cabrerahector / wordpress-popular-posts

WordPress Popular Posts - A highly customizable WordPress widget that displays your most popular posts.
https://wordpress.org/plugins/wordpress-popular-posts/
GNU General Public License v2.0
280 stars 82 forks source link

WPP: Couldn't read JSON data #345

Closed costidima closed 1 year ago

costidima commented 1 year ago

Hi. I get this error on the JavaScript console:

WPP: Couldn't read JSON data
(anonymous) @ wpp.js?ver=6.1.0:121
(anonymous) @ wpp.js?ver=6.1.0:123

The reason i suspect you have this error is because the script added from wp_add_inline_script function doesn't add the ID parameter to the script tag therefore this line doesn't return any results var wpp_json = document.querySelector("script#wpp-json")

cabrerahector commented 1 year ago

Hi @costidima,

This is being caused by a conflict with one of your plugins. You most likely have a plugin that's minifying / bundling JS files for performance but these can often lead to this specific kind of issue.

Please check this FAQ for more details and suggestions: Is WordPress Popular Posts compatible with plugins that minify / bundle JavaScript code?

If you have any further comments / questions please let me know.

costidima commented 1 year ago

Thanks @cabrerahector! Indeed, it was caused by one of the plugins. More precisely, it was the Roots Soil plugin (clean-up feature)