Disable Comments - Version 1.1.1

Version Description

  • Fix PHP warning when active_sitewide_plugins option doesn't contain expected data type.
Download this release

Release Info

Developer solarissmoke
Plugin Icon 128x128 Disable Comments
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1 to 1.1.1

Files changed (2) hide show
  1. disable-comments.php +3 -3
  2. readme.txt +6 -3
disable-comments.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Disable Comments
4
  Plugin URI: http://wordpress.org/extend/plugins/disable-comments/
5
  Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.
6
- Version: 1.1
7
  Author: Samir Shah
8
  Author URI: http://rayofsolaris.net/
9
  License: GPL2
@@ -22,7 +22,7 @@ class Disable_Comments {
22
 
23
  function __construct() {
24
  // are we network activated?
25
- $this->networkactive = ( is_multisite() && array_key_exists( plugin_basename( __FILE__ ), get_site_option( 'active_sitewide_plugins' ) ) );
26
 
27
  // load options
28
  $this->options = $this->networkactive ? get_site_option( 'disable_comments_options', array() ) : get_option( 'disable_comments_options', array() );
@@ -31,7 +31,7 @@ class Disable_Comments {
31
  load_plugin_textdomain( 'disable-comments', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
32
 
33
  // If it looks like first run, check compat
34
- if ( empty( $this->options ) && version_compare( $GLOBALS['wp_version'], '3.3', '<' ) ) {
35
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
36
  deactivate_plugins( __FILE__ );
37
  if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) )
3
  Plugin Name: Disable Comments
4
  Plugin URI: http://wordpress.org/extend/plugins/disable-comments/
5
  Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.
6
+ Version: 1.1.1
7
  Author: Samir Shah
8
  Author URI: http://rayofsolaris.net/
9
  License: GPL2
22
 
23
  function __construct() {
24
  // are we network activated?
25
+ $this->networkactive = ( is_multisite() && array_key_exists( plugin_basename( __FILE__ ), (array) get_site_option( 'active_sitewide_plugins' ) ) );
26
 
27
  // load options
28
  $this->options = $this->networkactive ? get_site_option( 'disable_comments_options', array() ) : get_option( 'disable_comments_options', array() );
31
  load_plugin_textdomain( 'disable-comments', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
32
 
33
  // If it looks like first run, check compat
34
+ if ( empty( $this->options ) && version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) {
35
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
36
  deactivate_plugins( __FILE__ );
37
  if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) )
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: solarissmoke
3
  Donate link: http://rayofsolaris.net/donate.php
4
  Tags: comments, disable, global
5
- Requires at least: 3.5
6
- Tested up to: 3.9
7
  Stable tag: trunk
8
 
9
  Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. Multisite friendly.
@@ -48,7 +48,7 @@ If you still see the message, then it means your theme is overriding this behavi
48
 
49
  = I only want to disable comments on certain posts, not globally. What do I do? =
50
 
51
- For starters, don't install this plugin!
52
 
53
  Go to the edit page for the post you want to disable comments on. Scroll down to the "Discussion" box, where you will find the comment options for that post. If you don't see a "Discussion" box, then click on "Screen Options" at the top of your screen, and make sure the "Discussion" checkbox is checked.
54
 
@@ -74,6 +74,9 @@ The plugin provides the option to **completely disable the commenting feature in
74
 
75
  == Changelog ==
76
 
 
 
 
77
  = 1.1 =
78
  * Attempt to hide the comments template ("Comments are closed") whenever comments are disabled.
79
 
2
  Contributors: solarissmoke
3
  Donate link: http://rayofsolaris.net/donate.php
4
  Tags: comments, disable, global
5
+ Requires at least: 3.6
6
+ Tested up to: 4.0
7
  Stable tag: trunk
8
 
9
  Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. Multisite friendly.
48
 
49
  = I only want to disable comments on certain posts, not globally. What do I do? =
50
 
51
+ Don't install this plugin!
52
 
53
  Go to the edit page for the post you want to disable comments on. Scroll down to the "Discussion" box, where you will find the comment options for that post. If you don't see a "Discussion" box, then click on "Screen Options" at the top of your screen, and make sure the "Discussion" checkbox is checked.
54
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.1.1 =
78
+ * Fix PHP warning when active_sitewide_plugins option doesn't contain expected data type.
79
+
80
  = 1.1 =
81
  * Attempt to hide the comments template ("Comments are closed") whenever comments are disabled.
82