-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprominent.php
More file actions
150 lines (121 loc) · 3.59 KB
/
Copy pathprominent.php
File metadata and controls
150 lines (121 loc) · 3.59 KB
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
<?php
/**
* Plugin Name: Prominent Manager
* Description: Download the plugin from your WordPress site! Much easier because now there are prominent managers. You can easily download any plugin on your website with the help of this plugin. After Prominent Manager activation you will see download button under each plugin on your plugin page. Clicking the download button will download the plugin in zip format.
* Plugin URI: https://mhemelhasan.com/pm-manager
* Author: M Hemel Hasan
* Author URI: https://mhemelhasan.com
* Version: 1.1.4
* Text Domain: pm-manager
* License: GPL3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Tags: plugin download, wordpress plugin manager, plugin backup, plugin rollback, plugin downloader, plugin save, plugin zip, plugin download manager, plugin download button, plugin download link, plugin download zip, plugin download wordpress, plugin download manager wordpress, plugin download manager for wordpress, plugin download manager for wp, plugin download manager for wordpress free, plugin download manager for wp free
* Tested up to: 6.8.2
* Requires PHP: 7.2
*
*/
/**
* Basic Security
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Auto Loader from PSR4
*/
require_once __DIR__ . '/vendor/autoload.php';
/**
* The main plugin class
*/
final class pm_prominent
{
/**
* Plugin version
*
* @var string
*/
const version = '1.1.2';
/**
* Class construcotr
*/
private function __construct()
{
$this->define_constants();
register_activation_hook(__FILE__, [$this, 'activate']);
add_action('plugins_loaded', [$this, 'init_plugin']);
}
/**
* Initializes a singleton instance
*
* @return \pm_prominent
*/
public static function init()
{
static $instance = false;
if (!$instance) {
$instance = new self();
}
return $instance;
}
/**
* Define the required plugin constants
*
* @return void
*/
public function define_constants()
{
define('PM_PROMINENT_VERSION', self::version);
define('PM_PROMINENT_FILE', __FILE__);
define('PM_PROMINENT_PATH', __DIR__);
define('PM_PROMINENT_URL', plugins_url('', PM_PROMINENT_FILE));
define('PM_PROMINENT_ASSETS', PM_PROMINENT_URL . '/assets');
}
/**
* Initialize the plugin
*
* @return void
*/
public function init_plugin()
{
new PM\ProminentManager\Assets();
if (is_admin()) {
new PM\ProminentManager\Admin();
$this->appsero_init_tracker_prominent_manager();
} else {
new PM\ProminentManager\Frontend();
}
}
/**
* Do stuff upon plugin activation
*
* @return void
*/
public function activate()
{
$installed = get_option('pm_prominent_installed');
if (!$installed) {
update_option('pm_prominent_installed', time());
}
update_option('pm_prominent_version', PM_PROMINENT_VERSION);
}
public function appsero_init_tracker_prominent_manager()
{
if (!class_exists('Appsero\Client')) {
require_once __DIR__ . '/appsero/src/Client.php';
}
$client = new Appsero\Client('e06b6587-56de-4f97-bfd3-827c76fb321f', 'Prominent Manager', __FILE__);
// Active insights
$client->insights()->init();
}
}
/**
* Initializes the main plugin
*
* @return \pm_prominent
*/
function pm_prominent()
{
return pm_prominent::init();
}
// kick-off the plugin
pm_prominent();