Loading issue - Found the bug please fix asap
OK, I have spent countless hours and have finally found the issue causing the main page from loading smoothly. After many, many people looking at me like I'm a dummy I have finally found the problem. First let's start with explaining the problem.
Problem
Site main page load times are extremely slow causing a lag in the initial loading of the main page.
(Please refer to original post here!)
Bug that I have found inside classipress (specifically >>/wp-content/themes/classipress/framework/includes/stats.php)
PHP Code:
SELECT postcount FROM wp_cp_ad_pop_daily WHERE postnum = 5392 AND time = '2013-07-31'\G
Line 168:
.../wp-content/themes/classipress/framework/includes/stats.php
The slowdown is because the query is not cached and it has to look through millions of rows.
What I have done is commented out the following code in line 168 of /wp-content/themes/classipress/framework/includes/stats.php
PHP Code:
$counter = $wpdb->get_var( $wpdb->prepare( "SELECT postcount FROM $wpdb->app_stats_daily WHERE postnum = %d AND time = %s", $post_id, $today_date ) );
} else {
It should look like this
PHP Code:
/*$counter = $wpdb->get_var( $wpdb->prepare( "SELECT postcount FROM $wpdb->app_stats_daily WHERE postnum = %d AND time = %s", $post_id, $today_date ) );
} else {*/
I have also commented out the following code in loop-ad_listing.php in the classipress theme editor towards the bottom
PHP Code:
<!--<?php appthemes_after_post_content(); ?>-->
Also if your running eClassify you will need to also comment out the code in loop-ad_listing.php in eClassify Child Theme as well using the editor.
PHP Code:
<!--<div class="additional">
<?php appthemes_after_post_content(); ?>
</div>-->
Again this has reduced my load time on the main page from 13-30 seconds down to 2-4 seconds after the code fixes. Can you guys please fix this asap?