The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
[Solved] Missing argument in _getWPComments causes wrong comments in combiation with redis plugins
✦
✦
✦
AI is analyzing the discussion...
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
Show original
Translating...
Jan 22, 2021 3:01 pm
(@benk)
Active Member
Joined: 5 years ago
Hello,
since the major update an wpDiscuz 7.x there is an error within the method _getWPComments of the file /wp-content/plugins/wpdiscuz/class.WpdiscuzCore.php
In case of non paging comments the array $this->commentsArgs haven't an argument offset like in version 5.3.5.
This missing argument is relavant for the creation of the redis key within WordPress core method get_comments within WordPress core class class-wp-comment-query.php:
$_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) );
unset( $_args['fields'] );
$key = md5( serialize( $_args ) );
$last_changed = wp_cache_get_last_changed( 'comment' );
$cache_key = "get_comments:$key:$last_changed";
$cache_value = wp_cache_get( $cache_key, 'comment' );
See also:
https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-comment-query.php#L429
If your WordPress uses a redis plugin like Redis Object Cache and you will click on the "Load more comments" Button, the same initial comments will be loaded.
Many enterprise bussiness sites based on WordPress are using caching, so please fix this issues.
Best regards,
Ben
Support
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
Show original
Translating...
Jan 25, 2021 12:03 pm
(@asti)
Illustrious Member
Joined: 8 years ago
@benk,
We'll take this into consideration for future updates.
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
Show original
Translating...
Feb 22, 2021 3:02 am
(@bekind)
Active Member
Joined: 5 years ago
Hi @asti - I am having the exact same issue and we are too invested in wpdiscuz as well as redis so we cannot afford to remove either. My developers modified the file pointed by @benk to get "Load More" to work correctly. But that is obviously incorrect.
Can you please share when the solution to this issue is expeced? The way we use wpdisuz makes redis important as we get sudden traffic + comment spikes and redis cache helps us manage our infrastructure.
Regards
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
Show original
Translating...
Apr 14, 2021 4:35 am
(@bekind)
Active Member
Joined: 5 years ago
Hi @asti - Any update on this. We accidentally broke wp comments during Wordpress Upgrade due to this issue. It's kind of critical for sites that heavily use wp comments. Kindly let me know when we can expect a fix here.
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8208
Apr 17, 2021 1:28 pm
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
Show original
Translating...
@bekind,
We've added the wpdiscuz_filter_args hook. You can use the hook and make the caches you like. More info here: https://wpdiscuz.com/docs/codex/filters/wpdiscuz_filter_args/
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
Show original
Translating...
Apr 19, 2021 10:13 pm
(@willybob)
Eminent Member
Joined: 5 years ago
I'm intetrested in this solution as I have exactly the same issue.
But I still don't get how those hooks would solve the problem...
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
Show original
Translating...
Apr 19, 2021 10:18 pm
(@bekind)
Active Member
Joined: 5 years ago
Hi @willybob,
What they are recommending is that we add the pagination parameter in the argument using the hook. The fundamental issue here is that Wordpress core is expecting a parameter "offset" as pointing by OP. But WpDiscuz doesnt have that parameter.
So essentially, one needs to figure out what parameter is used by Wpdiscuz for AJAX pagination and then map that parameter to offset parameter. If we filter the argument that way then the core would be able to create a unique key per page and the solution would behave as expected.
I havent had time to work on this else I would have shared the solution but I do understand what is the issue hence sharing my thoughts. If you happen to make progress, please share so all of us can use the solution. If I get to it before you 🙂 then I would share.
Regards
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
Show original
Translating...
Apr 19, 2021 10:34 pm
(@willybob)
Eminent Member
Joined: 5 years ago
I will, do not hesitate to share any progress too.