Plugin triggered by the_excerpt() function and slowing down my homepage
-
Hi Dario,
I’m using a theme that call the_excerpt() function on my homepage. And I noticed that your plugin causing a really slow down to my homepage (more than 5 seconds). This is because every time the_excerpt() function is being called, it also called the_content() function, so it triggers your plugin too. In my case there are 48 queries from your plugin.
Here is a sample from query monitor reports:
222 SELECT number_of_votes, sum_votes
FROM wp_yasr_votes
WHERE post_id=7712
–
dynamic_sidebar(‘colormag_front_page_content_top_section’)
wp-includes/widgets.php:742
WP_Widget->display_callback()
wp-includes/class-wp-widget.php:372
colormag_default_news_widget->widget()
wp-content/themes/v2/inc/widgets/widgets.php:1700
the_excerpt()
wp-includes/post-template.php:362
get_the_excerpt()
wp-includes/post-template.php:397
apply_filters(‘get_the_excerpt’)
wp-includes/plugin.php:203
wp_trim_excerpt()
wp-includes/formatting.php:3313
apply_filters(‘the_content’)
wp-includes/plugin.php:203
yasr_add_schema()
wp-content/plugins/yet-another-stars-rating/lib/yasr-functions.php:568
yasr_get_visitor_votes()
wp-content/plugins/yet-another-stars-rating/lib/yasr-db-functions.php:347120 SELECT vote
FROM wp_yasr_log
WHERE post_id=14992
AND user_id=1
ORDER BY id DESC
LIMIT 1
–
dynamic_sidebar(‘colormag_front_page_content_top_section’)
wp-includes/widgets.php:742
WP_Widget->display_callback()
wp-includes/class-wp-widget.php:372
colormag_default_news_widget->widget()
wp-content/themes/v2/inc/widgets/widgets.php:1700
the_excerpt()
wp-includes/post-template.php:362
get_the_excerpt()
wp-includes/post-template.php:397
apply_filters(‘get_the_excerpt’)
wp-includes/plugin.php:203
wp_trim_excerpt()
wp-includes/formatting.php:3313
apply_filters(‘the_content’)
wp-includes/plugin.php:203
do_shortcode()
wp-includes/shortcodes.php:197
preg_replace_callback()
wp-includes/shortcodes.php:319
do_shortcode_tag()
wp-includes/shortcodes.php:319
shortcode_visitor_votes_callback()
wp-content/plugins/yet-another-stars-rating/lib/yasr-shortcode-functions.php:187
yasr_check_if_user_already_voted()
wp-content/plugins/yet-another-stars-rating/lib/yasr-db-functions.php:384There are 48 of queries like above on my homepage, despite the yasr was not being displayed. Please advise.
Regards,
- The topic ‘Plugin triggered by the_excerpt() function and slowing down my homepage’ is closed to new replies.