These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * UIX Bootstrapper |
||
4 | * |
||
5 | * @package uix |
||
6 | * @author David Cramer |
||
7 | * @license GPL-2.0+ |
||
8 | * @link |
||
9 | * @copyright 2017 David Cramer |
||
10 | */ |
||
11 | |||
12 | // If this file is called directly, abort. |
||
13 | if ( defined( 'WPINC' ) ) { |
||
14 | |||
15 | View Code Duplication | if ( ! defined( 'UIX_CORE' ) ) { |
|
0 ignored issues
–
show
|
|||
16 | define( 'UIX_CORE', __FILE__ ); |
||
17 | define( 'UIX_PATH', plugin_dir_path( __FILE__ ) ); |
||
18 | define( 'UIX_URL', plugin_dir_url( __FILE__ ) ); |
||
19 | define( 'UIX_VER', '1.0.0' ); |
||
20 | } |
||
21 | if ( ! defined( 'UIX_ASSET_DEBUG' ) ) { |
||
22 | if ( ! defined( 'DEBUG_SCRIPTS' ) ) { |
||
23 | define( 'UIX_ASSET_DEBUG', '.min' ); |
||
24 | } else { |
||
25 | define( 'UIX_ASSET_DEBUG', '' ); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | |||
30 | // include uix helper functions and autoloader. |
||
31 | require_once UIX_PATH . 'includes/functions.php'; |
||
32 | |||
33 | // register uix autoloader. |
||
34 | spl_autoload_register( 'uix_autoload_class', true, false ); |
||
35 | |||
36 | // bootstrap plugin load. |
||
37 | add_action( 'plugins_loaded', 'uix' ); |
||
38 | |||
39 | } |
||
40 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.