Plugin Directory

Changeset 3078450


Ignore:
Timestamp:
04/29/2024 07:12:03 AM (2 years ago)
Author:
poweredcache
Message:

Update to version 3.4.4 from GitHub

Location:
powered-cache
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • powered-cache/tags/3.4.4/includes/classes/AdvancedCache.php

    r3038477 r3078450  
    7979        add_action( 'transition_post_status', array( $this, 'purge_on_post_update' ), 9999, 3 );
    8080        add_action( 'switch_theme', array( $this, 'purge_on_switch_theme' ) );
    81         add_action( 'wp_set_comment_status', array( $this, 'purge_post_on_comment_status_change' ), 10, 2 );
     81        add_action( 'wp_set_comment_status', array( $this, 'purge_post_on_comment_update' ) );
     82        add_action( 'edit_comment', array( $this, 'purge_post_on_comment_update' ) );
    8283        add_action( 'set_comment_cookies', array( $this, 'set_comment_cookie' ), 10, 2 );
    8384        add_filter( 'powered_cache_post_related_urls', array( $this, 'powered_cache_post_related_urls' ) );
     
    283284
    284285    /**
    285      * Delete page cache when post update
     286     * Purge post cache when comment status change
    286287     *
    287288     * @param int    $comment_id     Comment ID
    288      * @param string $comment_status Status of the comment
    289      *
    290      * @since 1.0
     289     * @param string $comment_status Comment status
     290     *
     291     * @return void
     292     * @deprecated since 3.4.4
    291293     */
    292294    public function purge_post_on_comment_status_change( $comment_id, $comment_status ) {
     295        // deprecate this method in favor of `purge_post_on_comment_update`
     296        _deprecated_function( __METHOD__, '3.4.4', 'purge_post_on_comment_update' );
     297        $this->purge_post_on_comment_update( $comment_id );
    293298        $comment  = get_comment( $comment_id );
    294299        $post_id  = $comment->comment_post_ID;
    295300        $post_url = get_permalink( $post_id );
    296         delete_page_cache( $post_url );
     301
     302        do_action( 'powered_cache_advanced_cache_purge_on_comment_update', $post_id, $post_url, $comment_id );
     303    }
     304
     305    /**
     306     * Delete page cache when a comment update
     307     *
     308     * @param int $comment_id Comment ID
     309     *
     310     * @since 3.4.4
     311     */
     312    public function purge_post_on_comment_update( $comment_id ) {
     313        $comment  = get_comment( $comment_id );
     314        $post_id  = $comment->comment_post_ID;
     315        $post_url = get_permalink( $post_id );
     316        delete_page_cache( $post_url, true );
    297317
    298318        /**
    299319         * Fires after purging cache for a post that associated a comment
     320         *
     321         * @hook  powered_cache_advanced_cache_purge_on_comment_update
    300322         *
    301323         * @param {int} $post_id Post ID.
     
    303325         * @param {int} $comment_id Comment ID.
    304326         *
    305          * @since 2.0
    306          */
    307         do_action( 'powered_cache_advanced_cache_purge_on_comment_status_change', $post_id, $post_url, $comment_id );
     327         * @since 3.4.4
     328         */
     329        do_action( 'powered_cache_advanced_cache_purge_on_comment_update', $post_id, $post_url, $comment_id );
    308330    }
    309331
  • powered-cache/tags/3.4.4/includes/compat/domain-mapping.php

    r3016660 r3078450  
    1919add_action( 'powered_cache_clean_site_cache_dir', __NAMESPACE__ . '\\maybe_clean_mapped_domain_dir' );
    2020add_action( 'powered_cache_advanced_cache_purge_post', __NAMESPACE__ . '\\maybe_purge_on_post_update', 10, 2 );
    21 add_action( 'powered_cache_advanced_cache_purge_on_comment_status_change', __NAMESPACE__ . '\\maybe_purge_on_comment_status_change', 10, 2 );
     21add_action( 'powered_cache_advanced_cache_purge_on_comment_update', __NAMESPACE__ . '\\maybe_purge_on_comment_update', 10, 2 );
    2222add_action( 'powered_cache_create_config_file', __NAMESPACE__ . '\\maybe_create_config_files', 10, 3 );
    2323add_action( 'wp_delete_site', __NAMESPACE__ . '\\purge_on_site_delete' ); // works on WP 5.1+
     
    9292        $new_purge_urls = str_replace( site_url(), $domain, $urls );
    9393        foreach ( $new_purge_urls as $new_purge_url ) {
    94             delete_page_cache( $new_purge_url );
     94            delete_page_cache( $new_purge_url, true );
    9595        }
    9696    }
     
    103103 * @param string $post_url Post ID of the comment.
    104104 */
    105 function maybe_purge_on_comment_status_change( $post_id, $post_url ) {
     105function maybe_purge_on_comment_update( $post_id, $post_url ) {
    106106    $mapped_domains = get_mapped_domains();
    107107    if ( ! $mapped_domains ) {
     
    111111    foreach ( $mapped_domains as $domain ) {
    112112        $post_url = str_replace( site_url(), $domain, $post_url );
    113         delete_page_cache( $post_url );
     113        delete_page_cache( $post_url, true );
    114114    }
    115115}
  • powered-cache/tags/3.4.4/includes/utils.php

    r3038477 r3078450  
    891891 * Delete cache file
    892892 *
    893  * @param string $url Target URL
     893 * @param string $url                   Target URL
     894 * @param bool   $delete_subdirectories Whether delete subdirectories or not
    894895 *
    895896 * @return bool  true when found cache dir, otherwise false
    896897 * @since 1.0
    897898 */
    898 function delete_page_cache( $url ) {
    899 
     899function delete_page_cache( $url, $delete_subdirectories = false ) {
    900900    $dir = get_url_dir( trim( $url ) );
    901901
     
    912912        }
    913913
    914         if ( file_exists( $dir ) && is_dir_empty( $dir ) ) {
     914        if ( file_exists( $dir ) && ( $delete_subdirectories || is_dir_empty( $dir ) ) ) {
    915915            remove_dir( $dir );
    916916        }
  • powered-cache/tags/3.4.4/languages/powered-cache.pot

    r3074892 r3078450  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Powered Cache 3.4.3\n"
     5"Project-Id-Version: Powered Cache 3.4.4\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-04-22T09:13:19+00:00\n"
     12"POT-Creation-Date: 2024-04-29T07:07:13+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.9.0\n"
     
    14981498msgstr ""
    14991499
    1500 #: includes/classes/AdvancedCache.php:104
     1500#: includes/classes/AdvancedCache.php:105
    15011501msgid "Purge Page Cache [Network Wide - All Sites]"
    15021502msgstr ""
    15031503
    1504 #: includes/classes/AdvancedCache.php:115
     1504#: includes/classes/AdvancedCache.php:116
    15051505msgid "Purge Page Cache"
    15061506msgstr ""
    15071507
    1508 #: includes/classes/AdvancedCache.php:125
     1508#: includes/classes/AdvancedCache.php:126
    15091509msgid "Purge Current Page"
    15101510msgstr ""
  • powered-cache/tags/3.4.4/powered-cache.php

    r3074892 r3078450  
    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.4.3
     6 * Version:           3.4.4
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.2.5
     
    2626
    2727// Useful global constants.
    28 define( 'POWERED_CACHE_VERSION', '3.4.3' );
     28define( 'POWERED_CACHE_VERSION', '3.4.4' );
    2929define( 'POWERED_CACHE_DB_VERSION', '3.4' );
    3030define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ );
  • powered-cache/tags/3.4.4/readme.txt

    r3074892 r3078450  
    44Requires at least:  5.7
    55Tested up to:  6.5
    6 Stable tag:  3.4.3
     6Stable tag:  3.4.4
    77License: GPLv2 (or later)
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171
    172172== Changelog ==
     173
     174= 3.4.4 (April 29, 2024) =
     175- [Fixed] Resolved an issue with comment cache not purging correctly.
     176- [Added] Support for purging paginated comments.
    173177
    174178= 3.4.3 (April 22, 2024) =
  • powered-cache/trunk/includes/classes/AdvancedCache.php

    r3038477 r3078450  
    7979        add_action( 'transition_post_status', array( $this, 'purge_on_post_update' ), 9999, 3 );
    8080        add_action( 'switch_theme', array( $this, 'purge_on_switch_theme' ) );
    81         add_action( 'wp_set_comment_status', array( $this, 'purge_post_on_comment_status_change' ), 10, 2 );
     81        add_action( 'wp_set_comment_status', array( $this, 'purge_post_on_comment_update' ) );
     82        add_action( 'edit_comment', array( $this, 'purge_post_on_comment_update' ) );
    8283        add_action( 'set_comment_cookies', array( $this, 'set_comment_cookie' ), 10, 2 );
    8384        add_filter( 'powered_cache_post_related_urls', array( $this, 'powered_cache_post_related_urls' ) );
     
    283284
    284285    /**
    285      * Delete page cache when post update
     286     * Purge post cache when comment status change
    286287     *
    287288     * @param int    $comment_id     Comment ID
    288      * @param string $comment_status Status of the comment
    289      *
    290      * @since 1.0
     289     * @param string $comment_status Comment status
     290     *
     291     * @return void
     292     * @deprecated since 3.4.4
    291293     */
    292294    public function purge_post_on_comment_status_change( $comment_id, $comment_status ) {
     295        // deprecate this method in favor of `purge_post_on_comment_update`
     296        _deprecated_function( __METHOD__, '3.4.4', 'purge_post_on_comment_update' );
     297        $this->purge_post_on_comment_update( $comment_id );
    293298        $comment  = get_comment( $comment_id );
    294299        $post_id  = $comment->comment_post_ID;
    295300        $post_url = get_permalink( $post_id );
    296         delete_page_cache( $post_url );
     301
     302        do_action( 'powered_cache_advanced_cache_purge_on_comment_update', $post_id, $post_url, $comment_id );
     303    }
     304
     305    /**
     306     * Delete page cache when a comment update
     307     *
     308     * @param int $comment_id Comment ID
     309     *
     310     * @since 3.4.4
     311     */
     312    public function purge_post_on_comment_update( $comment_id ) {
     313        $comment  = get_comment( $comment_id );
     314        $post_id  = $comment->comment_post_ID;
     315        $post_url = get_permalink( $post_id );
     316        delete_page_cache( $post_url, true );
    297317
    298318        /**
    299319         * Fires after purging cache for a post that associated a comment
     320         *
     321         * @hook  powered_cache_advanced_cache_purge_on_comment_update
    300322         *
    301323         * @param {int} $post_id Post ID.
     
    303325         * @param {int} $comment_id Comment ID.
    304326         *
    305          * @since 2.0
    306          */
    307         do_action( 'powered_cache_advanced_cache_purge_on_comment_status_change', $post_id, $post_url, $comment_id );
     327         * @since 3.4.4
     328         */
     329        do_action( 'powered_cache_advanced_cache_purge_on_comment_update', $post_id, $post_url, $comment_id );
    308330    }
    309331
  • powered-cache/trunk/includes/compat/domain-mapping.php

    r3016660 r3078450  
    1919add_action( 'powered_cache_clean_site_cache_dir', __NAMESPACE__ . '\\maybe_clean_mapped_domain_dir' );
    2020add_action( 'powered_cache_advanced_cache_purge_post', __NAMESPACE__ . '\\maybe_purge_on_post_update', 10, 2 );
    21 add_action( 'powered_cache_advanced_cache_purge_on_comment_status_change', __NAMESPACE__ . '\\maybe_purge_on_comment_status_change', 10, 2 );
     21add_action( 'powered_cache_advanced_cache_purge_on_comment_update', __NAMESPACE__ . '\\maybe_purge_on_comment_update', 10, 2 );
    2222add_action( 'powered_cache_create_config_file', __NAMESPACE__ . '\\maybe_create_config_files', 10, 3 );
    2323add_action( 'wp_delete_site', __NAMESPACE__ . '\\purge_on_site_delete' ); // works on WP 5.1+
     
    9292        $new_purge_urls = str_replace( site_url(), $domain, $urls );
    9393        foreach ( $new_purge_urls as $new_purge_url ) {
    94             delete_page_cache( $new_purge_url );
     94            delete_page_cache( $new_purge_url, true );
    9595        }
    9696    }
     
    103103 * @param string $post_url Post ID of the comment.
    104104 */
    105 function maybe_purge_on_comment_status_change( $post_id, $post_url ) {
     105function maybe_purge_on_comment_update( $post_id, $post_url ) {
    106106    $mapped_domains = get_mapped_domains();
    107107    if ( ! $mapped_domains ) {
     
    111111    foreach ( $mapped_domains as $domain ) {
    112112        $post_url = str_replace( site_url(), $domain, $post_url );
    113         delete_page_cache( $post_url );
     113        delete_page_cache( $post_url, true );
    114114    }
    115115}
  • powered-cache/trunk/includes/utils.php

    r3038477 r3078450  
    891891 * Delete cache file
    892892 *
    893  * @param string $url Target URL
     893 * @param string $url                   Target URL
     894 * @param bool   $delete_subdirectories Whether delete subdirectories or not
    894895 *
    895896 * @return bool  true when found cache dir, otherwise false
    896897 * @since 1.0
    897898 */
    898 function delete_page_cache( $url ) {
    899 
     899function delete_page_cache( $url, $delete_subdirectories = false ) {
    900900    $dir = get_url_dir( trim( $url ) );
    901901
     
    912912        }
    913913
    914         if ( file_exists( $dir ) && is_dir_empty( $dir ) ) {
     914        if ( file_exists( $dir ) && ( $delete_subdirectories || is_dir_empty( $dir ) ) ) {
    915915            remove_dir( $dir );
    916916        }
  • powered-cache/trunk/languages/powered-cache.pot

    r3074892 r3078450  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Powered Cache 3.4.3\n"
     5"Project-Id-Version: Powered Cache 3.4.4\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-04-22T09:13:19+00:00\n"
     12"POT-Creation-Date: 2024-04-29T07:07:13+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.9.0\n"
     
    14981498msgstr ""
    14991499
    1500 #: includes/classes/AdvancedCache.php:104
     1500#: includes/classes/AdvancedCache.php:105
    15011501msgid "Purge Page Cache [Network Wide - All Sites]"
    15021502msgstr ""
    15031503
    1504 #: includes/classes/AdvancedCache.php:115
     1504#: includes/classes/AdvancedCache.php:116
    15051505msgid "Purge Page Cache"
    15061506msgstr ""
    15071507
    1508 #: includes/classes/AdvancedCache.php:125
     1508#: includes/classes/AdvancedCache.php:126
    15091509msgid "Purge Current Page"
    15101510msgstr ""
  • powered-cache/trunk/powered-cache.php

    r3074892 r3078450  
    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.4.3
     6 * Version:           3.4.4
    77 * Requires at least: 5.7
    88 * Requires PHP:      7.2.5
     
    2626
    2727// Useful global constants.
    28 define( 'POWERED_CACHE_VERSION', '3.4.3' );
     28define( 'POWERED_CACHE_VERSION', '3.4.4' );
    2929define( 'POWERED_CACHE_DB_VERSION', '3.4' );
    3030define( 'POWERED_CACHE_PLUGIN_FILE', __FILE__ );
  • powered-cache/trunk/readme.txt

    r3074892 r3078450  
    44Requires at least:  5.7
    55Tested up to:  6.5
    6 Stable tag:  3.4.3
     6Stable tag:  3.4.4
    77License: GPLv2 (or later)
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    171171
    172172== Changelog ==
     173
     174= 3.4.4 (April 29, 2024) =
     175- [Fixed] Resolved an issue with comment cache not purging correctly.
     176- [Added] Support for purging paginated comments.
    173177
    174178= 3.4.3 (April 22, 2024) =
Note: See TracChangeset for help on using the changeset viewer.