Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

WPDiscuz slowing down my site

4 Posts
2 Users
0 Reactions
3,149 Views
Posts: 9
Customer
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@weninrome)
Member
Joined: 9 years ago
[#3589]

Hello 

My server hosts have notified me of the following issue:

As you can see below, there are multiple concurrent queries for the same query parameters (same 'user_id' search), and each query takes over 2 seconds. I want to understand why this happening (there should only be 1 query, not multiple queries with the same parameters), 

Time: 2019-03-04T04:52:02.323104Z

User@Host: wp_nrlsctalk[wp_nrlsctalk] @ localhost [] Id: 5903

Query_time: 2.102812 Lock_time: 0.000050 Rows_sent: 0 Rows_examined: 142515

SET timestamp=1551675122;
SELECT comment_ID FROM wp_comments WHERE comment_type = 'private' AND comment_parent = 0 AND user_id = 46057;

Time: 2019-03-04T04:52:02.384026Z

User@Host: wp_nrlsctalk[wp_nrlsctalk] @ localhost [] Id: 5907

Query_time: 2.205697 Lock_time: 0.000049 Rows_sent: 0 Rows_examined: 142515

SET timestamp=1551675122;
SELECT comment_ID FROM wp_comments WHERE comment_type = 'private' AND comment_parent = 0 AND user_id = 46057;

Time: 2019-03-04T04:52:02.455034Z

User@Host: wp_nrlsctalk[wp_nrlsctalk] @ localhost [] Id: 5905

Query_time: 2.196140 Lock_time: 0.000056 Rows_sent: 0 Rows_examined: 142515

SET timestamp=1551675122;
SELECT comment_ID FROM wp_comments WHERE comment_type = 'private' AND comment_parent = 0 AND user_id = 46057;

Time: 2019-03-04T04:52:02.457939Z

User@Host: wp_nrlsctalk[wp_nrlsctalk] @ localhost [] Id: 5904

Query_time: 2.419714 Lock_time: 0.000049 Rows_sent: 0 Rows_examined: 142515

SET timestamp=1551675122;
SELECT comment_ID FROM wp_comments WHERE comment_type = 'private' AND comment_parent = 0 AND user_id = 46057;


3 Replies
Astghik
Posts: 6645
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@astgh)
Illustrious Member
Joined: 8 years ago

Hi @weninrome,

wpDiscuz Private Comments add-on uses the native Wordpress  get_comments_number hook to display the comment count. In your case, it calls the  get_comments_number() function several times. The functions are being used to show the correct number of comments for each user. I mean the cases if there are private comments that needn't be included in the comments count. 

I suggest you remove the action using the code provided below, but in this case, there is a risk of displaying the whole comments count including the private comments:

remove_filter('get_comments_number', [$wpDiscuzPrivateComment, 'getCommentNumber'], 268);

You need to add the code in your active theme's function.php file. 


Reply
1 Reply
Customer
(@weninrome)
Joined: 9 years ago

Member
Posts: 9
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Hello, 

Would it just be better for me to disable one of the add on plugins instead? If so, which should I disable?


Reply
Astghik
Posts: 6645
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@astgh)
Illustrious Member
Joined: 8 years ago

@weninrome,

You should disable the Private comments add-on. 


Reply
Share:
Scroll to top