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

Security Plugin(s) renders wp-rocket useless #5887

Closed
SeparateReality opened this issue Apr 24, 2023 · 3 comments · Fixed by #5916
Closed

Security Plugin(s) renders wp-rocket useless #5887

SeparateReality opened this issue Apr 24, 2023 · 3 comments · Fixed by #5916
Assignees
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting community Issues created by someone outside of our team effort: [S] 1-2 days of estimated development time module: cache priority: medium Issues which are important, but no one will go out of business. type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Milestone

Comments

@SeparateReality
Copy link

Not sure how many Security Plugins use that "feature" this way, but it would be very easy to avoid this pitfall and lessen support requests (like we had one):

WP Cerber has a feature called "Stop exposing user details" (nouserpages_bylogin in code). The way they implemented it renders WP Rocket useless.

The feature sets - via add_filter('author_link'…) - all author pages queried via get_author_posts_url() to the SITE-URL.

WP-Rocket uses get_author_posts_url() to delete the author page of the post from the cache in rocket_clean_post().

However, due to the WP Cerber feature this adds the SITE-URL to the $purge_urls array.
Means that every time a post is changed (product, order,...), the entire site cache is deleted.

A simple check (something like get_author_posts_url() != SITE-URL) or alike would avoid this drama.

Regards,
Thomas

@piotrbak piotrbak added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement 3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting priority: medium Issues which are important, but no one will go out of business. module: cache labels Apr 25, 2023
@piotrbak piotrbak added the community Issues created by someone outside of our team label May 6, 2023
@piotrbak
Copy link
Contributor

piotrbak commented May 6, 2023

Hello @SeparateReality and thanks for creating the issue.

@piotrbak
Copy link
Contributor

piotrbak commented May 6, 2023

Acceptance Criteria

  • Don't clear the whole cache when Author Link is set to Site URL (possible relation Elementor templates clearing cache in full #5848)
  • Clear Author pages correctly when they're set default
  • Clear Author pages correctly when they're custom but not Site URL
  • No regressions in rocket_clean_post in any of the above scenarios

@jeawhanlee jeawhanlee added GROOMING IN PROGRESS Use this label when the issue is currently being groomed. and removed needs: grooming labels May 9, 2023
@jeawhanlee
Copy link
Contributor

jeawhanlee commented May 9, 2023

Reproduce the problem ✅

I was able to reproduce the problem with WP Cerber

Identify the root cause ✅

As stated in the issue.

Scope a solution ✅

We will do a check to add author url to list of urls to purge only if it is not the same as site_url() in

$purge_urls[] = get_author_posts_url( $post->post_author );

$author_url = get_author_posts_url( $post->post_author );

if ( site_url() !== $author_url ) {
  // Add the author page.
  $purge_urls[] = get_author_posts_url( $author_url );
}

Update test too.

Estimate the effort ✅

[S]

@jeawhanlee jeawhanlee added effort: [S] 1-2 days of estimated development time and removed GROOMING IN PROGRESS Use this label when the issue is currently being groomed. labels May 9, 2023
@mostafa-hisham mostafa-hisham self-assigned this May 10, 2023
@piotrbak piotrbak added this to the 3.13.4 milestone May 24, 2023
@engahmeds3ed engahmeds3ed mentioned this issue Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party compatibility Issues related to 3rd party compatibility like theme, plugin or hosting community Issues created by someone outside of our team effort: [S] 1-2 days of estimated development time module: cache priority: medium Issues which are important, but no one will go out of business. type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants