| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Webcraftic Disable Comments |
| 4 |
* Plugin URI: https://wordpress.org/plugins/comments-plus/ |
| 5 |
* Description: Allows administrators to globally disable comments on their site. Comments can be disabled for individual record types. |
| 6 |
* Author: Webcraftic <wordpress.webraftic@gmail.com> |
| 7 |
* Version: 1.0.9 |
| 8 |
* Text Domain: comments-plus |
| 9 |
* Domain Path: /languages/ |
| 10 |
* Author URI: https://clearfy.pro |
| 11 |
*/ |
| 12 |
|
| 13 |
// Exit if accessed directly |
| 14 |
if( !defined('ABSPATH') ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
if( defined('WCM_PLUGIN_ACTIVE') || (defined('WCL_PLUGIN_ACTIVE') && !defined('LOADING_COMMENTS_PLUS_AS_ADDON')) ) { |
| 19 |
function wbcr_cmp_admin_notice_error() |
| 20 |
{ |
| 21 |
?> |
| 22 |
<div class="notice notice-error"> |
| 23 |
<p><?php _e('We found that you have the "Clearfy - disable unused features" plugin installed, this plugin already has disable comments functions, so you can deactivate plugin "Disable comments"!'); ?></p> |
| 24 |
</div> |
| 25 |
<?php |
| 26 |
} |
| 27 |
|
| 28 |
add_action('admin_notices', 'wbcr_cmp_admin_notice_error'); |
| 29 |
|
| 30 |
return; |
| 31 |
} else { |
| 32 |
|
| 33 |
define('WCM_PLUGIN_ACTIVE', true); |
| 34 |
|
| 35 |
define('WCM_PLUGIN_DIR', dirname(__FILE__)); |
| 36 |
define('WCM_PLUGIN_BASE', plugin_basename(__FILE__)); |
| 37 |
define('WCM_PLUGIN_URL', plugins_url(null, __FILE__)); |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
if( !defined('LOADING_COMMENTS_PLUS_AS_ADDON') ) { |
| 42 |
require_once(WCM_PLUGIN_DIR . '/libs/factory/core/boot.php'); |
| 43 |
} |
| 44 |
|
| 45 |
require_once(WCM_PLUGIN_DIR . '/includes/class.plugin.php'); |
| 46 |
|
| 47 |
if( !defined('LOADING_COMMENTS_PLUS_AS_ADDON') ) { |
| 48 |
//todo: обновить опции в старом плагине на новый префикс |
| 49 |
new WCM_Plugin(__FILE__, array( |
| 50 |
'prefix' => 'wbcr_comments_plus_', // wbcr_cmp |
| 51 |
'plugin_name' => 'wbcr_comments_plus', |
| 52 |
'plugin_title' => __('Webcraftic Disable comments', 'comments-plus'), |
| 53 |
'plugin_version' => '1.0.9', |
| 54 |
'required_php_version' => '5.2', |
| 55 |
'required_wp_version' => '4.2', |
| 56 |
'plugin_build' => 'free', |
| 57 |
//'updates' => WCM_PLUGIN_DIR . '/updates/' |
| 58 |
)); |
| 59 |
} |
| 60 |
} |