Disable Comments - Version V2.3.1

Version Description

Download this release

Release Info

Developer wpdevteam
Plugin Icon 128x128 Disable Comments
Version V2.3.1
Comparing to
See all releases

Code changes from version 2.3.0 to V2.3.1

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.3.0
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.3.0');
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/');
@@ -103,6 +103,7 @@ class Disable_Comments
103
 
104
  // Upgrade DB if necessary.
105
  $this->check_db_upgrades();
 
106
 
107
  $this->init_filters();
108
 
@@ -215,6 +216,18 @@ class Disable_Comments
215
  }
216
  }
217
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  private function update_options()
219
  {
220
  if ($this->networkactive && !empty($this->options['is_network_admin']) && $this->options['is_network_admin']) {
@@ -621,11 +634,6 @@ class Disable_Comments
621
  }
622
 
623
  remove_submenu_page('options-general.php', 'options-discussion.php');
624
- // disabling gravatar if enabled.
625
- $show_avatar = get_option('show_avatars', false);
626
- if($show_avatar){
627
- update_option('show_avatars', false);
628
- }
629
  }
630
  }
631
 
@@ -908,6 +916,10 @@ class Disable_Comments
908
  if(isset($formArray['sitewide_settings'])){
909
  update_site_option('disable_comments_sitewide_settings', $formArray['sitewide_settings']);
910
  }
 
 
 
 
911
  // xml rpc
912
  $this->options['remove_xmlrpc_comments'] = (isset($formArray['remove_xmlrpc_comments']) ? intval($formArray['remove_xmlrpc_comments']) : ($this->is_CLI && isset($this->options['remove_xmlrpc_comments']) ? $this->options['remove_xmlrpc_comments'] : 0));
913
  // rest api comments
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.3.1
8
  * Author: WPDeveloper
9
  * Author URI: https://wpdeveloper.net
10
  * License: GPL-3.0+
37
 
38
  function __construct()
39
  {
40
+ define('DC_VERSION', '2.3.1');
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/');
103
 
104
  // Upgrade DB if necessary.
105
  $this->check_db_upgrades();
106
+ $this->check_upgrades();
107
 
108
  $this->init_filters();
109
 
216
  }
217
  }
218
 
219
+ public function check_upgrades(){
220
+ $dc_version = get_option('disable_comment_version');
221
+ if (version_compare($dc_version, '2.3.1', '<')) {
222
+ if (!empty($this->options['remove_everywhere'])){
223
+ update_option('show_avatars', true);
224
+ }
225
+ }
226
+ if(!$dc_version || $dc_version != DC_VERSION){
227
+ update_option('disable_comment_version', DC_VERSION);
228
+ }
229
+ }
230
+
231
  private function update_options()
232
  {
233
  if ($this->networkactive && !empty($this->options['is_network_admin']) && $this->options['is_network_admin']) {
634
  }
635
 
636
  remove_submenu_page('options-general.php', 'options-discussion.php');
 
 
 
 
 
637
  }
638
  }
639
 
916
  if(isset($formArray['sitewide_settings'])){
917
  update_site_option('disable_comments_sitewide_settings', $formArray['sitewide_settings']);
918
  }
919
+
920
+ if(isset($formArray['disable_avatar'])){
921
+ update_option('show_avatars', (bool) !$formArray['disable_avatar']);
922
+ }
923
  // xml rpc
924
  $this->options['remove_xmlrpc_comments'] = (isset($formArray['remove_xmlrpc_comments']) ? intval($formArray['remove_xmlrpc_comments']) : ($this->is_CLI && isset($this->options['remove_xmlrpc_comments']) ? $this->options['remove_xmlrpc_comments'] : 0));
925
  // rest api comments
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.3.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
- "POT-Creation-Date: 2021-12-14 02:30:59+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:155
28
  msgid "Want to help make Disable Comments even better?"
29
  msgstr ""
30
 
31
- #: disable-comments.php:156
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,7 +37,7 @@ msgid ""
37
  "I promise."
