Disable Comments - Version 2.0.2

Version Description

Download this release

Release Info

Developer Asif2BD
Plugin Icon 128x128 Disable Comments
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

assets/js/disable-comments-settings-scripts.js CHANGED
@@ -95,133 +95,6 @@ jQuery(document).ready(function () {
95
  });
96
  delete_comments_uihelper();
97
 
98
- /**
99
- * Quick Setup Settings Scripts
100
- */
101
- if (jQuery("#disablecommentssetupwrap").length > 0) {
102
- // disable nav click
103
- jQuery("ul.dc-quick__setup__nav li a").on("click", function (e) {
104
- e.stopPropagation();
105
- e.preventDefault();
106
- });
107
- var btnPrevious = "#dcQuickPreviousBtn";
108
- var btnNext = "#dcQuickNextBtn";
109
- var btnSkip = "#dcQuickSkipBtn";
110
- var finishStepFlug = false;
111
- var tabPosition = localStorage.getItem("dcqTabPostion");
112
- if (!tabPosition || tabPosition == null || isNaN(tabPosition)) {
113
- localStorage.setItem("dcqTabPostion", 1);
114
- tabPosition = 1;
115
- }
116
- changeTab(tabPosition); // window load
117
-
118
- // click button
119
- jQuery(btnPrevious).on("click", function (e) {
120
- e.preventDefault();
121
- finishStepFlug = false;
122
- updateTabPosition(localStorage.getItem("dcqTabPostion"), true);
123
- });
124
- jQuery(btnNext).on("click", function (e) {
125
- e.preventDefault();
126
- updateTabPosition(localStorage.getItem("dcqTabPostion"));
127
- save_settings(parseInt(localStorage.getItem("dcqTabPostion") - 1));
128
- });
129
- jQuery(btnSkip).on("click", function (e) {
130
- e.preventDefault();
131
- finishStepFlug = false;
132
- updateTabPosition(localStorage.getItem("dcqTabPostion"));
133
- });
134
-
135
- function updateTabPosition(tabPosition, isDecrement = false) {
136
- if (isDecrement === true) {
137
- if (1 < tabPosition) {
138
- --tabPosition;
139
- }
140
- } else {
141
- if (3 > tabPosition) {
142
- ++tabPosition;
143
- }
144
- }
145
- localStorage.setItem("dcqTabPostion", tabPosition);
146
- changeTab(tabPosition);
147
- }
148
- function changeTab(nthChildNumber) {
149
- for (var i = 1; i <= 3; i++) {
150
- if (i <= nthChildNumber) {
151
- jQuery(
152
- "ul.dc-quick__setup__nav li:nth-child(" + i + ")"
153
- ).addClass("active");
154
- } else {
155
- jQuery(
156
- "ul.dc-quick__setup__nav li:nth-child(" + i + ")"
157
- ).removeClass("active");
158
- }
159
- // active tab
160
- if (nthChildNumber == i) {
161
- jQuery("#dcqTabBody_" + nthChildNumber).addClass("active");
162
- } else {
163
- jQuery("#dcqTabBody_" + i).removeClass("active");
164
- }
165
- // active tab control
166
- if (nthChildNumber == 1) {
167
- jQuery(btnPrevious).css("visibility", "hidden");
168
- jQuery(btnSkip).css("visibility", "hidden");
169
- } else {
170
- jQuery(btnPrevious).css("visibility", "visible");
171
- jQuery(btnSkip).css("visibility", "visible");
172
- }
173
- if (nthChildNumber == 3) {
174
- jQuery(btnSkip).css("visibility", "hidden");
175
- jQuery(btnNext).text("Finish");
176
- } else {
177
- jQuery(btnNext).text("Next");
178
- }
179
- }
180
- }
181
- function save_settings(tabPosition) {
182
- // get all form data
183
-
184
- if (finishStepFlug) {
185
- window.location = disableCommentsObj.settings_URI;
186
- } else {
187
- if (
188
- tabPosition == 1 &&
189
- jQuery("[name=dc_is_optin]").is(":checked")
190
- ) {
191
- var data = {
192
- action: "optin_wizard_action_disable_comments",
193
- };
194
- jQuery
195
- .post(ajaxurl, data, function (response) {
196
- console.log("Optin Success");
197
- })
198
- .fail(function () {
199
- console.error("Optin Failed");
200
- });
201
- } else if (tabPosition == 2) {
202
- finishStepFlug = true;
203
- var data = {
204
- action: disableCommentsObj.save_action,
205
- nonce: disableCommentsObj._nonce,
206
- data: jQuery(
207
- "#disableCommentSaveSettings"
208
- ).serializeArray(),
209
- };
210
- jQuery
211
- .post(ajaxurl, data, function (response) {})
212
- .fail(function () {
213
- console.error("Settings failed to saved.");
214
- });
215
- }
216
- }
217
- }
218
-
219
- // what we collect toggle
220
- jQuery("#whatWeCollect").on("click", function (e) {
221
- e.preventDefault();
222
- jQuery("#whatWeCollectMessage").slideToggle("fast");
223
- });
224
- }
225
  /**
226
  * Settings Ajax Request
227
  */
