Skip to content

Commit

Permalink
Merge pull request #86 from tterb/wordpress-latest
Browse files Browse the repository at this point in the history
Test plugin with WordPress 5.6 and fix unnecessary `count.js` requests
  • Loading branch information
tterb authored Jan 11, 2021
2 parents f3c9a87 + 2ad32e1 commit af9a7ad
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 65 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Thumbs.db
nbproject
*.sublime-project
*.sublime-workspace
.vscode
.nvmrc

# Build files

Expand Down
19 changes: 0 additions & 19 deletions .vscode/launch.json

This file was deleted.

30 changes: 0 additions & 30 deletions .vscode/settings.json

This file was deleted.

Binary file modified assets/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 16 additions & 11 deletions disqus/README.txt
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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 =

Expand All @@ -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 =

Expand Down Expand Up @@ -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. =

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions disqus/disqus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand All @@ -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' ) ) {
Expand Down
32 changes: 31 additions & 1 deletion disqus/public/class-disqus-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
*
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit af9a7ad

Please sign in to comment.