Directories on host machine:
-
/data/certbot/letsencrypt -
/data/certbot/www -
Nginx server in docker container
docker run -d --name nginx \
| #{"rootDirectory":"","phpVersion":"8.3"} | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| listen 443 ssl http2; | |
| listen [::]:443 ssl http2; | |
| {{ssl_certificate_key}} | |
| {{ssl_certificate}} | |
| {{server_name}} | |
| {{root}} |
| Country | CountryCode | Currency | Code | |
|---|---|---|---|---|
| New Zealand | NZ | New Zealand Dollars | NZD | |
| Cook Islands | CK | New Zealand Dollars | NZD | |
| Niue | NU | New Zealand Dollars | NZD | |
| Pitcairn | PN | New Zealand Dollars | NZD | |
| Tokelau | TK | New Zealand Dollars | NZD | |
| Australian | AU | Australian Dollars | AUD | |
| Christmas Island | CX | Australian Dollars | AUD | |
| Cocos (Keeling) Islands | CC | Australian Dollars | AUD | |
| Heard and Mc Donald Islands | HM | Australian Dollars | AUD |
| # Author @Zubonick | |
| # Default log files, DB, archives, etc. | |
| *.log | |
| *.sql | |
| *.zip | |
| *.sqlite | |
| *.7z | |
| *.dmg | |
| *.gz |
| location ~* \.(jpe?g|png|gif|tif?f|bmp)$ { | |
| add_header Cache-Control max-age=31536000; | |
| add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
| access_log off; | |
| log_not_found off; | |
| expires max; | |
| if ($http_accept ~* "webp") { | |
| set $webp "accept"; | |
| } |
| <?php | |
| class ExportUser { | |
| public function __invoke() { | |
| $allUserByRole = count_users()['avail_roles']['subscriber']; | |
| $usersCSV = fopen( 'users_export.csv', 'w' ); | |
| for ( $i = 0; $i <= $allUserByRole; $i += 1000 ) { | |
| $user_query = new WP_User_Query( [ | |
| 'role' => 'Subscriber', |
| <?php | |
| // Add a custom coupon field before checkout payment section | |
| add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_coupon_form_custom' ); | |
| function woocommerce_checkout_coupon_form_custom() { | |
| ?> | |
| <div class="add_gift_card_form coupon-fictitious-form"> | |
| <h4>Have a coupon?</h4> | |
| <div id="wc_gc_cart_redeem_form"> | |
| <input placeholder="Coupon code" type="text" name="coupon_code" id="wc_gc_cart_code" autocomplete="off"> |
Directories on host machine:
/data/certbot/letsencrypt
/data/certbot/www
Nginx server in docker container
docker run -d --name nginx \
| add_action('wp_print_scripts', function (){ | |
| foreach ( get_intermediate_image_sizes() as $size ) { | |
| if ( !in_array( $size, array( 'thumbnail') ) ) { | |
| remove_image_size( $size ); | |
| } | |
| } | |
| if(isset($_GET['import_image']) && $_GET['import_image'] === 'yes'){ | |
| require_once ABSPATH . 'wp-admin/includes/media.php'; | |
| require_once ABSPATH . 'wp-admin/includes/file.php'; |
| function save_image($img,$path){ | |
| if (file_exists($path)){ | |
| return; | |
| } | |
| $curl = curl_init($img); | |
| curl_setopt($curl, CURLOPT_HEADER, 0); | |
| curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($curl, CURLOPT_BINARYTRANSFER,1); | |
| $content = curl_exec($curl); | |
| curl_close($curl); |
| <?php | |
| add_action('print_media_templates', function(){ | |
| // define your backbone template; | |
| // the "tmpl-" prefix is required, | |
| // and your input field should have a data-setting attribute | |
| // matching the shortcode name | |
| ?> | |
| <script type="text/html" id="tmpl-my-custom-gallery-setting"> | |
| <label class="setting"> |