@@ -6,22 +6,22 @@ discard block |
||
6 | 6 | */ |
7 | 7 | function espresso_load_error_handling() |
8 | 8 | { |
9 | - static $error_handling_loaded = false; |
|
10 | - if ($error_handling_loaded) { |
|
11 | - return; |
|
12 | - } |
|
13 | - // load debugging tools |
|
14 | - if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
15 | - require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
16 | - \EEH_Debug_Tools::instance(); |
|
17 | - } |
|
18 | - // load error handling |
|
19 | - if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
20 | - require_once EE_CORE . 'EE_Error.core.php'; |
|
21 | - } else { |
|
22 | - wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
23 | - } |
|
24 | - $error_handling_loaded = true; |
|
9 | + static $error_handling_loaded = false; |
|
10 | + if ($error_handling_loaded) { |
|
11 | + return; |
|
12 | + } |
|
13 | + // load debugging tools |
|
14 | + if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
15 | + require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
16 | + \EEH_Debug_Tools::instance(); |
|
17 | + } |
|
18 | + // load error handling |
|
19 | + if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
20 | + require_once EE_CORE . 'EE_Error.core.php'; |
|
21 | + } else { |
|
22 | + wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
23 | + } |
|
24 | + $error_handling_loaded = true; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -35,19 +35,19 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function espresso_load_required($classname, $full_path_to_file) |
37 | 37 | { |
38 | - if (is_readable($full_path_to_file)) { |
|
39 | - require_once $full_path_to_file; |
|
40 | - } else { |
|
41 | - throw new \EE_Error( |
|
42 | - sprintf( |
|
43 | - esc_html__( |
|
44 | - 'The %s class file could not be located or is not readable due to file permissions.', |
|
45 | - 'event_espresso' |
|
46 | - ), |
|
47 | - $classname |
|
48 | - ) |
|
49 | - ); |
|
50 | - } |
|
38 | + if (is_readable($full_path_to_file)) { |
|
39 | + require_once $full_path_to_file; |
|
40 | + } else { |
|
41 | + throw new \EE_Error( |
|
42 | + sprintf( |
|
43 | + esc_html__( |
|
44 | + 'The %s class file could not be located or is not readable due to file permissions.', |
|
45 | + 'event_espresso' |
|
46 | + ), |
|
47 | + $classname |
|
48 | + ) |
|
49 | + ); |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -66,52 +66,52 @@ discard block |
||
66 | 66 | */ |
67 | 67 | function bootstrap_espresso() |
68 | 68 | { |
69 | - require_once __DIR__ . '/espresso_definitions.php'; |
|
70 | - try { |
|
71 | - espresso_load_error_handling(); |
|
72 | - // include WordPress shims for functions introduced in later versions of WordPress |
|
73 | - espresso_load_required( |
|
74 | - '', |
|
75 | - EE_CORE . 'wordpress-shims.php' |
|
76 | - ); |
|
77 | - espresso_load_required( |
|
78 | - '', |
|
79 | - EE_CORE . 'third-party-compatibility.php' |
|
80 | - ); |
|
81 | - espresso_load_required( |
|
82 | - 'EEH_Base', |
|
83 | - EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
84 | - ); |
|
85 | - espresso_load_required( |
|
86 | - 'EEH_File', |
|
87 | - EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
88 | - ); |
|
89 | - espresso_load_required( |
|
90 | - 'EEH_File', |
|
91 | - EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
92 | - ); |
|
93 | - espresso_load_required( |
|
94 | - 'EEH_Array', |
|
95 | - EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
96 | - ); |
|
97 | - espresso_load_required( |
|
98 | - 'EE_Base', |
|
99 | - EE_CORE . 'EE_Base.core.php' |
|
100 | - ); |
|
101 | - // instantiate and configure PSR4 autoloader |
|
102 | - espresso_load_required( |
|
103 | - 'Psr4Autoloader', |
|
104 | - EE_CORE . 'Psr4Autoloader.php' |
|
105 | - ); |
|
106 | - espresso_load_required( |
|
107 | - 'EE_Psr4AutoloaderInit', |
|
108 | - EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
109 | - ); |
|
110 | - $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
111 | - $AutoloaderInit->initializeAutoloader(); |
|
112 | - new EventEspresso\core\services\bootstrap\BootstrapCore(); |
|
113 | - } catch (Exception $e) { |
|
114 | - require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
115 | - new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
116 | - } |
|
69 | + require_once __DIR__ . '/espresso_definitions.php'; |
|
70 | + try { |
|
71 | + espresso_load_error_handling(); |
|
72 | + // include WordPress shims for functions introduced in later versions of WordPress |
|
73 | + espresso_load_required( |
|
74 | + '', |
|
75 | + EE_CORE . 'wordpress-shims.php' |
|
76 | + ); |
|
77 | + espresso_load_required( |
|
78 | + '', |
|
79 | + EE_CORE . 'third-party-compatibility.php' |
|
80 | + ); |
|
81 | + espresso_load_required( |
|
82 | + 'EEH_Base', |
|
83 | + EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
84 | + ); |
|
85 | + espresso_load_required( |
|
86 | + 'EEH_File', |
|
87 | + EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
88 | + ); |
|
89 | + espresso_load_required( |
|
90 | + 'EEH_File', |
|
91 | + EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
92 | + ); |
|
93 | + espresso_load_required( |
|
94 | + 'EEH_Array', |
|
95 | + EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
96 | + ); |
|
97 | + espresso_load_required( |
|
98 | + 'EE_Base', |
|
99 | + EE_CORE . 'EE_Base.core.php' |
|
100 | + ); |
|
101 | + // instantiate and configure PSR4 autoloader |
|
102 | + espresso_load_required( |
|
103 | + 'Psr4Autoloader', |
|
104 | + EE_CORE . 'Psr4Autoloader.php' |
|
105 | + ); |
|
106 | + espresso_load_required( |
|
107 | + 'EE_Psr4AutoloaderInit', |
|
108 | + EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
109 | + ); |
|
110 | + $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
111 | + $AutoloaderInit->initializeAutoloader(); |
|
112 | + new EventEspresso\core\services\bootstrap\BootstrapCore(); |
|
113 | + } catch (Exception $e) { |
|
114 | + require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
115 | + new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
116 | + } |
|
117 | 117 | } |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | return; |
12 | 12 | } |
13 | 13 | // load debugging tools |
14 | - if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
15 | - require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
14 | + if (WP_DEBUG === true && is_readable(EE_HELPERS.'EEH_Debug_Tools.helper.php')) { |
|
15 | + require_once EE_HELPERS.'EEH_Debug_Tools.helper.php'; |
|
16 | 16 | \EEH_Debug_Tools::instance(); |
17 | 17 | } |
18 | 18 | // load error handling |
19 | - if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
20 | - require_once EE_CORE . 'EE_Error.core.php'; |
|
19 | + if (is_readable(EE_CORE.'EE_Error.core.php')) { |
|
20 | + require_once EE_CORE.'EE_Error.core.php'; |
|
21 | 21 | } else { |
22 | 22 | wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
23 | 23 | } |
@@ -66,52 +66,52 @@ discard block |
||
66 | 66 | */ |
67 | 67 | function bootstrap_espresso() |
68 | 68 | { |
69 | - require_once __DIR__ . '/espresso_definitions.php'; |
|
69 | + require_once __DIR__.'/espresso_definitions.php'; |
|
70 | 70 | try { |
71 | 71 | espresso_load_error_handling(); |
72 | 72 | // include WordPress shims for functions introduced in later versions of WordPress |
73 | 73 | espresso_load_required( |
74 | 74 | '', |
75 | - EE_CORE . 'wordpress-shims.php' |
|
75 | + EE_CORE.'wordpress-shims.php' |
|
76 | 76 | ); |
77 | 77 | espresso_load_required( |
78 | 78 | '', |
79 | - EE_CORE . 'third-party-compatibility.php' |
|
79 | + EE_CORE.'third-party-compatibility.php' |
|
80 | 80 | ); |
81 | 81 | espresso_load_required( |
82 | 82 | 'EEH_Base', |
83 | - EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
83 | + EE_CORE.'helpers'.DS.'EEH_Base.helper.php' |
|
84 | 84 | ); |
85 | 85 | espresso_load_required( |
86 | 86 | 'EEH_File', |
87 | - EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
87 | + EE_CORE.'interfaces'.DS.'EEHI_File.interface.php' |
|
88 | 88 | ); |
89 | 89 | espresso_load_required( |
90 | 90 | 'EEH_File', |
91 | - EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
91 | + EE_CORE.'helpers'.DS.'EEH_File.helper.php' |
|
92 | 92 | ); |
93 | 93 | espresso_load_required( |
94 | 94 | 'EEH_Array', |
95 | - EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
95 | + EE_CORE.'helpers'.DS.'EEH_Array.helper.php' |
|
96 | 96 | ); |
97 | 97 | espresso_load_required( |
98 | 98 | 'EE_Base', |
99 | - EE_CORE . 'EE_Base.core.php' |
|
99 | + EE_CORE.'EE_Base.core.php' |
|
100 | 100 | ); |
101 | 101 | // instantiate and configure PSR4 autoloader |
102 | 102 | espresso_load_required( |
103 | 103 | 'Psr4Autoloader', |
104 | - EE_CORE . 'Psr4Autoloader.php' |
|
104 | + EE_CORE.'Psr4Autoloader.php' |
|
105 | 105 | ); |
106 | 106 | espresso_load_required( |
107 | 107 | 'EE_Psr4AutoloaderInit', |
108 | - EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
108 | + EE_CORE.'EE_Psr4AutoloaderInit.core.php' |
|
109 | 109 | ); |
110 | 110 | $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
111 | 111 | $AutoloaderInit->initializeAutoloader(); |
112 | 112 | new EventEspresso\core\services\bootstrap\BootstrapCore(); |
113 | 113 | } catch (Exception $e) { |
114 | - require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
114 | + require_once EE_CORE.'exceptions'.DS.'ExceptionStackTraceDisplay.php'; |
|
115 | 115 | new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
116 | 116 | } |
117 | 117 | } |
@@ -7,24 +7,24 @@ |
||
7 | 7 | * ACF compatibility |
8 | 8 | */ |
9 | 9 | add_action( |
10 | - 'plugins_loaded', |
|
11 | - function () { |
|
12 | - if (function_exists('acf_include')) { |
|
13 | - add_filter( |
|
14 | - 'acf/get_post_types', |
|
15 | - function ($post_types, $args) { |
|
16 | - if (! empty($args['show_ui'])) { |
|
17 | - $ee_post_types = get_post_types(array('show_ee_ui' => 1)); |
|
18 | - $ee_post_types = array_keys($ee_post_types); |
|
19 | - $post_types = array_merge($post_types, $ee_post_types); |
|
20 | - $post_types = array_unique($post_types); |
|
21 | - } |
|
22 | - return $post_types; |
|
23 | - }, |
|
24 | - 10, |
|
25 | - 2 |
|
26 | - ); |
|
27 | - } |
|
28 | - }, |
|
29 | - 100 |
|
10 | + 'plugins_loaded', |
|
11 | + function () { |
|
12 | + if (function_exists('acf_include')) { |
|
13 | + add_filter( |
|
14 | + 'acf/get_post_types', |
|
15 | + function ($post_types, $args) { |
|
16 | + if (! empty($args['show_ui'])) { |
|
17 | + $ee_post_types = get_post_types(array('show_ee_ui' => 1)); |
|
18 | + $ee_post_types = array_keys($ee_post_types); |
|
19 | + $post_types = array_merge($post_types, $ee_post_types); |
|
20 | + $post_types = array_unique($post_types); |
|
21 | + } |
|
22 | + return $post_types; |
|
23 | + }, |
|
24 | + 10, |
|
25 | + 2 |
|
26 | + ); |
|
27 | + } |
|
28 | + }, |
|
29 | + 100 |
|
30 | 30 | ); |
@@ -8,12 +8,12 @@ |
||
8 | 8 | */ |
9 | 9 | add_action( |
10 | 10 | 'plugins_loaded', |
11 | - function () { |
|
11 | + function() { |
|
12 | 12 | if (function_exists('acf_include')) { |
13 | 13 | add_filter( |
14 | 14 | 'acf/get_post_types', |
15 | - function ($post_types, $args) { |
|
16 | - if (! empty($args['show_ui'])) { |
|
15 | + function($post_types, $args) { |
|
16 | + if ( ! empty($args['show_ui'])) { |
|
17 | 17 | $ee_post_types = get_post_types(array('show_ee_ui' => 1)); |
18 | 18 | $ee_post_types = array_keys($ee_post_types); |
19 | 19 | $post_types = array_merge($post_types, $ee_post_types); |
@@ -38,103 +38,103 @@ |
||
38 | 38 | * @since 4.0 |
39 | 39 | */ |
40 | 40 | if (function_exists('espresso_version')) { |
41 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | - /** |
|
43 | - * espresso_duplicate_plugin_error |
|
44 | - * displays if more than one version of EE is activated at the same time |
|
45 | - */ |
|
46 | - function espresso_duplicate_plugin_error() |
|
47 | - { |
|
48 | - ?> |
|
41 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
42 | + /** |
|
43 | + * espresso_duplicate_plugin_error |
|
44 | + * displays if more than one version of EE is activated at the same time |
|
45 | + */ |
|
46 | + function espresso_duplicate_plugin_error() |
|
47 | + { |
|
48 | + ?> |
|
49 | 49 | <div class="error"> |
50 | 50 | <p> |
51 | 51 | <?php |
52 | - echo esc_html__( |
|
53 | - 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | - 'event_espresso' |
|
55 | - ); ?> |
|
52 | + echo esc_html__( |
|
53 | + 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
54 | + 'event_espresso' |
|
55 | + ); ?> |
|
56 | 56 | </p> |
57 | 57 | </div> |
58 | 58 | <?php |
59 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | - } |
|
61 | - } |
|
62 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
60 | + } |
|
61 | + } |
|
62 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
63 | 63 | } else { |
64 | - define('EE_MIN_PHP_VER_REQUIRED', '5.4.0'); |
|
65 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
66 | - /** |
|
67 | - * espresso_minimum_php_version_error |
|
68 | - * |
|
69 | - * @return void |
|
70 | - */ |
|
71 | - function espresso_minimum_php_version_error() |
|
72 | - { |
|
73 | - ?> |
|
64 | + define('EE_MIN_PHP_VER_REQUIRED', '5.4.0'); |
|
65 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
66 | + /** |
|
67 | + * espresso_minimum_php_version_error |
|
68 | + * |
|
69 | + * @return void |
|
70 | + */ |
|
71 | + function espresso_minimum_php_version_error() |
|
72 | + { |
|
73 | + ?> |
|
74 | 74 | <div class="error"> |
75 | 75 | <p> |
76 | 76 | <?php |
77 | - printf( |
|
78 | - esc_html__( |
|
79 | - 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
80 | - 'event_espresso' |
|
81 | - ), |
|
82 | - EE_MIN_PHP_VER_REQUIRED, |
|
83 | - PHP_VERSION, |
|
84 | - '<br/>', |
|
85 | - '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
86 | - ); |
|
87 | - ?> |
|
77 | + printf( |
|
78 | + esc_html__( |
|
79 | + 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
80 | + 'event_espresso' |
|
81 | + ), |
|
82 | + EE_MIN_PHP_VER_REQUIRED, |
|
83 | + PHP_VERSION, |
|
84 | + '<br/>', |
|
85 | + '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
86 | + ); |
|
87 | + ?> |
|
88 | 88 | </p> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
92 | - } |
|
91 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
92 | + } |
|
93 | 93 | |
94 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
95 | - } else { |
|
96 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
97 | - /** |
|
98 | - * espresso_version |
|
99 | - * Returns the plugin version |
|
100 | - * |
|
101 | - * @return string |
|
102 | - */ |
|
103 | - function espresso_version() |
|
104 | - { |
|
105 | - return apply_filters('FHEE__espresso__espresso_version', '4.9.82.rc.035'); |
|
106 | - } |
|
94 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
95 | + } else { |
|
96 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
97 | + /** |
|
98 | + * espresso_version |
|
99 | + * Returns the plugin version |
|
100 | + * |
|
101 | + * @return string |
|
102 | + */ |
|
103 | + function espresso_version() |
|
104 | + { |
|
105 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.82.rc.035'); |
|
106 | + } |
|
107 | 107 | |
108 | - /** |
|
109 | - * espresso_plugin_activation |
|
110 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
111 | - */ |
|
112 | - function espresso_plugin_activation() |
|
113 | - { |
|
114 | - update_option('ee_espresso_activation', true); |
|
115 | - } |
|
108 | + /** |
|
109 | + * espresso_plugin_activation |
|
110 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
111 | + */ |
|
112 | + function espresso_plugin_activation() |
|
113 | + { |
|
114 | + update_option('ee_espresso_activation', true); |
|
115 | + } |
|
116 | 116 | |
117 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
117 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
118 | 118 | |
119 | - require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
120 | - bootstrap_espresso(); |
|
121 | - } |
|
119 | + require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
120 | + bootstrap_espresso(); |
|
121 | + } |
|
122 | 122 | } |
123 | 123 | if (! function_exists('espresso_deactivate_plugin')) { |
124 | - /** |
|
125 | - * deactivate_plugin |
|
126 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
127 | - * |
|
128 | - * @access public |
|
129 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
130 | - * @return void |
|
131 | - */ |
|
132 | - function espresso_deactivate_plugin($plugin_basename = '') |
|
133 | - { |
|
134 | - if (! function_exists('deactivate_plugins')) { |
|
135 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
136 | - } |
|
137 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
138 | - deactivate_plugins($plugin_basename); |
|
139 | - } |
|
124 | + /** |
|
125 | + * deactivate_plugin |
|
126 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
127 | + * |
|
128 | + * @access public |
|
129 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
130 | + * @return void |
|
131 | + */ |
|
132 | + function espresso_deactivate_plugin($plugin_basename = '') |
|
133 | + { |
|
134 | + if (! function_exists('deactivate_plugins')) { |
|
135 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
136 | + } |
|
137 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
138 | + deactivate_plugins($plugin_basename); |
|
139 | + } |
|
140 | 140 | } |