From 1ccd866e26599e563f6fec0a4239dd55d16dbfc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C5=A1a=20Todorovi=C4=87?= <15647032+stodorovic@users.noreply.github.com> Date: Tue, 7 Apr 2026 16:36:55 -0500 Subject: [PATCH 1/3] fix: use fileperms() instead of stat() and fix escaping --- wp-cache.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wp-cache.php b/wp-cache.php index e5ffa9fd..b3d011bc 100644 --- a/wp-cache.php +++ b/wp-cache.php @@ -618,8 +618,7 @@ function wp_cache_manager_error_checks() { $dismiss_readable_warning = 0; } if( $dismiss_readable_warning == 0 && is_writeable_ACLSafe( WP_CONTENT_DIR . '/' ) ) { - $wp_content_stat = stat(WP_CONTENT_DIR . '/'); - $wp_content_mode = decoct( $wp_content_stat[ 'mode' ] & 0777 ); + $wp_content_mode = decoct( fileperms( WP_CONTENT_DIR . '/' ) & 0777 ); if( substr( $wp_content_mode, -2 ) == '77' ) { ?>

chmod 755 /

@@ -669,13 +668,13 @@ function wp_cache_manager_error_checks() { ) ) { ?> -

-

- -

  1. +

    +

    +

    +
    1. Update Mod_Rewrite Rules button.', 'wp-super-cache' ); ?>
    2. -
    3. # BEGIN WPSuperCache and # END WPSuperCache and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), $home_path ); ?>
    4. -
    5. # BEGIN WPSuperCache and # END WPSuperCache. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|%s|wp-postpass_).*$ add these lines: (do it twice, once for each section)', 'wp-super-cache' ), $home_path, wpsc_get_logged_in_cookie() ); ?>

      +
    6. # BEGIN WPSuperCache and # END WPSuperCache and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), esc_html( $home_path ) ); ?>
    7. +
    8. # BEGIN WPSuperCache and # END WPSuperCache. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|%s|wp-postpass_).*$ add these lines: (do it twice, once for each section)', 'wp-super-cache' ), esc_html( $home_path ), esc_html( wpsc_get_logged_in_cookie() ) ); ?>

    Date: Tue, 7 Apr 2026 17:25:20 -0500 Subject: [PATCH 2/3] fix: address PHPCS escaping and placeholder errors --- wp-cache.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-cache.php b/wp-cache.php index b3d011bc..a1ed4a9a 100644 --- a/wp-cache.php +++ b/wp-cache.php @@ -673,8 +673,12 @@ function wp_cache_manager_error_checks() {

    1. Update Mod_Rewrite Rules button.', 'wp-super-cache' ); ?>
    2. -
    3. # BEGIN WPSuperCache and # END WPSuperCache and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), esc_html( $home_path ) ); ?>
    4. -
    5. # BEGIN WPSuperCache and # END WPSuperCache. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|%s|wp-postpass_).*$ add these lines: (do it twice, once for each section)', 'wp-super-cache' ), esc_html( $home_path ), esc_html( wpsc_get_logged_in_cookie() ) ); ?>

      +
    6. # BEGIN WPSuperCache and # END WPSuperCache and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ) ); ?>
    7. +
    8. # BEGIN WPSuperCache and # END WPSuperCache. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|%2$s|wp-postpass_).*$ add these lines: (do it twice, once for each section)', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ), esc_html( wpsc_get_logged_in_cookie() ) ); ?>

Date: Tue, 7 Apr 2026 17:29:19 -0500 Subject: [PATCH 3/3] fix: put PHP tags on their own lines per PHPCS --- wp-cache.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wp-cache.php b/wp-cache.php index a1ed4a9a..a585caa1 100644 --- a/wp-cache.php +++ b/wp-cache.php @@ -673,12 +673,18 @@ function wp_cache_manager_error_checks() {

  1. Update Mod_Rewrite Rules button.', 'wp-super-cache' ); ?>
  2. -
  3. + # BEGIN WPSuperCache and # END WPSuperCache and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ) ); ?>
  4. -
  5. # BEGIN WPSuperCache and # END WPSuperCache and let the plugin regenerate them by reloading this page.', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ) ); + ?> +
  6. +
  7. + # BEGIN WPSuperCache and # END WPSuperCache. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|%2$s|wp-postpass_).*$ add these lines: (do it twice, once for each section)', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ), esc_html( wpsc_get_logged_in_cookie() ) ); ?>

    + printf( wp_kses( __( 'Add the rules yourself. Edit %1$s.htaccess and find the block of code enclosed by the lines # BEGIN WPSuperCache and # END WPSuperCache. There are two sections that look very similar. Just below the line %%{HTTP:Cookie} !^.*(comment_author_|%2$s|wp-postpass_).*$ add these lines: (do it twice, once for each section)', 'wp-super-cache' ), array( 'code' => array() ) ), esc_html( $home_path ), esc_html( wpsc_get_logged_in_cookie() ) ); + ?> +