95
  });
96
  delete_comments_uihelper();
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Settings Ajax Request
100
  */
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.0.1
8
  * Author: WPDeveloper
9
  * Author URI: https://wpdeveloper.net
10
  * License: GPL-3.0+
@@ -37,16 +37,13 @@ class Disable_Comments
37
 
38
  function __construct()
39
  {
40
- define('DC_VERSION', '2.0.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/');
44
  define('DC_PLUGIN_ROOT_URI', plugins_url("/", __FILE__));
45
  define('DC_ASSETS_URI', DC_PLUGIN_ROOT_URI . 'assets/');
46
 
47
- register_activation_hook(__FILE__, array($this, 'activate'));
48
- add_action('wp_loaded', array($this, 'plugin_redirect'));
49
-
50
  // save settings
51
  add_action('wp_ajax_disable_comments_save_settings', array($this, 'disable_comments_settings'));
52
  add_action('wp_ajax_disable_comments_delete_comments', array($this, 'delete_comments_settings'));
@@ -110,7 +107,7 @@ class Disable_Comments
110
  }
111
  $current_screen = get_current_screen()->id;
112
  $hascaps = $this->networkactive ? is_network_admin() && current_user_can('manage_network_plugins') : current_user_can('manage_options');
113
- if( ! in_array( $current_screen, ['admin_page_disable_comments_settings_setup', 'settings_page_disable_comments_settings', 'settings_page_disable_comments_settings_setup', 'settings_page_disable_comments_settings-network', 'settings_page_disable_comments_settings_setup-network', 'admin_page_disable_comments_settings_setup-network' ]) && $hascaps ) {
114
  $this->tracker->notice();
115
  }
116
  }
@@ -127,8 +124,8 @@ class Disable_Comments
127
  'item_id' => 'b0112c9030af6ba53de4'
128
  ]);
129
  $tracker->set_notice_options(array(
130
- 'notice' => __('Want to help make Disable Comments even better?', 'disable-comments-on-attachments'),
131
- 'extra_notice' => __('We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins & themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, I promise.', 'disable-comments-on-attachments'),
132
  ));
133
  $tracker->init();
134
  }
@@ -240,15 +237,6 @@ class Disable_Comments
240
  add_action('admin_enqueue_scripts', array($this, 'settings_page_assets'));
241
  }
242
 
243
- /**
244
- * Do stuff upon plugin activation
245
- *
246
- * @return void
247
- */
248
- public function activate()
249
- {
250
- $this->update_option('dc_do_activation_redirect', true);
251
- }
252
 
253
  public function register_text_domain()
254
  {
@@ -327,19 +315,6 @@ class Disable_Comments
327
  return $this->networkactive ? delete_site_option( $option ) : delete_option( $option );
328
  }
329
 
330
- public function plugin_redirect()
331
- {
332
- if ( $this->get_option( 'dc_do_activation_redirect') ) {
333
- $this->delete_option('dc_do_activation_redirect');
334
- if( $this->get_option('dc_setup_screen_seen') ) {
335
- wp_safe_redirect($this->settings_page_url());
336
- } else {
337
- wp_safe_redirect($this->quick_setup_url());
338
- }
339
- exit;
340
- }
341
- }
342
-
343
  /**
344
  * Replace the theme's comment template with a blank one.
345
  * To prevent this, define DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE
@@ -448,9 +423,7 @@ class Disable_Comments
448
  {
449
  if (
450
  $hook_suffix === 'settings_page_' . DC_PLUGIN_SLUG ||
451
- $hook_suffix === 'options-general_' . DC_PLUGIN_SLUG ||
452
- $hook_suffix === 'admin_page_' . DC_PLUGIN_SLUG . '_setup' ||
453
- $hook_suffix === 'settings_page_' . DC_PLUGIN_SLUG . '_setup'
454
  ) {
455
  // css
456
  wp_enqueue_style('sweetalert2', DC_ASSETS_URI . 'css/sweetalert2.min.css', [], false);
@@ -511,16 +484,6 @@ class Disable_Comments
511
  return add_query_arg('page', DC_PLUGIN_SLUG, $base);
512
  }
513
 
514
-
515
- /**
516
- * Return context-aware settings page URL
517
- */
518
- private function quick_setup_url()
519
- {
520
- $base = $this->networkactive ? network_admin_url('settings.php') : admin_url('admin.php');
521
- return add_query_arg('page', $this->get_option('dc_setup_screen_seen') ? DC_PLUGIN_SLUG : DC_PLUGIN_SLUG . '_setup', $base);
522
- }
523
-
524
  /**
525
  * Return context-aware tools page URL
526
  */
@@ -536,13 +499,10 @@ class Disable_Comments
536
  if (strpos(get_current_screen()->id, 'settings_page_disable_comments_settings') === 0) {
537
  return;
538
  }
539
- if (strpos(get_current_screen()->id, 'admin_page_disable_comments_settings_setup') === 0) {
540
- return;
541
- }
542
  $hascaps = $this->networkactive ? is_network_admin() && current_user_can('manage_network_plugins') : current_user_can('manage_options');
543
  if ($hascaps) {
544
  $this->setup_notice_flag = true;
545
- echo '<div class="notice dc-text__block disable__comment__alert mb30"><img height="30" src="'. DC_ASSETS_URI .'img/icon-logo.png" alt=""><p>' . sprintf(__('The <strong>Disable Comments</strong> plugin is active, but isn\'t configured to do anything yet. Visit the <a href="%s">configuration page</a> to choose which post types to disable comments on.', 'disable-comments'), esc_attr($this->quick_setup_url())) . '</p></div>';
546
  }
547
  }
548
 
@@ -643,20 +603,12 @@ class Disable_Comments
643
  {
644
  $title = _x('Disable Comments', 'settings menu title', 'disable-comments');
645
  if ($this->networkactive) {
646
- $hook = add_submenu_page('settings.php', $title, $title, 'manage_network_plugins', DC_PLUGIN_SLUG, array($this, 'settings_page'));
647
  } else {
648
- $hook = add_submenu_page('options-general.php', $title, $title, 'manage_options', DC_PLUGIN_SLUG, array($this, 'settings_page'));
649
- }
650
- add_submenu_page(null, $title, $title, 'manage_options', DC_PLUGIN_SLUG . '_setup', array($this, 'setup_settings_page'));
651
- add_action('load-' . $hook, array($this, 'root_redirect'));
652
- }
653
- public function root_redirect(){
654
- $is_setup_page = isset( $_GET['page'] ) && trim( $_GET['page'] ) === 'disable_comments_settings_setup';
655
- if( isset( $_GET['page'] ) && trim( $_GET['page'] ) === 'disable_comments_settings' && ! $this->get_option('dc_setup_screen_seen') && ! $is_setup_page ) {
656
- wp_safe_redirect( $this->quick_setup_url(), 301 );
657
- exit;
658
  }
659
  }
 
660
  public function tools_menu()
661
  {
662
  $title = __('Delete Comments', 'disable-comments');
@@ -727,11 +679,6 @@ class Disable_Comments
727
  include_once DC_PLUGIN_VIEWS_PATH . 'settings.php';
728
  }
729
 
730
- public function setup_settings_page()
731
- {
732
- $this->update_option('dc_setup_screen_seen', true);
733
- include_once DC_PLUGIN_VIEWS_PATH . 'setup-settings.php';
734
- }
735
 
736
  public function form_data_modify($form_data)
737
  {
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.0.2
8
  * Author: WPDeveloper
9
  * Author URI: https://wpdeveloper.net
10
  * License: GPL-3.0+
37
 
38
  function __construct()
39
  {
40
+ define('DC_VERSION', '2.0.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/');
44
  define('DC_PLUGIN_ROOT_URI', plugins_url("/", __FILE__));
45
  define('DC_ASSETS_URI', DC_PLUGIN_ROOT_URI . 'assets/');
46
 
 
 
 
47
  // save settings
48
  add_action('wp_ajax_disable_comments_save_settings', array($this, 'disable_comments_settings'));
49
  add_action('wp_ajax_disable_comments_delete_comments', array($this, 'delete_comments_settings'));
107
  }
108
  $current_screen = get_current_screen()->id;
109
  $hascaps = $this->networkactive ? is_network_admin() && current_user_can('manage_network_plugins') : current_user_can('manage_options');
110
+ if( ! in_array( $current_screen, ['settings_page_disable_comments_settings', 'settings_page_disable_comments_settings-network']) && $hascaps ) {
111
  $this->tracker->notice();
112
  }
113
  }
124
  'item_id' => 'b0112c9030af6ba53de4'
125
  ]);
126
  $tracker->set_notice_options(array(
127
+ 'notice' => __('Want to help make Disable Comments even better?', 'disable-comments'),
128
+ 'extra_notice' => __('We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins & themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, I promise.', 'disable-comments'),
129
  ));
130
  $tracker->init();
131
  }
237
  add_action('admin_enqueue_scripts', array($this, 'settings_page_assets'));
238
  }
239
 
 
 
 
 
 
 
 
 
 
240
 
241
  public function register_text_domain()
242
  {
315
  return $this->networkactive ? delete_site_option( $option ) : delete_option( $option );
316
  }
317
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
  /**
319
  * Replace the theme's comment template with a blank one.
320
  * To prevent this, define DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE
423
  {
424
  if (
425
  $hook_suffix === 'settings_page_' . DC_PLUGIN_SLUG ||
426
+ $hook_suffix === 'options-general_' . DC_PLUGIN_SLUG
 
 
427
  ) {
428
  // css
429
  wp_enqueue_style('sweetalert2', DC_ASSETS_URI . 'css/sweetalert2.min.css', [], false);
484
  return add_query_arg('page', DC_PLUGIN_SLUG, $base);
485
  }
486
 
 
 
 
 
 
 
 
 
 
 
487
  /**
488
  * Return context-aware tools page URL
489
  */
499
  if (strpos(get_current_screen()->id, 'settings_page_disable_comments_settings') === 0) {
500
  return;
501
  }
 
 
 
