Disable Comments - Version 1.3.2

Version Description

  • Compatibility updates and code refactoring for WordPress 4.3
  • Adding a few new translations
Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

disable-comments.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Disable Comments
4
  Plugin URI: http://wordpress.org/extend/plugins/disable-comments/
5
  Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.
6
- Version: 1.3.1
7
  Author: Samir Shah
8
  Author URI: http://rayofsolaris.net/
9
  License: GPL2
@@ -15,17 +15,16 @@ if( !defined( 'ABSPATH' ) )
15
  exit;
16
 
17
  class Disable_Comments {
18
- const db_version = 6;
19
  private static $instance = null;
20
  private $options;
21
  private $networkactive;
22
  private $modified_types = array();
23
 
24
  public static function get_instance() {
25
- if ( null == self::$instance ) {
26
  self::$instance = new self;
27
  }
28
-
29
  return self::$instance;
30
  }
31
 
@@ -33,22 +32,41 @@ class Disable_Comments {
33
  // are we network activated?
34
  $this->networkactive = ( is_multisite() && array_key_exists( plugin_basename( __FILE__ ), (array) get_site_option( 'active_sitewide_plugins' ) ) );
35
 
36
- // load options
37
- $this->options = $this->networkactive ? get_site_option( 'disable_comments_options', array() ) : get_option( 'disable_comments_options', array() );
 
 
 
 
 
38
 
39
  // load language files
40
  load_plugin_textdomain( 'disable-comments', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
41
 
42
  // If it looks like first run, check compat
43
- if ( empty( $this->options ) && version_compare( $GLOBALS['wp_version'], '3.4', '<' ) ) {
 
 
 
 
 
 
 
 
 
 
 
44
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
45
  deactivate_plugins( __FILE__ );
46
- if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) )
47
- exit( sprintf( __( 'Disable Comments requires WordPress version %s or greater.', 'disable-comments' ), '3.3' ) );
 
48
  }
 
49
 
 
50
  $old_ver = isset( $this->options['db_version'] ) ? $this->options['db_version'] : 0;
51
- if( $old_ver < self::db_version ) {
52
  if( $old_ver < 2 ) {
53
  // upgrade options from version 0.2.1 or earlier to 0.3
54
  $this->options['disabled_post_types'] = get_option( 'disable_comments_post_types', array() );
@@ -67,11 +85,45 @@ class Disable_Comments {
67
  }
68
  }
69
 
70
- $this->options['db_version'] = self::db_version;
71
  $this->update_options();
72
  }
 
 
 
 
 
 
 
 
 
 
73
 
74
- // these need to happen now
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  if( $this->options['remove_everywhere'] ) {
76
  add_action( 'widgets_init', array( $this, 'disable_rc_widget' ) );
77
  add_filter( 'wp_headers', array( $this, 'filter_wp_headers' ) );
@@ -82,18 +134,11 @@ class Disable_Comments {
82
  add_action( 'admin_init', array( $this, 'filter_admin_bar' ) );
83
  }
84
 
85
- // these can happen later
86
- add_action( 'wp_loaded', array( $this, 'setup_filters' ) );
87
  }
88
 
89
- private function update_options() {
90
- if( $this->networkactive )
91
- update_site_option( 'disable_comments_options', $this->options );
92
- else
93
- update_option( 'disable_comments_options', $this->options );
94
- }
95
-
96
- function setup_filters(){
97
  $disabled_post_types = $this->get_disabled_post_types();
98
  if( !empty( $disabled_post_types ) ) {
99
  foreach( $disabled_post_types as $type ) {
@@ -146,10 +191,15 @@ class Disable_Comments {
146
  }
147
  }
148
 
149
- function check_comment_template() {
 
 
 
 
 
150
  if( is_singular() && ( $this->options['remove_everywhere'] || $this->is_post_type_disabled( get_post_type() ) ) ) {
151
  if( !defined( 'DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE' ) || DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE == true ) {
152
- // Kill the comments template. This will deal with themes that don't check comment stati properly!
153
  add_filter( 'comments_template', array( $this, 'dummy_comments_template' ), 20 );
154
  }
155
  // Remove comment-reply script for themes that include it indiscriminately
@@ -159,33 +209,46 @@ class Disable_Comments {
159
  }
160
  }
161
 
162
- function dummy_comments_template() {
163
- return dirname( __FILE__ ) . '/comments-template.php';
164
  }
165
 
166
- function filter_wp_headers( $headers ) {
 
 
 
 
167
  unset( $headers['X-Pingback'] );
168
  return $headers;
169
  }
170
 
171
- function filter_query() {
 
 
 
172
  if( is_comment_feed() ) {
173
- // we are inside a comment feed
174
  wp_die( __( 'Comments are closed.' ), '', array( 'response' => 403 ) );
175
  }
176
  }
177
 
178
- function filter_admin_bar() {
 
 
 
179
  if( is_admin_bar_showing() ) {
180
  // Remove comments links from admin bar
181
  remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 ); // WP<3.3
182
  remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); // WP 3.3
183
- if( is_multisite() )
184
  add_action( 'admin_bar_menu', array( $this, 'remove_network_comment_links' ), 500 );
 
185
  }
186
  }
187
 
188
- function remove_network_comment_links( $wp_admin_bar ) {
 
 
 
189
  if( $this->networkactive ) {
190
  foreach( (array) $wp_admin_bar->user->blogs as $blog )
191
  $wp_admin_bar->remove_menu( 'blog-' . $blog->userblog_id . '-c' );
@@ -196,7 +259,7 @@ class Disable_Comments {
196
  }
197
  }
198
 
199
- function edit_form_inputs() {
200
  global $post;
201
  // Without a dicussion meta box, comment_status will be set to closed on new/updated posts
202
  if( in_array( $post->post_type, $this->modified_types ) ) {
@@ -204,7 +267,7 @@ class Disable_Comments {
204
  }
205
  }
206
 
207
- function discussion_notice(){
208
  $disabled_post_types = $this->get_disabled_post_types();
209
  if( get_current_screen()->id == 'options-discussion' && !empty( $disabled_post_types ) ) {
210
  $names = array();
@@ -228,15 +291,16 @@ jQuery(document).ready(function($){
228
  return add_query_arg( 'page', 'disable_comments_settings', $base );
229
  }
230
 
231
- function setup_notice(){
232
  if( strpos( get_current_screen()->id, 'settings_page_disable_comments_settings' ) === 0 )
233
  return;
234
  $hascaps = $this->networkactive ? is_network_admin() && current_user_can( 'manage_network_plugins' ) : current_user_can( 'manage_options' );
235
- if( $hascaps )
236
  echo '<div class="updated fade"><p>' . sprintf( __( 'The <em>Disable Comments</em> 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>';
 
237
  }
238
 
239
- function filter_admin_menu(){
240
  global $pagenow;
241
 
242
  if ( $pagenow == 'comment.php' || $pagenow == 'edit-comments.php' || $pagenow == 'options-discussion.php' )
@@ -246,16 +310,16 @@ jQuery(document).ready(function($){
246
  remove_submenu_page( 'options-general.php', 'options-discussion.php' );
247
  }
248
 
249
- function filter_dashboard(){
250
  remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
251
  }
252
 
253
- function hide_dashboard_bits(){
254
  if( 'dashboard' == get_current_screen()->id )
255
  add_action( 'admin_print_footer_scripts', array( $this, 'dashboard_js' ) );
256
  }
257
 
258
- function dashboard_js(){
259
  if( version_compare( $GLOBALS['wp_version'], '3.8', '<' ) ) {
260
  // getting hold of the discussion box is tricky. The table_discussion class is used for other things in multisite
261
  echo '<script> jQuery(function($){ $("#dashboard_right_now .table_discussion").has(\'a[href="edit-comments.php"]\').first().hide(); }); </script>';
@@ -265,17 +329,17 @@ jQuery(document).ready(function($){
265
  }
266
  }
267
 
268
- function filter_comment_status( $open, $post_id ) {
269
  $post = get_post( $post_id );
270
  return ( $this->options['remove_everywhere'] || $this->is_post_type_disabled( $post->post_type ) ) ? false : $open;
271
  }
272
 
273
- function disable_rc_widget() {
274
  // This widget has been removed from the Dashboard in WP 3.8 and can be removed in a future version
275
  unregister_widget( 'WP_Widget_Recent_Comments' );
276
  }
277
 
278
- function set_plugin_meta( $links, $file ) {
279
  static $plugin;
280
  $plugin = plugin_basename( __FILE__ );
281
  if ( $file == $plugin ) {
@@ -287,7 +351,7 @@ jQuery(document).ready(function($){
287
  /**
288
  * Add links to Settings page
289
  */
290
- function plugin_actions_links( $links, $file ) {
291
  static $plugin;
292
  $plugin = plugin_basename( __FILE__ );
293
  if( $file == $plugin && current_user_can('manage_options') ) {
@@ -300,7 +364,7 @@ jQuery(document).ready(function($){
300
  return $links;
301
  }
302
 
303
- function settings_menu() {
304
  $title = __( 'Disable Comments', 'disable-comments' );
305
  if( $this->networkactive )
306
  add_submenu_page( 'settings.php', $title, $title, 'manage_network_plugins', 'disable_comments_settings', array( $this, 'settings_page' ) );
@@ -308,118 +372,8 @@ jQuery(document).ready(function($){
308
  add_submenu_page( 'options-general.php', $title, $title, 'manage_options', 'disable_comments_settings', array( $this, 'settings_page' ) );
309
  }
310
 
311
- function settings_page() {
312
- $typeargs = array( 'public' => true );
313
- if( $this->networkactive ) {
314
- $typeargs['_builtin'] = true; // stick to known types for network
315
- }
316
- $types = get_post_types( $typeargs, 'objects' );
317
- foreach( array_keys( $types ) as $type ) {
318
- if( ! in_array( $type, $this->modified_types ) && ! post_type_supports( $type, 'comments' ) ) // the type doesn't support comments anyway
319
- unset( $types[$type] );
320
- }
321
-
322
- $persistent_allowed = $this->persistent_mode_allowed();
323
-
324
- if ( isset( $_POST['submit'] ) ) {
325
- check_admin_referer( 'disable-comments-admin' );
326
- $this->options['remove_everywhere'] = ( $_POST['mode'] == 'remove_everywhere' );
327
-
328
- if( $this->options['remove_everywhere'] )
329
- $disabled_post_types = array_keys( $types );
330
- else
331
- $disabled_post_types = empty( $_POST['disabled_types'] ) ? array() : (array) $_POST['disabled_types'];
332
-
333
- $disabled_post_types = array_intersect( $disabled_post_types, array_keys( $types ) );
334
-
335
- // entering permanent mode, or post types have changed
336
- if( $persistent_allowed && !empty( $_POST['permanent'] ) && ( !$this->options['permanent'] || $disabled_post_types != $this->options['disabled_post_types'] ) )
337
- $this->enter_permanent_mode();
338
-
339
- $this->options['disabled_post_types'] = $disabled_post_types;
340
- $this->options['permanent'] = $persistent_allowed && isset( $_POST['permanent'] );
341
-
342
- // Extra custom post types
343
- if( $this->networkactive && !empty( $_POST['extra_post_types'] ) ) {
344
- $extra_post_types = array_filter( array_map( 'sanitize_key', explode( ',', $_POST['extra_post_types'] ) ) );
345
- $this->options['extra_post_types'] = array_diff( $extra_post_types, array_keys( $types ) ); // Make sure we don't double up builtins
346
- }
347
-
348
- $this->update_options();
349
- $cache_message = WP_CACHE ? ' <strong>' . __( 'If a caching/performance plugin is active, please invalidate its cache to ensure that changes are reflected immediately.' ) . '</strong>' : '';
350
- echo '<div id="message" class="updated"><p>' . __( 'Options updated. Changes to the Admin Menu and Admin Bar will not appear until you leave or reload this page.', 'disable-comments' ) . $cache_message . '</p></div>';
351
- }
352
- ?>
353
- <style> .indent {padding-left: 2em} </style>
354
- <div class="wrap">
355
- <?php screen_icon( 'plugins' ); ?>
356
- <h2><?php _e( 'Disable Comments', 'disable-comments') ?></h2>
357
- <?php
358
- if( $this->networkactive )
359
- echo '<div class="updated"><p>' . __( '<em>Disable Comments</em> is Network Activated. The settings below will affect <strong>all sites</strong> in this network.', 'disable-comments') . '</p></div>';
360
- if( WP_CACHE )
361
- echo '<div class="updated"><p>' . __( "It seems that a caching/performance plugin is active on this site. Please manually invalidate that plugin's cache after making any changes to the settings below.", 'disable-comments') . '</p></div>';
362
- ?>
363
- <form action="" method="post" id="disable-comments">
364
- <ul>
365
- <li><label for="remove_everywhere"><input type="radio" id="remove_everywhere" name="mode" value="remove_everywhere" <?php checked( $this->options['remove_everywhere'] );?> /> <strong><?php _e( 'Everywhere', 'disable-comments') ?></strong>: <?php _e( 'Disable all comment-related controls and settings in WordPress.', 'disable-comments') ?></label>
366
- <p class="indent"><?php printf( __( '%s: This option is global and will affect your entire site. Use it only if you want to disable comments <em>everywhere</em>. A complete description of what this option does is <a href="%s" target="_blank">available here</a>.', 'disable-comments' ), '<strong style="color: #900">' . __('Warning', 'disable-comments') . '</strong>', 'http://wordpress.org/extend/plugins/disable-comments/other_notes/' ); ?></p>
367
- </li>
368
- <li><label for="selected_types"><input type="radio" id="selected_types" name="mode" value="selected_types" <?php checked( ! $this->options['remove_everywhere'] );?> /> <strong><?php _e( 'On certain post types', 'disable-comments') ?></strong></label>:
369
- <p></p>
370
- <ul class="indent" id="listoftypes">
371
- <?php foreach( $types as $k => $v ) echo "<li><label for='post-type-$k'><input type='checkbox' name='disabled_types[]' value='$k' ". checked( in_array( $k, $this->options['disabled_post_types'] ), true, false ) ." id='post-type-$k'> {$v->labels->name}</label></li>";?>
372
- </ul>
373
- <?php if( $this->networkactive ) :?>
374
- <p class="indent" 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' ); ?>
375
- <br /><label>Custom post types: <input type="text" name="extra_post_types" size="30" value="<?php echo implode( ', ', (array) $this->options['extra_post_types'] ); ?>" /></label></p>
376
- <?php endif; ?>
377
- <p class="indent"><?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.', 'disable-comments') ?></p>
378
- </li>
379
- </ul>
380
-
381
- <?php if( $persistent_allowed ): ?>
382
- <h3><?php _e( 'Other options', 'disable-comments') ?></h3>
383
- <ul>
384
- <li>
385
- <?php
386
- echo '<label for="permanent"><input type="checkbox" name="permanent" id="permanent" '. checked( $this->options['permanent'], true, false ) . '> <strong>' . __( 'Use persistent mode', 'disable-comments') . '</strong></label>';
387
- echo '<p class="indent">' . sprintf( __( '%s: <strong>This will make persistent changes to your database &mdash; comments will remain closed even if you later disable the plugin!</strong> You should not use it if you only want to disable comments temporarily. Please <a href="%s" target="_blank">read the FAQ</a> before selecting this option.', 'disable-comments'), '<strong style="color: #900">' . __('Warning', 'disable-comments') . '</strong>', 'http://wordpress.org/extend/plugins/disable-comments/faq/' ) . '</p>';
388
- if( $this->networkactive )
389
- echo '<p class="indent">' . sprintf( __( '%s: Entering persistent mode on large multi-site networks requires a large number of database queries and can take a while. Use with caution!', 'disable-comments'), '<strong style="color: #900">' . __('Warning', 'disable-comments') . '</strong>' ) . '</p>';
390
- ?>
391
- </li>
392
- </ul>
393
- <?php endif; ?>
394
-
395
- <?php wp_nonce_field( 'disable-comments-admin' ); ?>
396
- <p class="submit"><input class="button-primary" type="submit" name="submit" value="<?php _e( 'Save Changes') ?>"></p>
397
- </form>
398
- </div>
399
- <script>
400
- jQuery(document).ready(function($){
401
- function disable_comments_uihelper(){
402
- var indiv_bits = $("#listoftypes, #extratypes");
403
- if( $("#remove_everywhere").is(":checked") )
404
- indiv_bits.css("color", "#888").find(":input").attr("disabled", true );
405
- else
406
- indiv_bits.css("color", "#000").find(":input").attr("disabled", false );
407
- }
408
-
409
- $("#disable-comments :input").change(function(){
410
- $("#message").slideUp();
411
- disable_comments_uihelper();
412
- });
413
-
414
- disable_comments_uihelper();
415
-
416
- $("#permanent").change( function() {
417
- if( $(this).is(":checked") && ! confirm(<?php echo json_encode( sprintf( __( '%s: Selecting this option will make persistent changes to your database. Are you sure you want to enable it?', 'disable-comments'), __( 'Warning', 'disable-comments' ) ) );?>) )
418
- $(this).attr("checked", false );
419
- });
420
- });
421
- </script>
422
- <?php
423
  }
424
 
425
  private function enter_permanent_mode() {
@@ -458,28 +412,10 @@ jQuery(document).ready(function($){
458
  return apply_filters( 'disable_comments_allow_persistent_mode', true );
459
  }
460
 
461
- /* This function should only be used inside an individual site context */
462
- private function get_disabled_post_types() {
463
- $types = $this->options['disabled_post_types'];
464
- // Not all extra_post_types might be registered on this particular site
465
- if( $this->networkactive ) {
466
- foreach( (array) $this->options['extra_post_types'] as $extra ) {
467
- if( post_type_exists( $extra ) ) {
468
- $types[] = $extra;
469
- }
470
- }
471
- }
472
- return $types;
473
- }
474
-
475
- private function is_post_type_disabled( $type ) {
476
- return in_array( $type, $this->get_disabled_post_types() );
477
- }
478
-
479
- function single_site_deactivate() {
480
  // for single sites, delete the options upon deactivation, not uninstall
481
  delete_option( 'disable_comments_options' );
482
  }
483
  }
484
 
485
- Disable_Comments::get_instance();
3
  Plugin Name: Disable Comments
4
  Plugin URI: http://wordpress.org/extend/plugins/disable-comments/
5
  Description: Allows administrators to globally disable comments on their site. Comments can be disabled according to post type.
6
+ Version: 1.3.2
7
  Author: Samir Shah
8
  Author URI: http://rayofsolaris.net/
9
  License: GPL2
15
  exit;
16
 
17
  class Disable_Comments {
18
+ const DB_VERSION = 6;
19
  private static $instance = null;
20
  private $options;
21
  private $networkactive;
22
  private $modified_types = array();
23
 
24
  public static function get_instance() {
25
+ if ( is_null( self::$instance ) ) {
26
  self::$instance = new self;
27
  }
 
28
  return self::$instance;
29
  }
30
 
32
  // are we network activated?
33
  $this->networkactive = ( is_multisite() && array_key_exists( plugin_basename( __FILE__ ), (array) get_site_option( 'active_sitewide_plugins' ) ) );
34
 
35
+ // Load options
36
+ if( $this->networkactive ) {
37
+ $this->options = get_site_option( 'disable_comments_options', array() );
38
+ }
39
+ else {
40
+ $this->options = get_option( 'disable_comments_options', array() );
41
+ }
42
 
43
  // load language files
44
  load_plugin_textdomain( 'disable-comments', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
45
 
46
  // If it looks like first run, check compat
47
+ if( empty( $this->options ) ) {
48
+ $this->check_compatibility();
49
+ }
50
+
51
+ // Upgrade DB if necessary
52
+ $this->check_db_upgrades();
53
+
54
+ $this->init_filters();
55
+ }
56
+
57
+ private function check_compatibility() {
58
+ if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) ) {
59
  require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
60
  deactivate_plugins( __FILE__ );
61
+ if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) ) {
62
+ exit( sprintf( __( 'Disable Comments requires WordPress version %s or greater.', 'disable-comments' ), '3.5' ) );
63
+ }
64
  }
65
+ }
66
 
67
+ private function check_db_upgrades() {
68
  $old_ver = isset( $this->options['db_version'] ) ? $this->options['db_version'] : 0;
69
+ if( $old_ver < self::DB_VERSION ) {
70
  if( $old_ver < 2 ) {
71
  // upgrade options from version 0.2.1 or earlier to 0.3
72
  $this->options['disabled_post_types'] = get_option( 'disable_comments_post_types', array() );
85
  }
86
  }
87
 
88
+ $this->options['db_version'] = self::DB_VERSION;
89
  $this->update_options();
90
  }
91
+ }
92
+
93
+ private function update_options() {
94
+ if( $this->networkactive ) {
95
+ update_site_option( 'disable_comments_options', $this->options );
96
+ }
97
+ else {
98
+ update_option( 'disable_comments_options', $this->options );
99
+ }
100
+ }
101
 
102
+ /*
103
+ * Get an array of disabled post type.
104
+ */
105
+ private function get_disabled_post_types() {
106
+ $types = $this->options['disabled_post_types'];
107
+ // Not all extra_post_types might be registered on this particular site
108
+ if( $this->networkactive ) {
109
+ foreach( (array) $this->options['extra_post_types'] as $extra ) {
110
+ if( post_type_exists( $extra ) ) {
111
+ $types[] = $extra;
112
+ }
113
+ }
114
+ }
115
+ return $types;
116
+ }
117
+
118
+ /*
119
+ * Check whether comments have been disabled on a given post type.
120
+ */
121
+ private function is_post_type_disabled( $type ) {
122
+ return in_array( $type, $this->get_disabled_post_types() );
123
+ }
124
+
125
+ private function init_filters() {
126
+ // These need to happen now
127
  if( $this->options['remove_everywhere'] ) {
128
  add_action( 'widgets_init', array( $this, 'disable_rc_widget' ) );
129
  add_filter( 'wp_headers', array( $this, 'filter_wp_headers' ) );
134
  add_action( 'admin_init', array( $this, 'filter_admin_bar' ) );
135
  }
136
 
137
+ // These can happen later
138
+ add_action( 'wp_loaded', array( $this, 'init_wploaded_filters' ) );
139
  }
140
 
141
+ public function init_wploaded_filters(){
 
 
 
 
 
 
 
142
  $disabled_post_types = $this->get_disabled_post_types();
143
  if( !empty( $disabled_post_types ) ) {
144
  foreach( $disabled_post_types as $type ) {
191
  }
192
  }
193
 
194
+ /*
195
+ * Replace the theme's comment template with a blank one.
196
+ * To prevent this, define DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE
197
+ * and set it to True
198
+ */
199
+ public function check_comment_template() {
200
  if( is_singular() && ( $this->options['remove_everywhere'] || $this->is_post_type_disabled( get_post_type() ) ) ) {
201
  if( !defined( 'DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE' ) || DISABLE_COMMENTS_REMOVE_COMMENTS_TEMPLATE == true ) {
202
+ // Kill the comments template.
203
  add_filter( 'comments_template', array( $this, 'dummy_comments_template' ), 20 );
204
  }
205
  // Remove comment-reply script for themes that include it indiscriminately
209
  }
210
  }
211
 
212
+ public function dummy_comments_template() {
213
+ return dirname( __FILE__ ) . '/includes/comments-template.php';
214
  }
215
 
216
+
217
+ /*
218
+ * Remove the X-Pingback HTTP header
219
+ */
220
+ public function filter_wp_headers( $headers ) {
221
  unset( $headers['X-Pingback'] );
222
  return $headers;
223
  }
224
 
225
+ /*
226
+ * Issue a 403 for all comment feed requests.
227
+ */
228
+ public function filter_query() {
229
  if( is_comment_feed() ) {
 
230
  wp_die( __( 'Comments are closed.' ), '', array( 'response' => 403 ) );
231
  }
232
  }
233
 
234
+ /*
235
+ * Remove comment links from the admin bar.
236
+ */
237
+ public function filter_admin_bar() {
238
  if( is_admin_bar_showing() ) {
239
  // Remove comments links from admin bar
240
  remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 ); // WP<3.3
241
  remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); // WP 3.3
242
+ if( is_multisite() ) {
243
  add_action( 'admin_bar_menu', array( $this, 'remove_network_comment_links' ), 500 );
244
+ }
245
  }
246
  }
247
 
248
+ /*
249
+ * Remove comment links from the admin bar in a multisite network.
250
+ */
251
+ public function remove_network_comment_links( $wp_admin_bar ) {
252
  if( $this->networkactive ) {
253
  foreach( (array) $wp_admin_bar->user->blogs as $blog )
254
  $wp_admin_bar->remove_menu( 'blog-' . $blog->userblog_id . '-c' );
259
  }
260
  }
261
 
262
+ public function edit_form_inputs() {
263
  global $post;
264
  // Without a dicussion meta box, comment_status will be set to closed on new/updated posts
265
  if( in_array( $post->post_type, $this->modified_types ) ) {
267
  }
268
  }
269
 
270
+ public function discussion_notice(){
271
  $disabled_post_types = $this->get_disabled_post_types();
272
  if( get_current_screen()->id == 'options-discussion' && !empty( $disabled_post_types ) ) {
273
  $names = array();
291
  return add_query_arg( 'page', 'disable_comments_settings', $base );
292
  }
293
 
294
+ public function setup_notice(){
295
  if( strpos( get_current_screen()->id, 'settings_page_disable_comments_settings' ) === 0 )
296
  return;
297
  $hascaps = $this->networkactive ? is_network_admin() && current_user_can( 'manage_network_plugins' ) : current_user_can( 'manage_options' );
298
+ if( $hascaps ) {
299
  echo '<div class="updated fade"><p>' . sprintf( __( 'The <em>Disable Comments</em> 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>';
300
+ }
301
  }
302
 
303
+ public function filter_admin_menu(){
304
  global $pagenow;
305
 
306
  if ( $pagenow == 'comment.php' || $pagenow == 'edit-comments.php' || $pagenow == 'options-discussion.php' )
310
  remove_submenu_page( 'options-general.php', 'options-discussion.php' );
311
  }
312
 
313
+ public function filter_dashboard(){
314
  remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );
315
  }
316
 
317
+ public function hide_dashboard_bits(){
318
  if( 'dashboard' == get_current_screen()->id )
319
  add_action( 'admin_print_footer_scripts', array( $this, 'dashboard_js' ) );
320
  }
321
 
322
+ public function dashboard_js(){
323
  if( version_compare( $GLOBALS['wp_version'], '3.8', '<' ) ) {
324
  // getting hold of the discussion box is tricky. The table_discussion class is used for other things in multisite
325
  echo '<script> jQuery(function($){ $("#dashboard_right_now .table_discussion").has(\'a[href="edit-comments.php"]\').first().hide(); }); </script>';
329
  }
330
  }
331
 
332
+ public function filter_comment_status( $open, $post_id ) {
333
  $post = get_post( $post_id );
334
  return ( $this->options['remove_everywhere'] || $this->is_post_type_disabled( $post->post_type ) ) ? false : $open;
335
  }
336
 
337
+ public function disable_rc_widget() {
338
  // This widget has been removed from the Dashboard in WP 3.8 and can be removed in a future version
339
  unregister_widget( 'WP_Widget_Recent_Comments' );
340
  }
341
 
342
+ public function set_plugin_meta( $links, $file ) {
343
  static $plugin;
344
  $plugin = plugin_basename( __FILE__ );
345
  if ( $file == $plugin ) {
351
  /**
352
  * Add links to Settings page
353
  */
354
+ public function plugin_actions_links( $links, $file ) {
355
  static $plugin;
356
  $plugin = plugin_basename( __FILE__ );
357
  if( $file == $plugin && current_user_can('manage_options') ) {
364
  return $links;
365
  }
366
 
367
+ public function settings_menu() {
368
  $title = __( 'Disable Comments', 'disable-comments' );
369
  if( $this->networkactive )
370
  add_submenu_page( 'settings.php', $title, $title, 'manage_network_plugins', 'disable_comments_settings', array( $this, 'settings_page' ) );
372
  add_submenu_page( 'options-general.php', $title, $title, 'manage_options', 'disable_comments_settings', array( $this, 'settings_page' ) );
373
  }
374
 
375
+ public function settings_page() {
376
+ include dirname( __FILE__ ) . '/includes/settings-page.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  }
378
 
379
  private function enter_permanent_mode() {
412
  return apply_filters( 'disable_comments_allow_persistent_mode', true );
413
  }
414
 
415
+ public function single_site_deactivate() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  // for single sites, delete the options upon deactivation, not uninstall
417
  delete_option( 'disable_comments_options' );
418
  }
419
  }
420
 
421
+ Disable_Comments::get_instance();
comments-template.php → includes/comments-template.php RENAMED
File without changes
includes/settings-page.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( !defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ $typeargs = array( 'public' => true );
7
+ if( $this->networkactive ) {
8
+ $typeargs['_builtin'] = true; // stick to known types for network
9
+ }
10
+ $types = get_post_types( $typeargs, 'objects' );
11
+ foreach( array_keys( $types ) as $type ) {
12
+ if( ! in_array( $type, $this->modified_types ) && ! post_type_supports( $type, 'comments' ) ) // the type doesn't support comments anyway
13
+ unset( $types[$type] );
14
+ }
15
+
16
+ $persistent_allowed = $this->persistent_mode_allowed();
17
+
18
+ if ( isset( $_POST['submit'] ) ) {
19
+ check_admin_referer( 'disable-comments-admin' );
20
+ $this->options['remove_everywhere'] = ( $_POST['mode'] == 'remove_everywhere' );
21
+
22
+ if( $this->options['remove_everywhere'] )
23
+ $disabled_post_types = array_keys( $types );
24
+ else
25
+ $disabled_post_types = empty( $_POST['disabled_types'] ) ? array() : (array) $_POST['disabled_types'];
26
+
27
+ $disabled_post_types = array_intersect( $disabled_post_types, array_keys( $types ) );
28
+
29
+ // entering permanent mode, or post types have changed
30
+ if( $persistent_allowed && !empty( $_POST['permanent'] ) && ( !$this->options['permanent'] || $disabled_post_types != $this->options['disabled_post_types'] ) )
31
+ $this->enter_permanent_mode();
32
+
33
+ $this->options['disabled_post_types'] = $disabled_post_types;
34
+ $this->options['permanent'] = $persistent_allowed && isset( $_POST['permanent'] );
35
+
36
+ // Extra custom post types
37
+ if( $this->networkactive && !empty( $_POST['extra_post_types'] ) ) {
38
+ $extra_post_types = array_filter( array_map( 'sanitize_key', explode( ',', $_POST['extra_post_types'] ) ) );
39
+ $this->options['extra_post_types'] = array_diff( $extra_post_types, array_keys( $types ) ); // Make sure we don't double up builtins
40
+ }
41
+
42
+ $this->update_options();
43
+ $cache_message = WP_CACHE ? ' <strong>' . __( 'If a caching/performance plugin is active, please invalidate its cache to ensure that changes are reflected immediately.' ) . '</strong>' : '';
44
+ echo '<div id="message" class="updated"><p>' . __( 'Options updated. Changes to the Admin Menu and Admin Bar will not appear until you leave or reload this page.', 'disable-comments' ) . $cache_message . '</p></div>';
45
+ }
46
+ ?>
47
+ <style> .indent {padding-left: 2em} </style>
48
+ <div class="wrap">
49
+ <h1><?php _e( 'Disable Comments', 'disable-comments') ?></h1>
50
+ <?php
51
+ if( $this->networkactive )
52
+ echo '<div class="updated"><p>' . __( '<em>Disable Comments</em> is Network Activated. The settings below will affect <strong>all sites</strong> in this network.', 'disable-comments') . '</p></div>';
53
+ if( WP_CACHE )
54
+ echo '<div class="updated"><p>' . __( "It seems that a caching/performance plugin is active on this site. Please manually invalidate that plugin's cache after making any changes to the settings below.", 'disable-comments') . '</p></div>';
55
+ ?>
56
+ <form action="" method="post" id="disable-comments">
57
+ <ul>
58
+ <li><label for="remove_everywhere"><input type="radio" id="remove_everywhere" name="mode" value="remove_everywhere" <?php checked( $this->options['remove_everywhere'] );?> /> <strong><?php _e( 'Everywhere', 'disable-comments') ?></strong>: <?php _e( 'Disable all comment-related controls and settings in WordPress.', 'disable-comments') ?></label>
59
+ <p class="indent"><?php printf( __( '%s: This option is global and will affect your entire site. Use it only if you want to disable comments <em>everywhere</em>. A complete description of what this option does is <a href="%s" target="_blank">available here</a>.', 'disable-comments' ), '<strong style="color: #900">' . __('Warning', 'disable-comments') . '</strong>', 'http://wordpress.org/extend/plugins/disable-comments/other_notes/' ); ?></p>
60
+ </li>
61
+ <li><label for="selected_types"><input type="radio" id="selected_types" name="mode" value="selected_types" <?php checked( ! $this->options['remove_everywhere'] );?> /> <strong><?php _e( 'On certain post types', 'disable-comments') ?></strong>:</label>
62
+ <p></p>
63
+ <ul class="indent" id="listoftypes">
64
+ <?php foreach( $types as $k => $v ) echo "<li><label for='post-type-$k'><input type='checkbox' name='disabled_types[]' value='$k' ". checked( in_array( $k, $this->options['disabled_post_types'] ), true, false ) ." id='post-type-$k'> {$v->labels->name}</label></li>";?>
65
+ </ul>
66
+ <?php if( $this->networkactive ) :?>
67
+ <p class="indent" 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' ); ?>
68
+ <br /><label>Custom post types: <input type="text" name="extra_post_types" size="30" value="<?php echo implode( ', ', (array) $this->options['extra_post_types'] ); ?>" /></label></p>
69
+ <?php endif; ?>
70
+ <p class="indent"><?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.', 'disable-comments') ?></p>
71
+ </li>
72
+ </ul>
73
+
74
+ <?php if( $persistent_allowed ): ?>
75
+ <h2><?php _e( 'Other options', 'disable-comments') ?></h2>
76
+ <ul>
77
+ <li>
78
+ <?php
79
+ echo '<label for="permanent"><input type="checkbox" name="permanent" id="permanent" '. checked( $this->options['permanent'], true, false ) . '> <strong>' . __( 'Use persistent mode', 'disable-comments') . '</strong></label>';
80
+ echo '<p class="indent">' . sprintf( __( '%s: <strong>This will make persistent changes to your database &mdash; comments will remain closed even if you later disable the plugin!</strong> You should not use it if you only want to disable comments temporarily. Please <a href="%s" target="_blank">read the FAQ</a> before selecting this option.', 'disable-comments'), '<strong style="color: #900">' . __('Warning', 'disable-comments') . '</strong>', 'http://wordpress.org/extend/plugins/disable-comments/faq/' ) . '</p>';
81
+ if( $this->networkactive )
82
+ echo '<p class="indent">' . sprintf( __( '%s: Entering persistent mode on large multi-site networks requires a large number of database queries and can take a while. Use with caution!', 'disable-comments'), '<strong style="color: #900">' . __('Warning', 'disable-comments') . '</strong>' ) . '</p>';
83
+ ?>
84
+ </li>
85
+ </ul>
86
+ <?php endif; ?>
87
+
88
+ <?php wp_nonce_field( 'disable-comments-admin' ); ?>
89
+ <p class="submit"><input class="button-primary" type="submit" name="submit" value="<?php _e( 'Save Changes') ?>"></p>
90
+ </form>
91
+ </div>
92
+ <script>
93
+ jQuery(document).ready(function($){
94
+ function disable_comments_uihelper(){
95
+ var indiv_bits = $("#listoftypes, #extratypes");
96
+ if( $("#remove_everywhere").is(":checked") )
97
+ indiv_bits.css("color", "#888").find(":input").attr("disabled", true );
98
+ else
99
+ indiv_bits.css("color", "#000").find(":input").attr("disabled", false );
100
+ }
101
+
102
+ $("#disable-comments :input").change(function(){
103
+ $("#message").slideUp();
104
+ disable_comments_uihelper();
105
+ });
106
+
107
+ disable_comments_uihelper();
108
+
109
+ $("#permanent").change( function() {
110
+ if( $(this).is(":checked") && ! confirm(<?php echo json_encode( sprintf( __( '%s: Selecting this option will make persistent changes to your database. Are you sure you want to enable it?', 'disable-comments'), __( 'Warning', 'disable-comments' ) ) );?>) )
111
+ $(this).attr("checked", false );
112
+ });
113
+ });
114
+ </script>
languages/disable-comments-pl_PL.mo ADDED
Binary file
languages/disable-comments-pl_PL.po ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 Disable Comments
2
+ # This file is distributed under the same license as the Disable Comments package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Disable Comments 1.2\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/disable-comments\n"
7
+ "POT-Creation-Date: 2015-02-03 08:04:31+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-04-30 22:12+0100\n"
12
+ "Last-Translator: Maciej Gryniuk <maciejka45@gmail.com>\n"
13
+ "Language-Team: Maciej Gryniuk <maciejka45@gmail.com>\n"
14
+ "X-Generator: Poedit 1.8beta1\n"
15
+ "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || "
16
+ "n%100>=20) ? 1 : 2);\n"
17
+ "Language: pl_PL\n"
18
+ "X-Poedit-SourceCharset: UTF-8\n"
19
+
20
+ #: disable-comments.php:38
21
+ msgid "Disable Comments requires WordPress version %s or greater."
22
+ msgstr "Wyłączenie Komentarzy wymaga WordPress'a w wersji %s lub nowszej."
23
+
24
+ #: disable-comments.php:210
25
+ msgid ""
26
+ "Note: The <em>Disable Comments</em> plugin is currently active, and comments "
27
+ "are completely disabled on: %s. Many of the settings below will not be "
28
+ "applicable for those post types."
29
+ msgstr ""
30
+ "Informacja: Wtyczka <em>Wyłączenie Komentarzy</em> jest aktywna, a komentarze "
31
+ "są całkowicie wyłączone na: %s. Większość poniższych ustawień nie będzie miała "
32
+ "wpływu na te rodzaje wpisów."
33
+
34
+ #: disable-comments.php:210
35
+ msgid ", "
36
+ msgstr ", "
37
+
38
+ #: disable-comments.php:230
39
+ msgid ""
40
+ "The <em>Disable Comments</em> plugin is active, but isn't configured to do "
41
+ "anything yet. Visit the <a href=\"%s\">configuration page</a> to choose which "
42
+ "post types to disable comments on."
43
+ msgstr ""
44
+ "Wtyczka <em>Wyłączenie Komentarzy</em> jest aktywna, ale nie została jeszcze "
45
+ "skonfigurowana. Odwiedź <a href=\"%s\">stronę konfiguracji</a> i wybierz "
46
+ "rodzaje wpisów do wyłączenia na nich komentarzy."
47
+
48
+ #: disable-comments.php:237
49
+ msgid "Comments are closed."
50
+ msgstr "Komentarze są wyłączone."
51
+
52
+ #: disable-comments.php:290
53
+ msgid "Settings"
54
+ msgstr "Ustawienia"
55
+
56
+ #. Plugin Name of the plugin/theme
57
+ #: disable-comments.php:298 disable-comments.php:350
58
+ msgid "Disable Comments"
59
+ msgstr "Wyłączenie komentarzy"
60
+
61
+ #: disable-comments.php:343
62
+ msgid ""
63
+ "If a caching/performance plugin is active, please invalidate its cache to "
64
+ "ensure that changes are reflected immediately."
65
+ msgstr ""
66
+ "Jeżeli jest aktywna wtyczka pamięci podręcznej/wydajnościowa, proszę unieważnić "
67
+ "jej podręczną, aby zmiany weszły w życie natychmiatowo."
68
+
69
+ #: disable-comments.php:344
70
+ msgid ""
71
+ "Options updated. Changes to the Admin Menu and Admin Bar will not appear until "
72
+ "you leave or reload this page."
73
+ msgstr ""
74
+ "Opcje zaktualizowane. Zmiany w menu panelu administracyjnego i na pasku "
75
+ "administracyjnym będą widoczne po opuszczeniu lub przeładowaniu tej strony."
76
+
77
+ #: disable-comments.php:353
78
+ msgid ""
79
+ "<em>Disable Comments</em> is Network Activated. The settings below will affect "
80
+ "<strong>all sites</strong> in this network."
81
+ msgstr ""
82
+ "<em>Wyłączenie Komentarzy</em> jest aktywne w sieci. Poniższe ustawienia "
83
+ "zostaną zastosowane na <strong>wszystkich stronach</strong> w tej sieci."
84
+
85
+ #: disable-comments.php:355
86
+ msgid ""
87
+ "It seems that a caching/performance plugin is active on this site. Please "
88
+ "manually invalidate that plugin's cache after making any changes to the "
89
+ "settings below."
90
+ msgstr ""
91
+ "Wygląda na to, że na stronie jest aktywna wtyczka pamięci podręcznej/"
92
+ "wydajnościowa. Proszę ręcznie unieważnić jej podręczną po dokonaniu "
93
+ "jakichkolwiek zmian poniżej."
94
+
95
+ #: disable-comments.php:359
96
+ msgid "Everywhere"
97
+ msgstr "Wszędzie"
98
+
99
+ #: disable-comments.php:359
100
+ msgid "Disable all comment-related controls and settings in WordPress."
101
+ msgstr ""
102
+ "Wyłącz wszystkie opcje i ustawienia powiązane z komentarzami w WordPress'ie."
103
+
104
+ #: disable-comments.php:360
105
+ msgid ""
106
+ "%s: This option is global and will affect your entire site. Use it only if you "
107
+ "want to disable comments <em>everywhere</em>. A complete description of what "
108
+ "this option does is <a href=\"%s\" target=\"_blank\">available here</a>."
109
+ msgstr ""
110
+ "%s: Ta opcja jest globalna i zostanie zastosowana na całej stronie. Użyj jej, "
111
+ "tylko gdy chcesz wyłączyć komentarze <em>wszędzie</em>. Pełny opis działania "
112
+ "tej opcji jest <a href=\"%s\" target=\"_blank\">dostępny tutaj</a>."
113
+
114
+ #: disable-comments.php:360 disable-comments.php:380 disable-comments.php:382
115
+ #: disable-comments.php:409
116
+ msgid "Warning"
117
+ msgstr "Ostrzeżenie"
118
+
119
+ #: disable-comments.php:362
120
+ msgid "On certain post types"
121
+ msgstr "Na wybranych rodzajach wpisów"
122
+
123
+ #: disable-comments.php:368
124
+ msgid ""
125
+ "Only the built-in post types appear above. If you want to disable comments on "
126
+ "other custom post types on the entire network, you can supply a comma-separated "
127
+ "list of post types below (use the slug that identifies the post type)."
128
+ msgstr ""
129
+ "Powyżej są wyświetlone tylko wbudowane rodzaje wpisów. Jeżeli chcesz wyłączyć "
130
+ "komentarze na własnym rodzaju wpisów w całej sieci, możesz poniżej podać ich "
131
+ "nazwy (slug identyfikujący), oddzielone przecinkami."
132
+
133
+ #: disable-comments.php:371
134
+ msgid ""
135
+ "Disabling comments will also disable trackbacks and pingbacks. All comment-"
136
+ "related fields will also be hidden from the edit/quick-edit screens of the "
137
+ "affected posts. These settings cannot be overridden for individual posts."
138
+ msgstr ""
139
+ "Wyłączenie komentarzy wyłączy również pingbacki i trackbacki. Wszystkie pola "
140
+ "powiązane z komentarzami zostaną ukryte z ekranów edycji i szybkiej edycji "
141
+ "odpowiednich wpisów. Te ustawienia nie mogą zostać nadpisane dla pojedynczych "
142
+ "wpisów."
143
+
144
+ #: disable-comments.php:374
145
+ msgid "Other options"
146
+ msgstr "Pozostałe opcje"
147
+
148
+ #: disable-comments.php:379
149
+ msgid "Use persistent mode"
150
+ msgstr "Użyj trybu trwałego"
151
+
152
+ #: disable-comments.php:380
153
+ msgid ""
154
+ "%s: <strong>This will make persistent changes to your database &mdash; comments "
155
+ "will remain closed even if you later disable the plugin!</strong> You should "
156
+ "not use it if you only want to disable comments temporarily. Please <a href=\"%s"
157
+ "\" target=\"_blank\">read the FAQ</a> before selecting this option."
158
+ msgstr ""
159
+ "%s: <strong>Ta opcja dokona trwałych zmian w w Twojej bazie danych &mdash; "
160
+ "komentarze pozostaną wyłączone, nawet gdy wyłączysz wtyczkę!</strong> Nie "
161
+ "powinno być wybierane do tymczasowego wyłączania komentarzy. Proszę <a href=\"%s"
162
+ "\" target=\"_blank\">przeczytać FAQ</a> przed wyborem tej opcji."
163
+
164
+ #: disable-comments.php:382
165
+ msgid ""
166
+ "%s: Entering persistent mode on large multi-site networks requires a large "
167
+ "number of database queries and can take a while. Use with caution!"
168
+ msgstr ""
169
+ "%s: Wejście z tryb trwały na dużych sieciach multi-witryn wymaga dużej ilości "
170
+ "zapytań do bazy danych, a więc może to trochę potrwać. Używać z ostrożnością!"
171
+
172
+ #: disable-comments.php:388
173
+ msgid "Save Changes"
174
+ msgstr "Zapisz zmiany"
175
+
176
+ #: disable-comments.php:409
177
+ msgid ""
178
+ "%s: Selecting this option will make persistent changes to your database. Are "
179
+ "you sure you want to enable it?"
180
+ msgstr ""
181
+ "%s: Ta opcja dokona stałych zmian w Twojej bazie danych. Na pewno chcesz ją "
182
+ "aktywować?"
183
+
184
+ #. Plugin URI of the plugin/theme
185
+ msgid "http://wordpress.org/extend/plugins/disable-comments/"
186
+ msgstr "http://wordpress.org/extend/plugins/disable-comments/"
187
+
188
+ #. Description of the plugin/theme
189
+ msgid ""
190
+ "Allows administrators to globally disable comments on their site. Comments can "
191
+ "be disabled according to post type."
192
+ msgstr ""
193
+ "Umożliwia administratorom możliwość globalnego wyłączenia komentarzy na stronie "
194
+ "internetowej. Komentarze mogą zostać wyłączone odpowiednio dla różnych rodzajów "
195
+ "wpisów."
196
+
197
+ #. Author of the plugin/theme
198
+ msgid "Samir Shah"
199
+ msgstr "Samir Shah"
200
+
201
+ #. Author URI of the plugin/theme
202
+ msgid "http://rayofsolaris.net/"
203
+ msgstr "http://rayofsolaris.net/"
languages/disable-comments-pt_BR.mo ADDED
Binary file
languages/disable-comments-pt_BR.po ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 Disable Comments
2
+ # This file is distributed under the same license as the Disable Comments package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Disable Comments 1.2\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/disable-comments\n"
7
+ "POT-Creation-Date: 2015-02-03 08:04:31+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-05-22 18:39+0100\n"
12
+ "Last-Translator: freemp\n"
13
+ "Language-Team: \n"
14
+ "X-Generator: Poedit 1.5.7\n"
15
+
16
+ #: disable-comments.php:38
17
+ msgid "Disable Comments requires WordPress version %s or greater."
18
+ msgstr "Disable Comments necessita do WordPress versão %s ou superior."
19
+
20
+ #: disable-comments.php:210
21
+ msgid ""
22
+ "Note: The <em>Disable Comments</em> plugin is currently active, and comments "
23
+ "are completely disabled on: %s. Many of the settings below will not be "
24
+ "applicable for those post types."
25
+ msgstr ""
26
+ "Nota: No momento, o plugin <em>Disable Comments</em> está ativado e os "
27
+ "comentários estão completamente desativados no: %s. Algumas das opções de "
28
+ "configuração abaixo não serão aplicáveis para estes tipos de notícias."
29
+
30
+ #: disable-comments.php:210
31
+ msgid ", "
32
+ msgstr ","
33
+
34
+ #: disable-comments.php:230
35
+ msgid ""
36
+ "The <em>Disable Comments</em> plugin is active, but isn't configured to do "
37
+ "anything yet. Visit the <a href=\"%s\">configuration page</a> to choose "
38
+ "which post types to disable comments on."
39
+ msgstr ""
40
+ "O plugin <em>Disable Comments</em> está ativado, mais até o momento nenhuma "
41
+ "função foi configurada. Visite a <a href=\"%s\">pagina de configuração</a> "
42
+ "para escolher os tipos de notícias, nas quais os comentários serão "
43
+ "desativados."
44
+
45
+ #: disable-comments.php:237
46
+ msgid "Comments are closed."
47
+ msgstr "Comentários estão fechados."
48
+
49
+ #: disable-comments.php:290
50
+ msgid "Settings"
51
+ msgstr "Configurações"
52
+
53
+ #. #-#-#-#-# disable-comments.pot (Disable Comments 1.2) #-#-#-#-#
54
+ #. Plugin Name of the plugin/theme
55
+ #: disable-comments.php:298 disable-comments.php:350
56
+ msgid "Disable Comments"
57
+ msgstr "Desativar Comentários"
58
+
59
+ #: disable-comments.php:343
60
+ msgid ""
61
+ "If a caching/performance plugin is active, please invalidate its cache to "
62
+ "ensure that changes are reflected immediately."
63
+ msgstr ""
64
+ "Se um plugin de cacheamento/performance estiver ativado, por favor "
65
+ "desconsiderar seu cache para certificar que futuros alterações sejam "
66
+ "consideradas."
67
+
68
+ #: disable-comments.php:344
69
+ msgid ""
70
+ "Options updated. Changes to the Admin Menu and Admin Bar will not appear "
71
+ "until you leave or reload this page."
72
+ msgstr ""
73
+ "Opções atualizadas. Alterações no Menu Admin e na Barra Admin não aparecerão "
74
+ "até você deixar ou recarregar esta página."
75
+
76
+ #: disable-comments.php:353
77
+ msgid ""
78
+ "<em>Disable Comments</em> is Network Activated. The settings below will "
79
+ "affect <strong>all sites</strong> in this network."
80
+ msgstr ""
81
+ "<em>Disable Comments</em> está Ativada Na Rede. As configurações abaixo "
82
+ "afetarão <strong>todos os sites</strong> nesta rede."
83
+
84
+ #: disable-comments.php:355
85
+ msgid ""
86
+ "It seems that a caching/performance plugin is active on this site. Please "
87
+ "manually invalidate that plugin's cache after making any changes to the "
88
+ "settings below."
89
+ msgstr ""
90
+ "Aparentemente um plugin de cacheamento/performance está ativado neste site. "
91
+ "Por favor desconsiderar o cache desse plugin depois de alterar qualquer "
92
+ "configuração abaixo."
93
+
94
+ #: disable-comments.php:359
95
+ msgid "Everywhere"
96
+ msgstr "Em todo lugar"
97
+
98
+ #: disable-comments.php:359
99
+ msgid "Disable all comment-related controls and settings in WordPress."
100
+ msgstr ""
101
+ "Desativar todos os controles e configurações dos comentários relacionados no "
102
+ "WordPress."
103
+
104
+ #: disable-comments.php:360
105
+ msgid ""
106
+ "%s: This option is global and will affect your entire site. Use it only if "
107
+ "you want to disable comments <em>everywhere</em>. A complete description of "
108
+ "what this option does is <a href=\"%s\" target=\"_blank\">available here</a>."
109
+ msgstr ""
110
+ "%s: Esta opção é global e vai afetar o site inteiro. Utilize-o somente caso "
111
+ "você queira desativar os comentários <em>em todo site</em>. Uma descrição "
112
+ "completa do que esta opção faz está <a href=\"%s\" target=\"_blank"
113
+ "\">disponível aqui</a>."
114
+
115
+ #: disable-comments.php:360 disable-comments.php:380 disable-comments.php:382
116
+ #: disable-comments.php:409
117
+ msgid "Warning"
118
+ msgstr "Aviso"
119
+
120
+ #: disable-comments.php:362
121
+ msgid "On certain post types"
122
+ msgstr "Para tipos de notícias específicas"
123
+
124
+ #: disable-comments.php:368
125
+ msgid ""
126
+ "Only the built-in post types appear above. If you want to disable comments "
127
+ "on other custom post types on the entire network, you can supply a comma-"
128
+ "separated list of post types below (use the slug that identifies the post "
129
+ "type)."
130
+ msgstr ""
131
+ "Apenas os tipos de notícias instaladas aparecem acima. Se você desejar "
132
+ "desativar os comentários de outros tipos de notícias em toda rede, você "
133
+ "deverá fornecer uma lista abaixo com os tipos de notícias separadas por "
134
+ "vírgulas (use o slug que identifique o tipo de notícia)."
135
+
136
+ #: disable-comments.php:371
137
+ msgid ""
138
+ "Disabling comments will also disable trackbacks and pingbacks. All comment-"
139
+ "related fields will also be hidden from the edit/quick-edit screens of the "
140
+ "affected posts. These settings cannot be overridden for individual posts."
141
+ msgstr ""
142
+ "Desabilitando os comentários, você desabilitará também os trackbacks e "
143
+ "pingbacks. Todos os campos relacionados com comentários serão ocultados das "
144
+ "telas de edição e edição rápida das notícias afetadas. Estes parâmetros não "
145
+ "podem ser sobrescritos para notícias individuais."
146
+
147
+ #: disable-comments.php:374
148
+ msgid "Other options"
149
+ msgstr "Outras opções"
150
+
151
+ #: disable-comments.php:379
152
+ msgid "Use persistent mode"
153
+ msgstr "Usar modo persistente"
154
+
155
+ #: disable-comments.php:380
156
+ msgid ""
157
+ "%s: <strong>This will make persistent changes to your database &mdash; "
158
+ "comments will remain closed even if you later disable the plugin!</strong> "
159
+ "You should not use it if you only want to disable comments temporarily. "
160
+ "Please <a href=\"%s\" target=\"_blank\">read the FAQ</a> before selecting "
161
+ "this option."
162
+ msgstr ""
163
+ "%s: <strong>Este fará alterações permanentes em seu banco de dados &mdash; "
164
+ "os comentários permanecerão fechados mesmo que você desative este plugin "
165
+ "depois! Nao utilize esta opção, caso deseje desabilitar os comentários "
166
+ "temporariamente. Por favor, <a href=\"%s\" target=\"_blank\">consulta as "
167
+ "perguntas frequentes</a> antes de selecionar esta opção."
168
+
169
+ #: disable-comments.php:382
170
+ msgid ""
171
+ "%s: Entering persistent mode on large multi-site networks requires a large "
172
+ "number of database queries and can take a while. Use with caution!"
173
+ msgstr ""
174
+ "%s: Entrando no modo persistente de uma vasta rede de sites múltiplos exige "
175
+ "uma ampla quantidade de consultas no banco de dados e pode levar algum "
176
+ "tempo. Use com cuidado!"
177
+
178
+ #: disable-comments.php:388
179
+ msgid "Save Changes"
180
+ msgstr "Salvar Alterações"
181
+
182
+ #: disable-comments.php:409
183
+ msgid ""
184
+ "%s: Selecting this option will make persistent changes to your database. Are "
185
+ "you sure you want to enable it?"
186
+ msgstr ""
187
+ "%s: Ao selecionar esta opção ocorrerão alterações persistentes no seu banco "
188
+ "de dados. Você tem certeza que deseja ativar esta opção?"
189
+
190
+ #. Plugin URI of the plugin/theme
191
+ msgid "http://wordpress.org/extend/plugins/disable-comments/"
192
+ msgstr "http://wordpress.org/extend/plugins/disable-comments/"
193
+
194
+ #. Description of the plugin/theme
195
+ msgid ""
196
+ "Allows administrators to globally disable comments on their site. Comments "
197
+ "can be disabled according to post type."
198
+ msgstr ""
199
+ "Permite administradores desativar comentários nos seus sites. Comentários "
200
+ "poderão ser desativados de acordo com o tipo de notícia."
201
+
202
+ #. Author of the plugin/theme
203
+ msgid "Samir Shah"
204
+ msgstr "Samir Shah"
205
+
206
+ #. Author URI of the plugin/theme
207
+ msgid "http://rayofsolaris.net/"
208
+ msgstr "http://rayofsolaris.net/"
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Disable Comments ===
2
  Contributors: solarissmoke
3
- Donate link: http://rayofsolaris.net/donate.php
4
  Tags: comments, disable, global
5
- Requires at least: 3.6
6
- Tested up to: 4.2
7
  Stable tag: trunk
8
 
9
  Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. Multisite friendly.
@@ -81,6 +81,10 @@ These definitions can be made either in your main `wp-config.php` or in your the
81
 
82
  == Changelog ==
83
 
 
 
 
 
84
  = 1.3.1 =
85
  * Change the behaviour for comment feed requests. This removes a potential security issue.
86
 
@@ -136,7 +140,7 @@ These definitions can be made either in your main `wp-config.php` or in your the
136
  * Now supports Network Activation - disable comments on your entire multi-site network.
137
  * Simplified settings page.
138
 
139
- = 0.6 =
140
  * Add "persistent mode" to deal with themes that don't use filterable comment status checking.
141
 
142
  = 0.5 =
1
  === Disable Comments ===
2
  Contributors: solarissmoke
3
+ Donate link: http://www.rayofsolaris.net/donate/
4
  Tags: comments, disable, global
5
+ Requires at least: 3.8
6
+ Tested up to: 4.3
7
  Stable tag: trunk
8
 
9
  Allows administrators to globally disable comments on their site. Comments can be disabled according to post type. Multisite friendly.
81
 
82
  == Changelog ==
83
 
84
+ = 1.3.2 =
85
+ * Compatibility updates and code refactoring for WordPress 4.3
86
+ * Adding a few new translations
87
+
88
  = 1.3.1 =
89
  * Change the behaviour for comment feed requests. This removes a potential security issue.
90
 
140
  * Now supports Network Activation - disable comments on your entire multi-site network.
141
  * Simplified settings page.
142
 
143
+ = 0.6 =
144
  * Add "persistent mode" to deal with themes that don't use filterable comment status checking.
145
 
146
  = 0.5 =