These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
0 ignored issues
–
show
|
|||
2 | /** |
||
3 | * |
||
4 | * |
||
5 | * @package Editus |
||
6 | * @author Nick Haskins <[email protected]> |
||
7 | * @link http://edituswp.com |
||
8 | * @copyright 2015 Aesopinteractive LLC |
||
9 | * |
||
10 | * Plugin Name: Editus |
||
11 | * Plugin URI: http://edituswp.com |
||
12 | * Description: Front-end editor and story builder. |
||
13 | * Version: 0.9.8.2 |
||
14 | * Author: Aesopinteractive LLC |
||
15 | * Author URI: http://aesopinteractive.com |
||
16 | * Text Domain: lasso |
||
17 | * Domain Path: /languages |
||
18 | */ |
||
19 | |||
20 | // If this file is called directly, abort. |
||
21 | if ( ! defined( 'WPINC' ) ) { |
||
22 | die; |
||
23 | } |
||
24 | |||
25 | // Set some constants |
||
26 | define( 'LASSO_VERSION', '0.9.8.2' ); |
||
27 | define( 'LASSO_DIR', plugin_dir_path( __FILE__ ) ); |
||
28 | define( 'LASSO_URL', plugins_url( '', __FILE__ ) ); |
||
29 | define( 'LASSO_FILE', __FILE__ ); |
||
30 | |||
31 | /** |
||
32 | * Load plugin if PHP version is 5.4 or later. |
||
33 | */ |
||
34 | if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { |
||
35 | |||
36 | include_once( LASSO_DIR . '/bootstrap.php' ); |
||
37 | |||
38 | } else { |
||
39 | |||
40 | add_action('admin_head', 'lasso_fail_notice'); |
||
41 | function lasso_fail_notice(){ |
||
42 | |||
43 | printf('<div class="error"><p>Lasso requires PHP 5.4 or higher.</p></div>'); |
||
44 | |||
45 | } |
||
46 | } |
||
47 | |||
48 | |||
49 |
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.