PluginProbe
Disable Comments & Delete All Comments / 1.1.1
Disable Comments & Delete All Comments v1.1.1
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.1.1, at comments-plus.php

135 lines 4.7 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://webcraftic.com
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.1.1
8 * Text Domain: comments-plus
9 * Domain Path: /languages/
10 * Author URI: https://webcraftic.com
11 * Framework Version: FACTORY_420_VERSION
12 */
13
14 // Exit if accessed directly
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * Developers who contributions in the development plugin:
21 *
22 * Alexander Kovalev
23 * ---------------------------------------------------------------------------------
24 * Full plugin development.
25 *
26 * Email: alex.kovalevv@gmail.com
27 * Personal card: https://alexkovalevv.github.io
28 * Personal repo: https://github.com/alexkovalevv
29 * ---------------------------------------------------------------------------------
30 */
31
32 /**
33 * -----------------------------------------------------------------------------
34 * CHECK REQUIREMENTS
35 * Check compatibility with php and wp version of the user's site. As well as checking
36 * compatibility with other plugins from Webcraftic.
37 * -----------------------------------------------------------------------------
38 */
39
40 require_once( dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php' );
41
42 // @formatter:off
43 $wcm_plugin_info = array(
44 'prefix' => 'wbcr_comments_plus_', // wbcr_cmp
45 'plugin_name' => 'wbcr_comments_plus',
46 'plugin_title' => __( 'Webcraftic Disable comments', 'comments-plus' ),
47
48 // PLUGIN SUPPORT
49 'support_details' => array(
50 'url' => 'https://webcraftic.com',
51 'pages_map' => array(
52 'support' => 'support', // {site}/support
53 'docs' => 'docs' // {site}/docs
54 )
55 ),
56
57 // PLUGIN ADVERTS
58 'render_adverts' => true,
59 'adverts_settings' => array(
60 'dashboard_widget' => true, // show dashboard widget (default: false)
61 'right_sidebar' => true, // show adverts sidebar (default: false)
62 'notice' => true, // show notice message (default: false)
63 ),
64
65 // FRAMEWORK MODULES
66 'load_factory_modules' => array(
67 array( 'libs/factory/bootstrap', 'factory_bootstrap_421', 'admin' ),
68 array( 'libs/factory/forms', 'factory_forms_418', 'admin' ),
69 array( 'libs/factory/pages', 'factory_pages_420', 'admin' ),
70 array( 'libs/factory/clearfy', 'factory_clearfy_212', 'all' ),
71 array( 'libs/factory/adverts', 'factory_adverts_102', 'admin')
72 )
73 );
74
75 $wcm_compatibility = new Wbcr_Factory420_Requirements( __FILE__, array_merge( $wcm_plugin_info, array(
76 'plugin_already_activate' => defined( 'WCM_PLUGIN_ACTIVE' ),
77 'required_php_version' => '5.4',
78 'required_wp_version' => '4.2.0',
79 'required_clearfy_check_component' => false
80 ) ) );
81
82
83 /**
84 * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
85 * and the user will throw a warning.
86 */
87 if ( ! $wcm_compatibility->check() ) {
88 return;
89 }
90
91 /**
92 * -----------------------------------------------------------------------------
93 * CONSTANTS
94 * Install frequently used constants and constants for debugging, which will be
95 * removed after compiling the plugin.
96 * -----------------------------------------------------------------------------
97 */
98
99 // This plugin is activated
100 define( 'WCM_PLUGIN_ACTIVE', true );
101 define( 'WCM_PLUGIN_VERSION', $wcm_compatibility->get_plugin_version() );
102 define( 'WCM_PLUGIN_DIR', dirname( __FILE__ ) );
103 define( 'WCM_PLUGIN_BASE', plugin_basename( __FILE__ ) );
104 define( 'WCM_PLUGIN_URL', plugins_url( null, __FILE__ ) );
105
106
107
108
109 /**
110 * -----------------------------------------------------------------------------
111 * PLUGIN INIT
112 * -----------------------------------------------------------------------------
113 */
114
115 require_once( WCM_PLUGIN_DIR . '/libs/factory/core/boot.php' );
116 require_once( WCM_PLUGIN_DIR . '/includes/class-plugin.php' );
117
118 try {
119 new WCM_Plugin( __FILE__, array_merge( $wcm_plugin_info, array(
120 'plugin_version' => WCM_PLUGIN_VERSION,
121 'plugin_text_domain' => $wcm_compatibility->get_text_domain(),
122 ) ) );
123 } catch( Exception $e ) {
124 // Plugin wasn't initialized due to an error
125 define( 'WCM_PLUGIN_THROW_ERROR', true );
126
127 $wcm_plugin_error_func = function () use ( $e ) {
128 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Webcraftic Disable Comments', $e->getMessage(), $e->getCode() );
129 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
130 };
131
132 add_action( 'admin_notices', $wcm_plugin_error_func );
133 add_action( 'network_admin_notices', $wcm_plugin_error_func );
134 }
135 // @formatter:on