Opened 3 years ago

Last modified 2 years ago

#14579 closed task (blessed)

Ajaxify list-type screens in the admin — at Version 44

Reported by: scribu Owned by: scribu
Priority: normal Milestone: 3.1
Component: Administration Version:
Severity: normal Keywords: ongoing-project
Cc: ryan, westi, WordPress@…, jdub@…, kawauso, mikeschinkel@…, admin@…, andymacb, batmoo@…

Description (last modified by scribu)

This is the master ticket for my GSoC project.

What the patch does:

  • makes most columns sortable: #9259
  • introduces a new pagination style: #12179
  • ajaxifies sortable columns, pagination & search
  • provides an API for adding custom list screens: #11517
  • replaces WP_User_Search with get_users(): #14123
  • removes _wp_get_comment_list() in favor of get_comments(): #14163
  • makes bulk actions filterable: #12732
  • fixes problems with long URIs: #10762, #11114

Change History (47)

  • Description modified (diff)

scribu3 years ago

The images go in wp-admin/images/

  • Owner set to scribu
  • Status changed from new to accepted

comment:3   ryan3 years ago

Nice.

  • Cc WordPress@… added
  • Cc westi added

Great to see the results of all your summer work as a mega patch.

It might be better to land this as incremental patches which achieve the different goals along the way so that it is easier to see what is changing and why.

Would it be much work to split down into per feature patches?

It wouldn't matter if there was an order in which we had to apply them it would just make it easier to review and commit.

Would it be much work to split down into per feature patches?

Unfortunately, yes. Identifying the bugs that were fixed was a retroactive process.

It might be better to land this as incremental patches which achieve the different goals along the way so that it is easier to see what is changing and why.

You can take a look at my commit log to get a sense of what was changed and why.

(In [15491]) Ajaxify list-type screens in the admin. See #14579

Related: #14595.

Awesomesauce.


Small things I noticed on first read. Note I only really looked at modified files:

AJAX fetch-list looks like it needs a cap/referer check. Also, die('-1') on insufficient privs, die('0') on failure.

default-list-tables.php -- I'm not sure I like an includes file having a require at the top. Also, should we split these tables up into individual files? Some of these classes are quite large.

template.php, right line 1817, this should be show_ui, not public.

minor style issues: false instead of FALSE, single if statements should not be on one line, we like our semicolons, CSS declarations should not be on one line, etc.

