PluginProbe
The WP Remote WordPress Plugin / 6.76
The WP Remote WordPress Plugin v6.76
6.76 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 All 54 releases
wpremote / wp_login_whitelabel.php

wp_login_whitelabel.php in The WP Remote WordPress Plugin 6.76, at wp_login_whitelabel.php

63 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit;
3 if (!class_exists('WPRWPLoginWhitelabel')) :
4
5 class WPRWPLoginWhitelabel {
6 private $bvinfo;
7 private $label;
8 private $logo;
9
10 public function __construct() {
11 $this->bvinfo = new WPRInfo(new WPRWPSettings());
12
13 $whitelabel_info = $this->bvinfo->getLPWhitelabelInfo();
14 if (isset($whitelabel_info['label']) && is_string($whitelabel_info['label'])) {
15 $this->label = $whitelabel_info['label'];
16 }
17
18 if (isset($whitelabel_info['logo']) && is_string($whitelabel_info['logo'])) {
19 $this->logo = $whitelabel_info['logo'];
20 }
21 }
22
23 public function init() {
24 add_action('login_head', array($this, 'custom_login_head'));
25 add_filter('login_message', array($this, 'custom_login_message'));
26 }
27
28 function custom_login_head() {
29 if (empty($this->logo) ||
30 !preg_match('/^data:image\/(jpeg|png);base64,[a-zA-Z0-9\/+]+={0,2}$/', $this->logo)) {
31
32 return;
33 }
34
35 $logo_style = 'background-image: none, url("' . esc_attr($this->logo) . '") !important;';
36
37 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
38 wp_register_style( 'bv-login-inline', false );
39 wp_enqueue_style( 'bv-login-inline' );
40
41 wp_add_inline_style(
42 'bv-login-inline',
43 '.login h1 a { ' . $logo_style . ' }'
44 );
45 // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
46 }
47
48 function custom_login_message($message) {
49 if (empty($this->label)) {
50 return;
51 }
52
53 return '<div style="
54 text-align: center;
55 font-size: 22px;
56 font-weight: bold;
57 color: #333;
58 margin-top: 10px;
59 margin-bottom: 10px;
60 ">' . esc_html($this->label) . '</div>';
61 }
62 }
63 endif;