Support Forum
This is doable no problem at all!
We don’t use a cache plugin.
Testresults:
1 at the time
Line 64: add_action('sph_setup_forum', 'sp_linking_check_delete_action');
Queries decreased 255 to 248
Line 120: add_action('sph_setup_forum', 'sp_linking_break_listen');
Queries decreased 255 to 247
Together: 255 to 245
Line 67: add_filter('the_content', 'sp_linking_show_blog_link');
Queries decreased 255 to 245
Line 68: add_filter('the excerpt', 'sp_linking_show_blog_link');
Queries decreased 255 to 247
Together: 255 to 255
Line 111: add_action('sph_blog_support_start', 'sp_linking_canonical_url', 1, 1);
Queries decreased 255 to 247
Line 112: add_filter('sph_aioseo_canonical_url', 'sp_linking_aioseo_caninical_url', 1, 2);
Queries decreased 255 to 248
Line 113: add_filter('sph_canonical_url', 'sp_linking_switch_canionical_url');
Queries decreased 255 to 247
None of these are resposible for the queryload!
I did some extra testing. Get comments number is suspicious!
Line 75: add_filter('get_comments_number', 'sp_comments_count_filter', 1, 2);
Queries decreased from 255 to 160
Line 497: remove_filter('get_comments_number', 'sp_comments_count_filter', 1);
Queries decreased 255 to 161
Together: 255 to 160
I think we've found the main culprit in the get_comment action and filter!?
KR,
Wil
sorry, will have to wait for @yellow-swordfish to return in the am...
Visit Cruise Talk Central and Mr Papa's World
Ah... is that what the numbers are against each of the little extracts? Comment counts?
Seems like a pretty unique situation which is why, I guess, it hasn't come up before. Seems that probably the best solution would be to cache the data which would result in one read per post instead of multiple. Let me see what I can work out today and then I can ask you to change the code and test. OK?
YELLOW
SWORDFISH
|
Let's try this. Same file as before but this time right down the very bottom is the function:
sp_blog_links_control()
On the line before the switch command at the top can you insert the line:
static $bLinks = array();
and then we will change the case 'read' code to be:
if(!array_key_exists($postid, $bLinks)) $bLinks[$postid] = spdb_table(SFLINKS, "post_id=$postid", 'row'); return $bLinks[$postid]; break;
and see if that helps out. I would be quite happy to make this part of the permanent code.
YELLOW
SWORDFISH
|
The blog link plugin is turned on. On the article page the Forumlink is disapeared. Undo the code changes will show up the forumlink again. There is a get_comments code in my themefunctionsfile, could that be responsible for the extra queryload on the frontpage together with the bloglinkfunction.
The get_comments is a part of the recentcomment widget!
Bit we did nothing to stop the blog link showing up. All we did was cache the results so that ot did not perform more than 1 database query for each post ID.
What about the filter.action hooka at the top? They should ALL now be uncomnented and running. Are they?
YELLOW
SWORDFISH
|
1 Guest(s)