PluginProbe
Adminify – White Label, Admin Menu Editor, Login Customizer / 4.0.2.5
Adminify – White Label, Admin Menu Editor, Login Customizer v4.0.2.5
4.3.2 4.3.1 4.3.0 4.2.26 4.2.25 4.2.24 4.2.23 4.2.22 4.2.21 4.2.20 4.2.19 4.2.18 4.2.17 4.2.16 4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 All 165 releases
← All changes | Inc/Classes/AdminFooterText.php +37 -101 4.2.254.0.2.5 View file →
@@ -1,11 +1,12 @@
1 1 <?php
2 2
3 -namespace PXLBSAdminify\Inc\Classes;
3 +namespace WPAdminify\Inc\Classes;
4 4
5 -use PXLBSAdminify\Inc\Classes\ServerInfo;
6 -use PXLBSAdminify\Inc\Admin\AdminSettings;
7 -use PXLBSAdminify\Inc\Admin\AdminSettingsModel;
5 +use WPAdminify\Inc\Utils;
6 +use WPAdminify\Inc\Classes\ServerInfo;
7 +use WPAdminify\Inc\Admin\AdminSettings;
8 +use WPAdminify\Inc\Admin\AdminSettingsModel;
8 9
9 10
10 11 // no direct access allowed.
11 12 if (!defined('ABSPATH')) {
@@ -27,20 +28,8 @@
27 28 */
28 29 public $server_info;
29 30
30 31 /**
31 - * Default admin_footer_text value supplied by WordPress core.
32 - *
33 - * Captured via the admin_footer_text filter at an early priority before
34 - * the plugin overrides it, so the standard "Thank you for creating with
35 - * WordPress." string can be rendered when the credit option is disabled
36 - * without hardcoding a copy of that string in the plugin.
37 - *
38 - * @var string
39 - */
40 - protected static $wp_default_footer_text = '';
41 -
42 - /**
43 32 * Constructor
44 33 */
45 34 public function __construct()
46 35 {
@@ -52,41 +41,20 @@
52 41 if (!empty($this->options) && in_array('wp_version', $this->options)) {
53 42 add_action('admin_menu', [$this, 'remove_admin_footer_version']);
54 43 }
55 44
56 - add_action('admin_menu', [$this, 'footer_version_remove']);
57 - add_action('network_admin_menu', [$this, 'footer_version_remove']);
45 + add_action('admin_menu', [$this, 'jltwp_adminify_footer_version_remove']);
46 + add_action('network_admin_menu', [$this, 'jltwp_adminify_footer_version_remove']);
58 47 /** Admin Footer */
59 - add_filter('update_footer', [$this, 'change_admin_footer'], 10, 3);
48 + add_filter('update_footer', [$this, 'jltwp_adminify_change_admin_footer'], 10, 3);
60 49
61 - // Capture WordPress core's default admin_footer_text before
62 - // suppressing it, so we can re-render it when the plugin's
63 - // "Show Footer Credit" option is disabled.
64 - add_filter('admin_footer_text', [$this, 'capture_wp_default_footer_text'], 1);
50 + add_filter( 'admin_footer_text', '__return_false' );
65 51
66 - add_filter( 'admin_footer_text', '__return_false', 999 );
67 - add_filter( 'update_footer', '__return_false', 999 );
68 -
69 52 $this->server_info = new ServerInfo();
70 53 }
71 54
72 - /**
73 - * Capture the default admin footer text WordPress passes into the
74 - * admin_footer_text filter, then return it unchanged.
75 - *
76 - * @param string $text
77 - * @return string
78 - */
79 - public function capture_wp_default_footer_text($text)
80 - {
81 - if (is_string($text) && $text !== '') {
82 - self::$wp_default_footer_text = $text;
83 - }
84 - return $text;
85 - }
86 55
87 56
88 -
89 57 /**
90 58 * Remove WordPress version
91 59 *
92 60 * @return void
@@ -99,44 +67,30 @@
99 67 }
100 68 }
101 69
102 70
103 - // function footer_get_options()
71 + // function jltwp_adminify_footer_get_options()
104 72 // {
105 73 // $objects = isset($this->options) && is_array($this->options) ? $this->options : [];
106 74 // return $objects;
107 75 // }
108 76
109 - public function footer_version_remove()
77 + public function jltwp_adminify_footer_version_remove()
110 78 {
111 79 remove_filter('update_footer', 'core_update_footer');
112 80 }
113 81
114 - /**
115 - * Default footer credit markup.
116 - *
117 - * Single source of truth for the "Developed by / Powered by" string,
118 - * used both as the default value of the white-label footer text option
119 - * and as the rendered fallback when the option is empty.
120 - *
121 - * @return string
122 - */
123 - public static function get_default_footer_credit()
124 - {
125 - return sprintf(
126 - /* translators: 1: WP Adminify website URL, 2: Plugin label, 3: WordPress.org URL */
127 - __('<p>Developed by <a href="%1$s" target="_blank" title="Adminify by Jewel Theme">%2$s</a></p> <p>Powered by <a target="_blank" href="%3$s">WordPress</a></p>', 'adminify'),
128 - esc_url('https://wpadminify.com/'),
129 - AdminSettings::get_pro_label(),
130 - esc_url('https://wordpress.org/')
131 - );
132 - }
133 -
134 82 /** Footer Credits */
135 - public function footer_credits()
136 - { ?>
83 + public function jltwp_adminify_footer_credits()
84 + { ?>
137 85 <div class="adminify-copyright">
138 - <?php echo wp_kses_post(self::get_default_footer_credit()); ?>
86 + <?php
87 + echo sprintf( __('<p>Developed by <a href="%1$s" target="_blank" title="WP Adminify by Jewel Theme" target="_blank">%2$s</a></p> <p>Powered by <a target="_blank" href="%3$s">WordPress</a></p>', 'adminify'),
88 + esc_url('https://wpadminify.com/'),
89 + __('WP Adminify', 'adminify'),
90 + esc_url( 'https://wordpress.org/' )
91 + );
92 + ?>
139 93 </div>
140 94 <?php
141 95 }
142 96
@@ -144,25 +98,8 @@
144 98 public function change_admin_footer_text()
145 99 {
146 100 $footer_text = (array) AdminSettings::get_instance()->get();
147 101
148 - // Attribution is opt-in only. When the site admin has not enabled
149 - // the "Show Footer Credit" option, fall back to the standard
150 - // WordPress admin footer text instead of plugin credits.
151 - $show_credit = !empty($footer_text['white_label']['wordpress']['show_footer_credit']);
152 - if (!$show_credit) {
153 - $wp_default = self::$wp_default_footer_text;
154 - if ($wp_default === '') {
155 - return;
156 - }
157 - ?>
158 - <div class="adminify-footer-left">
159 - <?php echo wp_kses_post($wp_default); ?>
160 - </div>
161 - <?php
162 - return;
163 - }
164 -
165 102 if (!empty($footer_text['white_label']['wordpress']['footer_text'])) { ?>
166 103 <div class="adminify-footer-left">
167 104 <?php echo wp_kses_post($footer_text['white_label']['wordpress']['footer_text']); ?>
168 105 </div>
@@ -168,19 +105,17 @@
168 105 </div>
169 106 <?php
170 107 return;
171 108 }
172 -
173 109 // Change the content of the left admin footer text.
174 - apply_filters('pxlbsadminify_footer_credits', $this->footer_credits());
110 + apply_filters('jltwp_adminify_footer_credits', $this->jltwp_adminify_footer_credits());
175 111 }
176 112
177 113
178 -
179 114 /**
180 115 * IP Address
181 116 */
182 - public function ip_address() { ?>
117 + public function adminify_ip_address() { ?>
183 118 <div class="adminify-system-info">
184 119 <?php
185 120 if (is_rtl()) {
186 121 echo sprintf(
@@ -203,9 +138,9 @@
203 138
204 139 /**
205 140 * PHP Version
206 141 */
207 - public function php_version() { ?>
142 + public function adminify_php_version() { ?>
208 143 <div class="adminify-system-info">
209 144 <?php
210 145 if (is_rtl()) {
211 146 echo sprintf(
@@ -227,9 +162,9 @@
227 162
228 163 /**
229 164 * WordPress Version
230 165 */
231 - public function default_wp_version() { ?>
166 + public function adminify_wp_version() { ?>
232 167 <div class="adminify-system-info">
233 168 <?php
234 169 if (is_rtl()) {
235 170 echo sprintf(
@@ -251,14 +186,14 @@
251 186
252 187 /**
253 188 * Memory Usage
254 189 */
255 - public function memory_usage() {
190 + public function adminify_memory_usage() {
256 191 $memory_usage = $this->server_info->get_wp_memory_usage();
257 192 $memory_limit = $memory_usage['MemLimitFormat'];
258 193 $memory_usage_format = $memory_usage['MemUsageFormat'];
259 194 // $memory_usage_percentage = $memory_usage['MemUsageCalc'];
260 - $memory_usage_percentage = ServerInfo::memory_usage_percentage();
195 + $memory_usage_percentage = ServerInfo::wp_memory_usage_percentage();
261 196
262 197 if ($memory_usage_percentage <= 65) {
263 198 $memory_status = '#00BA88';
264 199 } elseif ($memory_usage_percentage > 65 && $memory_usage_percentage < 85) {
@@ -295,9 +230,9 @@
295 230
296 231 /**
297 232 * Memory Limit
298 233 */
299 - public function memory_limit() {
234 + public function adminify_memory_limit() {
300 235 $memory_limit = $this->server_info->get_wp_memory_usage();
301 236
302 237 $memory_limit = $memory_limit['MemLimitFormat']; ?>
303 238
@@ -324,9 +259,9 @@
324 259
325 260 /**
326 261 * Memory Limit
327 262 */
328 - public function memory_available() {
263 + public function adminify_memory_available() {
329 264 $memory_available = $this->server_info->get_wp_memory_usage();
330 265 $memory_available = rtrim($memory_available['MemLimitGet'], 'MB') - rtrim($memory_available['MemUsageFormat'], 'MB'); ?>
331 266
332 267 <div class="adminify-system-info">
@@ -350,12 +285,12 @@
350 285 }
351 286
352 287
353 288 /** Admin Footer Text **/
354 - public function change_admin_footer($footer_text) { ?>
289 + public function jltwp_adminify_change_admin_footer($footer_text) { ?>
355 290
356 291 <div class="adminify--footer">
357 - <?php $this->change_admin_footer_text();
292 + <?php echo $this->change_admin_footer_text();
358 293 if ( !empty($this->options) ) { ?>
359 294
360 295 <div class="adminify-footer-right">
361 296 <div class="adminify-system-info-col">
@@ -360,17 +295,17 @@
360 295 <div class="adminify-footer-right">
361 296 <div class="adminify-system-info-col">
362 297 <?php
363 298 if ( in_array('ip_address', $this->options ) ) {
364 - $this->ip_address();
299 + $this->adminify_ip_address();
365 300 }
366 301
367 302 if ( in_array('php_version', $this->options ) ) {
368 - $this->php_version();
303 + $this->adminify_php_version();
369 304 }
370 305
371 306 if ( in_array('wp_version', $this->options ) ) {
372 - $this->default_wp_version();
307 + $this->adminify_wp_version();
373 308 }
374 309 ?>
375 310 </div>
376 311 <div class="adminify-system-info-col">
@@ -375,21 +310,22 @@
375 310 </div>
376 311 <div class="adminify-system-info-col">
377 312 <?php
378 313 if ( in_array('memory_usage', $this->options ) ) {
379 - $this->memory_usage();
314 + $this->adminify_memory_usage();
380 315 }
381 316
382 317 if ( in_array('memory_limit', $this->options ) ) {
383 - $this->memory_limit();
318 + $this->adminify_memory_limit();
384 319 }
385 320
386 321 if ( in_array('memory_available', $this->options ) ) {
387 - $this->memory_available();
322 + $this->adminify_memory_available();
388 323 }
389 324 ?>
390 325 </div>
391 326 </div>
327 +
392 328 <?php return $footer_text;
393 329 } ?>
394 330 </div>
395 331 <?php