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 | * UIX WordPress Plugin |
||
4 | * |
||
5 | * @package uix |
||
6 | * @author David Cramer |
||
7 | * @license GPL-2.0+ |
||
8 | * @link |
||
9 | * @copyright 2016 David Cramer |
||
10 | * @wordpress-plugin |
||
11 | * Plugin Name: UIX |
||
12 | * Plugin URI: http://cramer.co.za |
||
13 | * Description: UI Framework for WordPress Plugins. |
||
14 | * Version: 3.0.0 |
||
15 | * Author: David Cramer |
||
16 | * Author URI: http://cramer.co.za |
||
17 | * Text Domain: uix |
||
18 | * License: GPL-2.0+ |
||
19 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
||
20 | * Domain Path: /languages |
||
21 | */ |
||
22 | |||
23 | // If this file is called directly, abort. |
||
24 | if ( defined( 'WPINC' ) ) { |
||
25 | |||
26 | define( 'UIX_CORE', __FILE__ ); |
||
27 | define( 'UIX_PATH', plugin_dir_path( __FILE__ ) ); |
||
28 | define( 'UIX_URL', plugin_dir_url( __FILE__ ) ); |
||
29 | define( 'UIX_VER', '3.0.0' ); |
||
30 | |||
31 | // include uix bootstrap. |
||
32 | require_once UIX_PATH . 'uix-bootstrap.php'; |
||
33 | |||
34 | } |
||
35 |
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.