Changeset 3178112
- Timestamp:
- 10/29/2024 02:37:44 PM (17 months ago)
- Location:
- powered-cache
- Files:
-
- 2 added
- 12 edited
- 1 copied
-
tags/3.5.3 (copied) (copied from powered-cache/trunk)
-
tags/3.5.3/includes/classes/Config.php (modified) (1 diff)
-
tags/3.5.3/includes/compat/loader.php (modified) (1 diff)
-
tags/3.5.3/includes/compat/plugins/amp.php (added)
-
tags/3.5.3/includes/dropins/page-cache.php (modified) (2 diffs)
-
tags/3.5.3/languages/powered-cache.pot (modified) (3 diffs)
-
tags/3.5.3/powered-cache.php (modified) (2 diffs)
-
tags/3.5.3/readme.txt (modified) (2 diffs)
-
trunk/includes/classes/Config.php (modified) (1 diff)
-
trunk/includes/compat/loader.php (modified) (1 diff)
-
trunk/includes/compat/plugins/amp.php (added)
-
trunk/includes/dropins/page-cache.php (modified) (2 diffs)
-
trunk/languages/powered-cache.pot (modified) (3 diffs)
-
trunk/powered-cache.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
powered-cache/tags/3.5.3/includes/classes/Config.php
r3086700 r3178112 436 436 $file = get_cache_dir() . '.htaccess'; 437 437 438 $file_string = 'Options -Indexes'; 438 $file_string = '<IfModule mod_autoindex.c>' . PHP_EOL; 439 $file_string .= ' Options -Indexes' . PHP_EOL; 440 $file_string .= '</IfModule>' . PHP_EOL . PHP_EOL; 441 $file_string .= '<FilesMatch "^.*-user_.*\.(html|html\.gz)$">' . PHP_EOL; 442 $file_string .= ' Order Allow,Deny' . PHP_EOL; 443 $file_string .= ' Deny from all' . PHP_EOL; 444 $file_string .= '</FilesMatch>' . PHP_EOL; 445 446 /** 447 * Filters the content of the .htaccess file in the cache directory. 448 * 449 * @param {string} $file_string Default configuration 450 * 451 * @hook powered_cache_cache_dir_htaccess_file_content 452 * @since 3.5.3 453 */ 454 $file_string = apply_filters( 'powered_cache_cache_dir_htaccess_file_content', $file_string ); 439 455 440 456 if ( ! file_put_contents( $file, $file_string ) ) { -
powered-cache/tags/3.5.3/includes/compat/loader.php
r3160589 r3178112 42 42 require_once POWERED_CACHE_COMPAT_DIR . 'plugins/wps-hide-login.php'; 43 43 require_once POWERED_CACHE_COMPAT_DIR . 'plugins/short-pixel-ai.php'; 44 require_once POWERED_CACHE_COMPAT_DIR . 'plugins/amp.php'; 44 45 45 46 require_once POWERED_CACHE_COMPAT_DIR . 'themes/bricks.php'; -
powered-cache/tags/3.5.3/includes/dropins/page-cache.php
r3032658 r3178112 83 83 $comment_cookies = [ 'comment_author_', 'comment_author_email_', 'comment_author_url_' ]; 84 84 85 // Don't cache iflogged in86 if ( ! isset( $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) || false === $GLOBALS['powered_cache_options']['loggedin_user_cache']) {87 // check logged-in cookie85 // Check if logged-in caching is disabled or the user is not logged in 86 if ( empty( $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) || false === powered_cache_get_user_cookie() ) { 87 // Standard check for logged-in status 88 88 foreach ( $_COOKIE as $key => $value ) { 89 89 foreach ( $wp_cookies as $cookie ) { 90 90 if ( strpos( $key, $cookie ) !== false ) { 91 // Logged in!92 91 powered_cache_add_cache_miss_header( "User logged-in" ); 93 94 92 return; 95 93 } 96 94 } 97 95 96 // Check if the user has commented on the site 98 97 foreach ( $comment_cookies as $cookie ) { 99 98 if ( strpos( $key, $cookie ) !== false ) { 100 // Commented on the site!101 99 powered_cache_add_cache_miss_header( "User left a comment" ); 102 103 100 return; 104 101 } 105 102 } 106 103 } 107 } 108 109 110 if ( ! empty( $_COOKIE['powered_cache_commented_posts'] ) ) { 111 foreach ( $_COOKIE['powered_cache_commented_posts'] as $path ) { 112 if ( rtrim( $path, '/' ) === rtrim( $_SERVER['REQUEST_URI'], '/' ) ) { 113 // User commented on this post 114 powered_cache_add_cache_miss_header( "User commented" ); 115 116 return; 117 } 118 } 119 } 120 121 // don't cache specific cookie 122 if ( isset( $powered_cache_rejected_cookies ) && ! empty( $powered_cache_rejected_cookies ) ) { 123 $rejected_cookies = array_diff( $powered_cache_rejected_cookies, $wp_cookies, $comment_cookies ); // use diff in case caching for logged-in user 104 105 // Avoid caching pages with specific post comments from users 106 // it's a bit different from $comment_cookies since we are checking the post path 107 if ( ! empty( $_COOKIE['powered_cache_commented_posts'] ) ) { 108 foreach ( $_COOKIE['powered_cache_commented_posts'] as $path ) { 109 if ( rtrim( $path, '/' ) === rtrim( $_SERVER['REQUEST_URI'], '/' ) ) { 110 powered_cache_add_cache_miss_header( "User commented" ); 111 return; 112 } 113 } 114 } 115 } 116 117 // Skip caching if there are specific rejected cookies, regardless of logged-in status 118 if ( ! empty( $powered_cache_rejected_cookies ) ) { 119 $rejected_cookies = array_diff( $powered_cache_rejected_cookies, $wp_cookies, $comment_cookies, ['powered_cache_commented_posts'] ); 124 120 $rejected_cookies = implode( '|', $rejected_cookies ); 125 121 if ( preg_match( '#(' . $rejected_cookies . ')#', var_export( $_COOKIE, true ) ) ) { 126 122 powered_cache_add_cache_miss_header( "Rejected cookie" ); 127 128 123 return; 129 124 } … … 552 547 $cookie_info = explode( '|', $usr_cookie ); 553 548 554 // user specific cache dir555 $file_name .= ' _' . $cookie_info[0] . '-' . $cookie_info[1];549 // user specific cache index 550 $file_name .= '-user_' . $cookie_info[0] . '-' . substr( sha1( $cookie_info[0] ), 0, 6 ); 556 551 } 557 552 } -
powered-cache/tags/3.5.3/languages/powered-cache.pot
r3160589 r3178112 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Powered Cache 3.5. 2\n"5 "Project-Id-Version: Powered Cache 3.5.3\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-10- 01T10:33:24+00:00\n"12 "POT-Creation-Date: 2024-10-29T14:34:54+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 1601 1601 1602 1602 #. translators: %1$s plugin name, %2$s conflicted feature name (Eg lazyload) 1603 #: includes/compat/loader.php: 691603 #: includes/compat/loader.php:70 1604 1604 msgid "It seems %1$s is activated on your site. Powered Cache works perfectly fine with %1$s but you cannot use %2$s functionalities that conflic with %1$s plugin unless you deactivate it." 1605 1605 msgstr "" -
powered-cache/tags/3.5.3/powered-cache.php
r3160589 r3178112 4 4 * Plugin URI: https://poweredcache.com 5 5 * Description: Powered Cache is the most powerful caching and performance suite for WordPress, designed to easily improve your PageSpeed and Web Vitals Score. 6 * Version: 3.5. 26 * Version: 3.5.3 7 7 * Requires at least: 5.7 8 8 * Requires PHP: 7.2.5 … … 26 26 27 27 // Useful global constants. 28 define( 'POWERED_CACHE_VERSION', '3.5. 2' );28 define( 'POWERED_CACHE_VERSION', '3.5.3' ); 29 29 define( 'POWERED_CACHE_DB_VERSION', '3.4' ); 30 30 define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ ); -
powered-cache/tags/3.5.3/readme.txt
r3160589 r3178112 3 3 Tags: cache, web vitals, performance, page speed, optimize 4 4 Requires at least: 5.7 5 Tested up to: 6. 66 Stable tag: 3.5. 25 Tested up to: 6.7 6 Stable tag: 3.5.3 7 7 License: GPLv2 (or later) 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 171 171 172 172 == Changelog == 173 174 = 3.5.3 (October 29, 2024) = 175 - [Added] AMP compatibility for delay js. 176 - [Added] `powered_cache_cache_dir_htaccess_file_content` filter to modify the cache directory .htaccess content. 177 - [Updated] Cache key for logged-in user cache. (Advised to purge cache if you are using logged-in user cache). 178 - [Improved] Cookie control for cache skipping. 179 - Tested with Upcoming WP 6.7 180 - Various dependency updates. 173 181 174 182 = 3.5.2 (October 01, 2024) = -
powered-cache/trunk/includes/classes/Config.php
r3086700 r3178112 436 436 $file = get_cache_dir() . '.htaccess'; 437 437 438 $file_string = 'Options -Indexes'; 438 $file_string = '<IfModule mod_autoindex.c>' . PHP_EOL; 439 $file_string .= ' Options -Indexes' . PHP_EOL; 440 $file_string .= '</IfModule>' . PHP_EOL . PHP_EOL; 441 $file_string .= '<FilesMatch "^.*-user_.*\.(html|html\.gz)$">' . PHP_EOL; 442 $file_string .= ' Order Allow,Deny' . PHP_EOL; 443 $file_string .= ' Deny from all' . PHP_EOL; 444 $file_string .= '</FilesMatch>' . PHP_EOL; 445 446 /** 447 * Filters the content of the .htaccess file in the cache directory. 448 * 449 * @param {string} $file_string Default configuration 450 * 451 * @hook powered_cache_cache_dir_htaccess_file_content 452 * @since 3.5.3 453 */ 454 $file_string = apply_filters( 'powered_cache_cache_dir_htaccess_file_content', $file_string ); 439 455 440 456 if ( ! file_put_contents( $file, $file_string ) ) { -
powered-cache/trunk/includes/compat/loader.php
r3160589 r3178112 42 42 require_once POWERED_CACHE_COMPAT_DIR . 'plugins/wps-hide-login.php'; 43 43 require_once POWERED_CACHE_COMPAT_DIR . 'plugins/short-pixel-ai.php'; 44 require_once POWERED_CACHE_COMPAT_DIR . 'plugins/amp.php'; 44 45 45 46 require_once POWERED_CACHE_COMPAT_DIR . 'themes/bricks.php'; -
powered-cache/trunk/includes/dropins/page-cache.php
r3032658 r3178112 83 83 $comment_cookies = [ 'comment_author_', 'comment_author_email_', 'comment_author_url_' ]; 84 84 85 // Don't cache iflogged in86 if ( ! isset( $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) || false === $GLOBALS['powered_cache_options']['loggedin_user_cache']) {87 // check logged-in cookie85 // Check if logged-in caching is disabled or the user is not logged in 86 if ( empty( $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) || false === powered_cache_get_user_cookie() ) { 87 // Standard check for logged-in status 88 88 foreach ( $_COOKIE as $key => $value ) { 89 89 foreach ( $wp_cookies as $cookie ) { 90 90 if ( strpos( $key, $cookie ) !== false ) { 91 // Logged in!92 91 powered_cache_add_cache_miss_header( "User logged-in" ); 93 94 92 return; 95 93 } 96 94 } 97 95 96 // Check if the user has commented on the site 98 97 foreach ( $comment_cookies as $cookie ) { 99 98 if ( strpos( $key, $cookie ) !== false ) { 100 // Commented on the site!101 99 powered_cache_add_cache_miss_header( "User left a comment" ); 102 103 100 return; 104 101 } 105 102 } 106 103 } 107 } 108 109 110 if ( ! empty( $_COOKIE['powered_cache_commented_posts'] ) ) { 111 foreach ( $_COOKIE['powered_cache_commented_posts'] as $path ) { 112 if ( rtrim( $path, '/' ) === rtrim( $_SERVER['REQUEST_URI'], '/' ) ) { 113 // User commented on this post 114 powered_cache_add_cache_miss_header( "User commented" ); 115 116 return; 117 } 118 } 119 } 120 121 // don't cache specific cookie 122 if ( isset( $powered_cache_rejected_cookies ) && ! empty( $powered_cache_rejected_cookies ) ) { 123 $rejected_cookies = array_diff( $powered_cache_rejected_cookies, $wp_cookies, $comment_cookies ); // use diff in case caching for logged-in user 104 105 // Avoid caching pages with specific post comments from users 106 // it's a bit different from $comment_cookies since we are checking the post path 107 if ( ! empty( $_COOKIE['powered_cache_commented_posts'] ) ) { 108 foreach ( $_COOKIE['powered_cache_commented_posts'] as $path ) { 109 if ( rtrim( $path, '/' ) === rtrim( $_SERVER['REQUEST_URI'], '/' ) ) { 110 powered_cache_add_cache_miss_header( "User commented" ); 111 return; 112 } 113 } 114 } 115 } 116 117 // Skip caching if there are specific rejected cookies, regardless of logged-in status 118 if ( ! empty( $powered_cache_rejected_cookies ) ) { 119 $rejected_cookies = array_diff( $powered_cache_rejected_cookies, $wp_cookies, $comment_cookies, ['powered_cache_commented_posts'] ); 124 120 $rejected_cookies = implode( '|', $rejected_cookies ); 125 121 if ( preg_match( '#(' . $rejected_cookies . ')#', var_export( $_COOKIE, true ) ) ) { 126 122 powered_cache_add_cache_miss_header( "Rejected cookie" ); 127 128 123 return; 129 124 } … … 552 547 $cookie_info = explode( '|', $usr_cookie ); 553 548 554 // user specific cache dir555 $file_name .= ' _' . $cookie_info[0] . '-' . $cookie_info[1];549 // user specific cache index 550 $file_name .= '-user_' . $cookie_info[0] . '-' . substr( sha1( $cookie_info[0] ), 0, 6 ); 556 551 } 557 552 } -
powered-cache/trunk/languages/powered-cache.pot
r3160589 r3178112 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Powered Cache 3.5. 2\n"5 "Project-Id-Version: Powered Cache 3.5.3\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-10- 01T10:33:24+00:00\n"12 "POT-Creation-Date: 2024-10-29T14:34:54+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.10.0\n" … … 1601 1601 1602 1602 #. translators: %1$s plugin name, %2$s conflicted feature name (Eg lazyload) 1603 #: includes/compat/loader.php: 691603 #: includes/compat/loader.php:70 1604 1604 msgid "It seems %1$s is activated on your site. Powered Cache works perfectly fine with %1$s but you cannot use %2$s functionalities that conflic with %1$s plugin unless you deactivate it." 1605 1605 msgstr "" -
powered-cache/trunk/powered-cache.php
r3160589 r3178112 4 4 * Plugin URI: https://poweredcache.com 5 5 * Description: Powered Cache is the most powerful caching and performance suite for WordPress, designed to easily improve your PageSpeed and Web Vitals Score. 6 * Version: 3.5. 26 * Version: 3.5.3 7 7 * Requires at least: 5.7 8 8 * Requires PHP: 7.2.5 … … 26 26 27 27 // Useful global constants. 28 define( 'POWERED_CACHE_VERSION', '3.5. 2' );28 define( 'POWERED_CACHE_VERSION', '3.5.3' ); 29 29 define( 'POWERED_CACHE_DB_VERSION', '3.4' ); 30 30 define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ ); -
powered-cache/trunk/readme.txt
r3160589 r3178112 3 3 Tags: cache, web vitals, performance, page speed, optimize 4 4 Requires at least: 5.7 5 Tested up to: 6. 66 Stable tag: 3.5. 25 Tested up to: 6.7 6 Stable tag: 3.5.3 7 7 License: GPLv2 (or later) 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 171 171 172 172 == Changelog == 173 174 = 3.5.3 (October 29, 2024) = 175 - [Added] AMP compatibility for delay js. 176 - [Added] `powered_cache_cache_dir_htaccess_file_content` filter to modify the cache directory .htaccess content. 177 - [Updated] Cache key for logged-in user cache. (Advised to purge cache if you are using logged-in user cache). 178 - [Improved] Cookie control for cache skipping. 179 - Tested with Upcoming WP 6.7 180 - Various dependency updates. 173 181 174 182 = 3.5.2 (October 01, 2024) =
Note: See TracChangeset
for help on using the changeset viewer.