-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwp-plugin-info-card.php
174 lines (153 loc) · 3.82 KB
/
wp-plugin-info-card.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
/**
* WP Plugin Info Card
*
* @package WPPIC
*/
/**
* Plugin Name: WP Plugin Info Card
* Plugin URI: https://dlxplugins.com/plugins/plugin-info-card/
* Description: WP Plugin Info Card displays plugins & themes identity cards in a beautiful box with a smooth rotation effect using WordPress.org Plugin API & WordPress.org Theme API. Dashboard widget included.
* Author: Brice CAPOBIANCO, Ronald Huereca
* Author URI: https://dlxplugins.com/plugins/plugin-info-card/
* Version: 5.2.5
* Domain Path: /langs
* Text Domain: wp-plugin-info-card
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
namespace MediaRon\WPPIC;
/**
* Exit and prevent direct access.
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct acces not allowed!' );
}
/**
* Include Autoloader.
*/
if ( file_exists( __DIR__ . '/lib/autoload.php' ) ) {
require_once __DIR__ . '/lib/autoload.php';
}
/**
* Define Constants.
*/
if ( ! defined( 'WPPIC_VERSION' ) ) {
define( 'WPPIC_VERSION', '5.2.5' );
}
if ( ! defined( 'WPPIC_PATH' ) ) {
define( 'WPPIC_PATH', plugin_dir_path( __FILE__ ) . '/src/' );
}
if ( ! defined( 'WPPIC_URL' ) ) {
define( 'WPPIC_URL', plugin_dir_url( __FILE__ ) . '/src/' );
}
if ( ! defined( 'WPPIC_BASE' ) ) {
define( 'WPPIC_BASE', plugin_basename( __FILE__ ) );
}
if ( ! defined( 'WPPIC_NAME' ) ) {
define( 'WPPIC_NAME', 'WP Plugin Info Card' );
}
if ( ! defined( 'WPPIC_NAME_FULL' ) ) {
define( 'WPPIC_NAME_FULL', 'WP Plugin Info Card' );
}
if ( ! defined( 'WPPIC_ID' ) ) {
define( 'WPPIC_ID', 'wp-plugin-info-card' );
}
if ( ! defined( 'WPPIC_FILE' ) ) {
define( 'WPPIC_FILE', __FILE__ );
}
/**
* Include global functions and variables.
*/
require_once 'functions.php';
/**
* WP Plugin Info Card Main Class
*/
class WP_Plugin_Info_Card {
/**
* WP Plugin Info Card instance.
*
* @var WP_Plugin_Info_Card $instance Instance of Highlight and Share class.
*/
private static $instance = null;
/**
* Return an instance of the class
*
* Return an instance of the WP_Plugin_Info_Card Class.
*
* @since 1.0.0
* @access public
*
* @return WP_Plugin_Info_Card class instance.
*/
public static function get_instance() {
if ( null == self::$instance ) { // phpcs:ignore
self::$instance = new self();
}
return self::$instance;
}
/**
* Class constructor.
*
* Initialize plugin and load text domain for internationalization
*
* @since 1.0.0
* @access private
*/
private function __construct() {
// i18n initialization.
load_plugin_textdomain( 'wp-plugin-info-card', false, dirname( plugin_basename( __FILE__ ) ) . '/langs/' );
}
/**
* Run when plugins have finished loading. Begin main initialization.
*/
public function plugins_loaded() {
/**
* Fires before the plugin has been loaded and initialized.
*
* @since 5.2.0
*/
do_action( 'pre_wppic_loaded' );
// Register block related hooks.
$blocks = new Blocks();
$blocks->run();
// Set up admin.
$admin = new Admin();
$admin->run();
// Set up tinyMCE.
$tinymce = new TinyMCE\Init();
$tinymce->run();
// Set up Add Plugin.
$add_plugin = new Add_Plugin();
$add_plugin->run();
// Set up Add Theme.
$add_theme = new Add_Theme();
$add_theme->run();
// Set up shortcodes and callbacks.
$shortcodes = new Shortcodes();
$shortcodes->run();
if ( Functions::is_edd_installed() ) {
$edd = new EDD();
$edd->run();
}
// For the admin.
if ( is_admin() ) {
// Set up admin.
new Admin\Init();
}
/**
* Fires after the plugin has been loaded and initialized.
*
* @since 5.2.0
*/
do_action( 'wppic_loaded' );
}
}
add_action( 'plugins_loaded', 'MediaRon\WPPIC\wp_plugin_info_card_instantiate' );
/**
* Instantiate the WPPIC class.
*/
function wp_plugin_info_card_instantiate() {
$wppic = WP_Plugin_Info_Card::get_instance();
$wppic->plugins_loaded();
}