WordPress.org

Plugin Directory

PyCoreWeb Optimizer – Unload Unused CSS & JS, Lazy Load, WebP

PyCoreWeb Optimizer – Unload Unused CSS & JS, Lazy Load, WebP

Description

PyCoreWeb Optimizer makes pages load faster by removing what a page does not need and loading the rest smarter. Everything is built to be safe: every change can be tried in test mode first, core files can never be removed, and one click shows any page without optimizations.

Unload Files

  • See every CSS and JavaScript file a page really loads. The list comes from loading the page as a logged-out visitor, grouped by theme, plugin, WordPress core and external services.
  • Switch files off on the whole site, or on single pages from the editor.
  • Group rules: unload a file on groups of pages, or load it only where it is needed. Groups include page types (front page, blog, archives, search, 404, author, date…), post types including custom ones, categories, tags and custom taxonomy terms, page templates, logged-in or logged-out visitors, address patterns, and WooCommerce shop, product, cart, checkout and account pages.
  • Exact matching only: switching off one file never removes others with similar names.
  • Files that another loaded file depends on keep loading, so nothing breaks because of a missing dependency.
  • Core files such as jQuery and the WordPress JavaScript runtime are protected and can never be unloaded.

CSS & JavaScript

  • Defer JavaScript using WordPress’s own loading strategy, which keeps the script order.
  • Delay chosen scripts (chat widgets, analytics, pixels) until the visitor first scrolls, taps or moves the mouse.
  • Load stylesheets without blocking the page from showing.
  • Critical CSS generated automatically in your own browser while you view a page. No outside service, no account and no data sent anywhere. You can also paste your own critical CSS for the whole site or for any page.
  • Minify CSS and JavaScript. Minified copies are cached and refreshed automatically when a file changes; files that are already minified are left alone, and your originals are never changed.
  • Preload fonts and hero images, preconnect to other domains, and use font-display: swap for Google Fonts and theme.json fonts.

Images

  • Native lazy loading for images and iframes, skipping the first images at the top of the page.
  • Missing width and height filled in, so the page does not jump while images load.
  • WebP (and AVIF where your server supports it) copies created next to your originals, for new uploads and with a bulk tool for existing images. Served with the picture element, so older browsers still get the original. Your original files are never changed.

Safe by design

  • Test mode: only logged-in administrators see the optimizations until you are happy.
  • “View this page without optimizations” in the admin bar, or add ?pyco_off=1 to any address while logged in as an administrator.
  • Emergency off switch: add define( 'PYCO_DISABLE', true ); to wp-config.php.
  • Every option is off by default except safe image improvements.

PyCoreWeb Optimizer Pro

Everything described above is free and stays free. An optional Pro add-on from Py CoreWeb adds time-savers for larger sites, such as generating critical CSS for the whole site in the background. The free plugin never needs it.

External services

This plugin does not connect to any outside service. The file scan loads pages of your own site from your own server, and critical CSS is generated in your own browser.

If you turn on “Preconnect to Google Fonts automatically”, the plugin adds a preconnect hint for fonts.googleapis.com and fonts.gstatic.com, but only on pages that already load Google Fonts. The plugin itself sends no data to Google.

Installation

  1. Install the plugin from Plugins > Add New, or upload the pycoreweb-optimizer folder to /wp-content/plugins/.
  2. Activate it.
  3. Open PyCoreWeb Optimizer in the admin menu. Turn on test mode from the Dashboard while you try things out.
  4. On Unload Files, scan your home page and switch off files it does not need. For single pages, use the Unload Files box in the editor.
  5. When everything looks right, turn test mode off.

FAQ

Can I load a file only on the pages that need it?

Yes. On Unload Files, press “Rules…” next to the file, choose “Load only on these pages” and add the groups, for example “Pages” and “Template: Contact”. The file is unloaded everywhere else. A contact form plugin’s files are a typical example.

Will this break my site?

It is built not to. Core files are protected, dependencies keep loading, and every CSS and JavaScript option is off until you switch it on. Use test mode to try changes as an administrator before visitors see them.

Something looks wrong. How do I turn everything off?

Use “View this page without optimizations” in the PyCoreWeb admin bar menu to compare. To switch the plugin off everywhere at once, add define( 'PYCO_DISABLE', true ); to wp-config.php, or deactivate the plugin.

Does it send my data anywhere?

No. The file scan loads your own site from your own server. Critical CSS is generated in your browser and saved to your own database. The plugin makes no requests to outside services.

Does it work with page caching plugins?

Yes. Clear your page cache after changing settings so visitors get the new version.

Why is “Load CSS without blocking” not doing anything?

It only runs on pages that have critical CSS, so visitors never see an unstyled page. Keep “Generate critical CSS automatically” on and view a page while logged in, or paste critical CSS yourself.

Is JavaScript minification safe?

It runs in a safe mode: comments, indentation and extra spaces are removed, but line breaks that JavaScript can rely on are kept, so scripts run exactly as before. It was checked against all of WordPress core’s own scripts. If a script still misbehaves, add it to “Never minify”.

Where are WebP files stored?

Next to the original, with the extra extension added: photo.jpg gets photo.jpg.webp. Use “Delete all WebP/AVIF copies” on the Images screen to remove them, for example before deleting the plugin.

Some images could not be converted. What should I check?

Each failed file shows a reason on the Images screen. Settings > System information shows whether GD and Imagick can write WebP and AVIF on your server, and whether your uploads folder is writable. If neither library can write WebP, ask your host to enable WebP support in GD or Imagick. Then press “Convert existing images” again: only the images that still need it are processed.

What is removed when I delete the plugin?

All settings, rules and minified files, unless you turned off “Remove all PyCoreWeb Optimizer settings” on the Settings screen. WebP and AVIF copies are files and stay until you delete them from the Images screen.

