Make WordPress Core

Opened 9 years ago

Last modified 6 years ago

#36440 new defect (bug)

get_results break in wp-admin/options.php if thetable is huge

Reported by: aoculi's profile aoculi Owned by:
Milestone: Priority: normal
Severity: minor Version: 4.4.2
Component: Options, Meta APIs Keywords: admin
Focuses: administration Cc:

Description

If we try to check all values from wp_options table thanks to the admin page wp-admin/options.php, the page will be broken if the table is huge (on my case more than 100 000 rows).

A simple pagination feature should fix the issue instead of trying to get all results.

Currently on wp-admin/options.php line 253:

<?php
$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );

Change History (3)

#1 @aoculi
9 years ago

  • Keywords admin added

#2 @andy
9 years ago

  • Severity changed from normal to minor

Thanks for posting your first ticket! :)

I agree that it's a bug. An admin page should not make an unlimited options table query. However, it affects a very small number of users. The options table rarely gets that big and wp-admin/options.php is used very little. Also, users in that situation usually have SQL access. Which is not to say a patch would be rejected, but nobody is likely to stop what they're doing and start working on this. Just a matter of priorities.

A quick google search for wp plugin options editor did turn up some results. https://wordpress.org/plugins/wp-options-editor/ looks interesting, although I haven't looked deeper than that listing. You might contact the author about converting it to a core patch if it works well in your case.

#3 @mikeselander
9 years ago

Hi all, I saw that my plugin was pinged here and figured I'd save you some time. Currently, it has the same issue/bug that core does of loading all options, uncached. It's on my list to fix, but currently will most likely crash your site by attempting to load all 100,000 rows.

Note: See TracTickets for help on using tickets.