From 6309a2c233e8d8218c0d02f95632409447b4d910 Mon Sep 17 00:00:00 2001 From: mo2menelzeiny Date: Sat, 26 Jun 2021 20:37:57 +0200 Subject: [PATCH 01/20] fix redirects coming from wp-cli --- PgCache_Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PgCache_Plugin.php b/PgCache_Plugin.php index 2c5887579..8e400ecb7 100644 --- a/PgCache_Plugin.php +++ b/PgCache_Plugin.php @@ -191,7 +191,7 @@ function cron_schedules( $schedules ) { public function redirect_on_foreign_domain() { $request_host = Util_Environment::host(); // host not known, potentially we are in console mode not http request - if ( empty( $request_host ) ) + if ( empty( $request_host ) || defined( 'WP_CLI' ) && WP_CLI ) return; $home_url = get_home_url(); From f26376e4d9c02bc2c08d9d63a147ce6baacd134c Mon Sep 17 00:00:00 2001 From: mo2menelzeiny Date: Sun, 27 Jun 2021 16:40:21 +0200 Subject: [PATCH 02/20] fixes missing whitespaces in memcached nginx config --- PgCache_Environment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PgCache_Environment.php b/PgCache_Environment.php index 012c8023c..52deeea13 100644 --- a/PgCache_Environment.php +++ b/PgCache_Environment.php @@ -1218,7 +1218,7 @@ private function for_nginx_memcached( $config, $cache_dir, $env_request_uri, $memcached_pass = !empty( $memcached_servers ) ? array_values( $memcached_servers )[0] : 'localhost:11211'; $rules .= ' if ($w3tc_rewrite = 1) {' . "\n"; - $rules .= ' memcached_pass' . $memcached_pass . ';' . "\n"; + $rules .= ' memcached_pass ' . $memcached_pass . ';' . "\n"; $rules .= " }\n"; $rules .= ' error_page 404 502 504 = @fallback;' . "\n"; $rules .= "}\n"; From 17464678f0f09c3596decb907006b5d250731534 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Mon, 28 Jun 2021 13:17:29 +0200 Subject: [PATCH 03/20] fix(cdn_test): send correct passive checkbox value Fixes #310. --- pub/js/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/js/options.js b/pub/js/options.js index 4c3a5eccc..db651b3c8 100644 --- a/pub/js/options.js +++ b/pub/js/options.js @@ -642,7 +642,7 @@ jQuery(function() { 'config[user]': jQuery('#cdn_ftp_user').val(), 'config[path]': jQuery('#cdn_ftp_path').val(), 'config[pass]': jQuery('#cdn_ftp_pass').val(), - 'config[pasv]': jQuery('#cdn_ftp_pasv:checked').length, + 'config[pasv]': jQuery('#cdn__ftp__pasv:checked').length, 'config[default_keys]': jQuery('#cdn__ftp__default_keys:checked').length, 'config[pubkey]': jQuery('#cdn_ftp_pubkey').val(), 'config[privkey]': jQuery('#cdn_ftp_privkey').val() From 73911133ca843de9c20086c73aa84b134f4f9bb4 Mon Sep 17 00:00:00 2001 From: Joe Cartonia Date: Fri, 9 Jul 2021 16:06:03 -0400 Subject: [PATCH 04/20] Bump Tested up to --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 9b671ea7f..8261dd425 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryjackson1221, joemoto Tags: seo, cache, optimize, pagespeed, performance, caching, compression, maxcdn, nginx, varnish, redis, new relic, aws, amazon web services, s3, cloudfront, rackspace, cloudflare, azure, apache Requires at least: 3.8 -Tested up to: 5.7 +Tested up to: 5.8 Stable tag: 2.1.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From 6d38a3b8953ed5d63fab8bad2edceff678c4458e Mon Sep 17 00:00:00 2001 From: "mshaposhnikov@w3-edge.com" Date: Tue, 13 Jul 2021 15:05:30 +0200 Subject: [PATCH 05/20] clarify in error log why some functionality doesnt behave as expected when server environment is broken --- Cdn_Plugin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cdn_Plugin.php b/Cdn_Plugin.php index 0e286e9f5..d1d401e42 100644 --- a/Cdn_Plugin.php +++ b/Cdn_Plugin.php @@ -967,8 +967,10 @@ private function minify_url_regexp( $filename_mask ) { Util_Environment::cache_blog_minify_dir() ); $matches = null; - if ( !preg_match( '~((https?://)?([^/]+))(.+)~i', $minify_base_url, $matches ) ) + if ( !preg_match( '~((https?://)?([^/]+))(.+)~i', $minify_base_url, $matches ) ) { + error_log( 'cant find minification base url, make sure minification folder sits inside WP_CONTENT_DIR and DOCUMENT_ROOT is set correctly' ); return ''; + } $protocol_domain_regexp = Util_Environment::get_url_regexp( $matches[1] ); $path_regexp = Util_Environment::preg_quote( $matches[4] ); From 2a9a95a4d9e9680603480f337f7ff20e0b1b503a Mon Sep 17 00:00:00 2001 From: "mshaposhnikov@w3-edge.com" Date: Tue, 13 Jul 2021 15:13:55 +0200 Subject: [PATCH 06/20] avoid side-effects warnings when primary signal is there --- Cdn_Plugin.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Cdn_Plugin.php b/Cdn_Plugin.php index d1d401e42..c90c75331 100644 --- a/Cdn_Plugin.php +++ b/Cdn_Plugin.php @@ -874,22 +874,24 @@ function replace_all_links( $buffer ) { if ( $this->_config->get_boolean( 'cdn.minify.enable' ) ) { if ( $this->_config->get_boolean( 'minify.auto' ) ) { - $regexp = '~(["\'(=])\s*' . - $this->minify_url_regexp( '/[a-zA-Z0-9-_]+\.(css|js)' ) . - '~U'; - if ( Cdn_Util::is_engine_mirror( $this->_config->get_string( 'cdn.engine' ) ) ) + $minify_url_regexp = $this->minify_url_regexp( '/[a-zA-Z0-9-_]+\.(css|js)' ); + + if ( Cdn_Util::is_engine_mirror( $this->_config->get_string( 'cdn.engine' ) ) ) { $processor = array( $this, '_link_replace_callback' ); - else + } else { $processor = array( $this, '_minify_auto_pushcdn_link_replace_callback' ); + } } else { - $regexp = '~(["\'(=])\s*' . - $this->minify_url_regexp( - '/[a-z0-9]+\..+\.include(-(footer|body))?(-nb)?\.[a-f0-9]+\.(css|js)' ) - .'~U'; + $minify_url_regexp = $this->minify_url_regexp( + '/[a-z0-9]+\..+\.include(-(footer|body))?(-nb)?\.[a-f0-9]+\.(css|js)' ); + $processor = array( $this, '_link_replace_callback' ); } - $buffer = preg_replace_callback( $regexp, $processor, $buffer ); + if ( !empty( $minify_url_regexp ) ) { + $regexp = '~(["\'(=])\s*' . $minify_url_regexp .'~U'; + $buffer = preg_replace_callback( $regexp, $processor, $buffer ); + } } $buffer = $this->replace_placeholders( $buffer ); From 63a5d51674d9fb18bf791131b7868f69afdf183b Mon Sep 17 00:00:00 2001 From: Jacob Emmert-Aronson Date: Sun, 25 Jul 2021 14:16:11 -0700 Subject: [PATCH 07/20] Allow use of default AWS credential provider Resolves #399 If the administrator doesn't configure AWS credentials, fall back to the default credential provider. This is especially useful when WordPress is running within EC2, as the default provider is compatible with the AWS best practice of manging applications' IAM permissions through instance profiles instead of hardcoded credentials. --- CdnEngine_CloudFront.php | 10 +++++++--- CdnEngine_Mirror_CloudFront.php | 10 +++++++--- CdnEngine_S3.php | 26 +++++++++++++++----------- Cdn_RackSpace_Api_Cdn.php | 2 +- Cdnfsd_CloudFront_Engine.php | 22 +++++++++++++++++----- Cdnfsd_CloudFront_Popup.php | 8 ++++++-- Enterprise_SnsBase.php | 18 ++++++++++++------ Extension_CloudFlare_Plugin.php | 2 +- Util_File.php | 2 +- 9 files changed, 67 insertions(+), 33 deletions(-) diff --git a/CdnEngine_CloudFront.php b/CdnEngine_CloudFront.php index d40631d61..6eeca8370 100644 --- a/CdnEngine_CloudFront.php +++ b/CdnEngine_CloudFront.php @@ -30,9 +30,13 @@ function _init() { return; } - $credentials = new \Aws\Credentials\Credentials( - $this->_config['key'], - $this->_config['secret'] ); + if ( empty( $this->_config['key'] ) && empty( $this->_config['secret'] ) ) { + $credentials = \Aws\Credentials\CredentialProvider::defaultProvider(); + } else { + $credentials = new \Aws\Credentials\Credentials( + $this->_config['key'], + $this->_config['secret'] ); + } $this->api = new \Aws\CloudFront\CloudFrontClient( array( 'credentials' => $credentials, diff --git a/CdnEngine_Mirror_CloudFront.php b/CdnEngine_Mirror_CloudFront.php index 06193bef8..f3fa3f277 100644 --- a/CdnEngine_Mirror_CloudFront.php +++ b/CdnEngine_Mirror_CloudFront.php @@ -29,9 +29,13 @@ function _init() { return; } - $credentials = new \Aws\Credentials\Credentials( - $this->_config['key'], - $this->_config['secret'] ); + if ( empty( $this->_config['key'] ) && empty( $this->_config['secret'] ) ) { + $credentials = \Aws\Credentials\CredentialProvider::defaultProvider(); + } else { + $credentials = new \Aws\Credentials\Credentials( + $this->_config['key'], + $this->_config['secret'] ); + } $this->api = new \Aws\CloudFront\CloudFrontClient( array( 'credentials' => $credentials, diff --git a/CdnEngine_S3.php b/CdnEngine_S3.php index aa215c021..2fb12fce6 100644 --- a/CdnEngine_S3.php +++ b/CdnEngine_S3.php @@ -88,21 +88,25 @@ public function _init() { return; } - if ( empty( $this->_config['key'] ) ) { - throw new \Exception( 'Empty access key.' ); - } - - if ( empty( $this->_config['secret'] ) ) { - throw new \Exception( 'Empty secret key.' ); - } - if ( empty( $this->_config['bucket'] ) ) { throw new \Exception( 'Empty bucket.' ); } - $credentials = new \Aws\Credentials\Credentials( - $this->_config['key'], - $this->_config['secret'] ); + if ( empty( $this->_config['key'] ) && empty( $this->_config['secret'] ) ) { + $credentials = \Aws\Credentials\CredentialProvider::defaultProvider(); + } else { + if ( empty( $this->_config['key'] ) ) { + throw new \Exception( 'Empty access key.' ); + } + + if ( empty( $this->_config['secret'] ) ) { + throw new \Exception( 'Empty secret key.' ); + } + + $credentials = new \Aws\Credentials\Credentials( + $this->_config['key'], + $this->_config['secret'] ); + } $this->api = new \Aws\S3\S3Client( array( 'credentials' => $credentials, diff --git a/Cdn_RackSpace_Api_Cdn.php b/Cdn_RackSpace_Api_Cdn.php index ca55586cb..3167ec53d 100644 --- a/Cdn_RackSpace_Api_Cdn.php +++ b/Cdn_RackSpace_Api_Cdn.php @@ -217,7 +217,7 @@ static private function _decode_response( $result ) { 'response_json' => array(), 'auth_required' => true ); - + // try to decode response $response_json = @json_decode( $result['body'], true ); if ( is_null( $response_json ) || diff --git a/Cdnfsd_CloudFront_Engine.php b/Cdnfsd_CloudFront_Engine.php index 13ac0527f..314f98c0e 100644 --- a/Cdnfsd_CloudFront_Engine.php +++ b/Cdnfsd_CloudFront_Engine.php @@ -72,12 +72,24 @@ public function flush_all() { private function _api() { - if ( empty( $this->access_key ) || empty( $this->secret_key ) || - empty( $this->distribution_id ) ) - throw new \Exception( __( 'Access key not specified.', 'w3-total-cache' ) ); + if ( empty( $this->distribution_id ) ) { + throw new \Exception( __('CloudFront distribution not specified.', 'w3-total-cache' ) ); + } + + if ( empty( $this->access_key ) && empty( $this->secret_key ) ) { + $credentials = \Aws\Credentials\CredentialProvider::defaultProvider(); + } else { + if ( empty( $this->access_key ) ) { + throw new \Exception( __( 'Access key not specified.', 'w3-total-cache' ) ); + } - $credentials = new \Aws\Credentials\Credentials( - $this->access_key, $this->secret_key ); + if ( empty( $this->secret_key ) ) { + throw new \Exception( __( 'Secret key not specified.', 'w3-total-cache' ) ); + } + + $credentials = new \Aws\Credentials\Credentials( + $this->access_key, $this->secret_key ); + } return new \Aws\CloudFront\CloudFrontClient( array( 'credentials' => $credentials, diff --git a/Cdnfsd_CloudFront_Popup.php b/Cdnfsd_CloudFront_Popup.php index 28f8cbfc4..6bef691b6 100644 --- a/Cdnfsd_CloudFront_Popup.php +++ b/Cdnfsd_CloudFront_Popup.php @@ -406,8 +406,12 @@ public function w3tc_ajax_cdn_cloudfront_fsd_configure_distribution_skip() { private function _api( $access_key, $secret_key ) { - $credentials = new \Aws\Credentials\Credentials( - $access_key, $secret_key ); + if ( empty( $access_key ) && empty( $secret_key ) ) { + $credentials = \Aws\Credentials\CredentialProvider::defaultProvider(); + } else { + $credentials = new \Aws\Credentials\Credentials( + $access_key, $secret_key ); + } return new \Aws\CloudFront\CloudFrontClient( array( 'credentials' => $credentials, diff --git a/Enterprise_SnsBase.php b/Enterprise_SnsBase.php index e40b9b5fb..96d61421a 100644 --- a/Enterprise_SnsBase.php +++ b/Enterprise_SnsBase.php @@ -34,14 +34,20 @@ function __construct() { */ protected function _get_api() { if ( is_null( $this->_api ) ) { - if ( $this->_api_key == '' ) - throw new \Exception( 'API Key is not configured' ); - if ( $this->_api_secret == '' ) - throw new \Exception( 'API Secret is not configured' ); + if ( empty( $this->_api_key ) && empty( $this->_api_secret ) ) { + $credentials = \Aws\Credentials\CredentialProvider::defaultProvider(); + } else { + if ( empty( $this->_api_key ) ) { + throw new \Exception( 'API Key is not configured' ); + } + if ( empty( $this->_api_secret ) ) { + throw new \Exception( 'API Secret is not configured' ); + } - $credentials = new \Aws\Credentials\Credentials( - $this->_api_key, $this->_api_secret ); + $credentials = new \Aws\Credentials\Credentials( + $this->_api_key, $this->_api_secret ); + } $this->_api = new \Aws\Sns\SnsClient( array( 'credentials' => $credentials, diff --git a/Extension_CloudFlare_Plugin.php b/Extension_CloudFlare_Plugin.php index 82a48e567..085bdfa3c 100644 --- a/Extension_CloudFlare_Plugin.php +++ b/Extension_CloudFlare_Plugin.php @@ -134,7 +134,7 @@ function set_comment_status( $id, $status ) { array( 'cloudflare', 'timelimit.api_request' ) ) ) ); - + try { $api->external_event( 'WP_SPAM', json_encode( $value ) ); } catch ( \Exception $ex ) { diff --git a/Util_File.php b/Util_File.php index 4c93b5685..190553975 100644 --- a/Util_File.php +++ b/Util_File.php @@ -335,7 +335,7 @@ static public function create_tmp_dir() { if ( !is_dir( W3TC_CACHE_TMP_DIR ) || !is_writable( W3TC_CACHE_TMP_DIR ) ) { $e = error_get_last(); $description = ( isset( $e['message'] ) ? $e['message'] : '' ); - + throw new \Exception( 'Can\'t create folder ' . W3TC_CACHE_TMP_DIR . ': ' . $description ); } From b1025a875f6defa1053da62c4d3a81421e3a837b Mon Sep 17 00:00:00 2001 From: Jacob Dunn Date: Thu, 29 Jul 2021 15:21:52 -0400 Subject: [PATCH 08/20] Fixed JS minify issue with template literal backticks --- lib/Minify/JSMin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Minify/JSMin.php b/lib/Minify/JSMin.php index 3673d0c00..82bb13818 100644 --- a/lib/Minify/JSMin.php +++ b/lib/Minify/JSMin.php @@ -207,7 +207,7 @@ protected function action($command) // fallthrough intentional case self::ACTION_DELETE_A: // 2 $this->a = $this->b; - if ($this->a === "'" || $this->a === '"') { // string literal + if ( in_array( $this->a, array( "'", '"', '`' ), true ) ) { $str = $this->a; // in case needed for exception for(;;) { $this->output .= $this->a; From 66d221c3bad7c26e88982c39035352dcb452eaa9 Mon Sep 17 00:00:00 2001 From: Max Shaposhnikov Date: Wed, 4 Aug 2021 19:51:17 +0200 Subject: [PATCH 09/20] WP 5.8 QA (#407) * add wp58 * set template * trusty EOL * last resort fallback * 7.3 also * nginx php56 --- qa/env/100-generate-envs | 47 ++++++++------- qa/env/scripts/init-image/150-mocha.sh | 12 ++-- qa/env/scripts/init-image/200-db.sh | 9 +++ qa/env/scripts/init-image/300-php.sh | 12 ++-- .../450-http-server-nginx-php-fpm.sh | 4 +- qa/env/scripts/restart-http.rb | 2 +- qa/lib/wp.js | 57 +++++++++++++------ 7 files changed, 87 insertions(+), 56 deletions(-) diff --git a/qa/env/100-generate-envs b/qa/env/100-generate-envs index 3f5f9cf6c..4e0a49b56 100755 --- a/qa/env/100-generate-envs +++ b/qa/env/100-generate-envs @@ -73,7 +73,7 @@ def generate_image_descriptors }, 'php73' => { 'PHP_VERSION' => '7.3', - 'OS' => 'xenial', + 'OS' => 'focal', 'APC' => 'apcu', # apcu doesnt modify php behaviour, can be by default 'MEMCACHE' => 'memcached', 'REDIS' => 'redis' @@ -89,7 +89,7 @@ def generate_image_descriptors # 'php56' => { 'PHP_VERSION' => '5.6', - 'OS' => 'xenial', + 'OS' => 'focal', 'APC' => 'apcu', # apcu doesnt modify php behaviour, can be by default 'MEMCACHE' => 'memcached', 'REDIS' => 'redis' @@ -209,16 +209,13 @@ def generate_box_descriptors(image_name) # ] #}, 'wp56' => { - 'WP_VERSION' => '5.6', - '_except_name_contains' => [ - 'php55' # wp5.6 requires php>=5.6 - ] + 'WP_VERSION' => '5.6' }, 'wp57' => { - 'WP_VERSION' => '5.7', - '_except_name_contains' => [ - 'php55' # wp5.7 requires php>=5.6 - ] + 'WP_VERSION' => '5.7' + }, + 'wp58' => { + 'WP_VERSION' => '5.8' } }, image_name) @@ -507,20 +504,6 @@ end # adds vagrant-provider's specific variables def expand_image_specifics(image_descriptors) vagrant_oses = { - 'trusty' => { - 'AWS_ZONE' => 'us-west-2', - 'AWS_AMI' => 'ami-064460a18d75afc81', - 'OS_VERSION' => 'Ubuntu 14.04 LTS 64Bit', - 'vagrant_box' => 'ubuntu/trusty64', - 'vagrant_box_version' => '20190429.0.0' - }, - 'xenial' => { - 'AWS_ZONE' => 'us-west-2', - 'AWS_AMI' => 'ami-0dd273d94ed0540c0', - 'OS_VERSION' => 'Ubuntu 16.04 LTS 64Bit', - 'vagrant_box' => 'ubuntu/xenial64', - 'vagrant_box_version' => '20210429.0.0' - }, 'focal' => { 'AWS_ZONE' => 'us-west-2', 'AWS_AMI' => 'ami-03d5c68bab01f3496', @@ -529,6 +512,22 @@ def expand_image_specifics(image_descriptors) 'vagrant_box_version' => '20210510.0.0' }, + # EOL - no PHP modules in Ondrey Sury ppa + #'trusty' => { + # 'AWS_ZONE' => 'us-west-2', + # 'AWS_AMI' => 'ami-064460a18d75afc81', + # 'OS_VERSION' => 'Ubuntu 14.04 LTS 64Bit', + # 'vagrant_box' => 'ubuntu/trusty64', + # 'vagrant_box_version' => '20190429.0.0' + #}, + # EOL - no PHP modules in Ondrey Sury ppa + #'xenial' => { + # 'AWS_ZONE' => 'us-west-2', + # 'AWS_AMI' => 'ami-0dd273d94ed0540c0', + # 'OS_VERSION' => 'Ubuntu 16.04 LTS 64Bit', + # 'vagrant_box' => 'ubuntu/xenial64', + # 'vagrant_box_version' => '20210429.0.0' + #}, # puppeteer not available for this version #'precise' => { # 'AWS_ZONE' => 'us-west-2', diff --git a/qa/env/scripts/init-image/150-mocha.sh b/qa/env/scripts/init-image/150-mocha.sh index 054d1494e..0d5e854e0 100755 --- a/qa/env/scripts/init-image/150-mocha.sh +++ b/qa/env/scripts/init-image/150-mocha.sh @@ -1,4 +1,4 @@ -curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - +curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs case "${W3D_OS}" in @@ -6,11 +6,11 @@ case "${W3D_OS}" in apt install -y libnss3-dev libnss3 libxss-dev apt install -y cups libasound-dev libpangocairo-1.0-0 libx11-xcb-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxi-dev libxtst-dev libxrandr-dev libgtk-3-0 ;; - "xenial") echo "Installing for xenial" - apt install -y libnss3-dev libnss3 libxss-dev - apt install -y cups libasound-dev libpangocairo-1.0-0 libx11-xcb-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxi-dev libxtst-dev libxrandr-dev libgtk-3-0 - ;; - *) + #"xenial") echo "Installing for xenial" + # apt install -y libnss3-dev libnss3 libxss-dev + # apt install -y cups libasound-dev libpangocairo-1.0-0 libx11-xcb-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxi-dev libxtst-dev libxrandr-dev libgtk-3-0 + # ;; + *) apt install -y libnss3-dev libXss-dev apt install -y libX11-xcb-dev cups libXcomposite-dev libXcursor-dev libXdamage-dev libXi-dev libXtst-dev libXrandr-dev libasound-dev libpangocairo-1.0-0 libgdk3.0-cil ;; diff --git a/qa/env/scripts/init-image/200-db.sh b/qa/env/scripts/init-image/200-db.sh index 176aa620f..d361b3a99 100755 --- a/qa/env/scripts/init-image/200-db.sh +++ b/qa/env/scripts/init-image/200-db.sh @@ -7,3 +7,12 @@ apt-get install memcached if [ "$W3D_REDIS" = "redis" ]; then apt-get install -q -y redis-server fi + +if [ "${W3D_PHP_VERSION}" == "5.6" ]; then + echo "default_authentication_plugin=mysql_native_password" >> /etc/mysql/mysql.conf.d/mysqld.cnf + service mysql restart +fi +if [ "${W3D_PHP_VERSION}" == "7.3" ]; then + echo "default_authentication_plugin=mysql_native_password" >> /etc/mysql/mysql.conf.d/mysqld.cnf + service mysql restart +fi diff --git a/qa/env/scripts/init-image/300-php.sh b/qa/env/scripts/init-image/300-php.sh index 945035bdd..3fcded445 100755 --- a/qa/env/scripts/init-image/300-php.sh +++ b/qa/env/scripts/init-image/300-php.sh @@ -47,12 +47,12 @@ export | grep LANG case "${W3D_PHP_VERSION}" in # php7.0-xml required by wordpress, fails otherwise on pings - "5.3") echo "Installing PHP 5.3" - php_5x - ;; - "5.5") echo "Installing PHP 5.5" - php_5x - ;; + #"5.3") echo "Installing PHP 5.3" + # php_5x + # ;; + #"5.5") echo "Installing PHP 5.5" + # php_5x + # ;; "5.6") echo "Installing PHP 5.6" add-apt-repository -y ppa:ondrej/php apt-get update diff --git a/qa/env/scripts/init-image/450-http-server-nginx-php-fpm.sh b/qa/env/scripts/init-image/450-http-server-nginx-php-fpm.sh index 320e8b88a..3784f5bf4 100755 --- a/qa/env/scripts/init-image/450-http-server-nginx-php-fpm.sh +++ b/qa/env/scripts/init-image/450-http-server-nginx-php-fpm.sh @@ -11,9 +11,9 @@ case "${W3D_PHP_VERSION}" in service php5-fpm restart ;; "5.6") - apt-get install -y php5-fpm + apt-get install -y php5.6-fpm cp -f /share/scripts/init-image/templates/php-fpm-pool-www.conf /etc/php5/fpm/pool.d/www.conf - service php5-fpm restart + service php5.6-fpm restart ;; "7.0") apt-get install -y php7.0-fpm diff --git a/qa/env/scripts/restart-http.rb b/qa/env/scripts/restart-http.rb index c0a3c8ae1..ebd0dabd6 100755 --- a/qa/env/scripts/restart-http.rb +++ b/qa/env/scripts/restart-http.rb @@ -28,7 +28,7 @@ def run elsif ENV['W3D_PHP_VERSION'] == '8.0' system_assert 'service php8.0-fpm restart' else - system_assert 'service php5-fpm restart' + system_assert 'service php5.6-fpm restart' end n = 0 diff --git a/qa/lib/wp.js b/qa/lib/wp.js index d5dbddab0..a7d4c799d 100644 --- a/qa/lib/wp.js +++ b/qa/lib/wp.js @@ -259,28 +259,51 @@ async function postCreateWP5(pPage, data) { if (data.template) { log.log('create page - set template (' + data.template + ')') - let templateControlId = await pPage.evaluate(() => { - let elements = document.getElementsByClassName('components-panel__body-toggle'); - for (let element of elements) { - element.click(); - } + let templateControlId; + if (parseFloat(env.wpVersion) < 5.8) { + templateControlId = await pPage.evaluate(() => { + let elements = document.getElementsByClassName('components-panel__body-toggle'); + for (let element of elements) { + element.click(); + } - let labels = document.querySelectorAll('label.components-base-control__label'); - for (let element of labels) { - if (element.innerHTML == 'Template:') { - return element.getAttribute('for'); + let labels = document.querySelectorAll('label.components-base-control__label'); + for (let element of labels) { + if (element.innerHTML == 'Template:') { + return element.getAttribute('for'); + } } - } - labels = document.querySelectorAll('label.components-input-control__label'); - for (let element of labels) { - if (element.innerHTML == 'Template:') { - return element.getAttribute('for'); + labels = document.querySelectorAll('label.components-input-control__label'); + for (let element of labels) { + if (element.innerHTML == 'Template:') { + return element.getAttribute('for'); + } } - } - return x; - }); + let dropdowns = document.querySelectorAll('.components-select-control__input'); + for (let dropdown of dropdowns) { + if (dropdown.outerHTML.indexOf('>Default template<') > 0) { + return dropdown.id; + } + } + + return x1; // fail here means something wrong with DOM structure + }); + } else { + templateControlId = await pPage.evaluate(() => { + let elements = document.getElementsByClassName('components-panel__body-toggle'); + for (let element of elements) { + if (element.innerText.indexOf("Template") >= 0) { + element.click(); + let block = element.closest('.components-panel__body'); + return block.querySelector('select').getAttribute('id'); + } + } + + return x2; + }); + } console.log(templateControlId); expect(templateControlId).not.empty; From 4644db6ecc68eb5c5e17fe39d2a1dc13037ab000 Mon Sep 17 00:00:00 2001 From: Marko Vasiljevic <40050744+mavas84@users.noreply.github.com> Date: Wed, 4 Aug 2021 23:03:39 +0200 Subject: [PATCH 10/20] Added missing text domains, translations and corrected acronyms (#406) --- Extension_FragmentCache_GeneralPage_View.php | 2 +- Generic_WidgetSpreadTheWord_View.php | 4 ++-- UsageStatistics_GeneralPage_View.php | 15 ++++++--------- UsageStatistics_Page_View_Ad.php | 10 +++++----- UserExperience_LazyLoad_Page_View.php | 4 ++-- inc/options/about.php | 13 +++++++++++-- inc/options/browsercache.php | 2 +- inc/options/dashboard.php | 4 ++-- inc/options/general.php | 6 +++--- inc/options/minify.php | 14 +++++++++----- inc/options/minify/css.php | 2 +- inc/options/objectcache.php | 4 ++-- 12 files changed, 45 insertions(+), 35 deletions(-) diff --git a/Extension_FragmentCache_GeneralPage_View.php b/Extension_FragmentCache_GeneralPage_View.php index c293939bf..9ad467095 100644 --- a/Extension_FragmentCache_GeneralPage_View.php +++ b/Extension_FragmentCache_GeneralPage_View.php @@ -6,7 +6,7 @@ Util_Ui::postbox_header( 'Fragment Cache', '', 'fragmentcache' ); ?> -

Enable fragment caching reduce execution time for common operations.

+

  • - +

- Or please share + your feedback so that we can improve!

diff --git a/UsageStatistics_GeneralPage_View.php b/UsageStatistics_GeneralPage_View.php index e2dfad294..69997ba85 100644 --- a/UsageStatistics_GeneralPage_View.php +++ b/UsageStatistics_GeneralPage_View.php @@ -15,7 +15,7 @@ 'stats.enabled', - 'label' => esc_html__( 'Cache usage statistics' ), + 'label' => esc_html__( 'Cache usage statistics', 'w3-total-cache' ), 'control' => 'checkbox', 'checkbox_label' => __( 'Enable', 'w3-total-cache' ), 'disabled' => ( $is_pro ? null : true ), @@ -40,8 +40,7 @@ 'label' => __( 'Slot time (seconds):', 'w3-total-cache' ), 'control' => 'textbox', 'textbox_type' => 'number', - 'description' => - 'The duration of time in seconds to collect statistics per interval.', + 'description' => __( 'The duration of time in seconds to collect statistics per interval.', 'w3-total-cache' ), 'show_in_free' => false, ) ); Util_Ui::config_item( array( @@ -49,8 +48,7 @@ 'label' => __( 'Slots collected:', 'w3-total-cache' ), 'control' => 'textbox', 'textbox_type' => 'number', - 'description' => - 'The number of intervals that are represented in the graph.', + 'description' => __( 'The number of intervals that are represented in the graph.', 'w3-total-cache' ), 'show_in_free' => false, ) ); @@ -77,7 +75,7 @@ 'apache' => 'Apache', 'nginx' => 'Nginx' ), - 'description' => 'Webserver type generating access logs.', + 'description' => __( 'Webserver type generating access logs.' ,'w3-total-cache' ), 'show_in_free' => false, ) ); Util_Ui::config_item( array( @@ -85,7 +83,7 @@ 'label' => __( 'Access Log Filename:', 'w3-total-cache' ), 'control' => 'textbox', 'textbox_size' => 60, - 'description' => 'Where your access log is located.', + 'description' => __( 'Where your access log is located.', 'w3-total-cache' ), 'control_after' => '', 'show_in_free' => false, @@ -95,8 +93,7 @@ 'label' => __( 'Access Log Format:', 'w3-total-cache' ), 'control' => 'textbox', 'textbox_size' => 60, - 'description' => - 'Format of your access log from webserver configuration.', + 'description' => __( 'Format of your access log from webserver configuration.', 'w3-total-cache' ), 'control_after' => '', 'show_in_free' => false, diff --git a/UsageStatistics_Page_View_Ad.php b/UsageStatistics_Page_View_Ad.php index 86c225c64..5aa66d4d8 100644 --- a/UsageStatistics_Page_View_Ad.php +++ b/UsageStatistics_Page_View_Ad.php @@ -1,11 +1,11 @@

- Users who upgrade to W3 Total Cache Pro will have access to the new +

    -
  • View detailed information about your site’s performance
  • -
  • Visualize your performance over time with graphs
  • -
  • Examine the overall performance of caching method backends
  • +
  • +
  • +
diff --git a/UserExperience_LazyLoad_Page_View.php b/UserExperience_LazyLoad_Page_View.php index 5ad26edec..69a1864ca 100644 --- a/UserExperience_LazyLoad_Page_View.php +++ b/UserExperience_LazyLoad_Page_View.php @@ -49,7 +49,7 @@ 'sync_head' => 'sync (to head)', 'inline_footer' => 'inline' ), - 'description' => 'Use inline method only when your website has just a few pages' + 'description' => __( 'Use inline method only when your website has just a few pages', 'w3-total-cache' ), ) ); @@ -60,7 +60,7 @@ diff --git a/inc/options/dashboard.php b/inc/options/dashboard.php index 0fbe4923a..e9465f97e 100644 --- a/inc/options/dashboard.php +++ b/inc/options/dashboard.php @@ -31,7 +31,7 @@

