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 +46 -55 5.724.86 View file →
@@ -51,16 +51,14 @@
51 51 }
52 52 if ($this->bvinfo->isActivateRedirectSet()) {
53 53 $this->settings->updateOption($this->bvinfo->plug_redirect, 'no');
54 54 ##ACTIVATEREDIRECTCODE##
55 - if (!wp_doing_ajax()) {
56 - wp_redirect($this->mainUrl());
57 - }
55 + wp_redirect($this->mainUrl());
58 56 }
59 57 }
60 58
61 59 public function wprsecAdminMenu($hook) {
62 - 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)) {
63 61 wp_enqueue_style( 'bootstrap', plugins_url('css/bootstrap.min.css', __FILE__));
64 62 wp_enqueue_style( 'bvplugin', plugins_url('css/bvplugin.min.css', __FILE__));
65 63 }
66 64 }
@@ -65,10 +63,10 @@
65 63 }
66 64 }
67 65
68 66 public function menu() {
69 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
70 - 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))) {
71 69 $bname = $this->bvinfo->getBrandName();
72 70 $icon = $this->bvinfo->getBrandIcon();
73 71 add_menu_page($bname, $bname, 'manage_options', $this->bvinfo->plugname,
74 72 array($this, 'adminPage'), plugins_url($icon, __FILE__ ));
@@ -75,17 +73,13 @@
75 73 }
76 74 }
77 75
78 76 public function hidePluginUpdate($plugins) {
79 - if (!$this->bvinfo->canWhiteLabel()) {
80 - return $plugins;
81 - }
82 - $whitelabel_infos = $this->bvinfo->getPluginsWhitelabelInfos();
83 - foreach ($whitelabel_infos as $slug => $brand) {
84 - if ($this->bvinfo->canWhiteLabel($slug) && isset($plugins->response[$slug]) && is_array($brand)) {
85 - if (array_key_exists('hide_from_menu', $brand) || array_key_exists('hide', $brand)) {
86 - unset($plugins->response[$slug]);
87 - }
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]);
88 82 }
89 83 }
90 84 return $plugins;
91 85 }
@@ -90,13 +84,12 @@
90 84 return $plugins;
91 85 }
92 86
93 87 public function hidePluginDetails($plugin_metas, $slug) {
94 - if (!is_array($plugin_metas) || !$this->bvinfo->canWhiteLabel($slug)) {
95 - return $plugin_metas;
96 - }
97 - $whitelabel_info = $this->bvinfo->getPluginWhitelabelInfo($slug);
98 - 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)){
99 92 foreach ($plugin_metas as $pluginKey => $pluginValue) {
100 93 if (strpos($pluginValue, sprintf('>%s<', translate('View details')))) {
101 94 unset($plugin_metas[$pluginKey]);
102 95 break;
@@ -106,33 +99,31 @@
106 99 return $plugin_metas;
107 100 }
108 101
109 102 public function handlePluginHealthInfo($plugins) {
103 + $brand = $this->bvinfo->getBrandInfo();
104 + $title = $this->bvinfo->title;
110 105 if (!isset($plugins["wp-plugins-active"]) ||
111 - !isset($plugins["wp-plugins-active"]["fields"]) || !$this->bvinfo->canWhiteLabel()) {
106 + !isset($plugins["wp-plugins-active"]["fields"]) ||
107 + !isset($plugins["wp-plugins-active"]["fields"][$title])) {
112 108 return $plugins;
113 109 }
114 -
115 - $whitelabel_infos_by_title = $this->bvinfo->getPluginsWhitelabelInfoByTitle();
116 -
117 - foreach ($whitelabel_infos_by_title as $title => $brand) {
118 - if (is_array($brand) && array_key_exists('slug', $brand) && $this->bvinfo->canWhiteLabel($brand["slug"])) {
119 - if (array_key_exists('hide', $brand)) {
120 - unset($plugins["wp-plugins-active"]["fields"][$title]);
121 - } else {
122 - $plugin = $plugins["wp-plugins-active"]["fields"][$title];
123 - $author = $brand['default_author'];
124 - if (array_key_exists('name', $brand)) {
125 - $plugin["label"] = $brand['name'];
126 - }
127 - if (array_key_exists('author', $brand)) {
128 - $plugin["value"] = str_replace($author, $brand['author'], $plugin["value"]);
129 - }
130 - if (array_key_exists('description', $brand)) {
131 - $plugin["debug"] = str_replace($author, $brand['author'], $plugin["debug"]);
132 - }
133 - $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'];
134 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;
135 126 }
136 127 }
137 128 return $plugins;
138 129 }
@@ -138,11 +129,11 @@
138 129 }
139 130
140 131 public function settingsLink($links, $file) {
141 132 #XNOTE: Fix this
142 - if ( $file == plugin_basename( dirname(__FILE__).'/plugin.php' ) ) {
143 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
144 - if (!array_key_exists('hide_plugin_details', $brand)) {
133 + if ( $file == plugin_basename( dirname(__FILE__).'/blogvault.php' ) ) {
134 + $brand = $this->bvinfo->getBrandInfo();
135 + if (!$brand || !array_key_exists('hide_plugin_details', $brand)) {
145 136 $links[] = '<a href="'.$this->mainUrl().'">'.__( 'Settings' ).'</a>';
146 137 }
147 138 }
148 139 return $links;
@@ -148,10 +139,10 @@
148 139 return $links;
149 140 }
150 141
151 142 public function getPluginLogo() {
152 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
153 - if (array_key_exists('logo', $brand)) {
143 + $brand = $this->bvinfo->getBrandInfo();
144 + if (is_array($brand) && array_key_exists('logo', $brand)) {
154 145 return $brand['logo'];
155 146 }
156 147 return $this->bvinfo->logo;
157 148 }
@@ -156,10 +147,10 @@
156 147 return $this->bvinfo->logo;
157 148 }
158 149
159 150 public function getWebPage() {
160 - $brand = $this->bvinfo->getPluginWhitelabelInfo();
161 - if (array_key_exists('webpage', $brand)) {
151 + $brand = $this->bvinfo->getBrandInfo();
152 + if (is_array($brand) && array_key_exists('webpage', $brand)) {
162 153 return $brand['webpage'];
163 154 }
164 155 return $this->bvinfo->webpage;
165 156 }
@@ -221,17 +212,17 @@
221 212 $this->showAddAccountPage();
222 213 }
223 214 }
224 215
225 - public function initWhitelabel($plugins) {
226 - 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)) {
227 220 return $plugins;
228 221 }
229 - $whitelabel_infos = $this->bvinfo->getPluginsWhitelabelInfos();
230 - foreach ($whitelabel_infos as $slug => $brand) {
231 - if (!isset($slug) || !$this->bvinfo->canWhiteLabel($slug) || !array_key_exists($slug, $plugins) || !is_array($brand)) {
232 - continue;
233 - }
222 +
223 + $brand = $this->bvinfo->getBrandInfo();
224 + if (is_array($brand)) {
234 225 if (array_key_exists('hide', $brand)) {
235 226 unset($plugins[$slug]);
236 227 } else {
237 228 if (array_key_exists('name', $brand)) {