Skip to content

Commit

Permalink
Refactor and update wp-404-caching to version 1.0.2
Browse files Browse the repository at this point in the history
The main wp-404-caching class was deleted and the `Feature_Manager` setup was moved directly into the main plugin file.
  • Loading branch information
attackant committed Mar 15, 2024
1 parent 02a2828 commit cd7dbcf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 30 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
25 changes: 0 additions & 25 deletions src/class-wp-404-caching.php

This file was deleted.

11 changes: 7 additions & 4 deletions wp-404-caching.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,6 +17,9 @@

namespace Alley\WP\WP_404_Caching;

use Composer\InstalledVersions;
use function add_action;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Expand All @@ -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 () {
?>
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit cd7dbcf

Please sign in to comment.