@@ -27,180 +27,180 @@ |
||
27 | 27 | class InvalidCheckoutAccess |
28 | 28 | { |
29 | 29 | |
30 | - /** |
|
31 | - * key used for saving invalid checkout access data to the wp_options table |
|
32 | - */ |
|
33 | - const OPTION_KEY = 'ee_invalid_checkout_access'; |
|
30 | + /** |
|
31 | + * key used for saving invalid checkout access data to the wp_options table |
|
32 | + */ |
|
33 | + const OPTION_KEY = 'ee_invalid_checkout_access'; |
|
34 | 34 | |
35 | 35 | |
36 | - /** |
|
37 | - * _block_bots |
|
38 | - * checks that the incoming request has either of the following set: |
|
39 | - * a uts (unix timestamp) which indicates that the request was redirected from the Ticket Selector |
|
40 | - * a REG URL Link, which indicates that the request is a return visit to SPCO for a valid TXN |
|
41 | - * so if you're not coming from the Ticket Selector nor returning for a valid IP... |
|
42 | - * then where you coming from man? |
|
43 | - * |
|
44 | - * @param EE_Checkout $checkout |
|
45 | - * @return bool true if access to registration checkout appears to be invalid |
|
46 | - */ |
|
47 | - public function checkoutAccessIsInvalid(EE_Checkout $checkout) |
|
48 | - { |
|
49 | - if (! ($checkout->uts || $checkout->reg_url_link) |
|
50 | - && ! (defined('DOING_AJAX') && DOING_AJAX) |
|
51 | - && EE_Config::instance()->registration->track_invalid_checkout_access() |
|
52 | - ) { |
|
53 | - /** @var RequestInterface $request */ |
|
54 | - $request = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\request\RequestInterface'); |
|
55 | - $ip_address = $request->ipAddress(); |
|
56 | - $ee_bot_checkout = get_option(InvalidCheckoutAccess::OPTION_KEY); |
|
57 | - if ($ee_bot_checkout === false) { |
|
58 | - $ee_bot_checkout = array(); |
|
59 | - add_option(InvalidCheckoutAccess::OPTION_KEY, $ee_bot_checkout, '', false); |
|
60 | - } |
|
61 | - if (! isset($ee_bot_checkout[ $ip_address ])) { |
|
62 | - $ee_bot_checkout[ $ip_address ] = array(); |
|
63 | - } |
|
64 | - $http_referer = isset($_SERVER['HTTP_REFERER']) |
|
65 | - ? esc_attr($_SERVER['HTTP_REFERER']) |
|
66 | - : 0; |
|
67 | - if (! isset($ee_bot_checkout[ $ip_address ][ $http_referer ])) { |
|
68 | - $ee_bot_checkout[ $ip_address ][ $http_referer ] = 0; |
|
69 | - } |
|
70 | - $ee_bot_checkout[ $ip_address ][ $http_referer ]++; |
|
71 | - update_option(InvalidCheckoutAccess::OPTION_KEY, $ee_bot_checkout); |
|
72 | - if (WP_DEBUG) { |
|
73 | - EE_Error::add_error( |
|
74 | - esc_html__('Direct access to the registration checkout page is not allowed.', 'event_espresso'), |
|
75 | - __FILE__, |
|
76 | - __FUNCTION__, |
|
77 | - __LINE__ |
|
78 | - ); |
|
79 | - } |
|
80 | - return true; |
|
81 | - } |
|
82 | - return false; |
|
83 | - } |
|
36 | + /** |
|
37 | + * _block_bots |
|
38 | + * checks that the incoming request has either of the following set: |
|
39 | + * a uts (unix timestamp) which indicates that the request was redirected from the Ticket Selector |
|
40 | + * a REG URL Link, which indicates that the request is a return visit to SPCO for a valid TXN |
|
41 | + * so if you're not coming from the Ticket Selector nor returning for a valid IP... |
|
42 | + * then where you coming from man? |
|
43 | + * |
|
44 | + * @param EE_Checkout $checkout |
|
45 | + * @return bool true if access to registration checkout appears to be invalid |
|
46 | + */ |
|
47 | + public function checkoutAccessIsInvalid(EE_Checkout $checkout) |
|
48 | + { |
|
49 | + if (! ($checkout->uts || $checkout->reg_url_link) |
|
50 | + && ! (defined('DOING_AJAX') && DOING_AJAX) |
|
51 | + && EE_Config::instance()->registration->track_invalid_checkout_access() |
|
52 | + ) { |
|
53 | + /** @var RequestInterface $request */ |
|
54 | + $request = LoaderFactory::getLoader()->getShared('EventEspresso\core\services\request\RequestInterface'); |
|
55 | + $ip_address = $request->ipAddress(); |
|
56 | + $ee_bot_checkout = get_option(InvalidCheckoutAccess::OPTION_KEY); |
|
57 | + if ($ee_bot_checkout === false) { |
|
58 | + $ee_bot_checkout = array(); |
|
59 | + add_option(InvalidCheckoutAccess::OPTION_KEY, $ee_bot_checkout, '', false); |
|
60 | + } |
|
61 | + if (! isset($ee_bot_checkout[ $ip_address ])) { |
|
62 | + $ee_bot_checkout[ $ip_address ] = array(); |
|
63 | + } |
|
64 | + $http_referer = isset($_SERVER['HTTP_REFERER']) |
|
65 | + ? esc_attr($_SERVER['HTTP_REFERER']) |
|
66 | + : 0; |
|
67 | + if (! isset($ee_bot_checkout[ $ip_address ][ $http_referer ])) { |
|
68 | + $ee_bot_checkout[ $ip_address ][ $http_referer ] = 0; |
|
69 | + } |
|
70 | + $ee_bot_checkout[ $ip_address ][ $http_referer ]++; |
|
71 | + update_option(InvalidCheckoutAccess::OPTION_KEY, $ee_bot_checkout); |
|
72 | + if (WP_DEBUG) { |
|
73 | + EE_Error::add_error( |
|
74 | + esc_html__('Direct access to the registration checkout page is not allowed.', 'event_espresso'), |
|
75 | + __FILE__, |
|
76 | + __FUNCTION__, |
|
77 | + __LINE__ |
|
78 | + ); |
|
79 | + } |
|
80 | + return true; |
|
81 | + } |
|
82 | + return false; |
|
83 | + } |
|
84 | 84 | |
85 | 85 | |
86 | - /** |
|
87 | - * _invalid_checkout_access_form |
|
88 | - * |
|
89 | - * @return EE_Form_Section_Proper |
|
90 | - * @throws EE_Error |
|
91 | - */ |
|
92 | - public function getForm() |
|
93 | - { |
|
94 | - return new EE_Form_Section_Proper( |
|
95 | - array( |
|
96 | - 'name' => 'invalid_checkout_access', |
|
97 | - 'html_id' => 'invalid_checkout_access', |
|
98 | - 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
99 | - 'subsections' => array( |
|
100 | - 'invalid_checkout_access_hdr' => new EE_Form_Section_HTML( |
|
101 | - EEH_HTML::h2(esc_html__('Invalid Checkout Access', 'event_espresso')) |
|
102 | - ), |
|
103 | - 'ee_bot_checkout_data' => new EE_Text_Area_Input( |
|
104 | - array( |
|
105 | - 'html_label_text' => esc_html__('Invalid Checkout Data', 'event_espresso'), |
|
106 | - 'default' => var_export( |
|
107 | - get_option(InvalidCheckoutAccess::OPTION_KEY, array()), |
|
108 | - true |
|
109 | - ), |
|
110 | - 'required' => false, |
|
111 | - 'html_help_text' => esc_html__( |
|
112 | - 'Event Espresso blocks any attempt to directly access the registration checkout page, that is NOT from a Ticket Selector or for a return visit for a valid transaction. These are not valid requests accessing your checkout page, so we track the IP addresses, what web page they just came from, and the number of times that they have attempted to access your registration page. This information may help you with protecting your site by other means, such as firewalls, etc, but please note that IP addresses are almost guaranteed to be spoofed by malicious agents.', |
|
113 | - 'event_espresso' |
|
114 | - ), |
|
115 | - ) |
|
116 | - ), |
|
117 | - 'track_invalid_checkout_access' => new EE_Yes_No_Input( |
|
118 | - array( |
|
119 | - 'html_label_text' => __('Track Invalid Checkout Access?', 'event_espresso'), |
|
120 | - 'html_help_text' => esc_html__( |
|
121 | - 'Controls whether or not invalid attempts to directly access the registration checkout page should be tracked. Setting this to "No" means that the above data will no longer be collected.', |
|
122 | - 'event_espresso' |
|
123 | - ), |
|
124 | - 'default' => EE_Config::instance() |
|
125 | - ->registration |
|
126 | - ->track_invalid_checkout_access(), |
|
127 | - 'display_html_label_text' => false, |
|
128 | - ) |
|
129 | - ), |
|
130 | - 'delete_invalid_checkout_data' => new EE_Yes_No_Input( |
|
131 | - array( |
|
132 | - 'html_label_text' => __('Reset Invalid Checkout Data', 'event_espresso'), |
|
133 | - 'html_help_text' => esc_html__( |
|
134 | - 'Setting this to "Yes" will delete all existing invalid checkout access data.', |
|
135 | - 'event_espresso' |
|
136 | - ), |
|
137 | - 'default' => false, |
|
138 | - 'display_html_label_text' => false, |
|
139 | - ) |
|
140 | - ), |
|
141 | - ), |
|
142 | - ) |
|
143 | - ); |
|
144 | - } |
|
86 | + /** |
|
87 | + * _invalid_checkout_access_form |
|
88 | + * |
|
89 | + * @return EE_Form_Section_Proper |
|
90 | + * @throws EE_Error |
|
91 | + */ |
|
92 | + public function getForm() |
|
93 | + { |
|
94 | + return new EE_Form_Section_Proper( |
|
95 | + array( |
|
96 | + 'name' => 'invalid_checkout_access', |
|
97 | + 'html_id' => 'invalid_checkout_access', |
|
98 | + 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
99 | + 'subsections' => array( |
|
100 | + 'invalid_checkout_access_hdr' => new EE_Form_Section_HTML( |
|
101 | + EEH_HTML::h2(esc_html__('Invalid Checkout Access', 'event_espresso')) |
|
102 | + ), |
|
103 | + 'ee_bot_checkout_data' => new EE_Text_Area_Input( |
|
104 | + array( |
|
105 | + 'html_label_text' => esc_html__('Invalid Checkout Data', 'event_espresso'), |
|
106 | + 'default' => var_export( |
|
107 | + get_option(InvalidCheckoutAccess::OPTION_KEY, array()), |
|
108 | + true |
|
109 | + ), |
|
110 | + 'required' => false, |
|
111 | + 'html_help_text' => esc_html__( |
|
112 | + 'Event Espresso blocks any attempt to directly access the registration checkout page, that is NOT from a Ticket Selector or for a return visit for a valid transaction. These are not valid requests accessing your checkout page, so we track the IP addresses, what web page they just came from, and the number of times that they have attempted to access your registration page. This information may help you with protecting your site by other means, such as firewalls, etc, but please note that IP addresses are almost guaranteed to be spoofed by malicious agents.', |
|
113 | + 'event_espresso' |
|
114 | + ), |
|
115 | + ) |
|
116 | + ), |
|
117 | + 'track_invalid_checkout_access' => new EE_Yes_No_Input( |
|
118 | + array( |
|
119 | + 'html_label_text' => __('Track Invalid Checkout Access?', 'event_espresso'), |
|
120 | + 'html_help_text' => esc_html__( |
|
121 | + 'Controls whether or not invalid attempts to directly access the registration checkout page should be tracked. Setting this to "No" means that the above data will no longer be collected.', |
|
122 | + 'event_espresso' |
|
123 | + ), |
|
124 | + 'default' => EE_Config::instance() |
|
125 | + ->registration |
|
126 | + ->track_invalid_checkout_access(), |
|
127 | + 'display_html_label_text' => false, |
|
128 | + ) |
|
129 | + ), |
|
130 | + 'delete_invalid_checkout_data' => new EE_Yes_No_Input( |
|
131 | + array( |
|
132 | + 'html_label_text' => __('Reset Invalid Checkout Data', 'event_espresso'), |
|
133 | + 'html_help_text' => esc_html__( |
|
134 | + 'Setting this to "Yes" will delete all existing invalid checkout access data.', |
|
135 | + 'event_espresso' |
|
136 | + ), |
|
137 | + 'default' => false, |
|
138 | + 'display_html_label_text' => false, |
|
139 | + ) |
|
140 | + ), |
|
141 | + ), |
|
142 | + ) |
|
143 | + ); |
|
144 | + } |
|
145 | 145 | |
146 | 146 | |
147 | - /** |
|
148 | - * update_invalid_checkout_access_form |
|
149 | - * |
|
150 | - * @param EE_Registration_Config $EE_Registration_Config |
|
151 | - * @return EE_Registration_Config |
|
152 | - * @throws EE_Error |
|
153 | - * @throws ReflectionException |
|
154 | - */ |
|
155 | - public function processForm(EE_Registration_Config $EE_Registration_Config) |
|
156 | - { |
|
157 | - try { |
|
158 | - $invalid_checkout_access_form = $this->getForm(); |
|
159 | - // if not displaying a form, then check for form submission |
|
160 | - if ($invalid_checkout_access_form->was_submitted()) { |
|
161 | - // capture form data |
|
162 | - $invalid_checkout_access_form->receive_form_submission(); |
|
163 | - // validate form data |
|
164 | - if ($invalid_checkout_access_form->is_valid()) { |
|
165 | - // grab validated data from form |
|
166 | - $valid_data = $invalid_checkout_access_form->valid_data(); |
|
167 | - // ensure form inputs we want are set |
|
168 | - if (isset( |
|
169 | - $valid_data['track_invalid_checkout_access'], |
|
170 | - $valid_data['delete_invalid_checkout_data'] |
|
171 | - )) { |
|
172 | - $EE_Registration_Config->set_track_invalid_checkout_access( |
|
173 | - $valid_data['track_invalid_checkout_access'] |
|
174 | - ); |
|
175 | - // if deleting, then update option with empty array |
|
176 | - if (filter_var($valid_data['delete_invalid_checkout_data'], FILTER_VALIDATE_BOOLEAN)) { |
|
177 | - update_option(InvalidCheckoutAccess::OPTION_KEY, array()); |
|
178 | - } |
|
179 | - } else { |
|
180 | - EE_Error::add_error( |
|
181 | - esc_html__( |
|
182 | - 'Invalid or missing Invalid Checkout Access form data. Please refresh the form and try again.', |
|
183 | - 'event_espresso' |
|
184 | - ), |
|
185 | - __FILE__, |
|
186 | - __FUNCTION__, |
|
187 | - __LINE__ |
|
188 | - ); |
|
189 | - } |
|
190 | - } else { |
|
191 | - if ($invalid_checkout_access_form->submission_error_message() !== '') { |
|
192 | - EE_Error::add_error( |
|
193 | - $invalid_checkout_access_form->submission_error_message(), |
|
194 | - __FILE__, |
|
195 | - __FUNCTION__, |
|
196 | - __LINE__ |
|
197 | - ); |
|
198 | - } |
|
199 | - } |
|
200 | - } |
|
201 | - } catch (EE_Error $e) { |
|
202 | - $e->get_error(); |
|
203 | - } |
|
204 | - return $EE_Registration_Config; |
|
205 | - } |
|
147 | + /** |
|
148 | + * update_invalid_checkout_access_form |
|
149 | + * |
|
150 | + * @param EE_Registration_Config $EE_Registration_Config |
|
151 | + * @return EE_Registration_Config |
|
152 | + * @throws EE_Error |
|
153 | + * @throws ReflectionException |
|
154 | + */ |
|
155 | + public function processForm(EE_Registration_Config $EE_Registration_Config) |
|
156 | + { |
|
157 | + try { |
|
158 | + $invalid_checkout_access_form = $this->getForm(); |
|
159 | + // if not displaying a form, then check for form submission |
|
160 | + if ($invalid_checkout_access_form->was_submitted()) { |
|
161 | + // capture form data |
|
162 | + $invalid_checkout_access_form->receive_form_submission(); |
|
163 | + // validate form data |
|
164 | + if ($invalid_checkout_access_form->is_valid()) { |
|
165 | + // grab validated data from form |
|
166 | + $valid_data = $invalid_checkout_access_form->valid_data(); |
|
167 | + // ensure form inputs we want are set |
|
168 | + if (isset( |
|
169 | + $valid_data['track_invalid_checkout_access'], |
|
170 | + $valid_data['delete_invalid_checkout_data'] |
|
171 | + )) { |
|
172 | + $EE_Registration_Config->set_track_invalid_checkout_access( |
|
173 | + $valid_data['track_invalid_checkout_access'] |
|
174 | + ); |
|
175 | + // if deleting, then update option with empty array |
|
176 | + if (filter_var($valid_data['delete_invalid_checkout_data'], FILTER_VALIDATE_BOOLEAN)) { |
|
177 | + update_option(InvalidCheckoutAccess::OPTION_KEY, array()); |
|
178 | + } |
|
179 | + } else { |
|
180 | + EE_Error::add_error( |
|
181 | + esc_html__( |
|
182 | + 'Invalid or missing Invalid Checkout Access form data. Please refresh the form and try again.', |
|
183 | + 'event_espresso' |
|
184 | + ), |
|
185 | + __FILE__, |
|
186 | + __FUNCTION__, |
|
187 | + __LINE__ |
|
188 | + ); |
|
189 | + } |
|
190 | + } else { |
|
191 | + if ($invalid_checkout_access_form->submission_error_message() !== '') { |
|
192 | + EE_Error::add_error( |
|
193 | + $invalid_checkout_access_form->submission_error_message(), |
|
194 | + __FILE__, |
|
195 | + __FUNCTION__, |
|
196 | + __LINE__ |
|
197 | + ); |
|
198 | + } |
|
199 | + } |
|
200 | + } |
|
201 | + } catch (EE_Error $e) { |
|
202 | + $e->get_error(); |
|
203 | + } |
|
204 | + return $EE_Registration_Config; |
|
205 | + } |
|
206 | 206 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function checkoutAccessIsInvalid(EE_Checkout $checkout) |
48 | 48 | { |
49 | - if (! ($checkout->uts || $checkout->reg_url_link) |
|
49 | + if ( ! ($checkout->uts || $checkout->reg_url_link) |
|
50 | 50 | && ! (defined('DOING_AJAX') && DOING_AJAX) |
51 | 51 | && EE_Config::instance()->registration->track_invalid_checkout_access() |
52 | 52 | ) { |
@@ -58,16 +58,16 @@ discard block |
||
58 | 58 | $ee_bot_checkout = array(); |
59 | 59 | add_option(InvalidCheckoutAccess::OPTION_KEY, $ee_bot_checkout, '', false); |
60 | 60 | } |
61 | - if (! isset($ee_bot_checkout[ $ip_address ])) { |
|
62 | - $ee_bot_checkout[ $ip_address ] = array(); |
|
61 | + if ( ! isset($ee_bot_checkout[$ip_address])) { |
|
62 | + $ee_bot_checkout[$ip_address] = array(); |
|
63 | 63 | } |
64 | 64 | $http_referer = isset($_SERVER['HTTP_REFERER']) |
65 | 65 | ? esc_attr($_SERVER['HTTP_REFERER']) |
66 | 66 | : 0; |
67 | - if (! isset($ee_bot_checkout[ $ip_address ][ $http_referer ])) { |
|
68 | - $ee_bot_checkout[ $ip_address ][ $http_referer ] = 0; |
|
67 | + if ( ! isset($ee_bot_checkout[$ip_address][$http_referer])) { |
|
68 | + $ee_bot_checkout[$ip_address][$http_referer] = 0; |
|
69 | 69 | } |
70 | - $ee_bot_checkout[ $ip_address ][ $http_referer ]++; |
|
70 | + $ee_bot_checkout[$ip_address][$http_referer]++; |
|
71 | 71 | update_option(InvalidCheckoutAccess::OPTION_KEY, $ee_bot_checkout); |
72 | 72 | if (WP_DEBUG) { |
73 | 73 | EE_Error::add_error( |
@@ -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.6.2'); |
|
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.6.2'); |
|
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.10.14.rc.000'); |
|
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.10.14.rc.000'); |
|
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 | } |