-
Notifications
You must be signed in to change notification settings - Fork 101
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
WPcom specific rewrite rules logic should be removed #1141
Comments
I'm pretty sure you're right about point 1. Point 2 I'm less sure, but one thing that came to mind is, why are we still supporting this? Why do we want to have this dark magic that we copy pasted from wpcom? Does it help our clients? I think this warrants a bigger discussion with the platform team about how they view this. ( I think the same conversation could be had about the special way we handle roles on wpcom and how we've cut and pasted that here) |
This. Any special considerations that need to be made for WP.com migrations should happen via the compat plugin. |
Also noting here that I've seen a few tickets where missing rewrite rules would not be added until I ran |
Ah, think I figured out some of what goes wrong here. The request to flush_rewrite_rules() is being interrupted by a second request (any frontend page view). Example:
Ideally, core could have a "force flush" type option to prevent this type of issue I'm thinking. |
Found a bug with the wpcom_vip_refresh_wp_rewrite() logic. If a site uses only
It seems to require an all-or-nothing approach to using those functions. |
Still in favor of deprecating/removing this extra bit of wpcom functionality. But we'll need an ideal system to switch to. This seems fine:
But is susceptible to the same problem we see with user roles - it's possible it triggers a stampede of FE writes should something go wrong/change. Could suggest this:
But it's more-or-less exactly what we're already doing with the custom wpcom functionality (and has possible issues with how early/late it's registered). |
This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched. |
@WPprodigy Still value in pursuing this one? |
I'd like to, yes :). One day... |
This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched. |
This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched. |
This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched. |
https://core.trac.wordpress.org/ticket/58998 helps out a bit here, notably with the inconsistent flushes. Long-term, still planning to deprecate/replace this "API". |
1) Flushing rewrite rules from wp-admin forces them to essentially flush twice.
This bit of code in
rri_wpcom_flush_rules ()
should no longer be necessary and should be removed: https://github.com/Automattic/vip-go-mu-plugins/blob/master/rewrite-rules-inspector.php#L57-L69The call to
flush_rewrite_rules( false );
that the plugin makes before this hook is called is sufficient on VIP Go: https://github.com/Automattic/Rewrite-Rules-Inspector/blob/master/rewrite-rules-inspector.php#L282-L283flush_rewrite_rules( false );
boils down to this (which you'll notice is essentially the same thing we duplicate in our addon plugin):2) Flushing rewrites can behave differently when a theme is using the older WPcom ways of declaring permalink structures.
If a site is using
wpcom_vip_load_permastruct()
,wpcom_vip_load_tag_base()
, etc, then you'll see in the same function as above (rri_wpcom_flush_rules()
) that it callswpcom_vip_refresh_wp_rewrite()
.It's in this function that I believe we have some error-some logic that might be causing some hard to catch bugs. This portion in particular feels like it should not be needed:
vip-go-mu-plugins/vip-helpers/vip-permastructs.php
Lines 145 to 158 in da7fcd2
I believe the
$wp_rewrite->init();
might be interferring with things. Though I'm not 100% sure how this all works so a second opinion here would be very much appreciated.The text was updated successfully, but these errors were encountered: