WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#14579 closed task (blessed)

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

Reported by: scribu Owned by: scribu
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: ongoing-project
Focuses: Cc:

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)

#1 @scribu
6 years ago

  • Description modified (diff)

@scribu
6 years ago

The images go in wp-admin/images/

#2 @scribu
6 years ago

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

#3 @ryan
6 years ago

Nice.

#4 @voyagerfan5761
6 years ago

  • Cc WordPress@… added

#5 @westi
6 years ago

  • 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.

#6 @scribu
6 years ago

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.

#7 @scribu
6 years ago

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

#8 @scribu
6 years ago

Related: #14595.

#9 @nacin
6 years ago

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.

#11 @scribu
6 years ago

Related: #14596

#12 @automattor
6 years ago

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

#13 @scribu
6 years ago

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

#14 @ramoonus
6 years ago

  • Cc ramoonus@… added

#15 follow-up: @jdub
6 years ago

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

#16 @jdub
6 years ago

  • Cc jdub@… added

#17 in reply to: ↑ 15 @scribu
6 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

#18 follow-up: @demetris
6 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.

@demetris
6 years ago

Recently Active view of Plugins screen

#19 @scribu
6 years ago

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

#20 @scribu
6 years ago

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

#21 in reply to: ↑ 18 ; follow-up: @scribu
6 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.

#22 @scribu
6 years ago

Related: #14612

#23 in reply to: ↑ 21 @demetris
6 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.)

@markmcwilliams
6 years ago

network_admin_url(); / admin_url(); stuff

#24 @markmcwilliams
6 years ago

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! :(

#26 @scribu
6 years ago

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

#27 @scribu
6 years ago

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

#28 @scribu
6 years ago

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

#29 @scribu
6 years ago

Related: #14637

#30 @kawauso
6 years ago

  • Cc kawauso added

#31 follow-up: @kawauso
6 years ago

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

#33 @Lazy79
6 years ago

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..

#34 @scribu
6 years ago

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/

#35 @Lazy79
6 years ago

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/

#36 @scribu
6 years ago

Related: #14651

#37 @scribu
6 years ago

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

#38 follow-up: @scribu
6 years ago

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

#40 @hakre
6 years ago

Realted: #11517

#41 in reply to: ↑ 38 @demetris
6 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.

#42 @demetris
6 years ago

Correction:

s/Recently View/Recently Active/

#43 @scribu
6 years ago

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

#44 @scribu
6 years ago

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