looks like merging turned wp-admin/network/*.php back into ms-*.php a bit.

<br class="clear"> in plugins.php and a few other places.

_wp_search_sql() probably doesn't need to be in functions.php.

Script localization needs the convert entities bit at the end.

jquery.query.js should be minimized. Also, the crunching of admin-table.js looks like it didn't touch local variables, also. munging is fine.


General concerns about back compat:

We obviously changed quite a bit of markup, as well as some CSS. Should the old CSS selectors remain, in order not to hurt the styling of old-style tables by plugins?

Renaming the "p" query arg on edit-comments, does that break anything? Is that the URL included in emails? Now it's longer… p should be an alias at least.

Probably need to deprecate, not outright remove, WP_User_Search. I did not carefully read through a lot of the red, so there may be other things we can't get rid of without breaking a lot of plugins.

Related: #14596

(In [15494]) Fix network files. See #14579

(In [15495]) Fix ajaxification in network area by using ajaxurl. See #14579

  • Cc ramoonus@… added

comment:15 follow-up: ↓ 17   jdub3 years ago

How will custom columns fit into this? Additional hooks for plugins to provide the data to the ajax call?

  • Cc jdub@… added

comment:17 in reply to: ↑ 15   scribu3 years ago

Replying to jdub:

How will custom columns fit into this? Additional hooks for plugins to provide the data to the ajax call?

You don't need to worry about AJAX at all. See this tutorial:

Create your own sortable columns

comment:18 follow-up: ↓ 21   demetris3 years ago

Two small issues I noticed in the Plugins screen, and that I confirmed on two different setups:

  • The rows in the Recently Active view do not show any info. See attached screenshot.
  • It does not remember the view you were on. E.g., when I am on the Active view and click to deactivate a plugin, it then sends me to the All view.

Recently Active view of Plugins screen

(In [15496]) Introduce WP_List_Table::check_permissions() and WP_List_Table::prepare_items(). Fixes #14596; See #14579

(In [15497]) Fix Comments meta box in post editing screen. See #14579

comment:21 in reply to: ↑ 18 ; follow-up: ↓ 23   scribu3 years ago

Replying to demetris:

Two small issues I noticed in the Plugins screen, and that I confirmed on two different setups:

  • The rows in the Recently Active view do not show any info. See attached screenshot.

Confirmed.

  • It does not remember the view you were on. E.g., when I am on the Active view and click to deactivate a plugin, it then sends me to the All view.

I think this has been fixed in [15496].

Another bug I noticed is that clicking on 'Delete' gives you an 'Are you sure you want to do this?' screen.

Related: #14612

comment:23 in reply to: ↑ 21   demetris3 years ago

Replying to scribu:

Replying to demetris:

It does not remember the view you were on. E.g., when I am on the Active view and click to deactivate a plugin, it then sends me to the All view.

I think this has been fixed in [15496].

I am still seeing it in r15497. Confirmed on two different setups again. The query strings are like this:

http://example.com/wp-admin/plugins.php?deactivate=true&plugin_status=&paged=

(The plugin_status field has no value.)

network_admin_url(); / admin_url(); stuff

The attached patch fixes the action links for wp-admin/network/sites.php which all mustn't have been sync'ed before you made the commit scribu, anyway, admin_url(); now becomes network_admin_url(); in the above patch! :) All links to the ms-*.php files currently! :(

(In [15500]) In WP_Posts_Table, merge _single_row_hierarchical() and _single_row(). Fixes #14089; see #14579

(In [15501]) Safer hierarchical display check. Fixes #14600; See #14579

(In [15504]) introduce WP_List_Table::comments_bubble(); revert to edit-comments.php?p=123. See #14579

Related: #14637

  • Cc kawauso added

comment:31 follow-up: ↓ 32   kawauso3 years ago

Removal of register_column_headers() breaks popular plugins such as WP E-Commerce and MiniMeta Widget with an E_FATAL

i still have a problem on one blog running with trunk.

on dashboard, post screen (..) it says

Fatal Error: Call to undefined method stdClass::get_column_headers() in template.php (/wp-admin/includes)

on plugin screen it works (of course). its sure because of a plugin (i think) but maybe it helps you in trunk / dev a bit..

It would help if you could also figure out which plugin is causing it. Add this code to a file in your mu-plugins folder:

function scb_error_handler($errno, $errstr) {
	echo $errstr;
	
	ob_start();
	debug_print_backtrace();
	$out = explode( "\n#", ob_get_clean());
	$out = array_slice( $out, 1);
	echo '<pre>' . "\n#" . implode( "\n#", $out ) . '</pre>';
}
set_error_handler('scb_error_handler', E_WARNING|E_ERROR|E_RECOVERABLE_ERROR|E_USER_WARNING|E_USER_ERROR);

Then, please post back the displayed backtrace on http://wp.pastebin.ca/

Hi Scribu,

sorry i was stupid writing the post above. i figured out which plugin really makes this error (and thx for the function, its greadt!)

it is this plugin:

http://wordpress.org/extend/plugins/download-monitor/

Related: #14651

(In [15518]) use is_a() instead of is_object() in screen_meta(). See #14579

comment:38 follow-up: ↓ 41   scribu3 years ago

(In [15525]) Fix Recently Active plugins screen. See #14579

Realted: #11517

comment:41 in reply to: ↑ 38   demetris3 years ago

Replying to scribu:

(In [15525]) Fix Recently Active plugins screen. See #14579

r15525 fixed the issue with the Recently View, but it seems that the problem remains for other views.

For example, if you are on the Inactive view and activate a plugin, you are then sent to the All view.

Correction:

s/Recently View/Recently Active/

(In [15527]) On the plugins page, set and at the right time. See #14579

  • Description modified (diff)
Note: See TracTickets for help on using tickets.