Skip to content

Commit 70c96c4

Browse files
authored
Release v3.19 (#7432)
2 parents 52b2fc2 + 3a1f32b commit 70c96c4

File tree

151 files changed

+12067
-3986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+12067
-3986
lines changed

assets/js/wpr-beacon.js

Lines changed: 782 additions & 4 deletions
Large diffs are not rendered by default.

assets/js/wpr-beacon.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/wpr-beacon.min.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dynamic-lists-delayjs.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"":[{"slug":"wp-super-cache","file":"wp-super-cache\/wp-cache.php"},{"slug":"enable-gzip-compression","file":"enable-gzip-compression\/enable-gzip-compression.php"},{"slug":"quick-cache","file":"quick-cache\/quick-cache.php"},{"slug":"leverage-browser-caching-ninjas","file":"leverage-browser-caching-ninjas\/leverage-browser-caching-ninja.php"},{"slug":"wp-performance-score-booster","file":"wp-performance-score-booster\/wp-performance-score-booster.php"},{"slug":"litespeed-cache","file":"litespeed-cache\/litespeed-cache.php"},{"slug":"remove-query-strings-from-static-resources","file":"remove-query-strings-from-static-resources\/remove-query-strings.php"},{"slug":"wp-http-compression","file":"wp-http-compression\/wp-http-compression.php"},{"slug":"query-strings-remover","file":"query-strings-remover\/query-strings-remover.php"},{"slug":"page-optimize","file":"page-optimize\/page-optimize.php"},{"slug":"speed-booster-pack","file":"speed-booster-pack\/speed-booster-pack.php"},{"slug":"swift-performance","file":"swift-performance\/performance.php"},{"slug":"gzip-ninja-speed-compression","file":"gzip-ninja-speed-compression\/gzip-ninja-speed.php"},{"slug":"super-static-cache","file":"super-static-cache\/super-static-cache.php"},{"slug":"lite-cache","file":"lite-cache\/plugin.php"},{"slug":"hyper-cache","file":"hyper-cache\/plugin.php"},{"slug":"wp-ffpc","file":"wp-ffpc\/wp-ffpc.php"},{"slug":"wp-fast-cache","file":"wp-fast-cache\/wp-fast-cache.php"},{"slug":"psn-pagespeed-ninja","file":"psn-pagespeed-ninja\/pagespeedninja.php"},{"slug":"swift-performance-lite","file":"swift-performance-lite\/performance.php"},{"slug":"force-gzip","file":"force-gzip\/force-gzip.php"},{"slug":"add-expires-headers","file":"add-expires-headers\/add-expires-headers.php"},{"slug":"hyper-cache-extended","file":"hyper-cache-extended\/plugin.php"},{"slug":"gator-cache","file":"gator-cache\/gator-cache.php"},{"slug":"flexicache","file":"flexicache\/wp-plugin.php"},{"slug":"wp-fastest-cache","file":"wp-fastest-cache\/wpFastestCache.php"},{"slug":"wordpress-gzip-compression","file":"wordpress-gzip-compression\/ezgz.php"},{"slug":"wp-optimize","file":"wp-optimize\/wp-optimize.php"},{"slug":"check-and-enable-gzip-compression","file":"check-and-enable-gzip-compression\/richards-toolbox.php"},{"slug":"far-future-expiry-header","file":"far-future-expiry-header\/far-future-expiration.php"},{"slug":"leverage-browser-caching","file":"leverage-browser-caching\/leverage-browser-caching.php"},{"slug":"wpcompressor","file":"wpcompressor\/wpcompressor.php"},{"slug":"combine-css","file":"combine-css\/combine-css.php"},{"slug":"w3-total-cache","file":"w3-total-cache\/w3-total-cache.php"},{"slug":"airlift","file":"airlift\/airlift.php"},{"slug":"cache-enabler","file":"cache-enabler\/cache-enabler.php"}],"minify_css||minify_js":[{"slug":"merge-minify-refresh","file":"merge-minify-refresh\/merge-minify-refresh.php"},{"slug":"async-js-and-css","file":"async-js-and-css\/asyncJSandCSS.php"},{"slug":"wp-super-minify","file":"wp-super-minify\/wp-super-minify.php"},{"slug":"fast-velocity-minify","file":"fast-velocity-minify\/fvm.php"},{"slug":"dependency-minification","file":"dependency-minification\/dependency-minification.php"},{"slug":"bwp-minify","file":"bwp-minify\/bwp-minify.php"},{"slug":"minqueue","file":"minqueue\/plugin.php"},{"slug":"scripts-gzip","file":"scripts-gzip\/scripts_gzip.php"},{"slug":"wp-minify","file":"wp-minify\/wp-minify.php"}],"lazyload":[{"slug":"lazy-load","file":"lazy-load\/lazy-load.php"},{"slug":"bj-lazy-load","file":"bj-lazy-load\/bj-lazy-load.php"},{"slug":"jquery-image-lazy-loading","file":"jquery-image-lazy-loading\/jq_img_lazy_load.php"},{"slug":"crazy-lazy","file":"crazy-lazy\/crazy-lazy.php"},{"slug":"specify-image-dimensions","file":"specify-image-dimensions\/specify-image-dimensions.php"},{"slug":"advanced-lazy-load","file":"advanced-lazy-load\/advanced_lazyload.php"}],"minify_js":[{"slug":"wp-js","file":"wp-js\/wp-js.php"},{"slug":"scripts-to-footerphp","file":"scripts-to-footerphp\/scripts-to-footer.php"},{"slug":"combine-js","file":"combine-js\/combine-js.php"},{"slug":"footer-javascript","file":"footer-javascript\/footer-javascript.php"}],"control_heartbeat":[{"slug":"heartbeat-control","file":"heartbeat-control\/heartbeat-control.php"}],"lazyload_iframes":[{"slug":"lazy-load-for-videos","file":"lazy-load-for-videos\/codeispoetry.php"}]}
1+
{"":[{"slug":"gzip-ninja-speed-compression","file":"gzip-ninja-speed-compression\/gzip-ninja-speed.php"},{"slug":"wp-http-compression","file":"wp-http-compression\/wp-http-compression.php"},{"slug":"w3-total-cache","file":"w3-total-cache\/w3-total-cache.php"},{"slug":"flexicache","file":"flexicache\/wp-plugin.php"},{"slug":"remove-query-strings-from-static-resources","file":"remove-query-strings-from-static-resources\/remove-query-strings.php"},{"slug":"combine-css","file":"combine-css\/combine-css.php"},{"slug":"leverage-browser-caching-ninjas","file":"leverage-browser-caching-ninjas\/leverage-browser-caching-ninja.php"},{"slug":"wp-optimize","file":"wp-optimize\/wp-optimize.php"},{"slug":"speed-booster-pack","file":"speed-booster-pack\/speed-booster-pack.php"},{"slug":"wp-super-cache","file":"wp-super-cache\/wp-cache.php"},{"slug":"hyper-cache-extended","file":"hyper-cache-extended\/plugin.php"},{"slug":"gator-cache","file":"gator-cache\/gator-cache.php"},{"slug":"wp-ffpc","file":"wp-ffpc\/wp-ffpc.php"},{"slug":"super-static-cache","file":"super-static-cache\/super-static-cache.php"},{"slug":"wpcompressor","file":"wpcompressor\/wpcompressor.php"},{"slug":"check-and-enable-gzip-compression","file":"check-and-enable-gzip-compression\/richards-toolbox.php"},{"slug":"lite-cache","file":"lite-cache\/plugin.php"},{"slug":"add-expires-headers","file":"add-expires-headers\/add-expires-headers.php"},{"slug":"swift-performance","file":"swift-performance\/performance.php"},{"slug":"psn-pagespeed-ninja","file":"psn-pagespeed-ninja\/pagespeedninja.php"},{"slug":"far-future-expiry-header","file":"far-future-expiry-header\/far-future-expiration.php"},{"slug":"force-gzip","file":"force-gzip\/force-gzip.php"},{"slug":"quick-cache","file":"quick-cache\/quick-cache.php"},{"slug":"cache-enabler","file":"cache-enabler\/cache-enabler.php"},{"slug":"enable-gzip-compression","file":"enable-gzip-compression\/enable-gzip-compression.php"},{"slug":"leverage-browser-caching","file":"leverage-browser-caching\/leverage-browser-caching.php"},{"slug":"hyper-cache","file":"hyper-cache\/plugin.php"},{"slug":"page-optimize","file":"page-optimize\/page-optimize.php"},{"slug":"litespeed-cache","file":"litespeed-cache\/litespeed-cache.php"},{"slug":"airlift","file":"airlift\/airlift.php"},{"slug":"query-strings-remover","file":"query-strings-remover\/query-strings-remover.php"},{"slug":"wp-fast-cache","file":"wp-fast-cache\/wp-fast-cache.php"},{"slug":"wp-fastest-cache","file":"wp-fastest-cache\/wpFastestCache.php"},{"slug":"wordpress-gzip-compression","file":"wordpress-gzip-compression\/ezgz.php"},{"slug":"wp-performance-score-booster","file":"wp-performance-score-booster\/wp-performance-score-booster.php"},{"slug":"swift-performance-lite","file":"swift-performance-lite\/performance.php"}],"lazyload":[{"slug":"crazy-lazy","file":"crazy-lazy\/crazy-lazy.php"},{"slug":"jquery-image-lazy-loading","file":"jquery-image-lazy-loading\/jq_img_lazy_load.php"},{"slug":"lazy-load","file":"lazy-load\/lazy-load.php"},{"slug":"bj-lazy-load","file":"bj-lazy-load\/bj-lazy-load.php"},{"slug":"advanced-lazy-load","file":"advanced-lazy-load\/advanced_lazyload.php"},{"slug":"specify-image-dimensions","file":"specify-image-dimensions\/specify-image-dimensions.php"}],"auto_preload_fonts":[{"slug":"custom-fonts","file":"custom-fonts\/custom-fonts.php"}],"lazyload_iframes":[{"slug":"lazy-load-for-videos","file":"lazy-load-for-videos\/codeispoetry.php"}],"minify_css||minify_js":[{"slug":"dependency-minification","file":"dependency-minification\/dependency-minification.php"},{"slug":"async-js-and-css","file":"async-js-and-css\/asyncJSandCSS.php"},{"slug":"scripts-gzip","file":"scripts-gzip\/scripts_gzip.php"},{"slug":"merge-minify-refresh","file":"merge-minify-refresh\/merge-minify-refresh.php"},{"slug":"wp-super-minify","file":"wp-super-minify\/wp-super-minify.php"},{"slug":"fast-velocity-minify","file":"fast-velocity-minify\/fvm.php"},{"slug":"minqueue","file":"minqueue\/plugin.php"},{"slug":"bwp-minify","file":"bwp-minify\/bwp-minify.php"},{"slug":"wp-minify","file":"wp-minify\/wp-minify.php"}],"minify_js":[{"slug":"footer-javascript","file":"footer-javascript\/footer-javascript.php"},{"slug":"combine-js","file":"combine-js\/combine-js.php"},{"slug":"scripts-to-footerphp","file":"scripts-to-footerphp\/scripts-to-footer.php"},{"slug":"wp-js","file":"wp-js\/wp-js.php"}],"control_heartbeat":[{"slug":"heartbeat-control","file":"heartbeat-control\/heartbeat-control.php"}]}

