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

Don't flush rewrite_rules on every admin request #544

Merged
merged 2 commits into from
Jun 25, 2021

Conversation

diedexx
Copy link
Contributor

@diedexx diedexx commented Jun 18, 2021

This PR fixes an issue where flush_rewrite_rules is called on every wp-admin pageload.

$wp_rewrite->extra_rules_top only includes rules that were registered during the current request. And because add_rewrite_rule is called after the logic that checks for the same rule on extra_rules_top, it will never exist and always call flush_rewrite_rules.

Instead, I suggest to do the check against $wp_rewrite->wp_rewrite_rules(), as that fetches the existing rules from the database.

@google-cla
Copy link

google-cla bot commented Jun 18, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jun 18, 2021
@google-cla
Copy link

google-cla bot commented Jun 18, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@codecov-commenter
Copy link

codecov-commenter commented Jun 18, 2021

Codecov Report

Merging #544 (acd973f) into develop (f9fc1cb) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #544      +/-   ##
=============================================
- Coverage      23.26%   23.25%   -0.02%     
  Complexity       364      364              
=============================================
  Files             56       56              
  Lines           1947     1948       +1     
=============================================
  Hits             453      453              
- Misses          1494     1495       +1     
Flag Coverage Δ
php 23.25% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
wp-includes/class-wp.php 13.33% <0.00%> (-0.96%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9fc1cb...acd973f. Read the comment docs.

@westonruter westonruter added this to the 0.7 milestone Jun 18, 2021
@moorscode
Copy link
Contributor

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Jun 23, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

Co-authored-by: Weston Ruter <[email protected]>
@google-cla
Copy link

google-cla bot commented Jun 23, 2021

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@westonruter
Copy link
Collaborator

@moorscode The CLA bot needs you to sign as well now.

@moorscode
Copy link
Contributor

@googlebot I fixed it.

@google-cla
Copy link

google-cla bot commented Jun 25, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@diedexx
Copy link
Contributor Author

diedexx commented Jun 25, 2021

@googlebot I consent.

@google-cla
Copy link

google-cla bot commented Jun 25, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@diedexx diedexx requested a review from westonruter June 25, 2021 07:08
Copy link
Collaborator

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

And sorry for the hassle with the CLA.

@westonruter westonruter merged commit ee75ca8 into GoogleChromeLabs:develop Jun 25, 2021
@pooja-muchandikar
Copy link

QA Passed ✅

The changes are working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants