[wp-trac] [WordPress Trac] #47686: Always flush rewrite rules when active plugins changes & on plugin upgrades

WordPress Trac noreply at wordpress.org
Tue Jul 23 14:53:50 UTC 2019


#47686: Always flush rewrite rules when active plugins changes & on plugin upgrades
-----------------------------+------------------------------
 Reporter:  johnjamesjacoby  |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Rewrite Rules    |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by kevindees):

 I added a working implementation of this idea as tagged by @SergeyBiryukov
 https://core.trac.wordpress.org/ticket/47526

 Replying to [comment:2 johnjamesjacoby]:
 > > This could be problematic with caching systems, many of which are
 built to flush cache if permalinks are flushed.
 >
 > That's interesting. It's a pretty bad assumption, but I can see how
 people could make it.
 >
 > Neither `flush_rewrite_rules()` nor `$wp_rewrite->flush_rules()` have
 their own hooks, so I assume they are hooking into one of the hooks inside
 of `update_option()`?
 >
 > Since #29107, `$wp_rewrite->flush_rules()` now does a double update -
 once to empty, another to the new rules. If that commit didn't break
 caching plugins (or nobody noticed, or cared enough to say so) I'd be
 surprised if my suggestion would cause any ''more'' harm.
 >
 > If caching plugins are hooking into `updated_option` or
 `update_option_rewrite_rules`, and if we can confirm with unit tests that
 core isn't over flushing when the values are updated (see: #38903) then it
 should still be viable.
 >
 > Even if it's not yet, I still think it's worth it to the developer
 community and the user community to do more research into how rewrite rule
 flushing could be done automatically when it's needed, and not done
 repeatedly if it's not.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47686#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list