- Perform a + , disabled="disabled" /> @@ -55,7 +55,7 @@

-

Thanks for choosing W3TC as your Web Performance Optimization (WPO) framework! +

WPO) framework!', 'w3-total-cache' ); ?>

id, 'normal', '' ); ?> diff --git a/inc/options/general.php b/inc/options/general.php index 0e8e9d214..d68a9125b 100644 --- a/inc/options/general.php +++ b/inc/options/general.php @@ -17,7 +17,7 @@
Google Maps -

Lazy load google map

+

-

memcached and/or opcode caching and the CDN of your choosing to provide the following features and benefits:' ) ?>

- +

+ memcached', + 'CDN' + ); + ?> +

  • diff --git a/inc/options/browsercache.php b/inc/options/browsercache.php index 04d9c303f..da887e18e 100644 --- a/inc/options/browsercache.php +++ b/inc/options/browsercache.php @@ -119,7 +119,7 @@ -

    +

- +
Preview mode: _config->is_preview() ): ?> @@ -127,7 +127,7 @@ ) ); ?>

CSS and JS files. Automatically remove unnecessary data from CSS, JS, feed, page and post HTML.' ) ?>

- +

- Allows policy management to be shared between a dynamic pool of servers. For example, each server in a pool to use opcode caching (which is not a shared resource) and purging is then syncronized between any number of servers in real-time; each server therefore behaves identically even though resources are not shared. +

diff --git a/inc/options/minify.php b/inc/options/minify.php index 99b01ca2e..c34cecfce 100644 --- a/inc/options/minify.php +++ b/inc/options/minify.php @@ -136,7 +136,11 @@ 'minify.js.enable', - 'label' => 'JS minify settings:', + 'label' => sprintf( + // translators: 1: JS acronym open tag, 2: JS acronym and close tag + __( '%1$sJavaScript%2$s minify settings:', 'w3-total-cache' ), + 'JS' ), 'control' => 'checkbox', 'checkbox_label' => __( 'Enable', 'w3-total-cache' ) ) ); @@ -145,7 +149,7 @@ if ( $auto ): Util_Ui::config_item( array( 'key' => 'minify.js.method', - 'label' => 'Minify method:', + 'label' => __( 'Minify method:', 'w3-total-cache' ), 'control' => 'selectbox', 'selectbox_values' => array( 'both' => array( @@ -339,7 +343,7 @@ 'label' => 'HTTP/2 push', 'control' => 'checkbox', 'checkbox_label' => __( 'Enable', 'w3-total-cache' ), - 'description' => __( 'For better performance, send files to browser before they are requested when using the HTTP/2 protocol.', + 'description' => __( 'For better performance, send files to browser before they are requested when using the HTTP/2 protocol.', 'w3-total-cache' ) . ( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' ? '' : __( '
Not supported by "Disk: Enhanced" page cache method for Nginx', 'w3-total-cache' ) ) @@ -354,7 +358,7 @@ 'minify.css.enable', - 'label' => 'CSS minify settings:', + 'label' => __( 'CSS minify settings:', 'w3-total-cache' ), 'control' => 'checkbox', 'checkbox_label' => __( 'Enable', 'w3-total-cache' ) ) ); @@ -488,7 +492,7 @@ 'label' => 'HTTP/2 push', 'control' => 'checkbox', 'checkbox_label' => __( 'Enable', 'w3-total-cache' ), - 'description' => __( 'For better performance, send files to browser before they are requested when using the HTTP/2 protocol.', + 'description' => __( 'For better performance, send files to browser before they are requested when using the HTTP/2 protocol.', 'w3-total-cache' ) . ( $this->_config->get_string( 'pgcache.engine' ) != 'file_generic' ? '' : __( '
Not supported by "Disk: Enhanced" page cache method for Nginx', 'w3-total-cache' ) ) diff --git a/inc/options/minify/css.php b/inc/options/minify/css.php index 4ef5fb449..ebe660080 100644 --- a/inc/options/minify/css.php +++ b/inc/options/minify/css.php @@ -14,7 +14,7 @@ Util_Ui::config_item_pro( array( 'key' => 'minify.css.embed', 'control' => 'checkbox', - 'checkbox_label' => __( 'Eliminate render-blocking CSS by moving it to HTTP body', 'w3-total-cache' ), + 'checkbox_label' => __( 'Eliminate render-blocking CSS by moving it to HTTP body', 'w3-total-cache' ), 'disabled' => ( $is_pro ? null : true ), 'label_class' => 'w3tc_no_trtd', 'excerpt' => __( 'Website visitors cannot navigate your website until a given page is ready - reduce the wait time with this feature.', 'w3-total-cache' ), diff --git a/inc/options/objectcache.php b/inc/options/objectcache.php index 199414fbb..be3b0f0bd 100644 --- a/inc/options/objectcache.php +++ b/inc/options/objectcache.php @@ -72,13 +72,13 @@ From c3cbf0863c9eca54f2780da842e0290a7ceea12c Mon Sep 17 00:00:00 2001 From: Joe C Date: Thu, 5 Aug 2021 13:02:41 -0400 Subject: [PATCH 11/20] Bump version to 2.1.6 --- readme.txt | 14 ++++++++++++-- w3-total-cache-api.php | 2 +- w3-total-cache.php | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/readme.txt b/readme.txt index 8261dd425..6211560d8 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ === Plugin Name === -Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryjackson1221, joemoto +Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryjackson1221, joemoto, vmarko, jacobd91 Tags: seo, cache, optimize, pagespeed, performance, caching, compression, maxcdn, nginx, varnish, redis, new relic, aws, amazon web services, s3, cloudfront, rackspace, cloudflare, azure, apache Requires at least: 3.8 Tested up to: 5.8 -Stable tag: 2.1.5 +Stable tag: 2.1.6 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -275,6 +275,16 @@ Please reach out to all of these people and support their projects if you're so == Changelog == += 2.1.6 = +* Fix: JS minify issue with template literal backticks +* Fix: Do not redirect when using WP-CLI +* Fix: Missing whitespace in Memcached Nginx configuration +* Fix: Setting for CDN over passive FTP +* Fix: Updated CDN Minify regex +* Fix: Added missing text domains and fixed translations +* Enhancement: Allow default AWS credentials provider +* Enhancement: Added error logging when minification base URL is not found + = 2.1.5 = * Fix: Sanitize extension argument diff --git a/w3-total-cache-api.php b/w3-total-cache-api.php index 6290f9525..9f4ce81f9 100644 --- a/w3-total-cache-api.php +++ b/w3-total-cache-api.php @@ -5,7 +5,7 @@ } define( 'W3TC', true ); -define( 'W3TC_VERSION', '2.1.5' ); +define( 'W3TC_VERSION', '2.1.6' ); define( 'W3TC_POWERED_BY', 'W3 Total Cache' ); define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' ); define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' ); diff --git a/w3-total-cache.php b/w3-total-cache.php index 5370eb55e..206e6698f 100644 --- a/w3-total-cache.php +++ b/w3-total-cache.php @@ -3,7 +3,7 @@ * Plugin Name: W3 Total Cache * Plugin URI: https://www.boldgrid.com/totalcache/ * Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress. - * Version: 2.1.5 + * Version: 2.1.6 * Requires at least: 3.8 * Requires PHP: 5.6 * Author: BoldGrid From c26a6db913a60760dd58cb17da83b233150b9712 Mon Sep 17 00:00:00 2001 From: Jacob Dunn Date: Thu, 5 Aug 2021 13:33:56 -0400 Subject: [PATCH 12/20] YUI Composer PHP relative file path fix --- lib/YuiCssMin/Minifier.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/YuiCssMin/Minifier.php b/lib/YuiCssMin/Minifier.php index c8982f207..6d9254d58 100644 --- a/lib/YuiCssMin/Minifier.php +++ b/lib/YuiCssMin/Minifier.php @@ -64,6 +64,9 @@ class Minifier public static function minify_static($css, $options = array()) { $m = new Minifier(); + + $css = \W3TCL\Minify\Minify_CSS_UriRewriter::rewrite($css, $options); + return $m->run($css); } From a510a6e6ed6ffdd0f0711173a217a92d41ec674d Mon Sep 17 00:00:00 2001 From: Jacob Dunn Date: Thu, 5 Aug 2021 16:38:29 -0400 Subject: [PATCH 13/20] Fixed responsive display issue with columns within the perfomance main dashboard --- Generic_Page_Dashboard_View.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Generic_Page_Dashboard_View.css b/Generic_Page_Dashboard_View.css index 2cec49fd3..c74ee6808 100644 --- a/Generic_Page_Dashboard_View.css +++ b/Generic_Page_Dashboard_View.css @@ -126,6 +126,7 @@ } #w3tc-dashboard-widgets { min-width: auto; + flex-wrap: wrap; } #postbox-container-right { width: 100%; @@ -139,6 +140,13 @@ #w3tc-dashboard-widgets #normal-sortables .postbox { width: 100%; } + #w3tc-dashboard-widgets #side-sortables .postbox .postbox-header .w3tc-widget-text { + float: none; + } + #w3tc-dashboard-widgets #side-sortables .postbox .postbox-header, + #w3tc-dashboard-widgets #side-sortables .postbox .inside { + text-align: center; + } .w3tc_generic_widgetservice_label { display: inline; } From db158b4caff5b0ded6ee8318e2bf22b26aa45f11 Mon Sep 17 00:00:00 2001 From: "mshaposhnikov@w3-edge.com" Date: Wed, 11 Aug 2021 10:05:54 +0200 Subject: [PATCH 14/20] lazyloading threshold option, fixes #86 --- ConfigKeys.php | 4 ++++ UserExperience_LazyLoad_Page_View.php | 8 ++++++++ UserExperience_LazyLoad_Plugin.php | 9 ++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ConfigKeys.php b/ConfigKeys.php index 7e8af80c6..724ba8175 100644 --- a/ConfigKeys.php +++ b/ConfigKeys.php @@ -170,6 +170,10 @@ 'type' => 'boolean', 'default' => false ), + 'lazyload.threshold' => array( + 'type' => 'string', + 'default' => '' + ), 'lazyload.process_img' => array( 'type' => 'boolean', 'default' => true diff --git a/UserExperience_LazyLoad_Page_View.php b/UserExperience_LazyLoad_Page_View.php index 69a1864ca..0c5dfd7c8 100644 --- a/UserExperience_LazyLoad_Page_View.php +++ b/UserExperience_LazyLoad_Page_View.php @@ -40,6 +40,14 @@ 'w3-total-cache' ) ) ); + Util_Ui::config_item( array( + 'key' => 'lazyload.threshold', + 'control' => 'textbox', + 'label' => __( 'Threshold', 'w3-total-cache' ), + 'description' => __( 'The outer distance off the scrolling area from which to start loading the elements (example: 100px, 10%).', + 'w3-total-cache' ) + ) ); + Util_Ui::config_item( array( 'key' => 'lazyload.embed_method', 'label' => __( 'Script Embed method:', 'w3-total-cache' ), diff --git a/UserExperience_LazyLoad_Plugin.php b/UserExperience_LazyLoad_Plugin.php index 07a053190..21cb4eaa4 100644 --- a/UserExperience_LazyLoad_Plugin.php +++ b/UserExperience_LazyLoad_Plugin.php @@ -131,7 +131,14 @@ private function embed_script( $buffer ) { $method = $this->config->get_string( 'lazyload.embed_method' ); $fireEvent = 'function(t){var e;try{e=new CustomEvent("w3tc_lazyload_loaded",{detail:{e:t}})}catch(a){(e=document.createEvent("CustomEvent")).initCustomEvent("w3tc_lazyload_loaded",!1,!1,{e:t})}window.dispatchEvent(e)}'; - $config = '{elements_selector:".lazy",callback_loaded:' . $fireEvent . '}'; + + $thresholds = ''; + $config_threshold = $this->config->get_string( 'lazyload.threshold' ); + if ( !empty( $config_threshold ) ) { + $thresholds = 'thresholds:' . json_encode( $config_threshold ) . ','; + } + + $config = '{elements_selector:".lazy",' . $thresholds . 'callback_loaded:' . $fireEvent . '}'; $on_initialized_javascript = apply_filters( 'w3tc_lazyload_on_initialized_javascript', '' ); From 92cf2e0e4e62f7fd977c6c4b1067dc48e1865331 Mon Sep 17 00:00:00 2001 From: Jacob Dunn <88040916+jacobd91@users.noreply.github.com> Date: Fri, 13 Aug 2021 16:28:34 -0400 Subject: [PATCH 15/20] Modify robots.txt to prevent crawling of cache directory #147 (#413) * added disallow * for /wp-content/cache/ in robots.txt --- Generic_Environment.php | 57 +++++++++++++++++++++++++++++++++++++++++ Util_Rule.php | 18 ++++++++++++- w3-total-cache-api.php | 2 ++ 3 files changed, 76 insertions(+), 1 deletion(-) diff --git a/Generic_Environment.php b/Generic_Environment.php index 9822452be..ee89921eb 100644 --- a/Generic_Environment.php +++ b/Generic_Environment.php @@ -16,6 +16,7 @@ function fix_on_wpadmin_request( $config, $force_all_checks ) { $exs = new Util_Environment_Exceptions(); // create add-ins $this->create_required_files( $config, $exs ); + $this->robots_rules_add( $config, $exs ); // create folders $this->create_required_folders( $exs ); @@ -58,6 +59,7 @@ public function fix_after_deactivation() { $exs = new Util_Environment_Exceptions(); $this->delete_required_files( $exs ); + $this->robots_rules_remove( $exs ); if ( count( $exs->exceptions() ) > 0 ) throw $exs; @@ -207,4 +209,59 @@ public function is_advanced_cache_add_in() { return ( ( $script_data = @file_get_contents( W3TC_ADDIN_FILE_ADVANCED_CACHE ) ) && strstr( $script_data, 'PgCache_ContentGrabber' ) !== false ); } + + /** + * Write robots.txt directives to prevent crawl of cache directory. + * + * @since 2.1.7 + * + * @param Config $config Configuration. + * @param Util_Environment_Exceptions $exs Exceptions. + * + * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials. + */ + private function robots_rules_add( $config, $exs ) { + Util_Rule::add_rules( + $exs, + Util_Rule::get_robots_rules_path(), + $this->robots_rules_generate(), + W3TC_MARKER_BEGIN_ROBOTS, + W3TC_MARKER_END_ROBOTS, + array() + ); + } + + /** + * Generate robots.txt directives. + * + * @since 2.1.7 + * + * @return string + */ + private function robots_rules_generate() { + return ' +# BEGIN W3TC ROBOTS +User-agent: * +Disallow: /wp-content/cache/ +# END W3TC ROBOTS +'; + } + + /** + * Removes robots.txt directives. + * + * @since 2.1.7 + * + * @param Util_Environment_Exceptions $exs Exceptions. + * + * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials. + */ + private function robots_rules_remove( $exs ) { + Util_Rule::remove_rules( + $exs, + Util_Environment::site_path() . 'robots.txt', + W3TC_MARKER_BEGIN_ROBOTS, + W3TC_MARKER_END_ROBOTS + ); + } } diff --git a/Util_Rule.php b/Util_Rule.php index 9094b603c..abf8f558a 100644 --- a/Util_Rule.php +++ b/Util_Rule.php @@ -135,12 +135,28 @@ static public function get_cdn_rules_path() { return false; } + /** + * Returns path of pagecache core rules file for new relic. + * + * @return string + */ static public function get_new_relic_rules_core_path() { return Util_Rule::get_pgcache_rules_core_path(); } /** - * Returns true if we can modify rules + * Returns path of robots.txt. + * + * @since 2.1.7 + * + * @return string + */ + static public function get_robots_rules_path() { + return Util_Environment::site_path() . 'robots.txt'; + } + + /** + * Returns true if we can modify rules. * * @param string $path * @return boolean diff --git a/w3-total-cache-api.php b/w3-total-cache-api.php index 9f4ce81f9..2512fe901 100644 --- a/w3-total-cache-api.php +++ b/w3-total-cache-api.php @@ -104,6 +104,7 @@ define( 'W3TC_MARKER_BEGIN_MINIFY_CACHE', '# BEGIN W3TC Minify cache' ); define( 'W3TC_MARKER_BEGIN_MINIFY_LEGACY', '# BEGIN W3TC Minify' ); define( 'W3TC_MARKER_BEGIN_CDN', '# BEGIN W3TC CDN' ); +define( 'W3TC_MARKER_BEGIN_ROBOTS', '# BEGIN W3TC ROBOTS' ); define( 'W3TC_MARKER_END_WORDPRESS', '# END WordPress' ); @@ -118,6 +119,7 @@ define( 'W3TC_MARKER_END_MINIFY_LEGACY', '# END W3TC Minify' ); define( 'W3TC_MARKER_END_CDN', '# END W3TC CDN' ); define( 'W3TC_MARKER_END_NEW_RELIC_CORE', '# END W3TC New Relic core' ); +define( 'W3TC_MARKER_END_ROBOTS', '# END W3TC ROBOTS' ); if ( !defined( 'W3TC_EXTENSION_DIR' ) ) { From d4c499acee517dc951dda093cc6cb99c547ff130 Mon Sep 17 00:00:00 2001 From: Jacob Dunn <88040916+jacobd91@users.noreply.github.com> Date: Mon, 16 Aug 2021 14:42:58 -0400 Subject: [PATCH 16/20] Support Feature Policy Security Header #13 (#414) * added missing feature policy options and updated a few existing * Updated placeholders for feature policy fields --- BrowserCache_Page_View_SectionSecurity.php | 90 +++++++++++++++------- 1 file changed, 61 insertions(+), 29 deletions(-) diff --git a/BrowserCache_Page_View_SectionSecurity.php b/BrowserCache_Page_View_SectionSecurity.php index d2fd19dac..f2ad31f54 100644 --- a/BrowserCache_Page_View_SectionSecurity.php +++ b/BrowserCache_Page_View_SectionSecurity.php @@ -19,111 +19,143 @@ $feature_policies = array( array( 'label' => 'accelerometer', - 'description' => __( 'controls whether the current document is allowed to gather information about the acceleration of the device through the Accelerometer interface', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to gather information about the acceleration of the device through the Accelerometer interface.', 'w3-total-cache' ), ), array( 'label' => 'ambient-light-sensor', - 'description' => __( 'controls whether the current document is allowed to gather information about the amount of light in the environment around the device through the AmbientLightSensor interface', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to gather information about the amount of light in the environment around the device through the AmbientLightSensor interface.', 'w3-total-cache' ), ), array( 'label' => 'autoplay', - 'description' => __( 'controls whether the current document is allowed to autoplay media requested through the HTMLMediaElement interface', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to autoplay media requested through the HTMLMediaElement interface.', 'w3-total-cache' ), + ), + array( + 'label' => 'battery', + 'description' => __( 'Controls whether the use of the Battery Status API is allowed. When this policy is disabled, the Promise returned by Navigator.getBattery() will reject with a NotAllowedError DOMException.', 'w3-total-cache' ), ), array( 'label' => 'camera', - 'description' => __( 'controls whether the current document is allowed to use video input devices', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use video input devices.', 'w3-total-cache' ), ), array( 'label' => 'display-capture', - 'description' => __( 'controls whether or not the document is permitted to use Screen Capture API', 'w3-total-cache' ), + 'description' => __( 'Controls whether or not the document is permitted to use Screen Capture API.', 'w3-total-cache' ), ), array( 'label' => 'document-domain', - 'description' => __( 'controls whether the current document is allowed to set document.domain', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to set document.domain.', 'w3-total-cache' ), ), array( 'label' => 'encrypted-media', - 'description' => __( 'controls whether the current document is allowed to use the Encrypted Media Extensions API (EME)', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use the Encrypted Media Extensions API (EME).', 'w3-total-cache' ), + ), + array( + 'label' => 'execution-while-not-rendered', + 'description' => __( 'Controls whether tasks should execute in frames while they\'re not being rendered (e.g. if an iframe is hidden or display: none).', 'w3-total-cache' ), + ), + array( + 'label' => 'execution-while-out-of-viewport', + 'description' => __( 'Controls whether tasks should execute in frames while they\'re outside of the visible viewport.', 'w3-total-cache' ), ), array( 'label' => 'fullscreen', - 'description' => __( 'controls whether the current document is allowed to use Element.requestFullScreen()', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use Element.requestFullScreen().', 'w3-total-cache' ), + ), + array( + 'label' => 'gamepad', + 'description' => __( 'Controls whether the current document is allowed to use the Gamepad API. When this policy is disabled, calls to Navigator.getGamepads() will throw a SecurityError DOMException, and the gamepadconnected and gamepaddisconnected events will not fire.', 'w3-total-cache' ), ), array( 'label' => 'geolocation', - 'description' => __( 'controls whether the current document is allowed to use the Geolocation Interface', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use the Geolocation Interface.', 'w3-total-cache' ), ), array( 'label' => 'gyroscope', - 'description' => __( 'controls whether the current document is allowed to gather information about the orientation of the device through the Gyroscope interface', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to gather information about the orientation of the device through the Gyroscope interface.', 'w3-total-cache' ), ), array( 'label' => 'layout-animations', - 'description' => __( 'controls whether the current document is allowed to show layout animations', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to show layout animations.', 'w3-total-cache' ), ), array( 'label' => 'legacy-image-formats', - 'description' => __( 'controls whether the current document is allowed to display images in legacy formats', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to display images in legacy formats.', 'w3-total-cache' ), ), array( 'label' => 'magnetometer', - 'description' => __( 'controls whether the current document is allowed to gather information about the orientation of the device through the Magnetometer interface', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to gather information about the orientation of the device through the Magnetometer interface.', 'w3-total-cache' ), ), array( 'label' => 'microphone', - 'description' => __( 'controls whether the current document is allowed to use audio input devices', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use audio input devices.', 'w3-total-cache' ), ), array( 'label' => 'midi', - 'description' => __( 'controls whether the current document is allowed to use the Web MIDI API', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use the Web MIDI API.', 'w3-total-cache' ), + ), + array( + 'label' => 'navigation-override', + 'description' => __( 'Controls the availability of mechanisms that enables the page author to take control over the behavior of spatial navigation, or to cancel it outright.', 'w3-total-cache' ), ), array( 'label' => 'oversized-images', - 'description' => __( 'controls whether the current document is allowed to download and display large images', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to download and display large images.', 'w3-total-cache' ), ), array( 'label' => 'payment', - 'description' => __( 'controls whether the current document is allowed to use the Payment Request API', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use the Payment Request API.', 'w3-total-cache' ), ), array( 'label' => 'picture-in-picture', - 'description' => __( 'controls whether the current document is allowed to play a video in a Picture-in-Picture mode via the corresponding API', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to play a video in a Picture-in-Picture mode via the corresponding API.', 'w3-total-cache' ), + ), + array( + 'label' => 'publickey-credentials-get', + 'description' => __( 'Controls whether the current document is allowed to use the Web Authentication API to retrieve already stored public-key credentials, i.e. via navigator.credentials.get({publicKey: ..., ...}).', 'w3-total-cache' ), ), array( - 'label' => 'publickey-credentials', - 'description' => __( 'controls whether the current document is allowed to access Web Authentcation API', 'w3-total-cache' ), + 'label' => 'screen-wake-lock', + 'description' => __( 'Controls whether the current document is allowed to use Screen Wake Lock API to indicate that device should not turn off or dim the screen.', 'w3-total-cache' ), ), array( 'label' => 'speaker', - 'description' => __( 'controls whether the current document is allowed to play audio via any methods', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to play audio via any methods.', 'w3-total-cache' ), ), array( 'label' => 'sync-xhr', - 'description' => __( 'controls whether the current document is allowed to make synchronous XMLHttpRequest requests', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to make synchronous XMLHttpRequest requests.', 'w3-total-cache' ), ), array( 'label' => 'unoptimized-images', - 'description' => __( 'controls whether the current document is allowed to download and display unoptimized images', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to download and display unoptimized images.', 'w3-total-cache' ), ), array( 'label' => 'unsized-media', - 'description' => __( 'controls whether the current document is allowed to change the size of media elements after the initial layout is complete', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to change the size of media elements after the initial layout is complete.', 'w3-total-cache' ), ), array( 'label' => 'usb', - 'description' => __( 'controls whether the current document is allowed to use the WebUSB API', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use the WebUSB API.', 'w3-total-cache' ), ), array( 'label' => 'vibrate', - 'description' => __( 'directive controls whether the current document is allowed to trigger device vibrations via Vibration API', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to trigger device vibrations via Navigator.vibrate() method of Vibration API.', 'w3-total-cache' ), + ), + array( + 'label' => 'vr', + 'description' => __( 'Controls whether the current document is allowed to use the WebVR API. When this policy is disabled, the Promise returned by Navigator.getVRDisplays() will reject with a DOMException. Keep in mind that the WebVR standard is in the process of being replaced with WebXR.', 'w3-total-cache' ), ), array( 'label' => 'wake-lock', - 'description' => __( 'controls whether the current document is allowed to use Wake Lock API to indicate that device should not enter power-saving mode', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use Wake Lock API to indicate that device should not enter power-saving mode.', 'w3-total-cache' ), + ), + array( + 'label' => 'web-share', + 'description' => __( 'Controls whether or not the current document is allowed to use the Navigator.share() of Web Share API to share text, links, images, and other content to arbitrary destinations of user\'s choice, e.g. mobile apps.', 'w3-total-cache' ), ), array( 'label' => 'xr-spatial-tracking', - 'description' => __( 'controls whether the current document is allowed to use the WebXR Device API.', 'w3-total-cache' ), + 'description' => __( 'Controls whether the current document is allowed to use the WebXR Device API.', 'w3-total-cache' ), ), ); @@ -502,7 +534,7 @@ 'control' => 'textbox', 'label' => $i['label'], 'textbox_size' => '50', - 'textbox_placeholder' => "One of: 'self' 'src' 'none' *.domain.com", + 'textbox_placeholder' => "One of: * 'self' 'src' 'none' *.domain.com", 'description' => $i['description'], ) ); From d38ac6246fd1db77c487c7f8de42b549b507a92f Mon Sep 17 00:00:00 2001 From: Joe C Date: Thu, 2 Sep 2021 10:54:49 -0400 Subject: [PATCH 17/20] Bump version for patch release 2.1.7 --- readme.txt | 9 ++++++++- w3-total-cache-api.php | 2 +- w3-total-cache.php | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 6211560d8..0b39c5414 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryj Tags: seo, cache, optimize, pagespeed, performance, caching, compression, maxcdn, nginx, varnish, redis, new relic, aws, amazon web services, s3, cloudfront, rackspace, cloudflare, azure, apache Requires at least: 3.8 Tested up to: 5.8 -Stable tag: 2.1.6 +Stable tag: 2.1.7 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -275,6 +275,13 @@ Please reach out to all of these people and support their projects if you're so == Changelog == += 2.1.7 = +* Fix: Corrected relative paths used in the JS minify YUI Compressor +* Fix: Disallow crawling of cache directory +* Fix: Responsive display for the dashboard +* Enhancement: Added lazy load threshold setting +* Enhancement: Added feature policy security headers to settings + = 2.1.6 = * Fix: JS minify issue with template literal backticks * Fix: Do not redirect when using WP-CLI diff --git a/w3-total-cache-api.php b/w3-total-cache-api.php index 2512fe901..ed4d4e31e 100644 --- a/w3-total-cache-api.php +++ b/w3-total-cache-api.php @@ -5,7 +5,7 @@ } define( 'W3TC', true ); -define( 'W3TC_VERSION', '2.1.6' ); +define( 'W3TC_VERSION', '2.1.7' ); define( 'W3TC_POWERED_BY', 'W3 Total Cache' ); define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' ); define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' ); diff --git a/w3-total-cache.php b/w3-total-cache.php index 206e6698f..1c711b240 100644 --- a/w3-total-cache.php +++ b/w3-total-cache.php @@ -3,7 +3,7 @@ * Plugin Name: W3 Total Cache * Plugin URI: https://www.boldgrid.com/totalcache/ * Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress. - * Version: 2.1.6 + * Version: 2.1.7 * Requires at least: 3.8 * Requires PHP: 5.6 * Author: BoldGrid From cc28813b843de60d36dc2793cf2262401de14a96 Mon Sep 17 00:00:00 2001 From: Jacob Dunn <88040916+jacobd91@users.noreply.github.com> Date: Tue, 7 Sep 2021 19:29:32 -0400 Subject: [PATCH 18/20] Added robots blocking toggle #147/#419/#420 (#421) * Added toggle for robots blocking for cache directory both for virtual and physical robots.txt --- ConfigKeys.php | 5 ++- Generic_Environment.php | 70 +++++++++++++++++++++++++---------------- Generic_Plugin.php | 14 ++++++++- Util_WpFile.php | 22 +++++++++++++ inc/options/general.php | 21 ++++++++----- 5 files changed, 96 insertions(+), 36 deletions(-) diff --git a/ConfigKeys.php b/ConfigKeys.php index 724ba8175..ba1d6f117 100644 --- a/ConfigKeys.php +++ b/ConfigKeys.php @@ -2323,7 +2323,10 @@ ) ), - + 'robots_block.enable' => array( + 'type' => 'boolean', + 'default' => false + ), 'common.track_usage' => array( 'type' => 'boolean', 'default' => false diff --git a/Generic_Environment.php b/Generic_Environment.php index ee89921eb..1ed7cd1d4 100644 --- a/Generic_Environment.php +++ b/Generic_Environment.php @@ -4,7 +4,6 @@ class Generic_Environment { - /** * Fixes environment * @@ -16,7 +15,14 @@ function fix_on_wpadmin_request( $config, $force_all_checks ) { $exs = new Util_Environment_Exceptions(); // create add-ins $this->create_required_files( $config, $exs ); - $this->robots_rules_add( $config, $exs ); + + if ( Util_WpFile::file_exists( Util_Environment::site_path() . 'robots.txt' ) ) { + if ( $config->get_boolean( 'robots_block.enable' ) ) { + $this->robots_rules_add( $config, $exs ); + } else { + $this->robots_rules_remove( $exs ); + } + } // create folders $this->create_required_folders( $exs ); @@ -59,8 +65,9 @@ public function fix_after_deactivation() { $exs = new Util_Environment_Exceptions(); $this->delete_required_files( $exs ); - $this->robots_rules_remove( $exs ); + $this->robots_rules_remove( $exs ); + if ( count( $exs->exceptions() ) > 0 ) throw $exs; } @@ -213,22 +220,22 @@ public function is_advanced_cache_add_in() { /** * Write robots.txt directives to prevent crawl of cache directory. * - * @since 2.1.7 - * - * @param Config $config Configuration. - * @param Util_Environment_Exceptions $exs Exceptions. - * - * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials. - */ - private function robots_rules_add( $config, $exs ) { - Util_Rule::add_rules( - $exs, - Util_Rule::get_robots_rules_path(), - $this->robots_rules_generate(), - W3TC_MARKER_BEGIN_ROBOTS, - W3TC_MARKER_END_ROBOTS, - array() - ); + * @since 2.1.7 + * + * @param Config $config Configuration. + * @param Util_Environment_Exceptions $exs Exceptions. + * + * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials. + */ + private function robots_rules_add( $config, $exs ) { + Util_Rule::add_rules( + $exs, + Util_Rule::get_robots_rules_path(), + $this->robots_rules_generate(), + W3TC_MARKER_BEGIN_ROBOTS, + W3TC_MARKER_END_ROBOTS, + array() + ); } /** @@ -238,8 +245,8 @@ private function robots_rules_add( $config, $exs ) { * * @return string */ - private function robots_rules_generate() { - return ' + public static function robots_rules_generate() { + return ' # BEGIN W3TC ROBOTS User-agent: * Disallow: /wp-content/cache/ @@ -257,11 +264,20 @@ private function robots_rules_generate() { * @throws Util_WpFile_FilesystemOperationException with S/FTP form if it can't get the required filesystem credentials. */ private function robots_rules_remove( $exs ) { - Util_Rule::remove_rules( - $exs, - Util_Environment::site_path() . 'robots.txt', - W3TC_MARKER_BEGIN_ROBOTS, - W3TC_MARKER_END_ROBOTS - ); + $robots_path = Util_Environment::site_path() . 'robots.txt'; + + Util_Rule::remove_rules( + $exs, + $robots_path, + W3TC_MARKER_BEGIN_ROBOTS, + W3TC_MARKER_END_ROBOTS + ); + + WP_Filesystem(); + global $wp_filesystem; + + if ( empty( trim( $wp_filesystem->get_contents( $robots_path ) ) ) ) { + Util_WpFile::delete_file( $robots_path ); + } } } diff --git a/Generic_Plugin.php b/Generic_Plugin.php index 3887441e5..36cf43db6 100644 --- a/Generic_Plugin.php +++ b/Generic_Plugin.php @@ -84,6 +84,14 @@ function run() { 'ob_callback' ) ); } + + /* + * @link https://developer.wordpress.org/reference/hooks/robots_txt/ + * if robots_block is enabled modify robots.txt + */ + if ( $this->_config->get_boolean( 'robots_block.enable' ) && !Util_WpFile::file_exists( Util_Environment::site_path() . 'robots.txt' ) ) { + add_filter( 'robots_txt', array( $this, 'robots_rules_generate' ) ); + } } /** @@ -213,7 +221,6 @@ function init() { add_action( 'wp_print_scripts', array( $this, 'popup_script' ) ); } - // dont add system stuff to search results if ( ( isset( $_GET['repeat'] ) && $_GET['repeat'] == 'w3tc' ) || Util_Environment::is_preview_mode() ) { @@ -669,4 +676,9 @@ private function is_debugging() { public function pro_dev_mode() { echo '

W3 Total Cache is currently running in Pro version Development mode.

'; } + + public function robots_rules_generate( $content ) { + $content .= Generic_Environment::robots_rules_generate(); + return $content; + } } diff --git a/Util_WpFile.php b/Util_WpFile.php index 479d03289..30a183f85 100644 --- a/Util_WpFile.php +++ b/Util_WpFile.php @@ -226,6 +226,28 @@ static public function delete_file( $filename ) { } } + /** + * Checks if file exists + * + * @since 2.1.8 + * + * @param string $filename path to file + * @throws Util_WpFile_FilesystemOperationException + * @return boolean + */ + static public function file_exists( $filename ) { + try { + self::request_filesystem_credentials(); + } catch ( Util_WpFile_FilesystemOperationException $ex ) { + throw new Util_WpFile_FilesystemOperationException( $ex->getMessage(), + $ex->credentials_form() ); + } + + global $wp_filesystem; + + return $wp_filesystem->exists( $filename ); + } + /** * Get WordPress filesystems credentials. Required for WP filesystem usage. * diff --git a/inc/options/general.php b/inc/options/general.php index d68a9125b..a2604c1e5 100644 --- a/inc/options/general.php +++ b/inc/options/general.php @@ -524,13 +524,20 @@ class="w3tc-ignore-change" type="text" ) ); -Util_Ui::config_item( array( - 'key' => 'common.track_usage', - 'control' => 'checkbox', - 'checkbox_label' => __( 'Anonymously track usage to improve product quality', 'w3-total-cache' ), - 'label_class' => 'w3tc_single_column' - ) ); -?> + Util_Ui::config_item( array( + 'key' => 'common.track_usage', + 'control' => 'checkbox', + 'checkbox_label' => __( 'Anonymously track usage to improve product quality', 'w3-total-cache' ), + 'label_class' => 'w3tc_single_column' + ) ); + + Util_Ui::config_item( array( + 'key' => 'robots_block.enable', + 'control' => 'checkbox', + 'checkbox_label' => __( 'Enable robots.txt blocking for cache directory', 'w3-total-cache' ), + 'label_class' => 'w3tc_single_column' + ) ); + ?>
- checkbox( 'objectcache.enabled_for_wp_admin' ) ?> Enable caching for wp-admin requests + checkbox( 'objectcache.enabled_for_wp_admin' ); _e( 'Enable caching for wp-admin requests', 'w3-total-cache' ); ?>

