1 | <?php |
||
5 | /** |
||
6 | * Checks for minimum system requirments on plugin activation |
||
7 | * @version 1.0.1 |
||
8 | */ |
||
9 | class GL_Plugin_Check_v1 |
||
1 ignored issue
–
show
|
|||
10 | { |
||
11 | const MIN_PHP_VERSION = '5.6.0'; |
||
12 | const MIN_WORDPRESS_VERSION = '4.7.0'; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected static $file; |
||
18 | |||
19 | /** |
||
20 | * @var static |
||
21 | */ |
||
22 | protected static $instance; |
||
23 | |||
24 | /** |
||
25 | * @var object |
||
26 | */ |
||
27 | protected static $versions; |
||
28 | |||
29 | /** |
||
30 | * @param string $version |
||
31 | * @return bool |
||
32 | */ |
||
33 | View Code Duplication | public static function isPhpValid( $version = '' ) |
|
40 | |||
41 | /** |
||
42 | * @return bool |
||
43 | */ |
||
44 | public static function isValid( array $args = array() ) |
||
51 | |||
52 | /** |
||
53 | * @param string $version |
||
54 | * @return bool |
||
55 | */ |
||
56 | View Code Duplication | public static function isWpValid( $version = '' ) |
|
64 | |||
65 | /** |
||
66 | * @param string $file |
||
67 | * @return bool |
||
68 | */ |
||
69 | public static function shouldDeactivate( $file, array $args = array() ) |
||
83 | |||
84 | /** |
||
85 | * @param string $plugin |
||
86 | * @return void |
||
87 | */ |
||
88 | public function deactivate( $plugin ) |
||
99 | |||
100 | /** |
||
101 | * @return object |
||
102 | */ |
||
103 | protected static function normalize( array $args = array() ) |
||
110 | |||
111 | /** |
||
112 | * @return void |
||
113 | */ |
||
114 | protected function redirect() |
||
155 |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.