Disqus Comment System - Version 3.0.8

Version Description

  • Fixed a bug that prevented automatic installation when upgrading from version 2.86 or earlier.
Download this release

Release Info

Developer ryanv12
Plugin Icon Disqus Comment System
Version 3.0.8
Comparing to
See all releases

Code changes from version 3.0.7 to 3.0.8

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: disqus, alexkingorg, crowdfavorite, zeeg, tail, thetylerhayes, rya
3
  Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget, disqus
4
  Requires at least: 4.4
5
  Tested up to: 4.9.4
6
- Stable tag: 3.0.7
7
 
8
  Disqus is the web's most popular comment system. Use Disqus to increase engagement, retain readers, and grow your audience.
9
 
@@ -118,6 +118,10 @@ Go to [https://disqus.com/help/wordpress](https://disqus.com/help/wordpress)
118
 
119
  == Changelog ==
120
 
 
 
 
 
121
  = 3.0.7 =
122
 
123
  * Plugin has been completely rewritten to support modern and secure WordPress features.
3
  Tags: comments, threaded, email, notification, spam, avatars, community, profile, widget, disqus
4
  Requires at least: 4.4
5
  Tested up to: 4.9.4
6
+ Stable tag: 3.0.8
7
 
8
  Disqus is the web's most popular comment system. Use Disqus to increase engagement, retain readers, and grow your audience.
9
 
118
 
119
  == Changelog ==
120
 
121
+ = 3.0.8 =
122
+
123
+ * Fixed a bug that prevented automatic installation when upgrading from version 2.86 or earlier.
124
+
125
  = 3.0.7 =
126
 
127
  * Plugin has been completely rewritten to support modern and secure WordPress features.
admin/bundles/js/{en.disqus-admin.bundle.3.0.7.min.js → en.disqus-admin.bundle.3.0.8.min.js} RENAMED
File without changes
admin/class-disqus-admin.php CHANGED
@@ -61,6 +61,7 @@ class Disqus_Admin {
61
  $this->disqus = $disqus;
62
  $this->version = $version;
63
  $this->shortname = $shortname;
 
64
  }
65
 
66
  /**
@@ -276,4 +277,18 @@ class Disqus_Admin {
276
  private function get_site_name() {
277
  return esc_html( get_bloginfo( 'name' ) );
278
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  }
61
  $this->disqus = $disqus;
62
  $this->version = $version;
63
  $this->shortname = $shortname;
64
+ $this->ensure_sync_token();
65
  }
66
 
67
  /**
277
  private function get_site_name() {
278
  return esc_html( get_bloginfo( 'name' ) );
279
  }
280
+
281
+ /**
282
+ * Checks the stored `disqus_sync_token` and generates a new one if it doesn't exist.
283
+ * This is used as a secret key for authenticating requests through the REST API.
284
+ *
285
+ * @since 3.0.8
286
+ * @access private
287
+ */
288
+ private function ensure_sync_token() {
289
+ $existing_token = get_option( 'disqus_sync_token', null );
290
+ if ( empty( $existing_token ) ) {
291
+ update_option( 'disqus_sync_token', bin2hex( random_bytes( 16 ) ) );
292
+ }
293
+ }
294
  }
disqus.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Disqus for WordPress
16
  * Plugin URI: https://disqus.com/
17
  * Description: Disqus helps publishers increase engagement and build loyal audiences. Supports syncing comments to your database for easy backup.
18
- * Version: 3.0.7
19
  * Author: Disqus
20
  * Author URI: https://disqus.com/
21
  * License: GPL-2.0+
@@ -29,15 +29,6 @@ if ( ! defined( 'WPINC' ) ) {
29
  die;
30
  }
31
 
32
- /**
33
- * The code that runs during plugin activation.
34
- * This action is documented in includes/class-disqus-activator.php
35
- */
36
- function activate_disqus() {
37
- require_once plugin_dir_path( __FILE__ ) . 'includes/class-disqus-activator.php';
38
- Disqus_Activator::activate();
39
- }
40
-
41
  /**
42
  * The code that runs during plugin deactivation.
43
  * This action is documented in includes/class-disqus-deactivator.php
@@ -47,7 +38,6 @@ function deactivate_disqus() {
47
  Disqus_Deactivator::deactivate();
48
  }
49
 
50
- register_activation_hook( __FILE__, 'activate_disqus' );
51
  register_deactivation_hook( __FILE__, 'deactivate_disqus' );
52
 
53
  /**
@@ -67,7 +57,7 @@ require plugin_dir_path( __FILE__ ) . 'includes/class-disqus.php';
67
  */
68
  function run_disqus() {
69
 
70
- $plugin = new Disqus( '3.0.7' );
71
  $plugin->run();
72
 
73
  }
15
  * Plugin Name: Disqus for WordPress
16
  * Plugin URI: https://disqus.com/
17
  * Description: Disqus helps publishers increase engagement and build loyal audiences. Supports syncing comments to your database for easy backup.
18
+ * Version: 3.0.8
19
  * Author: Disqus
20
  * Author URI: https://disqus.com/
21
  * License: GPL-2.0+
29
  die;
30
  }
31
 
 
 
 
 
 
 
 
 
 
32
  /**
33
  * The code that runs during plugin deactivation.
34
  * This action is documented in includes/class-disqus-deactivator.php
38
  Disqus_Deactivator::deactivate();
39
  }
40
 
 
41
  register_deactivation_hook( __FILE__, 'deactivate_disqus' );
42
 
43
  /**
57
  */
58
  function run_disqus() {
59
 
60
+ $plugin = new Disqus( '3.0.8' );
61
  $plugin->run();
62
 
63
  }
includes/class-disqus-activator.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Fired during plugin activation
4
- *
5
- * @link https://disqus.com
6
- * @since 3.0
7
- *
8
- * @package Disqus
9
- * @subpackage Disqus/includes
10
- */
11
-
12
- /**
13
- * Fired during plugin activation.
14
- *
15
- * This class defines all code necessary to run during the plugin's activation.
16
- *
17
- * @since 3.0
18
- * @package Disqus
19
- * @subpackage Disqus/includes
20
- * @author Ryan Valentin <ryan@disqus.com>
21
- */
22
- class Disqus_Activator {
23
-
24
- /**
25
- * Short Description. (use period)
26
- *
27
- * Long Description.
28
- *
29
- * @since 3.0
30
- */
31
- public static function activate() {
32
- $existing_token = get_option( 'disqus_sync_token', null );
33
-
34
- // Create a shared secret token that will be used for install/syncing with Disqus.
35
- if ( empty( $existing_token ) ) {
36
- update_option( 'disqus_sync_token', bin2hex( random_bytes( 16 ) ) );
37
- }
38
- }
39
-
40
- }