Disable Comments - Version 2.2.3

Version Description

Download this release

Release Info

Developer wpdevteam
Plugin Icon 128x128 Disable Comments
Version 2.2.3
Comparing to
See all releases

Code changes from version 2.2.2 to 2.2.3

disable-comments.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Disable Comments
5
  * Plugin URI: https://wordpress.org/plugins/disable-comments/
6
  * Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. You could bulk delete comments using Tools.
7
- * Version: 2.2.2
8
  * Author: WPDeveloper
9
  * Author URI: https://wpdeveloper.net
10
  * License: GPL-3.0+
@@ -37,7 +37,7 @@ class Disable_Comments
37
 
38
  function __construct()
39
  {
40
- define('DC_VERSION', '2.2.2');
41
  define('DC_PLUGIN_SLUG', 'disable_comments_settings');
42
  define('DC_PLUGIN_ROOT_PATH', dirname(__FILE__));
43
  define('DC_PLUGIN_VIEWS_PATH', DC_PLUGIN_ROOT_PATH . '/views/');
@@ -138,6 +138,10 @@ class Disable_Comments
138
 
139
  public function start_plugin_usage_tracking()
140
  {
 
 
 
 
141
  if (!class_exists('DisableComments_Plugin_Tracker')) {
142
  include_once(DC_PLUGIN_ROOT_PATH . '/includes/class-plugin-usage-tracker.php');
143
  }
@@ -187,11 +191,15 @@ class Disable_Comments
187
  if ($old_ver < 7 && function_exists( 'get_sites' )) {
188
  $this->options['disabled_sites'] = [];
189
  $dc_options = get_site_option('disable_comments_options', array());
190
- $disabled_sites = isset($dc_options['disabled_sites']) ? $dc_options['disabled_sites'] : [];
191
 
192
  foreach(get_sites(['number' => 0]) as $blog){
193
  $blog_id = $blog->blog_id;
194
- $this->options['disabled_sites']["site_$blog_id"] = in_array($blog_id, $disabled_sites);
 
 
 
 
 
195
  }
196
  $this->options['disabled_sites'] = $this->get_disabled_sites();
197
  }
@@ -574,6 +582,9 @@ class Disable_Comments
574
  return;
575
  }
576
  $hascaps = $this->networkactive && is_network_admin() ? current_user_can('manage_network_plugins') : current_user_can('manage_options');
 
 
 
577
  if ($hascaps) {
578
  $this->setup_notice_flag = true;
579
  // translators: %s: URL to Disabled Comment settings page.
4
  * Plugin Name: Disable Comments
5
  * Plugin URI: https://wordpress.org/plugins/disable-comments/
6
  * Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. You could bulk delete comments using Tools.
7
+ * Version: 2.2.3
8
  * Author: WPDeveloper
9
  * Author URI: https://wpdeveloper.net
10
  * License: GPL-3.0+
37
 
38
  function __construct()
39
  {
40
+ define('DC_VERSION', '2.2.3');
41
  define('DC_PLUGIN_SLUG', 'disable_comments_settings');
42
  define('DC_PLUGIN_ROOT_PATH', dirname(__FILE__));
43
  define('DC_PLUGIN_VIEWS_PATH', DC_PLUGIN_ROOT_PATH . '/views/');
138
 
139
  public function start_plugin_usage_tracking()
140
  {
141
+ if($this->networkactive && !$this->options['sitewide_settings']){
142
+ $this->tracker = null;
143
+ return;
144
+ }
145
  if (!class_exists('DisableComments_Plugin_Tracker')) {
146
  include_once(DC_PLUGIN_ROOT_PATH . '/includes/class-plugin-usage-tracker.php');
147
  }
191
  if ($old_ver < 7 && function_exists( 'get_sites' )) {
192
  $this->options['disabled_sites'] = [];
193
  $dc_options = get_site_option('disable_comments_options', array());
 
194
 
195
  foreach(get_sites(['number' => 0]) as $blog){
196
  $blog_id = $blog->blog_id;
197
+ if(isset($dc_options['disabled_sites'])){
198
+ $this->options['disabled_sites']["site_$blog_id"] = in_array($blog_id, $dc_options['disabled_sites']);
199
+ }
200
+ else{
201
+ $this->options['disabled_sites']["site_$blog_id"] = true;
202
+ }
203
  }
204
  $this->options['disabled_sites'] = $this->get_disabled_sites();
205
  }
582
  return;
583
  }
584
  $hascaps = $this->networkactive && is_network_admin() ? current_user_can('manage_network_plugins') : current_user_can('manage_options');
585
+ if($this->networkactive && !is_network_admin() && !$this->options['sitewide_settings']){
586
+ $hascaps = false;
587
+ }
588
  if ($hascaps) {
589
  $this->setup_notice_flag = true;
590
  // translators: %s: URL to Disabled Comment settings page.
languages/disable-comments.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL-3.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Disable Comments 2.2.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
- "POT-Creation-Date: 2021-10-05 04:44:47+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -24,11 +24,11 @@ msgstr ""
24
  "X-Textdomain-Support: yes\n"
25
  "X-Generator: grunt-wp-i18n 1.0.3\n"
26
 
27
- #: disable-comments.php:150
28
  msgid "Want to help make Disable Comments even better?"
29
  msgstr ""
30
 
31
- #: disable-comments.php:151
32
  msgid ""
33
  "We collect non-sensitive diagnostic data and plugin usage information. Your "
34
  "site URL, WordPress & PHP version, plugins & themes and email address to "
@@ -37,16 +37,16 @@ msgid ""
37
  "I promise."
38
  msgstr ""
39
 
40
- #: disable-comments.php:163
41
  #. translators: %s: WordPress version no.
42
  msgid "Disable Comments requires WordPress version %s or greater."
43
  msgstr ""
44
 
45
- #: disable-comments.php:446 disable-comments.php:589 disable-comments.php:596
46
  msgid "Comments are closed."
47
  msgstr ""
48
 
49
- #: disable-comments.php:548
50
  #. translators: %s: disabled post types.
51
  msgid ""
52
  "Note: The <em>Disable Comments</em> plugin is currently active, and "
@@ -54,11 +54,11 @@ msgid ""
54
  "not be applicable for those post types."
55
  msgstr ""
56
 
57
- #: disable-comments.php:548
58
  msgid ", "
59
  msgstr ""
60
 
61
- #: disable-comments.php:580
62
  #. translators: %s: URL to Disabled Comment settings page.
63
  msgid ""
64
  "The <strong>Disable Comments</strong> plugin is active, but isn't "
@@ -66,31 +66,31 @@ msgid ""
66
  "page</a> to choose which post types to disable comments on."
67
  msgstr ""
68
 
69
- #: disable-comments.php:669 views/partials/_disable.php:3
70
  msgid "Settings"
71
  msgstr ""
72
 
73
- #: disable-comments.php:670
74
  msgid "Tools"
75
  msgstr ""
76
 
77
- #: disable-comments.php:689 views/partials/_delete.php:84
78
  msgid "Delete Comments"
79
  msgstr ""
80
 
81
- #: disable-comments.php:752
82
  msgid "Default (no type)"
83
  msgstr ""
84
 
85
- #: disable-comments.php:867
86
  msgid "Saved"
87
  msgstr ""
88
 
89
- #: disable-comments.php:937 disable-comments.php:971 disable-comments.php:994
90
  msgid "All comments have been deleted"
91
  msgstr ""
92
 
93
- #: disable-comments.php:939 disable-comments.php:943
94
  msgid "Internal error occured. Please try again later."
95
  msgstr ""
96
 
@@ -286,9 +286,7 @@ msgid ""
286
  msgstr ""
287
 
288
  #: views/partials/_disable.php:48
289
- msgid ""
290
- "Enable Site Wise settings if you want to configure “Disable Comments” "
291
- "settings individually on every website."
292
  msgstr ""
293
 
294
  #: views/partials/_disable.php:53
@@ -426,7 +424,7 @@ msgstr ""
426
  msgid "https://wpdeveloper.net"
427
  msgstr ""
428
 
429
- #: disable-comments.php:679
430
  msgctxt "settings menu title"
431
  msgid "Disable Comments"
432
  msgstr ""
2
  # This file is distributed under the GPL-3.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Disable Comments 2.2.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
+ "POT-Creation-Date: 2021-10-25 06:12:22+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
24
  "X-Textdomain-Support: yes\n"
25
  "X-Generator: grunt-wp-i18n 1.0.3\n"
26
 
27
+ #: disable-comments.php:154
28
  msgid "Want to help make Disable Comments even better?"
29
  msgstr ""
30
 
31
+ #: disable-comments.php:155
32
  msgid ""
33
  "We collect non-sensitive diagnostic data and plugin usage information. Your "
34
  "site URL, WordPress & PHP version, plugins & themes and email address to "
37
  "I promise."
38
  msgstr ""
39
 
40
+ #: disable-comments.php:167
41
  #. translators: %s: WordPress version no.
42
  msgid "Disable Comments requires WordPress version %s or greater."
43
  msgstr ""
44
 
45
+ #: disable-comments.php:454 disable-comments.php:600 disable-comments.php:607
46
  msgid "Comments are closed."
47
  msgstr ""
48
 
49
+ #: disable-comments.php:556
50
  #. translators: %s: disabled post types.
51
  msgid ""
52
  "Note: The <em>Disable Comments</em> plugin is currently active, and "
54
  "not be applicable for those post types."
55
  msgstr ""
56
 
57
+ #: disable-comments.php:556
58
  msgid ", "
59
  msgstr ""
60
 
61
+ #: disable-comments.php:591
62
  #. translators: %s: URL to Disabled Comment settings page.
63
  msgid ""
64
  "The <strong>Disable Comments</strong> plugin is active, but isn't "
66
  "page</a> to choose which post types to disable comments on."
67
  msgstr ""
68
 
69
+ #: disable-comments.php:680 views/partials/_disable.php:3
70
  msgid "Settings"
71
  msgstr ""
72
 
73
+ #: disable-comments.php:681
74
  msgid "Tools"
75
  msgstr ""
76
 
77
+ #: disable-comments.php:700 views/partials/_delete.php:84
78
  msgid "Delete Comments"
79
  msgstr ""
80
 
81
+ #: disable-comments.php:763
82
  msgid "Default (no type)"
83
  msgstr ""
84
 
85
+ #: disable-comments.php:878
86
  msgid "Saved"
87
  msgstr ""
88
 
89
+ #: disable-comments.php:948 disable-comments.php:982 disable-comments.php:1005
90
  msgid "All comments have been deleted"
91
  msgstr ""
92
 
93
+ #: disable-comments.php:950 disable-comments.php:954
94
  msgid "Internal error occured. Please try again later."
95
  msgstr ""
96
 
286
  msgstr ""
287
 
288
  #: views/partials/_disable.php:48
289
+ msgid "All the underneath settings will be applied for these selected sub sites."
 
 
290
  msgstr ""
291
 
292
  #: views/partials/_disable.php:53
424
  msgid "https://wpdeveloper.net"
425
  msgstr ""
426
 
427
+ #: disable-comments.php:690
428
  msgctxt "settings menu title"
429
  msgid "Disable Comments"
430
  msgstr ""
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: comments, delete comments, disable comments, spam comment, disable, stop s
5
  Requires at least: 5.0
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 2.2.2
9
  License: GPL-3.0-or-later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -191,6 +191,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
191
  and this project adheres to [Semantic Versioning](http://semver.org/).
192
  This will be maiintained from August 19, 2020 - @asif2bd
193
 
 
 
 
194
  = [2.2.2] - 2021-10-05 =
195
  * Added: "Select All" checkbox for subsites selection in a multisite network.
196
  * Few minor bug fixes and improvement.
5
  Requires at least: 5.0
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 2.2.3
9
  License: GPL-3.0-or-later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
191
  and this project adheres to [Semantic Versioning](http://semver.org/).
192
  This will be maiintained from August 19, 2020 - @asif2bd
193
 
194
+ = [2.2.3] - 2021-10-25 =
195
+ * Few minor bug fixes and improvement.
196
+
197
  = [2.2.2] - 2021-10-05 =
198
  * Added: "Select All" checkbox for subsites selection in a multisite network.
199
  * Few minor bug fixes and improvement.
views/partials/_disable.php CHANGED
@@ -45,7 +45,7 @@
45
  }
46
  ?>
47
  </div>
48
- <p class="disable__option__description"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('Enable Site Wise settings if you want to configure “Disable Comments” settings individually on every website.', 'disable-comments'); ?></p>
49
  </div>
50
  <?php elseif($this->options['sitewide_settings'] && !empty($this->options['is_network_options'])):?>
51
  <div class="disable_option dc-text__block mb30 mt30">
45
  }
46
  ?>
47
  </div>
48
+ <p class="disable__option__description"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('All the underneath settings will be applied for these selected sub sites.', 'disable-comments'); ?></p>
49
  </div>
50
  <?php elseif($this->options['sitewide_settings'] && !empty($this->options['is_network_options'])):?>
51
  <div class="disable_option dc-text__block mb30 mt30">