WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#10728 closed defect (bug) (fixed)

Improve is_blog_installed() check and add means of automatically repairing tables

Reported by: ryan Owned by: ryan
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Database Keywords:
Focuses: Cc:

Description

Improve is_blog_installed() check so that it reflects when the database tables are in an insane state. Instead of getting confused and offering to scratch install WP again, it should put up message on admin page visits that links to a page that will attempt to automatically repair tables.

Attachments (1)

10728.diff (5.4 KB) - added by ryan 5 years ago.

Download all attachments as: .zip

Change History (8)

@ryan5 years ago

comment:1 @westi5 years ago

Looks good.

I would rename the REPAIR define to something WP'y like WP_ALLOW_REPAIR for example.

comment:2 @ryan5 years ago

Will do.

comment:3 @azaozz5 years ago

Was thinking we could exit or maybe redirect to the dashboard when is_blog_installed is true and WP_REPAIRING is set (meaning someone is running repair.php directly). But that would prevent the user from repairing other tables.

Perhaps we need to cover two more user cases:

  • allow admins to run repair.php for cases when wp_posts, wp_comments, wp_terms, etc. need repairs
  • if wp_users or wp_usermeta fail, offer to try to repair them the same way as wp_options.

comment:4 @ryan5 years ago

(In [11902]) is_blog_installed() improvements and repair.php. see #10728

comment:5 @ryan5 years ago

First round committed. I'll work on azaozz's suggestions next.

comment:6 @scribu5 years ago

  • Milestone changed from Unassigned to 2.9

comment:7 @ryan5 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.