I used YU CoreOptimizer before. Are my rules kept?

Yes. Site-wide and per-page unloading rules are imported the first time PyCoreWeb Optimizer is activated.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“PyCoreWeb Optimizer – Unload Unused CSS & JS, Lazy Load, WebP” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.8.2

  • Moving from the old “PyCore Optimizer” plugin is now fully in your hands: while the old plugin is active, PyCoreWeb Optimizer waits and asks you to deactivate it. It never switches other plugins on or off.
  • Plugin, theme, upload and content folders are found with WordPress functions instead of WordPress constants.

1.8.1

  • Page rewrites no longer leave an output buffer open. On WordPress 6.9 and later they use WordPress’s own template output buffer whenever it is on; otherwise the theme template is wrapped, and the buffer is opened and closed in that one place. Sending the page head early still works.
  • The Elementor reveal style is now added with wp_add_inline_style().
  • No direct loading of WordPress core files for image conversion.

1.8.0

  • New name: PyCore Optimizer is now PyCoreWeb Optimizer (folder and text domain pycoreweb-optimizer).
  • Moving from the old plugin keeps every setting, and deleting the old plugin afterwards no longer removes them.

1.7.4

  • The first images (the number set in “Skip the first images”) are now also preloaded from the top of the page with high priority, so their download starts before the stylesheets. When the image is served as WebP or AVIF, that copy is preloaded. The page head is sent before the body is built, so the images found on the last visit of each address are used (option pyco_img_preload, filter pyco_preload_first_images).

1.7.3

  • Add-ons can view a logged-in request as visitors see it (filter pyco_view_as_visitor), so page analysers see the same minified files as visitors even when “Do not apply these changes for logged-in users” is on.
  • Minified copies remember their original file during the request, so other features can match them.

1.7.2

  • The first images (the “Skip the first images” number) now also get fetchpriority=”high”, so the browser downloads them before other images. Images that already have a fetchpriority keep it.

1.7.1

  • Fix: “Skip the first images” now also removes loading=”lazy” that WordPress or a page builder (Elementor) added to those images, so the main image loads right away. “Never lazy-load” works the same way. Icons and images under 64 pixels are no longer counted.
  • “Delay all JavaScript” has its own “load anyway after” timer, off by default. With the shared 10-second timer, scripts ran in the middle of PageSpeed’s test, which never scrolls or taps, and hurt Speed Index.

1.7.0

  • “Show text while fonts load” now also fixes fonts inside the site’s own stylesheets (theme, page builder, Font Awesome as bundled by Elementor, which hides icons and text for up to 3 seconds) and in

1.6.0

  • New: Delay all JavaScript. Every script on the page, inline ones too, waits for the first scroll, tap, click, mouse move or key press, then runs in its original order. Off by default; a “Never delay” list and a data-pyco-nodelay attribute keep chosen scripts running right away. With Elementor, animated sections are shown right away instead of staying hidden until the scripts run.
  • The delay loader and the non-blocking CSS helper now load with defer, so they no longer block the page.
  • Minified copies keep their names across plugin updates, so the Pro add-on’s unused CSS analysis stays valid after updating.

1.5.0

  • Faster first paint on slow-to-build pages (page builders such as Elementor, uncached pages): PyCoreWeb Optimizer used to hold the whole page until it was finished. It now sends the top of the page as soon as it is ready, so the browser starts loading CSS, fonts and scripts while the rest is still being built. All page rewrites share one buffer. Add define( 'PYCO_NO_EARLY_FLUSH', true ); to wp-config.php to turn this off.
  • New: Elementor-safe mode, on automatically when Elementor is active. jQuery, Elementor’s scripts and everything they need are never delayed, because Elementor keeps animated sections hidden until its scripts run. On Elementor pages, CSS loads without blocking only once the page has its own critical CSS.

1.4.2

  • Fixed: “The converted file was not written” when converting images on servers where Imagick cannot write WebP. Each file now tries Imagick and GD in turn, and the result is checked before it is kept.
  • Fixed: PNG images with a limited colour palette now convert to WebP with GD, keeping transparency.
  • Other plugins that change image output formats no longer interfere with WebP/AVIF copies.
  • Gentler bulk conversion for shared hosting: one image per request with a short pause, and automatic retries after 5, 15 and 30 seconds when the server is busy.
  • Clearer reasons for files that cannot be converted, and they are tried again on the next run.
  • System information shows WebP and AVIF support for GD and Imagick separately, the memory limit and whether uploads are writable.

1.4.1

  • Readme and plugin details prepared for WordPress.org.

1.4.0

  • New: group rules on Unload Files. Use “Rules…” next to a file to unload it on page types, post types, categories, tags and other terms, page templates, logged-in or logged-out visitors, address patterns or WooCommerce pages, or to load it only on those pages.
  • New: a list of every group rule, with one-click removal.
  • Protected core files can’t be given rules, and files other loaded files depend on keep loading, as before.

1.3.0

  • New: Minify CSS and Minify JavaScript on the CSS & JavaScript screen, with an exclude list and a “Clear minified files” button. Both are off by default.
  • Minified files are rebuilt automatically after settings changes, plugin or theme updates, and theme switches.

1.2.0

  • New name: PyCoreWeb Optimizer.
  • Unload Files, CSS & JavaScript and Images now live in one plugin with one menu, one test mode and one off switch.
  • Critical CSS can be generated automatically in your own browser.
  • No inline scripts: all JavaScript is loaded from files.
  • All text is translatable.
  • Deleting the plugin removes its settings.

1.1.0

  • Safer unloading: exact handles only, protected core files, dependencies kept, front-end scan.

1.0.0

  • First release as YU CoreOptimizer.