PluginProbe ʕ •ᴥ•ʔ
10Web Booster – Website speed optimization, Cache & Page Speed optimizer / 2.33.6
10Web Booster – Website speed optimization, Cache & Page Speed optimizer v2.33.6
2.33.6 2.33.5 2.33.0 2.30.5 2.30.7 2.30.9 2.31.10 2.31.8 2.32.11 2.32.21 2.32.3 2.32.4 2.32.7 2.6.31 2.6.40 2.6.42 2.6.7 2.7.37 2.7.44 2.7.47 2.8.18 2.8.19 2.8.32 2.8.34 2.8.35 2.9.23 2.9.24 2.9.25 2.9.27 v2.27.4 trunk 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.17 2.0.18 2.0.21 2.0.22 2.0.25 2.0.26 2.0.27 2.0.3 2.0.7 2.0.9 2.10.46 2.10.65 2.10.66 2.10.68 2.11.41 2.11.42 2.11.43 2.12.15 2.12.21 2.12.22 2.12.23 2.12.26 2.13.37 2.13.40 2.13.41 2.13.42 2.13.44 2.13.45 2.13.47 2.14.49 2.14.50 2.15.18 2.17.21 2.17.23 2.18.17 2.19.44 2.19.45 2.19.46 2.19.49 2.2.12 2.2.15 2.2.16 2.2.18 2.2.8 2.20.31 2.20.32 2.20.33 2.21.11 2.21.12 2.21.16 2.21.25 2.22.32 2.23.13 2.23.15 2.23.16 2.23.18 2.24.12 2.24.14 2.24.18 2.25.14 2.26.6 2.28.10 2.28.13 2.28.14 2.28.7 2.29.1 2.29.2 2.29.3 2.3.0 2.3.1 2.3.2 2.3.3 2.30.18
tenweb-speed-optimizer / includes / OptimizerWhiteLabel.php
tenweb-speed-optimizer / includes Last commit date
WebPageCache 2 weeks ago external 1 week ago ExcludeJsFromDelay.php 2 years ago OptimizerBanner.php 1 year ago OptimizerBase.php 2 years ago OptimizerCSSMin.php 2 years ago OptimizerCache.php 2 weeks ago OptimizerCacheStructure.php 2 years ago OptimizerCriticalCss.php 2 weeks ago OptimizerElementor.php 2 years ago OptimizerFonts.php 2 years ago OptimizerImages.php 1 year ago OptimizerLogger.php 1 year ago OptimizerMain.php 2 weeks ago OptimizerOnInit.php 2 weeks ago OptimizerScripts.php 2 years ago OptimizerSettings.php 2 weeks ago OptimizerStyles.php 2 weeks ago OptimizerUrl.php 1 year ago OptimizerUtils.php 2 weeks ago OptimizerWhiteLabel.php 2 years ago
OptimizerWhiteLabel.php
95 lines
1 <?php
2
3 namespace TenWebOptimizer;
4
5 class OptimizerWhiteLabel
6 {
7 private static $instance = null;
8
9 private $white_labeled_plugins = [
10 'tenweb-speed-optimizer/tenweb_speed_optimizer.php',
11 ];
12
13 private $whitelabeled_menus = [
14 '10web Booster'
15 ];
16
17 private $top_bar_menus = [
18 'two_options'
19 ];
20
21 private $company_name = TWO_SO_ORGANIZATION_NAME;
22
23 public function register_hooks()
24 {
25 if (!defined('TWO_SO_ORGANIZATION_NAME')) {
26 return;
27 }
28
29 add_action('pre_current_active_plugins', [$this, 'whiteLabelPluginsList'], 999999);
30 add_action('admin_menu', [$this, 'whiteLabelTopMenus'], 999999);
31 add_action('admin_bar_menu', [$this, 'whiteLabelAdminBarMenus'], 999999);
32 }
33
34 public function whiteLabelPluginsList()
35 {
36 global $wp_list_table;
37
38 $plugins = $wp_list_table->items;
39
40 $plugin = $plugins[$this->white_labeled_plugins[0]];
41 $slug = $this->white_labeled_plugins[0];
42 $main_php = explode('/', $slug);
43
44 if (is_array($main_php)) {
45 $main_php = end($main_php);
46 }
47 $name = str_ireplace('10web', $this->company_name, $plugin['Name']);
48 $Description = str_ireplace('10web', $this->company_name, $plugin['Description']);
49
50 $wp_list_table->items[$slug]['Name'] = $name;
51 $wp_list_table->items[$slug]['Description'] = $Description;
52 unset($wp_list_table->items[$slug]['Author']);
53 unset($wp_list_table->items[$slug]['AuthorURI']);
54 unset($wp_list_table->items[$slug]['AuthorName']);
55 unset($wp_list_table->items[$slug]['PluginURI']);
56
57 if (isset($wp_list_table->items[$slug]['slug'])) {
58 unset($wp_list_table->items[$slug]['slug']);
59 }
60 }
61
62 public function whiteLabelTopMenus()
63 {
64 global $menu;
65
66 foreach ($menu as $key => $item) {
67 if (str_ireplace($this->whitelabeled_menus, '', $item[0]) !== $item[0]) {
68 $name = str_ireplace('10web', $this->company_name, $item[0]);
69 $title = str_ireplace('10web', $this->company_name, $item[0]);
70 $menu[$key][0] = $name; // phpcs:ignore
71 $menu[$key][3] = $title; // phpcs:ignore
72 }
73 }
74 }
75
76 public function whiteLabelAdminBarMenus($admin_menu)
77 {
78 $wl_menu = $admin_menu->get_node($this->top_bar_menus[0]);
79
80 if (!empty($wl_menu)) {
81 $wl_menu->title = str_ireplace('10web', $this->company_name, $wl_menu->title);
82 $admin_menu->add_node($wl_menu);
83 }
84 }
85
86 public static function get_instance()
87 {
88 if (null == self::$instance) {
89 self::$instance = new self();
90 }
91
92 return self::$instance;
93 }
94 }
95