-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathphp-require-54.php
More file actions
69 lines (50 loc) · 1.24 KB
/
php-require-54.php
File metadata and controls
69 lines (50 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
class Bio_Links_Plugin_Require_PHP54 {
/** @var String */
private $minimum_version;
/**
* @param $minimum_version
*/
public function __construct() {
$this->minimum_version = '5.4';
}
/**
* @param $version
*
* @return bool
*/
public function does_it_meet_required_php_version( $version ) {
if ( $this->is_minimum_php_version( $version ) ) {
return true;
}
$this->load_minimum_required_version_notice();
return false;
}
/**
* @param $version
*
* @return boolean
*/
private function is_minimum_php_version( $version ) {
return version_compare( $this->minimum_version, $version, '<=' );
}
/**
* @return void
*/
private function load_minimum_required_version_notice() {
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
add_action( 'admin_notices', array( $this, 'admin_notice' ) );
}
}
public function admin_notice() {
echo '<div class="error">';
echo wp_kses_post(
__(
'<p>Your hosting environment is <strong>outdated</strong> and <strong>insecure</strong>! <br> Minimum version required for Bio Links is PHP 5.4. Read more information about <a href="http://www.wpupdatephp.com/update/">how you can update your server</a>!</p>'
,
'biolinks'
)
);
echo '</div>';
}
}