502
  $hascaps = $this->networkactive ? is_network_admin() && current_user_can('manage_network_plugins') : current_user_can('manage_options');
503
  if ($hascaps) {
504
  $this->setup_notice_flag = true;
505
+ echo '<div class="notice dc-text__block disable__comment__alert mb30"><img height="30" src="'. DC_ASSETS_URI .'img/icon-logo.png" alt=""><p>' . sprintf(__('The <strong>Disable Comments</strong> plugin is active, but isn\'t configured to do anything yet. Visit the <a href="%s">configuration page</a> to choose which post types to disable comments on.', 'disable-comments'), esc_attr($this->settings_page_url())) . '</p></div>';
506
  }
507
  }
508
 
603
  {
604
  $title = _x('Disable Comments', 'settings menu title', 'disable-comments');
605
  if ($this->networkactive) {
606
+ add_submenu_page('settings.php', $title, $title, 'manage_network_plugins', DC_PLUGIN_SLUG, array($this, 'settings_page'));
607
  } else {
608
+ add_submenu_page('options-general.php', $title, $title, 'manage_options', DC_PLUGIN_SLUG, array($this, 'settings_page'));
 
 
 
 
 
 
 
 
 
609
  }
610
  }
611
+
612
  public function tools_menu()
613
  {
614
  $title = __('Delete Comments', 'disable-comments');
679
  include_once DC_PLUGIN_VIEWS_PATH . 'settings.php';
680
  }
681
 
 
 
 
 
 
682
 
683
  public function form_data_modify($form_data)
