Added a check for the Disqus container before adding the embed script to the page.
Motivation and Context
WP report
I have a strong feeling that this issue is only happening when something in the WordPress theme or site is misconfigured that's causing pages to pass our other conditions because I couldn't reproduce the issue on the test site and the issue is only being reported for a couple of sites.
If you look at one of the sites listed in the report thread, you can see that there's a /wp-content/plugins/disqus-comment-system/public/js/comment_embed.js?ver=3.0.21 script on the page that shouldn't be added to pages that don't have comments. This is causing the rest of the plugin to think that we should go forward with adding the embed script, even though we don't have a disqus_thread element to load the thread into.
Someone with more WordPress knowledge could probably find a better solution.
How Has This Been Tested?
Tested locally with the WP test site
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
Description
Added a check for the Disqus container before adding the embed script to the page.
Motivation and Context
WP report I have a strong feeling that this issue is only happening when something in the WordPress theme or site is misconfigured that's causing pages to pass our other conditions because I couldn't reproduce the issue on the test site and the issue is only being reported for a couple of sites. If you look at one of the sites listed in the report thread, you can see that there's a
/wp-content/plugins/disqus-comment-system/public/js/comment_embed.js?ver=3.0.21
script on the page that shouldn't be added to pages that don't have comments. This is causing the rest of the plugin to think that we should go forward with adding the embed script, even though we don't have adisqus_thread
element to load the thread into.Someone with more WordPress knowledge could probably find a better solution.
How Has This Been Tested?
Tested locally with the WP test site
Types of changes
Checklist:
This change is