38
  msgstr ""
39
 
40
- #: disable-comments.php:168
41
  #. translators: %s: WordPress version no.
42
  msgid "Disable Comments requires WordPress version %s or greater."
43
  msgstr ""
@@ -46,11 +46,11 @@ msgstr ""
46
  msgid "Disable Comments"
47
  msgstr ""
48
 
49
- #: disable-comments.php:465 disable-comments.php:613 disable-comments.php:620
50
  msgid "Comments are closed."
51
  msgstr ""
52
 
53
- #: disable-comments.php:569
54
  #. translators: %s: disabled post types.
55
  msgid ""
56
  "Note: The <em>Disable Comments</em> plugin is currently active, and "
@@ -58,11 +58,11 @@ msgid ""
58
  "not be applicable for those post types."
59
  msgstr ""
60
 
61
- #: disable-comments.php:569
62
  msgid ", "
63
  msgstr ""
64
 
65
- #: disable-comments.php:604
66
  #. translators: %s: URL to Disabled Comment settings page.
67
  msgid ""
68
  "The <strong>Disable Comments</strong> plugin is active, but isn't "
@@ -70,35 +70,36 @@ msgid ""
70
  "page</a> to choose which post types to disable comments on."
71
  msgstr ""
72
 
73
- #: disable-comments.php:698 views/partials/_disable.php:3
74
  msgid "Settings"
75
  msgstr ""
76
 
77
- #: disable-comments.php:699
78
  msgid "Tools"
79
  msgstr ""
80
 
81
- #: disable-comments.php:718 views/partials/_delete.php:72
82
  msgid "Delete Comments"
83
  msgstr ""
84
 
85
- #: disable-comments.php:783
86
  msgid "Default (no type)"
87
  msgstr ""
88
 
89
- #: disable-comments.php:922
90
  msgid "Saved"
91
  msgstr ""
92
 
93
- #: disable-comments.php:993 disable-comments.php:1027 disable-comments.php:1050
 
94
  msgid "All comments have been deleted"
95
  msgstr ""
96
 
97
- #: disable-comments.php:995 disable-comments.php:999
98
  msgid "Internal error occured. Please try again later."
99
  msgstr ""
100
 
101
- #: disable-comments.php:1061
102
  msgid "All spam comments have been deleted"
103
  msgstr ""
104
 
@@ -200,6 +201,7 @@ msgstr ""
200
  #: views/partials/_delete.php:15 views/partials/_delete.php:19
201
  #: views/partials/_disable.php:19 views/partials/_disable.php:28
202
  #: views/partials/_disable.php:33 views/partials/_disable.php:64
 
203
  msgid "Note:"
204
  msgstr ""
205
 
@@ -290,13 +292,13 @@ msgid ""
290
  "types of posts."
291
  msgstr ""
292
 
293
- #: views/partials/_disable.php:14 views/partials/_disable.php:76
294
- #: views/partials/_disable.php:86
295
  msgid "On"
296
  msgstr ""
297
 
298
- #: views/partials/_disable.php:15 views/partials/_disable.php:77
299
- #: views/partials/_disable.php:87
300
  msgid "Off"
301
  msgstr ""
302
 
@@ -338,31 +340,39 @@ msgid ""
338
  "posts. Comments will be visible on all other post types."
339
  msgstr ""
340
 
341
- #: views/partials/_disable.php:68
 
 
 
 
 
 
 
 
342
  msgid "Disable Comments With API"
343
  msgstr ""
344
 
345
- #: views/partials/_disable.php:69
346
  msgid ""
347
  "You can disable comments made on your website using WordPress "
348
  "specifications."
349
  msgstr ""
350
 
351
- #: views/partials/_disable.php:79
352
  msgid "Disable Comments via XML-RPC"
353
  msgstr ""
354
 
355
- #: views/partials/_disable.php:88
356
  msgid "Disable Comments via REST API"
357
  msgstr ""