- checkbox( 'objectcache.fallback_transients' ) ?> Store transients in database + checkbox( 'objectcache.fallback_transients' ); _e( 'Store transients in database', 'w3-total-cache' ); ?>

From a8d778265b2dc3c86788ea56d645452d7d4e0dfd Mon Sep 17 00:00:00 2001 From: Joe Cartonia Date: Tue, 7 Sep 2021 19:42:10 -0400 Subject: [PATCH 19/20] Bump version to 2.1.8 --- readme.txt | 5 ++++- w3-total-cache-api.php | 2 +- w3-total-cache.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 0b39c5414..762282eef 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: boldgrid, fredericktownes, maxicusc, gidomanders, bwmarkle, harryj Tags: seo, cache, optimize, pagespeed, performance, caching, compression, maxcdn, nginx, varnish, redis, new relic, aws, amazon web services, s3, cloudfront, rackspace, cloudflare, azure, apache Requires at least: 3.8 Tested up to: 5.8 -Stable tag: 2.1.7 +Stable tag: 2.1.8 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -275,6 +275,9 @@ Please reach out to all of these people and support their projects if you're so == Changelog == += 2.1.8 = +* Fix: Corrected handling of robots.txt (file and filter) + = 2.1.7 = * Fix: Corrected relative paths used in the JS minify YUI Compressor * Fix: Disallow crawling of cache directory diff --git a/w3-total-cache-api.php b/w3-total-cache-api.php index ed4d4e31e..9bdeb8c01 100644 --- a/w3-total-cache-api.php +++ b/w3-total-cache-api.php @@ -5,7 +5,7 @@ } define( 'W3TC', true ); -define( 'W3TC_VERSION', '2.1.7' ); +define( 'W3TC_VERSION', '2.1.8' ); define( 'W3TC_POWERED_BY', 'W3 Total Cache' ); define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' ); define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' ); diff --git a/w3-total-cache.php b/w3-total-cache.php index 1c711b240..ae15046af 100644 --- a/w3-total-cache.php +++ b/w3-total-cache.php @@ -3,7 +3,7 @@ * Plugin Name: W3 Total Cache * Plugin URI: https://www.boldgrid.com/totalcache/ * Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress. - * Version: 2.1.7 + * Version: 2.1.8 * Requires at least: 3.8 * Requires PHP: 5.6 * Author: BoldGrid From bb35678f2c0feed42508c251381c26f8eb076193 Mon Sep 17 00:00:00 2001 From: Oleksandr Yarosh Date: Fri, 24 Sep 2021 11:53:47 +0300 Subject: [PATCH 20/20] fix composer version; --- composer.json | 2 +- w3-total-cache-api.php | 2 +- w3-total-cache.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 91aa71fe7..e4760f2da 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "glomex/w3-total-cache", "description": "Altered version of W3TC plugin with support for internal Glomex infrastructure", "type": "wordpress-plugin", - "version": "2.1.5", + "version": "2.1.8.1", "require-dev": { "roave/security-advisories": "dev-master" }, diff --git a/w3-total-cache-api.php b/w3-total-cache-api.php index 9bdeb8c01..c013c9b40 100644 --- a/w3-total-cache-api.php +++ b/w3-total-cache-api.php @@ -5,7 +5,7 @@ } define( 'W3TC', true ); -define( 'W3TC_VERSION', '2.1.8' ); +define( 'W3TC_VERSION', '2.1.8.1' ); define( 'W3TC_POWERED_BY', 'W3 Total Cache' ); define( 'W3TC_EMAIL', 'w3tc@w3-edge.com' ); define( 'W3TC_TEXT_DOMAIN', 'w3-total-cache' ); diff --git a/w3-total-cache.php b/w3-total-cache.php index ae15046af..09d68e397 100644 --- a/w3-total-cache.php +++ b/w3-total-cache.php @@ -3,7 +3,7 @@ * Plugin Name: W3 Total Cache * Plugin URI: https://www.boldgrid.com/totalcache/ * Description: The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress. - * Version: 2.1.8 + * Version: 2.1.8.1 * Requires at least: 3.8 * Requires PHP: 5.6 * Author: BoldGrid