Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial release #4

Merged
merged 40 commits into from
Mar 12, 2024
Merged

Initial release #4

merged 40 commits into from
Mar 12, 2024

Conversation

attackant
Copy link
Member

@attackant attackant commented Mar 12, 2024

As titled

dependabot bot and others added 30 commits March 7, 2024 16:59
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.3.3 to 5.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.3.3...v5.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…ypescript-5.4.2

Bump typescript from 5.3.3 to 5.4.2
…ugin

The commit removes defunct CI pipeline configuration and obsolete PHP class files. This helps to clean up the project layout. Moreover, the `wp-404-caching` WordPress plugin and the associated PHP class has been added, as well as a configuration file to tweak the plugin as per requirements.
An adjustment was made to the WP_404_Caching plugin usage example in the README.md file to correct a class instantiation error. Previously, the class namespace was being repeated, which could cause errors when trying to use the plugin. The corrected example now accurately reflects how to properly instantiate the class in PHP.
The minimum supported WordPress version and the versions tested up to have been updated in wp-404 caching plugin and its documentation. This ensures the plugin's compatibility with the updated WordPress versions, preparing it for latest WordPress capabilities and to avoid potential issues arising from using deprecated functions or features.
Bumps [@alleyinteractive/block-editor-tools](https://github.com/alleyinteractive/alley-scripts) from 0.6.4 to 0.7.0.
- [Release notes](https://github.com/alleyinteractive/alley-scripts/releases)
- [Changelog](https://github.com/alleyinteractive/alley-scripts/blob/main/CHANGELOG.md)
- [Commits](https://github.com/alleyinteractive/alley-scripts/compare/@alleyinteractive/block-editor-tools@0.6.4...@alleyinteractive/block-editor-tools@0.7.0)

---
updated-dependencies:
- dependency-name: "@alleyinteractive/block-editor-tools"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…lleyinteractive/block-editor-tools-0.7.0

Bump @alleyinteractive/block-editor-tools from 0.6.4 to 0.7.0
Package dependencies in wp-404-caching plugin have been updated. The 'node' and 'npm' versions were upgraded while all WordPress related dependencies were updated to the latest versions. This ensures our plugin remains compatible with the latest versions of dependencies and reduces potential future security and compatibility issues.
The WP 404 caching plugin's package-lock.json was modified to downgrade the version of the babel-preset-default and warning packages. The changes ensure that our plugin remains compatible with the specific versions of these dependencies, mitigating potential compatibility issues.
The path to the test files in the autoload-dev section of composer.json has been corrected. The double backslash was missing in the original path and this was causing issues with the loading of test files - this fix resolves that issue.
A new class file was created to handle Full Page Caching for 404s in the wp-404-caching plugin. This class includes features like fetching 404 Page Cache on template_redirect and replenishing the cache every hour. This addition enhances plugin performance by caching 404 pages and reducing unnecessary database hits.
The update introduces the Full Page Cache 404 feature to the wp-404-caching plugin. A constructor has been added to the main plugin class to initialize the new feature.
The update adds a method call of with_object_cache() to the test manager initialization in bootstrap.php for the wp-404-caching plugin. This improves test environment setup by ensuring object caching is enabled before running the tests.
The .phpcs.xml file in the wp-404-caching plugin is updated with a new prefix in its properties. The new added prefix is "Alley_WP_WP_404_Caching". This update include functionality related to that specific prefix.
A file titled ExampleFeatureTest.php has been deleted and replaced with FullPageCache404Test.php. The new PHP file includes a comprehensive test suite for Full Page Cache for 404 pages, including tests for SSL usage, object caching, content manipulation, and correct HTTP responses for various scenarios. These changes replace placeholder testing with functional, substantive tests.
The phpstan-param annotation in the add_features method of the wp-404-caching plugin's Feature Manager was updated. This modification improves code clarity by specifying 'string' as the key type of the first-level array in the parameter, ensuring clearer type hinting for developers and better code comprehension.
The condition to validate whether a cache is not empty has been updated for the wp-404-caching plugin. The new condition not only checks for an empty cache but also if it is a string. This improvement enhances cache handling accuracy and error prevention.
The HTTP header name 'X-WP_404_Caching-404-Cache' has been updated to 'X-WP-404-Cache' in class-full-page-cache-404 and all its instances within the project. Similarly, the unit tests have been updated to reflect these changes ensuring consistency in the caching system.
This commit includes modifications to the wp-404-caching plugin and its corresponding tests. The unnecessary typecasting to boolean in various test conditions has been removed. Also, the name of the scheduled task has been corrected from 'wp_404_caching_single' to 'wp_404_cache_single' in the tests. Lastly, the URI in the test html codes has been updated to '/wp-404-caching/404-template-generator'.
The README file for the WP 404 Caching plugin has been greatly improved. It now provides more comprehensive details about the plugin's purpose, requirements, features, installation instruction, usage, removing unnecessary details. The tested WordPress version is also updated. These changes improve documentation and transparency for new users or developers coming to the project.
Added a new element value "wp_404_cache" in the prefixes property of .phpcs.xml for the WP 404 caching plugin. This update brings consistency in naming and provides clear configuration directives for the plugin.
The README.md file for the WP 404 caching plugin has been updated to provide clearer and more detailed instructions. The new instructions illustrate how to configure cache time and stale cache time using the 'wp_404_caching_cache_time' and 'wp_404_caching_stale_cache_time' filters, respectively.
…lass

Added DEFAULT_CACHE_TIME and DEFAULT_STALE_CACHE_TIME constants to class-full-page-cache-404.php. Also introduced respective getter methods for each one of them: get_cache_time() and get_stale_cache_time(). Consequently updated the calls in set_cache() method to use these getters.
Improved the code comments for the get_stale_cache method in the class-full-page-cache-404.php file. The changes provide a more comprehensive explanation of the method's return values.
The constant CACHE_TIME was removed from the class-full-page-cache-404.php file. In addition, redundancy in casting to boolean was removed in an if-statement where the function wp_using_ext_object_cache() is used, improving code readability and efficiency.
Added a new test in FullPageCache404Test.php to verify modification of cache times via filters. This includes checks to ensure caching times are correctly modified and cleanup to remove added filters after test completion. This will help to ensure the reliability of cache time modifications in future updates.
The version number of WP 404 caching plugin has been updated from 0.0.1 to 1.0.0.
The plugin version of WP 404 Caching has been updated from 1.0.0 to 1.0.1 in multiple files including: CHANGELOG.md, wp-404-caching.php, README.md. The new version reference is properly documented in all these files.
Copy link
Member

@goodguyry goodguyry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸 Really cool! In addition to my comments, some docblock @return tags have a description and other don't. My view is a return description is often redundant based on the function description and/or name, but we should be consistent about whether or not we include one.

Comment on lines 13 to +14
with:
node: 16
node: 20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing we can roll with defaults, since there's no JS in this plugin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RE: your above comment about returns in docblocks, I'm only adding explanation when the return isn't obvious, ie in the case mixed primarily and when the return comes from a called function. Keeping 20 LTS version here for now. Otherwise, I've made all of your other suggested changes, thank you! 🤘🏼

README.md Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
src/features/class-full-page-cache-404.php Outdated Show resolved Hide resolved
src/features/class-full-page-cache-404.php Outdated Show resolved Hide resolved
src/features/class-full-page-cache-404.php Show resolved Hide resolved
attackant and others added 4 commits March 12, 2024 14:57
rm unneeded commands

Co-authored-by: Ryan Domingue <goodguyry@users.noreply.github.com>
The autoloader paths for both the main class and the test class in the WP 404 Caching plugin's composer.json file were corrected. The updated paths now correctly reference the respective directories.
Removed the unused constant representing stale cache time in the WP 404 Caching plugin. Additionally, rearranged the conditions in the action__template_redirect function so the 404 status check occurs before the user login status check.
@attackant attackant merged commit 1e9f2e2 into develop Mar 12, 2024
6 checks passed
@attackant attackant deleted the initial-release branch March 15, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants