Changeset 3091792
- Timestamp:
- 05/23/2024 09:58:41 PM (23 months ago)
- Location:
- pantheon-advanced-page-cache
- Files:
-
- 14 added
- 4 edited
- 1 copied
-
assets/screenshots (added)
-
assets/screenshots/page-cache-max-age-filtered.png (added)
-
tags/2.0.0-RC1 (copied) (copied from pantheon-advanced-page-cache/trunk)
-
tags/2.0.0-RC1/assets (added)
-
tags/2.0.0-RC1/assets/sass (added)
-
tags/2.0.0-RC1/assets/sass/main.scss (added)
-
tags/2.0.0-RC1/assets/sass/mixins.scss (added)
-
tags/2.0.0-RC1/assets/sass/styles.scss (added)
-
tags/2.0.0-RC1/inc/admin-interface.php (added)
-
tags/2.0.0-RC1/pantheon-advanced-page-cache.php (modified) (3 diffs)
-
tags/2.0.0-RC1/readme.txt (modified) (5 diffs)
-
trunk/assets (added)
-
trunk/assets/sass (added)
-
trunk/assets/sass/main.scss (added)
-
trunk/assets/sass/mixins.scss (added)
-
trunk/assets/sass/styles.scss (added)
-
trunk/inc/admin-interface.php (added)
-
trunk/pantheon-advanced-page-cache.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pantheon-advanced-page-cache/tags/2.0.0-RC1/pantheon-advanced-page-cache.php
r3049387 r3091792 1 1 <?php 2 2 /** 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 11 13 * 12 14 * @package Pantheon_Advanced_Page_Cache … … 102 104 103 105 /** 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 */ 113 function 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 /** 104 130 * Registers the class autoloader. 105 131 */ … … 122 148 } 123 149 ); 150 151 /** 152 * Init namespaced files. 153 */ 154 add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' ); 124 155 125 156 /** -
pantheon-advanced-page-cache/tags/2.0.0-RC1/readme.txt
r3059307 r3091792 2 2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler 3 3 Tags: pantheon, cdn, cache 4 Requires at least: 4.75 Tested up to: 6. 4.36 Stable tag: 1.5.04 Requires at least: 6.4 5 Tested up to: 6.5.3 6 Stable tag: 2.0.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 151 151 This will prevent the cache from being purged if the given post type is updated. 152 152 153 = Setting the Cache Max Age with a filter = 154 155 The 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 161 When the cache max age is filtered in this way, the admin option is disabled and a notice is displayed. 162 153 163 == WP-CLI Commands == 154 164 … … 322 332 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2); 323 333 334 == Other Filters == 335 336 = `pantheon_apc_disable_admin_notices` = 337 Since 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 341 Alternately, 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 350 The above example would disable _only_ the admin notice recommending a higher cache max age. 351 324 352 == Plugin Integrations == 325 353 … … 333 361 334 362 == 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 335 368 = 1.5.0 (11 March 2024) = 336 369 * 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)] … … 410 443 411 444 == Upgrade Notice == 412 413 = Latest = 445 = 2.0.0 (23 May 2024) = 446 This 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 448 This 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 = 414 451 Note 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 1 1 <?php 2 2 /** 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 11 13 * 12 14 * @package Pantheon_Advanced_Page_Cache … … 102 104 103 105 /** 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 */ 113 function 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 /** 104 130 * Registers the class autoloader. 105 131 */ … … 122 148 } 123 149 ); 150 151 /** 152 * Init namespaced files. 153 */ 154 add_action( 'plugins_loaded', 'pantheon_bootstrap_namespaces' ); 124 155 125 156 /** -
pantheon-advanced-page-cache/trunk/readme.txt
r3059307 r3091792 2 2 Contributors: getpantheon, danielbachhuber, kporras07, jspellman, jazzs3quence, ryanshoover, rwagner00, pwtyler 3 3 Tags: pantheon, cdn, cache 4 Requires at least: 4.75 Tested up to: 6. 4.36 Stable tag: 1.5.04 Requires at least: 6.4 5 Tested up to: 6.5.3 6 Stable tag: 2.0.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 151 151 This will prevent the cache from being purged if the given post type is updated. 152 152 153 = Setting the Cache Max Age with a filter = 154 155 The 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 161 When the cache max age is filtered in this way, the admin option is disabled and a notice is displayed. 162 153 163 == WP-CLI Commands == 154 164 … … 322 332 add_filter('pantheon_should_add_terms', 'custom_should_add_terms', 10, 2); 323 333 334 == Other Filters == 335 336 = `pantheon_apc_disable_admin_notices` = 337 Since 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 341 Alternately, 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 350 The above example would disable _only_ the admin notice recommending a higher cache max age. 351 324 352 == Plugin Integrations == 325 353 … … 333 361 334 362 == 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 335 368 = 1.5.0 (11 March 2024) = 336 369 * 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)] … … 410 443 411 444 == Upgrade Notice == 412 413 = Latest = 445 = 2.0.0 (23 May 2024) = 446 This 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 448 This 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 = 414 451 Note 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.