dynamic-lists.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

inc/Engine/Admin/Beacon/Beacon.php

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -483,16 +483,6 @@ public function get_suggest( $doc_id ) {
483483
'url' => 'https://fr.docs.wp-rocket.me/article/188-comment-est-pre-charge-le-cache/?utm_source=wp_plugin&utm_medium=wp_rocket',
484484
],
485485
],
486-
'dns_prefetch' => [
487-
'en' => [
488-
'id' => '5e055a602c7d3a7e9ae5881c',
489-
'url' => 'https://docs.wp-rocket.me/article/1302-prefetch-dns-requests/?utm_source=wp_plugin&utm_medium=wp_rocket',
490-
],
491-
'fr' => [
492-
'id' => '5e1891892c7d3a7e9ae60983',
493-
'url' => 'https://fr.docs.wp-rocket.me/article/1303-prechargement-requetes-dns/?utm_source=wp_plugin&utm_medium=wp_rocket',
494-
],
495-
],
496486
'fonts_preload' => [
497487
'en' => [
498488
'id' => '5eab7729042863474d19f647',
@@ -821,16 +811,6 @@ public function get_suggest( $doc_id ) {
821811
'url' => 'https://fr.docs.wp-rocket.me/article/1833-impossible-creer-table-rucssusedcss/?utm_source=wp_plugin&utm_medium=wp_rocket',
822812
],
823813
],
824-
'lazy_render_content' => [
825-
'en' => [
826-
'id' => '66b11e26a62a7505fcf339e7',
827-
'url' => 'https://docs.wp-rocket.me/article/1835-lazy-render-content/?utm_source=wp_plugin&utm_medium=wp_rocket',
828-
],
829-
'fr' => [
830-
'id' => '66ba0e8e082392452a0773ea',
831-
'url' => 'https://fr.docs.wp-rocket.me/article/1836-rendu-differe-automatique/?utm_source=wp_plugin&utm_medium=wp_rocket',
832-
],
833-
],
834814
'host_fonts_locally' => [
835815
'en' => [
836816
'id' => '673358b02ddbd952f6241b38',
@@ -841,6 +821,16 @@ public function get_suggest( $doc_id ) {
841821
'url' => 'https://fr.docs.wp-rocket.me/article/1852-auto-heberger-google-fonts?utm_source=wp_plugin&utm_medium=wp_rocket',
842822
],
843823
],
824+
'preconnect_domains' => [
825+
'en' => [
826+
'id' => '681b61d889bd957cd04bd2d9',
827+
'url' => 'https://docs.wp-rocket.me/article/1869-preconnect-to-external-domains',
828+
],
829+
'fr' => [
830+
'id' => '681da5ae11561a04f5de356e',
831+
'url' => 'https://fr.docs.wp-rocket.me/article/1870-preconnexion-aux-domaines-externes',
832+
],
833+
],
844834
];
845835

846836
return isset( $suggest[ $doc_id ][ $this->get_user_locale() ] )

inc/Engine/Admin/Settings/Page.php

Lines changed: 28 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ private function media_section() {
847847
$exclude_lazyload = $this->beacon->get_suggest( 'exclude_lazyload' );
848848
$dimensions = $this->beacon->get_suggest( 'image_dimensions' );
849849
$fonts = $this->beacon->get_suggest( 'host_fonts_locally' );
850+
$fonts_preload = $this->beacon->get_suggest( 'fonts_preload' );
850851

851852
$this->settings->add_page_section(
852853
'media',
@@ -936,12 +937,10 @@ private function media_section() {
936937
'page' => 'media',
937938
],
938939
'font_optimization_section' => [
939-
'title' => __( 'Fonts', 'rocket' ),
940-
'type' => 'fields_container',
941-
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
942-
'description' => sprintf( __( 'Download and serve fonts directly from your server. Reduces connections to external servers and minimizes font shifts. %1$sMore info%2$s', 'rocket' ), '<a href="' . esc_url( $fonts['url'] ) . '" data-beacon-article="' . esc_attr( $fonts['id'] ) . '" target="_blank" rel="noopener noreferrer">', '</a>' ),
943-
'help' => $fonts,
944-
'page' => 'media',
940+
'title' => __( 'Fonts', 'rocket' ),
941+
'type' => 'fields_container',
942+
'help' => $fonts,
943+
'page' => 'media',
945944
],
946945
]
947946
);
@@ -1041,9 +1040,21 @@ private function media_section() {
10411040
'default' => 0,
10421041
'sanitize_callback' => 'sanitize_checkbox',
10431042
],
1043+
'auto_preload_fonts' => [
1044+
'type' => 'checkbox',
1045+
'label' => __( 'Preload fonts', 'rocket' ),
1046+
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
1047+
'description' => sprintf( __( 'Preload above-the-fold fonts to enhance layout stability and optimize text-based LCP elements. %1$sMore info%2$s', 'rocket' ), '<a href="' . esc_url( $fonts_preload['url'] ) . '" data-beacon-article="' . esc_attr( $fonts_preload['id'] ) . '" target="_blank" rel="noopener noreferrer">', '</a>' ),
1048+
'section' => 'font_optimization_section',
1049+
'page' => 'media',
1050+
'default' => 0,
1051+
'sanitize_callback' => 'sanitize_checkbox',
1052+
],
10441053
'host_fonts_locally' => [
10451054
'type' => 'checkbox',
10461055
'label' => __( 'Self-host Google Fonts', 'rocket' ),
1056+
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
1057+
'description' => sprintf( __( 'Download and serve fonts directly from your server. Reduces connections to external servers and minimizes font shifts. %1$sMore info%2$s', 'rocket' ), '<a href="' . esc_url( $fonts['url'] ) . '" data-beacon-article="' . esc_attr( $fonts['id'] ) . '" target="_blank" rel="noopener noreferrer">', '</a>' ),
10471058
'section' => 'font_optimization_section',
10481059
'page' => 'media',
10491060
'default' => 0,
@@ -1063,7 +1074,7 @@ private function preload_section() {
10631074
'preload',
10641075
[
10651076
'title' => __( 'Preload', 'rocket' ),
1066-
'menu_description' => __( 'Generate cache files, preload fonts', 'rocket' ),
1077+
'menu_description' => __( 'Generate cache files', 'rocket' ),
10671078
]
10681079
);
10691080

@@ -1096,24 +1107,6 @@ private function preload_section() {
10961107
],
10971108
'page' => 'preload',
10981109
],
1099-
'dns_prefetch_section' => [
1100-
'title' => __( 'Prefetch DNS Requests', 'rocket' ),
1101-
'type' => 'fields_container',
1102-
'description' => __( 'DNS prefetching can make external files load faster, especially on mobile networks', 'rocket' ),
1103-
'help' => $this->beacon->get_suggest( 'dns_prefetch' ),
1104-
'page' => 'preload',
1105-
],
1106-
'preload_fonts_section' => [
1107-
'title' => __( 'Preload Fonts', 'rocket' ),
1108-
'type' => 'fields_container',
1109-
// translators: %1$s = opening <a> tag, %2$s = closing </a> tag.
1110-
'description' => sprintf( __( 'Improves performance by helping browsers discover fonts in CSS files. %1$sMore info%2$s', 'rocket' ), '<a href="' . esc_url( $fonts_preload['url'] ) . '" data-beacon-article="' . esc_attr( $fonts_preload['id'] ) . '" target="_blank">', '</a>' ),
1111-
'help' => [
1112-
'id' => $fonts_preload['id'],
1113-
'url' => $fonts_preload['url'],
1114-
],
1115-
'page' => 'preload',
1116-
],
11171110
]
11181111
);
11191112

