Description
What are we proposing to do?
With this update we are hoping to remove the « Minify HTML » option from WP Rocket UI (File Optimization tab).
Why are we doing this?
GT Metrix has deprecated this recommandation as the effect on overall performance is very small :
GT Metrix was the latest performance tool to recommend HTML minification. PageSpeed Insight and Pingdom Tools ignore this recommandation since a while.
Here a GT Metrix test comparaison:
With Minify HTML
https://gtmetrix.com/reports/wp-rocket.me/JUC11exR
-
Grade: 100 / 96
-
Loading time: 0.8s
-
Page Size: 956KB
Without Minify HTML
https://gtmetrix.com/reports/wp-rocket.me/Xv7fZ4DG
-
Grade: 100 / 96
-
Loading time: 0.8s
-
Page Size: 957KB
The loading time is exactly the same. Why? The page size only increased by 0.01KB...
How will we do this feature?
From version 3.7, all users will not have this option in WP Rocket UI and HTML minification won't be applied anymore.
Both existing and new users will have the same experience.
Development
inc/Plugin.php
- Remove the
minify_html_subscriber
entry from the subscribers
inc/admin/upgrader.php
-
Remove the entry for
minify_html
inrocket_first_install()
-
Remove the checks for
minify_html
inrocket_new_upgrade()
inc/admin/ui/meta-boxes.php
- Remove
minify_html
from the$fields
inrocket_display_cache_options_meta_boxes()
androcket_save_metabox_options()
inc/admin/ui/notices.php
- Remove the checks for
minify_html
inrocket_plugins_to_deactivate()
inc/3rd-party/hosting/wp-serveur.php
- Deprecate the
rocket_deactivate_inline_js_on_wp_serveur()
function
inc/3rd-party/plugins/appbanner.php
-
Deprecate the
rocket_deactivate_js_minifier_with_appbanner()
function -
Delete the file
-
Remove the require in
inc/3rd-party.php
inc/3rd-party/plugins/autoptimize.php
-
Deprecate the
rocket_maybe_deactivate_minify_html()
function -
Update
rocket_activate_autoptimize()
to remove the check forminify_html
-
Deprecate
rocket_maybe_disable_minify_html()
inc/3rd-party/plugins/slider/revslider.php
-
Deprecate the
rocket_deactivate_js_minifier_with_revslider()
function -
Delete the file
-
Remove the require in
inc/3rd-party.php
inc/classes/subscriber/Optimization/class-minify-html-subscriber.php
- Deprecate the class
inc/Engine/Beacon/Beacon.php
- Remove
minify_html
fromsession_data()
inc/Engine/Admin/Deactivation/DeactivationIntent.php
- Remove
minify_html
fromactivate_safe_mode()
inc/Engine/Admin/Settings/Page.php
- Remove references to minify HTML option
inc/Engine/Admin/Settings/Settings.php
- Remove references to
minify_html
insanitize_callback()
inc/Engine/Optimization/ServiceProvider.php
- Remove registering minify HTML subscriber in
$provides
andregister()
inc/vendors/classes/class-minify-html.php
- Deprecate the class
Risks
Since we are removing a feature, this should be low risk. The major concern is educating customers.
Testing
-
Update WP Rocket to 3.7.
-
The UI for "Minify HTML" is removed.
-
On front-end, the HTML shouldn't be minified
Documentation and Translations
- Remove the « Minify HTML » section: https://docs.wp-rocket.me/article/19-resolving-issues-with-file-optimization#minify-html