Plugin Directory

Changeset 3091792


Ignore:
Timestamp:
05/23/2024 09:58:41 PM (23 months ago)
Author:
getpantheon
Message:

Update to version 2.0.0-RC1 from GitHub

Location:
pantheon-advanced-page-cache
Files:
14 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pantheon-advanced-page-cache/tags/2.0.0-RC1/pantheon-advanced-page-cache.php

    r3049387 r3091792  
    11<?php
    22/**
    3  * Plugin Name:     Pantheon Advanced Page Cache
    4  * Plugin URI:      https://wordpress.org/plugins/pantheon-advanced-page-cache/
    5  * Description:     Automatically clear related pages from Pantheon's Edge when you update content. High TTL. Fresh content. Visitors never wait.
    6  * Author:          Pantheon
    7  * Author URI:      https://pantheon.io
    8  * Text Domain:     pantheon-advanced-page-cache
    9  * Domain Path:     /languages
    10  * Version:         1.5.0
     3 * Plugin Name: Pantheon Advanced Page Cache
     4 * Plugin URI: https://wordpress.org/plugins/pantheon-advanced-page-cache/
     5 * Description: Automatically clear related pages from Pantheon's Edge when you update content. High TTL. Fresh content. Visitors never wait.
     6 * Author: Pantheon
     7 * Author URI: https://pantheon.io
     8 * Text Domain: pantheon-advanced-page-cache
     9 * Domain Path: /languages
     10 * Version: 2.0.0
     11 * Requires at least: 6.4
     12 * Tested up to: 6.5.3
    1113 *
    1214 * @package         Pantheon_Advanced_Page_Cache
     
    102104
    103105/**
     106 * Bootstrapper for namespaced files that aren't classes.
     107 *
     108 * Expects that a bootstrap() function exists in the namespaced file.
     109 *
     110 * @since 2.0.0
     111 * @return void
     112 */
     113function pantheon_bootstrap_namespaces() {
     114    $namespaced_files = [
     115        '\\Pantheon_Advanced_Page_Cache\\Admin_Interface' => __DIR__ . '/inc/admin-interface.php',
     116    ];
     117
     118    foreach ( $namespaced_files as $namespace => $file ) {
     119        if ( file_exists( $file ) ) {
     120            require $file;
     121            call_user_func( $namespace . '\\bootstrap' );
     122        } else {
     123            wp_die( esc_html( "Could not find $file" ), 'Pantheon Advanced Page Cache error' );
     124
     125        }
     126    }
     127}
     128
     129/**
    104130 * Registers the class autoloader.
    105131 */
     
    122148    }
    123149);
     150
     151/**
     152 * Init namespaced files.
     153 */
     154add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' );
    124155
    125156/**
  • pantheon-advanced-page-cache/tags/2.0.0-RC1/readme.txt

    r3059307 r3091792  
    22Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler
    33Tags: pantheon, cdn, cache
    4 Requires at least: 4.7
    5 Tested up to: 6.4.3
    6 Stable tag: 1.5.0
     4Requires at least: 6.4
     5Tested up to: 6.5.3
     6Stable tag: 2.0.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    151151This will prevent the cache from being purged if the given post type is updated.
    152152
     153= Setting the Cache Max Age with a filter =
     154
     155The cache max age setting is controlled by the [Pantheon Page Cache](https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin) admin page. As of 2.0.0, there are three cache age options by default — 1 week, 1 month, 1 year. Pantheon Advanced Page Cache automatically purges the cache of updated and related posts and pages, but you might want to override the cache max age value and set it programmatically. In this case, you can use the `pantheon_cache_default_max_age` filter added in [Pantheon MU plugin 1.4.0+](https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin#override-the-default-max-age). For example:
     156
     157    add_filter( 'pantheon_cache_default_max_age', function() {
     158        return 10 * DAY_IN_SECONDS;
     159    } );
     160
     161When the cache max age is filtered in this way, the admin option is disabled and a notice is displayed.
     162
    153163== WP-CLI Commands ==
    154164
     
    322332    add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2);
    323333
     334== Other Filters ==
     335
     336= `pantheon_apc_disable_admin_notices` =
     337Since 2.0.0, Pantheon Advanced Page Cache displays a number of admin notices about your current cache max age value. You can disable these notices with the `pantheon_apc_disable_admin_notices` filter.
     338
     339    add_filter( 'pantheon_apc_disable_admin_notices', '__return_true' );
     340
     341Alternately, the function callback is passed into the `pantheon_apc_disable_admin_notices` filter, allowing you to specify precisely _which_ notice to disable, for example:
     342
     343    add_filter( 'pantheon_apc_disable_admin_notices', function( $disable_notices, $callback ) {
     344        if ( $callback === '\\Pantheon_Advanced_Page_Cache\\Admin_Interface\\admin_notice_maybe_recommend_higher_max_age' ) {
     345            return true;
     346        }
     347        return $disable_notices;
     348    }, 10, 2 );
     349
     350The above example would disable _only_ the admin notice recommending a higher cache max age.
     351
    324352== Plugin Integrations ==
    325353
     
    333361
    334362== Changelog ==
     363= 2.0.0 (23 May 2024) =
     364* Adds new admin alerts and Site Health tests about default cache max age settings and recommendations [[#268](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/268), [#271](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/271)]. The default Pantheon GCDN cache max age value has been updated to 1 week in the [Pantheon MU plugin](https://github.com/pantheon-systems/pantheon-mu-plugin). For more information, see the [release note](https://docs.pantheon.io/release-notes/2024/04/pantheon-mu-plugin-1-4-0-update).
     365* Updated UI in Pantheon Page Cache admin page when used in a Pantheon environment (with the Pantheon MU plugin). [[#272](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/272)]
     366* Automatically updates the cache max age to the recommended value (1 week) if it was saved at the old default value (600 seconds). [[#269](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/269)]
     367
    335368= 1.5.0 (11 March 2024) =
    336369* Adds filter `pantheon_purge_post_type_ignored` to allow an array of post types to ignore before purging cache [[#258](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/258)]
     
    410443
    411444== Upgrade Notice ==
    412 
    413 = Latest =
     445= 2.0.0 (23 May 2024) =
     446This release requires a minimum WordPress version of 6.4.0. It uses Site Health checks and the `wp_admin_notices` function to alert users to the new cache max-age default settings and recommendations. The plugin will still function with earlier versions, but you will not get the benefit of the alerts and Site Health checks.
     447
     448This version also automatically updates the cache max age (set in the [Pantheon Page Cache settings](https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin)) to the recommended value (1 week) if it was saved at the old default value (600 seconds). If the cache max age was set to any other value (or not set at all), it will not be changed. A one-time notice will be displayed in the admin interface to inform administrators of this change.
     449
     450= 1.3.0 =
    414451Note that the Pantheon Advanced Page Cache 1.3.0 release now prefixes keys on a WordPress Multisite (WPMS) with the blog ID. For users who already have this plugin installed on a WPMS, they will need to click the Clear Cache button on the settings page to generate the prefixed keys.
  • pantheon-advanced-page-cache/trunk/pantheon-advanced-page-cache.php

    r3049387 r3091792  
    11<?php
    22/**
    3  * Plugin Name:     Pantheon Advanced Page Cache
    4  * Plugin URI:      https://wordpress.org/plugins/pantheon-advanced-page-cache/
    5  * Description:     Automatically clear related pages from Pantheon's Edge when you update content. High TTL. Fresh content. Visitors never wait.
    6  * Author:          Pantheon
    7  * Author URI:      https://pantheon.io
    8  * Text Domain:     pantheon-advanced-page-cache
    9  * Domain Path:     /languages
    10  * Version:         1.5.0
     3 * Plugin Name: Pantheon Advanced Page Cache
     4 * Plugin URI: https://wordpress.org/plugins/pantheon-advanced-page-cache/
     5 * Description: Automatically clear related pages from Pantheon's Edge when you update content. High TTL. Fresh content. Visitors never wait.
     6 * Author: Pantheon
     7 * Author URI: https://pantheon.io
     8 * Text Domain: pantheon-advanced-page-cache
     9 * Domain Path: /languages
     10 * Version: 2.0.0
     11 * Requires at least: 6.4
     12 * Tested up to: 6.5.3
    1113 *
    1214 * @package         Pantheon_Advanced_Page_Cache
     
    102104
    103105/**
     106 * Bootstrapper for namespaced files that aren't classes.
     107 *
     108 * Expects that a bootstrap() function exists in the namespaced file.
     109 *
     110 * @since 2.0.0
     111 * @return void
     112 */
     113function pantheon_bootstrap_namespaces() {
     114    $namespaced_files = [
     115        '\\Pantheon_Advanced_Page_Cache\\Admin_Interface' => __DIR__ . '/inc/admin-interface.php',
     116    ];
     117
     118    foreach ( $namespaced_files as $namespace => $file ) {
     119        if ( file_exists( $file ) ) {
     120            require $file;
     121            call_user_func( $namespace . '\\bootstrap' );
     122        } else {
     123            wp_die( esc_html( "Could not find $file" ), 'Pantheon Advanced Page Cache error' );
     124
     125        }
     126    }
     127}
     128
     129/**
    104130 * Registers the class autoloader.
    105131 */
     
    122148    }
    123149);
     150
     151/**
     152 * Init namespaced files.
     153 */
     154add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' );
    124155
    125156/**
  • pantheon-advanced-page-cache/trunk/readme.txt

    r3059307 r3091792  
    22Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler
    33Tags: pantheon, cdn, cache
    4 Requires at least: 4.7
    5 Tested up to: 6.4.3
    6 Stable tag: 1.5.0
     4Requires at least: 6.4
     5Tested up to: 6.5.3
     6Stable tag: 2.0.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    151151This will prevent the cache from being purged if the given post type is updated.
    152152
     153= Setting the Cache Max Age with a filter =
     154
     155The cache max age setting is controlled by the [Pantheon Page Cache](https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin) admin page. As of 2.0.0, there are three cache age options by default — 1 week, 1 month, 1 year. Pantheon Advanced Page Cache automatically purges the cache of updated and related posts and pages, but you might want to override the cache max age value and set it programmatically. In this case, you can use the `pantheon_cache_default_max_age` filter added in [Pantheon MU plugin 1.4.0+](https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin#override-the-default-max-age). For example:
     156
     157    add_filter( 'pantheon_cache_default_max_age', function() {
     158        return 10 * DAY_IN_SECONDS;
     159    } );
     160
     161When the cache max age is filtered in this way, the admin option is disabled and a notice is displayed.
     162
    153163== WP-CLI Commands ==
    154164
     
    322332    add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2);
    323333
     334== Other Filters ==
     335
     336= `pantheon_apc_disable_admin_notices` =
     337Since 2.0.0, Pantheon Advanced Page Cache displays a number of admin notices about your current cache max age value. You can disable these notices with the `pantheon_apc_disable_admin_notices` filter.
     338
     339    add_filter( 'pantheon_apc_disable_admin_notices', '__return_true' );
     340
     341Alternately, the function callback is passed into the `pantheon_apc_disable_admin_notices` filter, allowing you to specify precisely _which_ notice to disable, for example:
     342
     343    add_filter( 'pantheon_apc_disable_admin_notices', function( $disable_notices, $callback ) {
     344        if ( $callback === '\\Pantheon_Advanced_Page_Cache\\Admin_Interface\\admin_notice_maybe_recommend_higher_max_age' ) {
     345            return true;
     346        }
     347        return $disable_notices;
     348    }, 10, 2 );
     349
     350The above example would disable _only_ the admin notice recommending a higher cache max age.
     351
    324352== Plugin Integrations ==
    325353
     
    333361
    334362== Changelog ==
     363= 2.0.0 (23 May 2024) =
     364* Adds new admin alerts and Site Health tests about default cache max age settings and recommendations [[#268](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/268), [#271](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/271)]. The default Pantheon GCDN cache max age value has been updated to 1 week in the [Pantheon MU plugin](https://github.com/pantheon-systems/pantheon-mu-plugin). For more information, see the [release note](https://docs.pantheon.io/release-notes/2024/04/pantheon-mu-plugin-1-4-0-update).
     365* Updated UI in Pantheon Page Cache admin page when used in a Pantheon environment (with the Pantheon MU plugin). [[#272](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/272)]
     366* Automatically updates the cache max age to the recommended value (1 week) if it was saved at the old default value (600 seconds). [[#269](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/269)]
     367
    335368= 1.5.0 (11 March 2024) =
    336369* Adds filter `pantheon_purge_post_type_ignored` to allow an array of post types to ignore before purging cache [[#258](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/258)]
     
    410443
    411444== Upgrade Notice ==
    412 
    413 = Latest =
     445= 2.0.0 (23 May 2024) =
     446This release requires a minimum WordPress version of 6.4.0. It uses Site Health checks and the `wp_admin_notices` function to alert users to the new cache max-age default settings and recommendations. The plugin will still function with earlier versions, but you will not get the benefit of the alerts and Site Health checks.
     447
     448This version also automatically updates the cache max age (set in the [Pantheon Page Cache settings](https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin)) to the recommended value (1 week) if it was saved at the old default value (600 seconds). If the cache max age was set to any other value (or not set at all), it will not be changed. A one-time notice will be displayed in the admin interface to inform administrators of this change.
     449
     450= 1.3.0 =
    414451Note that the Pantheon Advanced Page Cache 1.3.0 release now prefixes keys on a WordPress Multisite (WPMS) with the blog ID. For users who already have this plugin installed on a WPMS, they will need to click the Clear Cache button on the settings page to generate the prefixed keys.
Note: See TracChangeset for help on using the changeset viewer.