- Contributors: bobbingwide, vsgloik
- Donate link: https://www.oik-plugins.com/oik/oik-donate/
- Tags: oik, plugin, unloader
- Requires at least: 5.8.1
- Tested up to: 6.9
- Stable tag: 0.4.0
WordPress Must Use plugin to unload unnecessary plugins on demand.
Use the oik-unloader plugin to unload unnecessary plugins on demand.
Many websites have lots of plugins activated because the functionality is sometimes needed. But quite a few of these plugins:
- think they're needed all the time,
- do a lot of processing for each incoming request,
- only to find that there was no need for the work that they'd done.
These slow the server side processing of the site. This can increase the server response time; time to first byte. The plugins can also slow the front end of the site; delivering scripts, CSS and even HTML and images that are not actually needed.
Dynamically unloading a subset of plugins for certain requests could improve the overall performance of the site. This could help improve the Core Web Vitals which may lead to better rankings in Search Engine Results Pages ( SERPs ).
- Upload the contents of the oik-unloader plugin to the `/wp-content/plugins/oik-unloader' directory
- Activate the oik-unloader plugin through the 'Plugins' menu in WordPress
- Visit the oik-unloader admin page
- Use the admin interface to select which plugins to deactivate for selected URLs
- Click on the link to activate/update the Must Use ( MU ) plugin
- Disable the MU logic using the Deactivate link
- Note: In a WordPress Multi Site installation
- There will only be one version of the Must Use plugin ( oik-unloader-mu.php )
- There will be multiple unloader files; one per site.
Performance tweaking.
- It helps to reduce the number of activated plugins for a particular request.
- It dynamically removes the unwanted plugins from the list of plugins to be activated.
- The plugin temporarily deactivates plugins for the specific URL.
- It doesn't unload them, it prevents the plugins from being loaded.
For certain URLs you should be able to deactivate a whole host of plugins that aren't actually required for the front end. You may find that some plugins are extremely well behaved and it won't make the slightest difference if they're left activated.
By targetting specific URLs you can deactivate plugins that you're certain are not needed. For example, you may have a number of posts that display charts. For these you will need to ensure that the chart plugin is activated. For any other post, the plugin that displays the charts doesn't need to be activated. If it improves the performance, then you may consider deactivating the chart plugin for these other posts. The tweaking is intended to get the best performance for specific URLs. Concentrate on the most visited pages first and deactivate only those plugins that you know you can safely deactivate.
It's primarily the front end experience that we want to improve.
When using the WordPress admin interface you'll expect each of the plugins to operate correctly. Therefore you would expect the plugins to be activated. The REST API and AJAX requests should also produce the expected results.
- oik-loader admin page - plugins
- oik-loader admin page - oik-loader-mu not activated
- oik-loader admin page - oik-loader-mu activated
Update for accessibility improvements to the active-plugins block
Update for PHP 8.4 - tested manually
- Changed: A11y - try adding aria-label attr to local implementation of icheckbox() #15
- Fixed: Corect load_dir_files() method #14
- Tested: With WordPress 6.9
- Tested: With PHP 8.3
- Tested: With PHPUnit 9.6
- Changed: Support PHP 8.4 #14
See also oik-loader which adds plugins to the list of plugins to activate.
If you want to read more about oik plugins and themes then please visit oik-plugins
