Support » Plugin: WP Clean Up » Optimize not working in WP 3.9.x

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m seeing the same error.

    The way WordPress runs some mysql queries has changed in 3.9 and mysql_query is deprecated in favor of mysqli.

    Replace these two spots in wp_clean_up_admin.php:

    line 108

    function wp_clean_up_optimize(){
        global $wpdb;
    	$wcu_sql = 'SHOW TABLE STATUS FROM '.DB_NAME;
    	$result = $wpdb->get_results($wcu_sql);
    	foreach($result as $row) {
    		$wcu_sql = 'OPTIMIZE TABLE '.$row->Name;
    		$wpdb->query($wcu_sql);
    	}
    }

    line 363

    global $wpdb;
    		$total_size = 0;
    		$alternate = " class='alternate'";
    		$wcu_sql = 'SHOW TABLE STATUS FROM <code>'.DB_NAME.'</code>';
    		$result = $wpdb->get_results($wcu_sql);
    
            foreach($result as $row) {
    
                $table_size = $row->Data_length + $row->Index_length;
                $table_size = $table_size / 1024;
                $table_size = sprintf("%0.3f",$table_size);
    
                $every_size = $row->Data_length + $row->Index_length;
                $every_size = $every_size / 1024;
                $total_size += $every_size;
    
                echo "<tr". $alternate .">
                        <td class='column-name'>". $row->Name ."</td>
                        <td class='column-name'>". $table_size ." KB"."</td>
                    </tr>\n";
                $alternate = (empty($alternate)) ? " class='alternate'" : "";
    
            }

    I appreciate the reply but that didn’t work for me. I wonder if it being Network Activated has anything to do with it.

    Hasn’t worked for me either, I’m just running a standard install of WP 3.9.1

    Plugin Author acalbert

    (@acalbert)

    It has been fixed in the new version 1.2.2.Thanks to khanman225.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Optimize not working in WP 3.9.x’ is closed to new replies.