WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#14547 closed defect (bug) (wontfix)

Flush Rewrite Rules on Submit, not on Page Load

Reported by: ikailo Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: has-patch
Focuses: Cc:

Description

Current: Rewrite rules are flushed when /wp-admin/options-permalink.php is loaded.

Expected: Rewrite rules should be flushed only after the user submits the request.

Attachments (2)

flush_rewrite_rules_on_submit.2.diff (450 bytes) - added by ikailo 4 years ago.
flush_rewrite_rules_on_submit.3.diff (823 bytes) - added by ikailo 4 years ago.
Better Code

Download all attachments as: .zip

Change History (6)

comment:1 ikailo4 years ago

  • Keywords has-patch added

ikailo4 years ago

Better Code

comment:2 nacin3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I see no reason to modify this behavior. It gets flushed on submit, too.

comment:3 follow-up: ikailo3 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Forgive me, but I don't see the reasoning behind closing this ticket. The current state is inefficient.

When a user loads the page (clicks on Settings > Permalinks, nothing else), WordPress:

  1. Makes unnecessary calls to the database to delete and insert the rewrite rules.
  2. Makes unnecessary calls to the filesystem to rewrite the .htaccess file.

All without the explicit instruction of the user.

This can't possibly be expected behavior.

comment:4 in reply to: ↑ 3 Denis-de-Bernardy3 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

Replying to ikailo:

This can't possibly be expected behavior.

At least for the time being, it actually is. As you may (not) have noted, the rewrite rules aren't always refreshed properly, whether by WP or by themes or plugins. It's thus convenient, when supporting a user that has issues with pages not being found due to verbose rewrite rules and the like, to just tell him to visit his permalink settings in order to magically fix his site.

Note: See TracTickets for help on using tickets.