-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathespresso.php
174 lines (161 loc) · 6.83 KB
/
espresso.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php defined('ABSPATH') || exit('No direct script access allowed');
/*
Plugin Name: Event Espresso
Plugin URI: https://eventespresso.com/pricing/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=wordpress_plugins_page&utm_content=support_link
Description: Manage events, sell tickets, and receive payments from your WordPress website. Reduce event administration time, cut-out ticketing fees, and own your customer data. | <a href="https://eventespresso.com/add-ons/?utm_source=plugin_activation_screen&utm_medium=link&utm_campaign=plugin_description">Extensions</a> | <a href="https://eventespresso.com/pricing/?utm_source=plugin_activation_screen&utm_medium=link&utm_campaign=plugin_description">Sales</a> | <a href="admin.php?page=espresso_support">Support</a>
Version: 5.0.34.rc.000
Author: Event Espresso
Author URI: https://eventespresso.com/?ee_ver=ee4&utm_source=ee4_plugin_admin&utm_medium=link&utm_campaign=wordpress_plugins_page&utm_content=support_link
License: GPLv3
Text Domain: event_espresso
GitHub Plugin URI: https://github.com/eventespresso/event-espresso-core
Copyright (c) 2008-2019 Event Espresso All Rights Reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* Event Espresso
* Event Registration and Management Plugin for WordPress
*
* @package Event Espresso
* @author Seth Shoultes
* @copyright (c) 2008-2018 Event Espresso All Rights Reserved.
* @license {@link https://eventespresso.com/support/terms-conditions/}
* @see Plugin Licensing
* @link {@link https://www.eventespresso.com}
* @since 4.0
*/
if (function_exists('espresso_version')) {
if (! function_exists('espresso_duplicate_plugin_error')) {
/**
* espresso_duplicate_plugin_error
* displays if more than one version of EE is activated at the same time.
*/
function espresso_duplicate_plugin_error()
{
?>
<div class="error">
<p>
<?php
echo esc_html__(
'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.',
'event_espresso'
); ?>
</p>
</div>
<?php
espresso_deactivate_plugin(plugin_basename(__FILE__));
}
}
add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
} else {
define('EE_MIN_PHP_VER_REQUIRED', '7.4.0');
if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
/**
* espresso_minimum_php_version_error
*
* @return void
*/
function espresso_minimum_php_version_error()
{
?>
<div class="error">
<p>
<?php
printf(
esc_html__(
'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.',
'event_espresso'
),
EE_MIN_PHP_VER_REQUIRED,
PHP_VERSION,
'<br/>',
'<a href="https://www.php.net/downloads.php">https://php.net/downloads.php</a>'
);
?>
</p>
</div>
<?php
espresso_deactivate_plugin(plugin_basename(__FILE__));
}
add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
} else {
define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
require_once __DIR__ . '/vendor/autoload.php';
/**
* espresso_version
* Returns the plugin version
*
* @return string
*/
function espresso_version(): string
{
return apply_filters('FHEE__espresso__espresso_version', '5.0.34.rc.000');
}
/**
* espresso_plugin_activation
* adds a wp-option to indicate that EE has been activated via the WP admin plugins page
*/
function espresso_plugin_activation()
{
update_option('ee_espresso_activation', true);
update_option('event-espresso-core_allow_tracking', 'no');
update_option('event-espresso-core_tracking_notice', 'hide');
// Run WP GraphQL activation callback
espressoLoadWpGraphQL();
graphql_activation_callback();
}
register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
/**
* espresso_plugin_deactivation
*/
function espresso_plugin_deactivation()
{
// Run WP GraphQL deactivation callback
espressoLoadWpGraphQL();
graphql_deactivation_callback();
delete_option('event-espresso-core_allow_tracking');
delete_option('event-espresso-core_tracking_notice');
}
register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation');
require_once __DIR__ . '/core/bootstrap_espresso.php';
bootstrap_espresso();
}
}
if (! function_exists('espresso_deactivate_plugin')) {
/**
* deactivate_plugin
* usage: espresso_deactivate_plugin( plugin_basename( __FILE__ ));
*
* @access public
* @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
* @return void
*/
function espresso_deactivate_plugin(string $plugin_basename = '')
{
if (! function_exists('deactivate_plugins')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
unset($_GET['activate'], $_REQUEST['activate']);
deactivate_plugins($plugin_basename);
}
}
if (! function_exists('espressoLoadWpGraphQL')) {
function espressoLoadWpGraphQL()
{
if (
! class_exists('WPGraphQL')
&& is_readable(__DIR__ . '/vendor/wp-graphql/wp-graphql/wp-graphql.php')
) {
require_once __DIR__ . '/vendor/wp-graphql/wp-graphql/wp-graphql.php';
}
}
}