@@ -1146,27 +1139,6 @@ private function preload_section() {
11461139
'default' => [],
11471140
'sanitize_callback' => 'sanitize_textarea',
11481141
],
1149-
'dns_prefetch' => [
1150-
'type' => 'textarea',
1151-
'label' => __( 'URLs to prefetch', 'rocket' ),
1152-
'description' => __( 'Specify external hosts to be prefetched (no <code>http:</code>, one per line)', 'rocket' ),
1153-
'placeholder' => '//example.com',
1154-
'section' => 'dns_prefetch_section',
1155-
'page' => 'preload',
1156-
'default' => [],
1157-
'sanitize_callback' => 'sanitize_textarea',
1158-
],
1159-
'preload_fonts' => [
1160-
'type' => 'textarea',
1161-
'label' => __( 'Fonts to preload', 'rocket' ),
1162-
'description' => __( 'Specify urls of the font files to be preloaded (one per line). Fonts must be hosted on your own domain, or the domain you have specified on the CDN tab.', 'rocket' ),
1163-
'helper' => __( 'The domain part of the URL will be stripped automatically.<br/>Allowed font extensions: otf, ttf, svg, woff, woff2.', 'rocket' ),
1164-
'placeholder' => '/wp-content/themes/your-theme/assets/fonts/font-file.woff',
1165-
'section' => 'preload_fonts_section',
1166-
'page' => 'preload',
1167-
'default' => [],
1168-
'sanitize_callback' => 'sanitize_textarea',
1169-
],
11701142
'preload_links' => [
11711143
'type' => 'checkbox',
11721144
'label' => __( 'Enable link preloading', 'rocket' ),
@@ -2116,6 +2088,7 @@ private function hidden_fields() {
21162088
'minify_concatenate_css',
21172089
'cloudflare_api_key',
21182090
'cloudflare_zone_id',
2091+
'dns_prefetch',
21192092
];
21202093

21212094
$this->settings->add_hidden_settings_fields(
@@ -2266,29 +2239,24 @@ public function display_update_notice() {
22662239

22672240
$previous_version = $this->options->get( 'previous_version' );
22682241

2269-
// Bail-out for fresh install.
2270-
if ( empty( $previous_version ) ) {
2242+
// Bail-out if previous version is greater than or equal to 3.19.
2243+
if ( version_compare( $previous_version, '3.19', '>=' ) ) {
22712244
return;
22722245
}
22732246

2274-
// Bail-out if previous version is greater than 3.17.
2275-
if ( $previous_version > '3.17' ) {
2276-
return;
2277-
}
2278-
2279-
$lazy_render_content = $this->beacon->get_suggest( 'lazy_render_content' );
2247+
$preconnect_content = $this->beacon->get_suggest( 'preconnect_domains' );
22802248

22812249
rocket_notice_html(
22822250
[
22832251
'status' => 'info',
22842252
'dismissible' => '',
22852253
'message' => sprintf(
2286-
// translators: %1$s: opening strong tag, %2$s: closing strong tag, %3$s: opening a tag, %4$s: opening a tag.
2287-
__( '%1$sWP Rocket:%2$s the plugin has been updated to the 3.17 version. New feature: %3$sAutomatic Lazy Rendering%4$s. Check out our documentation to learn more about it.', 'rocket' ),
2288-
'<strong>',
2289-
'</strong>',
2290-
'<a href="' . esc_url( $lazy_render_content['url'] ) . '" data-beacon-article="' . esc_attr( $lazy_render_content['id'] ) . '" target="_blank" rel="noopener noreferrer">',
2291-
'</a>'
2254+
// translators: %1$s: opening strong tag, %2$s: closing strong tag, %3$s: opening a tag, %4$s: closing a tag.
2255+
__( '%1$sWP Rocket:%2$s the plugin has been updated to the 3.19 version. New feature: %3$sPreconnect to external domains%4$s. Check out our documentation to learn more about it.', 'rocket' ),
2256+
'<strong>',
2257+
'</strong>',
2258+
'<a href="' . esc_url( $preconnect_content['url'] ) . '" data-beacon-article="' . esc_attr( $preconnect_content['id'] ) . '" target="_blank" rel="noopener noreferrer">',
2259+
'</a>'
22922260
),
22932261
'dismiss_button' => 'rocket_update_notice',
22942262
]

inc/Engine/Admin/Settings/Render.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ public function cache_lifespan( $args ) {
428428
* @param array $args Array of arguments to populate the template.
429429
*/
430430
public function hidden( $args ) {
431+
if ( is_array( $args['value'] ) ) {
432+
$args['value'] = implode( "\n", $args['value'] );
433+
}
434+
431435
echo $this->generate( 'fields/hidden', $args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Dynamic content is properly escaped in the view.
432436
}
433437

0 commit comments

Comments
 (0)