Servebolt WordPress Optimizer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Robert Sæther 42998f5fe4
Merge pull request #92 from Servebolt/WPSO-46
2 months ago
.github/workflows Attempt to clean up before deploying plugin to wordpress.org 7 months ago
.phan Added phan static analyzer 7 months ago
admin Attempt to prevent autocompletion (added more unique IDs to input fields along adding autocomplete attribute) 2 months ago
assets/src Attempt to prevent autocompletion (added more unique IDs to input fields along adding autocomplete attribute) 2 months ago
bin Added WP Unit test environment 2 months ago
classes Added command to purge cron cache queue 4 months ago
cli Bugfix in shonky settings system 2 months ago
tests Added WP Unit test environment 2 months ago
.babelrc Added base-files 7 months ago
.distignore Deploy adjustments 1 year ago
.eslintignore Added base-files 7 months ago
.eslintrc Added base-files 7 months ago
.gitignore Added phan static analyzer 7 months ago
LICENSE Initial commit 3 years ago
README.md Documented phan-setup 7 months ago
Readme.txt Updated version number 5 months ago
assets.php Prevented gutenberg-related files from loading when not needed 7 months ago
cleanup.sh Updated deployment cleanup file to include test-related files 2 months ago
composer-missing.php Minor typo fix 1 year ago
composer.json Added WP Unit test environment 2 months ago
composer.lock Added WP Unit test environment 2 months ago
functions.php Changed the cache purge logic in regards to paginated URLs - we are now just running WP_Query to determine how many pages are needed 7 months ago
index.php Added base-files 7 months ago
non-php7.php Completed multisite-support for WP CLI commands, minor refactor 1 year ago
package.json Removed engine-property from package.json 7 months ago
phpunit.xml.dist Added WP Unit test environment 2 months ago
postcss.config.js Started using yarn instead of npm, added scaffolding for cache purge event handling when term/post slug/url gets changed, added conditional display to post purge button when editing with gutenberg, updated deployscript to attempt to build assets using Github actions 7 months ago
servebolt-optimizer.php Bugfix in shonky settings system 2 months ago
uninstall.php Added fix to remove cache headers when plugin is removed/deactivated 7 months ago
webpack.config.js SBWP-20 Fixed issue with assets, improved consistency in sweetalert2 appearance 7 months ago
yarn.lock Started using yarn instead of npm, added scaffolding for cache purge event handling when term/post slug/url gets changed, added conditional display to post purge button when editing with gutenberg, updated deployscript to attempt to build assets using Github actions 7 months ago

README.md

Servebolt Optimizer

Note: this document is WIP!

This repository contains the WordPress plugin Servebolt Optimizer - a plugin that:

  • optimizes your WordPress site
  • gives you neat features related to Cloudflare's services (cache purge, image resize)
  • gives you additional benefits when hosting your site at Servebolt

Development

Build assets

  1. Run yarn install
  2. Run yarn build for local or yarn production for production

Phan - static analyzer for PHP

Phan helps identifying errors in your code.

Let's start by setting it up:

  1. Run composer install
  2. Run composer test

But Phan also needs to parse the code that is not part of the plugin to get things right. Add a folder called wp-sources to the repo, this file will be ignored by Git. Then add the following folders to it:

You can download them or just check them out using Git. I also like to symlink the folder in to the plugin folder, so that you can reuse it for other WP plugins using Phan. Now the static analyzer will analyze the plugin while still having access to the source code. If not the analyzer will complain a lot about functions, methods and classes that does not exist.