| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Unagi |
| 4 |
* Plugin URI: https://github.com/HandyPlugins/unagi |
| 5 |
* Description: Unagi clean-up your WordPress notices from the dashboard and show them under the "Notifications" pages. |
| 6 |
* Version: 0.2.2 |
| 7 |
* Requires at least: 5.0 |
| 8 |
* Requires PHP: 5.6 |
| 9 |
* Author: HandyPlugins |
| 10 |
* Author URI: https://handyplugins.co/ |
| 11 |
* License: GPL v2 or later |
| 12 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 13 |
* Text Domain: unagi |
| 14 |
* Domain Path: /languages |
| 15 |
* |
| 16 |
* @package Unagi |
| 17 |
*/ |
| 18 |
|
| 19 |
namespace Unagi; |
| 20 |
|
| 21 |
if ( ! defined( 'ABSPATH' ) ) { |
| 22 |
exit; // Exit if accessed directly. |
| 23 |
} |
| 24 |
|
| 25 |
// Useful global constants. |
| 26 |
define( 'UNAGI_VERSION', '0.2.2' ); |
| 27 |
define( 'UNAGI_URL', plugin_dir_url( __FILE__ ) ); |
| 28 |
define( 'UNAGI_PATH', plugin_dir_path( __FILE__ ) ); |
| 29 |
define( 'UNAGI_INC', UNAGI_PATH . 'includes/' ); |
| 30 |
|
| 31 |
// Include files. |
| 32 |
require_once UNAGI_INC . 'constants.php'; |
| 33 |
require_once UNAGI_INC . 'utils.php'; |
| 34 |
require_once UNAGI_INC . 'core.php'; |
| 35 |
require_once UNAGI_INC . 'shovel.php'; |
| 36 |
require_once UNAGI_INC . 'notifications.php'; |
| 37 |
|
| 38 |
// Require Composer autoloader if it exists. |
| 39 |
if ( file_exists( UNAGI_PATH . 'vendor/autoload.php' ) ) { |
| 40 |
require_once UNAGI_PATH . 'vendor/autoload.php'; |
| 41 |
} |
| 42 |
|
| 43 |
add_action( 'plugins_loaded', __NAMESPACE__ . '\unagi_run' ); |
| 44 |
|
| 45 |
/** |
| 46 |
* Get prepared! U(N) - NAG - I |
| 47 |
* |
| 48 |
* @see https://giphy.com/gifs/friends-tv-ubpB6XcvpYMF2 |
| 49 |
* @link https://www.urbandictionary.com/define.php?term=Unagi |
| 50 |
*/ |
| 51 |
function unagi_run() { |
| 52 |
if ( ! current_user_can( Utils\required_capability() ) ) { |
| 53 |
return; |
| 54 |
} |
| 55 |
// Bootstrap. |
| 56 |
Core\setup(); |
| 57 |
Shovel\setup(); |
| 58 |
Notifications\setup(); |
| 59 |
} |
| 60 |
|
| 61 |
|