PluginProbe
Boxzilla – WordPress Popup Builder / 3.1.11
Boxzilla – WordPress Popup Builder v3.1.11
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
boxzilla / src / class-php-fallback.php

class-php-fallback.php in Boxzilla – WordPress Popup Builder 3.1.11, at src/class-php-fallback.php

63 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Boxzilla_PHP_Fallback {
4
5 /**
6 * @var string
7 */
8 private $plugin_name = '';
9
10 /**
11 * @var string
12 */
13 private $plugin_file = '';
14
15 /**
16 * @param $plugin_name
17 * @param $plugin_file
18 */
19 public function __construct( $plugin_name, $plugin_file ) {
20
21 $this->plugin_name = $plugin_name;
22 $this->plugin_file = $plugin_file;
23
24 // deactivate plugin straight away
25 add_action( 'admin_init', array( $this, 'deactivate_self' ) );
26 }
27
28 /**
29 * @return bool
30 */
31 public function deactivate_self() {
32 if( ! current_user_can( 'activate_plugins' ) ) {
33 return false;
34 }
35
36 // deactivate self
37 deactivate_plugins( $this->plugin_file );
38
39 // get rid of "Plugin activated" notice
40 if( isset( $_GET['activate'] ) ) {
41 unset( $_GET['activate'] );
42 }
43
44 // show notice to user
45 add_action( 'admin_notices', array( $this, 'show_notice' ) );
46
47 return true;
48 }
49
50 /**
51 * @return void
52 */
53 public function show_notice() {
54 ?>
55 <div class="updated">
56 <p><?php printf( '<strong>%s</strong> did not activate because it requires <strong>PHP v5.3</strong> or higher, while your server is running <strong>PHP v%s</strong>.', $this->plugin_name, PHP_VERSION ); ?>
57 <p><?php printf( '<a href="%s">Updating your PHP version</a> makes your site faster, more secure and should be easy for your host.', 'http://www.wpupdatephp.com/update/#utm_source=wp-plugin&utm_medium=boxzillas&utm_campaign=activation-notice' ); ?></p>
58 </div>
59 <?php
60 }
61
62 }
63