{"id":117127,"date":"2020-02-27T06:17:13","date_gmt":"2020-02-27T06:17:13","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/page-optimize\/"},"modified":"2026-02-12T19:35:09","modified_gmt":"2026-02-12T19:35:09","slug":"page-optimize","status":"publish","type":"plugin","link":"https:\/\/nn.wordpress.org\/plugins\/page-optimize\/","author":5279457,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.6.2","stable_tag":"0.6.2","tested":"6.9.4","requires":"5.3","requires_php":"7.4","requires_plugins":null,"header_name":"Page Optimize","header_author":"Automattic","header_description":"Optimizes JS and CSS for faster page load and render in the browser.","assets_banners_color":"","last_updated":"2026-02-12 19:35:09","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/page-optimize\/","header_author_uri":"http:\/\/automattic.com\/","rating":3,"author_block_rating":0,"active_installs":200000,"downloads":77634,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"0.4.2":{"tag":"0.4.2","author":"bpayton","date":"2020-02-27 06:16:57"},"0.4.3":{"tag":"0.4.3","author":"aidvu","date":"2020-02-27 11:27:28"},"0.4.4":{"tag":"0.4.4","author":"aidvu","date":"2020-03-05 16:40:06"},"0.4.6":{"tag":"0.4.6","author":"aidvu","date":"2020-03-17 14:34:01"},"0.4.7":{"tag":"0.4.7","author":"aidvu","date":"2020-06-01 19:38:33"},"0.5.0":{"tag":"0.5.0","author":"bpayton","date":"2020-06-23 21:56:08"},"0.5.1":{"tag":"0.5.1","author":"aidvu","date":"2020-09-17 10:46:44"},"0.5.2":{"tag":"0.5.2","author":"aidvu","date":"2022-11-08 13:20:27"},"0.5.3":{"tag":"0.5.3","author":"bpayton","date":"2023-03-31 01:12:00"},"0.5.4":{"tag":"0.5.4","author":"rcrdortiz","date":"2023-08-29 12:52:45"},"0.5.5":{"tag":"0.5.5","author":"bpayton","date":"2024-01-18 17:08:38"},"0.5.6":{"tag":"0.5.6","author":"a8caustin","date":"2024-10-23 19:36:48"},"0.5.7":{"tag":"0.5.7","author":"a8caustin","date":"2025-05-26 17:50:02"},"0.5.8":{"tag":"0.5.8","author":"mdbitz","date":"2025-12-02 18:25:49"},"0.6.0":{"tag":"0.6.0","author":"mreishus","date":"2026-02-04 16:02:25"},"0.6.1":{"tag":"0.6.1","author":"mreishus","date":"2026-02-10 17:35:00"},"0.6.2":{"tag":"0.6.2","author":"mreishus","date":"2026-02-12 19:35:09"}},"upgrade_notice":[],"ratings":{"1":2,"2":0,"3":1,"4":0,"5":2},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.4.2","0.4.3","0.4.4","0.4.6","0.4.7","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.5.5","0.5.6","0.5.7","0.5.8","0.6.0","0.6.1","0.6.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[247],"plugin_category":[54],"plugin_contributors":[182428,204180,182429,255217,223820],"plugin_business_model":[],"class_list":["post-117127","plugin","type-plugin","status-publish","hentry","plugin_tags-performance","plugin_category-security-and-spam-protection","plugin_contributors-aidvu","plugin_contributors-bjorsch","plugin_contributors-bpayton","plugin_contributors-mreishus","plugin_contributors-rcrdortiz","plugin_committers-apokalyptik","plugin_committers-automattic","plugin_committers-bpayton","plugin_committers-jmdodd","plugin_committers-mdbitz","plugin_committers-mreishus","plugin_committers-rcrdortiz","plugin_committers-westi","plugin_support_reps-crazywickedawesome"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/page-optimize.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin supports a few features that may improve the performance of page loading and rendering in the browser:<\/p>\n\n<ul>\n<li>Concatenate CSS<\/li>\n<li>Concatenate JavaScript<\/li>\n<li>Execution timing of non-critical scripts\n\n<ul>\n<li>Note: Changing script execution timing can be risky and will not work well for all sites.<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h3>Testing<\/h3>\n\n<p>To test features without enabling them for the entire site, you may append query params to a WordPress post or page URL. For example, to test enabling JavaScript concatenation for <code>https:\/\/example.com\/blog\/<\/code>, you can use the URL <code>https:\/\/example.com\/blog\/?concat-js=1<\/code>.<\/p>\n\n<p>Supported query params:<\/p>\n\n<ul>\n<li><code>concat-css<\/code> controls CSS concatenation. Values: <code>1<\/code> for ON and <code>0<\/code> for OFF.<\/li>\n<li><code>concat-js<\/code> controls JavaScript concatenation. Values: <code>1<\/code> for ON and <code>0<\/code> for OFF.<\/li>\n<li><code>load-mode-js<\/code> controls how non-critical JavaScript are loaded. Values: 'defer' for <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/script#attr-defer\">deferred<\/a>, 'async' for <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/script#attr-async\">async loading<\/a>, any other value indicates the feature should be disabled.<\/li>\n<\/ul>\n\n<h4>PHPUnit (Docker)<\/h4>\n\n<p>You can run the PHPUnit tests locally using Docker (no local MySQL required).<\/p>\n\n<p>First time (or after changing DB credentials):<\/p>\n\n<pre><code>docker compose down -v\n<\/code><\/pre>\n\n<p>Run tests:<\/p>\n\n<pre><code>docker compose up --build --abort-on-container-exit --exit-code-from tests\n<\/code><\/pre>\n\n<p>Optional overrides (examples):<\/p>\n\n<ul>\n<li><code>WP_VERSION=6.5 docker compose up --build --abort-on-container-exit --exit-code-from tests<\/code><\/li>\n<li><code>PHP_VERSION=7.4 docker compose up --build --abort-on-container-exit --exit-code-from tests<\/code><\/li>\n<li><code>PHPUNIT_VERSION=9.6.20 docker compose up --build --abort-on-container-exit --exit-code-from tests<\/code><\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>This plugin uses sensible defaults so it can operate without configuration, but there are a number of constants you may use for a custom configuration.<\/p>\n\n<h4>PAGE_OPTIMIZE_CACHE_DIR<\/h4>\n\n<p>Page Optimize caches concatenated scripts and styles by default, and this constant controls where the cache files are stored. The default directory is <code>cache\/page_optimize<\/code> under your site's <code>wp-content<\/code> folder.<\/p>\n\n<p>To change the cache location, set this constant to the absolute filesystem path of that location.<\/p>\n\n<p>To disable caching, set this constant to <code>false<\/code>. Please note that disabling Page Optimize caching may negatively impact performance unless you are caching elsewhere.<\/p>\n\n<h4>PAGE_OPTIMIZE_CSS_MINIFY<\/h4>\n\n<p>Page Optimize has CSS Minification capabilities which are off by default.<\/p>\n\n<p>If you're using caching, and not minifying CSS elsewhere, it is recommended to enable it by setting it to <code>true<\/code>.<\/p>\n\n<!--section=changelog-->\n<h4>0.6.2<\/h4>\n\n<ul>\n<li>Fix: Harden CSS concat <code>@import<\/code> hoisting to preserve long Google Fonts-style URLs with semicolons and avoid false positives from <code>@import<\/code>-like substrings in rule bodies\/URL paths.<\/li>\n<\/ul>\n\n<h4>0.6.1<\/h4>\n\n<ul>\n<li>Fix: Skip JavaScript concatenation for scripts that request defer or async loading to preserve core loading behavior.<\/li>\n<li>Fix: Skip JavaScript concatenation for module scripts (type=\"module\") and scripts whose  tag is modified via the script_loader_tag filter (for example, plugins that add module attributes), improving compatibility.<\/li>\n<\/ul>\n\n<h4>0.6.0<\/h4>\n\n<ul>\n<li>Fix: Preserve stylesheet enqueue\/document order when concatenating CSS. Concat-eligible styles are now emitted as sequential runs and split around non-concatenated items (e.g. external\/excluded\/dynamic URLs), media changes, RTL handling, and other boundaries.<\/li>\n<li>Fix: Inline styles (wp_add_inline_style) now print immediately after their parent stylesheet, including when styles are concatenated.<\/li>\n<li>Fix: Apply core's style_loader_tag filter when a concatenation run contains only a single stylesheet (matching core behavior and the JS-side fix from 0.5.0).<\/li>\n<li>Fix: The css_do_concat filter is now evaluated once per handle.<\/li>\n<li>Fix: The concat service no longer drops @import directives due to a closure scoping bug. (@charset\/@import handling now runs against the intended pre-output buffer.)<\/li>\n<li>Fix: Stylesheets containing @import now start a new concat run so service-side @import hoisting cannot reorder imports ahead of earlier stylesheets.<\/li>\n<li>Fix: Treat @import and @charset as case\u2011insensitive when building concatenated CSS, preventing missed rules in some stylesheets.<\/li>\n<\/ul>\n\n<h4>0.5.8<\/h4>\n\n<ul>\n<li>Update Tested Up To Version to 6.9.<\/li>\n<\/ul>\n\n<h4>0.5.7<\/h4>\n\n<ul>\n<li>Update Tested Up To Version to 6.8.<\/li>\n<\/ul>\n\n<h4>0.5.6<\/h4>\n\n<ul>\n<li>Update Tested Up To version to 6.7.<\/li>\n<\/ul>\n\n<h4>0.5.5<\/h4>\n\n<ul>\n<li>Fix: Stop skipping inline scripts when src is empty.<\/li>\n<\/ul>\n\n<h4>0.5.4<\/h4>\n\n<ul>\n<li>Bail when editing pages or posts in the Editor. Increased the max concatenated file limit.<\/li>\n<\/ul>\n\n<h4>0.5.1<\/h4>\n\n<ul>\n<li>Bail when editing pages in Brizy Editor (it errors when JavaScript load mode is <code>async<\/code>).<\/li>\n<\/ul>\n\n<h4>0.5.0<\/h4>\n\n<ul>\n<li>Apply the <code>script_loader_tag<\/code> filter for scripts that are concatenate-able but have no neighbors to concatenate with. This fixes a case where the TwentyTwenty theme wanted to apply a <code>defer<\/code> attribute to its script but was never given the opportunity.<\/li>\n<\/ul>\n\n<h4>0.4.5, 0.4.6<\/h4>\n\n<ul>\n<li>Force absolute paths for CSS replacements.<\/li>\n<li>Lower required PHP version to 7.0.<\/li>\n<\/ul>\n\n<h4>0.4.4<\/h4>\n\n<ul>\n<li>Don't queue the cache cleaning WP Cron job if we aren't caching.<\/li>\n<li>Cleanup cache if we turned caching off or directory changed.<\/li>\n<\/ul>\n\n<h4>0.4.3<\/h4>\n\n<ul>\n<li>gzip in PHP slows stuff down a bit. Simply don't do this. Any web server can handle this better.<\/li>\n<li>also remove the output buffering, no need for that anymore<\/li>\n<li>CSS Minification can sometimes slow things down significantly. Add constant to enable\/disable.<\/li>\n<\/ul>\n\n<h4>0.4.2<\/h4>\n\n<ul>\n<li>Initial release. No changes yet. :)<\/li>\n<\/ul>","raw_excerpt":"Optimize pages for faster load and render in the browser.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/117127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=117127"}],"author":[{"embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/automattic"}],"wp:attachment":[{"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=117127"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=117127"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=117127"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=117127"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=117127"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/nn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=117127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}