Notifications
Clear all

wpForo 1.x.x [Closed] wpForo slows site - useless wp_posts calls

10 Posts
2 Users
0 Likes
677 Views
Posts: 33
Topic starter
(@stan1z)
Trusted Member
Joined: 4 years ago

Hello,

The categories of my site (photo catalog) became work very slow - 16 seconds to generate the page. The "Query Monitor" plugin displays that wpForo generate many slow calls like that:

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1
AND ( wp_term_relationships.term_taxonomy_id IN (15,17,18,19,20,24,49,76,82,86,93,94,96,97,98,99,114,116,120,122,143,161,180,204,213,221,227,243,244,247,261,268,324,370,376,377,378,409,410,411,421,442,450,451,452,453,468,477,483,507,525,529,530,531,532,541,542,548,549,571,580,600,603,671,677,691,694,731,1038,1039,1042,1105,1245,1246,1248,1249,1250,1251,1252,1253,1254,1255,1274,1287,1291,1300,1302,1319,1328,1368,1369,1395,1396,1397,1429,1455,1486,1488,1502,1528,1545,1556,1578,1580,1581,1626,1647,1652,1657,1658,1659,1660,1661,1698,1699,1762,1763,1777,1782,1793,1818,1829,1830,1966,1976,2000,2032,2090,2099,2100,2108) )
AND wp_posts.post_type = 'post'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'private')
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 10

Why wpForo do this? How can I get rid of this?

Screens:

#1 - general query stats, 16 seconds by wpForo

9 Replies
Posts: 33
Topic starter
(@stan1z)
Trusted Member
Joined: 4 years ago

Screen #2 - part of slow queries list

Screen #3 - wpForo deactivated. The page generates during just 1,58 seconds (red strip on top).

Robert
Posts: 10503
Admin
(@robert)
Support Team
Joined: 8 years ago

@robert,

You can ignore all my points above This is not wpForo call for sure, this comes from the forum page widgets, not from wpForo widgets, these SQ are from other plugins. You can click and investigate the calling tree. wpForo has no any relation to these SQL, even if you see the "wpforo" word in the column. That's wrong information. wpForo doesn't have any call for wp_posts and wp_taxonomies. wpForo uses its own wp_wpforo_forums and wp_wpforo_posts tables. This is 100% not wpForo SQL.

3 Replies
Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10503

Please leave direct URL to that page. Some component is connected to wpForo and that component generates the SQL. This is not wpForo SQL but somehow the SQL generator function is contacted to wpForo page. Can you click on the Query Monitor report and go to the functions and files that calls the SQL. This is important to find the real SQL caller.

Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10503

And, please answer on this questions:

  1. First, please let me know what is your MySQL version.
  2. Then make sure you use innoDB database type.
  3. WordPress loopback issue. Don't forget disable other plugins when you check it. This can be other plugins affection.

And, can we see that topic?

(@stan1z)
Joined: 4 years ago

Trusted Member
Posts: 33

@robert

The URL of the page is http://test.waralbum.ru/category/war/

DB is MySQL 5.7.22 (InnoDB is on)

The report of Query Monitor regarding functions of this slow queries:

WP_Query->get_posts()

wp-includes/class-wp-query.php:2994
WP_Query->query()
wp-includes/class-wp-query.php:3413
WP_Query->__construct()
wp-includes/class-wp-query.php:3522
url_to_postid()
wp-includes/rewrite.php:612
wpforo_get_wp_post_content()
wp-content/plugins/wpforo/wpf-includes/functions.php:124
is_wpforo_shortcode_page()
wp-content/plugins/wpforo/wpf-includes/functions.php:117
wpForo->init_current_url()
wp-content/plugins/wpforo/wpforo.php:263
wpForo->init()
wp-content/plugins/wpforo/wpforo.php:247
do_action('init')
wp-includes/plugin.php:478

 

Posts: 33
Topic starter
(@stan1z)
Trusted Member
Joined: 4 years ago

As for lookback issue, I don't now how actually locate it. I've installed Site Heath plugin, it reports:

Your site couldn't complete loopback request

Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.

The loopback request to your site failed, this means features relying on them are not currently working as expected.
Error encountered: (0) Response could not be parsed

Robert
Posts: 10503
Admin
(@robert)
Support Team
Joined: 8 years ago

@stan1z,

Thank you for the details. And yes, this is not wpForo for sure. wpForo calls get_posts() WordPress functions one time. This function is injected by some custom code or by some plugin or by the theme. So it's being initiated with wpForo. You should disable other plugins and st it again. Then check your active theme functions.php and then try to change the theme.

I recommend duplicate your website or backup before this manipulation, because changing the theme may affect some widget and menu settings. Use the Duplicator plugin and clone your website in some sub-domain and start disabling all plugins, then switch the theme to some defaults theme. You should only keep wpForo activated to see that this is not wpForo SQL.

2 Replies
(@stan1z)
Joined: 4 years ago

Trusted Member
Posts: 33

@robert,

Yes, I have test.* version of my site.

I disabled all plugins except wpForo and Query Monitor - the problem remained. Still slow "wpForo" queries.

I switched to standard theme, but this page became work even 2 times slower - 60 seconds! And all slow queries by wpForo, again. 

Disabled wpForo - no slow queries.

The problem was solved, in general, by updating wpForo to v.1.7.2 (I had 1.7.0). As I disabled all plugins, I disabled plugin that blocks plugin updates, and saw that wpForo has new version.

After update to v.1.7.2 I still have 2 "slow" queries "by wpForo" (the same as I discribed in 1st post) 0.5 seconds each, but total delay (1 second) is acceptable.

Thank you for your attention. I agree with you that wpForo has no reasons to call get_posts() for many times and slow the site such a way, but all changes with perfomance were after manipultaing with wpForo (disabling, updating), so may be there is actually some issue...

Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10503

@stan1z,

Please send admin login details of the DEV website to info[at]gvectors.com email address. We'll login and find the problem maker within next 12-24 hours.