684
  {
includes/class-plugin-usage-tracker.php CHANGED
@@ -373,7 +373,7 @@ if( ! class_exists('DisableComments_Plugin_Tracker') ) :
373
  */
374
  $plugin = $this->plugin_data();
375
  if( empty( $plugin ) ) {
376
- $body['message'] .= __( 'We can\'t detect any plugin information. This is most probably because you have not included the code in the plugin main file.', 'plugin-usage-tracker' );
377
  $body['status'] = 'NOT FOUND';
378
  } else {
379
  if( isset( $plugin['Name'] ) ) {
@@ -634,9 +634,9 @@ if( ! class_exists('DisableComments_Plugin_Tracker') ) :
634
  */
635
  public function set_notice_options( $options = [] ){
636
  $default_options = [
637
- 'consent_button_text' => __( 'What we collect.', 'wpinsight' ),
638
- 'yes' => __( 'Sure, I\'d like to help', 'wpinsight' ),
639
- 'no' => __( 'No Thanks.', 'wpinsight' ),
640
  ];
641
  $options = wp_parse_args( $options, $default_options );
642
  $this->notice_options = $options;
@@ -729,20 +729,20 @@ if( ! class_exists('DisableComments_Plugin_Tracker') ) :
729
  */
730
  public function deactivation_reasons() {
731
  $form = array();
732
- $form['heading'] = __( 'Sorry to see you go', 'plugin-usage-tracker' );
733
- $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'plugin-usage-tracker' );
734
 
735
  $form['options'] = array(
736
- __( 'I no longer need the plugin', 'plugin-usage-tracker' ),
737
  [
738
- 'label' => __( 'I found a better plugin', 'plugin-usage-tracker' ),
739
- 'extra_field' => __( 'Please share which plugin', 'plugin-usage-tracker' )
740
  ],
741
- __( "I couldn't get the plugin to work", 'plugin-usage-tracker' ),
742
- __( 'It\'s a temporary deactivation', 'plugin-usage-tracker' ),
743
  [
744
- 'label' => __( 'Other', 'plugin-usage-tracker' ),
745
- 'extra_field' => __( 'Please share the reason', 'plugin-usage-tracker' ),
746
  'type' => 'textarea'
747
  ]
748
  );
@@ -784,7 +784,7 @@ if( ! class_exists('DisableComments_Plugin_Tracker') ) :
784
  $html .= '</ul></div><!-- .wpinsights-'. $class_plugin_name .'-goodbye-options -->';
785
  }
786
  $html .= '</div><!-- .wpinsights-goodbye-form-body -->';
787
- $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'plugin-usage-tracker' ) . '</p>';
788
 
789
  $wrapper_class = '.wpinsights-goodbye-form-wrapper-'. $class_plugin_name;
790
 
@@ -842,7 +842,7 @@ if( ! class_exists('DisableComments_Plugin_Tracker') ) :
842
  var url = document.getElementById("wpinsights-goodbye-link-<?php echo $class_plugin_name; ?>");
843
  $('body').toggleClass('wpinsights-form-active-<?php echo $class_plugin_name; ?>');
844
  $(".wpinsights-goodbye-form-wrapper-<?php echo $class_plugin_name; ?> #wpinsights-goodbye-form").fadeIn();
845
- $(".wpinsights-goodbye-form-wrapper-<?php echo $class_plugin_name; ?> #wpinsights-goodbye-form").html( '<?php echo $html; ?>' + '<div class="wpinsights-goodbye-form-footer"><div class="wpinsights-goodbye-form-buttons"><a id="wpinsights-submit-form-<?php echo $class_plugin_name; ?>" class="wpinsights-submit-btn" href="#"><?php _e( 'Submit and Deactivate', 'plugin-usage-tracker' ); ?></a>&nbsp;<a class="wpsp-put-deactivate-btn" href="'+url+'"><?php _e( 'Just Deactivate', 'plugin-usage-tracker' ); ?></a></div></div>');
846
  $('#wpinsights-submit-form-<?php echo $class_plugin_name; ?>').on('click', function(e){
847
  // As soon as we click, the body of the form should disappear
848
  $("#wpinsights-goodbye-form-<?php echo $class_plugin_name; ?> .wpinsights-goodbye-form-body").fadeOut();
373
  */
374
  $plugin = $this->plugin_data();
375
  if( empty( $plugin ) ) {
376
+ $body['message'] .= __( 'We can\'t detect any plugin information. This is most probably because you have not included the code in the plugin main file.', 'disable-comments' );
377
  $body['status'] = 'NOT FOUND';
378
  } else {
379
  if( isset( $plugin['Name'] ) ) {
634
  */
635
  public function set_notice_options( $options = [] ){
636
  $default_options = [
637
+ 'consent_button_text' => __( 'What we collect.', 'disable-comments' ),
638
+ 'yes' => __( 'Sure, I\'d like to help', 'disable-comments' ),
639
+ 'no' => __( 'No Thanks.', 'disable-comments' ),
640
  ];
641
  $options = wp_parse_args( $options, $default_options );
642
  $this->notice_options = $options;
729
  */
730
  public function deactivation_reasons() {
731
  $form = array();
732
+ $form['heading'] = __( 'Sorry to see you go', 'disable-comments' );
733
+ $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'disable-comments' );
734
 
735
  $form['options'] = array(
736
+ __( 'I no longer need the plugin', 'disable-comments' ),
737
  [
738
+ 'label' => __( 'I found a better plugin', 'disable-comments' ),
739
+ 'extra_field' => __( 'Please share which plugin', 'disable-comments' )
740
  ],
741
+ __( "I couldn't get the plugin to work", 'disable-comments' ),
742
+ __( 'It\'s a temporary deactivation', 'disable-comments' ),
743
  [
744
+ 'label' => __( 'Other', 'disable-comments' ),
745
+ 'extra_field' => __( 'Please share the reason', 'disable-comments' ),
746
  'type' => 'textarea'
747
  ]
748
  );
784
  $html .= '</ul></div><!-- .wpinsights-'. $class_plugin_name .'-goodbye-options -->';
785
  }
786
  $html .= '</div><!-- .wpinsights-goodbye-form-body -->';
787
+ $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'disable-comments' ) . '</p>';
788
 
789
  $wrapper_class = '.wpinsights-goodbye-form-wrapper-'. $class_plugin_name;
790
 
842
  var url = document.getElementById("wpinsights-goodbye-link-<?php echo $class_plugin_name; ?>");
843
  $('body').toggleClass('wpinsights-form-active-<?php echo $class_plugin_name; ?>');
844
  $(".wpinsights-goodbye-form-wrapper-<?php echo $class_plugin_name; ?> #wpinsights-goodbye-form").fadeIn();
845
+ $(".wpinsights-goodbye-form-wrapper-<?php echo $class_plugin_name; ?> #wpinsights-goodbye-form").html( '<?php echo $html; ?>' + '<div class="wpinsights-goodbye-form-footer"><div class="wpinsights-goodbye-form-buttons"><a id="wpinsights-submit-form-<?php echo $class_plugin_name; ?>" class="wpinsights-submit-btn" href="#"><?php _e( 'Submit and Deactivate', 'disable-comments' ); ?></a>&nbsp;<a class="wpsp-put-deactivate-btn" href="'+url+'"><?php _e( 'Just Deactivate', 'disable-comments' ); ?></a></div></div>');
846
  $('#wpinsights-submit-form-<?php echo $class_plugin_name; ?>').on('click', function(e){
847
  // As soon as we click, the body of the form should disappear
848
  $("#wpinsights-goodbye-form-<?php echo $class_plugin_name; ?> .wpinsights-goodbye-form-body").fadeOut();
languages/disable-comments.pot CHANGED
@@ -1,17 +1,17 @@
1
  # Copyright (C) 2020 WPDeveloper
2
- # This file is distributed under the GPL-3.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Disable Comments 2.0.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2020-11-27T13:34:45+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.5.0-alpha\n"
15
  "X-Domain: disable-comments\n"
16
 
17
  #. Plugin Name of the plugin
@@ -35,67 +35,139 @@ msgstr ""
35
  msgid "https://wpdeveloper.net"
36
  msgstr ""
37
 
38
- #: disable-comments.php:142
 
 
 
 
 
 
 
 
39
  msgid "Disable Comments requires WordPress version %s or greater."
40
  msgstr ""
41
 
42
- #: disable-comments.php:397
43
- #: disable-comments.php:554
44
- #: disable-comments.php:561
45
  msgid "Comments are closed."
46
  msgstr ""
47
 
48
- #: disable-comments.php:501
49
  msgid "Note: The <em>Disable Comments</em> plugin is currently active, and comments are completely disabled on: %s. Many of the settings below will not be applicable for those post types."
50
  msgstr ""
51
 
52
- #: disable-comments.php:501
53
  msgid ", "
54
  msgstr ""
55
 
56
- #: disable-comments.php:545
57
  msgid "The <strong>Disable Comments</strong> plugin is active, but isn't configured to do anything yet. Visit the <a href=\"%s\">configuration page</a> to choose which post types to disable comments on."
58
  msgstr ""
59
 
60
- #: disable-comments.php:634
61
  #: views/partials/_disable.php:3
62
  msgid "Settings"
63
  msgstr ""
64
 
65
- #: disable-comments.php:635
66
  msgid "Tools"
67
  msgstr ""
68
 
69
- #: disable-comments.php:644
70
  msgctxt "settings menu title"
71
  msgid "Disable Comments"
72
  msgstr ""
73
 
74
- #: disable-comments.php:674
75
  #: views/partials/_delete.php:51
76
  #: views/settings.php:12
77
  msgid "Delete Comments"
78
  msgstr ""
79
 
80
- #: disable-comments.php:708
81
  msgid "Default (no type)"
82
  msgstr ""
83
 
84
- #: disable-comments.php:803
85
  msgid "Saved"
86
  msgstr ""
87
 
88
- #: disable-comments.php:832
89
- #: disable-comments.php:866
90
- #: disable-comments.php:889
91
  msgid "All comments has been deleted"
92
  msgstr ""
93
 
94
- #: disable-comments.php:834
95
- #: disable-comments.php:838
96
  msgid "Internal error occured. Please try again later."
97
  msgstr ""
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  #: includes/cli.php:122
100
  msgid "Comments is disabled everywhere. "
101
  msgstr ""
@@ -293,63 +365,3 @@ msgstr ""
293
  #: views/settings.php:6
294
  msgid "Version"
295
  msgstr ""
296
-
297
- #: views/setup-settings.php:17
298
- msgid "GETTING STARTED"
299
- msgstr ""
300
-
301
- #: views/setup-settings.php:20
302
- msgid "Disable comments"
303
- msgstr ""
304
-
305
- #: views/setup-settings.php:23
306
- msgid "FINALIZE"
307
- msgstr ""
308
-
309
- #: views/setup-settings.php:30
310
- msgid "Getting Started"
311
- msgstr ""
312
-
313
- #: views/setup-settings.php:31
314
- msgid "Easily get started with this easy setup wizard and complete setting up your Knowledge Base."
315
- msgstr ""
316
-
317
- #: views/setup-settings.php:39
318
- msgid "Want to help make Disable Comments even better?"
319
- msgstr ""
320
-
321
- #: views/setup-settings.php:40
322
- msgid "What we collect."
323
- msgstr ""
324
-
325
- #: views/setup-settings.php:41
326
- msgid "We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins, themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, I promise."
327
- msgstr ""
328
-
329
- #: views/setup-settings.php:50
330
- msgid "Great Job!"
331
- msgstr ""
332
-
333
- #: views/setup-settings.php:51
334
- msgid "Your documentation page is ready! Make sure to add more articles and assign them to proper categories and you are good to go."
335
- msgstr ""
336
-
337
- #: views/setup-settings.php:57
338
- msgid "VISIT OUR DOCUMENTATION PAGE"
339
- msgstr ""
340
-
341
- #: views/setup-settings.php:61
342
- msgid "Previous"
343
- msgstr ""
344
-
345
- #: views/setup-settings.php:62
346
- msgid "Next"
347
- msgstr ""
348
-
349
- #: views/setup-settings.php:63
350
- msgid "Skip"
351
- msgstr ""
352
-
353
- #: views/setup-settings.php:68
354
- msgid "Return to Dashboard"
355
- msgstr ""
1
  # Copyright (C) 2020 WPDeveloper
2
+ # This file is distributed under the same license as the Disable Comments plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Disable Comments 2.0.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/disable-comments\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2020-12-01T10:43:49+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
+ "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: disable-comments\n"
16
 
17
  #. Plugin Name of the plugin
35
  msgid "https://wpdeveloper.net"
36
  msgstr ""
37
 
38
+ #: disable-comments.php:127
39
+ msgid "Want to help make Disable Comments even better?"
40
+ msgstr ""
41
+
42
+ #: disable-comments.php:128
43
+ msgid "We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins & themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, I promise."
44
+ msgstr ""
45
+
46
+ #: disable-comments.php:139
47
  msgid "Disable Comments requires WordPress version %s or greater."
48
  msgstr ""
49
 
50
+ #: disable-comments.php:372
51
+ #: disable-comments.php:514
52
+ #: disable-comments.php:521
53
  msgid "Comments are closed."
54
  msgstr ""
55
 
56
+ #: disable-comments.php:474
57
  msgid "Note: The <em>Disable Comments</em> plugin is currently active, and comments are completely disabled on: %s. Many of the settings below will not be applicable for those post types."
58
  msgstr ""
59
 
60
+ #: disable-comments.php:474
61
  msgid ", "
62
  msgstr ""
63
 
64
+ #: disable-comments.php:505
65
  msgid "The <strong>Disable Comments</strong> plugin is active, but isn't configured to do anything yet. Visit the <a href=\"%s\">configuration page</a> to choose which post types to disable comments on."
66
  msgstr ""
67
 
68
+ #: disable-comments.php:594
69
  #: views/partials/_disable.php:3
70
  msgid "Settings"
71
  msgstr ""
72
 
73
+ #: disable-comments.php:595
74
  msgid "Tools"
75
  msgstr ""
76
 
77
+ #: disable-comments.php:604
78
  msgctxt "settings menu title"
79
  msgid "Disable Comments"
80
  msgstr ""
81
 
82
+ #: disable-comments.php:614
83
  #: views/partials/_delete.php:51
84
  #: views/settings.php:12
85
  msgid "Delete Comments"
86
  msgstr ""
87
 
88
+ #: disable-comments.php:645
89
  msgid "Default (no type)"
90
  msgstr ""
91
 
92
+ #: disable-comments.php:735
93
  msgid "Saved"
94
  msgstr ""
95
 
96
+ #: disable-comments.php:764
97
+ #: disable-comments.php:798
98
+ #: disable-comments.php:821
99
  msgid "All comments has been deleted"
100
  msgstr ""
101
 
102
+ #: disable-comments.php:766
103
+ #: disable-comments.php:770
104
  msgid "Internal error occured. Please try again later."
105
  msgstr ""
106
 
107
+ #: includes/class-plugin-usage-tracker.php:376
108
+ msgid "We can't detect any plugin information. This is most probably because you have not included the code in the plugin main file."
109
+ msgstr ""
110
+
111
+ #: includes/class-plugin-usage-tracker.php:637
112
+ msgid "What we collect."
113
+ msgstr ""
114
+
115
+ #: includes/class-plugin-usage-tracker.php:638
116
+ msgid "Sure, I'd like to help"
117
+ msgstr ""
118
+
119
+ #: includes/class-plugin-usage-tracker.php:639
120
+ msgid "No Thanks."
121
+ msgstr ""
122
+
123
+ #: includes/class-plugin-usage-tracker.php:732
124
+ msgid "Sorry to see you go"
125
+ msgstr ""
126
+
127
+ #: includes/class-plugin-usage-tracker.php:733
128
+ msgid "Before you deactivate the plugin, would you quickly give us your reason for doing so?"
129
+ msgstr ""
130
+
131
+ #: includes/class-plugin-usage-tracker.php:736
132
+ msgid "I no longer need the plugin"
133
+ msgstr ""
134
+
135
+ #: includes/class-plugin-usage-tracker.php:738
136
+ msgid "I found a better plugin"
137
+ msgstr ""
138
+
139
+ #: includes/class-plugin-usage-tracker.php:739
140
+ msgid "Please share which plugin"
141
+ msgstr ""
142
+
143
+ #: includes/class-plugin-usage-tracker.php:741
144
+ msgid "I couldn't get the plugin to work"
145
+ msgstr ""
146
+
147
+ #: includes/class-plugin-usage-tracker.php:742
148
+ msgid "It's a temporary deactivation"
149
+ msgstr ""
150
+
151
+ #: includes/class-plugin-usage-tracker.php:744
152
+ msgid "Other"
153
+ msgstr ""
154
+
155
+ #: includes/class-plugin-usage-tracker.php:745
156
+ msgid "Please share the reason"
157
+ msgstr ""
158
+
159
+ #: includes/class-plugin-usage-tracker.php:787
160
+ msgid "Submitting form"
161
+ msgstr ""
162
+
163
+ #: includes/class-plugin-usage-tracker.php:845
164
+ msgid "Submit and Deactivate"
165
+ msgstr ""
166
+
167
+ #: includes/class-plugin-usage-tracker.php:845
168
+ msgid "Just Deactivate"
169
+ msgstr ""
170
+
171
  #: includes/cli.php:122
172
  msgid "Comments is disabled everywhere. "
173
  msgstr ""
365
  #: views/settings.php:6
366
  msgid "Version"
367
  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, disable comments, 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.5
7
  Requires PHP: 5.6
8
- Stable tag: 2.0.1
9
  License: GPL-3.0-or-later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -169,6 +169,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
169
  and this project adheres to [Semantic Versioning](http://semver.org/).
170
  This will be maiintained from August 19, 2020 - @asif2bd
171
 
 
 
 
 
 
172
  = [2.0.1] - 2020-11-28 =
173
  * Bug Fix: Settings page URL issue fixed from plugins page.
174
  * Improvement: Quick Setup Wizard instructions.
3
  Donate link: https://wpdeveloper.net/
4
  Tags: comments, delete comments, disable, disable comments, 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.6
7
  Requires PHP: 5.6
8
+ Stable tag: 2.0.2
9
  License: GPL-3.0-or-later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
 
169
  and this project adheres to [Semantic Versioning](http://semver.org/).
170
  This will be maiintained from August 19, 2020 - @asif2bd
171
 
172
+ = [2.0.2] - 2020-12-01 =
173
+ * Removed: Quick Setup Wizard
174
+ * Improved: Redirection settings page after activation.
175
+ * Fixed: Text-Domain Issue.
176
+
177
  = [2.0.1] - 2020-11-28 =
178
  * Bug Fix: Settings page URL issue fixed from plugins page.
179
  * Improvement: Quick Setup Wizard instructions.
views/setup-settings.php DELETED
@@ -1,76 +0,0 @@
1
- <div id="disablecommentssetupwrap" class="disablecommentswrap background__grey dc-quick__setup__wrap">
2
- <div class="dc-container">
3
- <div class="dc-row">
4
- <div class="dc-col">
5
- <div class="dc-quick__setup">
6
- <div class="dc-logo dc-logo__center mb50">
7
- <img src="<?php echo esc_url(DC_ASSETS_URI . 'img/logo.png'); ?>" alt="">
8
- </div>
9
- </div>
10
- </div>
11
- </div>
12
- <div class="dc-row">
13
- <div class="dc-col">
14
- <div class="mb30">
15
- <ul class="dc-quick__setup__nav">
16
- <li class="quick__setup__item active">
17
- <a href="#" class="quick__setup__link"><?php _e('GETTING STARTED', 'disable-comments'); ?></a>
18
- </li>
19
- <li class="quick__setup__item">
20
- <a href="#" class="quick__setup__link"><?php _e('Disable comments', 'disable-comments'); ?></a>
21
- </li>
22
- <li class="quick__setup__item">
23
- <a href="#" class="quick__setup__link"><?php _e('FINALIZE', 'disable-comments'); ?></a>
24
- </li>
25
- </ul>
26
- </div>
27
- <div id="disableCommentSetupSettings" class="dc-quick__setup__step dc-text__block__big__pad">
28
- <div id="dcqTabBody_1" class="dc-quick__step__item">
29
- <div class="quick__setup__item__header mb30">
30
- <h2><?php _e('Getting Started', 'disable-comments'); ?></h2>
31
- <p><?php _e('Easily get started with this easy setup wizard and complete setting up your Disable Comments', 'disable-comments'); ?></p>
32
- </div>
33
- <div class="dc-video__area">
34
- <iframe width="622" height="350" src="https://www.youtube.com/embed/J9AteKzQpPs" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
35
- </div>
36
- <div class="dc-form__group">
37
- <input name="dc_is_optin" type="checkbox" value="1" id="dc_option" checked>
38
- <label for="dc_option">
39
- <?php _e('Want to help make Disable Comments even better?', 'disable-comments'); ?>
40
- <a id="whatWeCollect" href="#"><?php _e('What we collect.', 'disable-comments'); ?></a>
41
- <p id="whatWeCollectMessage"><?php _e('We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins, themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, I promise.', 'disable-comments'); ?></p>
42
- </label>
43
- </div>
44
- </div>
45
- <div id="dcqTabBody_2" class="dc-quick__step__item">
46
- <?php include DC_PLUGIN_VIEWS_PATH . 'partials/_disable.php'; ?>
47
- </div>
48
- <div id="dcqTabBody_3" class="dc-quick__step__item">
49
- <div class="quick__setup__item__header">
50
- <h2><?php _e('Great Job!', 'disable-comments'); ?></h2>
51
- <p><?php _e('You are ready to go! You can manage your settings anytime from Settings > Disable Comments', 'disable-comments'); ?></p>
52
- </div>
53
- <div class="finalize-thumb">
54
- <img src="<?php echo esc_url(DC_ASSETS_URI . 'img/finalize-thumb.png'); ?>" alt="">
55
- </div>
56
- <div class="doc__button__wrap">
57
- <a href="<?php echo esc_url('https://wpdeveloper.net/docs-category/disable-comments/'); ?>" class="doc__button" target="_blank" rel="nofollow"><?php _e('VISIT OUR DOCUMENTATION PAGE', 'disable-comments'); ?></a>
58
- </div>
59
- </div>
60
- <div class="button__group mt30">
61
- <a id="dcQuickPreviousBtn" href="#" class="button button--sm"><?php _e('Previous', 'disable-comments'); ?></a>
62
- <a id="dcQuickNextBtn" href="#" class="button button__success"><?php _e('Next', 'disable-comments'); ?></a>
63
- <a id="dcQuickSkipBtn" href="#" class="button button--sm"><?php _e('Skip', 'disable-comments'); ?></a>
64
- </div>
65
- </div>
66
-
67
- <div class="footer__content mt50">
68
- <a href="<?php echo $this->settings_page_url() . '&cancel=setup'; ?>" class="cancel-dc-setup"><?php _e('Return to Dashboard', 'disable-comments'); ?></a>
69
- <?php
70
- include DC_PLUGIN_VIEWS_PATH . 'partials/_menu.php';
71
- ?>
72
- </div>
73
- </div>
74
- </div>
75
- </div>
76
- </div>