PluginProbe
Disable Comments & Delete All Comments / 1.0.0
Disable Comments & Delete All Comments v1.0.0
1.3.3 1.3.2 trunk 1.0.0 1.0.4 1.0.5 1.0.8 1.0.9 1.1.1 1.1.3 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.3.0 1.3.1
comments-plus / comments-plus.php

comments-plus.php in Disable Comments & Delete All Comments 1.0.0, at comments-plus.php

87 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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.3
8 * Text Domain: comments-plus
9 * Domain Path: /languages/
10 */
11
12 if( defined('WBCR_CMP_PLUGIN_ACTIVE') || (defined('WBCR_CLEARFY_PLUGIN_ACTIVE') && !defined('LOADING_COMMENTS_PLUS_AS_ADDON')) ) {
13 function wbcr_cmp_admin_notice_error()
14 {
15 ?>
16 <div class="notice notice-error">
17 <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>
18 </div>
19 <?php
20 }
21
22 add_action('admin_notices', 'wbcr_cmp_admin_notice_error');
23
24 return;
25 } else {
26
27 define('WBCR_CMP_PLUGIN_ACTIVE', true);
28
29 define('WBCR_CMP_PLUGIN_DIR', dirname(__FILE__));
30 define('WBCR_CMP_PLUGIN_BASE', plugin_basename(__FILE__));
31 define('WBCR_CMP_PLUGIN_URL', plugins_url(null, __FILE__));
32
33
34
35 if( !defined('LOADING_COMMENTS_PLUS_AS_ADDON') ) {
36 require_once(WBCR_CMP_PLUGIN_DIR . '/libs/factory/core/boot.php');
37 }
38
39 function wbcr_cmp_plugin_init()
40 {
41 global $wbcr_comments_plus_plugin;
42
43 // Localization plugin
44 load_plugin_textdomain('comments-plus', false, dirname(WBCR_CMP_PLUGIN_BASE) . '/languages/');
45
46 if( defined('LOADING_COMMENTS_PLUS_AS_ADDON') ) {
47 //return;
48 global $wbcr_clearfy_plugin;
49 $wbcr_comments_plus_plugin = $wbcr_clearfy_plugin;
50 } else {
51
52 $wbcr_comments_plus_plugin = new Factory326_Plugin(__FILE__, array(
53 'name' => 'wbcr_comments_plus',
54 'title' => __('Webcraftic Disable comments', 'comments-plus'),
55 'version' => '1.0.3',
56 'host' => 'wordpress.org',
57 'url' => 'https://wordpress.org/plugins/comments-plus/',
58 'assembly' => 'free',
59 'updates' => WBCR_CMP_PLUGIN_DIR . '/updates/'
60 ));
61
62 // requires factory modules
63 $wbcr_comments_plus_plugin->load(array(
64 array('libs/factory/bootstrap', 'factory_bootstrap_330', 'admin'),
65 array('libs/factory/forms', 'factory_forms_329', 'admin'),
66 array('libs/factory/pages', 'factory_pages_322', 'admin'),
67 array('libs/factory/font-awesome', 'factory_pages_322', 'admin'),
68 array('libs/factory/clearfy', 'factory_clearfy_101', 'all')
69 ));
70 }
71
72 // loading other files
73 if( is_admin() ) {
74 require(WBCR_CMP_PLUGIN_DIR . '/admin/boot.php');
75 }
76
77 require(WBCR_CMP_PLUGIN_DIR . '/includes/classes/class.configurate-comments.php');
78
79 new WbcrCmp_ConfigComments($wbcr_comments_plus_plugin);
80 }
81
82 if( defined('LOADING_COMMENTS_PLUS_AS_ADDON') ) {
83 wbcr_cmp_plugin_init();
84 } else {
85 add_action('plugins_loaded', 'wbcr_cmp_plugin_init');
86 }
87 }