Plugin Directory

Changeset 3178112


Ignore:
Timestamp:
10/29/2024 02:37:44 PM (17 months ago)
Author:
poweredcache
Message:

Update to version 3.5.3 from GitHub

Location:
powered-cache
Files:
2 added
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • powered-cache/tags/3.5.3/includes/classes/Config.php

    r3086700 r3178112  
    436436        $file = get_cache_dir() . '.htaccess';
    437437
    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 );
    439455
    440456        if ( ! file_put_contents( $file, $file_string ) ) {
  • powered-cache/tags/3.5.3/includes/compat/loader.php

    r3160589 r3178112  
    4242    require_once POWERED_CACHE_COMPAT_DIR . 'plugins/wps-hide-login.php';
    4343    require_once POWERED_CACHE_COMPAT_DIR . 'plugins/short-pixel-ai.php';
     44    require_once POWERED_CACHE_COMPAT_DIR . 'plugins/amp.php';
    4445
    4546    require_once POWERED_CACHE_COMPAT_DIR . 'themes/bricks.php';
  • powered-cache/tags/3.5.3/includes/dropins/page-cache.php

    r3032658 r3178112  
    8383    $comment_cookies = [ 'comment_author_', 'comment_author_email_', 'comment_author_url_' ];
    8484
    85     //Don't cache if logged in
    86     if ( ! isset( $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) || false === $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) {
    87         // check logged-in cookie
     85    // 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
    8888        foreach ( $_COOKIE as $key => $value ) {
    8989            foreach ( $wp_cookies as $cookie ) {
    9090                if ( strpos( $key, $cookie ) !== false ) {
    91                     // Logged in!
    9291                    powered_cache_add_cache_miss_header( "User logged-in" );
    93 
    9492                    return;
    9593                }
    9694            }
    9795
     96            // Check if the user has commented on the site
    9897            foreach ( $comment_cookies as $cookie ) {
    9998                if ( strpos( $key, $cookie ) !== false ) {
    100                     // Commented on the site!
    10199                    powered_cache_add_cache_miss_header( "User left a comment" );
    102 
    103100                    return;
    104101                }
    105102            }
    106103        }
    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'] );
    124120        $rejected_cookies = implode( '|', $rejected_cookies );
    125121        if ( preg_match( '#(' . $rejected_cookies . ')#', var_export( $_COOKIE, true ) ) ) {
    126122            powered_cache_add_cache_miss_header( "Rejected cookie" );
    127 
    128123            return;
    129124        }
     
    552547            $cookie_info = explode( '|', $usr_cookie );
    553548
    554             // user specific cache dir
    555             $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 );
    556551        }
    557552    }
  • powered-cache/tags/3.5.3/languages/powered-cache.pot

    r3160589 r3178112  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Powered Cache 3.5.2\n"
     5"Project-Id-Version: Powered Cache 3.5.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"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"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    16011601
    16021602#. translators: %1$s plugin name,  %2$s conflicted feature name (Eg lazyload)
    1603 #: includes/compat/loader.php:69
     1603#: includes/compat/loader.php:70
    16041604msgid "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."
    16051605msgstr ""
  • powered-cache/tags/3.5.3/powered-cache.php

    r3160589 r3178112  
    44 * Plugin URI:        https://poweredcache.com
    55 * 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.2
     6 * Version:           3.5.3
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.2.5
     
    2626
    2727// Useful global constants.
    28 define( 'POWERED_CACHE_VERSION', '3.5.2' );
     28define( 'POWERED_CACHE_VERSION', '3.5.3' );
    2929define( 'POWERED_CACHE_DB_VERSION', '3.4' );
    3030define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ );
  • powered-cache/tags/3.5.3/readme.txt

    r3160589 r3178112  
    33Tags: cache, web vitals, performance, page speed, optimize
    44Requires at least:  5.7
    5 Tested up to:  6.6
    6 Stable tag:  3.5.2
     5Tested up to:  6.7
     6Stable tag:  3.5.3
    77License: GPLv2 (or later)
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171
    172172== 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.
    173181
    174182= 3.5.2 (October 01, 2024) =
  • powered-cache/trunk/includes/classes/Config.php

    r3086700 r3178112  
    436436        $file = get_cache_dir() . '.htaccess';
    437437
    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 );
    439455
    440456        if ( ! file_put_contents( $file, $file_string ) ) {
  • powered-cache/trunk/includes/compat/loader.php

    r3160589 r3178112  
    4242    require_once POWERED_CACHE_COMPAT_DIR . 'plugins/wps-hide-login.php';
    4343    require_once POWERED_CACHE_COMPAT_DIR . 'plugins/short-pixel-ai.php';
     44    require_once POWERED_CACHE_COMPAT_DIR . 'plugins/amp.php';
    4445
    4546    require_once POWERED_CACHE_COMPAT_DIR . 'themes/bricks.php';
  • powered-cache/trunk/includes/dropins/page-cache.php

    r3032658 r3178112  
    8383    $comment_cookies = [ 'comment_author_', 'comment_author_email_', 'comment_author_url_' ];
    8484
    85     //Don't cache if logged in
    86     if ( ! isset( $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) || false === $GLOBALS['powered_cache_options']['loggedin_user_cache'] ) {
    87         // check logged-in cookie
     85    // 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
    8888        foreach ( $_COOKIE as $key => $value ) {
    8989            foreach ( $wp_cookies as $cookie ) {
    9090                if ( strpos( $key, $cookie ) !== false ) {
    91                     // Logged in!
    9291                    powered_cache_add_cache_miss_header( "User logged-in" );
    93 
    9492                    return;
    9593                }
    9694            }
    9795
     96            // Check if the user has commented on the site
    9897            foreach ( $comment_cookies as $cookie ) {
    9998                if ( strpos( $key, $cookie ) !== false ) {
    100                     // Commented on the site!
    10199                    powered_cache_add_cache_miss_header( "User left a comment" );
    102 
    103100                    return;
    104101                }
    105102            }
    106103        }
    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'] );
    124120        $rejected_cookies = implode( '|', $rejected_cookies );
    125121        if ( preg_match( '#(' . $rejected_cookies . ')#', var_export( $_COOKIE, true ) ) ) {
    126122            powered_cache_add_cache_miss_header( "Rejected cookie" );
    127 
    128123            return;
    129124        }
     
    552547            $cookie_info = explode( '|', $usr_cookie );
    553548
    554             // user specific cache dir
    555             $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 );
    556551        }
    557552    }
  • powered-cache/trunk/languages/powered-cache.pot

    r3160589 r3178112  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Powered Cache 3.5.2\n"
     5"Project-Id-Version: Powered Cache 3.5.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/powered-cache\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"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"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    16011601
    16021602#. translators: %1$s plugin name,  %2$s conflicted feature name (Eg lazyload)
    1603 #: includes/compat/loader.php:69
     1603#: includes/compat/loader.php:70
    16041604msgid "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."
    16051605msgstr ""
  • powered-cache/trunk/powered-cache.php

    r3160589 r3178112  
    44 * Plugin URI:        https://poweredcache.com
    55 * 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.2
     6 * Version:           3.5.3
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.2.5
     
    2626
    2727// Useful global constants.
    28 define( 'POWERED_CACHE_VERSION', '3.5.2' );
     28define( 'POWERED_CACHE_VERSION', '3.5.3' );
    2929define( 'POWERED_CACHE_DB_VERSION', '3.4' );
    3030define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ );
  • powered-cache/trunk/readme.txt

    r3160589 r3178112  
    33Tags: cache, web vitals, performance, page speed, optimize
    44Requires at least:  5.7
    5 Tested up to:  6.6
    6 Stable tag:  3.5.2
     5Tested up to:  6.7
     6Stable tag:  3.5.3
    77License: GPLv2 (or later)
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171
    172172== 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.
    173181
    174182= 3.5.2 (October 01, 2024) =
Note: See TracChangeset for help on using the changeset viewer.