Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only apply performance hints optimizations when page html is not empty #7298

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dynamic-lists-delayjs.json

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion inc/Engine/Cache/TaxonomySubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ private function is_not_valid_taxonomy_page() {
$term_link = trailingslashit( $term_link ) . 'page/' . get_query_var( 'paged' );
}

return urldecode( untrailingslashit( $term_link ) ) !== urldecode( untrailingslashit( $current_link ) );
$term_link = urldecode( untrailingslashit( $term_link ) );

if ( urldecode( untrailingslashit( $current_link ) ) !== $term_link && ! empty( $_SERVER['REQUEST_URI'] ) ) {
$current_link = home_url( add_query_arg( [], wp_unslash( $_SERVER['REQUEST_URI'] ) ) );// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
}

return urldecode( untrailingslashit( $current_link ) ) !== $term_link;
}
}
2 changes: 1 addition & 1 deletion inc/Engine/Common/PerformanceHints/Frontend/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static function get_subscribed_events(): array {
* @return string
*/
public function maybe_apply_optimizations( $html ): string {
if ( ! isset( $_GET['wpr_imagedimensions'] ) && isset( $_GET['wpr_lazyrendercontent'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( empty( $html ) || ( ! isset( $_GET['wpr_imagedimensions'] ) && isset( $_GET['wpr_lazyrendercontent'] ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return $html;
}

Expand Down
4 changes: 2 additions & 2 deletions wp-rocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Rocket
* Plugin URI: https://wp-rocket.me
* Description: The best WordPress performance plugin.
* Version: 3.18.1.4
* Version: 3.18.1.5
* Requires at least: 5.8
* Requires PHP: 7.3
* Code Name: Iego
Expand All @@ -20,7 +20,7 @@
defined( 'ABSPATH' ) || exit;

// Rocket defines.
define( 'WP_ROCKET_VERSION', '3.18.1.4' );
define( 'WP_ROCKET_VERSION', '3.18.1.5' );
define( 'WP_ROCKET_WP_VERSION', '5.8' );
define( 'WP_ROCKET_WP_VERSION_TESTED', '6.3.1' );
define( 'WP_ROCKET_PHP_VERSION', '7.3' );
Expand Down
Loading