Skip to content

Repository files navigation

WP Optimizer

Welcome to the WP Optimizer repository on GitHub.

Author License: CC-NC Donate Repo Link

Here you can browse the source, look at open issues and keep track of development.

If you are not a developer, please use the WP Optimizer plugin page on WordPress.org.

Description

WP Optimizer is a modular WordPress optimization toolkit for performance, maintenance, diagnostics and site control. It brings together the common tools needed to keep a WordPress installation fast and easy to maintain: cache, media optimization, database managment, Page Test diagnostics, update controls, configuration backups and module resets.

Performance and cache

  • Layered cache storage: the shared WPS cache uses request memory first, Redis (or Memcached) when available, and WPS Storage as the durable fallback under WP_CONTENT_DIR/cache. Positive lifetimes are applied to both remote and disk entries; a zero lifetime is request-local and is not persisted. WP Optimizer's static page, WP_Query and database-query caches continue to use their dedicated WPS Storage groups and independent lifetime, purge and exclusion rules.
  • Safe compatibility defaults: compatible with WooCommerce and with editing and preview flows from Elementor, Beaver Builder, Divi, Gutenberg, Bricks, Oxygen and Breakdance. Builder requests bypass cache and output optimization, preserving generated assets and markup.
  • Protected and extensible behavior: built-in exclusions cannot be removed, but filters can add project-specific routes, request signatures and assets. Invalid or missing direct-cache configuration is regenerated in a disabled fail-safe state.

Maintenance and diagnostics

  • Database and scheduling tools: maintain tables, create database backups, review wp_options autoload data and manage WordPress cron events and custom schedules. On WordPress Multisite, site administrators retain Database Manager access, while SQL script execution requires the manage_network_options capability.
  • Multisite lifecycle: network-wide activation, upgrades and deactivation are applied independently to every site while preserving each site's settings, cron state and database-table prefix.
  • Four-stage Page Test: scans a site URL with a signed optimization/cache-bypass request, an empty current-configuration pass, a diagnostic warmup and a final measured signed request using the current configuration.
  • Actionable diagnostics: the warmup identifies slow or repeated queries, heavier hooks, callback samples and memory/query totals. Runtime HTML transformations use ordered handlers in the WPS html_output_buffer service, with PageSpeed processing before final HTML minification.
  • Navigation prefetch: enabling early page prefetching uses WordPress Core speculation rules with moderate eagerness on WordPress 6.8+ when Core defaults are unchanged; explicit site and hosting settings remain in control. Older versions retain the hover/touch prefetch script. Core's default speculative loading remains active even when this PageSpeed option is off. A separate switch can disable Core speculative loading when it causes unwanted requests; it does not affect the older script.
  • AVIF conversion: Media Optimizer can convert selected images to AVIF with the same replacement workflow used for WebP. AVIF takes priority when both conversion options are enabled. If encoding fails, the source file and attachment metadata remain unchanged. Generated server rules include the image/avif MIME type.

Configuration safety

  • Automatic backups: configuration snapshots are created before settings changes, throttled to prevent duplicate autosaves and limited to the 50 newest entries.
  • Safe module resets: after confirmation, individual modules can be restored to factory settings from the modules screen, including their cleanup lifecycle.
  • Multisite direct-cache isolation: each blog has its own runtime configuration, index directory and request signature; the shared bootstrap routes by hostname and the most specific registered site path.
  • Network-owned cache drop-ins: on Multisite, only users with manage_network_options can configure, install or remove the global object-cache.php and db.php drop-ins. Subsite administrators retain access to WP_Query and static-page cache settings.

Web server compatibility

  • Automatic detection: identifies Apache, Nginx, LiteSpeed Enterprise and OpenLiteSpeed. Apache and LiteSpeed Enterprise use generated .htaccess directives, while Nginx uses a generated nginx.conf include file.
  • Portable directory protection: generated Apache-style security rules use Options -Indexes, avoiding the invalid mixed Options All -Indexes syntax that can make LiteSpeed reject the site .htaccess.
  • OpenLiteSpeed support: because .htaccess accepts only Apache mod_rewrite syntax, WP Optimizer writes compatible rules for direct cache delivery, redirects and rewrite-based security controls. Enable Auto Load from .htaccess for the virtual host; configure compression, response headers, MIME types and other non-rewrite options in WebAdmin, then restart OpenLiteSpeed after rewrite changes.

Developer integrations

External plugins, themes, importers and maintenance scripts can use the documented public PHP functions in EXTERNAL-API.md.

Module architecture

WP Optimizer registers modules through the explicit catalog in inc/module-catalog.php. The catalog declares one relative module directory and namespace; each module entry contains only its display name and scopes. The entry slug deterministically produces <slug>.class.php and WPOptimizer\modules\Mod_<slug>, so file paths and classes are never duplicated per module. The bundled WPS framework normalizes the catalog into one compact, request-shared registry and loads module files on demand. New top-level module classes must follow this convention and be registered explicitly; unregistered files are ignored and there is no discovery fallback.

Support

This repository is not suitable for support. Please don't use our issue tracker for support requests. Support can take place through the appropriate channel on our community forum on wp.org.

Support requests in issues on this repository will be closed on sight.

About

Speed up your website with WP-Optimizer – Contains the Most Requested Features for Maintaining WordPress. Customize in Easy Steps to Increase Website Speed and Reduce Load Times for Enhanced User Experience.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages