A WordPress plugin for disabling selected features and configuring resource hints. Choose the options that suit your site and check their effects on your theme and plugins.
- Header Cleanup: Remove generator output from the page head and feeds, RSD links from the page head, shortlinks and the REST API link from the page head and the HTTP response header, and oEmbed discovery and feed links from the page head
- Script Optimization: Disable WordPress emojis, remove jQuery Migrate, and limit the Heartbeat (off on the front end, every 120 seconds on admin screens outside the editors)
- Style Optimization: Remove inline styles from recent comments widget and disable classic theme styles
- Editor and Admin: Stop loading patterns from the WordPress.org Pattern Directory, and turn off WordPress's AI support
- Resource Hints: Configure DNS prefetch and preconnect for HTTPS domains used by your site
- Jetpack Promotions: Disable Jetpack promotional messages and Blaze promotions
- Autoloaded Options: A tab on the settings page that lists the options WordPress loads on every page, largest first, with the plugin or theme each probably belongs to (from folder names, a search of the installed code, or a recording of which options pages read); stop loading the ones you select, with an automatic check that undoes a change that breaks the home page or the dashboard, and WP-CLI commands to restore everything
- Explained Settings: Every setting says what it does, its effect on the site, and its performance gain or cost
- Download the latest release from the releases page
- Upload the plugin files to the
/wp-content/plugins/enginescript-site-optimizerdirectory - Activate the plugin from the Plugins menu in WordPress
- Configure the plugin under Settings > Site Optimizer
- Navigate to the Site Optimizer menu in your WordPress admin dashboard (under Settings)
- Enable the optimization features you want to use
- Configure resource hint domains if needed
- Save your changes
All feature toggles start disabled. On multisite, configure each site's settings separately; network activation does not create shared network settings.
Preconnect and DNS Prefetch lists start empty. Optional domain suggestions appear as selectable text below each field. Copy only the domains your site uses, enable the setting and save. Existing saved lists are preserved.
Enter one HTTPS domain per line, such as https://cdn.example.com. Paths other
than a trailing slash, query strings, fragments and credentials are rejected.
Preconnect accepts an omitted port or port 443. DNS prefetch uses only the
domain name, even if an accepted entry includes a port. Each entry must be valid
as written: a malformed port, for example, is rejected and not corrected.
Each list allows 32,768 bytes in total, 100 nonblank lines and 512 bytes per nonblank line. These limits apply before trimming or removing duplicate and invalid entries. Empty or ASCII-space-only lines are blank.
Saving a blank list clears it. Within the limits, invalid entries are omitted; an entirely invalid list is saved empty. A malformed or oversized submission retains the previous list. An oversized saved list produces no plugin hints until corrected. Legacy custom-port preconnect entries are skipped without rewriting their saved text until you explicitly save the settings.
Use hints for domains your pages actually need and measure their effect on your site. Browsers decide whether to use them; adding a hint does not establish a performance improvement. The plugin adds its hints to front-end pages only, not to the admin area or the login screen.
Settings submissions use WordPress Settings API nonce and capability checks. The plugin checks the input type and the original text of each domain, escapes settings output for its context, and reports rejected lines without repeating submitted domains or credentials.
Domain validation rejects IP literals, localhost and configured reserved domain name suffixes. It checks domain name syntax without resolving DNS. An accepted domain can still resolve to a private address in a visitor's environment; the plugin does not verify its DNS destination or connect to the domain from the server.
The repository configures coding standards, static analysis, dependency checks, unit tests, native WordPress tests and WordPress Plugin Check in GitHub Actions. Passing results must be checked against the exact commit and resolved tool versions. Plugin Check provides automated checks; passing them does not guarantee WordPress.org approval or replace manual review.
Compatibility depends on which features your theme and plugins use. Enable options one at a time and check the affected pages, editor and admin screens.
jQuery Migrate supports older jQuery APIs. Removing it can affect scripts that depend on those APIs. Check your theme and plugins before enabling this option.
This option disables selected WordPress emoji scripts, styles and conversion filters. Check emoji rendering in the site, editor, feeds and email if you use those features.
The option removes WordPress's generator output from the page head and from feeds. Other version indicators, such as version arguments on asset URLs, can remain. It does not fix vulnerabilities or replace WordPress, theme and plugin updates.
Deactivation retains settings. Deleting the plugin through WordPress runs its uninstall cleanup, including separate site settings across multisite networks. Pause site creation and settings changes during removal. Large installations may need an operator-run uninstall with sufficient time and memory. If cleanup fails, the plugin files stay in place and the message gives the reason and, on a network, the IDs of the sites that could not be cleaned. Resolve the reported problem and retry removal.
Options you stopped from loading on every page on the Autoloaded Options tab are loaded on every page again before anything is deleted, with the exact autoload setting each one had, on every site of a network. An option whose setting other code has changed since is left alone. If an option cannot be restored, nothing on that site is deleted and the uninstall stops. Deactivation changes nothing. While any option is switched off, the Autoloaded Options tab and the plugin's row on the Plugins screen say so.
It rarely does, because code that needs the option still gets it. After each
change the plugin loads the home page and the dashboard, and undoes the change
if either answers with a server error. To undo every change from the command
line, run wp site-optimizer autoload restore --all. If a plugin keeps WP-CLI
from starting, skip every plugin and theme and load only the command:
wp --skip-plugins --skip-themes \
--require=wp-content/plugins/enginescript-site-optimizer/includes/class-es-optimizer-autoload-command.php \
site-optimizer autoload restore --all- Plugin runtime: PHP 8.3 or higher and WordPress 7.0 or higher
- Development tools: Composer and a PHP version that satisfies
composer.json
- Clone this repository:
git clone https://github.com/EngineScript/enginescript-site-optimizer.git - Install the development tools:
composer install --no-interaction --prefer-dist, thennpm ci. Both lock files are tracked, so your machine and CI install the same versions of the tools. These tools are separate from the plugin's PHP 8.3 runtime minimum. - Run the static checks and the unit tests with
composer check-all. - Submit changes for the WordPress Compatibility workflow.
composer test runs the unit suite on any machine. The workflow runs it as well,
before selecting PHPUnit 9.6 for the native WordPress tests. Those tests run in the
workflow only: it generates its installer, native bootstrap, tests and config on the
runner, and there is no checked-in local WordPress installer.
The declared plugin minimum is PHP 8.3. The workflow covers PHP 8.3–8.5 with WordPress 7.0, latest and nightly, plus a lowest-dependency lane. A compatibility claim requires a successful run for the exact reviewed commit and resolved versions. Static analysis and a Composer installation alone do not establish it.
This repository uses GitHub Actions to test the plugin against supported PHP and WordPress versions. The compatibility workflow runs WordPress Plugin Check, PHPCS, PHPMD, Psalm, PHPStan, dependency security checks, and generated WordPress integration tests.
The GitHub workflow defines isolated unit and generated native WordPress tests. Its configured matrix includes:
- PHP versions: 8.3, 8.4, 8.5
- WordPress versions: 7.0, latest, nightly
Compatibility acceptance requires a successful run for the exact source commit; the configured matrix alone does not establish a passing result.
Contributions are welcome. Please feel free to submit a pull request.
- Fork the project
- Create your feature branch:
git checkout -b feature/new-optimization - Commit your changes:
git commit -m 'Add some new optimization' - Push to the branch:
git push origin feature/new-optimization - Open a Pull Request
This project is licensed under the GPL-3.0-or-later license. See the LICENSE file for details.
See CHANGELOG.md for a list of changes in each release.
- Developed by EngineScript
- Special thanks to all contributors
For support, please open an issue in the GitHub repository or contact us at support@enginescript.com.
Report suspected vulnerabilities privately using SECURITY.md.