358
 
359
- #: views/partials/_disable.php:92
360
  msgid ""
361
  "Turning on these settings will disable any comments made on your website "
362
  "via XML-RPC or REST API specifications."
363
  msgstr ""
364
 
365
- #: views/partials/_disable.php:97
366
  msgid "Save Changes"
367
  msgstr ""
368
 
@@ -445,7 +455,7 @@ msgstr ""
445
  msgid "https://wpdeveloper.net"
446
  msgstr ""
447
 
448
- #: disable-comments.php:708
449
  msgctxt "settings menu title"
450
  msgid "Disable Comments"
451
  msgstr ""
2
  # This file is distributed under the GPL-3.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Disable Comments 2.3.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
+ "POT-Creation-Date: 2021-12-14 10:57:48+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:156
28
  msgid "Want to help make Disable Comments even better?"
29
  msgstr ""
30
 
31
+ #: disable-comments.php:157
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:169
41
  #. translators: %s: WordPress version no.
42
  msgid "Disable Comments requires WordPress version %s or greater."
43
  msgstr ""
46
  msgid "Disable Comments"
47
  msgstr ""
48
 
49
+ #: disable-comments.php:478 disable-comments.php:626 disable-comments.php:633
50
  msgid "Comments are closed."
51
  msgstr ""
52
 
53
+ #: disable-comments.php:582
54
  #. translators: %s: disabled post types.
55
  msgid ""
56
  "Note: The <em>Disable Comments</em> plugin is currently active, and "
58
  "not be applicable for those post types."
59
  msgstr ""
60
 
61
+ #: disable-comments.php:582
62
  msgid ", "
63
  msgstr ""
64
 
65
+ #: disable-comments.php:617
66
  #. translators: %s: URL to Disabled Comment settings page.
67
  msgid ""
68
  "The <strong>Disable Comments</strong> plugin is active, but isn't "
70
  "page</a> to choose which post types to disable comments on."
71
  msgstr ""
72
 
73
+ #: disable-comments.php:706 views/partials/_disable.php:3
74
  msgid "Settings"
75
  msgstr ""
76
 
77
+ #: disable-comments.php:707
78
  msgid "Tools"
79
  msgstr ""
80
 
81
+ #: disable-comments.php:726 views/partials/_delete.php:72
82
  msgid "Delete Comments"
83
  msgstr ""
84
 
85
+ #: disable-comments.php:791
86
  msgid "Default (no type)"
87
  msgstr ""
88
 
89
+ #: disable-comments.php:934
90
  msgid "Saved"
91
  msgstr ""
92
 
93
+ #: disable-comments.php:1005 disable-comments.php:1039
94
+ #: disable-comments.php:1062
95
  msgid "All comments have been deleted"
96
  msgstr ""
97
 
98
+ #: disable-comments.php:1007 disable-comments.php:1011
99
  msgid "Internal error occured. Please try again later."
100
  msgstr ""
101
 
102
+ #: disable-comments.php:1073
103
  msgid "All spam comments have been deleted"
104
  msgstr ""
105
 
201
  #: views/partials/_delete.php:15 views/partials/_delete.php:19
202
  #: views/partials/_disable.php:19 views/partials/_disable.php:28
203
  #: views/partials/_disable.php:33 views/partials/_disable.php:64
204
+ #: views/partials/_disable.php:80
205
  msgid "Note:"
206
  msgstr ""
207
 
292
  "types of posts."
293
  msgstr ""
294
 
295
+ #: views/partials/_disable.php:14 views/partials/_disable.php:74
296
+ #: views/partials/_disable.php:93 views/partials/_disable.php:103
297
  msgid "On"
298
  msgstr ""
299
 
300
+ #: views/partials/_disable.php:15 views/partials/_disable.php:75
301
+ #: views/partials/_disable.php:94 views/partials/_disable.php:104
302
  msgid "Off"
303
  msgstr ""
304
 
340
  "posts. Comments will be visible on all other post types."
