From cd7dbcf31e53f489813b2814d22deca6b8b24bb5 Mon Sep 17 00:00:00 2001 From: Damian Taggart <4309872+attackant@users.noreply.github.com> Date: Fri, 15 Mar 2024 09:35:35 -0600 Subject: [PATCH] Refactor and update wp-404-caching to version 1.0.2 The main wp-404-caching class was deleted and the `Feature_Manager` setup was moved directly into the main plugin file. --- CHANGELOG.md | 4 ++++ README.md | 2 +- src/class-wp-404-caching.php | 25 ------------------------- wp-404-caching.php | 11 +++++++---- 4 files changed, 12 insertions(+), 30 deletions(-) delete mode 100644 src/class-wp-404-caching.php diff --git a/CHANGELOG.md b/CHANGELOG.md index cc7f1e6f..9e0e9fc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `WP 404 Caching` will be documented in this file. +## 1.0.2 + +- Fixed issue with Feature_Manager setup + ## 1.0.1 - Initial release diff --git a/README.md b/README.md index 7f2dd0f4..9295f749 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A WordPress plugin to provide full page caching for 404 pages, improving perform - **Contributors**: alleyinteractive - **Tags**: alleyinteractive, wp-404-caching -- **Stable tag**: 1.0.1 +- **Stable tag**: 1.0.2 ## Requirements - SSL enabled on the website. diff --git a/src/class-wp-404-caching.php b/src/class-wp-404-caching.php deleted file mode 100644 index 9a941631..00000000 --- a/src/class-wp-404-caching.php +++ /dev/null @@ -1,25 +0,0 @@ - [], - ] - ); - } -} diff --git a/wp-404-caching.php b/wp-404-caching.php index a0b3940b..4e5dabf8 100644 --- a/wp-404-caching.php +++ b/wp-404-caching.php @@ -3,7 +3,7 @@ * Plugin Name: WP 404 Caching * Plugin URI: https://github.com/alleyinteractive/wp-404-caching * Description: Full Page Cache for WordPress 404s - * Version: 1.0.1 + * Version: 1.0.2 * Author: Alley * Author URI: https://github.com/alleyinteractive/wp-404-caching * Requires at least: 6.3 @@ -17,6 +17,9 @@ namespace Alley\WP\WP_404_Caching; +use Composer\InstalledVersions; +use function add_action; + if ( ! defined( 'ABSPATH' ) ) { exit; } @@ -32,8 +35,8 @@ // to see if the Composer dependencies have been installed in a parent // folder. This is useful for when the plugin is loaded as a Composer // dependency in a larger project. - if ( ! class_exists( \Composer\InstalledVersions::class ) ) { - \add_action( + if ( ! class_exists( InstalledVersions::class ) ) { + add_action( 'admin_notices', function () { ?> @@ -61,7 +64,7 @@ function () { function main(): void { // This should be an array with keys set to feature classnames and arguments. $features = [ - // Add initial features here. + 'Alley\WP\WP_404_Caching\Features\Full_Page_Cache_404' => [], ]; $features = apply_filters( 'wp_404_caching_features', $features ); Feature_Manager::add_features( $features );