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

WordPress Trac noreply at wordpress.org
Thu Jul 11 21:29:36 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:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by 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:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list