341
  msgstr ""
342
 
343
+ #: views/partials/_disable.php:76
344
+ msgid "Disable Avatar"
345
+ msgstr ""
346
+
347
+ #: views/partials/_disable.php:80
348
+ msgid "This will remove Avatar from your entire website."
349
+ msgstr ""
350
+
351
+ #: views/partials/_disable.php:85
352
  msgid "Disable Comments With API"
353
  msgstr ""
354
 
355
+ #: views/partials/_disable.php:86
356
  msgid ""
357
  "You can disable comments made on your website using WordPress "
358
  "specifications."
359
  msgstr ""
360
 
361
+ #: views/partials/_disable.php:96
362
  msgid "Disable Comments via XML-RPC"
363
  msgstr ""
364
 
365
+ #: views/partials/_disable.php:105
366
  msgid "Disable Comments via REST API"
367
  msgstr ""
368
 
369
+ #: views/partials/_disable.php:109
370
  msgid ""
371
  "Turning on these settings will disable any comments made on your website "
372
  "via XML-RPC or REST API specifications."
373
  msgstr ""
374
 
375
+ #: views/partials/_disable.php:114
376
  msgid "Save Changes"
377
  msgstr ""
378
 
455
  msgid "https://wpdeveloper.net"
456
  msgstr ""
457
 
458
+ #: disable-comments.php:716
459
  msgctxt "settings menu title"
460
  msgid "Disable Comments"
461
  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.3.0
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.3.0] - 2021-12-14 =
195
  * New Feature: Delete Spam Comments.
196
  * Updated deprecated jQuery library.
5
  Requires at least: 5.0
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 2.3.1
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.3.1] - 2021-12-14 =
195
+ * Added: You can enable or disable Avatar from Disable Comments settings.
196
+
197
  = [2.3.0] - 2021-12-14 =
198
  * New Feature: Delete Spam Comments.
199
  * Updated deprecated jQuery library.
views/partials/_disable.php CHANGED
@@ -63,6 +63,23 @@
63
  </div>
64
  <p class="subtitle"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('Disabling comments will also disable trackbacks and pingbacks. All comment-related fields will also be hidden from the edit/quick-edit screens of the affected posts. These settings cannot be overridden for individual posts. Comments will be visible on all other post types.', 'disable-comments'); ?></p>
65
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  </div>
67
  <div class="disable__comment__option mb50">
68
  <h3 class="title"><?php _e('Disable Comments With API', 'disable-comments'); ?></h3>
63
  </div>
64
  <p class="subtitle"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('Disabling comments will also disable trackbacks and pingbacks. All comment-related fields will also be hidden from the edit/quick-edit screens of the affected posts. These settings cannot be overridden for individual posts. Comments will be visible on all other post types.', 'disable-comments'); ?></p>
65
  </div>
66
+ <?php if(!is_network_admin()):?>
67
+ <div class="disable_option dc-text__block mt30">
68
+ <div class="disable__switchs">
69
+ <div class="dissable__switch__item">
70
+ <input type="hidden" name="disable_avatar" value="0">
71
+ <input type="checkbox" id="switch-api" name="disable_avatar" value="1" <?php checked(!get_option('show_avatars', false)); ?>>
72
+ <label for="switch-api">
73
+ <span class="switch">
74
+ <span class="switch__text on"><?php _e('On', 'disable-comments'); ?></span>
75
+ <span class="switch__text off"><?php _e('Off', 'disable-comments'); ?></span>
76
+ </span><?php _e('Disable Avatar', 'disable-comments'); ?>
77
+ </label>
78
+ </div>
79
+ </div>
80
+ <p class="disable__option__description"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('This will remove Avatar from your entire website.', 'disable-comments'); ?></p>
81
+ </div>
82
+ <?php endif;?>
83
  </div>
84
  <div class="disable__comment__option mb50">
85
  <h3 class="title"><?php _e('Disable Comments With API', 'disable-comments'); ?></h3>