PluginProbe
The WP Remote WordPress Plugin / 4.86
The WP Remote WordPress Plugin v4.86
6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 5.73 All 53 releases
← All changes | wp_admin.php +44 -51 5.474.86 View file →
@@ -56,9 +56,9 @@
56 56 }
57 57 }
58 58
59 59 public function wprsecAdminMenu($hook) {
60 - if ($hook === 'toplevel_page_wpremote' || WPRHelper::safePregMatch("/wpr_add_account$/", $hook) || WPRHelper::safePregMatch("/wpr_account_details$/", $hook)) {
60 + if ($hook === 'toplevel_page_wpremote' || preg_match("/wpr_add_account$/", $hook) || preg_match("/wpr_account_details$/", $hook)) {
61 61 wp_enqueue_style( 'bootstrap', plugins_url('css/bootstrap.min.css', __FILE__));
62 62 wp_enqueue_style( 'bvplugin', plugins_url('css/bvplugin.min.css', __FILE__));
63 63 }
64 64 }
@@ -63,10 +63,10 @@
63 63 }
64 64 }
65 65
66 66 public function menu() {
67 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
68 - if (!array_key_exists('hide', $brand) && !array_key_exists('hide_from_menu', $brand)) {
67 + $brand = $this->bvinfo->getBrandInfo();
68 + if (!is_array($brand) || (!array_key_exists('hide', $brand) && !array_key_exists('hide_from_menu', $brand))) {
69 69 $bname = $this->bvinfo->getBrandName();
70 70 $icon = $this->bvinfo->getBrandIcon();
71 71 add_menu_page($bname, $bname, 'manage_options', $this->bvinfo->plugname,
72 72 array($this, 'adminPage'), plugins_url($icon, __FILE__ ));
@@ -73,17 +73,13 @@
73 73 }
74 74 }
75 75
76 76 public function hidePluginUpdate($plugins) {
77 - if (!$this->bvinfo->canWhiteLabel()) {
78 - return $plugins;
79 - }
80 - $whitelabel_infos = $this->bvinfo->getPluginsWhitelabelInfos();
81 - foreach ($whitelabel_infos as $slug => $brand) {
82 - if ($this->bvinfo->canWhiteLabel($slug) && isset($plugins->response[$slug]) && is_array($brand)) {
83 - if (array_key_exists('hide_from_menu', $brand) || array_key_exists('hide', $brand)) {
84 - unset($plugins->response[$slug]);
85 - }
77 + $brand = $this->bvinfo->getBrandInfo();
78 + $bvslug = $this->bvinfo->slug;
79 + if (isset($plugins->response[$bvslug]) && is_array($brand)) {
80 + if (array_key_exists('hide_from_menu', $brand) || array_key_exists('hide', $brand)) {
81 + unset($plugins->response[$bvslug]);
86 82 }
87 83 }
88 84 return $plugins;
89 85 }
@@ -88,13 +84,12 @@
88 84 return $plugins;
89 85 }
90 86
91 87 public function hidePluginDetails($plugin_metas, $slug) {
92 - if (!is_array($plugin_metas) || !$this->bvinfo->canWhiteLabel($slug)) {
93 - return $plugin_metas;
94 - }
95 - $whitelabel_info = $this->bvinfo->getPluginWhitelabelInfo($slug);
96 - if (array_key_exists('hide_plugin_details', $whitelabel_info)) {
88 + $brand = $this->bvinfo->getBrandInfo();
89 + $bvslug = $this->bvinfo->slug;
90 +
91 + if ($slug === $bvslug && is_array($brand) && array_key_exists('hide_plugin_details', $brand)){
97 92 foreach ($plugin_metas as $pluginKey => $pluginValue) {
98 93 if (strpos($pluginValue, sprintf('>%s<', translate('View details')))) {
99 94 unset($plugin_metas[$pluginKey]);
100 95 break;
@@ -104,33 +99,31 @@
104 99 return $plugin_metas;
105 100 }
106 101
107 102 public function handlePluginHealthInfo($plugins) {
103 + $brand = $this->bvinfo->getBrandInfo();
104 + $title = $this->bvinfo->title;
108 105 if (!isset($plugins["wp-plugins-active"]) ||
109 - !isset($plugins["wp-plugins-active"]["fields"]) || !$this->bvinfo->canWhiteLabel()) {
106 + !isset($plugins["wp-plugins-active"]["fields"]) ||
107 + !isset($plugins["wp-plugins-active"]["fields"][$title])) {
110 108 return $plugins;
111 109 }
112 -
113 - $whitelabel_infos_by_title = $this->bvinfo->getPluginsWhitelabelInfoByTitle();
114 -
115 - foreach ($whitelabel_infos_by_title as $title => $brand) {
116 - if (is_array($brand) && array_key_exists('slug', $brand) && $this->bvinfo->canWhiteLabel($brand["slug"])) {
117 - if (array_key_exists('hide', $brand)) {
118 - unset($plugins["wp-plugins-active"]["fields"][$title]);
119 - } else {
120 - $plugin = $plugins["wp-plugins-active"]["fields"][$title];
121 - $author = $brand['default_author'];
122 - if (array_key_exists('name', $brand)) {
123 - $plugin["label"] = $brand['name'];
124 - }
125 - if (array_key_exists('author', $brand)) {
126 - $plugin["value"] = str_replace($author, $brand['author'], $plugin["value"]);
127 - }
128 - if (array_key_exists('description', $brand)) {
129 - $plugin["debug"] = str_replace($author, $brand['author'], $plugin["debug"]);
130 - }
131 - $plugins["wp-plugins-active"]["fields"][$title] = $plugin;
110 + if (is_array($brand)) {
111 + if (array_key_exists('hide', $brand)) {
112 + unset($plugins["wp-plugins-active"]["fields"][$title]);
113 + } else {
114 + $plugin = $plugins["wp-plugins-active"]["fields"][$title];
115 + $author = $this->bvinfo->author;
116 + if (array_key_exists('name', $brand)) {
117 + $plugin["label"] = $brand['name'];
132 118 }
119 + if (array_key_exists('author', $brand)) {
120 + $plugin["value"] = str_replace($author, $brand['author'], $plugin["value"]);
121 + }
122 + if (array_key_exists('description', $brand)) {
123 + $plugin["debug"] = str_replace($author, $brand['author'], $plugin["debug"]);
124 + }
125 + $plugins["wp-plugins-active"]["fields"][$title] = $plugin;
133 126 }
134 127 }
135 128 return $plugins;
136 129 }
@@ -137,10 +130,10 @@
137 130
138 131 public function settingsLink($links, $file) {
139 132 #XNOTE: Fix this
140 133 if ( $file == plugin_basename( dirname(__FILE__).'/blogvault.php' ) ) {
141 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
142 - if (!array_key_exists('hide_plugin_details', $brand)) {
134 + $brand = $this->bvinfo->getBrandInfo();
135 + if (!$brand || !array_key_exists('hide_plugin_details', $brand)) {
143 136 $links[] = '<a href="'.$this->mainUrl().'">'.__( 'Settings' ).'</a>';
144 137 }
145 138 }
146 139 return $links;
@@ -146,10 +139,10 @@
146 139 return $links;
147 140 }
148 141
149 142 public function getPluginLogo() {
150 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
151 - if (array_key_exists('logo', $brand)) {
143 + $brand = $this->bvinfo->getBrandInfo();
144 + if (is_array($brand) && array_key_exists('logo', $brand)) {
152 145 return $brand['logo'];
153 146 }
154 147 return $this->bvinfo->logo;
155 148 }
@@ -154,10 +147,10 @@
154 147 return $this->bvinfo->logo;
155 148 }
156 149
157 150 public function getWebPage() {
158 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
159 - if (array_key_exists('webpage', $brand)) {
151 + $brand = $this->bvinfo->getBrandInfo();
152 + if (is_array($brand) && array_key_exists('webpage', $brand)) {
160 153 return $brand['webpage'];
161 154 }
162 155 return $this->bvinfo->webpage;
163 156 }
@@ -219,17 +212,17 @@
219 212 $this->showAddAccountPage();
220 213 }
221 214 }
222 215
223 - public function initWhitelabel($plugins) {
224 - if (!is_array($plugins) || !$this->bvinfo->canWhiteLabel()) {
216 + public function initBranding($plugins) {
217 + $slug = $this->bvinfo->slug;
218 +
219 + if (!is_array($plugins) || !isset($slug, $plugins)) {
225 220 return $plugins;
226 221 }
227 - $whitelabel_infos = $this->bvinfo->getPluginsWhitelabelInfos();
228 - foreach ($whitelabel_infos as $slug => $brand) {
229 - if (!isset($slug) || !$this->bvinfo->canWhiteLabel($slug) || !array_key_exists($slug, $plugins) || !is_array($brand)) {
230 - continue;
231 - }
222 +
223 + $brand = $this->bvinfo->getBrandInfo();
224 + if (is_array($brand)) {
232 225 if (array_key_exists('hide', $brand)) {
233 226 unset($plugins[$slug]);
234 227 } else {
235 228 if (array_key_exists('name', $brand)) {