Support » Plugin: Media Library Categories » [Plugin: Media Library Categories] Sitewide slowdown

  • Hello, I’ve been trying to run this potentially useful plugin, but trust me, when activating it, my site suffers a dramatic slowdown, even in the admin screens.

    The same page gets loaded in 15s averagely (sometimes with 45s peaks) whereas it’s usually opened in just 3s when Media Library Categories is deactivated.

    No errors are reported in the server log.
    The problem occurs even after upgrading WP from 3.2.1 to 3.3.1
    There are no particular plugins affecting Media or Categories/Taxonomies, I’ve also tried to turn all of them off, one by one, in order to detect what could cause a conflict but I didn’t succeed.

    Could you please help me to figure out why my site becomes sooo sloooow?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Well, I’ve dug a little into the source code and placed some die(); here and there.
    This made me eventually able to discover that the plugin hogs my site because of the CheckForTermOrderColumn() function (line 149).
    I guess that the query

    SELECT COUNT(*) FROM information_schema.COLUMNS
    				TABLE_NAME = '$wpdb->terms'
    				AND COLUMN_NAME = 'term_order'

    is the main culprit, as it seems that $wpdb->get_var is being prevented from accessing the information_schema table.

    I still don’t know whether it’s the WordPress default behaviour or a limit set by the host, but then I’ve replaced that query with
    SHOW COLUMNS FROM $wpdb->terms LIKE 'term_order';
    (checking if(empty($row_count)) instead of if($row_count==0))
    and everything eventually goes at full speed.

    However, further testing may be needed to determine if this could be a reliable workaround.


    Just went from a local wamp install to remote and it took me the last hour (because of load times) to figure out that this plugin was the culprit.

    — Just did a fresh DB install to test it out. Goes from 1.2 seconds load time to 18 seconds with this installed. Thank gawd it wasn’t my terrible programming!

    I’ll try your fix and see if it speeds back up.

    Yea that does speed it up but it’s still taking a full second longer to load. Not nearly as bad but bad enough for me to click Delete.

    After looking a bit at the code, there is no need to run anything from the plugin if you’re not in the admin so I did:

    in media-categories.php line 81

    function mc(){
    	if (is_admin())

    And now it only adds that extra second to the admin side.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Media Library Categories] Sitewide slowdown’ is closed to new replies.