PluginProbe
Disable Admin Notices – Hide Dashboard Notifications / 1.2.3
Disable Admin Notices – Hide Dashboard Notifications v1.2.3
1.4.7 1.4.6 1.4.5 trunk 1.0.0 1.0.2 1.0.3 1.0.5 1.0.6 1.1.1 1.1.3 1.1.4 1.2.0 1.2.2 1.2.3 1.2.4 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 All 30 releases
disable-admin-notices / disable-admin-notices.php
disable-admin-notices.php
153 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Disable Admin Notices Individually
4 * Plugin URI: https://webcraftic.com
5 * Description: Disable admin notices plugin gives you the option to hide updates warnings and inline notices in the admin panel.
6 * Author: Webcraftic <wordpress.webraftic@gmail.com>
7 * Version: 1.2.3
8 * Text Domain: disable-admin-notices
9 * Domain Path: /languages/
10 * Author URI: https://webcraftic.com
11 * Framework Version: FACTORY_432_VERSION
12 */
13
14 /**
15 * Developers who contributions in the development plugin:
16 *
17 * Alexander Kovalev
18 * ---------------------------------------------------------------------------------
19 * Full plugin development.
20 *
21 * Email: alex.kovalevv@gmail.com
22 * Personal card: https://alexkovalevv.github.io
23 * Personal repo: https://github.com/alexkovalevv
24 * ---------------------------------------------------------------------------------
25 */
26
27 // Exit if accessed directly
28 if ( ! defined( 'ABSPATH' ) ) {
29 exit;
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 $wdan_plugin_info = array(
44 'prefix' => 'wbcr_dan_',
45 'plugin_name' => 'wbcr_dan',
46 'plugin_title' => __( 'Webcraftic disable admin notices', 'disable-admin-notices' ),
47
48 // PLUGIN SUPPORT
49 'support_details' => array(
50 'url' => 'https://clearfy.pro/',
51 'pages_map' => array(
52 'support' => 'support', // {site}/support
53 'docs' => 'docs', // {site}/docs,
54 'pricing' => 'disable-admin-notices'
55 )
56 ),
57 // PLUGIN PREMIUM SETTINGS
58 'has_premium' => true,
59 'license_settings' => array(
60 'provider' => 'freemius',
61 'slug' => 'disable-admin-notices-premium',
62 'plugin_id' => '6456',
63 'public_key' => 'pk_0570ec3c1b4100b9c9a0cbfe80f9f',
64 'price' => 29,
65 'has_updates' => true,
66 'updates_settings' => array(
67 'maybe_rollback' => true,
68 'rollback_settings' => array(
69 'prev_stable_version' => '0.0.0'
70 )
71 )
72 ),
73 // PLUGIN ADVERTS
74 'render_adverts' => true,
75 'adverts_settings' => array(
76 'dashboard_widget' => false, // show dashboard widget (default: false)
77 'right_sidebar' => true, // show adverts sidebar (default: false)
78 'notice' => false, // show notice message (default: false)
79 ),
80
81 // FRAMEWORK MODULES
82 'load_factory_modules' => array(
83 array( 'libs/factory/bootstrap', 'factory_bootstrap_433', 'admin' ),
84 array( 'libs/factory/forms', 'factory_forms_430', 'admin' ),
85 array( 'libs/factory/pages', 'factory_pages_432', 'admin' ),
86 array( 'libs/factory/clearfy', 'factory_clearfy_224', 'all' ),
87 array( 'libs/factory/freemius', 'factory_freemius_120', 'all' ),
88 array( 'libs/factory/adverts', 'factory_adverts_112', 'admin' )
89 )
90 );
91
92 $wdan_compatibility = new Wbcr_Factory432_Requirements( __FILE__, array_merge( $wdan_plugin_info, array(
93 'plugin_already_activate' => defined( 'WDN_PLUGIN_ACTIVE' ),
94 'required_php_version' => '5.4',
95 'required_wp_version' => '4.2.0',
96 'required_clearfy_check_component' => false
97 ) ) );
98
99
100
101 /**
102 * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
103 * and the user will throw a warning.
104 */
105 if ( ! $wdan_compatibility->check() ) {
106 return;
107 }
108
109 /**
110 * -----------------------------------------------------------------------------
111 * CONSTANTS
112 * Install frequently used constants and constants for debugging, which will be
113 * removed after compiling the plugin.
114 * -----------------------------------------------------------------------------
115 */
116
117 // This plugin is activated
118 define( 'WDN_PLUGIN_ACTIVE', true );
119 define( 'WDN_PLUGIN_VERSION', $wdan_compatibility->get_plugin_version() );
120 define( 'WDN_PLUGIN_DIR', dirname( __FILE__ ) );
121 define( 'WDN_PLUGIN_BASE', plugin_basename( __FILE__ ) );
122 define( 'WDN_PLUGIN_URL', plugins_url( null, __FILE__ ) );
123
124
125
126 /**
127 * -----------------------------------------------------------------------------
128 * PLUGIN INIT
129 * -----------------------------------------------------------------------------
130 */
131
132 require_once( WDN_PLUGIN_DIR . '/libs/factory/core/boot.php' );
133 require_once( WDN_PLUGIN_DIR . '/includes/functions.php' );
134 require_once( WDN_PLUGIN_DIR . '/includes/class-plugin.php' );
135
136 try {
137 new WDN_Plugin( __FILE__, array_merge( $wdan_plugin_info, array(
138 'plugin_version' => WDN_PLUGIN_VERSION,
139 'plugin_text_domain' => $wdan_compatibility->get_text_domain(),
140 ) ) );
141 } catch( Exception $e ) {
142 // Plugin wasn't initialized due to an error
143 define( 'WDN_PLUGIN_THROW_ERROR', true );
144
145 $wdan_plugin_error_func = function () use ( $e ) {
146 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Webcraftic Disable Admin Notices', $e->getMessage(), $e->getCode() );
147 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
148 };
149
150 add_action( 'admin_notices', $wdan_plugin_error_func );
151 add_action( 'network_admin_notices', $wdan_plugin_error_func );
152 }
153 // @formatter:on