PluginProbe
Disable Admin Notices – Hide Dashboard Notifications / 1.4.1
Disable Admin Notices – Hide Dashboard Notifications v1.4.1
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
169 lines 5.6 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://clearfy.pro/disable-admin-notices
5 * Description: Disable admin notices plugin gives you the option to hide updates warnings and inline notices in the admin panel.
6 * Author: Themeisle
7 * Version: 1.4.1
8 * Text Domain: disable-admin-notices
9 * Domain Path: /languages/
10 * Author URI: https://themeisle.com
11 * Framework Version: FACTORY_480_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 * Artem Prihodko
27 * ---------------------------------------------------------------------------------
28 * Updates and fixes
29 *
30 * Email: webtemyk@yandex.ru
31 * GitHub: https://github.com/temyk
32 * ---------------------------------------------------------------------------------
33 */
34
35 // Exit if accessed directly
36 if ( ! defined( 'ABSPATH' ) ) {
37 exit;
38 }
39
40 /**
41 * -----------------------------------------------------------------------------
42 * CHECK REQUIREMENTS
43 * Check compatibility with php and wp version of the user's site. As well as checking
44 * compatibility with other plugins from Webcraftic.
45 * -----------------------------------------------------------------------------
46 */
47
48 require_once( dirname( __FILE__ ) . '/libs/factory/core/includes/class-factory-requirements.php' );
49
50 // @formatter:off
51 $wdan_plugin_info = [
52 'prefix' => 'wbcr_dan_',
53 'plugin_name' => 'wbcr_dan',
54 'plugin_title' => 'Webcraftic disable admin notices',
55
56 // PLUGIN SUPPORT
57 'support_details' => [
58 'url' => 'https://clearfy.pro/',
59 'pages_map' => [
60 'support' => 'support', // {site}/support
61 'docs' => 'docs', // {site}/docs,
62 'pricing' => 'disable-admin-notices'
63 ]
64 ],
65 // PLUGIN PREMIUM SETTINGS
66 'has_premium' => true,
67 'license_settings' => [
68 'provider' => 'freemius',
69 'slug' => 'disable-admin-notices-premium',
70 'plugin_id' => '6456',
71 'public_key' => 'pk_0570ec3c1b4100b9c9a0cbfe80f9f',
72 'price' => 29,
73 'has_updates' => true,
74 'updates_settings' => [
75 'maybe_rollback' => true,
76 'rollback_settings' => [
77 'prev_stable_version' => '0.0.0'
78 ]
79 ]
80 ],
81
82 // PLUGIN SUBSCRIBE FORM
83 'subscribe_widget' => true,
84 'subscribe_settings' => [ 'group_id' => '105407140' ],
85
86 // PLUGIN ADVERTS
87 'render_adverts' => true,
88 'adverts_settings' => [
89 'dashboard_widget' => false, // show dashboard widget (default: false)
90 'right_sidebar' => true, // show adverts sidebar (default: false)
91 'notice' => false, // show notice message (default: false)
92 ],
93
94 // FRAMEWORK MODULES
95 'load_factory_modules' => [
96 [ 'libs/factory/bootstrap', 'factory_bootstrap_482', 'admin' ],
97 [ 'libs/factory/forms', 'factory_forms_480', 'admin' ],
98 [ 'libs/factory/pages', 'factory_pages_480', 'admin' ],
99 [ 'libs/factory/templates', 'factory_templates_134', 'all' ],
100 [ 'libs/factory/freemius', 'factory_freemius_170', 'all' ],
101 [ 'libs/factory/adverts', 'factory_adverts_159', 'admin' ],
102 //array('libs/factory/logger', 'factory_logger_149', 'all')
103 ]
104 ];
105
106 $wdan_compatibility = new Wbcr_Factory480_Requirements( __FILE__, array_merge( $wdan_plugin_info, [
107 'plugin_already_activate' => defined( 'WDN_PLUGIN_ACTIVE' ),
108 'required_php_version' => '7.0',
109 'required_wp_version' => '4.8.0',
110 'required_clearfy_check_component' => false
111 ] ) );
112
113
114
115 /**
116 * If the plugin is compatible, then it will continue its work, otherwise it will be stopped,
117 * and the user will throw a warning.
118 */
119 if ( ! $wdan_compatibility->check() ) {
120 return;
121 }
122
123 /**
124 * -----------------------------------------------------------------------------
125 * CONSTANTS
126 * Install frequently used constants and constants for debugging, which will be
127 * removed after compiling the plugin.
128 * -----------------------------------------------------------------------------
129 */
130
131 // This plugin is activated
132 define( 'WDN_PLUGIN_ACTIVE', true );
133 define( 'WDN_PLUGIN_VERSION', $wdan_compatibility->get_plugin_version() );
134 define( 'WDN_PLUGIN_DIR', dirname( __FILE__ ) );
135 define( 'WDN_PLUGIN_BASE', plugin_basename( __FILE__ ) );
136 define( 'WDN_PLUGIN_URL', plugins_url( '', __FILE__ ) );
137 define( 'WDN_PLUGIN_FILE', __FILE__ );
138
139
140
141 /**
142 * -----------------------------------------------------------------------------
143 * PLUGIN INIT
144 * -----------------------------------------------------------------------------
145 */
146
147 require_once( WDN_PLUGIN_DIR . '/libs/factory/core/boot.php' );
148 require_once( WDN_PLUGIN_DIR . '/includes/functions.php' );
149 require_once( WDN_PLUGIN_DIR . '/includes/class-plugin.php' );
150
151 try {
152 require_once WDN_PLUGIN_DIR . '/vendor/autoload.php';
153 new WDN_Plugin( __FILE__, array_merge( $wdan_plugin_info, [
154 'plugin_version' => WDN_PLUGIN_VERSION,
155 'plugin_text_domain' => $wdan_compatibility->get_text_domain(),
156 ] ) );
157 } catch ( Exception $e ) {
158 // Plugin wasn't initialized due to an error
159 define( 'WDN_PLUGIN_THROW_ERROR', true );
160
161 $wdan_plugin_error_func = function () use ( $e ) {
162 $error = sprintf( "The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Disable Admin Notices', $e->getMessage(), $e->getCode() );
163 echo '<div class="notice notice-error"><p>' . $error . '</p></div>';
164 };
165
166 add_action( 'admin_notices', $wdan_plugin_error_func );
167 add_action( 'network_admin_notices', $wdan_plugin_error_func );
168 }
169 // @formatter:on