Disable Comments - Version 2.2.0

Version Description

Download this release

Release Info

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

Code changes from version 2.1.2 to 2.2.0

assets/css/style.css CHANGED
@@ -1250,6 +1250,10 @@ a.color__instagram:hover, a.color__instagram:focus {
1250
  max-width: 75%;
1251
  }
1252
  }
 
 
 
 
1253
  .button__primary:not(.hover__highlight) {
1254
  background: #623cea;
1255
  color: white;
@@ -1847,6 +1851,12 @@ button.button__instagram.hover__highlight:hover .icon {
1847
  color: #ffffff;
1848
  background: #05cb6b;
1849
  }
 
 
 
 
 
 
1850
  @media (max-width: 991.98px) {
1851
  .disablecommentswrap .button {
1852
  height: 50px;
@@ -1865,11 +1875,15 @@ button.button__instagram.hover__highlight:hover .icon {
1865
  .disablecommentswrap .button__success {
1866
  color: #ffffff;
1867
  background: #05cb6b;
 
1868
  }
1869
  .disablecommentswrap .button__success:hover, .disablecommentswrap .button__success:focus {
1870
  background: rgba(5, 203, 107, 0.9);
1871
  color: #ffffff;
1872
  }
 
 
 
1873
  .disablecommentswrap .button--sm {
1874
  height: 40px;
1875
  line-height: 40px;
@@ -1878,6 +1892,65 @@ button.button__instagram.hover__highlight:hover .icon {
1878
  margin-right: 15px;
1879
  }
1880
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1881
  .disable__comment__alert {
1882
  display: flex;
1883
  align-items: center;
@@ -2079,6 +2152,16 @@ button.button__instagram.hover__highlight:hover .icon {
2079
  .disable__comment__option .disable_option {
2080
  border-radius: 5px;
2081
  }
 
 
 
 
 
 
 
 
 
 
2082
  .disable__comment__option .disable_option input[type=radio] {
2083
  display: none;
2084
  }
@@ -2181,6 +2264,9 @@ button.button__instagram.hover__highlight:hover .icon {
2181
  flex-wrap: wrap;
2182
  margin-bottom: 10px;
2183
  }
 
 
 
2184
  .disable__comment__option .disable_option .delete__checklist .delete__checklist__item {
2185
  flex: 0 0 130px;
2186
  margin-right: 10px;
@@ -2231,6 +2317,9 @@ button.button__instagram.hover__highlight:hover .icon {
2231
  flex-wrap: wrap;
2232
  margin-bottom: 10px;
2233
  }
 
 
 
2234
  .disable__comment__option .disable_option .remove__checklist .remove__checklist__item {
2235
  flex: 0 0 130px;
2236
  margin-right: 10px;
1250
  max-width: 75%;
1251
  }
1252
  }
1253
+ .form__control {
1254
+ border: 1px solid rgba(0, 0, 0, 0.15) !important;
1255
+ }
1256
+
1257
  .button__primary:not(.hover__highlight) {
1258
  background: #623cea;
1259
  color: white;
1851
  color: #ffffff;
1852
  background: #05cb6b;
1853
  }
1854
+ .disablecommentswrap .button.button__fade {
1855
+ display: flex;
1856
+ align-items: center;
1857
+ min-width: 190px;
1858
+ justify-content: center;
1859
+ }
1860
  @media (max-width: 991.98px) {
1861
  .disablecommentswrap .button {
1862
  height: 50px;
1875
  .disablecommentswrap .button__success {
1876
  color: #ffffff;
1877
  background: #05cb6b;
1878
+ opacity: 0.6;
1879
  }
1880
  .disablecommentswrap .button__success:hover, .disablecommentswrap .button__success:focus {
1881
  background: rgba(5, 203, 107, 0.9);
1882
  color: #ffffff;
1883
  }
1884
+ .disablecommentswrap .button__success.form-dirty {
1885
+ opacity: 1;
1886
+ }
1887
  .disablecommentswrap .button--sm {
1888
  height: 40px;
1889
  line-height: 40px;
1892
  margin-right: 15px;
1893
  }
1894
 
1895
+ .cancelButton {
1896
+ padding: 0;
1897
+ border-radius: 5px;
1898
+ color: #808da1 !important;
1899
+ font-size: 15px;
1900
+ border: 0;
1901
+ font-weight: 700;
1902
+ padding: 0 20px;
1903
+ box-shadow: none;
1904
+ outline: none;
1905
+ background: #f4f6fc !important;
1906
+ }
1907
+
1908
+ .confirmButton {
1909
+ padding: 0;
1910
+ border-radius: 5px;
1911
+ color: #fff !important;
1912
+ font-size: 15px;
1913
+ border: 0;
1914
+ font-weight: 700;
1915
+ padding: 0 20px;
1916
+ box-shadow: none;
1917
+ outline: none;
1918
+ background: #e0061a !important;
1919
+ }
1920
+ .confirmButton:focus {
1921
+ outline: none !important;
1922
+ box-shadow: none !important;
1923
+ }
1924
+
1925
+ #eael-spinner {
1926
+ width: 18px;
1927
+ display: inline-block;
1928
+ float: left;
1929
+ margin: 0 5px 0 0;
1930
+ -webkit-transition-property: -webkit-transform;
1931
+ -webkit-transition-duration: 1.2s;
1932
+ -webkit-animation-name: rotate;
1933
+ -webkit-animation-iteration-count: infinite;
1934
+ -webkit-animation-timing-function: linear;
1935
+ -moz-transition-property: -moz-transform;
1936
+ -moz-animation-name: rotate;
1937
+ -moz-animation-duration: 1.2s;
1938
+ -moz-animation-iteration-count: infinite;
1939
+ -moz-animation-timing-function: linear;
1940
+ transition-property: transform;
1941
+ animation-name: rotate;
1942
+ animation-duration: 1.2s;
1943
+ animation-iteration-count: infinite;
1944
+ animation-timing-function: linear;
1945
+ }
1946
+ @keyframes rotate {
1947
+ from {
1948
+ transform: rotate(0deg);
1949
+ }
1950
+ to {
1951
+ transform: rotate(360deg);
1952
+ }
1953
+ }
1954
  .disable__comment__alert {
1955
  display: flex;
1956
  align-items: center;
2152
  .disable__comment__option .disable_option {
2153
  border-radius: 5px;
2154
  }
2155
+ .disable__comment__option .disable_option h3 {
2156
+ font-size: 18px;
2157
+ font-weight: 500;
2158
+ color: #22282d;
2159
+ font-family: "DM Sans", sans-serif;
2160
+ position: relative;
2161
+ line-height: 1.3;
2162
+ display: block;
2163
+ margin-bottom: 15px;
2164
+ }
2165
  .disable__comment__option .disable_option input[type=radio] {
2166
  display: none;
2167
  }
2264
  flex-wrap: wrap;
2265
  margin-bottom: 10px;
2266
  }
2267
+ .disable__comment__option .disable_option .delete__checklist.disabled__sites .delete__checklist__item {
2268
+ flex: 0 1 200px;
2269
+ }
2270
  .disable__comment__option .disable_option .delete__checklist .delete__checklist__item {
2271
  flex: 0 0 130px;
2272
  margin-right: 10px;
2317
  flex-wrap: wrap;
2318
  margin-bottom: 10px;
2319
  }
2320
+ .disable__comment__option .disable_option .remove__checklist.disabled__sites .remove__checklist__item {
2321
+ flex: 0 1 200px;
2322
+ }
2323
  .disable__comment__option .disable_option .remove__checklist .remove__checklist__item {
2324
  flex: 0 0 130px;
2325
  margin-right: 10px;
assets/js/disable-comments-settings-scripts.js CHANGED
@@ -1,4 +1,6 @@
1
- jQuery(document).ready(function () {
 
 
2
  /**
3
  * Settings Scripts
4
  */
@@ -28,9 +30,31 @@ jQuery(document).ready(function () {
28
  }
29
  disbale_comments_tabs();
30
  // UI Helper
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  function disable_comments_uihelper() {
32
  var indiv_bits = jQuery(
33
- ".remove__checklist .remove__checklist__item, #extratypes"
34
  );
35
  if (jQuery("#remove_everywhere").is(":checked")) {
36
  indiv_bits
@@ -53,7 +77,7 @@ jQuery(document).ready(function () {
53
 
54
  function delete_comments_uihelper() {
55
  var toggle_pt_bits = jQuery(
56
- ".delete__checklist .delete__checklist__item, #extradeletetypes"
57
  );
58
  var toggle_ct_bits = jQuery("#listofdeletecommenttypes");
59
  if (jQuery("#delete_everywhere").is(":checked")) {
@@ -105,47 +129,95 @@ jQuery(document).ready(function () {
105
  nonce: disableCommentsObj._nonce,
106
  data: jQuery(this).serializeArray(),
107
  };
108
- jQuery.post(ajaxurl, data, function (response) {
109
- if (response.success) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  Swal.fire({
111
- icon: "success",
112
- title: response.data.message,
113
- timer: 3000,
114
- showConfirmButton: false,
115
  });
116
- }
117
  });
118
  });
119
  jQuery("#deleteCommentSettings").on("submit", function (e) {
120
  e.preventDefault();
 
121
  Swal.fire({
122
- icon: "info",
123
- title: "Request Sending...",
124
- text: "Please wait.",
125
- showConfirmButton: false,
126
- });
127
- var data = {
128
- action: disableCommentsObj.delete_action,
129
- nonce: disableCommentsObj._nonce,
130
- data: jQuery(this).serializeArray(),
131
- };
132
- jQuery.post(ajaxurl, data, function (response) {
133
- if (response.success) {
 
 
134
  Swal.fire({
135
- icon: "success",
136
- title: "Deleted",
137
- html: response.data.message,
138
- timer: 3000,
139
  showConfirmButton: false,
140
  });
141
- } else {
142
- Swal.fire({
143
- icon: "error",
144
- title: "Oops...",
145
- html: response.data.message,
146
- showConfirmButton: true,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  });
148
  }
149
  });
150
  });
 
 
 
 
 
151
  });
1
+ jQuery(document).ready(function ($) {
2
+ var saveBtn = jQuery("#disableCommentSaveSettings button.button.button__success");
3
+ var deleteBtn = jQuery("#deleteCommentSettings button.button.button__delete");
4
  /**
5
  * Settings Scripts
6
  */
30
  }
31
  disbale_comments_tabs();
32
  // UI Helper
33
+ function enable_site_wise_uihelper() {
34
+ var indiv_bits = jQuery(
35
+ ".disabled__sites .remove__checklist__item"
36
+ );
37
+ if (jQuery("#sitewide_settings").is(":checked")) {
38
+ indiv_bits
39
+ .css("opacity", ".3")
40
+ .find(":input")
41
+ .attr("disabled", true);
42
+ } else {
43
+ indiv_bits
44
+ .css("opacity", "1")
45
+ .find(":input")
46
+ .attr("disabled", false);
47
+ }
48
+ }
49
+
50
+ jQuery("#sitewide_settings").on('change', function () {
51
+ enable_site_wise_uihelper();
52
+ });
53
+ enable_site_wise_uihelper();
54
+
55
  function disable_comments_uihelper() {
56
  var indiv_bits = jQuery(
57
+ "#disable__post__types .remove__checklist__item, #extratypes"
58
  );
59
  if (jQuery("#remove_everywhere").is(":checked")) {
60
  indiv_bits
77
 
78
  function delete_comments_uihelper() {
79
  var toggle_pt_bits = jQuery(
80
+ "#delete__post__types .delete__checklist__item, #extradeletetypes"
81
  );
82
  var toggle_ct_bits = jQuery("#listofdeletecommenttypes");
83
  if (jQuery("#delete_everywhere").is(":checked")) {
129
  nonce: disableCommentsObj._nonce,
130
  data: jQuery(this).serializeArray(),
131
  };
132
+
133
+ jQuery.ajax({
134
+ url: ajaxurl,
135
+ type: "post",
136
+ data: data,
137
+ beforeSend: function () {
138
+ saveBtn.html(
139
+ '<svg id="eael-spinner" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 48 48"><circle cx="24" cy="4" r="4" fill="#fff"/><circle cx="12.19" cy="7.86" r="3.7" fill="#fffbf2"/><circle cx="5.02" cy="17.68" r="3.4" fill="#fef7e4"/><circle cx="5.02" cy="30.32" r="3.1" fill="#fef3d7"/><circle cx="12.19" cy="40.14" r="2.8" fill="#feefc9"/><circle cx="24" cy="44" r="2.5" fill="#feebbc"/><circle cx="35.81" cy="40.14" r="2.2" fill="#fde7af"/><circle cx="42.98" cy="30.32" r="1.9" fill="#fde3a1"/><circle cx="42.98" cy="17.68" r="1.6" fill="#fddf94"/><circle cx="35.81" cy="7.86" r="1.3" fill="#fcdb86"/></svg><span>Saving Settings..</span>'
140
+ );
141
+ },
142
+ success: function (response) {
143
+ if (response.success) {
144
+ saveBtn.html("Save Settings");
145
+ Swal.fire({
146
+ icon: "success",
147
+ title: response.data.message,
148
+ timer: 3000,
149
+ showConfirmButton: false,
150
+ });
151
+ saveBtn.removeClass('form-dirty');
152
+ }
153
+ },
154
+ error: function () {
155
+ saveBtn.html("Save Settings");
156
  Swal.fire({
157
+ type: "error",
158
+ title: "Oops...",
159
+ text: "Something went wrong!",
 
160
  });
161
+ },
162
  });
163
  });
164
  jQuery("#deleteCommentSettings").on("submit", function (e) {
165
  e.preventDefault();
166
+ var $form = jQuery(this);
167
  Swal.fire({
168
+ icon: "error",
169
+ title: "Are you sure?",
170
+ text: "You won't be able to revert this!",
171
+ showConfirmButton: true,
172
+ showCancelButton: true,
173
+ confirmButtonText: 'Yes, Delete It',
174
+ cancelButtonText: 'No, Cancel',
175
+ customClass: {
176
+ confirmButton: 'confirmButton',
177
+ cancelButton: 'cancelButton'
178
+ },
179
+ reverseButtons: true,
180
+ }).then(function(result){
181
+ if (result.isConfirmed) {
182
  Swal.fire({
183
+ icon: "info",
184
+ title: "Deleting comments...",
185
+ text: "Please wait.",
 
186
  showConfirmButton: false,
187
  });
188
+ var data = {
189
+ action: disableCommentsObj.delete_action,
190
+ nonce: disableCommentsObj._nonce,
191
+ data: $form.serializeArray(),
192
+ };
193
+ deleteBtn.html(
194
+ '<svg id="eael-spinner" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 48 48"><circle cx="24" cy="4" r="4" fill="#fff"/><circle cx="12.19" cy="7.86" r="3.7" fill="#fffbf2"/><circle cx="5.02" cy="17.68" r="3.4" fill="#fef7e4"/><circle cx="5.02" cy="30.32" r="3.1" fill="#fef3d7"/><circle cx="12.19" cy="40.14" r="2.8" fill="#feefc9"/><circle cx="24" cy="44" r="2.5" fill="#feebbc"/><circle cx="35.81" cy="40.14" r="2.2" fill="#fde7af"/><circle cx="42.98" cy="30.32" r="1.9" fill="#fde3a1"/><circle cx="42.98" cy="17.68" r="1.6" fill="#fddf94"/><circle cx="35.81" cy="7.86" r="1.3" fill="#fcdb86"/></svg><span>Deleting Comments..</span>'
195
+ );
196
+ jQuery.post(ajaxurl, data, function (response) {
197
+ deleteBtn.html("Delete Comments");
198
+ if (response.success) {
199
+ Swal.fire({
200
+ icon: "success",
201
+ title: "Deleted",
202
+ html: response.data.message,
203
+ timer: 3000,
204
+ showConfirmButton: false,
205
+ });
206
+ } else {
207
+ Swal.fire({
208
+ icon: "error",
209
+ title: "Oops...",
210
+ html: response.data.message,
211
+ showConfirmButton: true,
212
+ });
213
+ }
214
  });
215
  }
216
  });
217
  });
218
+
219
+ jQuery("#disableCommentSaveSettings").on('change keydown', 'input', function (e) {
220
+ // jQuery(this).off(e);
221
+ saveBtn.addClass('form-dirty');
222
+ });
223
  });
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.1.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.1.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/');
@@ -61,6 +61,29 @@ class Disable_Comments
61
  // Load options.
62
  if ($this->networkactive && (is_network_admin() || $this->sitewide_settings !== '1')) {
63
  $this->options = get_site_option('disable_comments_options', array());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  } else {
65
  $this->options = get_option('disable_comments_options', array());
66
  $not_configured = empty($this->options) || empty($this->options['settings_saved']);
@@ -71,6 +94,7 @@ class Disable_Comments
71
  }
72
  }
73
 
 
74
  // If it looks like first run, check compat.
75
  if (empty($this->options)) {
76
  $this->check_compatibility();
@@ -744,6 +768,10 @@ class Disable_Comments
744
 
745
  $this->options['is_network_admin'] = isset($formArray['is_network_admin']) && $formArray['is_network_admin'] == '1' ? true : false;
746
 
 
 
 
 
747
  if (isset($formArray['mode'])) {
748
  $this->options['remove_everywhere'] = (sanitize_text_field($formArray['mode']) == 'remove_everywhere');
749
  }
@@ -803,9 +831,11 @@ class Disable_Comments
803
  if ( !empty($formArray['is_network_admin']) && function_exists( 'get_sites' ) && class_exists( 'WP_Site_Query' ) ) {
804
  $sites = get_sites();
805
  foreach ( $sites as $site ) {
806
- switch_to_blog( $site->blog_id );
807
- $log = $this->delete_comments($_args);
808
- restore_current_blog();
 
 
809
  }
810
  }
811
  else{
@@ -843,7 +873,7 @@ class Disable_Comments
843
  $wpdb->query("UPDATE $wpdb->posts SET comment_count = 0");
844
  $wpdb->query("OPTIMIZE TABLE $wpdb->commentmeta");
845
  $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
846
- $log = __('All comments has been deleted', 'disable-comments');
847
  } else {
848
  wp_send_json_error(array('message' => __('Internal error occured. Please try again later.', 'disable-comments')));
849
  wp_die();
@@ -877,7 +907,7 @@ class Disable_Comments
877
 
878
  $wpdb->query("OPTIMIZE TABLE $wpdb->commentmeta");
879
  $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
880
- $log = __('All comments has been deleted', 'disable-comments');
881
  }
882
  } elseif ($formArray['delete_mode'] == 'selected_delete_comment_types') {
883
  $delete_comment_types = empty($formArray['delete_comment_types']) ? array() : (array) $formArray['delete_comment_types'];
@@ -900,7 +930,7 @@ class Disable_Comments
900
  $wpdb->query("OPTIMIZE TABLE $wpdb->commentmeta");
901
  $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
902
 
903
- $log = __('All comments has been deleted', 'disable-comments');
904
  }
905
  }
906
  }
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.0
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.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/');
61
  // Load options.
62
  if ($this->networkactive && (is_network_admin() || $this->sitewide_settings !== '1')) {
63
  $this->options = get_site_option('disable_comments_options', array());
64
+ if(!isset($this->options['disabled_sites'])){
65
+ $sites = get_sites();
66
+ $this->options['disabled_sites'] = array_map(function($site){
67
+ return $site->blog_id;
68
+ }, $sites);
69
+ }
70
+ $blog_id = get_current_blog_id();
71
+ if(
72
+ !is_network_admin() && (
73
+ empty($this->options['disabled_sites']) ||
74
+ !in_array($blog_id, $this->options['disabled_sites'])
75
+ )
76
+ ){
77
+ $this->options = [
78
+ 'remove_everywhere' => false,
79
+ 'disabled_post_types' => array(),
80
+ 'extra_post_types' => array(),
81
+ 'remove_xmlrpc_comments' => 0,
82
+ 'remove_rest_API_comments' => 0,
83
+ 'settings_saved' => true,
84
+ 'db_version' => $this->options['db_version']
85
+ ];
86
+ }
87
  } else {
88
  $this->options = get_option('disable_comments_options', array());
89
  $not_configured = empty($this->options) || empty($this->options['settings_saved']);
94
  }
95
  }
96
 
97
+
98
  // If it looks like first run, check compat.
99
  if (empty($this->options)) {
100
  $this->check_compatibility();
768
 
769
  $this->options['is_network_admin'] = isset($formArray['is_network_admin']) && $formArray['is_network_admin'] == '1' ? true : false;
770
 
771
+ if(!empty($formArray['disabled_sites'])){
772
+ $this->options['disabled_sites'] = $formArray['disabled_sites'];
773
+ }
774
+
775
  if (isset($formArray['mode'])) {
776
  $this->options['remove_everywhere'] = (sanitize_text_field($formArray['mode']) == 'remove_everywhere');
777
  }
831
  if ( !empty($formArray['is_network_admin']) && function_exists( 'get_sites' ) && class_exists( 'WP_Site_Query' ) ) {
832
  $sites = get_sites();
833
  foreach ( $sites as $site ) {
834
+ if( !empty($formArray['disabled_sites']) && in_array($site->blog_id, $formArray['disabled_sites'])){
835
+ switch_to_blog( $site->blog_id );
836
+ $log = $this->delete_comments($_args);
837
+ restore_current_blog();
838
+ }
839
  }
840
  }
841
  else{
873
  $wpdb->query("UPDATE $wpdb->posts SET comment_count = 0");
874
  $wpdb->query("OPTIMIZE TABLE $wpdb->commentmeta");
875
  $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
876
+ $log = __('All comments have been deleted', 'disable-comments');
877
  } else {
878
  wp_send_json_error(array('message' => __('Internal error occured. Please try again later.', 'disable-comments')));
879
  wp_die();
907
 
908
  $wpdb->query("OPTIMIZE TABLE $wpdb->commentmeta");
909
  $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
910
+ $log = __('All comments have been deleted', 'disable-comments');
911
  }
912
  } elseif ($formArray['delete_mode'] == 'selected_delete_comment_types') {
913
  $delete_comment_types = empty($formArray['delete_comment_types']) ? array() : (array) $formArray['delete_comment_types'];
930
  $wpdb->query("OPTIMIZE TABLE $wpdb->commentmeta");
931
  $wpdb->query("OPTIMIZE TABLE $wpdb->comments");
932
 
933
+ $log = __('All comments have been deleted', 'disable-comments');
934
  }
935
  }
936
  }
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.1.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
- "POT-Creation-Date: 2021-06-20 11:01:34+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:121
28
  msgid "Want to help make Disable Comments even better?"
29
  msgstr ""
30
 
31
- #: disable-comments.php:122
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:134
41
  #. translators: %s: WordPress version no.
42
  msgid "Disable Comments requires WordPress version %s or greater."
43
  msgstr ""
44
 
45
- #: disable-comments.php:379 disable-comments.php:522 disable-comments.php:529
46
  msgid "Comments are closed."
47
  msgstr ""
48
 
49
- #: disable-comments.php:481
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:481
58
  msgid ", "
59
  msgstr ""
60
 
61
- #: disable-comments.php:513
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:602 views/partials/_disable.php:3
70
  msgid "Settings"
71
  msgstr ""
72
 
73
- #: disable-comments.php:603
74
  msgid "Tools"
75
  msgstr ""
76
 
77
- #: disable-comments.php:622 views/partials/_delete.php:54
78
  msgid "Delete Comments"
79
  msgstr ""
80
 
81
- #: disable-comments.php:681
82
  msgid "Default (no type)"
83
  msgstr ""
84
 
85
- #: disable-comments.php:781
86
  msgid "Saved"
87
  msgstr ""
88
 
89
- #: disable-comments.php:846 disable-comments.php:880 disable-comments.php:903
90
- msgid "All comments has been deleted"
91
  msgstr ""
92
 
93
- #: disable-comments.php:848 disable-comments.php:852
94
  msgid "Internal error occured. Please try again later."
95
  msgstr ""
96
 
@@ -189,39 +189,44 @@ msgstr ""
189
  msgid "Disable Comments via REST API. "
190
  msgstr ""
191
 
192
- #: views/partials/_delete.php:6 views/partials/_disable.php:19
193
- #: views/partials/_disable.php:25 views/partials/_disable.php:56
 
194
  msgid "Note:"
195
  msgstr ""
196
 
197
- #: views/partials/_delete.php:6
 
 
 
 
198
  msgid ""
199
  "These settings will permanently delete comments for your entire website, or "
200
  "for specific posts and comment types."
201
  msgstr ""
202
 
203
- #: views/partials/_delete.php:9 views/partials/_disable.php:32
204
  msgid "Everywhere:"
205
  msgstr ""
206
 
207
- #: views/partials/_delete.php:9
208
  msgid "Permanently delete all comments on your WordPress website"
209
  msgstr ""
210
 
211
- #: views/partials/_delete.php:10 views/partials/_delete.php:33
212
- #: views/partials/_delete.php:46 views/partials/_disable.php:33
213
  msgid "Warnings:"
214
  msgstr ""
215
 
216
- #: views/partials/_delete.php:10
217
  msgid "This will permanently delete comments everywhere on your website."
218
  msgstr ""
219
 
220
- #: views/partials/_delete.php:14
221
  msgid "On Certain Post Types:"
222
  msgstr ""
223
 
224
- #: views/partials/_delete.php:29 views/partials/_disable.php:52
225
  msgid ""
226
  "Only the built-in post types appear above. If you want to disable comments "
227
  "on other custom post types on the entire network, you can supply a "
@@ -229,32 +234,32 @@ msgid ""
229
  "post type)."
230
  msgstr ""
231
 
232
- #: views/partials/_delete.php:30 views/partials/_disable.php:53
233
  msgid "Custom post types:"
234
  msgstr ""
235
 
236
- #: views/partials/_delete.php:33
237
  msgid ""
238
  "This will remove existing comment entries for the selected post type(s) in "
239
  "the database and cannot be reverted without a database backups."
240
  msgstr ""
241
 
242
- #: views/partials/_delete.php:37
243
  msgid "Delete Certain Comment Types:"
244
  msgstr ""
245
 
246
- #: views/partials/_delete.php:46
247
  msgid ""
248
  "Deleting comments by comment type will remove existing comment entries of "
249
  "the selected comment type(s) in the database and cannot be reverted without "
250
  "a database backup."
251
  msgstr ""
252
 
253
- #: views/partials/_delete.php:48
254
  msgid "Total Comments:"
255
  msgstr ""
256
 
257
- #: views/partials/_delete.php:192
258
  msgid "No comments are available for deletion."
259
  msgstr ""
260
 
@@ -264,43 +269,49 @@ msgid ""
264
  "types of posts."
265
  msgstr ""
266
 
267
- #: views/partials/_disable.php:14 views/partials/_disable.php:68
268
- #: views/partials/_disable.php:78
269
  msgid "On"
270
  msgstr ""
271
 
272
- #: views/partials/_disable.php:15 views/partials/_disable.php:69
273
- #: views/partials/_disable.php:79
274
  msgid "Off"
275
  msgstr ""
276
 
277
  #: views/partials/_disable.php:19
278
  msgid ""
279
- "If you enable site wise settings, You need to configure your Disable "
280
- "Comments settings individually on every website in the network."
281
  msgstr ""
282
 
283
- #: views/partials/_disable.php:25
 
 
 
 
 
 
284
  msgid ""
285
  "This site will be controlled by the network admin until you click the "
286
  "\"Save Changes\" button."
287
  msgstr ""
288
 
289
- #: views/partials/_disable.php:32
290
  msgid "Disable comments globally on your entire website"
291
  msgstr ""
292
 
293
- #: views/partials/_disable.php:33
294
  msgid ""
295
  "This will disable comments from every page and post on your website. Use "
296
  "this setting if you do not want to show comments anywhere."
297
  msgstr ""
298
 
299
- #: views/partials/_disable.php:37
300
  msgid "On Specific Post Types:"
301
  msgstr ""
302
 
303
- #: views/partials/_disable.php:56
304
  msgid ""
305
  "Disabling comments will also disable trackbacks and pingbacks. All "
306
  "comment-related fields will also be hidden from the edit/quick-edit screens "
@@ -308,31 +319,31 @@ msgid ""
308
  "posts. Comments will be visible on all other post types."
309
  msgstr ""
310
 
311
- #: views/partials/_disable.php:60
312
  msgid "Disable Comments With API"
313
  msgstr ""
314
 
315
- #: views/partials/_disable.php:61
316
  msgid ""
317
  "You can disable comments made on your website using WordPress "
318
  "specifications."
319
  msgstr ""
320
 
321
- #: views/partials/_disable.php:71
322
  msgid "Disable Comments via XML-RPC"
323
  msgstr ""
324
 
325
- #: views/partials/_disable.php:80
326
  msgid "Disable Comments via REST API"
327
  msgstr ""
328
 
329
- #: views/partials/_disable.php:84
330
  msgid ""
331
  "Turning on these settings will disable any comments made on your website "
332
  "via XML-RPC or REST API specifications."
333
  msgstr ""
334
 
335
- #: views/partials/_disable.php:88
336
  msgid "Save Changes"
337
  msgstr ""
338
 
@@ -415,7 +426,7 @@ msgstr ""
415
  msgid "https://wpdeveloper.net"
416
  msgstr ""
417
 
418
- #: disable-comments.php:612
419
  msgctxt "settings menu title"
420
  msgid "Disable Comments"
421
  msgstr ""
2
  # This file is distributed under the GPL-3.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Disable Comments 2.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
+ "POT-Creation-Date: 2021-09-22 10:39:38+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:145
28
  msgid "Want to help make Disable Comments even better?"
29
  msgstr ""
30
 
31
+ #: disable-comments.php:146
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:158
41
  #. translators: %s: WordPress version no.
42
  msgid "Disable Comments requires WordPress version %s or greater."
43
  msgstr ""
44
 
45
+ #: disable-comments.php:403 disable-comments.php:546 disable-comments.php:553
46
  msgid "Comments are closed."
47
  msgstr ""
48
 
49
+ #: disable-comments.php:505
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:505
58
  msgid ", "
59
  msgstr ""
60
 
61
+ #: disable-comments.php:537
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:626 views/partials/_disable.php:3
70
  msgid "Settings"
71
  msgstr ""
72
 
73
+ #: disable-comments.php:627
74
  msgid "Tools"
75
  msgstr ""
76
 
77
+ #: disable-comments.php:646 views/partials/_delete.php:78
78
  msgid "Delete Comments"
79
  msgstr ""
80
 
81
+ #: disable-comments.php:705
82
  msgid "Default (no type)"
83
  msgstr ""
84
 
85
+ #: disable-comments.php:809
86
  msgid "Saved"
87
  msgstr ""
88
 
89
+ #: disable-comments.php:876 disable-comments.php:910 disable-comments.php:933
90
+ msgid "All comments have been deleted"
91
  msgstr ""
92
 
93
+ #: disable-comments.php:878 disable-comments.php:882
94
  msgid "Internal error occured. Please try again later."
95
  msgstr ""
96
 
189
  msgid "Disable Comments via REST API. "
190
  msgstr ""
191
 
192
+ #: views/partials/_delete.php:26 views/partials/_delete.php:30
193
+ #: views/partials/_disable.php:19 views/partials/_disable.php:39
194
+ #: views/partials/_disable.php:44 views/partials/_disable.php:75
195
  msgid "Note:"
196
  msgstr ""
197
 
198
+ #: views/partials/_delete.php:26
199
+ msgid "Select your sub-sites where you want to delete comments."
200
+ msgstr ""
201
+
202
+ #: views/partials/_delete.php:30
203
  msgid ""
204
  "These settings will permanently delete comments for your entire website, or "
205
  "for specific posts and comment types."
206
  msgstr ""
207
 
208
+ #: views/partials/_delete.php:33 views/partials/_disable.php:51
209
  msgid "Everywhere:"
210
  msgstr ""
211
 
212
+ #: views/partials/_delete.php:33
213
  msgid "Permanently delete all comments on your WordPress website"
214
  msgstr ""
215
 
216
+ #: views/partials/_delete.php:34 views/partials/_delete.php:57
217
+ #: views/partials/_delete.php:70 views/partials/_disable.php:52
218
  msgid "Warnings:"
219
  msgstr ""
220
 
221
+ #: views/partials/_delete.php:34
222
  msgid "This will permanently delete comments everywhere on your website."
223
  msgstr ""
224
 
225
+ #: views/partials/_delete.php:38
226
  msgid "On Certain Post Types:"
227
  msgstr ""
228
 
229
+ #: views/partials/_delete.php:53 views/partials/_disable.php:71
230
  msgid ""
231
  "Only the built-in post types appear above. If you want to disable comments "
232
  "on other custom post types on the entire network, you can supply a "
234
  "post type)."
235
  msgstr ""
236
 
237
+ #: views/partials/_delete.php:54 views/partials/_disable.php:72
238
  msgid "Custom post types:"
239
  msgstr ""
240
 
241
+ #: views/partials/_delete.php:57
242
  msgid ""
243
  "This will remove existing comment entries for the selected post type(s) in "
244
  "the database and cannot be reverted without a database backups."
245
  msgstr ""
246
 
247
+ #: views/partials/_delete.php:61
248
  msgid "Delete Certain Comment Types:"
249
  msgstr ""
250
 
251
+ #: views/partials/_delete.php:70
252
  msgid ""
253
  "Deleting comments by comment type will remove existing comment entries of "
254
  "the selected comment type(s) in the database and cannot be reverted without "
255
  "a database backup."
256
  msgstr ""
257
 
258
+ #: views/partials/_delete.php:72
259
  msgid "Total Comments:"
260
  msgstr ""
261
 
262
+ #: views/partials/_delete.php:216
263
  msgid "No comments are available for deletion."
264
  msgstr ""
265
 
269
  "types of posts."
270
  msgstr ""
271
 
272
+ #: views/partials/_disable.php:14 views/partials/_disable.php:87
273
+ #: views/partials/_disable.php:97
274
  msgid "On"
275
  msgstr ""
276
 
277
+ #: views/partials/_disable.php:15 views/partials/_disable.php:88
278
+ #: views/partials/_disable.php:98
279
  msgid "Off"
280
  msgstr ""
281
 
282
  #: views/partials/_disable.php:19
283
  msgid ""
284
+ "If you enable Site Wise settings, you need to configure your Disable "
285
+ "Comments settings individually on every website in the network."
286
  msgstr ""
287
 
288
+ #: views/partials/_disable.php:39
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:44
295
  msgid ""
296
  "This site will be controlled by the network admin until you click the "
297
  "\"Save Changes\" button."
298
  msgstr ""
299
 
300
+ #: views/partials/_disable.php:51
301
  msgid "Disable comments globally on your entire website"
302
  msgstr ""
303
 
304
+ #: views/partials/_disable.php:52
305
  msgid ""
306
  "This will disable comments from every page and post on your website. Use "
307
  "this setting if you do not want to show comments anywhere."
308
  msgstr ""
309
 
310
+ #: views/partials/_disable.php:56
311
  msgid "On Specific Post Types:"
312
  msgstr ""
313
 
314
+ #: views/partials/_disable.php:75
315
  msgid ""
316
  "Disabling comments will also disable trackbacks and pingbacks. All "
317
  "comment-related fields will also be hidden from the edit/quick-edit screens "
319
  "posts. Comments will be visible on all other post types."
320
  msgstr ""
321
 
322
+ #: views/partials/_disable.php:79
323
  msgid "Disable Comments With API"
324
  msgstr ""
325
 
326
+ #: views/partials/_disable.php:80
327
  msgid ""
328
  "You can disable comments made on your website using WordPress "
329
  "specifications."
330
  msgstr ""
331
 
332
+ #: views/partials/_disable.php:90
333
  msgid "Disable Comments via XML-RPC"
334
  msgstr ""
335
 
336
+ #: views/partials/_disable.php:99
337
  msgid "Disable Comments via REST API"
338
  msgstr ""
339
 
340
+ #: views/partials/_disable.php:103
341
  msgid ""
342
  "Turning on these settings will disable any comments made on your website "
343
  "via XML-RPC or REST API specifications."
344
  msgstr ""
345
 
346
+ #: views/partials/_disable.php:108
347
  msgid "Save Changes"
348
  msgstr ""
349
 
426
  msgid "https://wpdeveloper.net"
427
  msgstr ""
428
 
429
+ #: disable-comments.php:636
430
  msgctxt "settings menu title"
431
  msgid "Disable Comments"
432
  msgstr ""
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: Asif2BD, priyomukul, wpdevteam, re_enter_rupok, tusharimran, alimu
3
  Donate link: https://wpdeveloper.net/
4
  Tags: comments, delete comments, disable comments, spam comment, disable, stop spam, remove comments, anti spam, disable xml-rpc, hide comment, XML-RPC, REST-API, WP-CLI
5
  Requires at least: 5.0
6
- Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 2.1.2
9
  License: GPL-3.0-or-later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -15,11 +15,11 @@ Allows administrators to globally disable comments on their site. Comments can b
15
 
16
  = Disable Comments - Remove Comments & Protect From Spam =
17
 
18
- Instantly allow or disallow comments from any post type in WordPress (Pages, Posts or Media) to stop the spammers and gain complete control over your full website. WP-CLI Suppprt & Control comments via XML-RPC and REST-API too!
19
 
20
  [More About Plugin](https://wpdeveloper.net/plugins/disable-comments/) ◼️ [Documentation](https://wpdeveloper.net/docs-category/disable-comments/) ◼️ [Support Forum](https://wordpress.org/support/plugin/disable-comments/)
21
 
22
- https://www.youtube.com/watch?v=J9AteKzQpPs
23
 
24
  ## Take Global Control Over Your WordPress Site
25
  Override all comments-related settings throughout your website & manage your comments just the way you want.
@@ -30,19 +30,22 @@ Choose which posts, pages or media should allow comments from site visitors & co
30
  ## Disallow Comments On Multi-Site Network
31
  Have multiple websites? Get rid of irrelevant comments on the entire network using Disable Comments Plugin
32
 
 
33
 
34
  ## KEY FEATURES OF DISABLE COMMENTS
35
 
36
- * All “Comments” links are hidden from the Admin Menu and Admin Bar;
37
- * All comment-related sections (“Recent Comments”, “Discussion” etc.) are hidden from the WordPress Dashboard;
38
- * All comment-related widgets are disabled (so your theme cannot use them);
39
- * The “Discussion” settings page is hidden;
40
- * All comment RSS/Atom feeds are disabled (and requests for these will be redirected to the parent post);
41
- * The X-Pingback HTTP header is removed from all pages;
42
  * Outgoing pingbacks are disabled.
43
  * Stop spam comments entirely from the site with one click.
44
  * **[New]** Delete comments by type.
45
- * **[New]** Disable comments via xml-rpc.
 
 
46
 
47
  Please delete any existing comments on your site **before applying this setting**, otherwise (depending on your theme) those comments may still be displayed to visitors. You can use the **Delete Comments tool** to delete any existing comments on your site.
48
 
@@ -52,7 +55,9 @@ Please delete any existing comments on your site **before applying this setting*
52
  Easily configure your comment-related settings with an amazing and attractive app-like user interface.
53
 
54
  **WP-CLI COMMANDS TO DISABLE COMMENTS**
55
- Use WP-CLI control for comment-related settings to disable comments on posts, pages, attachments or everywhere on your website.
 
 
56
 
57
  **GET STARTED WITH QUICK SETUP WIZARD**
58
  Use the quick setup wizard after activating the plugin to instantly configure comment-related settings for your WordPress website.
@@ -60,9 +65,13 @@ Use the quick setup wizard after activating the plugin to instantly configure co
60
  **DISABLE COMMENTS ON DOCS**
61
  Instantly disable comments on your documentation pages or WordPress knowledge base with a single click.
62
 
 
 
63
  **DELETE CERTAIN COMMENT TYPE(S)**
64
  Permanently delete certain comment types from your WordPress website including WooCommerce product reviews as well as generic comments.
65
 
 
 
66
  **DISABLE COMMENTS VIA XML-RPC And REST API**
67
  Block any comments made on your WordPress website via XML-RPC specification and REST API.
68
 
@@ -76,7 +85,7 @@ A [must-use version](https://github.com/WPDevelopers/disable-comments-mu) of the
76
 
77
  ### Advanced Configuration
78
 
79
- Some of the plugin’s behaviour can be modified by site administrators and plugin/theme developers through code:
80
 
81
  * Define `DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE` and set it to `false` to prevent the plugin from replacing the theme's comment template with an empty one.
82
 
@@ -90,9 +99,15 @@ These definitions can be made either in your main `wp-config.php` or in your the
90
 
91
  ### 💙 LOVED DISABLE COMMENTS?
92
 
93
- - Join our [Facebook Group](https://www.facebook.com/groups/wpdeveloper.net/)
94
 
95
- - If you love Disable Comments, [rate us on WordPress](https://wordpress.org/support/plugin/disable-comments/reviews/?filter=5)
 
 
 
 
 
 
96
 
97
 
98
  ### 🔥 GET FREEBIES FOR YOUR WORDPRESS SITE
@@ -103,17 +118,19 @@ Consider checking out our other WordPress solutions & boost your WordPress websi
103
 
104
  🔔 [NotificationX](https://notificationx.com/) – Best Social Proof & FOMO Marketing Solution to increase conversion rates.
105
 
106
- 📄 [EmbedPress](https://wordpress.org/plugins/embedpress/): EmbedPress lets you embed videos, images, posts, audio, maps and upload PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors.
 
 
107
 
108
  ☁ [Templately](https://wordpress.org/plugins/templately/): 1000+ Free templates library for Elementor & Gutenberg along with the cloud collaboration for WordPress.
109
 
110
  📚 [BetterDocs](https://wordpress.org/plugins/betterdocs/): Best Documentation & Knowledge Base Plugin for WordPress reduce manual support tickets & improve user experience.
111
 
112
- ⏰ [WP Scheduled Posts](https://wordpress.org/plugins/wp-scheduled-posts/): Advanced editorial calendar & complete solution for WordPress Post Scheduling, social sharing, missed scheduled alerts and more.
113
 
114
- ⭐ [ReviewX](https://wordpress.org/plugins/reviewx/): WooCommerce Product review plugin that allows users to submit product reviews with multiple criteria, photos, video and more.
115
 
116
- ⚡ [Flexia](http://wordpress.org/plugins/flexia): Most lightweight, customizable & multi purpose theme for WordPress.
117
 
118
 
119
  Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
@@ -173,6 +190,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
173
  and this project adheres to [Semantic Versioning](http://semver.org/).
174
  This will be maiintained from August 19, 2020 - @asif2bd
175
 
 
 
 
 
 
176
  = [2.1.2] - 2021-06-20 =
177
  * Improvement: Fix for Attempt to read property "post_type" on null
178
 
@@ -345,4 +367,4 @@ This will be maiintained from August 19, 2020 - @asif2bd
345
 
346
  == Upgrade Notice ==
347
 
348
- [Minor Update] Improvement: Fix for Attempt to read property "post_type" on null
3
  Donate link: https://wpdeveloper.net/
4
  Tags: comments, delete comments, disable comments, spam comment, disable, stop spam, remove comments, anti spam, disable xml-rpc, hide comment, XML-RPC, REST-API, WP-CLI
5
  Requires at least: 5.0
6
+ Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 2.2.0
9
  License: GPL-3.0-or-later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
15
 
16
  = Disable Comments - Remove Comments & Protect From Spam =
17
 
18
+ Instantly allow or disallow comments from any post type in WordPress (Pages, Posts, or Media) to stop the spammers and gain complete control over your full website. WP-CLI Support & Control comments via XML-RPC and REST-API too!
19
 
20
  [More About Plugin](https://wpdeveloper.net/plugins/disable-comments/) ◼️ [Documentation](https://wpdeveloper.net/docs-category/disable-comments/) ◼️ [Support Forum](https://wordpress.org/support/plugin/disable-comments/)
21
 
22
+ https://www.youtube.com/watch?v=EpuYs9Nf_nY
23
 
24
  ## Take Global Control Over Your WordPress Site
25
  Override all comments-related settings throughout your website & manage your comments just the way you want.
30
  ## Disallow Comments On Multi-Site Network
31
  Have multiple websites? Get rid of irrelevant comments on the entire network using Disable Comments Plugin
32
 
33
+ https://www.youtube.com/watch?v=J9AteKzQpPs
34
 
35
  ## KEY FEATURES OF DISABLE COMMENTS
36
 
37
+ * All “Comments” links are hidden from the Admin Menu and Admin Bar.
38
+ * All comment-related sections (“Recent Comments”, “Discussion” etc.) are hidden from the WordPress Dashboard.
39
+ * All comment-related widgets are disabled (so your theme cannot use them).
40
+ * The “Discussion” settings page is hidden.
41
+ * All comment RSS/Atom feeds are disabled (and requests for these will be redirected to the parent post).
42
+ * The X-Pingback HTTP header is removed from all pages.
43
  * Outgoing pingbacks are disabled.
44
  * Stop spam comments entirely from the site with one click.
45
  * **[New]** Delete comments by type.
46
+ * **[New]** Disable comments via [XML-RPC](https://wpdeveloper.net/docs/how-to-disable-comments-made-via-xml-rpc/) & [REST-API](https://wpdeveloper.net/docs/how-to-disable-comments-made-via-rest-api/)
47
+
48
+ https://www.youtube.com/watch?v=FBq3-W-p-DM
49
 
50
  Please delete any existing comments on your site **before applying this setting**, otherwise (depending on your theme) those comments may still be displayed to visitors. You can use the **Delete Comments tool** to delete any existing comments on your site.
51
 
55
  Easily configure your comment-related settings with an amazing and attractive app-like user interface.
56
 
57
  **WP-CLI COMMANDS TO DISABLE COMMENTS**
58
+ Use [WP-CLI](https://wpdeveloper.net/docs/how-to-use-disable-comments-plugin-with-wp-cli-command-line/) control for comment-related settings to disable comments on posts, pages, attachments or everywhere on your website.
59
+
60
+ https://www.youtube.com/watch?v=mzi5uhKB9Zk
61
 
62
  **GET STARTED WITH QUICK SETUP WIZARD**
63
  Use the quick setup wizard after activating the plugin to instantly configure comment-related settings for your WordPress website.
65
  **DISABLE COMMENTS ON DOCS**
66
  Instantly disable comments on your documentation pages or WordPress knowledge base with a single click.
67
 
68
+ https://www.youtube.com/watch?v=t7BQ-7A4y4s
69
+
70
  **DELETE CERTAIN COMMENT TYPE(S)**
71
  Permanently delete certain comment types from your WordPress website including WooCommerce product reviews as well as generic comments.
72
 
73
+ https://www.youtube.com/watch?v=Izm_ihC-z10
74
+
75
  **DISABLE COMMENTS VIA XML-RPC And REST API**
76
  Block any comments made on your WordPress website via XML-RPC specification and REST API.
77
 
85
 
86
  ### Advanced Configuration
87
 
88
+ Some of the plugin’s behavior can be modified by site administrators and plugin/theme developers through code:
89
 
90
  * Define `DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE` and set it to `false` to prevent the plugin from replacing the theme's comment template with an empty one.
91
 
99
 
100
  ### 💙 LOVED DISABLE COMMENTS?
101
 
102
+ - For documentation and tutorials go to our [Documentation](https://wpdeveloper.net/docs-category/disable-comments/)
103
 
104
+ - For video tutorials go to our [YouTube Playlist](https://www.youtube.com/watch?v=J9AteKzQpPs&list=PLWHp1xKHCfxD2_xOIR5dMAGf3wd4hv-8K)
105
+
106
+ - Join our [Facebook Group](https://www.facebook.com/groups/wpdeveloper.net/)
107
+
108
+ - If you love Disable Comments, [rate us on WordPress](https://wordpress.org/support/plugin/disable-comments/reviews/?filter=5)
109
+
110
+ - For more information about features, FAQs, and documentation, check out our website at [Disable Comments](https://wpdeveloper.net/plugins/disable-comments/)
111
 
112
 
113
  ### 🔥 GET FREEBIES FOR YOUR WORDPRESS SITE
118
 
119
  🔔 [NotificationX](https://notificationx.com/) – Best Social Proof & FOMO Marketing Solution to increase conversion rates.
120
 
121
+ 🔗 [BetterLinks](https://wordpress.org/plugins/betterlinks/): Latest best WordPress link management plugin for link shortening, tracking & analyzing.
122
+
123
+ 📄 [EmbedPress](https://wordpress.org/plugins/embedpress/): EmbedPress lets you embed anything including videos, images, posts, audio, maps and upload PDF, DOC, PPT etc.
124
 
125
  ☁ [Templately](https://wordpress.org/plugins/templately/): 1000+ Free templates library for Elementor & Gutenberg along with the cloud collaboration for WordPress.
126
 
127
  📚 [BetterDocs](https://wordpress.org/plugins/betterdocs/): Best Documentation & Knowledge Base Plugin for WordPress reduce manual support tickets & improve user experience.
128
 
129
+ ⏰ [SchedulePress](https://wordpress.org/plugins/wp-scheduled-posts/): Advanced editorial calendar with WordPress Post Scheduling, Social Sharing, Missed scheduled alerts, and more.
130
 
131
+ ⭐ [ReviewX](https://wordpress.org/plugins/reviewx/): WooCommerce Product review plugin that allows users to submit product reviews with multiple criteria, photos, video, and more.
132
 
133
+ ⚡ [Flexia](https://wordpress.org/themes/flexia/): Most lightweight, customizable & multi purpose theme for WordPress.
134
 
135
 
136
  Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do better in WordPress with [Help Tutorial, Tips & Tricks](https://wpdeveloper.net/blog).
190
  and this project adheres to [Semantic Versioning](http://semver.org/).
191
  This will be maiintained from August 19, 2020 - @asif2bd
192
 
193
+ = [2.2.0] - 2021-09-22 =
194
+ * New Feature: Configure Disable Comments on Subsites from Main Network in Multisite Network.
195
+ * Improvement: UX Improvement.
196
+ * Few minor bug fix and improvement.
197
+
198
  = [2.1.2] - 2021-06-20 =
199
  * Improvement: Fix for Attempt to read property "post_type" on null
200
 
367
 
368
  == Upgrade Notice ==
369
 
370
+ [Major Update] Bug fixes & MU supported
views/partials/_delete.php CHANGED
@@ -2,7 +2,31 @@
2
  <?php
3
  if ($this->get_all_comments_number() > 0) :
4
  ?>
 
 
5
  <div class="disable__comment__option mb50">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  <p class="subtitle"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('These settings will permanently delete comments for your entire website, or for specific posts and comment types.', 'disable-comments'); ?></p>
7
  <div class="disable_option dc-text__block mb30 mt30">
8
  <input type="radio" id="delete_everywhere" name="delete_mode" value="<?php echo esc_attr('delete_everywhere'); ?>" <?php checked($this->options['remove_everywhere']); ?> />
@@ -12,7 +36,7 @@
12
  <div class="disable_option dc-text__block mb30">
13
  <input type="radio" id="selected_delete_types" name="delete_mode" value="<?php echo esc_attr('selected_delete_types'); ?>" <?php checked(!$this->options['remove_everywhere']); ?> />
14
  <label for="selected_delete_types"><?php _e('On Certain Post Types:', 'disable-comments'); ?></label>
15
- <div class="delete__checklist">
16
  <?php
17
  $types = $this->get_all_post_types();
18
  foreach ($types as $key => $value) {
@@ -25,9 +49,9 @@
25
  <?php if ($this->networkactive && is_network_admin()) :
26
  $extradeletetypes = implode(', ', (array) $this->options['extra_post_types']);
27
  ?>
28
- <p class="indent" id="extradeletetypes">
29
  <?php _e('Only the built-in post types appear above. If you want to disable comments on other custom post types on the entire network, you can supply a comma-separated list of post types below (use the slug that identifies the post type).', 'disable-comments'); ?>
30
- <br /><label><?php _e('Custom post types:', 'disable-comments'); ?> <input type="text" name="delete_extra_post_types" size="30" value="<?php echo esc_attr($extradeletetypes); ?>" /></label></p>
31
  <?php endif; ?>
32
  </div>
33
  <p class="disable__option__description"><span class="danger"><?php _e('Warnings:', 'disable-comments') ?></span> <?php _e('This will remove existing comment entries for the selected post type(s) in the database and cannot be reverted without a database backups.', 'disable-comments'); ?></p>
@@ -51,7 +75,7 @@
51
  <input type="hidden" name="is_network_admin" value="1">
52
  <?php endif;?>
53
  <!-- save -->
54
- <button class="button button__delete"><?php _e('Delete Comments', 'disable-comments'); ?></button>
55
  <?php
56
  else :
57
  ?>
2
  <?php
3
  if ($this->get_all_comments_number() > 0) :
4
  ?>
5
+
6
+
7
  <div class="disable__comment__option mb50">
8
+ <?php if(is_network_admin()):?>
9
+ <div class="disable_option dc-text__block mb30 mt30">
10
+ <h3>Delete comments in the following sites:</h3>
11
+ <div class="disabled__sites delete__checklist">
12
+ <?php
13
+ $disabled_site_options = isset($this->options['disabled_sites']) ? $this->options['disabled_sites'] : [];
14
+ $sub_sites = get_sites();
15
+ foreach ( $sub_sites as $sub_site ) {
16
+ $sub_site_id = $sub_site->blog_id;
17
+ $blog = get_blog_details($sub_site_id);
18
+ echo
19
+ "<div class='delete__checklist__item'>
20
+ <input type='checkbox' id='delete__checklist__item-$sub_site_id' name='disabled_sites[]' value='$sub_site_id' checked='checked'>
21
+ <label for='delete__checklist__item-$sub_site_id'>{$blog->blogname}</label>
22
+ </div>";
23
+ }
24
+ ?>
25
+ </div>
26
+ <p class="disable__option__description"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('Select your sub-sites where you want to delete comments.', 'disable-comments'); ?></p>
27
+ </div>
28
+
29
+ <?php endif;?>
30
  <p class="subtitle"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('These settings will permanently delete comments for your entire website, or for specific posts and comment types.', 'disable-comments'); ?></p>
31
  <div class="disable_option dc-text__block mb30 mt30">
32
  <input type="radio" id="delete_everywhere" name="delete_mode" value="<?php echo esc_attr('delete_everywhere'); ?>" <?php checked($this->options['remove_everywhere']); ?> />
36
  <div class="disable_option dc-text__block mb30">
37
  <input type="radio" id="selected_delete_types" name="delete_mode" value="<?php echo esc_attr('selected_delete_types'); ?>" <?php checked(!$this->options['remove_everywhere']); ?> />
38
  <label for="selected_delete_types"><?php _e('On Certain Post Types:', 'disable-comments'); ?></label>
39
+ <div id="delete__post__types" class="delete__checklist">
40
  <?php
41
  $types = $this->get_all_post_types();
42
  foreach ($types as $key => $value) {
49
  <?php if ($this->networkactive && is_network_admin()) :
50
  $extradeletetypes = implode(', ', (array) $this->options['extra_post_types']);
51
  ?>
52
+ <p class="indent subtitle" id="extradeletetypes">
53
  <?php _e('Only the built-in post types appear above. If you want to disable comments on other custom post types on the entire network, you can supply a comma-separated list of post types below (use the slug that identifies the post type).', 'disable-comments'); ?>
54
+ <br /> <br /><label><?php _e('Custom post types:', 'disable-comments'); ?> <input type="text" class="form__control" name="delete_extra_post_types" size="30" value="<?php echo esc_attr($extradeletetypes); ?>" /></label></p>
55
  <?php endif; ?>
56
  </div>
57
  <p class="disable__option__description"><span class="danger"><?php _e('Warnings:', 'disable-comments') ?></span> <?php _e('This will remove existing comment entries for the selected post type(s) in the database and cannot be reverted without a database backups.', 'disable-comments'); ?></p>
75
  <input type="hidden" name="is_network_admin" value="1">
76
  <?php endif;?>
77
  <!-- save -->
78
+ <button class="button button__delete button__fade"><?php _e('Delete Comments', 'disable-comments'); ?></button>
79
  <?php
80
  else :
81
  ?>
views/partials/_disable.php CHANGED
@@ -14,11 +14,30 @@
14
  <span class="switch__text on"><?php _e('On', 'disable-comments'); ?></span>
15
  <span class="switch__text off"><?php _e('Off', 'disable-comments'); ?></span>
16
  </span>
17
- Enable site wise settings.
18
  </label>
19
- <p class="disable__option__description"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('If you enable site wise settings, You need to configure your Disable Comments settings individually on every website in the network.', 'disable-comments'); ?></p>
20
  </div>
21
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  <?php elseif($this->options['sitewide_settings'] && !empty($this->options['is_network_options'])):?>
23
  <div class="disable_option dc-text__block mb30 mt30">
24
  <div>
@@ -35,7 +54,7 @@
35
  <div class="disable_option dc-text__block">
36
  <input type="radio" id="selected_types" name="mode" value="<?php echo esc_attr('selected_types'); ?>" <?php checked(!$this->options['remove_everywhere']); ?> />
37
  <label for="selected_types"><?php _e('On Specific Post Types:', 'disable-comments'); ?></label>
38
- <div class="remove__checklist">
39
  <?php
40
  $types = $this->get_all_post_types();
41
  foreach ($types as $key => $value) {
@@ -50,7 +69,7 @@
50
  $extradisabletypes = implode(', ', (array) $this->options['extra_post_types']);
51
  ?>
52
  <p class="indent subtitle" id="extratypes"><?php _e('Only the built-in post types appear above. If you want to disable comments on other custom post types on the entire network, you can supply a comma-separated list of post types below (use the slug that identifies the post type).', 'disable-comments'); ?>
53
- <br /><label><strong><?php _e('Custom post types:', 'disable-comments'); ?></strong> <input type="text" name="extra_post_types" size="30" value="<?php echo esc_attr($extradisabletypes); ?>" /></label></p>
54
  <?php endif; ?>
55
  </div>
56
  <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>
@@ -85,7 +104,9 @@
85
  </div>
86
  </div>
87
  <!-- save -->
88
- <button class="button button__success"><?php _e('Save Changes', 'disable-comments'); ?></button>
 
 
89
  <?php if(is_network_admin()):?>
90
  <input type="hidden" name="is_network_admin" value="1">
91
  <?php endif;?>
14
  <span class="switch__text on"><?php _e('On', 'disable-comments'); ?></span>
15
  <span class="switch__text off"><?php _e('Off', 'disable-comments'); ?></span>
16
  </span>
17
+ Enable Site Wise settings.
18
  </label>
19
+ <p class="disable__option__description"><span class="danger"><?php _e('Note:', 'disable-comments'); ?></span> <?php _e('If you enable Site Wise settings, you need to configure your Disable Comments settings individually on every website in the network.', 'disable-comments'); ?></p>
20
  </div>
21
  </div>
22
+ <div class="disable_option dc-text__block mb30 mt30">
23
+ <h3>Disable comments in the following sites:</h3>
24
+ <div class="disabled__sites remove__checklist">
25
+ <?php
26
+ $disabled_site_options = isset($this->options['disabled_sites']) ? $this->options['disabled_sites'] : [];
27
+ $sub_sites = get_sites();
28
+ foreach ( $sub_sites as $sub_site ) {
29
+ $sub_site_id = $sub_site->blog_id;
30
+ $blog = get_blog_details($sub_site_id);
31
+ echo
32
+ "<div class='remove__checklist__item'>
33
+ <input type='checkbox' id='remove__checklist__item-$sub_site_id' name='disabled_sites[]' value='$sub_site_id'" . checked(in_array($sub_site_id, $disabled_site_options), true, false) . ">
34
+ <label for='remove__checklist__item-$sub_site_id'>{$blog->blogname}</label>
35
+ </div>";
36
+ }
37
+ ?>
38
+ </div>
39
+ <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>
40
+ </div>
41
  <?php elseif($this->options['sitewide_settings'] && !empty($this->options['is_network_options'])):?>
42
  <div class="disable_option dc-text__block mb30 mt30">
43
  <div>
54
  <div class="disable_option dc-text__block">
55
  <input type="radio" id="selected_types" name="mode" value="<?php echo esc_attr('selected_types'); ?>" <?php checked(!$this->options['remove_everywhere']); ?> />
56
  <label for="selected_types"><?php _e('On Specific Post Types:', 'disable-comments'); ?></label>
57
+ <div id="disable__post__types" class="remove__checklist">
58
  <?php
59
  $types = $this->get_all_post_types();
60
  foreach ($types as $key => $value) {
69
  $extradisabletypes = implode(', ', (array) $this->options['extra_post_types']);
70
  ?>
71
  <p class="indent subtitle" id="extratypes"><?php _e('Only the built-in post types appear above. If you want to disable comments on other custom post types on the entire network, you can supply a comma-separated list of post types below (use the slug that identifies the post type).', 'disable-comments'); ?>
72
+ <br /><br /><label class="hello"><strong><?php _e('Custom post types:', 'disable-comments'); ?></strong> <input type="text" class="form__control" name="extra_post_types" size="30" value="<?php echo esc_attr($extradisabletypes); ?>" /></label></p>
73
  <?php endif; ?>
74
  </div>
75
  <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>
104
  </div>
105
  </div>
106
  <!-- save -->
107
+ <button class="button button__success button__fade">
108
+ <span><?php _e('Save Changes', 'disable-comments'); ?></span>
109
+ </button>
110
  <?php if(is_network_admin()):?>
111
  <input type="hidden" name="is_network_admin" value="1">
112
  <?php endif;?>