diff --git a/.gitignore b/.gitignore index f824356..e619b4b 100755 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,8 @@ Thumbs.db nbproject *.sublime-project *.sublime-workspace +.vscode +.nvmrc # Build files diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 970684c..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Listen for XDebug", - "type": "php", - "request": "launch", - "port": 8888 - }, - { - "name": "Launch currently open script", - "type": "php", - "request": "launch", - "program": "${file}", - "cwd": "${fileDirname}", - "port": 9000 - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 1ad4c70..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,30 +0,0 @@ -// Place your settings in this file to overwrite default and user settings. -{ - "files.trimTrailingWhitespace": true, - - // From `final-newline` extension - "files.insertFinalNewline": true, - - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true, - "**/node_modules": true - }, - - // Configure glob patterns for excluding files and folders in searches. - // Inherits all glob patterns from the file.exclude setting. - "search.exclude": { - "**/vendor": true, - "**/*.bundle.*.js": true, - "**/*.bundle.*.js.map": true, - "**/*.bundle.*.min.js": true - }, - - "editor.rulers": [ - 120 - ], - "window.zoomLevel": 0, - "php.validate.enable": true, - "php.validate.executablePath": null, - "php.validate.run": "onType" -} diff --git a/assets/screenshot-1.png b/assets/screenshot-1.png index cac1c2e..a0fcceb 100644 Binary files a/assets/screenshot-1.png and b/assets/screenshot-1.png differ diff --git a/assets/screenshot-2.png b/assets/screenshot-2.png index 72c0614..8d04f7a 100644 Binary files a/assets/screenshot-2.png and b/assets/screenshot-2.png differ diff --git a/assets/screenshot-3.png b/assets/screenshot-3.png index d66a52a..72c0614 100644 Binary files a/assets/screenshot-3.png and b/assets/screenshot-3.png differ diff --git a/assets/screenshot-5.png b/assets/screenshot-5.png index f70f04d..84c4a46 100644 Binary files a/assets/screenshot-5.png and b/assets/screenshot-5.png differ diff --git a/disqus/README.txt b/disqus/README.txt index 390a6d1..b690cc9 100755 --- a/disqus/README.txt +++ b/disqus/README.txt @@ -1,10 +1,10 @@ === Disqus Comment System === -Contributors: disqus, alexkingorg, crowdfavorite, zeeg, tail, thetylerhayes, ryanv12, iamfrancisyo, brevityness -Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget, disqus +Contributors: disqus, alexkingorg, crowdfavorite, zeeg, tail, thetylerhayes, ryanv12, iamfrancisyo, brevityness, tterb +Tags: disqus, comments, engagement, threaded, email, notification, spam, avatars, community, profile, widget Requires at least: 4.4 -Tested up to: 5.1 -Stable tag: 3.0.17 -Requires PHP: 5.4 +Tested up to: 5.6 +Stable tag: 3.0.18 +Requires PHP: 5.6 Disqus is the web's most popular comment system. Use Disqus to increase engagement, retain readers, and grow your audience. @@ -22,7 +22,7 @@ The Disqus for WordPress plugin lets site owners and developers easily add Disqu * Improve SEO ranking with user generated content * Keep spam out with our best-in-class anti-spam filter powered by Akismet * Single profile for commenting on over 4 million sites including social login support for Facebook, Twitter, and Google accounts -* Trusted by sites like Wired, CBS, and Entertainment Weekly +* Trusted by sites like ABC News, Entertainment Weekly, and Rotten Tomatoes = Disqus Features = @@ -42,7 +42,7 @@ The Disqus for WordPress plugin lets site owners and developers easily add Disqu * Flexible login options - Social login with Facebook, Twitter, and Google, SSO, and guest commenting support * Instant activity notifications, email notifications, and digests pull readers back in * User profiles that show you recent comment history and frequented communities -* Discovery widget that shows active discussions happening elsewhere on your site +* Recommendations widget that shows where active discussions are happening elsewhere on your site = Moderation Features = @@ -80,7 +80,7 @@ Yes, you can import your existing WordPress comments into Disqus during installa = How do I set up Single Sign-On (SSO)? = -SSO allows users in your database to comment without requiring them to register with Disqus. Access to SSO is currently available as an add-on for users with a [Pro subscription](https://help.disqus.com/customer/en/portal/articles/2759918-disqus-pricing-and-plans#pro-plan). If you would like to enable this feature, [contact our Support team](https://disqus.com/support/?article=contact_SSO). Also check out our guide for [setting up SSO on WordPress](https://help.disqus.com/customer/portal/articles/1148635). +SSO allows users in your database to comment without requiring them to register with Disqus. Access to SSO is currently available as an add-on for users with a [Business subscription](https://help.disqus.com/customer/en/portal/articles/2759918-disqus-pricing-and-plans#business-plan). If you would like to enable this feature, [contact our Support team](https://disqus.com/support/?article=contact_SSO). Also check out our guide for [setting up SSO on WordPress](https://help.disqus.com/customer/portal/articles/1148635). = I’m experiencing an issue with my installation of Disqus. = @@ -111,10 +111,10 @@ Go to [https://disqus.com/help/wordpress](https://disqus.com/help/wordpress) == Screenshots == 1. Disqus Comments -2. Comment Reply -3. Disqus Audience Platform +2. Disqus Audience Platform +3. Comment Reply 4. Featured Comment -5. Discovery Box (part of Disqus Comments) +5. Recommendations (part of Disqus Comments) 6. Mentions 7. Real-time Comments 8. Commenter User Profile @@ -124,6 +124,11 @@ Go to [https://disqus.com/help/wordpress](https://disqus.com/help/wordpress) == Changelog == += 3.0.18 = +* Tested plugin with WordPress 5.6 and updated documentation +* Fixed count.js script being loaded on unnecessary pages +* Fixed comments showing sync date instead of creation date in WordPress admin + = 3.0.17 = * Bumping version for WP 5.1 version bump. (Changes to README versions and main php file's version) * Fixed Undefined index bug where HTTP_HOST could not find web server diff --git a/disqus/disqus.php b/disqus/disqus.php index d753548..c976920 100755 --- a/disqus/disqus.php +++ b/disqus/disqus.php @@ -15,7 +15,7 @@ * Plugin Name: Disqus for WordPress * Plugin URI: https://disqus.com/ * Description: Disqus helps publishers increase engagement and build loyal audiences. Supports syncing comments to your database for easy backup. - * Version: 3.0.17 + * Version: 3.0.18 * Author: Disqus * Author URI: https://disqus.com/ * License: GPL-2.0+ @@ -24,7 +24,7 @@ * Domain Path: /languages */ -$DISQUSVERSION = '3.0.17'; +$DISQUSVERSION = '3.0.18'; // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { diff --git a/disqus/public/class-disqus-public.php b/disqus/public/class-disqus-public.php index 38456b7..03e11db 100755 --- a/disqus/public/class-disqus-public.php +++ b/disqus/public/class-disqus-public.php @@ -208,7 +208,9 @@ public function dsq_close_window_template() { * @since 3.0 */ public function enqueue_comment_count() { - if ( $this->dsq_can_load( 'count' ) ) { + global $post; + + if ( $this->dsq_comment_count_can_load_for_post( $post ) ) { $count_vars = array( 'disqusShortname' => $this->shortname, @@ -263,6 +265,34 @@ private function dsq_can_load( $script_name ) { return true; } + /** + * Determines if Disqus is configured and should load the comment count script on a given page. + * + * @since 3.0.18 + * @access private + * @param WP_Post $post The WordPress post used to determine if Disqus can be loaded. + * @return boolean Whether Disqus is configured properly and should load the comment count on the current page. + */ + private function dsq_comment_count_can_load_for_post( $post ) { + // Checks if the plugin is configured properly + // and is a valid page. + if ( ! $this->dsq_can_load( 'count' ) ) { + return false; + } + + // Make sure we have a $post object. + if ( ! isset( $post ) ) { + return false; + } + + // Make sure comments are open if it's a single post page. + if ( is_singular() && ! comments_open() ) { + return false; + } + + return true; + } + /** * Determines if Disqus is configured and can the comments embed on a given page. * diff --git a/package.json b/package.json index ff90cee..3f54051 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "disqus-wordpress-plugin", - "version": "3.0.17", - "description": "", + "version": "3.0.18", + "description": "A WordPress plugin that allows site owners to easily replace the default commenting system with Disqus", "main": "frontend/src/js/index.js", "scripts": { "build": "yarn run build:dev && yarn run build:dist",