keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

refactor code base and restyle settings #84

Closed coreykn closed 4 years ago

coreykn commented 4 years ago

Refactor code base to (mostly) follow WordPress coding standards. Soft tabs with the tab length 4 are used for indentation (instead of hard tabs). Associative arrays have each item on a new line. Arrays are declared with long syntax and have trailing commas. When using multiline PHP snippets within HTML block the PHP open and close tags are now on a line by themselves. Spaces, lots of spaces. Update error messages to increase usefulness. Add @change to code documentation to avoid reformatting for clean future diffs.

Update settings. Improve the settings page style. Change the Cache Behavior options order to group all options that clear the complete cache. Change the Cache Inclusions from "GET attributes" to "URL query parameters" to improve understanding of functionality. Remove HTML from translatable strings like in PR #31. Use esc_html__() and esc_html_e() instead of __() and _e() for translatable strings to ensure safe HTML output.

Remove path cache bypass check from advanced-cache.php because the path will never be cached if excluded so checking twice is not required. Update the _bypass_cache() method:

Update outbound links to KeyCDN and Optimus to avoid unnecessary 301 redirects. Update outbound link to WordPress because the page was moved. Correct brand name style (WordPress, WooCommerce, and WP-CLI).

Implements: #80