| 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.4 |
| 8 |
* Text Domain: disable-admin-notices |
| 9 |
* Domain Path: /languages/ |
| 10 |
* Author URI: https://webcraftic.com |
| 11 |
* Framework Version: FACTORY_439_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 |
|
| 74 |
// PLUGIN SUBSCRIBE FORM |
| 75 |
'subscribe_widget' => true, |
| 76 |
'subscribe_settings' => ['group_id' => '105407140'], |
| 77 |
|
| 78 |
// PLUGIN ADVERTS |
| 79 |
'render_adverts' => true, |
| 80 |
'adverts_settings' => array( |
| 81 |
'dashboard_widget' => false, // show dashboard widget (default: false) |
| 82 |
'right_sidebar' => true, // show adverts sidebar (default: false) |
| 83 |
'notice' => false, // show notice message (default: false) |
| 84 |
), |
| 85 |
|
| 86 |
// FRAMEWORK MODULES |
| 87 |
'load_factory_modules' => array( |
| 88 |
array('libs/factory/bootstrap', 'factory_bootstrap_439', 'admin'), |
| 89 |
array('libs/factory/forms', 'factory_forms_436', 'admin'), |
| 90 |
array('libs/factory/pages', 'factory_pages_438', 'admin'), |
| 91 |
array('libs/factory/clearfy', 'factory_clearfy_230', 'all'), |
| 92 |
array('libs/factory/freemius', 'factory_freemius_126', 'all'), |
| 93 |
array('libs/factory/adverts', 'factory_adverts_117', 'admin'), |
| 94 |
//array('libs/factory/logger', 'factory_logger_101', 'all') |
| 95 |
) |
| 96 |
); |
| 97 |
|
| 98 |
$wdan_compatibility = new Wbcr_Factory439_Requirements(__FILE__, array_merge($wdan_plugin_info, array( |
| 99 |
'plugin_already_activate' => defined('WDN_PLUGIN_ACTIVE'), |
| 100 |
'required_php_version' => '5.4', |
| 101 |
'required_wp_version' => '4.2.0', |
| 102 |
'required_clearfy_check_component' => false |
| 103 |
))); |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
/** |
| 108 |
* If the plugin is compatible, then it will continue its work, otherwise it will be stopped, |
| 109 |
* and the user will throw a warning. |
| 110 |
*/ |
| 111 |
if( !$wdan_compatibility->check() ) { |
| 112 |
return; |
| 113 |
} |
| 114 |
|
| 115 |
/** |
| 116 |
* ----------------------------------------------------------------------------- |
| 117 |
* CONSTANTS |
| 118 |
* Install frequently used constants and constants for debugging, which will be |
| 119 |
* removed after compiling the plugin. |
| 120 |
* ----------------------------------------------------------------------------- |
| 121 |
*/ |
| 122 |
|
| 123 |
// This plugin is activated |
| 124 |
define('WDN_PLUGIN_ACTIVE', true); |
| 125 |
define('WDN_PLUGIN_VERSION', $wdan_compatibility->get_plugin_version()); |
| 126 |
define('WDN_PLUGIN_DIR', dirname(__FILE__)); |
| 127 |
define('WDN_PLUGIN_BASE', plugin_basename(__FILE__)); |
| 128 |
define('WDN_PLUGIN_URL', plugins_url(null, __FILE__)); |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
/** |
| 133 |
* ----------------------------------------------------------------------------- |
| 134 |
* PLUGIN INIT |
| 135 |
* ----------------------------------------------------------------------------- |
| 136 |
*/ |
| 137 |
|
| 138 |
require_once(WDN_PLUGIN_DIR . '/libs/factory/core/boot.php'); |
| 139 |
require_once(WDN_PLUGIN_DIR . '/includes/functions.php'); |
| 140 |
require_once(WDN_PLUGIN_DIR . '/includes/class-plugin.php'); |
| 141 |
|
| 142 |
try { |
| 143 |
new WDN_Plugin(__FILE__, array_merge($wdan_plugin_info, array( |
| 144 |
'plugin_version' => WDN_PLUGIN_VERSION, |
| 145 |
'plugin_text_domain' => $wdan_compatibility->get_text_domain(), |
| 146 |
))); |
| 147 |
} catch( Exception $e ) { |
| 148 |
// Plugin wasn't initialized due to an error |
| 149 |
define('WDN_PLUGIN_THROW_ERROR', true); |
| 150 |
|
| 151 |
$wdan_plugin_error_func = function () use ($e) { |
| 152 |
$error = sprintf("The %s plugin has stopped. <b>Error:</b> %s Code: %s", 'Webcraftic Disable Admin Notices', $e->getMessage(), $e->getCode()); |
| 153 |
echo '<div class="notice notice-error"><p>' . $error . '</p></div>'; |
| 154 |
}; |
| 155 |
|
| 156 |
add_action('admin_notices', $wdan_plugin_error_func); |
| 157 |
add_action('network_admin_notices', $wdan_plugin_error_func); |
| 158 |
} |
| 159 |
// @formatter:on |