Completed
Pull Request — master (#1071)
by Darren
08:53
created
admin_pages/general_settings/AdminOptionsSettings.php 1 patch
Indentation   +209 added lines, -209 removed lines patch added patch discarded remove patch
@@ -29,224 +29,224 @@
 block discarded – undo
29 29
 class AdminOptionsSettings extends FormHandler
30 30
 {
31 31
 
32
-    protected $template_args = array();
32
+	protected $template_args = array();
33 33
 
34
-    /**
35
-     * Form constructor.
36
-     *
37
-     * @param \EE_Registry $registry
38
-     */
39
-    public function __construct(\EE_Registry $registry)
40
-    {
41
-        parent::__construct(
42
-            esc_html__('Admin Options', 'event_espresso'),
43
-            esc_html__('Admin Options', 'event_espresso'),
44
-            'admin_option_settings',
45
-            '',
46
-            FormHandler::DO_NOT_SETUP_FORM,
47
-            $registry
48
-        );
49
-    }
34
+	/**
35
+	 * Form constructor.
36
+	 *
37
+	 * @param \EE_Registry $registry
38
+	 */
39
+	public function __construct(\EE_Registry $registry)
40
+	{
41
+		parent::__construct(
42
+			esc_html__('Admin Options', 'event_espresso'),
43
+			esc_html__('Admin Options', 'event_espresso'),
44
+			'admin_option_settings',
45
+			'',
46
+			FormHandler::DO_NOT_SETUP_FORM,
47
+			$registry
48
+		);
49
+	}
50 50
 
51 51
 
52
-    /**
53
-     * @param array $template_args
54
-     */
55
-    public function setTemplateArgs(array $template_args)
56
-    {
57
-        $this->template_args = $template_args;
58
-    }
52
+	/**
53
+	 * @param array $template_args
54
+	 */
55
+	public function setTemplateArgs(array $template_args)
56
+	{
57
+		$this->template_args = $template_args;
58
+	}
59 59
 
60 60
 
61
-    /**
62
-     * creates and returns the actual form
63
-     *
64
-     * @return EE_Form_Section_Proper
65
-     * @throws EE_Error
66
-     * @throws InvalidArgumentException
67
-     * @throws InvalidDataTypeException
68
-     * @throws \DomainException
69
-     * @throws InvalidFilePathException
70
-     * @throws InvalidInterfaceException
71
-     */
72
-    public function generate()
73
-    {
74
-        $form = new \EE_Form_Section_Proper(
75
-            array(
76
-                'name'            => 'admin_option_settings',
77
-                'html_id'         => 'admin_option_settings',
78
-                'layout_strategy' => new EE_Admin_Two_Column_Layout(),
79
-                'subsections'     => array(
80
-                    'help_tour_activation_hdr' => new EE_Form_Section_HTML(
81
-                        EEH_HTML::h2(
82
-                            esc_html__('Help Tour Global Activation', 'event_espresso')
83
-                            . ' '
84
-                            . EEH_HTML::span(
85
-                                EEH_Template::get_help_tab_link('help_tour_activation_info'),
86
-                                'help_tour_activation'
87
-                            ),
88
-                            '',
89
-                            'ee-admin-settings-hdr'
90
-                        )
91
-                    ),
92
-                    'help_tour_activation'     => new EE_Yes_No_Input(
93
-                        array(
94
-                            'html_label_text' => esc_html__('Activate Global Help Tours?', 'event_espresso'),
95
-                            'html_help_text'  => esc_html__(
96
-                                'This toggles whether the Event Espresso help tours are active globally or not.',
97
-                                'event_espresso'
98
-                            ),
99
-                            'default'         => isset($this->registry->CFG->admin->help_tour_activation)
100
-                                ? filter_var($this->registry->CFG->admin->help_tour_activation, FILTER_VALIDATE_BOOLEAN)
101
-                                : true,
102
-                            'required'        => false,
103
-                        )
104
-                    ),
105
-                    'compatibility_hdr'        => new EE_Form_Section_HTML(
106
-                        EEH_HTML::h2(
107
-                            esc_html__('Compatibility Settings', 'event_espresso'),
108
-                            '',
109
-                            'ee-admin-settings-hdr'
110
-                        )
111
-                    ),
112
-                    'encode_session_data'      => new EE_Yes_No_Input(
113
-                        array(
114
-                            'html_label_text' => esc_html__('Encode Session Data?', 'event_espresso'),
115
-                            'html_help_text'  => sprintf(
116
-                                esc_html__(
117
-                                    'Some servers and database configurations can cause problems when saving the Event Espresso session data. Setting this option to "Yes" adds an extra layer of encoding to session data to prevent serialization errors, but can be incompatible with some server configurations.%1$sIf you receive "500 internal server" type errors during registration, try turning this option on.%1$sIf you get fatal PHP errors regarding missing base64 functions, then turn this option off.',
118
-                                    'event_espresso'
119
-                                ),
120
-                                '<br>'
121
-                            ),
122
-                            'default'         => $this->registry->CFG->admin->encode_session_data(),
123
-                            'required'        => false,
124
-                        )
125
-                    ),
126
-                ),
127
-            )
128
-        );
129
-        if ($this->registry->CAP->current_user_can(
130
-            'manage_options',
131
-            'display_admin_settings_options_promote_and_affiliate'
132
-        )) {
133
-            $form->add_subsections(
134
-                array(
135
-                    'promote_ee_hdr'  => new EE_Form_Section_HTML(
136
-                        EEH_HTML::h2(
137
-                            esc_html__('Promote Event Espresso', 'event_espresso')
138
-                            . ' '
139
-                            . EEH_HTML::span(
140
-                                EEH_Template::get_help_tab_link('affiliate_info'),
141
-                                'affiliate_info'
142
-                            ),
143
-                            '',
144
-                            'ee-admin-settings-hdr'
145
-                        )
146
-                    ),
147
-                    'show_reg_footer' => new EE_Yes_No_Input(
148
-                        array(
149
-                            'html_label_text' => esc_html__(
150
-                                'Link to Event Espresso in your Registration Page?',
151
-                                'event_espresso'
152
-                            )
153
-                            . EEH_Template::get_help_tab_link('email_validation_info'),
154
-                            'html_help_text'  => esc_html__(
155
-                                'adds an unobtrusive link to Event Espresso\'s website in the footer of your registration form. Get an affiliate link (see below) and make money if people click the link and purchase Event Espresso.',
156
-                                'event_espresso'
157
-                            ),
158
-                            'default'         => isset($this->registry->CFG->admin->show_reg_footer)
159
-                                ? filter_var($this->registry->CFG->admin->show_reg_footer, FILTER_VALIDATE_BOOLEAN)
160
-                                : DomainFactory::getEventEspressoCoreDomain()->isCaffeinated(),
161
-                            'required'        => false,
162
-                        )
163
-                    ),
164
-                    'affiliate_id'    => new EE_Text_Input(
165
-                        array(
166
-                            'html_label_text' => sprintf(
167
-                                esc_html__('Event Espresso %1$sAffiliate%2$s ID', 'event_espresso'),
168
-                                '<a href="http://eventespresso.com/affiliates/" target="_blank">',
169
-                                '</a>'
170
-                            ),
171
-                            'html_help_text'  => esc_html__(
172
-                                'Earn cash for promoting Event Espresso.',
173
-                                'event_espresso'
174
-                            ),
175
-                            'html_class'      => 'regular-text',
176
-                            'default'         => isset($this->registry->CFG->admin->affiliate_id)
177
-                                ? $this->registry->CFG->admin->get_pretty('affiliate_id')
178
-                                : '',
179
-                            'required'        => false,
180
-                        )
181
-                    ),
182
-                ),
183
-                'help_tour_activation_hdr'
184
-            );
185
-        }
186
-        return $form;
187
-    }
61
+	/**
62
+	 * creates and returns the actual form
63
+	 *
64
+	 * @return EE_Form_Section_Proper
65
+	 * @throws EE_Error
66
+	 * @throws InvalidArgumentException
67
+	 * @throws InvalidDataTypeException
68
+	 * @throws \DomainException
69
+	 * @throws InvalidFilePathException
70
+	 * @throws InvalidInterfaceException
71
+	 */
72
+	public function generate()
73
+	{
74
+		$form = new \EE_Form_Section_Proper(
75
+			array(
76
+				'name'            => 'admin_option_settings',
77
+				'html_id'         => 'admin_option_settings',
78
+				'layout_strategy' => new EE_Admin_Two_Column_Layout(),
79
+				'subsections'     => array(
80
+					'help_tour_activation_hdr' => new EE_Form_Section_HTML(
81
+						EEH_HTML::h2(
82
+							esc_html__('Help Tour Global Activation', 'event_espresso')
83
+							. ' '
84
+							. EEH_HTML::span(
85
+								EEH_Template::get_help_tab_link('help_tour_activation_info'),
86
+								'help_tour_activation'
87
+							),
88
+							'',
89
+							'ee-admin-settings-hdr'
90
+						)
91
+					),
92
+					'help_tour_activation'     => new EE_Yes_No_Input(
93
+						array(
94
+							'html_label_text' => esc_html__('Activate Global Help Tours?', 'event_espresso'),
95
+							'html_help_text'  => esc_html__(
96
+								'This toggles whether the Event Espresso help tours are active globally or not.',
97
+								'event_espresso'
98
+							),
99
+							'default'         => isset($this->registry->CFG->admin->help_tour_activation)
100
+								? filter_var($this->registry->CFG->admin->help_tour_activation, FILTER_VALIDATE_BOOLEAN)
101
+								: true,
102
+							'required'        => false,
103
+						)
104
+					),
105
+					'compatibility_hdr'        => new EE_Form_Section_HTML(
106
+						EEH_HTML::h2(
107
+							esc_html__('Compatibility Settings', 'event_espresso'),
108
+							'',
109
+							'ee-admin-settings-hdr'
110
+						)
111
+					),
112
+					'encode_session_data'      => new EE_Yes_No_Input(
113
+						array(
114
+							'html_label_text' => esc_html__('Encode Session Data?', 'event_espresso'),
115
+							'html_help_text'  => sprintf(
116
+								esc_html__(
117
+									'Some servers and database configurations can cause problems when saving the Event Espresso session data. Setting this option to "Yes" adds an extra layer of encoding to session data to prevent serialization errors, but can be incompatible with some server configurations.%1$sIf you receive "500 internal server" type errors during registration, try turning this option on.%1$sIf you get fatal PHP errors regarding missing base64 functions, then turn this option off.',
118
+									'event_espresso'
119
+								),
120
+								'<br>'
121
+							),
122
+							'default'         => $this->registry->CFG->admin->encode_session_data(),
123
+							'required'        => false,
124
+						)
125
+					),
126
+				),
127
+			)
128
+		);
129
+		if ($this->registry->CAP->current_user_can(
130
+			'manage_options',
131
+			'display_admin_settings_options_promote_and_affiliate'
132
+		)) {
133
+			$form->add_subsections(
134
+				array(
135
+					'promote_ee_hdr'  => new EE_Form_Section_HTML(
136
+						EEH_HTML::h2(
137
+							esc_html__('Promote Event Espresso', 'event_espresso')
138
+							. ' '
139
+							. EEH_HTML::span(
140
+								EEH_Template::get_help_tab_link('affiliate_info'),
141
+								'affiliate_info'
142
+							),
143
+							'',
144
+							'ee-admin-settings-hdr'
145
+						)
146
+					),
147
+					'show_reg_footer' => new EE_Yes_No_Input(
148
+						array(
149
+							'html_label_text' => esc_html__(
150
+								'Link to Event Espresso in your Registration Page?',
151
+								'event_espresso'
152
+							)
153
+							. EEH_Template::get_help_tab_link('email_validation_info'),
154
+							'html_help_text'  => esc_html__(
155
+								'adds an unobtrusive link to Event Espresso\'s website in the footer of your registration form. Get an affiliate link (see below) and make money if people click the link and purchase Event Espresso.',
156
+								'event_espresso'
157
+							),
158
+							'default'         => isset($this->registry->CFG->admin->show_reg_footer)
159
+								? filter_var($this->registry->CFG->admin->show_reg_footer, FILTER_VALIDATE_BOOLEAN)
160
+								: DomainFactory::getEventEspressoCoreDomain()->isCaffeinated(),
161
+							'required'        => false,
162
+						)
163
+					),
164
+					'affiliate_id'    => new EE_Text_Input(
165
+						array(
166
+							'html_label_text' => sprintf(
167
+								esc_html__('Event Espresso %1$sAffiliate%2$s ID', 'event_espresso'),
168
+								'<a href="http://eventespresso.com/affiliates/" target="_blank">',
169
+								'</a>'
170
+							),
171
+							'html_help_text'  => esc_html__(
172
+								'Earn cash for promoting Event Espresso.',
173
+								'event_espresso'
174
+							),
175
+							'html_class'      => 'regular-text',
176
+							'default'         => isset($this->registry->CFG->admin->affiliate_id)
177
+								? $this->registry->CFG->admin->get_pretty('affiliate_id')
178
+								: '',
179
+							'required'        => false,
180
+						)
181
+					),
182
+				),
183
+				'help_tour_activation_hdr'
184
+			);
185
+		}
186
+		return $form;
187
+	}
188 188
 
189 189
 
190
-    /**
191
-     * takes the generated form and displays it along with ony other non-form HTML that may be required
192
-     * returns a string of HTML that can be directly echoed in a template
193
-     *
194
-     * @return string
195
-     * @throws LogicException
196
-     * @throws \EE_Error
197
-     */
198
-    public function display()
199
-    {
200
-        add_filter(
201
-            'FHEE__EventEspresso_core_libraries_form_sections_form_handlers_FormHandler__display__before_form',
202
-            array($this, 'handleOldAdminOptionsSettingsAction')
203
-        );
204
-        return parent::display();
205
-    }
190
+	/**
191
+	 * takes the generated form and displays it along with ony other non-form HTML that may be required
192
+	 * returns a string of HTML that can be directly echoed in a template
193
+	 *
194
+	 * @return string
195
+	 * @throws LogicException
196
+	 * @throws \EE_Error
197
+	 */
198
+	public function display()
199
+	{
200
+		add_filter(
201
+			'FHEE__EventEspresso_core_libraries_form_sections_form_handlers_FormHandler__display__before_form',
202
+			array($this, 'handleOldAdminOptionsSettingsAction')
203
+		);
204
+		return parent::display();
205
+	}
206 206
 
207 207
 
208
-    /**
209
-     * @return string
210
-     */
211
-    public function handleOldAdminOptionsSettingsAction()
212
-    {
213
-        ob_start();
214
-        do_action('AHEE__admin_option_settings__template__before', $this->template_args);
215
-        return ob_get_clean();
216
-    }
208
+	/**
209
+	 * @return string
210
+	 */
211
+	public function handleOldAdminOptionsSettingsAction()
212
+	{
213
+		ob_start();
214
+		do_action('AHEE__admin_option_settings__template__before', $this->template_args);
215
+		return ob_get_clean();
216
+	}
217 217
 
218 218
 
219
-    /**
220
-     * handles processing the form submission
221
-     * returns true or false depending on whether the form was processed successfully or not
222
-     *
223
-     * @param array $form_data
224
-     * @return bool
225
-     * @throws InvalidFormSubmissionException
226
-     * @throws EE_Error
227
-     * @throws LogicException
228
-     * @throws InvalidArgumentException
229
-     * @throws InvalidDataTypeException
230
-     */
231
-    public function process($form_data = array())
232
-    {
233
-        // process form
234
-        $valid_data = (array) parent::process($form_data);
235
-        if (empty($valid_data)) {
236
-            return false;
237
-        }
238
-        $this->registry->CFG->admin->show_reg_footer = isset($form_data['show_reg_footer'])
239
-            ? absint($form_data['show_reg_footer'])
240
-            : $this->registry->CFG->admin->show_reg_footer;
241
-        $this->registry->CFG->admin->affiliate_id = isset($form_data['affiliate_id'])
242
-            ? sanitize_text_field($form_data['affiliate_id'])
243
-            : $this->registry->CFG->admin->affiliate_id;
244
-        $this->registry->CFG->admin->help_tour_activation = isset($form_data['help_tour_activation'])
245
-            ? absint($form_data['help_tour_activation'])
246
-            : $this->registry->CFG->admin->help_tour_activation;
247
-        if (isset($form_data['encode_session_data'])) {
248
-            $this->registry->CFG->admin->set_encode_session_data($form_data['encode_session_data']);
249
-        }
250
-        return false;
251
-    }
219
+	/**
220
+	 * handles processing the form submission
221
+	 * returns true or false depending on whether the form was processed successfully or not
222
+	 *
223
+	 * @param array $form_data
224
+	 * @return bool
225
+	 * @throws InvalidFormSubmissionException
226
+	 * @throws EE_Error
227
+	 * @throws LogicException
228
+	 * @throws InvalidArgumentException
229
+	 * @throws InvalidDataTypeException
230
+	 */
231
+	public function process($form_data = array())
232
+	{
233
+		// process form
234
+		$valid_data = (array) parent::process($form_data);
235
+		if (empty($valid_data)) {
236
+			return false;
237
+		}
238
+		$this->registry->CFG->admin->show_reg_footer = isset($form_data['show_reg_footer'])
239
+			? absint($form_data['show_reg_footer'])
240
+			: $this->registry->CFG->admin->show_reg_footer;
241
+		$this->registry->CFG->admin->affiliate_id = isset($form_data['affiliate_id'])
242
+			? sanitize_text_field($form_data['affiliate_id'])
243
+			: $this->registry->CFG->admin->affiliate_id;
244
+		$this->registry->CFG->admin->help_tour_activation = isset($form_data['help_tour_activation'])
245
+			? absint($form_data['help_tour_activation'])
246
+			: $this->registry->CFG->admin->help_tour_activation;
247
+		if (isset($form_data['encode_session_data'])) {
248
+			$this->registry->CFG->admin->set_encode_session_data($form_data['encode_session_data']);
249
+		}
250
+		return false;
251
+	}
252 252
 }
Please login to merge, or discard this patch.
core/EE_Config.core.php 1 patch
Indentation   +3156 added lines, -3156 removed lines patch added patch discarded remove patch
@@ -16,2509 +16,2509 @@  discard block
 block discarded – undo
16 16
 final class EE_Config implements ResettableInterface
17 17
 {
18 18
 
19
-    const OPTION_NAME = 'ee_config';
20
-
21
-    const LOG_NAME = 'ee_config_log';
22
-
23
-    const LOG_LENGTH = 100;
24
-
25
-    const ADDON_OPTION_NAMES = 'ee_config_option_names';
26
-
27
-    /**
28
-     *    instance of the EE_Config object
29
-     *
30
-     * @var    EE_Config $_instance
31
-     * @access    private
32
-     */
33
-    private static $_instance;
34
-
35
-    /**
36
-     * @var boolean $_logging_enabled
37
-     */
38
-    private static $_logging_enabled = false;
39
-
40
-    /**
41
-     * @var LegacyShortcodesManager $legacy_shortcodes_manager
42
-     */
43
-    private $legacy_shortcodes_manager;
44
-
45
-    /**
46
-     * An StdClass whose property names are addon slugs,
47
-     * and values are their config classes
48
-     *
49
-     * @var StdClass
50
-     */
51
-    public $addons;
52
-
53
-    /**
54
-     * @var EE_Admin_Config
55
-     */
56
-    public $admin;
57
-
58
-    /**
59
-     * @var EE_Core_Config
60
-     */
61
-    public $core;
62
-
63
-    /**
64
-     * @var EE_Currency_Config
65
-     */
66
-    public $currency;
67
-
68
-    /**
69
-     * @var EE_Organization_Config
70
-     */
71
-    public $organization;
72
-
73
-    /**
74
-     * @var EE_Registration_Config
75
-     */
76
-    public $registration;
77
-
78
-    /**
79
-     * @var EE_Template_Config
80
-     */
81
-    public $template_settings;
82
-
83
-    /**
84
-     * Holds EE environment values.
85
-     *
86
-     * @var EE_Environment_Config
87
-     */
88
-    public $environment;
89
-
90
-    /**
91
-     * settings pertaining to Google maps
92
-     *
93
-     * @var EE_Map_Config
94
-     */
95
-    public $map_settings;
96
-
97
-    /**
98
-     * settings pertaining to Taxes
99
-     *
100
-     * @var EE_Tax_Config
101
-     */
102
-    public $tax_settings;
103
-
104
-    /**
105
-     * Settings pertaining to global messages settings.
106
-     *
107
-     * @var EE_Messages_Config
108
-     */
109
-    public $messages;
110
-
111
-    /**
112
-     * @deprecated
113
-     * @var EE_Gateway_Config
114
-     */
115
-    public $gateway;
116
-
117
-    /**
118
-     * @var    array $_addon_option_names
119
-     * @access    private
120
-     */
121
-    private $_addon_option_names = array();
122
-
123
-    /**
124
-     * @var    array $_module_route_map
125
-     * @access    private
126
-     */
127
-    private static $_module_route_map = array();
128
-
129
-    /**
130
-     * @var    array $_module_forward_map
131
-     * @access    private
132
-     */
133
-    private static $_module_forward_map = array();
134
-
135
-    /**
136
-     * @var    array $_module_view_map
137
-     * @access    private
138
-     */
139
-    private static $_module_view_map = array();
140
-
141
-
142
-    /**
143
-     * @singleton method used to instantiate class object
144
-     * @access    public
145
-     * @return EE_Config instance
146
-     */
147
-    public static function instance()
148
-    {
149
-        // check if class object is instantiated, and instantiated properly
150
-        if (! self::$_instance instanceof EE_Config) {
151
-            self::$_instance = new self();
152
-        }
153
-        return self::$_instance;
154
-    }
155
-
156
-
157
-    /**
158
-     * Resets the config
159
-     *
160
-     * @param bool    $hard_reset    if TRUE, sets EE_CONFig back to its original settings in the database. If FALSE
161
-     *                               (default) leaves the database alone, and merely resets the EE_Config object to
162
-     *                               reflect its state in the database
163
-     * @param boolean $reinstantiate if TRUE (default) call instance() and return it. Otherwise, just leave
164
-     *                               $_instance as NULL. Useful in case you want to forget about the old instance on
165
-     *                               EE_Config, but might not be ready to instantiate EE_Config currently (eg if the
166
-     *                               site was put into maintenance mode)
167
-     * @return EE_Config
168
-     */
169
-    public static function reset($hard_reset = false, $reinstantiate = true)
170
-    {
171
-        if (self::$_instance instanceof EE_Config) {
172
-            if ($hard_reset) {
173
-                self::$_instance->legacy_shortcodes_manager = null;
174
-                self::$_instance->_addon_option_names = array();
175
-                self::$_instance->_initialize_config();
176
-                self::$_instance->update_espresso_config();
177
-            }
178
-            self::$_instance->update_addon_option_names();
179
-        }
180
-        self::$_instance = null;
181
-        // we don't need to reset the static properties imo because those should
182
-        // only change when a module is added or removed. Currently we don't
183
-        // support removing a module during a request when it previously existed
184
-        if ($reinstantiate) {
185
-            return self::instance();
186
-        } else {
187
-            return null;
188
-        }
189
-    }
190
-
191
-
192
-    /**
193
-     *    class constructor
194
-     *
195
-     * @access    private
196
-     */
197
-    private function __construct()
198
-    {
199
-        do_action('AHEE__EE_Config__construct__begin', $this);
200
-        EE_Config::$_logging_enabled = apply_filters('FHEE__EE_Config___construct__logging_enabled', false);
201
-        // setup empty config classes
202
-        $this->_initialize_config();
203
-        // load existing EE site settings
204
-        $this->_load_core_config();
205
-        // confirm everything loaded correctly and set filtered defaults if not
206
-        $this->_verify_config();
207
-        //  register shortcodes and modules
208
-        add_action(
209
-            'AHEE__EE_System__register_shortcodes_modules_and_widgets',
210
-            array($this, 'register_shortcodes_and_modules'),
211
-            999
212
-        );
213
-        //  initialize shortcodes and modules
214
-        add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'initialize_shortcodes_and_modules'));
215
-        // register widgets
216
-        add_action('widgets_init', array($this, 'widgets_init'), 10);
217
-        // shutdown
218
-        add_action('shutdown', array($this, 'shutdown'), 10);
219
-        // construct__end hook
220
-        do_action('AHEE__EE_Config__construct__end', $this);
221
-        // hardcoded hack
222
-        $this->template_settings->current_espresso_theme = 'Espresso_Arabica_2014';
223
-    }
224
-
225
-
226
-    /**
227
-     * @return boolean
228
-     */
229
-    public static function logging_enabled()
230
-    {
231
-        return self::$_logging_enabled;
232
-    }
233
-
234
-
235
-    /**
236
-     * use to get the current theme if needed from static context
237
-     *
238
-     * @return string current theme set.
239
-     */
240
-    public static function get_current_theme()
241
-    {
242
-        return isset(self::$_instance->template_settings->current_espresso_theme)
243
-            ? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
244
-    }
245
-
246
-
247
-    /**
248
-     *        _initialize_config
249
-     *
250
-     * @access private
251
-     * @return void
252
-     */
253
-    private function _initialize_config()
254
-    {
255
-        EE_Config::trim_log();
256
-        // set defaults
257
-        $this->_addon_option_names = get_option(EE_Config::ADDON_OPTION_NAMES, array());
258
-        $this->addons = new stdClass();
259
-        // set _module_route_map
260
-        EE_Config::$_module_route_map = array();
261
-        // set _module_forward_map
262
-        EE_Config::$_module_forward_map = array();
263
-        // set _module_view_map
264
-        EE_Config::$_module_view_map = array();
265
-    }
266
-
267
-
268
-    /**
269
-     *        load core plugin configuration
270
-     *
271
-     * @access private
272
-     * @return void
273
-     */
274
-    private function _load_core_config()
275
-    {
276
-        // load_core_config__start hook
277
-        do_action('AHEE__EE_Config___load_core_config__start', $this);
278
-        $espresso_config = $this->get_espresso_config();
279
-        foreach ($espresso_config as $config => $settings) {
280
-            // load_core_config__start hook
281
-            $settings = apply_filters(
282
-                'FHEE__EE_Config___load_core_config__config_settings',
283
-                $settings,
284
-                $config,
285
-                $this
286
-            );
287
-            if (is_object($settings) && property_exists($this, $config)) {
288
-                $this->{$config} = apply_filters('FHEE__EE_Config___load_core_config__' . $config, $settings);
289
-                // call configs populate method to ensure any defaults are set for empty values.
290
-                if (method_exists($settings, 'populate')) {
291
-                    $this->{$config}->populate();
292
-                }
293
-                if (method_exists($settings, 'do_hooks')) {
294
-                    $this->{$config}->do_hooks();
295
-                }
296
-            }
297
-        }
298
-        if (apply_filters('FHEE__EE_Config___load_core_config__update_espresso_config', false)) {
299
-            $this->update_espresso_config();
300
-        }
301
-        // load_core_config__end hook
302
-        do_action('AHEE__EE_Config___load_core_config__end', $this);
303
-    }
304
-
305
-
306
-    /**
307
-     *    _verify_config
308
-     *
309
-     * @access    protected
310
-     * @return    void
311
-     */
312
-    protected function _verify_config()
313
-    {
314
-        $this->core = $this->core instanceof EE_Core_Config
315
-            ? $this->core
316
-            : new EE_Core_Config();
317
-        $this->core = apply_filters('FHEE__EE_Config___initialize_config__core', $this->core);
318
-        $this->organization = $this->organization instanceof EE_Organization_Config
319
-            ? $this->organization
320
-            : new EE_Organization_Config();
321
-        $this->organization = apply_filters(
322
-            'FHEE__EE_Config___initialize_config__organization',
323
-            $this->organization
324
-        );
325
-        $this->currency = $this->currency instanceof EE_Currency_Config
326
-            ? $this->currency
327
-            : new EE_Currency_Config();
328
-        $this->currency = apply_filters('FHEE__EE_Config___initialize_config__currency', $this->currency);
329
-        $this->registration = $this->registration instanceof EE_Registration_Config
330
-            ? $this->registration
331
-            : new EE_Registration_Config();
332
-        $this->registration = apply_filters(
333
-            'FHEE__EE_Config___initialize_config__registration',
334
-            $this->registration
335
-        );
336
-        $this->admin = $this->admin instanceof EE_Admin_Config
337
-            ? $this->admin
338
-            : new EE_Admin_Config();
339
-        $this->admin = apply_filters('FHEE__EE_Config___initialize_config__admin', $this->admin);
340
-        $this->template_settings = $this->template_settings instanceof EE_Template_Config
341
-            ? $this->template_settings
342
-            : new EE_Template_Config();
343
-        $this->template_settings = apply_filters(
344
-            'FHEE__EE_Config___initialize_config__template_settings',
345
-            $this->template_settings
346
-        );
347
-        $this->map_settings = $this->map_settings instanceof EE_Map_Config
348
-            ? $this->map_settings
349
-            : new EE_Map_Config();
350
-        $this->map_settings = apply_filters(
351
-            'FHEE__EE_Config___initialize_config__map_settings',
352
-            $this->map_settings
353
-        );
354
-        $this->environment = $this->environment instanceof EE_Environment_Config
355
-            ? $this->environment
356
-            : new EE_Environment_Config();
357
-        $this->environment = apply_filters(
358
-            'FHEE__EE_Config___initialize_config__environment',
359
-            $this->environment
360
-        );
361
-        $this->tax_settings = $this->tax_settings instanceof EE_Tax_Config
362
-            ? $this->tax_settings
363
-            : new EE_Tax_Config();
364
-        $this->tax_settings = apply_filters(
365
-            'FHEE__EE_Config___initialize_config__tax_settings',
366
-            $this->tax_settings
367
-        );
368
-        $this->messages = apply_filters('FHEE__EE_Config__initialize_config__messages', $this->messages);
369
-        $this->messages = $this->messages instanceof EE_Messages_Config
370
-            ? $this->messages
371
-            : new EE_Messages_Config();
372
-        $this->gateway = $this->gateway instanceof EE_Gateway_Config
373
-            ? $this->gateway
374
-            : new EE_Gateway_Config();
375
-        $this->gateway = apply_filters('FHEE__EE_Config___initialize_config__gateway', $this->gateway);
376
-        $this->legacy_shortcodes_manager = null;
377
-    }
378
-
379
-
380
-    /**
381
-     *    get_espresso_config
382
-     *
383
-     * @access    public
384
-     * @return    array of espresso config stuff
385
-     */
386
-    public function get_espresso_config()
387
-    {
388
-        // grab espresso configuration
389
-        return apply_filters(
390
-            'FHEE__EE_Config__get_espresso_config__CFG',
391
-            get_option(EE_Config::OPTION_NAME, array())
392
-        );
393
-    }
394
-
395
-
396
-    /**
397
-     *    double_check_config_comparison
398
-     *
399
-     * @access    public
400
-     * @param string $option
401
-     * @param        $old_value
402
-     * @param        $value
403
-     */
404
-    public function double_check_config_comparison($option = '', $old_value, $value)
405
-    {
406
-        // make sure we're checking the ee config
407
-        if ($option === EE_Config::OPTION_NAME) {
408
-            // run a loose comparison of the old value against the new value for type and properties,
409
-            // but NOT exact instance like WP update_option does (ie: NOT type safe comparison)
410
-            if ($value != $old_value) {
411
-                // if they are NOT the same, then remove the hook,
412
-                // which means the subsequent update results will be based solely on the update query results
413
-                // the reason we do this is because, as stated above,
414
-                // WP update_option performs an exact instance comparison (===) on any update values passed to it
415
-                // this happens PRIOR to serialization and any subsequent update.
416
-                // If values are found to match their previous old value,
417
-                // then WP bails before performing any update.
418
-                // Since we are passing the EE_Config object, it is comparing the EXACT instance of the saved version
419
-                // it just pulled from the db, with the one being passed to it (which will not match).
420
-                // HOWEVER, once the object is serialized and passed off to MySQL to update,
421
-                // MySQL MAY ALSO NOT perform the update because
422
-                // the string it sees in the db looks the same as the new one it has been passed!!!
423
-                // This results in the query returning an "affected rows" value of ZERO,
424
-                // which gets returned immediately by WP update_option and looks like an error.
425
-                remove_action('update_option', array($this, 'check_config_updated'));
426
-            }
427
-        }
428
-    }
429
-
430
-
431
-    /**
432
-     *    update_espresso_config
433
-     *
434
-     * @access   public
435
-     */
436
-    protected function _reset_espresso_addon_config()
437
-    {
438
-        $this->_addon_option_names = array();
439
-        foreach ($this->addons as $addon_name => $addon_config_obj) {
440
-            $addon_config_obj = maybe_unserialize($addon_config_obj);
441
-            if ($addon_config_obj instanceof EE_Config_Base) {
442
-                $this->update_config('addons', $addon_name, $addon_config_obj, false);
443
-            }
444
-            $this->addons->{$addon_name} = null;
445
-        }
446
-    }
447
-
448
-
449
-    /**
450
-     *    update_espresso_config
451
-     *
452
-     * @access   public
453
-     * @param   bool $add_success
454
-     * @param   bool $add_error
455
-     * @return   bool
456
-     */
457
-    public function update_espresso_config($add_success = false, $add_error = true)
458
-    {
459
-        // don't allow config updates during WP heartbeats
460
-        if (\EE_Registry::instance()->REQ->get('action', '') === 'heartbeat') {
461
-            return false;
462
-        }
463
-        // commented out the following re: https://events.codebasehq.com/projects/event-espresso/tickets/8197
464
-        // $clone = clone( self::$_instance );
465
-        // self::$_instance = NULL;
466
-        do_action('AHEE__EE_Config__update_espresso_config__begin', $this);
467
-        $this->_reset_espresso_addon_config();
468
-        // hook into update_option because that happens AFTER the ( $value === $old_value ) conditional
469
-        // but BEFORE the actual update occurs
470
-        add_action('update_option', array($this, 'double_check_config_comparison'), 1, 3);
471
-        // don't want to persist legacy_shortcodes_manager, but don't want to lose it either
472
-        $legacy_shortcodes_manager = $this->legacy_shortcodes_manager;
473
-        $this->legacy_shortcodes_manager = null;
474
-        // now update "ee_config"
475
-        $saved = update_option(EE_Config::OPTION_NAME, $this);
476
-        $this->legacy_shortcodes_manager = $legacy_shortcodes_manager;
477
-        EE_Config::log(EE_Config::OPTION_NAME);
478
-        // if not saved... check if the hook we just added still exists;
479
-        // if it does, it means one of two things:
480
-        // that update_option bailed at the($value === $old_value) conditional,
481
-        // or...
482
-        // the db update query returned 0 rows affected
483
-        // (probably because the data  value was the same from it's perspective)
484
-        // so the existence of the hook means that a negative result from update_option is NOT an error,
485
-        // but just means no update occurred, so don't display an error to the user.
486
-        // BUT... if update_option returns FALSE, AND the hook is missing,
487
-        // then it means that something truly went wrong
488
-        $saved = ! $saved ? has_action('update_option', array($this, 'double_check_config_comparison')) : $saved;
489
-        // remove our action since we don't want it in the system anymore
490
-        remove_action('update_option', array($this, 'double_check_config_comparison'), 1);
491
-        do_action('AHEE__EE_Config__update_espresso_config__end', $this, $saved);
492
-        // self::$_instance = $clone;
493
-        // unset( $clone );
494
-        // if config remains the same or was updated successfully
495
-        if ($saved) {
496
-            if ($add_success) {
497
-                EE_Error::add_success(
498
-                    __('The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso'),
499
-                    __FILE__,
500
-                    __FUNCTION__,
501
-                    __LINE__
502
-                );
503
-            }
504
-            return true;
505
-        } else {
506
-            if ($add_error) {
507
-                EE_Error::add_error(
508
-                    __('The Event Espresso Configuration Settings were not updated.', 'event_espresso'),
509
-                    __FILE__,
510
-                    __FUNCTION__,
511
-                    __LINE__
512
-                );
513
-            }
514
-            return false;
515
-        }
516
-    }
517
-
518
-
519
-    /**
520
-     *    _verify_config_params
521
-     *
522
-     * @access    private
523
-     * @param    string         $section
524
-     * @param    string         $name
525
-     * @param    string         $config_class
526
-     * @param    EE_Config_Base $config_obj
527
-     * @param    array          $tests_to_run
528
-     * @param    bool           $display_errors
529
-     * @return    bool    TRUE on success, FALSE on fail
530
-     */
531
-    private function _verify_config_params(
532
-        $section = '',
533
-        $name = '',
534
-        $config_class = '',
535
-        $config_obj = null,
536
-        $tests_to_run = array(1, 2, 3, 4, 5, 6, 7, 8),
537
-        $display_errors = true
538
-    ) {
539
-        try {
540
-            foreach ($tests_to_run as $test) {
541
-                switch ($test) {
542
-                    // TEST #1 : check that section was set
543
-                    case 1:
544
-                        if (empty($section)) {
545
-                            if ($display_errors) {
546
-                                throw new EE_Error(
547
-                                    sprintf(
548
-                                        __(
549
-                                            'No configuration section has been provided while attempting to save "%s".',
550
-                                            'event_espresso'
551
-                                        ),
552
-                                        $config_class
553
-                                    )
554
-                                );
555
-                            }
556
-                            return false;
557
-                        }
558
-                        break;
559
-                    // TEST #2 : check that settings section exists
560
-                    case 2:
561
-                        if (! isset($this->{$section})) {
562
-                            if ($display_errors) {
563
-                                throw new EE_Error(
564
-                                    sprintf(
565
-                                        __('The "%s" configuration section does not exist.', 'event_espresso'),
566
-                                        $section
567
-                                    )
568
-                                );
569
-                            }
570
-                            return false;
571
-                        }
572
-                        break;
573
-                    // TEST #3 : check that section is the proper format
574
-                    case 3:
575
-                        if (! ($this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass)
576
-                        ) {
577
-                            if ($display_errors) {
578
-                                throw new EE_Error(
579
-                                    sprintf(
580
-                                        __(
581
-                                            'The "%s" configuration settings have not been formatted correctly.',
582
-                                            'event_espresso'
583
-                                        ),
584
-                                        $section
585
-                                    )
586
-                                );
587
-                            }
588
-                            return false;
589
-                        }
590
-                        break;
591
-                    // TEST #4 : check that config section name has been set
592
-                    case 4:
593
-                        if (empty($name)) {
594
-                            if ($display_errors) {
595
-                                throw new EE_Error(
596
-                                    __(
597
-                                        'No name has been provided for the specific configuration section.',
598
-                                        'event_espresso'
599
-                                    )
600
-                                );
601
-                            }
602
-                            return false;
603
-                        }
604
-                        break;
605
-                    // TEST #5 : check that a config class name has been set
606
-                    case 5:
607
-                        if (empty($config_class)) {
608
-                            if ($display_errors) {
609
-                                throw new EE_Error(
610
-                                    __(
611
-                                        'No class name has been provided for the specific configuration section.',
612
-                                        'event_espresso'
613
-                                    )
614
-                                );
615
-                            }
616
-                            return false;
617
-                        }
618
-                        break;
619
-                    // TEST #6 : verify config class is accessible
620
-                    case 6:
621
-                        if (! class_exists($config_class)) {
622
-                            if ($display_errors) {
623
-                                throw new EE_Error(
624
-                                    sprintf(
625
-                                        __(
626
-                                            'The "%s" class does not exist. Please ensure that an autoloader has been set for it.',
627
-                                            'event_espresso'
628
-                                        ),
629
-                                        $config_class
630
-                                    )
631
-                                );
632
-                            }
633
-                            return false;
634
-                        }
635
-                        break;
636
-                    // TEST #7 : check that config has even been set
637
-                    case 7:
638
-                        if (! isset($this->{$section}->{$name})) {
639
-                            if ($display_errors) {
640
-                                throw new EE_Error(
641
-                                    sprintf(
642
-                                        __('No configuration has been set for "%1$s->%2$s".', 'event_espresso'),
643
-                                        $section,
644
-                                        $name
645
-                                    )
646
-                                );
647
-                            }
648
-                            return false;
649
-                        } else {
650
-                            // and make sure it's not serialized
651
-                            $this->{$section}->{$name} = maybe_unserialize($this->{$section}->{$name});
652
-                        }
653
-                        break;
654
-                    // TEST #8 : check that config is the requested type
655
-                    case 8:
656
-                        if (! $this->{$section}->{$name} instanceof $config_class) {
657
-                            if ($display_errors) {
658
-                                throw new EE_Error(
659
-                                    sprintf(
660
-                                        __(
661
-                                            'The configuration for "%1$s->%2$s" is not of the "%3$s" class.',
662
-                                            'event_espresso'
663
-                                        ),
664
-                                        $section,
665
-                                        $name,
666
-                                        $config_class
667
-                                    )
668
-                                );
669
-                            }
670
-                            return false;
671
-                        }
672
-                        break;
673
-                    // TEST #9 : verify config object
674
-                    case 9:
675
-                        if (! $config_obj instanceof EE_Config_Base) {
676
-                            if ($display_errors) {
677
-                                throw new EE_Error(
678
-                                    sprintf(
679
-                                        __('The "%s" class is not an instance of EE_Config_Base.', 'event_espresso'),
680
-                                        print_r($config_obj, true)
681
-                                    )
682
-                                );
683
-                            }
684
-                            return false;
685
-                        }
686
-                        break;
687
-                }
688
-            }
689
-        } catch (EE_Error $e) {
690
-            $e->get_error();
691
-        }
692
-        // you have successfully run the gauntlet
693
-        return true;
694
-    }
695
-
696
-
697
-    /**
698
-     *    _generate_config_option_name
699
-     *
700
-     * @access        protected
701
-     * @param        string $section
702
-     * @param        string $name
703
-     * @return        string
704
-     */
705
-    private function _generate_config_option_name($section = '', $name = '')
706
-    {
707
-        return 'ee_config-' . strtolower($section . '-' . str_replace(array('EE_', 'EED_'), '', $name));
708
-    }
709
-
710
-
711
-    /**
712
-     *    _set_config_class
713
-     * ensures that a config class is set, either from a passed config class or one generated from the config name
714
-     *
715
-     * @access    private
716
-     * @param    string $config_class
717
-     * @param    string $name
718
-     * @return    string
719
-     */
720
-    private function _set_config_class($config_class = '', $name = '')
721
-    {
722
-        return ! empty($config_class)
723
-            ? $config_class
724
-            : str_replace(' ', '_', ucwords(str_replace('_', ' ', $name))) . '_Config';
725
-    }
726
-
727
-
728
-    /**
729
-     *    set_config
730
-     *
731
-     * @access    protected
732
-     * @param    string         $section
733
-     * @param    string         $name
734
-     * @param    string         $config_class
735
-     * @param    EE_Config_Base $config_obj
736
-     * @return    EE_Config_Base
737
-     */
738
-    public function set_config($section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null)
739
-    {
740
-        // ensure config class is set to something
741
-        $config_class = $this->_set_config_class($config_class, $name);
742
-        // run tests 1-4, 6, and 7 to verify all config params are set and valid
743
-        if (! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
744
-            return null;
745
-        }
746
-        $config_option_name = $this->_generate_config_option_name($section, $name);
747
-        // if the config option name hasn't been added yet to the list of option names we're tracking, then do so now
748
-        if (! isset($this->_addon_option_names[ $config_option_name ])) {
749
-            $this->_addon_option_names[ $config_option_name ] = $config_class;
750
-            $this->update_addon_option_names();
751
-        }
752
-        // verify the incoming config object but suppress errors
753
-        if (! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
754
-            $config_obj = new $config_class();
755
-        }
756
-        if (get_option($config_option_name)) {
757
-            EE_Config::log($config_option_name);
758
-            update_option($config_option_name, $config_obj);
759
-            $this->{$section}->{$name} = $config_obj;
760
-            return $this->{$section}->{$name};
761
-        } else {
762
-            // create a wp-option for this config
763
-            if (add_option($config_option_name, $config_obj, '', 'no')) {
764
-                $this->{$section}->{$name} = maybe_unserialize($config_obj);
765
-                return $this->{$section}->{$name};
766
-            } else {
767
-                EE_Error::add_error(
768
-                    sprintf(__('The "%s" could not be saved to the database.', 'event_espresso'), $config_class),
769
-                    __FILE__,
770
-                    __FUNCTION__,
771
-                    __LINE__
772
-                );
773
-                return null;
774
-            }
775
-        }
776
-    }
777
-
778
-
779
-    /**
780
-     *    update_config
781
-     * Important: the config object must ALREADY be set, otherwise this will produce an error.
782
-     *
783
-     * @access    public
784
-     * @param    string                $section
785
-     * @param    string                $name
786
-     * @param    EE_Config_Base|string $config_obj
787
-     * @param    bool                  $throw_errors
788
-     * @return    bool
789
-     */
790
-    public function update_config($section = '', $name = '', $config_obj = '', $throw_errors = true)
791
-    {
792
-        // don't allow config updates during WP heartbeats
793
-        if (\EE_Registry::instance()->REQ->get('action', '') === 'heartbeat') {
794
-            return false;
795
-        }
796
-        $config_obj = maybe_unserialize($config_obj);
797
-        // get class name of the incoming object
798
-        $config_class = get_class($config_obj);
799
-        // run tests 1-5 and 9 to verify config
800
-        if (! $this->_verify_config_params(
801
-            $section,
802
-            $name,
803
-            $config_class,
804
-            $config_obj,
805
-            array(1, 2, 3, 4, 7, 9)
806
-        )
807
-        ) {
808
-            return false;
809
-        }
810
-        $config_option_name = $this->_generate_config_option_name($section, $name);
811
-        // check if config object has been added to db by seeing if config option name is in $this->_addon_option_names array
812
-        if (! isset($this->_addon_option_names[ $config_option_name ])) {
813
-            // save new config to db
814
-            if ($this->set_config($section, $name, $config_class, $config_obj)) {
815
-                return true;
816
-            }
817
-        } else {
818
-            // first check if the record already exists
819
-            $existing_config = get_option($config_option_name);
820
-            $config_obj = serialize($config_obj);
821
-            // just return if db record is already up to date (NOT type safe comparison)
822
-            if ($existing_config == $config_obj) {
823
-                $this->{$section}->{$name} = $config_obj;
824
-                return true;
825
-            } elseif (update_option($config_option_name, $config_obj)) {
826
-                EE_Config::log($config_option_name);
827
-                // update wp-option for this config class
828
-                $this->{$section}->{$name} = $config_obj;
829
-                return true;
830
-            } elseif ($throw_errors) {
831
-                EE_Error::add_error(
832
-                    sprintf(
833
-                        __(
834
-                            'The "%1$s" object stored at"%2$s" was not successfully updated in the database.',
835
-                            'event_espresso'
836
-                        ),
837
-                        $config_class,
838
-                        'EE_Config->' . $section . '->' . $name
839
-                    ),
840
-                    __FILE__,
841
-                    __FUNCTION__,
842
-                    __LINE__
843
-                );
844
-            }
845
-        }
846
-        return false;
847
-    }
848
-
849
-
850
-    /**
851
-     *    get_config
852
-     *
853
-     * @access    public
854
-     * @param    string $section
855
-     * @param    string $name
856
-     * @param    string $config_class
857
-     * @return    mixed EE_Config_Base | NULL
858
-     */
859
-    public function get_config($section = '', $name = '', $config_class = '')
860
-    {
861
-        // ensure config class is set to something
862
-        $config_class = $this->_set_config_class($config_class, $name);
863
-        // run tests 1-4, 6 and 7 to verify that all params have been set
864
-        if (! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
865
-            return null;
866
-        }
867
-        // now test if the requested config object exists, but suppress errors
868
-        if ($this->_verify_config_params($section, $name, $config_class, null, array(7, 8), false)) {
869
-            // config already exists, so pass it back
870
-            return $this->{$section}->{$name};
871
-        }
872
-        // load config option from db if it exists
873
-        $config_obj = $this->get_config_option($this->_generate_config_option_name($section, $name));
874
-        // verify the newly retrieved config object, but suppress errors
875
-        if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
876
-            // config is good, so set it and pass it back
877
-            $this->{$section}->{$name} = $config_obj;
878
-            return $this->{$section}->{$name};
879
-        }
880
-        // oops! $config_obj is not already set and does not exist in the db, so create a new one
881
-        $config_obj = $this->set_config($section, $name, $config_class);
882
-        // verify the newly created config object
883
-        if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9))) {
884
-            return $this->{$section}->{$name};
885
-        } else {
886
-            EE_Error::add_error(
887
-                sprintf(__('The "%s" could not be retrieved from the database.', 'event_espresso'), $config_class),
888
-                __FILE__,
889
-                __FUNCTION__,
890
-                __LINE__
891
-            );
892
-        }
893
-        return null;
894
-    }
895
-
896
-
897
-    /**
898
-     *    get_config_option
899
-     *
900
-     * @access    public
901
-     * @param    string $config_option_name
902
-     * @return    mixed EE_Config_Base | FALSE
903
-     */
904
-    public function get_config_option($config_option_name = '')
905
-    {
906
-        // retrieve the wp-option for this config class.
907
-        $config_option = maybe_unserialize(get_option($config_option_name, array()));
908
-        if (empty($config_option)) {
909
-            EE_Config::log($config_option_name . '-NOT-FOUND');
910
-        }
911
-        return $config_option;
912
-    }
913
-
914
-
915
-    /**
916
-     * log
917
-     *
918
-     * @param string $config_option_name
919
-     */
920
-    public static function log($config_option_name = '')
921
-    {
922
-        if (EE_Config::logging_enabled() && ! empty($config_option_name)) {
923
-            $config_log = get_option(EE_Config::LOG_NAME, array());
924
-            // copy incoming $_REQUEST and sanitize it so we can save it
925
-            $_request = $_REQUEST;
926
-            array_walk_recursive($_request, 'sanitize_text_field');
927
-            $config_log[ (string) microtime(true) ] = array(
928
-                'config_name' => $config_option_name,
929
-                'request'     => $_request,
930
-            );
931
-            update_option(EE_Config::LOG_NAME, $config_log);
932
-        }
933
-    }
934
-
935
-
936
-    /**
937
-     * trim_log
938
-     * reduces the size of the config log to the length specified by EE_Config::LOG_LENGTH
939
-     */
940
-    public static function trim_log()
941
-    {
942
-        if (! EE_Config::logging_enabled()) {
943
-            return;
944
-        }
945
-        $config_log = maybe_unserialize(get_option(EE_Config::LOG_NAME, array()));
946
-        $log_length = count($config_log);
947
-        if ($log_length > EE_Config::LOG_LENGTH) {
948
-            ksort($config_log);
949
-            $config_log = array_slice($config_log, $log_length - EE_Config::LOG_LENGTH, null, true);
950
-            update_option(EE_Config::LOG_NAME, $config_log);
951
-        }
952
-    }
953
-
954
-
955
-    /**
956
-     *    get_page_for_posts
957
-     *    if the wp-option "show_on_front" is set to "page", then this is the post_name for the post set in the
958
-     *    wp-option "page_for_posts", or "posts" if no page is selected
959
-     *
960
-     * @access    public
961
-     * @return    string
962
-     */
963
-    public static function get_page_for_posts()
964
-    {
965
-        $page_for_posts = get_option('page_for_posts');
966
-        if (! $page_for_posts) {
967
-            return 'posts';
968
-        }
969
-        /** @type WPDB $wpdb */
970
-        global $wpdb;
971
-        $SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
972
-        return $wpdb->get_var($wpdb->prepare($SQL, $page_for_posts));
973
-    }
974
-
975
-
976
-    /**
977
-     *    register_shortcodes_and_modules.
978
-     *    At this point, it's too early to tell if we're maintenance mode or not.
979
-     *    In fact, this is where we give modules a chance to let core know they exist
980
-     *    so they can help trigger maintenance mode if it's needed
981
-     *
982
-     * @access    public
983
-     * @return    void
984
-     */
985
-    public function register_shortcodes_and_modules()
986
-    {
987
-        // allow modules to set hooks for the rest of the system
988
-        EE_Registry::instance()->modules = $this->_register_modules();
989
-    }
990
-
991
-
992
-    /**
993
-     *    initialize_shortcodes_and_modules
994
-     *    meaning they can start adding their hooks to get stuff done
995
-     *
996
-     * @access    public
997
-     * @return    void
998
-     */
999
-    public function initialize_shortcodes_and_modules()
1000
-    {
1001
-        // allow modules to set hooks for the rest of the system
1002
-        $this->_initialize_modules();
1003
-    }
1004
-
1005
-
1006
-    /**
1007
-     *    widgets_init
1008
-     *
1009
-     * @access private
1010
-     * @return void
1011
-     */
1012
-    public function widgets_init()
1013
-    {
1014
-        // only init widgets on admin pages when not in complete maintenance, and
1015
-        // on frontend when not in any maintenance mode
1016
-        if (! EE_Maintenance_Mode::instance()->level()
1017
-            || (
1018
-                is_admin()
1019
-                && EE_Maintenance_Mode::instance()->level() !== EE_Maintenance_Mode::level_2_complete_maintenance
1020
-            )
1021
-        ) {
1022
-            // grab list of installed widgets
1023
-            $widgets_to_register = glob(EE_WIDGETS . '*', GLOB_ONLYDIR);
1024
-            // filter list of modules to register
1025
-            $widgets_to_register = apply_filters(
1026
-                'FHEE__EE_Config__register_widgets__widgets_to_register',
1027
-                $widgets_to_register
1028
-            );
1029
-            if (! empty($widgets_to_register)) {
1030
-                // cycle thru widget folders
1031
-                foreach ($widgets_to_register as $widget_path) {
1032
-                    // add to list of installed widget modules
1033
-                    EE_Config::register_ee_widget($widget_path);
1034
-                }
1035
-            }
1036
-            // filter list of installed modules
1037
-            EE_Registry::instance()->widgets = apply_filters(
1038
-                'FHEE__EE_Config__register_widgets__installed_widgets',
1039
-                EE_Registry::instance()->widgets
1040
-            );
1041
-        }
1042
-    }
1043
-
1044
-
1045
-    /**
1046
-     *    register_ee_widget - makes core aware of this widget
1047
-     *
1048
-     * @access    public
1049
-     * @param    string $widget_path - full path up to and including widget folder
1050
-     * @return    void
1051
-     */
1052
-    public static function register_ee_widget($widget_path = null)
1053
-    {
1054
-        do_action('AHEE__EE_Config__register_widget__begin', $widget_path);
1055
-        $widget_ext = '.widget.php';
1056
-        // make all separators match
1057
-        $widget_path = rtrim(str_replace('\\', DS, $widget_path), DS);
1058
-        // does the file path INCLUDE the actual file name as part of the path ?
1059
-        if (strpos($widget_path, $widget_ext) !== false) {
1060
-            // grab and shortcode file name from directory name and break apart at dots
1061
-            $file_name = explode('.', basename($widget_path));
1062
-            // take first segment from file name pieces and remove class prefix if it exists
1063
-            $widget = strpos($file_name[0], 'EEW_') === 0 ? substr($file_name[0], 4) : $file_name[0];
1064
-            // sanitize shortcode directory name
1065
-            $widget = sanitize_key($widget);
1066
-            // now we need to rebuild the shortcode path
1067
-            $widget_path = explode(DS, $widget_path);
1068
-            // remove last segment
1069
-            array_pop($widget_path);
1070
-            // glue it back together
1071
-            $widget_path = implode(DS, $widget_path);
1072
-        } else {
1073
-            // grab and sanitize widget directory name
1074
-            $widget = sanitize_key(basename($widget_path));
1075
-        }
1076
-        // create classname from widget directory name
1077
-        $widget = str_replace(' ', '_', ucwords(str_replace('_', ' ', $widget)));
1078
-        // add class prefix
1079
-        $widget_class = 'EEW_' . $widget;
1080
-        // does the widget exist ?
1081
-        if (! is_readable($widget_path . DS . $widget_class . $widget_ext)) {
1082
-            $msg = sprintf(
1083
-                __(
1084
-                    'The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s',
1085
-                    'event_espresso'
1086
-                ),
1087
-                $widget_class,
1088
-                $widget_path . DS . $widget_class . $widget_ext
1089
-            );
1090
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1091
-            return;
1092
-        }
1093
-        // load the widget class file
1094
-        require_once($widget_path . DS . $widget_class . $widget_ext);
1095
-        // verify that class exists
1096
-        if (! class_exists($widget_class)) {
1097
-            $msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
1098
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1099
-            return;
1100
-        }
1101
-        register_widget($widget_class);
1102
-        // add to array of registered widgets
1103
-        EE_Registry::instance()->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;
1104
-    }
1105
-
1106
-
1107
-    /**
1108
-     *        _register_modules
1109
-     *
1110
-     * @access private
1111
-     * @return array
1112
-     */
1113
-    private function _register_modules()
1114
-    {
1115
-        // grab list of installed modules
1116
-        $modules_to_register = glob(EE_MODULES . '*', GLOB_ONLYDIR);
1117
-        // filter list of modules to register
1118
-        $modules_to_register = apply_filters(
1119
-            'FHEE__EE_Config__register_modules__modules_to_register',
1120
-            $modules_to_register
1121
-        );
1122
-        if (! empty($modules_to_register)) {
1123
-            // loop through folders
1124
-            foreach ($modules_to_register as $module_path) {
1125
-                /**TEMPORARILY EXCLUDE gateways from modules for time being**/
1126
-                if ($module_path !== EE_MODULES . 'zzz-copy-this-module-template'
1127
-                    && $module_path !== EE_MODULES . 'gateways'
1128
-                ) {
1129
-                    // add to list of installed modules
1130
-                    EE_Config::register_module($module_path);
1131
-                }
1132
-            }
1133
-        }
1134
-        // filter list of installed modules
1135
-        return apply_filters(
1136
-            'FHEE__EE_Config___register_modules__installed_modules',
1137
-            EE_Registry::instance()->modules
1138
-        );
1139
-    }
1140
-
1141
-
1142
-    /**
1143
-     *    register_module - makes core aware of this module
1144
-     *
1145
-     * @access    public
1146
-     * @param    string $module_path - full path up to and including module folder
1147
-     * @return    bool
1148
-     */
1149
-    public static function register_module($module_path = null)
1150
-    {
1151
-        do_action('AHEE__EE_Config__register_module__begin', $module_path);
1152
-        $module_ext = '.module.php';
1153
-        // make all separators match
1154
-        $module_path = str_replace(array('\\', '/'), DS, $module_path);
1155
-        // does the file path INCLUDE the actual file name as part of the path ?
1156
-        if (strpos($module_path, $module_ext) !== false) {
1157
-            // grab and shortcode file name from directory name and break apart at dots
1158
-            $module_file = explode('.', basename($module_path));
1159
-            // now we need to rebuild the shortcode path
1160
-            $module_path = explode(DS, $module_path);
1161
-            // remove last segment
1162
-            array_pop($module_path);
1163
-            // glue it back together
1164
-            $module_path = implode(DS, $module_path) . DS;
1165
-            // take first segment from file name pieces and sanitize it
1166
-            $module = preg_replace('/[^a-zA-Z0-9_\-]/', '', $module_file[0]);
1167
-            // ensure class prefix is added
1168
-            $module_class = strpos($module, 'EED_') !== 0 ? 'EED_' . $module : $module;
1169
-        } else {
1170
-            // we need to generate the filename based off of the folder name
1171
-            // grab and sanitize module name
1172
-            $module = strtolower(basename($module_path));
1173
-            $module = preg_replace('/[^a-z0-9_\-]/', '', $module);
1174
-            // like trailingslashit()
1175
-            $module_path = rtrim($module_path, DS) . DS;
1176
-            // create classname from module directory name
1177
-            $module = str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
1178
-            // add class prefix
1179
-            $module_class = 'EED_' . $module;
1180
-        }
1181
-        // does the module exist ?
1182
-        if (! is_readable($module_path . DS . $module_class . $module_ext)) {
1183
-            $msg = sprintf(
1184
-                __(
1185
-                    'The requested %s module file could not be found or is not readable due to file permissions.',
1186
-                    'event_espresso'
1187
-                ),
1188
-                $module
1189
-            );
1190
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1191
-            return false;
1192
-        }
1193
-        // load the module class file
1194
-        require_once($module_path . $module_class . $module_ext);
1195
-        // verify that class exists
1196
-        if (! class_exists($module_class)) {
1197
-            $msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1198
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1199
-            return false;
1200
-        }
1201
-        // add to array of registered modules
1202
-        EE_Registry::instance()->modules->{$module_class} = $module_path . $module_class . $module_ext;
1203
-        do_action(
1204
-            'AHEE__EE_Config__register_module__complete',
1205
-            $module_class,
1206
-            EE_Registry::instance()->modules->{$module_class}
1207
-        );
1208
-        return true;
1209
-    }
1210
-
1211
-
1212
-    /**
1213
-     *    _initialize_modules
1214
-     *    allow modules to set hooks for the rest of the system
1215
-     *
1216
-     * @access private
1217
-     * @return void
1218
-     */
1219
-    private function _initialize_modules()
1220
-    {
1221
-        // cycle thru shortcode folders
1222
-        foreach (EE_Registry::instance()->modules as $module_class => $module_path) {
1223
-            // fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1224
-            // which set hooks ?
1225
-            if (is_admin()) {
1226
-                // fire immediately
1227
-                call_user_func(array($module_class, 'set_hooks_admin'));
1228
-            } else {
1229
-                // delay until other systems are online
1230
-                add_action(
1231
-                    'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons',
1232
-                    array($module_class, 'set_hooks')
1233
-                );
1234
-            }
1235
-        }
1236
-    }
1237
-
1238
-
1239
-    /**
1240
-     *    register_route - adds module method routes to route_map
1241
-     *
1242
-     * @access    public
1243
-     * @param    string $route       - "pretty" public alias for module method
1244
-     * @param    string $module      - module name (classname without EED_ prefix)
1245
-     * @param    string $method_name - the actual module method to be routed to
1246
-     * @param    string $key         - url param key indicating a route is being called
1247
-     * @return    bool
1248
-     */
1249
-    public static function register_route($route = null, $module = null, $method_name = null, $key = 'ee')
1250
-    {
1251
-        do_action('AHEE__EE_Config__register_route__begin', $route, $module, $method_name);
1252
-        $module = str_replace('EED_', '', $module);
1253
-        $module_class = 'EED_' . $module;
1254
-        if (! isset(EE_Registry::instance()->modules->{$module_class})) {
1255
-            $msg = sprintf(__('The module %s has not been registered.', 'event_espresso'), $module);
1256
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1257
-            return false;
1258
-        }
1259
-        if (empty($route)) {
1260
-            $msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1261
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1262
-            return false;
1263
-        }
1264
-        if (! method_exists('EED_' . $module, $method_name)) {
1265
-            $msg = sprintf(
1266
-                __('A valid class method for the %s route has not been supplied.', 'event_espresso'),
1267
-                $route
1268
-            );
1269
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1270
-            return false;
1271
-        }
1272
-        EE_Config::$_module_route_map[ (string) $key ][ (string) $route ] = array('EED_' . $module, $method_name);
1273
-        return true;
1274
-    }
1275
-
1276
-
1277
-    /**
1278
-     *    get_route - get module method route
1279
-     *
1280
-     * @access    public
1281
-     * @param    string $route - "pretty" public alias for module method
1282
-     * @param    string $key   - url param key indicating a route is being called
1283
-     * @return    string
1284
-     */
1285
-    public static function get_route($route = null, $key = 'ee')
1286
-    {
1287
-        do_action('AHEE__EE_Config__get_route__begin', $route);
1288
-        $route = (string) apply_filters('FHEE__EE_Config__get_route', $route);
1289
-        if (isset(EE_Config::$_module_route_map[ $key ][ $route ])) {
1290
-            return EE_Config::$_module_route_map[ $key ][ $route ];
1291
-        }
1292
-        return null;
1293
-    }
1294
-
1295
-
1296
-    /**
1297
-     *    get_routes - get ALL module method routes
1298
-     *
1299
-     * @access    public
1300
-     * @return    array
1301
-     */
1302
-    public static function get_routes()
1303
-    {
1304
-        return EE_Config::$_module_route_map;
1305
-    }
1306
-
1307
-
1308
-    /**
1309
-     *    register_forward - allows modules to forward request to another module for further processing
1310
-     *
1311
-     * @access    public
1312
-     * @param    string       $route   - "pretty" public alias for module method
1313
-     * @param    integer      $status  - integer value corresponding  to status constant strings set in module parent
1314
-     *                                 class, allows different forwards to be served based on status
1315
-     * @param    array|string $forward - function name or array( class, method )
1316
-     * @param    string       $key     - url param key indicating a route is being called
1317
-     * @return    bool
1318
-     */
1319
-    public static function register_forward($route = null, $status = 0, $forward = null, $key = 'ee')
1320
-    {
1321
-        do_action('AHEE__EE_Config__register_forward', $route, $status, $forward);
1322
-        if (! isset(EE_Config::$_module_route_map[ $key ][ $route ]) || empty($route)) {
1323
-            $msg = sprintf(
1324
-                __('The module route %s for this forward has not been registered.', 'event_espresso'),
1325
-                $route
1326
-            );
1327
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1328
-            return false;
1329
-        }
1330
-        if (empty($forward)) {
1331
-            $msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1332
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1333
-            return false;
1334
-        }
1335
-        if (is_array($forward)) {
1336
-            if (! isset($forward[1])) {
1337
-                $msg = sprintf(
1338
-                    __('A class method for the %s forwarding route has not been supplied.', 'event_espresso'),
1339
-                    $route
1340
-                );
1341
-                EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1342
-                return false;
1343
-            }
1344
-            if (! method_exists($forward[0], $forward[1])) {
1345
-                $msg = sprintf(
1346
-                    __('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'),
1347
-                    $forward[1],
1348
-                    $route
1349
-                );
1350
-                EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1351
-                return false;
1352
-            }
1353
-        } elseif (! function_exists($forward)) {
1354
-            $msg = sprintf(
1355
-                __('The function %s for the %s forwarding route is in invalid.', 'event_espresso'),
1356
-                $forward,
1357
-                $route
1358
-            );
1359
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1360
-            return false;
1361
-        }
1362
-        EE_Config::$_module_forward_map[ $key ][ $route ][ absint($status) ] = $forward;
1363
-        return true;
1364
-    }
1365
-
1366
-
1367
-    /**
1368
-     *    get_forward - get forwarding route
1369
-     *
1370
-     * @access    public
1371
-     * @param    string  $route  - "pretty" public alias for module method
1372
-     * @param    integer $status - integer value corresponding  to status constant strings set in module parent class,
1373
-     *                           allows different forwards to be served based on status
1374
-     * @param    string  $key    - url param key indicating a route is being called
1375
-     * @return    string
1376
-     */
1377
-    public static function get_forward($route = null, $status = 0, $key = 'ee')
1378
-    {
1379
-        do_action('AHEE__EE_Config__get_forward__begin', $route, $status);
1380
-        if (isset(EE_Config::$_module_forward_map[ $key ][ $route ][ $status ])) {
1381
-            return apply_filters(
1382
-                'FHEE__EE_Config__get_forward',
1383
-                EE_Config::$_module_forward_map[ $key ][ $route ][ $status ],
1384
-                $route,
1385
-                $status
1386
-            );
1387
-        }
1388
-        return null;
1389
-    }
1390
-
1391
-
1392
-    /**
1393
-     *    register_forward - allows modules to specify different view templates for different method routes and status
1394
-     *    results
1395
-     *
1396
-     * @access    public
1397
-     * @param    string  $route  - "pretty" public alias for module method
1398
-     * @param    integer $status - integer value corresponding  to status constant strings set in module parent class,
1399
-     *                           allows different views to be served based on status
1400
-     * @param    string  $view
1401
-     * @param    string  $key    - url param key indicating a route is being called
1402
-     * @return    bool
1403
-     */
1404
-    public static function register_view($route = null, $status = 0, $view = null, $key = 'ee')
1405
-    {
1406
-        do_action('AHEE__EE_Config__register_view__begin', $route, $status, $view);
1407
-        if (! isset(EE_Config::$_module_route_map[ $key ][ $route ]) || empty($route)) {
1408
-            $msg = sprintf(
1409
-                __('The module route %s for this view has not been registered.', 'event_espresso'),
1410
-                $route
1411
-            );
1412
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1413
-            return false;
1414
-        }
1415
-        if (! is_readable($view)) {
1416
-            $msg = sprintf(
1417
-                __(
1418
-                    'The %s view file could not be found or is not readable due to file permissions.',
1419
-                    'event_espresso'
1420
-                ),
1421
-                $view
1422
-            );
1423
-            EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1424
-            return false;
1425
-        }
1426
-        EE_Config::$_module_view_map[ $key ][ $route ][ absint($status) ] = $view;
1427
-        return true;
1428
-    }
1429
-
1430
-
1431
-    /**
1432
-     *    get_view - get view for route and status
1433
-     *
1434
-     * @access    public
1435
-     * @param    string  $route  - "pretty" public alias for module method
1436
-     * @param    integer $status - integer value corresponding  to status constant strings set in module parent class,
1437
-     *                           allows different views to be served based on status
1438
-     * @param    string  $key    - url param key indicating a route is being called
1439
-     * @return    string
1440
-     */
1441
-    public static function get_view($route = null, $status = 0, $key = 'ee')
1442
-    {
1443
-        do_action('AHEE__EE_Config__get_view__begin', $route, $status);
1444
-        if (isset(EE_Config::$_module_view_map[ $key ][ $route ][ $status ])) {
1445
-            return apply_filters(
1446
-                'FHEE__EE_Config__get_view',
1447
-                EE_Config::$_module_view_map[ $key ][ $route ][ $status ],
1448
-                $route,
1449
-                $status
1450
-            );
1451
-        }
1452
-        return null;
1453
-    }
1454
-
1455
-
1456
-    public function update_addon_option_names()
1457
-    {
1458
-        update_option(EE_Config::ADDON_OPTION_NAMES, $this->_addon_option_names);
1459
-    }
1460
-
1461
-
1462
-    public function shutdown()
1463
-    {
1464
-        $this->update_addon_option_names();
1465
-    }
1466
-
1467
-
1468
-    /**
1469
-     * @return LegacyShortcodesManager
1470
-     */
1471
-    public static function getLegacyShortcodesManager()
1472
-    {
1473
-
1474
-        if (! EE_Config::instance()->legacy_shortcodes_manager instanceof LegacyShortcodesManager) {
1475
-            EE_Config::instance()->legacy_shortcodes_manager = new LegacyShortcodesManager(
1476
-                EE_Registry::instance()
1477
-            );
1478
-        }
1479
-        return EE_Config::instance()->legacy_shortcodes_manager;
1480
-    }
1481
-
1482
-
1483
-    /**
1484
-     * register_shortcode - makes core aware of this shortcode
1485
-     *
1486
-     * @deprecated 4.9.26
1487
-     * @param    string $shortcode_path - full path up to and including shortcode folder
1488
-     * @return    bool
1489
-     */
1490
-    public static function register_shortcode($shortcode_path = null)
1491
-    {
1492
-        EE_Error::doing_it_wrong(
1493
-            __METHOD__,
1494
-            __(
1495
-                'Usage is deprecated. Use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::registerShortcode() as direct replacement, or better yet, please see the new \EventEspresso\core\services\shortcodes\ShortcodesManager class.',
1496
-                'event_espresso'
1497
-            ),
1498
-            '4.9.26'
1499
-        );
1500
-        return EE_Config::instance()->getLegacyShortcodesManager()->registerShortcode($shortcode_path);
1501
-    }
1502
-}
1503
-
1504
-/**
1505
- * Base class used for config classes. These classes should generally not have
1506
- * magic functions in use, except we'll allow them to magically set and get stuff...
1507
- * basically, they should just be well-defined stdClasses
1508
- */
1509
-class EE_Config_Base
1510
-{
1511
-
1512
-    /**
1513
-     * Utility function for escaping the value of a property and returning.
1514
-     *
1515
-     * @param string $property property name (checks to see if exists).
1516
-     * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1517
-     * @throws \EE_Error
1518
-     */
1519
-    public function get_pretty($property)
1520
-    {
1521
-        if (! property_exists($this, $property)) {
1522
-            throw new EE_Error(
1523
-                sprintf(
1524
-                    __(
1525
-                        '%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.',
1526
-                        'event_espresso'
1527
-                    ),
1528
-                    get_class($this),
1529
-                    $property
1530
-                )
1531
-            );
1532
-        }
1533
-        // just handling escaping of strings for now.
1534
-        if (is_string($this->{$property})) {
1535
-            return stripslashes($this->{$property});
1536
-        }
1537
-        return $this->{$property};
1538
-    }
1539
-
1540
-
1541
-    public function populate()
1542
-    {
1543
-        // grab defaults via a new instance of this class.
1544
-        $class_name = get_class($this);
1545
-        $defaults = new $class_name;
1546
-        // loop through the properties for this class and see if they are set.  If they are NOT, then grab the
1547
-        // default from our $defaults object.
1548
-        foreach (get_object_vars($defaults) as $property => $value) {
1549
-            if ($this->{$property} === null) {
1550
-                $this->{$property} = $value;
1551
-            }
1552
-        }
1553
-        // cleanup
1554
-        unset($defaults);
1555
-    }
1556
-
1557
-
1558
-    /**
1559
-     *        __isset
1560
-     *
1561
-     * @param $a
1562
-     * @return bool
1563
-     */
1564
-    public function __isset($a)
1565
-    {
1566
-        return false;
1567
-    }
1568
-
1569
-
1570
-    /**
1571
-     *        __unset
1572
-     *
1573
-     * @param $a
1574
-     * @return bool
1575
-     */
1576
-    public function __unset($a)
1577
-    {
1578
-        return false;
1579
-    }
1580
-
1581
-
1582
-    /**
1583
-     *        __clone
1584
-     */
1585
-    public function __clone()
1586
-    {
1587
-    }
1588
-
1589
-
1590
-    /**
1591
-     *        __wakeup
1592
-     */
1593
-    public function __wakeup()
1594
-    {
1595
-    }
1596
-
1597
-
1598
-    /**
1599
-     *        __destruct
1600
-     */
1601
-    public function __destruct()
1602
-    {
1603
-    }
1604
-}
1605
-
1606
-/**
1607
- * Class for defining what's in the EE_Config relating to registration settings
1608
- */
1609
-class EE_Core_Config extends EE_Config_Base
1610
-{
1611
-
1612
-    const OPTION_NAME_UXIP = 'ee_ueip_optin';
1613
-
1614
-
1615
-    public $current_blog_id;
1616
-
1617
-    public $ee_ueip_optin;
1618
-
1619
-    public $ee_ueip_has_notified;
1620
-
1621
-    /**
1622
-     * Not to be confused with the 4 critical page variables (See
1623
-     * get_critical_pages_array()), this is just an array of wp posts that have EE
1624
-     * shortcodes in them. Keys are slugs, values are arrays with only 1 element: where the key is the shortcode
1625
-     * in the page, and the value is the page's ID. The key 'posts' is basically a duplicate of this same array.
1626
-     *
1627
-     * @var array
1628
-     */
1629
-    public $post_shortcodes;
1630
-
1631
-    public $module_route_map;
1632
-
1633
-    public $module_forward_map;
1634
-
1635
-    public $module_view_map;
1636
-
1637
-    /**
1638
-     * The next 4 vars are the IDs of critical EE pages.
1639
-     *
1640
-     * @var int
1641
-     */
1642
-    public $reg_page_id;
1643
-
1644
-    public $txn_page_id;
1645
-
1646
-    public $thank_you_page_id;
1647
-
1648
-    public $cancel_page_id;
1649
-
1650
-    /**
1651
-     * The next 4 vars are the URLs of critical EE pages.
1652
-     *
1653
-     * @var int
1654
-     */
1655
-    public $reg_page_url;
1656
-
1657
-    public $txn_page_url;
1658
-
1659
-    public $thank_you_page_url;
1660
-
1661
-    public $cancel_page_url;
1662
-
1663
-    /**
1664
-     * The next vars relate to the custom slugs for EE CPT routes
1665
-     */
1666
-    public $event_cpt_slug;
1667
-
1668
-    /**
1669
-     * This caches the _ee_ueip_option in case this config is reset in the same
1670
-     * request across blog switches in a multisite context.
1671
-     * Avoids extra queries to the db for this option.
1672
-     *
1673
-     * @var bool
1674
-     */
1675
-    public static $ee_ueip_option;
1676
-
1677
-
1678
-    /**
1679
-     *    class constructor
1680
-     *
1681
-     * @access    public
1682
-     */
1683
-    public function __construct()
1684
-    {
1685
-        // set default organization settings
1686
-        $this->current_blog_id = get_current_blog_id();
1687
-        $this->current_blog_id = $this->current_blog_id === null ? 1 : $this->current_blog_id;
1688
-        $this->ee_ueip_optin = $this->_get_main_ee_ueip_optin();
1689
-        $this->ee_ueip_has_notified = is_main_site() ? get_option('ee_ueip_has_notified', false) : true;
1690
-        $this->post_shortcodes = array();
1691
-        $this->module_route_map = array();
1692
-        $this->module_forward_map = array();
1693
-        $this->module_view_map = array();
1694
-        // critical EE page IDs
1695
-        $this->reg_page_id = 0;
1696
-        $this->txn_page_id = 0;
1697
-        $this->thank_you_page_id = 0;
1698
-        $this->cancel_page_id = 0;
1699
-        // critical EE page URLs
1700
-        $this->reg_page_url = '';
1701
-        $this->txn_page_url = '';
1702
-        $this->thank_you_page_url = '';
1703
-        $this->cancel_page_url = '';
1704
-        // cpt slugs
1705
-        $this->event_cpt_slug = __('events', 'event_espresso');
1706
-        // ueip constant check
1707
-        if (defined('EE_DISABLE_UXIP') && EE_DISABLE_UXIP) {
1708
-            $this->ee_ueip_optin = false;
1709
-            $this->ee_ueip_has_notified = true;
1710
-        }
1711
-    }
1712
-
1713
-
1714
-    /**
1715
-     * @return array
1716
-     */
1717
-    public function get_critical_pages_array()
1718
-    {
1719
-        return array(
1720
-            $this->reg_page_id,
1721
-            $this->txn_page_id,
1722
-            $this->thank_you_page_id,
1723
-            $this->cancel_page_id,
1724
-        );
1725
-    }
1726
-
1727
-
1728
-    /**
1729
-     * @return array
1730
-     */
1731
-    public function get_critical_pages_shortcodes_array()
1732
-    {
1733
-        return array(
1734
-            $this->reg_page_id       => 'ESPRESSO_CHECKOUT',
1735
-            $this->txn_page_id       => 'ESPRESSO_TXN_PAGE',
1736
-            $this->thank_you_page_id => 'ESPRESSO_THANK_YOU',
1737
-            $this->cancel_page_id    => 'ESPRESSO_CANCELLED',
1738
-        );
1739
-    }
1740
-
1741
-
1742
-    /**
1743
-     *  gets/returns URL for EE reg_page
1744
-     *
1745
-     * @access    public
1746
-     * @return    string
1747
-     */
1748
-    public function reg_page_url()
1749
-    {
1750
-        if (! $this->reg_page_url) {
1751
-            $this->reg_page_url = add_query_arg(
1752
-                array('uts' => time()),
1753
-                get_permalink($this->reg_page_id)
1754
-            ) . '#checkout';
1755
-        }
1756
-        return $this->reg_page_url;
1757
-    }
1758
-
1759
-
1760
-    /**
1761
-     *  gets/returns URL for EE txn_page
1762
-     *
1763
-     * @param array $query_args like what gets passed to
1764
-     *                          add_query_arg() as the first argument
1765
-     * @access    public
1766
-     * @return    string
1767
-     */
1768
-    public function txn_page_url($query_args = array())
1769
-    {
1770
-        if (! $this->txn_page_url) {
1771
-            $this->txn_page_url = get_permalink($this->txn_page_id);
1772
-        }
1773
-        if ($query_args) {
1774
-            return add_query_arg($query_args, $this->txn_page_url);
1775
-        } else {
1776
-            return $this->txn_page_url;
1777
-        }
1778
-    }
1779
-
1780
-
1781
-    /**
1782
-     *  gets/returns URL for EE thank_you_page
1783
-     *
1784
-     * @param array $query_args like what gets passed to
1785
-     *                          add_query_arg() as the first argument
1786
-     * @access    public
1787
-     * @return    string
1788
-     */
1789
-    public function thank_you_page_url($query_args = array())
1790
-    {
1791
-        if (! $this->thank_you_page_url) {
1792
-            $this->thank_you_page_url = get_permalink($this->thank_you_page_id);
1793
-        }
1794
-        if ($query_args) {
1795
-            return add_query_arg($query_args, $this->thank_you_page_url);
1796
-        } else {
1797
-            return $this->thank_you_page_url;
1798
-        }
1799
-    }
1800
-
1801
-
1802
-    /**
1803
-     *  gets/returns URL for EE cancel_page
1804
-     *
1805
-     * @access    public
1806
-     * @return    string
1807
-     */
1808
-    public function cancel_page_url()
1809
-    {
1810
-        if (! $this->cancel_page_url) {
1811
-            $this->cancel_page_url = get_permalink($this->cancel_page_id);
1812
-        }
1813
-        return $this->cancel_page_url;
1814
-    }
1815
-
1816
-
1817
-    /**
1818
-     * Resets all critical page urls to their original state.  Used primarily by the __sleep() magic method currently.
1819
-     *
1820
-     * @since 4.7.5
1821
-     */
1822
-    protected function _reset_urls()
1823
-    {
1824
-        $this->reg_page_url = '';
1825
-        $this->txn_page_url = '';
1826
-        $this->cancel_page_url = '';
1827
-        $this->thank_you_page_url = '';
1828
-    }
1829
-
1830
-
1831
-    /**
1832
-     * Used to return what the optin value is set for the EE User Experience Program.
1833
-     * This accounts for multisite and this value being requested for a subsite.  In multisite, the value is set
1834
-     * on the main site only.
1835
-     *
1836
-     * @return bool
1837
-     */
1838
-    protected function _get_main_ee_ueip_optin()
1839
-    {
1840
-        // if this is the main site then we can just bypass our direct query.
1841
-        if (is_main_site()) {
1842
-            return get_option(self::OPTION_NAME_UXIP, false);
1843
-        }
1844
-        // is this already cached for this request?  If so use it.
1845
-        if (EE_Core_Config::$ee_ueip_option !== null) {
1846
-            return EE_Core_Config::$ee_ueip_option;
1847
-        }
1848
-        global $wpdb;
1849
-        $current_network_main_site = is_multisite() ? get_current_site() : null;
1850
-        $current_main_site_id = ! empty($current_network_main_site) ? $current_network_main_site->blog_id : 1;
1851
-        $option = self::OPTION_NAME_UXIP;
1852
-        // set correct table for query
1853
-        $table_name = $wpdb->get_blog_prefix($current_main_site_id) . 'options';
1854
-        // rather than getting blog option for the $current_main_site_id, we do a direct $wpdb query because
1855
-        // get_blog_option() does a switch_to_blog an that could cause infinite recursion because EE_Core_Config might be
1856
-        // re-constructed on the blog switch.  Note, we are still executing any core wp filters on this option retrieval.
1857
-        // this bit of code is basically a direct copy of get_option without any caching because we are NOT switched to the blog
1858
-        // for the purpose of caching.
1859
-        $pre = apply_filters('pre_option_' . $option, false, $option);
1860
-        if (false !== $pre) {
1861
-            EE_Core_Config::$ee_ueip_option = $pre;
1862
-            return EE_Core_Config::$ee_ueip_option;
1863
-        }
1864
-        $row = $wpdb->get_row(
1865
-            $wpdb->prepare(
1866
-                "SELECT option_value FROM $table_name WHERE option_name = %s LIMIT 1",
1867
-                $option
1868
-            )
1869
-        );
1870
-        if (is_object($row)) {
1871
-            $value = $row->option_value;
1872
-        } else { // option does not exist so use default.
1873
-            EE_Core_Config::$ee_ueip_option =  apply_filters('default_option_' . $option, false, $option);
1874
-            return EE_Core_Config::$ee_ueip_option;
1875
-        }
1876
-        EE_Core_Config::$ee_ueip_option = apply_filters('option_' . $option, maybe_unserialize($value), $option);
1877
-        return EE_Core_Config::$ee_ueip_option;
1878
-    }
1879
-
1880
-
1881
-    /**
1882
-     * Utility function for escaping the value of a property and returning.
1883
-     *
1884
-     * @param string $property property name (checks to see if exists).
1885
-     * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1886
-     * @throws \EE_Error
1887
-     */
1888
-    public function get_pretty($property)
1889
-    {
1890
-        if ($property === self::OPTION_NAME_UXIP) {
1891
-            return $this->ee_ueip_optin ? 'yes' : 'no';
1892
-        }
1893
-        return parent::get_pretty($property);
1894
-    }
1895
-
1896
-
1897
-    /**
1898
-     * Currently used to ensure critical page urls have initial values saved to the db instead of any current set values
1899
-     * on the object.
1900
-     *
1901
-     * @return array
1902
-     */
1903
-    public function __sleep()
1904
-    {
1905
-        // reset all url properties
1906
-        $this->_reset_urls();
1907
-        // return what to save to db
1908
-        return array_keys(get_object_vars($this));
1909
-    }
1910
-}
1911
-
1912
-/**
1913
- * Config class for storing info on the Organization
1914
- */
1915
-class EE_Organization_Config extends EE_Config_Base
1916
-{
1917
-
1918
-    /**
1919
-     * @var string $name
1920
-     * eg EE4.1
1921
-     */
1922
-    public $name;
1923
-
1924
-    /**
1925
-     * @var string $address_1
1926
-     * eg 123 Onna Road
1927
-     */
1928
-    public $address_1 = '';
1929
-
1930
-    /**
1931
-     * @var string $address_2
1932
-     * eg PO Box 123
1933
-     */
1934
-    public $address_2 = '';
1935
-
1936
-    /**
1937
-     * @var string $city
1938
-     * eg Inna City
1939
-     */
1940
-    public $city = '';
1941
-
1942
-    /**
1943
-     * @var int $STA_ID
1944
-     * eg 4
1945
-     */
1946
-    public $STA_ID = 0;
1947
-
1948
-    /**
1949
-     * @var string $CNT_ISO
1950
-     * eg US
1951
-     */
1952
-    public $CNT_ISO = '';
1953
-
1954
-    /**
1955
-     * @var string $zip
1956
-     * eg 12345  or V1A 2B3
1957
-     */
1958
-    public $zip = '';
1959
-
1960
-    /**
1961
-     * @var string $email
1962
-     * eg [email protected]
1963
-     */
1964
-    public $email;
1965
-
1966
-    /**
1967
-     * @var string $phone
1968
-     * eg. 111-111-1111
1969
-     */
1970
-    public $phone = '';
1971
-
1972
-    /**
1973
-     * @var string $vat
1974
-     * VAT/Tax Number
1975
-     */
1976
-    public $vat = '';
1977
-
1978
-    /**
1979
-     * @var string $logo_url
1980
-     * eg http://www.somedomain.com/wp-content/uploads/kittehs.jpg
1981
-     */
1982
-    public $logo_url = '';
1983
-
1984
-    /**
1985
-     * The below are all various properties for holding links to organization social network profiles
1986
-     *
1987
-     * @var string
1988
-     */
1989
-    /**
1990
-     * facebook (facebook.com/profile.name)
1991
-     *
1992
-     * @var string
1993
-     */
1994
-    public $facebook = '';
1995
-
1996
-    /**
1997
-     * twitter (twitter.com/twitter_handle)
1998
-     *
1999
-     * @var string
2000
-     */
2001
-    public $twitter = '';
2002
-
2003
-    /**
2004
-     * linkedin (linkedin.com/in/profile_name)
2005
-     *
2006
-     * @var string
2007
-     */
2008
-    public $linkedin = '';
2009
-
2010
-    /**
2011
-     * pinterest (www.pinterest.com/profile_name)
2012
-     *
2013
-     * @var string
2014
-     */
2015
-    public $pinterest = '';
2016
-
2017
-    /**
2018
-     * google+ (google.com/+profileName)
2019
-     *
2020
-     * @var string
2021
-     */
2022
-    public $google = '';
2023
-
2024
-    /**
2025
-     * instagram (instagram.com/handle)
2026
-     *
2027
-     * @var string
2028
-     */
2029
-    public $instagram = '';
2030
-
2031
-
2032
-    /**
2033
-     *    class constructor
2034
-     *
2035
-     * @access    public
2036
-     */
2037
-    public function __construct()
2038
-    {
2039
-        // set default organization settings
2040
-        // decode HTML entities from the WP blogname, because it's stored in the DB with HTML entities encoded
2041
-        $this->name = wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES);
2042
-        $this->email = get_bloginfo('admin_email');
2043
-    }
2044
-}
2045
-
2046
-/**
2047
- * Class for defining what's in the EE_Config relating to currency
2048
- */
2049
-class EE_Currency_Config extends EE_Config_Base
2050
-{
2051
-
2052
-    /**
2053
-     * @var string $code
2054
-     * eg 'US'
2055
-     */
2056
-    public $code;
2057
-
2058
-    /**
2059
-     * @var string $name
2060
-     * eg 'Dollar'
2061
-     */
2062
-    public $name;
2063
-
2064
-    /**
2065
-     * plural name
2066
-     *
2067
-     * @var string $plural
2068
-     * eg 'Dollars'
2069
-     */
2070
-    public $plural;
2071
-
2072
-    /**
2073
-     * currency sign
2074
-     *
2075
-     * @var string $sign
2076
-     * eg '$'
2077
-     */
2078
-    public $sign;
2079
-
2080
-    /**
2081
-     * Whether the currency sign should come before the number or not
2082
-     *
2083
-     * @var boolean $sign_b4
2084
-     */
2085
-    public $sign_b4;
2086
-
2087
-    /**
2088
-     * How many digits should come after the decimal place
2089
-     *
2090
-     * @var int $dec_plc
2091
-     */
2092
-    public $dec_plc;
2093
-
2094
-    /**
2095
-     * Symbol to use for decimal mark
2096
-     *
2097
-     * @var string $dec_mrk
2098
-     * eg '.'
2099
-     */
2100
-    public $dec_mrk;
2101
-
2102
-    /**
2103
-     * Symbol to use for thousands
2104
-     *
2105
-     * @var string $thsnds
2106
-     * eg ','
2107
-     */
2108
-    public $thsnds;
2109
-
2110
-
2111
-    /**
2112
-     *    class constructor
2113
-     *
2114
-     * @access    public
2115
-     * @param string $CNT_ISO
2116
-     * @throws \EE_Error
2117
-     */
2118
-    public function __construct($CNT_ISO = '')
2119
-    {
2120
-        /** @var \EventEspresso\core\services\database\TableAnalysis $table_analysis */
2121
-        $table_analysis = EE_Registry::instance()->create('TableAnalysis', array(), true);
2122
-        // get country code from organization settings or use default
2123
-        $ORG_CNT = isset(EE_Registry::instance()->CFG->organization)
2124
-                   && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config
2125
-            ? EE_Registry::instance()->CFG->organization->CNT_ISO
2126
-            : '';
2127
-        // but override if requested
2128
-        $CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : $ORG_CNT;
2129
-        // so if that all went well, and we are not in M-Mode (cuz you can't query the db in M-Mode) and double-check the countries table exists
2130
-        if (! empty($CNT_ISO)
2131
-            && EE_Maintenance_Mode::instance()->models_can_query()
2132
-            && $table_analysis->tableExists(EE_Registry::instance()->load_model('Country')->table())
2133
-        ) {
2134
-            // retrieve the country settings from the db, just in case they have been customized
2135
-            $country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($CNT_ISO);
2136
-            if ($country instanceof EE_Country) {
2137
-                $this->code = $country->currency_code();    // currency code: USD, CAD, EUR
2138
-                $this->name = $country->currency_name_single();    // Dollar
2139
-                $this->plural = $country->currency_name_plural();    // Dollars
2140
-                $this->sign = $country->currency_sign();            // currency sign: $
2141
-                $this->sign_b4 = $country->currency_sign_before(
2142
-                );        // currency sign before or after: $TRUE  or  FALSE$
2143
-                $this->dec_plc = $country->currency_decimal_places();    // decimal places: 2 = 0.00  3 = 0.000
2144
-                $this->dec_mrk = $country->currency_decimal_mark(
2145
-                );    // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2146
-                $this->thsnds = $country->currency_thousands_separator(
2147
-                );    // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2148
-            }
2149
-        }
2150
-        // fallback to hardcoded defaults, in case the above failed
2151
-        if (empty($this->code)) {
2152
-            // set default currency settings
2153
-            $this->code = 'USD';    // currency code: USD, CAD, EUR
2154
-            $this->name = __('Dollar', 'event_espresso');    // Dollar
2155
-            $this->plural = __('Dollars', 'event_espresso');    // Dollars
2156
-            $this->sign = '$';    // currency sign: $
2157
-            $this->sign_b4 = true;    // currency sign before or after: $TRUE  or  FALSE$
2158
-            $this->dec_plc = 2;    // decimal places: 2 = 0.00  3 = 0.000
2159
-            $this->dec_mrk = '.';    // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2160
-            $this->thsnds = ',';    // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2161
-        }
2162
-    }
2163
-}
2164
-
2165
-/**
2166
- * Class for defining what's in the EE_Config relating to registration settings
2167
- */
2168
-class EE_Registration_Config extends EE_Config_Base
2169
-{
2170
-
2171
-    /**
2172
-     * Default registration status
2173
-     *
2174
-     * @var string $default_STS_ID
2175
-     * eg 'RPP'
2176
-     */
2177
-    public $default_STS_ID;
2178
-
2179
-    /**
2180
-     * For new events, this will be the default value for the maximum number of tickets (equivalent to maximum number of
2181
-     * registrations)
2182
-     *
2183
-     * @var int
2184
-     */
2185
-    public $default_maximum_number_of_tickets;
2186
-
2187
-    /**
2188
-     * level of validation to apply to email addresses
2189
-     *
2190
-     * @var string $email_validation_level
2191
-     * options: 'basic', 'wp_default', 'i18n', 'i18n_dns'
2192
-     */
2193
-    public $email_validation_level;
2194
-
2195
-    /**
2196
-     *    whether or not to show alternate payment options during the reg process if payment status is pending
2197
-     *
2198
-     * @var boolean $show_pending_payment_options
2199
-     */
2200
-    public $show_pending_payment_options;
2201
-
2202
-    /**
2203
-     * Whether to skip the registration confirmation page
2204
-     *
2205
-     * @var boolean $skip_reg_confirmation
2206
-     */
2207
-    public $skip_reg_confirmation;
2208
-
2209
-    /**
2210
-     * an array of SPCO reg steps where:
2211
-     *        the keys denotes the reg step order
2212
-     *        each element consists of an array with the following elements:
2213
-     *            "file_path" => the file path to the EE_SPCO_Reg_Step class
2214
-     *            "class_name" => the specific EE_SPCO_Reg_Step child class name
2215
-     *            "slug" => the URL param used to trigger the reg step
2216
-     *
2217
-     * @var array $reg_steps
2218
-     */
2219
-    public $reg_steps;
2220
-
2221
-    /**
2222
-     * Whether registration confirmation should be the last page of SPCO
2223
-     *
2224
-     * @var boolean $reg_confirmation_last
2225
-     */
2226
-    public $reg_confirmation_last;
2227
-
2228
-    /**
2229
-     * Whether or not to enable the EE Bot Trap
2230
-     *
2231
-     * @var boolean $use_bot_trap
2232
-     */
2233
-    public $use_bot_trap;
2234
-
2235
-    /**
2236
-     * Whether or not to encrypt some data sent by the EE Bot Trap
2237
-     *
2238
-     * @var boolean $use_encryption
2239
-     */
2240
-    public $use_encryption;
2241
-
2242
-    /**
2243
-     * Whether or not to use ReCaptcha
2244
-     *
2245
-     * @var boolean $use_captcha
2246
-     */
2247
-    public $use_captcha;
2248
-
2249
-    /**
2250
-     * ReCaptcha Theme
2251
-     *
2252
-     * @var string $recaptcha_theme
2253
-     *    options: 'dark', 'light', 'invisible'
2254
-     */
2255
-    public $recaptcha_theme;
2256
-
2257
-    /**
2258
-     * ReCaptcha Badge - determines the position of the reCAPTCHA badge if using Invisible ReCaptcha.
2259
-     *
2260
-     * @var string $recaptcha_badge
2261
-     *    options: 'bottomright', 'bottomleft', 'inline'
2262
-     */
2263
-    public $recaptcha_badge;
19
+	const OPTION_NAME = 'ee_config';
20
+
21
+	const LOG_NAME = 'ee_config_log';
22
+
23
+	const LOG_LENGTH = 100;
24
+
25
+	const ADDON_OPTION_NAMES = 'ee_config_option_names';
26
+
27
+	/**
28
+	 *    instance of the EE_Config object
29
+	 *
30
+	 * @var    EE_Config $_instance
31
+	 * @access    private
32
+	 */
33
+	private static $_instance;
34
+
35
+	/**
36
+	 * @var boolean $_logging_enabled
37
+	 */
38
+	private static $_logging_enabled = false;
39
+
40
+	/**
41
+	 * @var LegacyShortcodesManager $legacy_shortcodes_manager
42
+	 */
43
+	private $legacy_shortcodes_manager;
44
+
45
+	/**
46
+	 * An StdClass whose property names are addon slugs,
47
+	 * and values are their config classes
48
+	 *
49
+	 * @var StdClass
50
+	 */
51
+	public $addons;
52
+
53
+	/**
54
+	 * @var EE_Admin_Config
55
+	 */
56
+	public $admin;
57
+
58
+	/**
59
+	 * @var EE_Core_Config
60
+	 */
61
+	public $core;
62
+
63
+	/**
64
+	 * @var EE_Currency_Config
65
+	 */
66
+	public $currency;
67
+
68
+	/**
69
+	 * @var EE_Organization_Config
70
+	 */
71
+	public $organization;
72
+
73
+	/**
74
+	 * @var EE_Registration_Config
75
+	 */
76
+	public $registration;
77
+
78
+	/**
79
+	 * @var EE_Template_Config
80
+	 */
81
+	public $template_settings;
82
+
83
+	/**
84
+	 * Holds EE environment values.
85
+	 *
86
+	 * @var EE_Environment_Config
87
+	 */
88
+	public $environment;
89
+
90
+	/**
91
+	 * settings pertaining to Google maps
92
+	 *
93
+	 * @var EE_Map_Config
94
+	 */
95
+	public $map_settings;
96
+
97
+	/**
98
+	 * settings pertaining to Taxes
99
+	 *
100
+	 * @var EE_Tax_Config
101
+	 */
102
+	public $tax_settings;
103
+
104
+	/**
105
+	 * Settings pertaining to global messages settings.
106
+	 *
107
+	 * @var EE_Messages_Config
108
+	 */
109
+	public $messages;
110
+
111
+	/**
112
+	 * @deprecated
113
+	 * @var EE_Gateway_Config
114
+	 */
115
+	public $gateway;
116
+
117
+	/**
118
+	 * @var    array $_addon_option_names
119
+	 * @access    private
120
+	 */
121
+	private $_addon_option_names = array();
122
+
123
+	/**
124
+	 * @var    array $_module_route_map
125
+	 * @access    private
126
+	 */
127
+	private static $_module_route_map = array();
128
+
129
+	/**
130
+	 * @var    array $_module_forward_map
131
+	 * @access    private
132
+	 */
133
+	private static $_module_forward_map = array();
134
+
135
+	/**
136
+	 * @var    array $_module_view_map
137
+	 * @access    private
138
+	 */
139
+	private static $_module_view_map = array();
140
+
141
+
142
+	/**
143
+	 * @singleton method used to instantiate class object
144
+	 * @access    public
145
+	 * @return EE_Config instance
146
+	 */
147
+	public static function instance()
148
+	{
149
+		// check if class object is instantiated, and instantiated properly
150
+		if (! self::$_instance instanceof EE_Config) {
151
+			self::$_instance = new self();
152
+		}
153
+		return self::$_instance;
154
+	}
155
+
156
+
157
+	/**
158
+	 * Resets the config
159
+	 *
160
+	 * @param bool    $hard_reset    if TRUE, sets EE_CONFig back to its original settings in the database. If FALSE
161
+	 *                               (default) leaves the database alone, and merely resets the EE_Config object to
162
+	 *                               reflect its state in the database
163
+	 * @param boolean $reinstantiate if TRUE (default) call instance() and return it. Otherwise, just leave
164
+	 *                               $_instance as NULL. Useful in case you want to forget about the old instance on
165
+	 *                               EE_Config, but might not be ready to instantiate EE_Config currently (eg if the
166
+	 *                               site was put into maintenance mode)
167
+	 * @return EE_Config
168
+	 */
169
+	public static function reset($hard_reset = false, $reinstantiate = true)
170
+	{
171
+		if (self::$_instance instanceof EE_Config) {
172
+			if ($hard_reset) {
173
+				self::$_instance->legacy_shortcodes_manager = null;
174
+				self::$_instance->_addon_option_names = array();
175
+				self::$_instance->_initialize_config();
176
+				self::$_instance->update_espresso_config();
177
+			}
178
+			self::$_instance->update_addon_option_names();
179
+		}
180
+		self::$_instance = null;
181
+		// we don't need to reset the static properties imo because those should
182
+		// only change when a module is added or removed. Currently we don't
183
+		// support removing a module during a request when it previously existed
184
+		if ($reinstantiate) {
185
+			return self::instance();
186
+		} else {
187
+			return null;
188
+		}
189
+	}
190
+
191
+
192
+	/**
193
+	 *    class constructor
194
+	 *
195
+	 * @access    private
196
+	 */
197
+	private function __construct()
198
+	{
199
+		do_action('AHEE__EE_Config__construct__begin', $this);
200
+		EE_Config::$_logging_enabled = apply_filters('FHEE__EE_Config___construct__logging_enabled', false);
201
+		// setup empty config classes
202
+		$this->_initialize_config();
203
+		// load existing EE site settings
204
+		$this->_load_core_config();
205
+		// confirm everything loaded correctly and set filtered defaults if not
206
+		$this->_verify_config();
207
+		//  register shortcodes and modules
208
+		add_action(
209
+			'AHEE__EE_System__register_shortcodes_modules_and_widgets',
210
+			array($this, 'register_shortcodes_and_modules'),
211
+			999
212
+		);
213
+		//  initialize shortcodes and modules
214
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'initialize_shortcodes_and_modules'));
215
+		// register widgets
216
+		add_action('widgets_init', array($this, 'widgets_init'), 10);
217
+		// shutdown
218
+		add_action('shutdown', array($this, 'shutdown'), 10);
219
+		// construct__end hook
220
+		do_action('AHEE__EE_Config__construct__end', $this);
221
+		// hardcoded hack
222
+		$this->template_settings->current_espresso_theme = 'Espresso_Arabica_2014';
223
+	}
224
+
225
+
226
+	/**
227
+	 * @return boolean
228
+	 */
229
+	public static function logging_enabled()
230
+	{
231
+		return self::$_logging_enabled;
232
+	}
233
+
234
+
235
+	/**
236
+	 * use to get the current theme if needed from static context
237
+	 *
238
+	 * @return string current theme set.
239
+	 */
240
+	public static function get_current_theme()
241
+	{
242
+		return isset(self::$_instance->template_settings->current_espresso_theme)
243
+			? self::$_instance->template_settings->current_espresso_theme : 'Espresso_Arabica_2014';
244
+	}
245
+
246
+
247
+	/**
248
+	 *        _initialize_config
249
+	 *
250
+	 * @access private
251
+	 * @return void
252
+	 */
253
+	private function _initialize_config()
254
+	{
255
+		EE_Config::trim_log();
256
+		// set defaults
257
+		$this->_addon_option_names = get_option(EE_Config::ADDON_OPTION_NAMES, array());
258
+		$this->addons = new stdClass();
259
+		// set _module_route_map
260
+		EE_Config::$_module_route_map = array();
261
+		// set _module_forward_map
262
+		EE_Config::$_module_forward_map = array();
263
+		// set _module_view_map
264
+		EE_Config::$_module_view_map = array();
265
+	}
266
+
267
+
268
+	/**
269
+	 *        load core plugin configuration
270
+	 *
271
+	 * @access private
272
+	 * @return void
273
+	 */
274
+	private function _load_core_config()
275
+	{
276
+		// load_core_config__start hook
277
+		do_action('AHEE__EE_Config___load_core_config__start', $this);
278
+		$espresso_config = $this->get_espresso_config();
279
+		foreach ($espresso_config as $config => $settings) {
280
+			// load_core_config__start hook
281
+			$settings = apply_filters(
282
+				'FHEE__EE_Config___load_core_config__config_settings',
283
+				$settings,
284
+				$config,
285
+				$this
286
+			);
287
+			if (is_object($settings) && property_exists($this, $config)) {
288
+				$this->{$config} = apply_filters('FHEE__EE_Config___load_core_config__' . $config, $settings);
289
+				// call configs populate method to ensure any defaults are set for empty values.
290
+				if (method_exists($settings, 'populate')) {
291
+					$this->{$config}->populate();
292
+				}
293
+				if (method_exists($settings, 'do_hooks')) {
294
+					$this->{$config}->do_hooks();
295
+				}
296
+			}
297
+		}
298
+		if (apply_filters('FHEE__EE_Config___load_core_config__update_espresso_config', false)) {
299
+			$this->update_espresso_config();
300
+		}
301
+		// load_core_config__end hook
302
+		do_action('AHEE__EE_Config___load_core_config__end', $this);
303
+	}
304
+
305
+
306
+	/**
307
+	 *    _verify_config
308
+	 *
309
+	 * @access    protected
310
+	 * @return    void
311
+	 */
312
+	protected function _verify_config()
313
+	{
314
+		$this->core = $this->core instanceof EE_Core_Config
315
+			? $this->core
316
+			: new EE_Core_Config();
317
+		$this->core = apply_filters('FHEE__EE_Config___initialize_config__core', $this->core);
318
+		$this->organization = $this->organization instanceof EE_Organization_Config
319
+			? $this->organization
320
+			: new EE_Organization_Config();
321
+		$this->organization = apply_filters(
322
+			'FHEE__EE_Config___initialize_config__organization',
323
+			$this->organization
324
+		);
325
+		$this->currency = $this->currency instanceof EE_Currency_Config
326
+			? $this->currency
327
+			: new EE_Currency_Config();
328
+		$this->currency = apply_filters('FHEE__EE_Config___initialize_config__currency', $this->currency);
329
+		$this->registration = $this->registration instanceof EE_Registration_Config
330
+			? $this->registration
331
+			: new EE_Registration_Config();
332
+		$this->registration = apply_filters(
333
+			'FHEE__EE_Config___initialize_config__registration',
334
+			$this->registration
335
+		);
336
+		$this->admin = $this->admin instanceof EE_Admin_Config
337
+			? $this->admin
338
+			: new EE_Admin_Config();
339
+		$this->admin = apply_filters('FHEE__EE_Config___initialize_config__admin', $this->admin);
340
+		$this->template_settings = $this->template_settings instanceof EE_Template_Config
341
+			? $this->template_settings
342
+			: new EE_Template_Config();
343
+		$this->template_settings = apply_filters(
344
+			'FHEE__EE_Config___initialize_config__template_settings',
345
+			$this->template_settings
346
+		);
347
+		$this->map_settings = $this->map_settings instanceof EE_Map_Config
348
+			? $this->map_settings
349
+			: new EE_Map_Config();
350
+		$this->map_settings = apply_filters(
351
+			'FHEE__EE_Config___initialize_config__map_settings',
352
+			$this->map_settings
353
+		);
354
+		$this->environment = $this->environment instanceof EE_Environment_Config
355
+			? $this->environment
356
+			: new EE_Environment_Config();
357
+		$this->environment = apply_filters(
358
+			'FHEE__EE_Config___initialize_config__environment',
359
+			$this->environment
360
+		);
361
+		$this->tax_settings = $this->tax_settings instanceof EE_Tax_Config
362
+			? $this->tax_settings
363
+			: new EE_Tax_Config();
364
+		$this->tax_settings = apply_filters(
365
+			'FHEE__EE_Config___initialize_config__tax_settings',
366
+			$this->tax_settings
367
+		);
368
+		$this->messages = apply_filters('FHEE__EE_Config__initialize_config__messages', $this->messages);
369
+		$this->messages = $this->messages instanceof EE_Messages_Config
370
+			? $this->messages
371
+			: new EE_Messages_Config();
372
+		$this->gateway = $this->gateway instanceof EE_Gateway_Config
373
+			? $this->gateway
374
+			: new EE_Gateway_Config();
375
+		$this->gateway = apply_filters('FHEE__EE_Config___initialize_config__gateway', $this->gateway);
376
+		$this->legacy_shortcodes_manager = null;
377
+	}
378
+
379
+
380
+	/**
381
+	 *    get_espresso_config
382
+	 *
383
+	 * @access    public
384
+	 * @return    array of espresso config stuff
385
+	 */
386
+	public function get_espresso_config()
387
+	{
388
+		// grab espresso configuration
389
+		return apply_filters(
390
+			'FHEE__EE_Config__get_espresso_config__CFG',
391
+			get_option(EE_Config::OPTION_NAME, array())
392
+		);
393
+	}
394
+
395
+
396
+	/**
397
+	 *    double_check_config_comparison
398
+	 *
399
+	 * @access    public
400
+	 * @param string $option
401
+	 * @param        $old_value
402
+	 * @param        $value
403
+	 */
404
+	public function double_check_config_comparison($option = '', $old_value, $value)
405
+	{
406
+		// make sure we're checking the ee config
407
+		if ($option === EE_Config::OPTION_NAME) {
408
+			// run a loose comparison of the old value against the new value for type and properties,
409
+			// but NOT exact instance like WP update_option does (ie: NOT type safe comparison)
410
+			if ($value != $old_value) {
411
+				// if they are NOT the same, then remove the hook,
412
+				// which means the subsequent update results will be based solely on the update query results
413
+				// the reason we do this is because, as stated above,
414
+				// WP update_option performs an exact instance comparison (===) on any update values passed to it
415
+				// this happens PRIOR to serialization and any subsequent update.
416
+				// If values are found to match their previous old value,
417
+				// then WP bails before performing any update.
418
+				// Since we are passing the EE_Config object, it is comparing the EXACT instance of the saved version
419
+				// it just pulled from the db, with the one being passed to it (which will not match).
420
+				// HOWEVER, once the object is serialized and passed off to MySQL to update,
421
+				// MySQL MAY ALSO NOT perform the update because
422
+				// the string it sees in the db looks the same as the new one it has been passed!!!
423
+				// This results in the query returning an "affected rows" value of ZERO,
424
+				// which gets returned immediately by WP update_option and looks like an error.
425
+				remove_action('update_option', array($this, 'check_config_updated'));
426
+			}
427
+		}
428
+	}
429
+
430
+
431
+	/**
432
+	 *    update_espresso_config
433
+	 *
434
+	 * @access   public
435
+	 */
436
+	protected function _reset_espresso_addon_config()
437
+	{
438
+		$this->_addon_option_names = array();
439
+		foreach ($this->addons as $addon_name => $addon_config_obj) {
440
+			$addon_config_obj = maybe_unserialize($addon_config_obj);
441
+			if ($addon_config_obj instanceof EE_Config_Base) {
442
+				$this->update_config('addons', $addon_name, $addon_config_obj, false);
443
+			}
444
+			$this->addons->{$addon_name} = null;
445
+		}
446
+	}
447
+
448
+
449
+	/**
450
+	 *    update_espresso_config
451
+	 *
452
+	 * @access   public
453
+	 * @param   bool $add_success
454
+	 * @param   bool $add_error
455
+	 * @return   bool
456
+	 */
457
+	public function update_espresso_config($add_success = false, $add_error = true)
458
+	{
459
+		// don't allow config updates during WP heartbeats
460
+		if (\EE_Registry::instance()->REQ->get('action', '') === 'heartbeat') {
461
+			return false;
462
+		}
463
+		// commented out the following re: https://events.codebasehq.com/projects/event-espresso/tickets/8197
464
+		// $clone = clone( self::$_instance );
465
+		// self::$_instance = NULL;
466
+		do_action('AHEE__EE_Config__update_espresso_config__begin', $this);
467
+		$this->_reset_espresso_addon_config();
468
+		// hook into update_option because that happens AFTER the ( $value === $old_value ) conditional
469
+		// but BEFORE the actual update occurs
470
+		add_action('update_option', array($this, 'double_check_config_comparison'), 1, 3);
471
+		// don't want to persist legacy_shortcodes_manager, but don't want to lose it either
472
+		$legacy_shortcodes_manager = $this->legacy_shortcodes_manager;
473
+		$this->legacy_shortcodes_manager = null;
474
+		// now update "ee_config"
475
+		$saved = update_option(EE_Config::OPTION_NAME, $this);
476
+		$this->legacy_shortcodes_manager = $legacy_shortcodes_manager;
477
+		EE_Config::log(EE_Config::OPTION_NAME);
478
+		// if not saved... check if the hook we just added still exists;
479
+		// if it does, it means one of two things:
480
+		// that update_option bailed at the($value === $old_value) conditional,
481
+		// or...
482
+		// the db update query returned 0 rows affected
483
+		// (probably because the data  value was the same from it's perspective)
484
+		// so the existence of the hook means that a negative result from update_option is NOT an error,
485
+		// but just means no update occurred, so don't display an error to the user.
486
+		// BUT... if update_option returns FALSE, AND the hook is missing,
487
+		// then it means that something truly went wrong
488
+		$saved = ! $saved ? has_action('update_option', array($this, 'double_check_config_comparison')) : $saved;
489
+		// remove our action since we don't want it in the system anymore
490
+		remove_action('update_option', array($this, 'double_check_config_comparison'), 1);
491
+		do_action('AHEE__EE_Config__update_espresso_config__end', $this, $saved);
492
+		// self::$_instance = $clone;
493
+		// unset( $clone );
494
+		// if config remains the same or was updated successfully
495
+		if ($saved) {
496
+			if ($add_success) {
497
+				EE_Error::add_success(
498
+					__('The Event Espresso Configuration Settings have been successfully updated.', 'event_espresso'),
499
+					__FILE__,
500
+					__FUNCTION__,
501
+					__LINE__
502
+				);
503
+			}
504
+			return true;
505
+		} else {
506
+			if ($add_error) {
507
+				EE_Error::add_error(
508
+					__('The Event Espresso Configuration Settings were not updated.', 'event_espresso'),
509
+					__FILE__,
510
+					__FUNCTION__,
511
+					__LINE__
512
+				);
513
+			}
514
+			return false;
515
+		}
516
+	}
517
+
518
+
519
+	/**
520
+	 *    _verify_config_params
521
+	 *
522
+	 * @access    private
523
+	 * @param    string         $section
524
+	 * @param    string         $name
525
+	 * @param    string         $config_class
526
+	 * @param    EE_Config_Base $config_obj
527
+	 * @param    array          $tests_to_run
528
+	 * @param    bool           $display_errors
529
+	 * @return    bool    TRUE on success, FALSE on fail
530
+	 */
531
+	private function _verify_config_params(
532
+		$section = '',
533
+		$name = '',
534
+		$config_class = '',
535
+		$config_obj = null,
536
+		$tests_to_run = array(1, 2, 3, 4, 5, 6, 7, 8),
537
+		$display_errors = true
538
+	) {
539
+		try {
540
+			foreach ($tests_to_run as $test) {
541
+				switch ($test) {
542
+					// TEST #1 : check that section was set
543
+					case 1:
544
+						if (empty($section)) {
545
+							if ($display_errors) {
546
+								throw new EE_Error(
547
+									sprintf(
548
+										__(
549
+											'No configuration section has been provided while attempting to save "%s".',
550
+											'event_espresso'
551
+										),
552
+										$config_class
553
+									)
554
+								);
555
+							}
556
+							return false;
557
+						}
558
+						break;
559
+					// TEST #2 : check that settings section exists
560
+					case 2:
561
+						if (! isset($this->{$section})) {
562
+							if ($display_errors) {
563
+								throw new EE_Error(
564
+									sprintf(
565
+										__('The "%s" configuration section does not exist.', 'event_espresso'),
566
+										$section
567
+									)
568
+								);
569
+							}
570
+							return false;
571
+						}
572
+						break;
573
+					// TEST #3 : check that section is the proper format
574
+					case 3:
575
+						if (! ($this->{$section} instanceof EE_Config_Base || $this->{$section} instanceof stdClass)
576
+						) {
577
+							if ($display_errors) {
578
+								throw new EE_Error(
579
+									sprintf(
580
+										__(
581
+											'The "%s" configuration settings have not been formatted correctly.',
582
+											'event_espresso'
583
+										),
584
+										$section
585
+									)
586
+								);
587
+							}
588
+							return false;
589
+						}
590
+						break;
591
+					// TEST #4 : check that config section name has been set
592
+					case 4:
593
+						if (empty($name)) {
594
+							if ($display_errors) {
595
+								throw new EE_Error(
596
+									__(
597
+										'No name has been provided for the specific configuration section.',
598
+										'event_espresso'
599
+									)
600
+								);
601
+							}
602
+							return false;
603
+						}
604
+						break;
605
+					// TEST #5 : check that a config class name has been set
606
+					case 5:
607
+						if (empty($config_class)) {
608
+							if ($display_errors) {
609
+								throw new EE_Error(
610
+									__(
611
+										'No class name has been provided for the specific configuration section.',
612
+										'event_espresso'
613
+									)
614
+								);
615
+							}
616
+							return false;
617
+						}
618
+						break;
619
+					// TEST #6 : verify config class is accessible
620
+					case 6:
621
+						if (! class_exists($config_class)) {
622
+							if ($display_errors) {
623
+								throw new EE_Error(
624
+									sprintf(
625
+										__(
626
+											'The "%s" class does not exist. Please ensure that an autoloader has been set for it.',
627
+											'event_espresso'
628
+										),
629
+										$config_class
630
+									)
631
+								);
632
+							}
633
+							return false;
634
+						}
635
+						break;
636
+					// TEST #7 : check that config has even been set
637
+					case 7:
638
+						if (! isset($this->{$section}->{$name})) {
639
+							if ($display_errors) {
640
+								throw new EE_Error(
641
+									sprintf(
642
+										__('No configuration has been set for "%1$s->%2$s".', 'event_espresso'),
643
+										$section,
644
+										$name
645
+									)
646
+								);
647
+							}
648
+							return false;
649
+						} else {
650
+							// and make sure it's not serialized
651
+							$this->{$section}->{$name} = maybe_unserialize($this->{$section}->{$name});
652
+						}
653
+						break;
654
+					// TEST #8 : check that config is the requested type
655
+					case 8:
656
+						if (! $this->{$section}->{$name} instanceof $config_class) {
657
+							if ($display_errors) {
658
+								throw new EE_Error(
659
+									sprintf(
660
+										__(
661
+											'The configuration for "%1$s->%2$s" is not of the "%3$s" class.',
662
+											'event_espresso'
663
+										),
664
+										$section,
665
+										$name,
666
+										$config_class
667
+									)
668
+								);
669
+							}
670
+							return false;
671
+						}
672
+						break;
673
+					// TEST #9 : verify config object
674
+					case 9:
675
+						if (! $config_obj instanceof EE_Config_Base) {
676
+							if ($display_errors) {
677
+								throw new EE_Error(
678
+									sprintf(
679
+										__('The "%s" class is not an instance of EE_Config_Base.', 'event_espresso'),
680
+										print_r($config_obj, true)
681
+									)
682
+								);
683
+							}
684
+							return false;
685
+						}
686
+						break;
687
+				}
688
+			}
689
+		} catch (EE_Error $e) {
690
+			$e->get_error();
691
+		}
692
+		// you have successfully run the gauntlet
693
+		return true;
694
+	}
695
+
696
+
697
+	/**
698
+	 *    _generate_config_option_name
699
+	 *
700
+	 * @access        protected
701
+	 * @param        string $section
702
+	 * @param        string $name
703
+	 * @return        string
704
+	 */
705
+	private function _generate_config_option_name($section = '', $name = '')
706
+	{
707
+		return 'ee_config-' . strtolower($section . '-' . str_replace(array('EE_', 'EED_'), '', $name));
708
+	}
709
+
710
+
711
+	/**
712
+	 *    _set_config_class
713
+	 * ensures that a config class is set, either from a passed config class or one generated from the config name
714
+	 *
715
+	 * @access    private
716
+	 * @param    string $config_class
717
+	 * @param    string $name
718
+	 * @return    string
719
+	 */
720
+	private function _set_config_class($config_class = '', $name = '')
721
+	{
722
+		return ! empty($config_class)
723
+			? $config_class
724
+			: str_replace(' ', '_', ucwords(str_replace('_', ' ', $name))) . '_Config';
725
+	}
726
+
727
+
728
+	/**
729
+	 *    set_config
730
+	 *
731
+	 * @access    protected
732
+	 * @param    string         $section
733
+	 * @param    string         $name
734
+	 * @param    string         $config_class
735
+	 * @param    EE_Config_Base $config_obj
736
+	 * @return    EE_Config_Base
737
+	 */
738
+	public function set_config($section = '', $name = '', $config_class = '', EE_Config_Base $config_obj = null)
739
+	{
740
+		// ensure config class is set to something
741
+		$config_class = $this->_set_config_class($config_class, $name);
742
+		// run tests 1-4, 6, and 7 to verify all config params are set and valid
743
+		if (! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
744
+			return null;
745
+		}
746
+		$config_option_name = $this->_generate_config_option_name($section, $name);
747
+		// if the config option name hasn't been added yet to the list of option names we're tracking, then do so now
748
+		if (! isset($this->_addon_option_names[ $config_option_name ])) {
749
+			$this->_addon_option_names[ $config_option_name ] = $config_class;
750
+			$this->update_addon_option_names();
751
+		}
752
+		// verify the incoming config object but suppress errors
753
+		if (! $this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
754
+			$config_obj = new $config_class();
755
+		}
756
+		if (get_option($config_option_name)) {
757
+			EE_Config::log($config_option_name);
758
+			update_option($config_option_name, $config_obj);
759
+			$this->{$section}->{$name} = $config_obj;
760
+			return $this->{$section}->{$name};
761
+		} else {
762
+			// create a wp-option for this config
763
+			if (add_option($config_option_name, $config_obj, '', 'no')) {
764
+				$this->{$section}->{$name} = maybe_unserialize($config_obj);
765
+				return $this->{$section}->{$name};
766
+			} else {
767
+				EE_Error::add_error(
768
+					sprintf(__('The "%s" could not be saved to the database.', 'event_espresso'), $config_class),
769
+					__FILE__,
770
+					__FUNCTION__,
771
+					__LINE__
772
+				);
773
+				return null;
774
+			}
775
+		}
776
+	}
777
+
778
+
779
+	/**
780
+	 *    update_config
781
+	 * Important: the config object must ALREADY be set, otherwise this will produce an error.
782
+	 *
783
+	 * @access    public
784
+	 * @param    string                $section
785
+	 * @param    string                $name
786
+	 * @param    EE_Config_Base|string $config_obj
787
+	 * @param    bool                  $throw_errors
788
+	 * @return    bool
789
+	 */
790
+	public function update_config($section = '', $name = '', $config_obj = '', $throw_errors = true)
791
+	{
792
+		// don't allow config updates during WP heartbeats
793
+		if (\EE_Registry::instance()->REQ->get('action', '') === 'heartbeat') {
794
+			return false;
795
+		}
796
+		$config_obj = maybe_unserialize($config_obj);
797
+		// get class name of the incoming object
798
+		$config_class = get_class($config_obj);
799
+		// run tests 1-5 and 9 to verify config
800
+		if (! $this->_verify_config_params(
801
+			$section,
802
+			$name,
803
+			$config_class,
804
+			$config_obj,
805
+			array(1, 2, 3, 4, 7, 9)
806
+		)
807
+		) {
808
+			return false;
809
+		}
810
+		$config_option_name = $this->_generate_config_option_name($section, $name);
811
+		// check if config object has been added to db by seeing if config option name is in $this->_addon_option_names array
812
+		if (! isset($this->_addon_option_names[ $config_option_name ])) {
813
+			// save new config to db
814
+			if ($this->set_config($section, $name, $config_class, $config_obj)) {
815
+				return true;
816
+			}
817
+		} else {
818
+			// first check if the record already exists
819
+			$existing_config = get_option($config_option_name);
820
+			$config_obj = serialize($config_obj);
821
+			// just return if db record is already up to date (NOT type safe comparison)
822
+			if ($existing_config == $config_obj) {
823
+				$this->{$section}->{$name} = $config_obj;
824
+				return true;
825
+			} elseif (update_option($config_option_name, $config_obj)) {
826
+				EE_Config::log($config_option_name);
827
+				// update wp-option for this config class
828
+				$this->{$section}->{$name} = $config_obj;
829
+				return true;
830
+			} elseif ($throw_errors) {
831
+				EE_Error::add_error(
832
+					sprintf(
833
+						__(
834
+							'The "%1$s" object stored at"%2$s" was not successfully updated in the database.',
835
+							'event_espresso'
836
+						),
837
+						$config_class,
838
+						'EE_Config->' . $section . '->' . $name
839
+					),
840
+					__FILE__,
841
+					__FUNCTION__,
842
+					__LINE__
843
+				);
844
+			}
845
+		}
846
+		return false;
847
+	}
848
+
849
+
850
+	/**
851
+	 *    get_config
852
+	 *
853
+	 * @access    public
854
+	 * @param    string $section
855
+	 * @param    string $name
856
+	 * @param    string $config_class
857
+	 * @return    mixed EE_Config_Base | NULL
858
+	 */
859
+	public function get_config($section = '', $name = '', $config_class = '')
860
+	{
861
+		// ensure config class is set to something
862
+		$config_class = $this->_set_config_class($config_class, $name);
863
+		// run tests 1-4, 6 and 7 to verify that all params have been set
864
+		if (! $this->_verify_config_params($section, $name, $config_class, null, array(1, 2, 3, 4, 5, 6))) {
865
+			return null;
866
+		}
867
+		// now test if the requested config object exists, but suppress errors
868
+		if ($this->_verify_config_params($section, $name, $config_class, null, array(7, 8), false)) {
869
+			// config already exists, so pass it back
870
+			return $this->{$section}->{$name};
871
+		}
872
+		// load config option from db if it exists
873
+		$config_obj = $this->get_config_option($this->_generate_config_option_name($section, $name));
874
+		// verify the newly retrieved config object, but suppress errors
875
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9), false)) {
876
+			// config is good, so set it and pass it back
877
+			$this->{$section}->{$name} = $config_obj;
878
+			return $this->{$section}->{$name};
879
+		}
880
+		// oops! $config_obj is not already set and does not exist in the db, so create a new one
881
+		$config_obj = $this->set_config($section, $name, $config_class);
882
+		// verify the newly created config object
883
+		if ($this->_verify_config_params($section, $name, $config_class, $config_obj, array(9))) {
884
+			return $this->{$section}->{$name};
885
+		} else {
886
+			EE_Error::add_error(
887
+				sprintf(__('The "%s" could not be retrieved from the database.', 'event_espresso'), $config_class),
888
+				__FILE__,
889
+				__FUNCTION__,
890
+				__LINE__
891
+			);
892
+		}
893
+		return null;
894
+	}
895
+
896
+
897
+	/**
898
+	 *    get_config_option
899
+	 *
900
+	 * @access    public
901
+	 * @param    string $config_option_name
902
+	 * @return    mixed EE_Config_Base | FALSE
903
+	 */
904
+	public function get_config_option($config_option_name = '')
905
+	{
906
+		// retrieve the wp-option for this config class.
907
+		$config_option = maybe_unserialize(get_option($config_option_name, array()));
908
+		if (empty($config_option)) {
909
+			EE_Config::log($config_option_name . '-NOT-FOUND');
910
+		}
911
+		return $config_option;
912
+	}
913
+
914
+
915
+	/**
916
+	 * log
917
+	 *
918
+	 * @param string $config_option_name
919
+	 */
920
+	public static function log($config_option_name = '')
921
+	{
922
+		if (EE_Config::logging_enabled() && ! empty($config_option_name)) {
923
+			$config_log = get_option(EE_Config::LOG_NAME, array());
924
+			// copy incoming $_REQUEST and sanitize it so we can save it
925
+			$_request = $_REQUEST;
926
+			array_walk_recursive($_request, 'sanitize_text_field');
927
+			$config_log[ (string) microtime(true) ] = array(
928
+				'config_name' => $config_option_name,
929
+				'request'     => $_request,
930
+			);
931
+			update_option(EE_Config::LOG_NAME, $config_log);
932
+		}
933
+	}
934
+
935
+
936
+	/**
937
+	 * trim_log
938
+	 * reduces the size of the config log to the length specified by EE_Config::LOG_LENGTH
939
+	 */
940
+	public static function trim_log()
941
+	{
942
+		if (! EE_Config::logging_enabled()) {
943
+			return;
944
+		}
945
+		$config_log = maybe_unserialize(get_option(EE_Config::LOG_NAME, array()));
946
+		$log_length = count($config_log);
947
+		if ($log_length > EE_Config::LOG_LENGTH) {
948
+			ksort($config_log);
949
+			$config_log = array_slice($config_log, $log_length - EE_Config::LOG_LENGTH, null, true);
950
+			update_option(EE_Config::LOG_NAME, $config_log);
951
+		}
952
+	}
953
+
954
+
955
+	/**
956
+	 *    get_page_for_posts
957
+	 *    if the wp-option "show_on_front" is set to "page", then this is the post_name for the post set in the
958
+	 *    wp-option "page_for_posts", or "posts" if no page is selected
959
+	 *
960
+	 * @access    public
961
+	 * @return    string
962
+	 */
963
+	public static function get_page_for_posts()
964
+	{
965
+		$page_for_posts = get_option('page_for_posts');
966
+		if (! $page_for_posts) {
967
+			return 'posts';
968
+		}
969
+		/** @type WPDB $wpdb */
970
+		global $wpdb;
971
+		$SQL = "SELECT post_name from $wpdb->posts WHERE post_type='posts' OR post_type='page' AND post_status='publish' AND ID=%d";
972
+		return $wpdb->get_var($wpdb->prepare($SQL, $page_for_posts));
973
+	}
974
+
975
+
976
+	/**
977
+	 *    register_shortcodes_and_modules.
978
+	 *    At this point, it's too early to tell if we're maintenance mode or not.
979
+	 *    In fact, this is where we give modules a chance to let core know they exist
980
+	 *    so they can help trigger maintenance mode if it's needed
981
+	 *
982
+	 * @access    public
983
+	 * @return    void
984
+	 */
985
+	public function register_shortcodes_and_modules()
986
+	{
987
+		// allow modules to set hooks for the rest of the system
988
+		EE_Registry::instance()->modules = $this->_register_modules();
989
+	}
990
+
991
+
992
+	/**
993
+	 *    initialize_shortcodes_and_modules
994
+	 *    meaning they can start adding their hooks to get stuff done
995
+	 *
996
+	 * @access    public
997
+	 * @return    void
998
+	 */
999
+	public function initialize_shortcodes_and_modules()
1000
+	{
1001
+		// allow modules to set hooks for the rest of the system
1002
+		$this->_initialize_modules();
1003
+	}
1004
+
1005
+
1006
+	/**
1007
+	 *    widgets_init
1008
+	 *
1009
+	 * @access private
1010
+	 * @return void
1011
+	 */
1012
+	public function widgets_init()
1013
+	{
1014
+		// only init widgets on admin pages when not in complete maintenance, and
1015
+		// on frontend when not in any maintenance mode
1016
+		if (! EE_Maintenance_Mode::instance()->level()
1017
+			|| (
1018
+				is_admin()
1019
+				&& EE_Maintenance_Mode::instance()->level() !== EE_Maintenance_Mode::level_2_complete_maintenance
1020
+			)
1021
+		) {
1022
+			// grab list of installed widgets
1023
+			$widgets_to_register = glob(EE_WIDGETS . '*', GLOB_ONLYDIR);
1024
+			// filter list of modules to register
1025
+			$widgets_to_register = apply_filters(
1026
+				'FHEE__EE_Config__register_widgets__widgets_to_register',
1027
+				$widgets_to_register
1028
+			);
1029
+			if (! empty($widgets_to_register)) {
1030
+				// cycle thru widget folders
1031
+				foreach ($widgets_to_register as $widget_path) {
1032
+					// add to list of installed widget modules
1033
+					EE_Config::register_ee_widget($widget_path);
1034
+				}
1035
+			}
1036
+			// filter list of installed modules
1037
+			EE_Registry::instance()->widgets = apply_filters(
1038
+				'FHEE__EE_Config__register_widgets__installed_widgets',
1039
+				EE_Registry::instance()->widgets
1040
+			);
1041
+		}
1042
+	}
1043
+
1044
+
1045
+	/**
1046
+	 *    register_ee_widget - makes core aware of this widget
1047
+	 *
1048
+	 * @access    public
1049
+	 * @param    string $widget_path - full path up to and including widget folder
1050
+	 * @return    void
1051
+	 */
1052
+	public static function register_ee_widget($widget_path = null)
1053
+	{
1054
+		do_action('AHEE__EE_Config__register_widget__begin', $widget_path);
1055
+		$widget_ext = '.widget.php';
1056
+		// make all separators match
1057
+		$widget_path = rtrim(str_replace('\\', DS, $widget_path), DS);
1058
+		// does the file path INCLUDE the actual file name as part of the path ?
1059
+		if (strpos($widget_path, $widget_ext) !== false) {
1060
+			// grab and shortcode file name from directory name and break apart at dots
1061
+			$file_name = explode('.', basename($widget_path));
1062
+			// take first segment from file name pieces and remove class prefix if it exists
1063
+			$widget = strpos($file_name[0], 'EEW_') === 0 ? substr($file_name[0], 4) : $file_name[0];
1064
+			// sanitize shortcode directory name
1065
+			$widget = sanitize_key($widget);
1066
+			// now we need to rebuild the shortcode path
1067
+			$widget_path = explode(DS, $widget_path);
1068
+			// remove last segment
1069
+			array_pop($widget_path);
1070
+			// glue it back together
1071
+			$widget_path = implode(DS, $widget_path);
1072
+		} else {
1073
+			// grab and sanitize widget directory name
1074
+			$widget = sanitize_key(basename($widget_path));
1075
+		}
1076
+		// create classname from widget directory name
1077
+		$widget = str_replace(' ', '_', ucwords(str_replace('_', ' ', $widget)));
1078
+		// add class prefix
1079
+		$widget_class = 'EEW_' . $widget;
1080
+		// does the widget exist ?
1081
+		if (! is_readable($widget_path . DS . $widget_class . $widget_ext)) {
1082
+			$msg = sprintf(
1083
+				__(
1084
+					'The requested %s widget file could not be found or is not readable due to file permissions. Please ensure the following path is correct: %s',
1085
+					'event_espresso'
1086
+				),
1087
+				$widget_class,
1088
+				$widget_path . DS . $widget_class . $widget_ext
1089
+			);
1090
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1091
+			return;
1092
+		}
1093
+		// load the widget class file
1094
+		require_once($widget_path . DS . $widget_class . $widget_ext);
1095
+		// verify that class exists
1096
+		if (! class_exists($widget_class)) {
1097
+			$msg = sprintf(__('The requested %s widget class does not exist.', 'event_espresso'), $widget_class);
1098
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1099
+			return;
1100
+		}
1101
+		register_widget($widget_class);
1102
+		// add to array of registered widgets
1103
+		EE_Registry::instance()->widgets->{$widget_class} = $widget_path . DS . $widget_class . $widget_ext;
1104
+	}
1105
+
1106
+
1107
+	/**
1108
+	 *        _register_modules
1109
+	 *
1110
+	 * @access private
1111
+	 * @return array
1112
+	 */
1113
+	private function _register_modules()
1114
+	{
1115
+		// grab list of installed modules
1116
+		$modules_to_register = glob(EE_MODULES . '*', GLOB_ONLYDIR);
1117
+		// filter list of modules to register
1118
+		$modules_to_register = apply_filters(
1119
+			'FHEE__EE_Config__register_modules__modules_to_register',
1120
+			$modules_to_register
1121
+		);
1122
+		if (! empty($modules_to_register)) {
1123
+			// loop through folders
1124
+			foreach ($modules_to_register as $module_path) {
1125
+				/**TEMPORARILY EXCLUDE gateways from modules for time being**/
1126
+				if ($module_path !== EE_MODULES . 'zzz-copy-this-module-template'
1127
+					&& $module_path !== EE_MODULES . 'gateways'
1128
+				) {
1129
+					// add to list of installed modules
1130
+					EE_Config::register_module($module_path);
1131
+				}
1132
+			}
1133
+		}
1134
+		// filter list of installed modules
1135
+		return apply_filters(
1136
+			'FHEE__EE_Config___register_modules__installed_modules',
1137
+			EE_Registry::instance()->modules
1138
+		);
1139
+	}
1140
+
1141
+
1142
+	/**
1143
+	 *    register_module - makes core aware of this module
1144
+	 *
1145
+	 * @access    public
1146
+	 * @param    string $module_path - full path up to and including module folder
1147
+	 * @return    bool
1148
+	 */
1149
+	public static function register_module($module_path = null)
1150
+	{
1151
+		do_action('AHEE__EE_Config__register_module__begin', $module_path);
1152
+		$module_ext = '.module.php';
1153
+		// make all separators match
1154
+		$module_path = str_replace(array('\\', '/'), DS, $module_path);
1155
+		// does the file path INCLUDE the actual file name as part of the path ?
1156
+		if (strpos($module_path, $module_ext) !== false) {
1157
+			// grab and shortcode file name from directory name and break apart at dots
1158
+			$module_file = explode('.', basename($module_path));
1159
+			// now we need to rebuild the shortcode path
1160
+			$module_path = explode(DS, $module_path);
1161
+			// remove last segment
1162
+			array_pop($module_path);
1163
+			// glue it back together
1164
+			$module_path = implode(DS, $module_path) . DS;
1165
+			// take first segment from file name pieces and sanitize it
1166
+			$module = preg_replace('/[^a-zA-Z0-9_\-]/', '', $module_file[0]);
1167
+			// ensure class prefix is added
1168
+			$module_class = strpos($module, 'EED_') !== 0 ? 'EED_' . $module : $module;
1169
+		} else {
1170
+			// we need to generate the filename based off of the folder name
1171
+			// grab and sanitize module name
1172
+			$module = strtolower(basename($module_path));
1173
+			$module = preg_replace('/[^a-z0-9_\-]/', '', $module);
1174
+			// like trailingslashit()
1175
+			$module_path = rtrim($module_path, DS) . DS;
1176
+			// create classname from module directory name
1177
+			$module = str_replace(' ', '_', ucwords(str_replace('_', ' ', $module)));
1178
+			// add class prefix
1179
+			$module_class = 'EED_' . $module;
1180
+		}
1181
+		// does the module exist ?
1182
+		if (! is_readable($module_path . DS . $module_class . $module_ext)) {
1183
+			$msg = sprintf(
1184
+				__(
1185
+					'The requested %s module file could not be found or is not readable due to file permissions.',
1186
+					'event_espresso'
1187
+				),
1188
+				$module
1189
+			);
1190
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1191
+			return false;
1192
+		}
1193
+		// load the module class file
1194
+		require_once($module_path . $module_class . $module_ext);
1195
+		// verify that class exists
1196
+		if (! class_exists($module_class)) {
1197
+			$msg = sprintf(__('The requested %s module class does not exist.', 'event_espresso'), $module_class);
1198
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1199
+			return false;
1200
+		}
1201
+		// add to array of registered modules
1202
+		EE_Registry::instance()->modules->{$module_class} = $module_path . $module_class . $module_ext;
1203
+		do_action(
1204
+			'AHEE__EE_Config__register_module__complete',
1205
+			$module_class,
1206
+			EE_Registry::instance()->modules->{$module_class}
1207
+		);
1208
+		return true;
1209
+	}
1210
+
1211
+
1212
+	/**
1213
+	 *    _initialize_modules
1214
+	 *    allow modules to set hooks for the rest of the system
1215
+	 *
1216
+	 * @access private
1217
+	 * @return void
1218
+	 */
1219
+	private function _initialize_modules()
1220
+	{
1221
+		// cycle thru shortcode folders
1222
+		foreach (EE_Registry::instance()->modules as $module_class => $module_path) {
1223
+			// fire the shortcode class's set_hooks methods in case it needs to hook into other parts of the system
1224
+			// which set hooks ?
1225
+			if (is_admin()) {
1226
+				// fire immediately
1227
+				call_user_func(array($module_class, 'set_hooks_admin'));
1228
+			} else {
1229
+				// delay until other systems are online
1230
+				add_action(
1231
+					'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons',
1232
+					array($module_class, 'set_hooks')
1233
+				);
1234
+			}
1235
+		}
1236
+	}
1237
+
1238
+
1239
+	/**
1240
+	 *    register_route - adds module method routes to route_map
1241
+	 *
1242
+	 * @access    public
1243
+	 * @param    string $route       - "pretty" public alias for module method
1244
+	 * @param    string $module      - module name (classname without EED_ prefix)
1245
+	 * @param    string $method_name - the actual module method to be routed to
1246
+	 * @param    string $key         - url param key indicating a route is being called
1247
+	 * @return    bool
1248
+	 */
1249
+	public static function register_route($route = null, $module = null, $method_name = null, $key = 'ee')
1250
+	{
1251
+		do_action('AHEE__EE_Config__register_route__begin', $route, $module, $method_name);
1252
+		$module = str_replace('EED_', '', $module);
1253
+		$module_class = 'EED_' . $module;
1254
+		if (! isset(EE_Registry::instance()->modules->{$module_class})) {
1255
+			$msg = sprintf(__('The module %s has not been registered.', 'event_espresso'), $module);
1256
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1257
+			return false;
1258
+		}
1259
+		if (empty($route)) {
1260
+			$msg = sprintf(__('No route has been supplied.', 'event_espresso'), $route);
1261
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1262
+			return false;
1263
+		}
1264
+		if (! method_exists('EED_' . $module, $method_name)) {
1265
+			$msg = sprintf(
1266
+				__('A valid class method for the %s route has not been supplied.', 'event_espresso'),
1267
+				$route
1268
+			);
1269
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1270
+			return false;
1271
+		}
1272
+		EE_Config::$_module_route_map[ (string) $key ][ (string) $route ] = array('EED_' . $module, $method_name);
1273
+		return true;
1274
+	}
1275
+
1276
+
1277
+	/**
1278
+	 *    get_route - get module method route
1279
+	 *
1280
+	 * @access    public
1281
+	 * @param    string $route - "pretty" public alias for module method
1282
+	 * @param    string $key   - url param key indicating a route is being called
1283
+	 * @return    string
1284
+	 */
1285
+	public static function get_route($route = null, $key = 'ee')
1286
+	{
1287
+		do_action('AHEE__EE_Config__get_route__begin', $route);
1288
+		$route = (string) apply_filters('FHEE__EE_Config__get_route', $route);
1289
+		if (isset(EE_Config::$_module_route_map[ $key ][ $route ])) {
1290
+			return EE_Config::$_module_route_map[ $key ][ $route ];
1291
+		}
1292
+		return null;
1293
+	}
1294
+
1295
+
1296
+	/**
1297
+	 *    get_routes - get ALL module method routes
1298
+	 *
1299
+	 * @access    public
1300
+	 * @return    array
1301
+	 */
1302
+	public static function get_routes()
1303
+	{
1304
+		return EE_Config::$_module_route_map;
1305
+	}
1306
+
1307
+
1308
+	/**
1309
+	 *    register_forward - allows modules to forward request to another module for further processing
1310
+	 *
1311
+	 * @access    public
1312
+	 * @param    string       $route   - "pretty" public alias for module method
1313
+	 * @param    integer      $status  - integer value corresponding  to status constant strings set in module parent
1314
+	 *                                 class, allows different forwards to be served based on status
1315
+	 * @param    array|string $forward - function name or array( class, method )
1316
+	 * @param    string       $key     - url param key indicating a route is being called
1317
+	 * @return    bool
1318
+	 */
1319
+	public static function register_forward($route = null, $status = 0, $forward = null, $key = 'ee')
1320
+	{
1321
+		do_action('AHEE__EE_Config__register_forward', $route, $status, $forward);
1322
+		if (! isset(EE_Config::$_module_route_map[ $key ][ $route ]) || empty($route)) {
1323
+			$msg = sprintf(
1324
+				__('The module route %s for this forward has not been registered.', 'event_espresso'),
1325
+				$route
1326
+			);
1327
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1328
+			return false;
1329
+		}
1330
+		if (empty($forward)) {
1331
+			$msg = sprintf(__('No forwarding route has been supplied.', 'event_espresso'), $route);
1332
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1333
+			return false;
1334
+		}
1335
+		if (is_array($forward)) {
1336
+			if (! isset($forward[1])) {
1337
+				$msg = sprintf(
1338
+					__('A class method for the %s forwarding route has not been supplied.', 'event_espresso'),
1339
+					$route
1340
+				);
1341
+				EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1342
+				return false;
1343
+			}
1344
+			if (! method_exists($forward[0], $forward[1])) {
1345
+				$msg = sprintf(
1346
+					__('The class method %s for the %s forwarding route is in invalid.', 'event_espresso'),
1347
+					$forward[1],
1348
+					$route
1349
+				);
1350
+				EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1351
+				return false;
1352
+			}
1353
+		} elseif (! function_exists($forward)) {
1354
+			$msg = sprintf(
1355
+				__('The function %s for the %s forwarding route is in invalid.', 'event_espresso'),
1356
+				$forward,
1357
+				$route
1358
+			);
1359
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1360
+			return false;
1361
+		}
1362
+		EE_Config::$_module_forward_map[ $key ][ $route ][ absint($status) ] = $forward;
1363
+		return true;
1364
+	}
1365
+
1366
+
1367
+	/**
1368
+	 *    get_forward - get forwarding route
1369
+	 *
1370
+	 * @access    public
1371
+	 * @param    string  $route  - "pretty" public alias for module method
1372
+	 * @param    integer $status - integer value corresponding  to status constant strings set in module parent class,
1373
+	 *                           allows different forwards to be served based on status
1374
+	 * @param    string  $key    - url param key indicating a route is being called
1375
+	 * @return    string
1376
+	 */
1377
+	public static function get_forward($route = null, $status = 0, $key = 'ee')
1378
+	{
1379
+		do_action('AHEE__EE_Config__get_forward__begin', $route, $status);
1380
+		if (isset(EE_Config::$_module_forward_map[ $key ][ $route ][ $status ])) {
1381
+			return apply_filters(
1382
+				'FHEE__EE_Config__get_forward',
1383
+				EE_Config::$_module_forward_map[ $key ][ $route ][ $status ],
1384
+				$route,
1385
+				$status
1386
+			);
1387
+		}
1388
+		return null;
1389
+	}
1390
+
1391
+
1392
+	/**
1393
+	 *    register_forward - allows modules to specify different view templates for different method routes and status
1394
+	 *    results
1395
+	 *
1396
+	 * @access    public
1397
+	 * @param    string  $route  - "pretty" public alias for module method
1398
+	 * @param    integer $status - integer value corresponding  to status constant strings set in module parent class,
1399
+	 *                           allows different views to be served based on status
1400
+	 * @param    string  $view
1401
+	 * @param    string  $key    - url param key indicating a route is being called
1402
+	 * @return    bool
1403
+	 */
1404
+	public static function register_view($route = null, $status = 0, $view = null, $key = 'ee')
1405
+	{
1406
+		do_action('AHEE__EE_Config__register_view__begin', $route, $status, $view);
1407
+		if (! isset(EE_Config::$_module_route_map[ $key ][ $route ]) || empty($route)) {
1408
+			$msg = sprintf(
1409
+				__('The module route %s for this view has not been registered.', 'event_espresso'),
1410
+				$route
1411
+			);
1412
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1413
+			return false;
1414
+		}
1415
+		if (! is_readable($view)) {
1416
+			$msg = sprintf(
1417
+				__(
1418
+					'The %s view file could not be found or is not readable due to file permissions.',
1419
+					'event_espresso'
1420
+				),
1421
+				$view
1422
+			);
1423
+			EE_Error::add_error($msg . '||' . $msg, __FILE__, __FUNCTION__, __LINE__);
1424
+			return false;
1425
+		}
1426
+		EE_Config::$_module_view_map[ $key ][ $route ][ absint($status) ] = $view;
1427
+		return true;
1428
+	}
1429
+
1430
+
1431
+	/**
1432
+	 *    get_view - get view for route and status
1433
+	 *
1434
+	 * @access    public
1435
+	 * @param    string  $route  - "pretty" public alias for module method
1436
+	 * @param    integer $status - integer value corresponding  to status constant strings set in module parent class,
1437
+	 *                           allows different views to be served based on status
1438
+	 * @param    string  $key    - url param key indicating a route is being called
1439
+	 * @return    string
1440
+	 */
1441
+	public static function get_view($route = null, $status = 0, $key = 'ee')
1442
+	{
1443
+		do_action('AHEE__EE_Config__get_view__begin', $route, $status);
1444
+		if (isset(EE_Config::$_module_view_map[ $key ][ $route ][ $status ])) {
1445
+			return apply_filters(
1446
+				'FHEE__EE_Config__get_view',
1447
+				EE_Config::$_module_view_map[ $key ][ $route ][ $status ],
1448
+				$route,
1449
+				$status
1450
+			);
1451
+		}
1452
+		return null;
1453
+	}
1454
+
1455
+
1456
+	public function update_addon_option_names()
1457
+	{
1458
+		update_option(EE_Config::ADDON_OPTION_NAMES, $this->_addon_option_names);
1459
+	}
1460
+
1461
+
1462
+	public function shutdown()
1463
+	{
1464
+		$this->update_addon_option_names();
1465
+	}
1466
+
1467
+
1468
+	/**
1469
+	 * @return LegacyShortcodesManager
1470
+	 */
1471
+	public static function getLegacyShortcodesManager()
1472
+	{
1473
+
1474
+		if (! EE_Config::instance()->legacy_shortcodes_manager instanceof LegacyShortcodesManager) {
1475
+			EE_Config::instance()->legacy_shortcodes_manager = new LegacyShortcodesManager(
1476
+				EE_Registry::instance()
1477
+			);
1478
+		}
1479
+		return EE_Config::instance()->legacy_shortcodes_manager;
1480
+	}
1481
+
1482
+
1483
+	/**
1484
+	 * register_shortcode - makes core aware of this shortcode
1485
+	 *
1486
+	 * @deprecated 4.9.26
1487
+	 * @param    string $shortcode_path - full path up to and including shortcode folder
1488
+	 * @return    bool
1489
+	 */
1490
+	public static function register_shortcode($shortcode_path = null)
1491
+	{
1492
+		EE_Error::doing_it_wrong(
1493
+			__METHOD__,
1494
+			__(
1495
+				'Usage is deprecated. Use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::registerShortcode() as direct replacement, or better yet, please see the new \EventEspresso\core\services\shortcodes\ShortcodesManager class.',
1496
+				'event_espresso'
1497
+			),
1498
+			'4.9.26'
1499
+		);
1500
+		return EE_Config::instance()->getLegacyShortcodesManager()->registerShortcode($shortcode_path);
1501
+	}
1502
+}
2264 1503
 
2265
-    /**
2266
-     * ReCaptcha Type
2267
-     *
2268
-     * @var string $recaptcha_type
2269
-     *    options: 'audio', 'image'
2270
-     */
2271
-    public $recaptcha_type;
1504
+/**
1505
+ * Base class used for config classes. These classes should generally not have
1506
+ * magic functions in use, except we'll allow them to magically set and get stuff...
1507
+ * basically, they should just be well-defined stdClasses
1508
+ */
1509
+class EE_Config_Base
1510
+{
2272 1511
 
2273
-    /**
2274
-     * ReCaptcha language
2275
-     *
2276
-     * @var string $recaptcha_language
2277
-     * eg 'en'
2278
-     */
2279
-    public $recaptcha_language;
1512
+	/**
1513
+	 * Utility function for escaping the value of a property and returning.
1514
+	 *
1515
+	 * @param string $property property name (checks to see if exists).
1516
+	 * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1517
+	 * @throws \EE_Error
1518
+	 */
1519
+	public function get_pretty($property)
1520
+	{
1521
+		if (! property_exists($this, $property)) {
1522
+			throw new EE_Error(
1523
+				sprintf(
1524
+					__(
1525
+						'%1$s::get_pretty() has been called with the property %2$s which does not exist on the %1$s config class.',
1526
+						'event_espresso'
1527
+					),
1528
+					get_class($this),
1529
+					$property
1530
+				)
1531
+			);
1532
+		}
1533
+		// just handling escaping of strings for now.
1534
+		if (is_string($this->{$property})) {
1535
+			return stripslashes($this->{$property});
1536
+		}
1537
+		return $this->{$property};
1538
+	}
1539
+
1540
+
1541
+	public function populate()
1542
+	{
1543
+		// grab defaults via a new instance of this class.
1544
+		$class_name = get_class($this);
1545
+		$defaults = new $class_name;
1546
+		// loop through the properties for this class and see if they are set.  If they are NOT, then grab the
1547
+		// default from our $defaults object.
1548
+		foreach (get_object_vars($defaults) as $property => $value) {
1549
+			if ($this->{$property} === null) {
1550
+				$this->{$property} = $value;
1551
+			}
1552
+		}
1553
+		// cleanup
1554
+		unset($defaults);
1555
+	}
1556
+
1557
+
1558
+	/**
1559
+	 *        __isset
1560
+	 *
1561
+	 * @param $a
1562
+	 * @return bool
1563
+	 */
1564
+	public function __isset($a)
1565
+	{
1566
+		return false;
1567
+	}
1568
+
1569
+
1570
+	/**
1571
+	 *        __unset
1572
+	 *
1573
+	 * @param $a
1574
+	 * @return bool
1575
+	 */
1576
+	public function __unset($a)
1577
+	{
1578
+		return false;
1579
+	}
1580
+
1581
+
1582
+	/**
1583
+	 *        __clone
1584
+	 */
1585
+	public function __clone()
1586
+	{
1587
+	}
1588
+
1589
+
1590
+	/**
1591
+	 *        __wakeup
1592
+	 */
1593
+	public function __wakeup()
1594
+	{
1595
+	}
1596
+
1597
+
1598
+	/**
1599
+	 *        __destruct
1600
+	 */
1601
+	public function __destruct()
1602
+	{
1603
+	}
1604
+}
2280 1605
 
2281
-    /**
2282
-     * ReCaptcha public key
2283
-     *
2284
-     * @var string $recaptcha_publickey
2285
-     */
2286
-    public $recaptcha_publickey;
1606
+/**
1607
+ * Class for defining what's in the EE_Config relating to registration settings
1608
+ */
1609
+class EE_Core_Config extends EE_Config_Base
1610
+{
2287 1611
 
2288
-    /**
2289
-     * ReCaptcha private key
2290
-     *
2291
-     * @var string $recaptcha_privatekey
2292
-     */
2293
-    public $recaptcha_privatekey;
1612
+	const OPTION_NAME_UXIP = 'ee_ueip_optin';
1613
+
1614
+
1615
+	public $current_blog_id;
1616
+
1617
+	public $ee_ueip_optin;
1618
+
1619
+	public $ee_ueip_has_notified;
1620
+
1621
+	/**
1622
+	 * Not to be confused with the 4 critical page variables (See
1623
+	 * get_critical_pages_array()), this is just an array of wp posts that have EE
1624
+	 * shortcodes in them. Keys are slugs, values are arrays with only 1 element: where the key is the shortcode
1625
+	 * in the page, and the value is the page's ID. The key 'posts' is basically a duplicate of this same array.
1626
+	 *
1627
+	 * @var array
1628
+	 */
1629
+	public $post_shortcodes;
1630
+
1631
+	public $module_route_map;
1632
+
1633
+	public $module_forward_map;
1634
+
1635
+	public $module_view_map;
1636
+
1637
+	/**
1638
+	 * The next 4 vars are the IDs of critical EE pages.
1639
+	 *
1640
+	 * @var int
1641
+	 */
1642
+	public $reg_page_id;
1643
+
1644
+	public $txn_page_id;
1645
+
1646
+	public $thank_you_page_id;
1647
+
1648
+	public $cancel_page_id;
1649
+
1650
+	/**
1651
+	 * The next 4 vars are the URLs of critical EE pages.
1652
+	 *
1653
+	 * @var int
1654
+	 */
1655
+	public $reg_page_url;
1656
+
1657
+	public $txn_page_url;
1658
+
1659
+	public $thank_you_page_url;
1660
+
1661
+	public $cancel_page_url;
1662
+
1663
+	/**
1664
+	 * The next vars relate to the custom slugs for EE CPT routes
1665
+	 */
1666
+	public $event_cpt_slug;
1667
+
1668
+	/**
1669
+	 * This caches the _ee_ueip_option in case this config is reset in the same
1670
+	 * request across blog switches in a multisite context.
1671
+	 * Avoids extra queries to the db for this option.
1672
+	 *
1673
+	 * @var bool
1674
+	 */
1675
+	public static $ee_ueip_option;
1676
+
1677
+
1678
+	/**
1679
+	 *    class constructor
1680
+	 *
1681
+	 * @access    public
1682
+	 */
1683
+	public function __construct()
1684
+	{
1685
+		// set default organization settings
1686
+		$this->current_blog_id = get_current_blog_id();
1687
+		$this->current_blog_id = $this->current_blog_id === null ? 1 : $this->current_blog_id;
1688
+		$this->ee_ueip_optin = $this->_get_main_ee_ueip_optin();
1689
+		$this->ee_ueip_has_notified = is_main_site() ? get_option('ee_ueip_has_notified', false) : true;
1690
+		$this->post_shortcodes = array();
1691
+		$this->module_route_map = array();
1692
+		$this->module_forward_map = array();
1693
+		$this->module_view_map = array();
1694
+		// critical EE page IDs
1695
+		$this->reg_page_id = 0;
1696
+		$this->txn_page_id = 0;
1697
+		$this->thank_you_page_id = 0;
1698
+		$this->cancel_page_id = 0;
1699
+		// critical EE page URLs
1700
+		$this->reg_page_url = '';
1701
+		$this->txn_page_url = '';
1702
+		$this->thank_you_page_url = '';
1703
+		$this->cancel_page_url = '';
1704
+		// cpt slugs
1705
+		$this->event_cpt_slug = __('events', 'event_espresso');
1706
+		// ueip constant check
1707
+		if (defined('EE_DISABLE_UXIP') && EE_DISABLE_UXIP) {
1708
+			$this->ee_ueip_optin = false;
1709
+			$this->ee_ueip_has_notified = true;
1710
+		}
1711
+	}
1712
+
1713
+
1714
+	/**
1715
+	 * @return array
1716
+	 */
1717
+	public function get_critical_pages_array()
1718
+	{
1719
+		return array(
1720
+			$this->reg_page_id,
1721
+			$this->txn_page_id,
1722
+			$this->thank_you_page_id,
1723
+			$this->cancel_page_id,
1724
+		);
1725
+	}
1726
+
1727
+
1728
+	/**
1729
+	 * @return array
1730
+	 */
1731
+	public function get_critical_pages_shortcodes_array()
1732
+	{
1733
+		return array(
1734
+			$this->reg_page_id       => 'ESPRESSO_CHECKOUT',
1735
+			$this->txn_page_id       => 'ESPRESSO_TXN_PAGE',
1736
+			$this->thank_you_page_id => 'ESPRESSO_THANK_YOU',
1737
+			$this->cancel_page_id    => 'ESPRESSO_CANCELLED',
1738
+		);
1739
+	}
1740
+
1741
+
1742
+	/**
1743
+	 *  gets/returns URL for EE reg_page
1744
+	 *
1745
+	 * @access    public
1746
+	 * @return    string
1747
+	 */
1748
+	public function reg_page_url()
1749
+	{
1750
+		if (! $this->reg_page_url) {
1751
+			$this->reg_page_url = add_query_arg(
1752
+				array('uts' => time()),
1753
+				get_permalink($this->reg_page_id)
1754
+			) . '#checkout';
1755
+		}
1756
+		return $this->reg_page_url;
1757
+	}
1758
+
1759
+
1760
+	/**
1761
+	 *  gets/returns URL for EE txn_page
1762
+	 *
1763
+	 * @param array $query_args like what gets passed to
1764
+	 *                          add_query_arg() as the first argument
1765
+	 * @access    public
1766
+	 * @return    string
1767
+	 */
1768
+	public function txn_page_url($query_args = array())
1769
+	{
1770
+		if (! $this->txn_page_url) {
1771
+			$this->txn_page_url = get_permalink($this->txn_page_id);
1772
+		}
1773
+		if ($query_args) {
1774
+			return add_query_arg($query_args, $this->txn_page_url);
1775
+		} else {
1776
+			return $this->txn_page_url;
1777
+		}
1778
+	}
1779
+
1780
+
1781
+	/**
1782
+	 *  gets/returns URL for EE thank_you_page
1783
+	 *
1784
+	 * @param array $query_args like what gets passed to
1785
+	 *                          add_query_arg() as the first argument
1786
+	 * @access    public
1787
+	 * @return    string
1788
+	 */
1789
+	public function thank_you_page_url($query_args = array())
1790
+	{
1791
+		if (! $this->thank_you_page_url) {
1792
+			$this->thank_you_page_url = get_permalink($this->thank_you_page_id);
1793
+		}
1794
+		if ($query_args) {
1795
+			return add_query_arg($query_args, $this->thank_you_page_url);
1796
+		} else {
1797
+			return $this->thank_you_page_url;
1798
+		}
1799
+	}
1800
+
1801
+
1802
+	/**
1803
+	 *  gets/returns URL for EE cancel_page
1804
+	 *
1805
+	 * @access    public
1806
+	 * @return    string
1807
+	 */
1808
+	public function cancel_page_url()
1809
+	{
1810
+		if (! $this->cancel_page_url) {
1811
+			$this->cancel_page_url = get_permalink($this->cancel_page_id);
1812
+		}
1813
+		return $this->cancel_page_url;
1814
+	}
1815
+
1816
+
1817
+	/**
1818
+	 * Resets all critical page urls to their original state.  Used primarily by the __sleep() magic method currently.
1819
+	 *
1820
+	 * @since 4.7.5
1821
+	 */
1822
+	protected function _reset_urls()
1823
+	{
1824
+		$this->reg_page_url = '';
1825
+		$this->txn_page_url = '';
1826
+		$this->cancel_page_url = '';
1827
+		$this->thank_you_page_url = '';
1828
+	}
1829
+
1830
+
1831
+	/**
1832
+	 * Used to return what the optin value is set for the EE User Experience Program.
1833
+	 * This accounts for multisite and this value being requested for a subsite.  In multisite, the value is set
1834
+	 * on the main site only.
1835
+	 *
1836
+	 * @return bool
1837
+	 */
1838
+	protected function _get_main_ee_ueip_optin()
1839
+	{
1840
+		// if this is the main site then we can just bypass our direct query.
1841
+		if (is_main_site()) {
1842
+			return get_option(self::OPTION_NAME_UXIP, false);
1843
+		}
1844
+		// is this already cached for this request?  If so use it.
1845
+		if (EE_Core_Config::$ee_ueip_option !== null) {
1846
+			return EE_Core_Config::$ee_ueip_option;
1847
+		}
1848
+		global $wpdb;
1849
+		$current_network_main_site = is_multisite() ? get_current_site() : null;
1850
+		$current_main_site_id = ! empty($current_network_main_site) ? $current_network_main_site->blog_id : 1;
1851
+		$option = self::OPTION_NAME_UXIP;
1852
+		// set correct table for query
1853
+		$table_name = $wpdb->get_blog_prefix($current_main_site_id) . 'options';
1854
+		// rather than getting blog option for the $current_main_site_id, we do a direct $wpdb query because
1855
+		// get_blog_option() does a switch_to_blog an that could cause infinite recursion because EE_Core_Config might be
1856
+		// re-constructed on the blog switch.  Note, we are still executing any core wp filters on this option retrieval.
1857
+		// this bit of code is basically a direct copy of get_option without any caching because we are NOT switched to the blog
1858
+		// for the purpose of caching.
1859
+		$pre = apply_filters('pre_option_' . $option, false, $option);
1860
+		if (false !== $pre) {
1861
+			EE_Core_Config::$ee_ueip_option = $pre;
1862
+			return EE_Core_Config::$ee_ueip_option;
1863
+		}
1864
+		$row = $wpdb->get_row(
1865
+			$wpdb->prepare(
1866
+				"SELECT option_value FROM $table_name WHERE option_name = %s LIMIT 1",
1867
+				$option
1868
+			)
1869
+		);
1870
+		if (is_object($row)) {
1871
+			$value = $row->option_value;
1872
+		} else { // option does not exist so use default.
1873
+			EE_Core_Config::$ee_ueip_option =  apply_filters('default_option_' . $option, false, $option);
1874
+			return EE_Core_Config::$ee_ueip_option;
1875
+		}
1876
+		EE_Core_Config::$ee_ueip_option = apply_filters('option_' . $option, maybe_unserialize($value), $option);
1877
+		return EE_Core_Config::$ee_ueip_option;
1878
+	}
1879
+
1880
+
1881
+	/**
1882
+	 * Utility function for escaping the value of a property and returning.
1883
+	 *
1884
+	 * @param string $property property name (checks to see if exists).
1885
+	 * @return mixed if a detected type found return the escaped value, otherwise just the raw value is returned.
1886
+	 * @throws \EE_Error
1887
+	 */
1888
+	public function get_pretty($property)
1889
+	{
1890
+		if ($property === self::OPTION_NAME_UXIP) {
1891
+			return $this->ee_ueip_optin ? 'yes' : 'no';
1892
+		}
1893
+		return parent::get_pretty($property);
1894
+	}
1895
+
1896
+
1897
+	/**
1898
+	 * Currently used to ensure critical page urls have initial values saved to the db instead of any current set values
1899
+	 * on the object.
1900
+	 *
1901
+	 * @return array
1902
+	 */
1903
+	public function __sleep()
1904
+	{
1905
+		// reset all url properties
1906
+		$this->_reset_urls();
1907
+		// return what to save to db
1908
+		return array_keys(get_object_vars($this));
1909
+	}
1910
+}
2294 1911
 
2295
-    /**
2296
-     * array of form names protected by ReCaptcha
2297
-     *
2298
-     * @var array $recaptcha_protected_forms
2299
-     */
2300
-    public $recaptcha_protected_forms;
1912
+/**
1913
+ * Config class for storing info on the Organization
1914
+ */
1915
+class EE_Organization_Config extends EE_Config_Base
1916
+{
2301 1917
 
2302
-    /**
2303
-     * ReCaptcha width
2304
-     *
2305
-     * @var int $recaptcha_width
2306
-     * @deprecated
2307
-     */
2308
-    public $recaptcha_width;
1918
+	/**
1919
+	 * @var string $name
1920
+	 * eg EE4.1
1921
+	 */
1922
+	public $name;
1923
+
1924
+	/**
1925
+	 * @var string $address_1
1926
+	 * eg 123 Onna Road
1927
+	 */
1928
+	public $address_1 = '';
1929
+
1930
+	/**
1931
+	 * @var string $address_2
1932
+	 * eg PO Box 123
1933
+	 */
1934
+	public $address_2 = '';
1935
+
1936
+	/**
1937
+	 * @var string $city
1938
+	 * eg Inna City
1939
+	 */
1940
+	public $city = '';
1941
+
1942
+	/**
1943
+	 * @var int $STA_ID
1944
+	 * eg 4
1945
+	 */
1946
+	public $STA_ID = 0;
1947
+
1948
+	/**
1949
+	 * @var string $CNT_ISO
1950
+	 * eg US
1951
+	 */
1952
+	public $CNT_ISO = '';
1953
+
1954
+	/**
1955
+	 * @var string $zip
1956
+	 * eg 12345  or V1A 2B3
1957
+	 */
1958
+	public $zip = '';
1959
+
1960
+	/**
1961
+	 * @var string $email
1962
+	 * eg [email protected]
1963
+	 */
1964
+	public $email;
1965
+
1966
+	/**
1967
+	 * @var string $phone
1968
+	 * eg. 111-111-1111
1969
+	 */
1970
+	public $phone = '';
1971
+
1972
+	/**
1973
+	 * @var string $vat
1974
+	 * VAT/Tax Number
1975
+	 */
1976
+	public $vat = '';
1977
+
1978
+	/**
1979
+	 * @var string $logo_url
1980
+	 * eg http://www.somedomain.com/wp-content/uploads/kittehs.jpg
1981
+	 */
1982
+	public $logo_url = '';
1983
+
1984
+	/**
1985
+	 * The below are all various properties for holding links to organization social network profiles
1986
+	 *
1987
+	 * @var string
1988
+	 */
1989
+	/**
1990
+	 * facebook (facebook.com/profile.name)
1991
+	 *
1992
+	 * @var string
1993
+	 */
1994
+	public $facebook = '';
1995
+
1996
+	/**
1997
+	 * twitter (twitter.com/twitter_handle)
1998
+	 *
1999
+	 * @var string
2000
+	 */
2001
+	public $twitter = '';
2002
+
2003
+	/**
2004
+	 * linkedin (linkedin.com/in/profile_name)
2005
+	 *
2006
+	 * @var string
2007
+	 */
2008
+	public $linkedin = '';
2009
+
2010
+	/**
2011
+	 * pinterest (www.pinterest.com/profile_name)
2012
+	 *
2013
+	 * @var string
2014
+	 */
2015
+	public $pinterest = '';
2016
+
2017
+	/**
2018
+	 * google+ (google.com/+profileName)
2019
+	 *
2020
+	 * @var string
2021
+	 */
2022
+	public $google = '';
2023
+
2024
+	/**
2025
+	 * instagram (instagram.com/handle)
2026
+	 *
2027
+	 * @var string
2028
+	 */
2029
+	public $instagram = '';
2030
+
2031
+
2032
+	/**
2033
+	 *    class constructor
2034
+	 *
2035
+	 * @access    public
2036
+	 */
2037
+	public function __construct()
2038
+	{
2039
+		// set default organization settings
2040
+		// decode HTML entities from the WP blogname, because it's stored in the DB with HTML entities encoded
2041
+		$this->name = wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES);
2042
+		$this->email = get_bloginfo('admin_email');
2043
+	}
2044
+}
2309 2045
 
2310
-    /**
2311
-     * Whether or not invalid attempts to directly access the registration checkout page should be tracked.
2312
-     *
2313
-     * @var boolean $track_invalid_checkout_access
2314
-     */
2315
-    protected $track_invalid_checkout_access = true;
2046
+/**
2047
+ * Class for defining what's in the EE_Config relating to currency
2048
+ */
2049
+class EE_Currency_Config extends EE_Config_Base
2050
+{
2316 2051
 
2317
-    /**
2318
-     * Whether or not to show the privacy policy consent checkbox
2319
-     *
2320
-     * @var bool
2321
-     */
2322
-    public $consent_checkbox_enabled;
2052
+	/**
2053
+	 * @var string $code
2054
+	 * eg 'US'
2055
+	 */
2056
+	public $code;
2057
+
2058
+	/**
2059
+	 * @var string $name
2060
+	 * eg 'Dollar'
2061
+	 */
2062
+	public $name;
2063
+
2064
+	/**
2065
+	 * plural name
2066
+	 *
2067
+	 * @var string $plural
2068
+	 * eg 'Dollars'
2069
+	 */
2070
+	public $plural;
2071
+
2072
+	/**
2073
+	 * currency sign
2074
+	 *
2075
+	 * @var string $sign
2076
+	 * eg '$'
2077
+	 */
2078
+	public $sign;
2079
+
2080
+	/**
2081
+	 * Whether the currency sign should come before the number or not
2082
+	 *
2083
+	 * @var boolean $sign_b4
2084
+	 */
2085
+	public $sign_b4;
2086
+
2087
+	/**
2088
+	 * How many digits should come after the decimal place
2089
+	 *
2090
+	 * @var int $dec_plc
2091
+	 */
2092
+	public $dec_plc;
2093
+
2094
+	/**
2095
+	 * Symbol to use for decimal mark
2096
+	 *
2097
+	 * @var string $dec_mrk
2098
+	 * eg '.'
2099
+	 */
2100
+	public $dec_mrk;
2101
+
2102
+	/**
2103
+	 * Symbol to use for thousands
2104
+	 *
2105
+	 * @var string $thsnds
2106
+	 * eg ','
2107
+	 */
2108
+	public $thsnds;
2109
+
2110
+
2111
+	/**
2112
+	 *    class constructor
2113
+	 *
2114
+	 * @access    public
2115
+	 * @param string $CNT_ISO
2116
+	 * @throws \EE_Error
2117
+	 */
2118
+	public function __construct($CNT_ISO = '')
2119
+	{
2120
+		/** @var \EventEspresso\core\services\database\TableAnalysis $table_analysis */
2121
+		$table_analysis = EE_Registry::instance()->create('TableAnalysis', array(), true);
2122
+		// get country code from organization settings or use default
2123
+		$ORG_CNT = isset(EE_Registry::instance()->CFG->organization)
2124
+				   && EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config
2125
+			? EE_Registry::instance()->CFG->organization->CNT_ISO
2126
+			: '';
2127
+		// but override if requested
2128
+		$CNT_ISO = ! empty($CNT_ISO) ? $CNT_ISO : $ORG_CNT;
2129
+		// so if that all went well, and we are not in M-Mode (cuz you can't query the db in M-Mode) and double-check the countries table exists
2130
+		if (! empty($CNT_ISO)
2131
+			&& EE_Maintenance_Mode::instance()->models_can_query()
2132
+			&& $table_analysis->tableExists(EE_Registry::instance()->load_model('Country')->table())
2133
+		) {
2134
+			// retrieve the country settings from the db, just in case they have been customized
2135
+			$country = EE_Registry::instance()->load_model('Country')->get_one_by_ID($CNT_ISO);
2136
+			if ($country instanceof EE_Country) {
2137
+				$this->code = $country->currency_code();    // currency code: USD, CAD, EUR
2138
+				$this->name = $country->currency_name_single();    // Dollar
2139
+				$this->plural = $country->currency_name_plural();    // Dollars
2140
+				$this->sign = $country->currency_sign();            // currency sign: $
2141
+				$this->sign_b4 = $country->currency_sign_before(
2142
+				);        // currency sign before or after: $TRUE  or  FALSE$
2143
+				$this->dec_plc = $country->currency_decimal_places();    // decimal places: 2 = 0.00  3 = 0.000
2144
+				$this->dec_mrk = $country->currency_decimal_mark(
2145
+				);    // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2146
+				$this->thsnds = $country->currency_thousands_separator(
2147
+				);    // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2148
+			}
2149
+		}
2150
+		// fallback to hardcoded defaults, in case the above failed
2151
+		if (empty($this->code)) {
2152
+			// set default currency settings
2153
+			$this->code = 'USD';    // currency code: USD, CAD, EUR
2154
+			$this->name = __('Dollar', 'event_espresso');    // Dollar
2155
+			$this->plural = __('Dollars', 'event_espresso');    // Dollars
2156
+			$this->sign = '$';    // currency sign: $
2157
+			$this->sign_b4 = true;    // currency sign before or after: $TRUE  or  FALSE$
2158
+			$this->dec_plc = 2;    // decimal places: 2 = 0.00  3 = 0.000
2159
+			$this->dec_mrk = '.';    // decimal mark: (comma) ',' = 0,01   or (decimal) '.' = 0.01
2160
+			$this->thsnds = ',';    // thousands separator: (comma) ',' = 1,000   or (decimal) '.' = 1.000
2161
+		}
2162
+	}
2163
+}
2323 2164
 
2324
-    /**
2325
-     * Label text to show on the checkbox
2326
-     *
2327
-     * @var string
2328
-     */
2329
-    public $consent_checkbox_label_text;
2165
+/**
2166
+ * Class for defining what's in the EE_Config relating to registration settings
2167
+ */
2168
+class EE_Registration_Config extends EE_Config_Base
2169
+{
2330 2170
 
2331
-    /*
2171
+	/**
2172
+	 * Default registration status
2173
+	 *
2174
+	 * @var string $default_STS_ID
2175
+	 * eg 'RPP'
2176
+	 */
2177
+	public $default_STS_ID;
2178
+
2179
+	/**
2180
+	 * For new events, this will be the default value for the maximum number of tickets (equivalent to maximum number of
2181
+	 * registrations)
2182
+	 *
2183
+	 * @var int
2184
+	 */
2185
+	public $default_maximum_number_of_tickets;
2186
+
2187
+	/**
2188
+	 * level of validation to apply to email addresses
2189
+	 *
2190
+	 * @var string $email_validation_level
2191
+	 * options: 'basic', 'wp_default', 'i18n', 'i18n_dns'
2192
+	 */
2193
+	public $email_validation_level;
2194
+
2195
+	/**
2196
+	 *    whether or not to show alternate payment options during the reg process if payment status is pending
2197
+	 *
2198
+	 * @var boolean $show_pending_payment_options
2199
+	 */
2200
+	public $show_pending_payment_options;
2201
+
2202
+	/**
2203
+	 * Whether to skip the registration confirmation page
2204
+	 *
2205
+	 * @var boolean $skip_reg_confirmation
2206
+	 */
2207
+	public $skip_reg_confirmation;
2208
+
2209
+	/**
2210
+	 * an array of SPCO reg steps where:
2211
+	 *        the keys denotes the reg step order
2212
+	 *        each element consists of an array with the following elements:
2213
+	 *            "file_path" => the file path to the EE_SPCO_Reg_Step class
2214
+	 *            "class_name" => the specific EE_SPCO_Reg_Step child class name
2215
+	 *            "slug" => the URL param used to trigger the reg step
2216
+	 *
2217
+	 * @var array $reg_steps
2218
+	 */
2219
+	public $reg_steps;
2220
+
2221
+	/**
2222
+	 * Whether registration confirmation should be the last page of SPCO
2223
+	 *
2224
+	 * @var boolean $reg_confirmation_last
2225
+	 */
2226
+	public $reg_confirmation_last;
2227
+
2228
+	/**
2229
+	 * Whether or not to enable the EE Bot Trap
2230
+	 *
2231
+	 * @var boolean $use_bot_trap
2232
+	 */
2233
+	public $use_bot_trap;
2234
+
2235
+	/**
2236
+	 * Whether or not to encrypt some data sent by the EE Bot Trap
2237
+	 *
2238
+	 * @var boolean $use_encryption
2239
+	 */
2240
+	public $use_encryption;
2241
+
2242
+	/**
2243
+	 * Whether or not to use ReCaptcha
2244
+	 *
2245
+	 * @var boolean $use_captcha
2246
+	 */
2247
+	public $use_captcha;
2248
+
2249
+	/**
2250
+	 * ReCaptcha Theme
2251
+	 *
2252
+	 * @var string $recaptcha_theme
2253
+	 *    options: 'dark', 'light', 'invisible'
2254
+	 */
2255
+	public $recaptcha_theme;
2256
+
2257
+	/**
2258
+	 * ReCaptcha Badge - determines the position of the reCAPTCHA badge if using Invisible ReCaptcha.
2259
+	 *
2260
+	 * @var string $recaptcha_badge
2261
+	 *    options: 'bottomright', 'bottomleft', 'inline'
2262
+	 */
2263
+	public $recaptcha_badge;
2264
+
2265
+	/**
2266
+	 * ReCaptcha Type
2267
+	 *
2268
+	 * @var string $recaptcha_type
2269
+	 *    options: 'audio', 'image'
2270
+	 */
2271
+	public $recaptcha_type;
2272
+
2273
+	/**
2274
+	 * ReCaptcha language
2275
+	 *
2276
+	 * @var string $recaptcha_language
2277
+	 * eg 'en'
2278
+	 */
2279
+	public $recaptcha_language;
2280
+
2281
+	/**
2282
+	 * ReCaptcha public key
2283
+	 *
2284
+	 * @var string $recaptcha_publickey
2285
+	 */
2286
+	public $recaptcha_publickey;
2287
+
2288
+	/**
2289
+	 * ReCaptcha private key
2290
+	 *
2291
+	 * @var string $recaptcha_privatekey
2292
+	 */
2293
+	public $recaptcha_privatekey;
2294
+
2295
+	/**
2296
+	 * array of form names protected by ReCaptcha
2297
+	 *
2298
+	 * @var array $recaptcha_protected_forms
2299
+	 */
2300
+	public $recaptcha_protected_forms;
2301
+
2302
+	/**
2303
+	 * ReCaptcha width
2304
+	 *
2305
+	 * @var int $recaptcha_width
2306
+	 * @deprecated
2307
+	 */
2308
+	public $recaptcha_width;
2309
+
2310
+	/**
2311
+	 * Whether or not invalid attempts to directly access the registration checkout page should be tracked.
2312
+	 *
2313
+	 * @var boolean $track_invalid_checkout_access
2314
+	 */
2315
+	protected $track_invalid_checkout_access = true;
2316
+
2317
+	/**
2318
+	 * Whether or not to show the privacy policy consent checkbox
2319
+	 *
2320
+	 * @var bool
2321
+	 */
2322
+	public $consent_checkbox_enabled;
2323
+
2324
+	/**
2325
+	 * Label text to show on the checkbox
2326
+	 *
2327
+	 * @var string
2328
+	 */
2329
+	public $consent_checkbox_label_text;
2330
+
2331
+	/*
2332 2332
      * String describing how long to keep payment logs. Passed into DateTime constructor
2333 2333
      * @var string
2334 2334
      */
2335
-    public $gateway_log_lifespan = '1 week';
2336
-
2337
-
2338
-    /**
2339
-     *    class constructor
2340
-     *
2341
-     * @access    public
2342
-     */
2343
-    public function __construct()
2344
-    {
2345
-        // set default registration settings
2346
-        $this->default_STS_ID = EEM_Registration::status_id_pending_payment;
2347
-        $this->email_validation_level = 'wp_default';
2348
-        $this->show_pending_payment_options = true;
2349
-        $this->skip_reg_confirmation = true;
2350
-        $this->reg_steps = array();
2351
-        $this->reg_confirmation_last = false;
2352
-        $this->use_bot_trap = true;
2353
-        $this->use_encryption = true;
2354
-        $this->use_captcha = false;
2355
-        $this->recaptcha_theme = 'light';
2356
-        $this->recaptcha_badge = 'bottomleft';
2357
-        $this->recaptcha_type = 'image';
2358
-        $this->recaptcha_language = 'en';
2359
-        $this->recaptcha_publickey = null;
2360
-        $this->recaptcha_privatekey = null;
2361
-        $this->recaptcha_protected_forms = array();
2362
-        $this->recaptcha_width = 500;
2363
-        $this->default_maximum_number_of_tickets = 10;
2364
-        $this->consent_checkbox_enabled = false;
2365
-        $this->consent_checkbox_label_text = '';
2366
-        $this->gateway_log_lifespan = '7 days';
2367
-    }
2368
-
2369
-
2370
-    /**
2371
-     * This is called by the config loader and hooks are initialized AFTER the config has been populated.
2372
-     *
2373
-     * @since 4.8.8.rc.019
2374
-     */
2375
-    public function do_hooks()
2376
-    {
2377
-        add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_reg_status_on_EEM_Event'));
2378
-        add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_max_ticket_on_EEM_Event'));
2379
-        add_action('setup_theme', array($this, 'setDefaultCheckboxLabelText'));
2380
-    }
2381
-
2382
-
2383
-    /**
2384
-     * Hooked into `AHEE__EE_Config___load_core_config__end` to ensure the default for the
2385
-     * EVT_default_registration_status field matches the config setting for default_STS_ID.
2386
-     */
2387
-    public function set_default_reg_status_on_EEM_Event()
2388
-    {
2389
-        EEM_Event::set_default_reg_status($this->default_STS_ID);
2390
-    }
2391
-
2392
-
2393
-    /**
2394
-     * Hooked into `AHEE__EE_Config___load_core_config__end` to ensure the default for the EVT_additional_limit field
2395
-     * for Events matches the config setting for default_maximum_number_of_tickets
2396
-     */
2397
-    public function set_default_max_ticket_on_EEM_Event()
2398
-    {
2399
-        EEM_Event::set_default_additional_limit($this->default_maximum_number_of_tickets);
2400
-    }
2401
-
2402
-
2403
-    /**
2404
-     * Sets the default consent checkbox text. This needs to be done a bit later than when EE_Registration_Config is
2405
-     * constructed because that happens before we can get the privacy policy page's permalink.
2406
-     *
2407
-     * @throws InvalidArgumentException
2408
-     * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
2409
-     * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
2410
-     */
2411
-    public function setDefaultCheckboxLabelText()
2412
-    {
2413
-        if ($this->getConsentCheckboxLabelText() === null
2414
-            || $this->getConsentCheckboxLabelText() === '') {
2415
-            $opening_a_tag = '';
2416
-            $closing_a_tag = '';
2417
-            if (function_exists('get_privacy_policy_url')) {
2418
-                $privacy_page_url = get_privacy_policy_url();
2419
-                if (! empty($privacy_page_url)) {
2420
-                    $opening_a_tag = '<a href="' . $privacy_page_url . '" target="_blank">';
2421
-                    $closing_a_tag = '</a>';
2422
-                }
2423
-            }
2424
-            $loader = LoaderFactory::getLoader();
2425
-            $org_config = $loader->getShared('EE_Organization_Config');
2426
-            /**
2427
-             * @var $org_config EE_Organization_Config
2428
-             */
2429
-
2430
-            $this->setConsentCheckboxLabelText(
2431
-                sprintf(
2432
-                    esc_html__(
2433
-                        'I consent to %1$s storing and using my personal information, according to their %2$sprivacy policy%3$s.',
2434
-                        'event_espresso'
2435
-                    ),
2436
-                    $org_config->name,
2437
-                    $opening_a_tag,
2438
-                    $closing_a_tag
2439
-                )
2440
-            );
2441
-        }
2442
-    }
2443
-
2444
-
2445
-    /**
2446
-     * @return boolean
2447
-     */
2448
-    public function track_invalid_checkout_access()
2449
-    {
2450
-        return $this->track_invalid_checkout_access;
2451
-    }
2452
-
2453
-
2454
-    /**
2455
-     * @param boolean $track_invalid_checkout_access
2456
-     */
2457
-    public function set_track_invalid_checkout_access($track_invalid_checkout_access)
2458
-    {
2459
-        $this->track_invalid_checkout_access = filter_var(
2460
-            $track_invalid_checkout_access,
2461
-            FILTER_VALIDATE_BOOLEAN
2462
-        );
2463
-    }
2464
-
2465
-
2466
-    /**
2467
-     * Gets the options to make availalbe for the gateway log lifespan
2468
-     * @return array
2469
-     */
2470
-    public function gatewayLogLifespanOptions()
2471
-    {
2472
-        return (array) apply_filters(
2473
-            'FHEE_EE_Admin_Config__gatewayLogLifespanOptions',
2474
-            array(
2475
-                '1 second' => esc_html__('Don\'t Log At All', 'event_espresso'),
2476
-                '1 day' => esc_html__('1 Day', 'event_espresso'),
2477
-                '7 days' => esc_html__('7 Days', 'event_espresso'),
2478
-                '14 days' => esc_html__('14 Days', 'event_espresso'),
2479
-                '30 days' => esc_html__('30 Days', 'event_espresso')
2480
-            )
2481
-        );
2482
-    }
2483
-
2484
-
2485
-    /**
2486
-     * @return bool
2487
-     */
2488
-    public function isConsentCheckboxEnabled()
2489
-    {
2490
-        return $this->consent_checkbox_enabled;
2491
-    }
2492
-
2493
-
2494
-    /**
2495
-     * @param bool $consent_checkbox_enabled
2496
-     */
2497
-    public function setConsentCheckboxEnabled($consent_checkbox_enabled)
2498
-    {
2499
-        $this->consent_checkbox_enabled = filter_var(
2500
-            $consent_checkbox_enabled,
2501
-            FILTER_VALIDATE_BOOLEAN
2502
-        );
2503
-    }
2504
-
2505
-
2506
-    /**
2507
-     * @return string
2508
-     */
2509
-    public function getConsentCheckboxLabelText()
2510
-    {
2511
-        return $this->consent_checkbox_label_text;
2512
-    }
2513
-
2514
-
2515
-    /**
2516
-     * @param string $consent_checkbox_label_text
2517
-     */
2518
-    public function setConsentCheckboxLabelText($consent_checkbox_label_text)
2519
-    {
2520
-        $this->consent_checkbox_label_text = (string) $consent_checkbox_label_text;
2521
-    }
2335
+	public $gateway_log_lifespan = '1 week';
2336
+
2337
+
2338
+	/**
2339
+	 *    class constructor
2340
+	 *
2341
+	 * @access    public
2342
+	 */
2343
+	public function __construct()
2344
+	{
2345
+		// set default registration settings
2346
+		$this->default_STS_ID = EEM_Registration::status_id_pending_payment;
2347
+		$this->email_validation_level = 'wp_default';
2348
+		$this->show_pending_payment_options = true;
2349
+		$this->skip_reg_confirmation = true;
2350
+		$this->reg_steps = array();
2351
+		$this->reg_confirmation_last = false;
2352
+		$this->use_bot_trap = true;
2353
+		$this->use_encryption = true;
2354
+		$this->use_captcha = false;
2355
+		$this->recaptcha_theme = 'light';
2356
+		$this->recaptcha_badge = 'bottomleft';
2357
+		$this->recaptcha_type = 'image';
2358
+		$this->recaptcha_language = 'en';
2359
+		$this->recaptcha_publickey = null;
2360
+		$this->recaptcha_privatekey = null;
2361
+		$this->recaptcha_protected_forms = array();
2362
+		$this->recaptcha_width = 500;
2363
+		$this->default_maximum_number_of_tickets = 10;
2364
+		$this->consent_checkbox_enabled = false;
2365
+		$this->consent_checkbox_label_text = '';
2366
+		$this->gateway_log_lifespan = '7 days';
2367
+	}
2368
+
2369
+
2370
+	/**
2371
+	 * This is called by the config loader and hooks are initialized AFTER the config has been populated.
2372
+	 *
2373
+	 * @since 4.8.8.rc.019
2374
+	 */
2375
+	public function do_hooks()
2376
+	{
2377
+		add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_reg_status_on_EEM_Event'));
2378
+		add_action('AHEE__EE_Config___load_core_config__end', array($this, 'set_default_max_ticket_on_EEM_Event'));
2379
+		add_action('setup_theme', array($this, 'setDefaultCheckboxLabelText'));
2380
+	}
2381
+
2382
+
2383
+	/**
2384
+	 * Hooked into `AHEE__EE_Config___load_core_config__end` to ensure the default for the
2385
+	 * EVT_default_registration_status field matches the config setting for default_STS_ID.
2386
+	 */
2387
+	public function set_default_reg_status_on_EEM_Event()
2388
+	{
2389
+		EEM_Event::set_default_reg_status($this->default_STS_ID);
2390
+	}
2391
+
2392
+
2393
+	/**
2394
+	 * Hooked into `AHEE__EE_Config___load_core_config__end` to ensure the default for the EVT_additional_limit field
2395
+	 * for Events matches the config setting for default_maximum_number_of_tickets
2396
+	 */
2397
+	public function set_default_max_ticket_on_EEM_Event()
2398
+	{
2399
+		EEM_Event::set_default_additional_limit($this->default_maximum_number_of_tickets);
2400
+	}
2401
+
2402
+
2403
+	/**
2404
+	 * Sets the default consent checkbox text. This needs to be done a bit later than when EE_Registration_Config is
2405
+	 * constructed because that happens before we can get the privacy policy page's permalink.
2406
+	 *
2407
+	 * @throws InvalidArgumentException
2408
+	 * @throws \EventEspresso\core\exceptions\InvalidDataTypeException
2409
+	 * @throws \EventEspresso\core\exceptions\InvalidInterfaceException
2410
+	 */
2411
+	public function setDefaultCheckboxLabelText()
2412
+	{
2413
+		if ($this->getConsentCheckboxLabelText() === null
2414
+			|| $this->getConsentCheckboxLabelText() === '') {
2415
+			$opening_a_tag = '';
2416
+			$closing_a_tag = '';
2417
+			if (function_exists('get_privacy_policy_url')) {
2418
+				$privacy_page_url = get_privacy_policy_url();
2419
+				if (! empty($privacy_page_url)) {
2420
+					$opening_a_tag = '<a href="' . $privacy_page_url . '" target="_blank">';
2421
+					$closing_a_tag = '</a>';
2422
+				}
2423
+			}
2424
+			$loader = LoaderFactory::getLoader();
2425
+			$org_config = $loader->getShared('EE_Organization_Config');
2426
+			/**
2427
+			 * @var $org_config EE_Organization_Config
2428
+			 */
2429
+
2430
+			$this->setConsentCheckboxLabelText(
2431
+				sprintf(
2432
+					esc_html__(
2433
+						'I consent to %1$s storing and using my personal information, according to their %2$sprivacy policy%3$s.',
2434
+						'event_espresso'
2435
+					),
2436
+					$org_config->name,
2437
+					$opening_a_tag,
2438
+					$closing_a_tag
2439
+				)
2440
+			);
2441
+		}
2442
+	}
2443
+
2444
+
2445
+	/**
2446
+	 * @return boolean
2447
+	 */
2448
+	public function track_invalid_checkout_access()
2449
+	{
2450
+		return $this->track_invalid_checkout_access;
2451
+	}
2452
+
2453
+
2454
+	/**
2455
+	 * @param boolean $track_invalid_checkout_access
2456
+	 */
2457
+	public function set_track_invalid_checkout_access($track_invalid_checkout_access)
2458
+	{
2459
+		$this->track_invalid_checkout_access = filter_var(
2460
+			$track_invalid_checkout_access,
2461
+			FILTER_VALIDATE_BOOLEAN
2462
+		);
2463
+	}
2464
+
2465
+
2466
+	/**
2467
+	 * Gets the options to make availalbe for the gateway log lifespan
2468
+	 * @return array
2469
+	 */
2470
+	public function gatewayLogLifespanOptions()
2471
+	{
2472
+		return (array) apply_filters(
2473
+			'FHEE_EE_Admin_Config__gatewayLogLifespanOptions',
2474
+			array(
2475
+				'1 second' => esc_html__('Don\'t Log At All', 'event_espresso'),
2476
+				'1 day' => esc_html__('1 Day', 'event_espresso'),
2477
+				'7 days' => esc_html__('7 Days', 'event_espresso'),
2478
+				'14 days' => esc_html__('14 Days', 'event_espresso'),
2479
+				'30 days' => esc_html__('30 Days', 'event_espresso')
2480
+			)
2481
+		);
2482
+	}
2483
+
2484
+
2485
+	/**
2486
+	 * @return bool
2487
+	 */
2488
+	public function isConsentCheckboxEnabled()
2489
+	{
2490
+		return $this->consent_checkbox_enabled;
2491
+	}
2492
+
2493
+
2494
+	/**
2495
+	 * @param bool $consent_checkbox_enabled
2496
+	 */
2497
+	public function setConsentCheckboxEnabled($consent_checkbox_enabled)
2498
+	{
2499
+		$this->consent_checkbox_enabled = filter_var(
2500
+			$consent_checkbox_enabled,
2501
+			FILTER_VALIDATE_BOOLEAN
2502
+		);
2503
+	}
2504
+
2505
+
2506
+	/**
2507
+	 * @return string
2508
+	 */
2509
+	public function getConsentCheckboxLabelText()
2510
+	{
2511
+		return $this->consent_checkbox_label_text;
2512
+	}
2513
+
2514
+
2515
+	/**
2516
+	 * @param string $consent_checkbox_label_text
2517
+	 */
2518
+	public function setConsentCheckboxLabelText($consent_checkbox_label_text)
2519
+	{
2520
+		$this->consent_checkbox_label_text = (string) $consent_checkbox_label_text;
2521
+	}
2522 2522
 }
2523 2523
 
2524 2524
 /**
@@ -2527,159 +2527,159 @@  discard block
 block discarded – undo
2527 2527
 class EE_Admin_Config extends EE_Config_Base
2528 2528
 {
2529 2529
 
2530
-    /**
2531
-     * @var boolean $use_personnel_manager
2532
-     */
2533
-    public $use_personnel_manager;
2534
-
2535
-    /**
2536
-     * @var boolean $use_dashboard_widget
2537
-     */
2538
-    public $use_dashboard_widget;
2539
-
2540
-    /**
2541
-     * @var int $events_in_dashboard
2542
-     */
2543
-    public $events_in_dashboard;
2544
-
2545
-    /**
2546
-     * @var boolean $use_event_timezones
2547
-     */
2548
-    public $use_event_timezones;
2549
-
2550
-    /**
2551
-     * @var boolean $use_full_logging
2552
-     */
2553
-    public $use_full_logging;
2554
-
2555
-    /**
2556
-     * @var string $log_file_name
2557
-     */
2558
-    public $log_file_name;
2559
-
2560
-    /**
2561
-     * @var string $debug_file_name
2562
-     */
2563
-    public $debug_file_name;
2564
-
2565
-    /**
2566
-     * @var boolean $use_remote_logging
2567
-     */
2568
-    public $use_remote_logging;
2569
-
2570
-    /**
2571
-     * @var string $remote_logging_url
2572
-     */
2573
-    public $remote_logging_url;
2574
-
2575
-    /**
2576
-     * @var boolean $show_reg_footer
2577
-     */
2578
-    public $show_reg_footer;
2579
-
2580
-    /**
2581
-     * @var string $affiliate_id
2582
-     */
2583
-    public $affiliate_id;
2584
-
2585
-    /**
2586
-     * help tours on or off (global setting)
2587
-     *
2588
-     * @var boolean
2589
-     */
2590
-    public $help_tour_activation;
2591
-
2592
-    /**
2593
-     * adds extra layer of encoding to session data to prevent serialization errors
2594
-     * but is incompatible with some server configuration errors
2595
-     * if you get "500 internal server errors" during registration, try turning this on
2596
-     * if you get PHP fatal errors regarding base 64 methods not defined, then turn this off
2597
-     *
2598
-     * @var boolean $encode_session_data
2599
-     */
2600
-    private $encode_session_data = false;
2601
-
2602
-
2603
-    /**
2604
-     *    class constructor
2605
-     *
2606
-     * @access    public
2607
-     */
2608
-    public function __construct()
2609
-    {
2610
-        try {
2611
-            $domain = DomainFactory::getEventEspressoCoreDomain();
2612
-        } catch (Exception $e) {
2613
-            $domain = null;
2614
-        }
2615
-        // set default general admin settings
2616
-        $this->use_personnel_manager = true;
2617
-        $this->use_dashboard_widget = true;
2618
-        $this->events_in_dashboard = 30;
2619
-        $this->use_event_timezones = false;
2620
-        $this->use_full_logging = false;
2621
-        $this->use_remote_logging = false;
2622
-        $this->remote_logging_url = null;
2623
-        $this->show_reg_footer = $domain instanceof Domain ? $domain->isCaffeinated() : false;
2624
-        $this->affiliate_id = 'default';
2625
-        $this->help_tour_activation = true;
2626
-        $this->encode_session_data = false;
2627
-    }
2628
-
2629
-
2630
-    /**
2631
-     * @param bool $reset
2632
-     * @return string
2633
-     */
2634
-    public function log_file_name($reset = false)
2635
-    {
2636
-        if (empty($this->log_file_name) || $reset) {
2637
-            $this->log_file_name = sanitize_key('espresso_log_' . md5(uniqid('', true))) . '.txt';
2638
-            EE_Config::instance()->update_espresso_config(false, false);
2639
-        }
2640
-        return $this->log_file_name;
2641
-    }
2642
-
2643
-
2644
-    /**
2645
-     * @param bool $reset
2646
-     * @return string
2647
-     */
2648
-    public function debug_file_name($reset = false)
2649
-    {
2650
-        if (empty($this->debug_file_name) || $reset) {
2651
-            $this->debug_file_name = sanitize_key('espresso_debug_' . md5(uniqid('', true))) . '.txt';
2652
-            EE_Config::instance()->update_espresso_config(false, false);
2653
-        }
2654
-        return $this->debug_file_name;
2655
-    }
2656
-
2657
-
2658
-    /**
2659
-     * @return string
2660
-     */
2661
-    public function affiliate_id()
2662
-    {
2663
-        return ! empty($this->affiliate_id) ? $this->affiliate_id : 'default';
2664
-    }
2665
-
2666
-
2667
-    /**
2668
-     * @return boolean
2669
-     */
2670
-    public function encode_session_data()
2671
-    {
2672
-        return filter_var($this->encode_session_data, FILTER_VALIDATE_BOOLEAN);
2673
-    }
2674
-
2675
-
2676
-    /**
2677
-     * @param boolean $encode_session_data
2678
-     */
2679
-    public function set_encode_session_data($encode_session_data)
2680
-    {
2681
-        $this->encode_session_data = filter_var($encode_session_data, FILTER_VALIDATE_BOOLEAN);
2682
-    }
2530
+	/**
2531
+	 * @var boolean $use_personnel_manager
2532
+	 */
2533
+	public $use_personnel_manager;
2534
+
2535
+	/**
2536
+	 * @var boolean $use_dashboard_widget
2537
+	 */
2538
+	public $use_dashboard_widget;
2539
+
2540
+	/**
2541
+	 * @var int $events_in_dashboard
2542
+	 */
2543
+	public $events_in_dashboard;
2544
+
2545
+	/**
2546
+	 * @var boolean $use_event_timezones
2547
+	 */
2548
+	public $use_event_timezones;
2549
+
2550
+	/**
2551
+	 * @var boolean $use_full_logging
2552
+	 */
2553
+	public $use_full_logging;
2554
+
2555
+	/**
2556
+	 * @var string $log_file_name
2557
+	 */
2558
+	public $log_file_name;
2559
+
2560
+	/**
2561
+	 * @var string $debug_file_name
2562
+	 */
2563
+	public $debug_file_name;
2564
+
2565
+	/**
2566
+	 * @var boolean $use_remote_logging
2567
+	 */
2568
+	public $use_remote_logging;
2569
+
2570
+	/**
2571
+	 * @var string $remote_logging_url
2572
+	 */
2573
+	public $remote_logging_url;
2574
+
2575
+	/**
2576
+	 * @var boolean $show_reg_footer
2577
+	 */
2578
+	public $show_reg_footer;
2579
+
2580
+	/**
2581
+	 * @var string $affiliate_id
2582
+	 */
2583
+	public $affiliate_id;
2584
+
2585
+	/**
2586
+	 * help tours on or off (global setting)
2587
+	 *
2588
+	 * @var boolean
2589
+	 */
2590
+	public $help_tour_activation;
2591
+
2592
+	/**
2593
+	 * adds extra layer of encoding to session data to prevent serialization errors
2594
+	 * but is incompatible with some server configuration errors
2595
+	 * if you get "500 internal server errors" during registration, try turning this on
2596
+	 * if you get PHP fatal errors regarding base 64 methods not defined, then turn this off
2597
+	 *
2598
+	 * @var boolean $encode_session_data
2599
+	 */
2600
+	private $encode_session_data = false;
2601
+
2602
+
2603
+	/**
2604
+	 *    class constructor
2605
+	 *
2606
+	 * @access    public
2607
+	 */
2608
+	public function __construct()
2609
+	{
2610
+		try {
2611
+			$domain = DomainFactory::getEventEspressoCoreDomain();
2612
+		} catch (Exception $e) {
2613
+			$domain = null;
2614
+		}
2615
+		// set default general admin settings
2616
+		$this->use_personnel_manager = true;
2617
+		$this->use_dashboard_widget = true;
2618
+		$this->events_in_dashboard = 30;
2619
+		$this->use_event_timezones = false;
2620
+		$this->use_full_logging = false;
2621
+		$this->use_remote_logging = false;
2622
+		$this->remote_logging_url = null;
2623
+		$this->show_reg_footer = $domain instanceof Domain ? $domain->isCaffeinated() : false;
2624
+		$this->affiliate_id = 'default';
2625
+		$this->help_tour_activation = true;
2626
+		$this->encode_session_data = false;
2627
+	}
2628
+
2629
+
2630
+	/**
2631
+	 * @param bool $reset
2632
+	 * @return string
2633
+	 */
2634
+	public function log_file_name($reset = false)
2635
+	{
2636
+		if (empty($this->log_file_name) || $reset) {
2637
+			$this->log_file_name = sanitize_key('espresso_log_' . md5(uniqid('', true))) . '.txt';
2638
+			EE_Config::instance()->update_espresso_config(false, false);
2639
+		}
2640
+		return $this->log_file_name;
2641
+	}
2642
+
2643
+
2644
+	/**
2645
+	 * @param bool $reset
2646
+	 * @return string
2647
+	 */
2648
+	public function debug_file_name($reset = false)
2649
+	{
2650
+		if (empty($this->debug_file_name) || $reset) {
2651
+			$this->debug_file_name = sanitize_key('espresso_debug_' . md5(uniqid('', true))) . '.txt';
2652
+			EE_Config::instance()->update_espresso_config(false, false);
2653
+		}
2654
+		return $this->debug_file_name;
2655
+	}
2656
+
2657
+
2658
+	/**
2659
+	 * @return string
2660
+	 */
2661
+	public function affiliate_id()
2662
+	{
2663
+		return ! empty($this->affiliate_id) ? $this->affiliate_id : 'default';
2664
+	}
2665
+
2666
+
2667
+	/**
2668
+	 * @return boolean
2669
+	 */
2670
+	public function encode_session_data()
2671
+	{
2672
+		return filter_var($this->encode_session_data, FILTER_VALIDATE_BOOLEAN);
2673
+	}
2674
+
2675
+
2676
+	/**
2677
+	 * @param boolean $encode_session_data
2678
+	 */
2679
+	public function set_encode_session_data($encode_session_data)
2680
+	{
2681
+		$this->encode_session_data = filter_var($encode_session_data, FILTER_VALIDATE_BOOLEAN);
2682
+	}
2683 2683
 }
2684 2684
 
2685 2685
 /**
@@ -2688,70 +2688,70 @@  discard block
 block discarded – undo
2688 2688
 class EE_Template_Config extends EE_Config_Base
2689 2689
 {
2690 2690
 
2691
-    /**
2692
-     * @var boolean $enable_default_style
2693
-     */
2694
-    public $enable_default_style;
2695
-
2696
-    /**
2697
-     * @var string $custom_style_sheet
2698
-     */
2699
-    public $custom_style_sheet;
2700
-
2701
-    /**
2702
-     * @var boolean $display_address_in_regform
2703
-     */
2704
-    public $display_address_in_regform;
2705
-
2706
-    /**
2707
-     * @var int $display_description_on_multi_reg_page
2708
-     */
2709
-    public $display_description_on_multi_reg_page;
2710
-
2711
-    /**
2712
-     * @var boolean $use_custom_templates
2713
-     */
2714
-    public $use_custom_templates;
2715
-
2716
-    /**
2717
-     * @var string $current_espresso_theme
2718
-     */
2719
-    public $current_espresso_theme;
2720
-
2721
-    /**
2722
-     * @var EE_Ticket_Selector_Config $EED_Ticket_Selector
2723
-     */
2724
-    public $EED_Ticket_Selector;
2725
-
2726
-    /**
2727
-     * @var EE_Event_Single_Config $EED_Event_Single
2728
-     */
2729
-    public $EED_Event_Single;
2730
-
2731
-    /**
2732
-     * @var EE_Events_Archive_Config $EED_Events_Archive
2733
-     */
2734
-    public $EED_Events_Archive;
2735
-
2736
-
2737
-    /**
2738
-     *    class constructor
2739
-     *
2740
-     * @access    public
2741
-     */
2742
-    public function __construct()
2743
-    {
2744
-        // set default template settings
2745
-        $this->enable_default_style = true;
2746
-        $this->custom_style_sheet = null;
2747
-        $this->display_address_in_regform = true;
2748
-        $this->display_description_on_multi_reg_page = false;
2749
-        $this->use_custom_templates = false;
2750
-        $this->current_espresso_theme = 'Espresso_Arabica_2014';
2751
-        $this->EED_Event_Single = null;
2752
-        $this->EED_Events_Archive = null;
2753
-        $this->EED_Ticket_Selector = null;
2754
-    }
2691
+	/**
2692
+	 * @var boolean $enable_default_style
2693
+	 */
2694
+	public $enable_default_style;
2695
+
2696
+	/**
2697
+	 * @var string $custom_style_sheet
2698
+	 */
2699
+	public $custom_style_sheet;
2700
+
2701
+	/**
2702
+	 * @var boolean $display_address_in_regform
2703
+	 */
2704
+	public $display_address_in_regform;
2705
+
2706
+	/**
2707
+	 * @var int $display_description_on_multi_reg_page
2708
+	 */
2709
+	public $display_description_on_multi_reg_page;
2710
+
2711
+	/**
2712
+	 * @var boolean $use_custom_templates
2713
+	 */
2714
+	public $use_custom_templates;
2715
+
2716
+	/**
2717
+	 * @var string $current_espresso_theme
2718
+	 */
2719
+	public $current_espresso_theme;
2720
+
2721
+	/**
2722
+	 * @var EE_Ticket_Selector_Config $EED_Ticket_Selector
2723
+	 */
2724
+	public $EED_Ticket_Selector;
2725
+
2726
+	/**
2727
+	 * @var EE_Event_Single_Config $EED_Event_Single
2728
+	 */
2729
+	public $EED_Event_Single;
2730
+
2731
+	/**
2732
+	 * @var EE_Events_Archive_Config $EED_Events_Archive
2733
+	 */
2734
+	public $EED_Events_Archive;
2735
+
2736
+
2737
+	/**
2738
+	 *    class constructor
2739
+	 *
2740
+	 * @access    public
2741
+	 */
2742
+	public function __construct()
2743
+	{
2744
+		// set default template settings
2745
+		$this->enable_default_style = true;
2746
+		$this->custom_style_sheet = null;
2747
+		$this->display_address_in_regform = true;
2748
+		$this->display_description_on_multi_reg_page = false;
2749
+		$this->use_custom_templates = false;
2750
+		$this->current_espresso_theme = 'Espresso_Arabica_2014';
2751
+		$this->EED_Event_Single = null;
2752
+		$this->EED_Events_Archive = null;
2753
+		$this->EED_Ticket_Selector = null;
2754
+	}
2755 2755
 }
2756 2756
 
2757 2757
 /**
@@ -2760,114 +2760,114 @@  discard block
 block discarded – undo
2760 2760
 class EE_Map_Config extends EE_Config_Base
2761 2761
 {
2762 2762
 
2763
-    /**
2764
-     * @var boolean $use_google_maps
2765
-     */
2766
-    public $use_google_maps;
2767
-
2768
-    /**
2769
-     * @var string $api_key
2770
-     */
2771
-    public $google_map_api_key;
2772
-
2773
-    /**
2774
-     * @var int $event_details_map_width
2775
-     */
2776
-    public $event_details_map_width;
2777
-
2778
-    /**
2779
-     * @var int $event_details_map_height
2780
-     */
2781
-    public $event_details_map_height;
2782
-
2783
-    /**
2784
-     * @var int $event_details_map_zoom
2785
-     */
2786
-    public $event_details_map_zoom;
2787
-
2788
-    /**
2789
-     * @var boolean $event_details_display_nav
2790
-     */
2791
-    public $event_details_display_nav;
2792
-
2793
-    /**
2794
-     * @var boolean $event_details_nav_size
2795
-     */
2796
-    public $event_details_nav_size;
2797
-
2798
-    /**
2799
-     * @var string $event_details_control_type
2800
-     */
2801
-    public $event_details_control_type;
2802
-
2803
-    /**
2804
-     * @var string $event_details_map_align
2805
-     */
2806
-    public $event_details_map_align;
2807
-
2808
-    /**
2809
-     * @var int $event_list_map_width
2810
-     */
2811
-    public $event_list_map_width;
2812
-
2813
-    /**
2814
-     * @var int $event_list_map_height
2815
-     */
2816
-    public $event_list_map_height;
2817
-
2818
-    /**
2819
-     * @var int $event_list_map_zoom
2820
-     */
2821
-    public $event_list_map_zoom;
2822
-
2823
-    /**
2824
-     * @var boolean $event_list_display_nav
2825
-     */
2826
-    public $event_list_display_nav;
2827
-
2828
-    /**
2829
-     * @var boolean $event_list_nav_size
2830
-     */
2831
-    public $event_list_nav_size;
2832
-
2833
-    /**
2834
-     * @var string $event_list_control_type
2835
-     */
2836
-    public $event_list_control_type;
2837
-
2838
-    /**
2839
-     * @var string $event_list_map_align
2840
-     */
2841
-    public $event_list_map_align;
2842
-
2843
-
2844
-    /**
2845
-     *    class constructor
2846
-     *
2847
-     * @access    public
2848
-     */
2849
-    public function __construct()
2850
-    {
2851
-        // set default map settings
2852
-        $this->use_google_maps = true;
2853
-        $this->google_map_api_key = '';
2854
-        // for event details pages (reg page)
2855
-        $this->event_details_map_width = 585;            // ee_map_width_single
2856
-        $this->event_details_map_height = 362;            // ee_map_height_single
2857
-        $this->event_details_map_zoom = 14;            // ee_map_zoom_single
2858
-        $this->event_details_display_nav = true;            // ee_map_nav_display_single
2859
-        $this->event_details_nav_size = false;            // ee_map_nav_size_single
2860
-        $this->event_details_control_type = 'default';        // ee_map_type_control_single
2861
-        $this->event_details_map_align = 'center';            // ee_map_align_single
2862
-        // for event list pages
2863
-        $this->event_list_map_width = 300;            // ee_map_width
2864
-        $this->event_list_map_height = 185;        // ee_map_height
2865
-        $this->event_list_map_zoom = 12;            // ee_map_zoom
2866
-        $this->event_list_display_nav = false;        // ee_map_nav_display
2867
-        $this->event_list_nav_size = true;            // ee_map_nav_size
2868
-        $this->event_list_control_type = 'dropdown';        // ee_map_type_control
2869
-        $this->event_list_map_align = 'center';            // ee_map_align
2870
-    }
2763
+	/**
2764
+	 * @var boolean $use_google_maps
2765
+	 */
2766
+	public $use_google_maps;
2767
+
2768
+	/**
2769
+	 * @var string $api_key
2770
+	 */
2771
+	public $google_map_api_key;
2772
+
2773
+	/**
2774
+	 * @var int $event_details_map_width
2775
+	 */
2776
+	public $event_details_map_width;
2777
+
2778
+	/**
2779
+	 * @var int $event_details_map_height
2780
+	 */
2781
+	public $event_details_map_height;
2782
+
2783
+	/**
2784
+	 * @var int $event_details_map_zoom
2785
+	 */
2786
+	public $event_details_map_zoom;
2787
+
2788
+	/**
2789
+	 * @var boolean $event_details_display_nav
2790
+	 */
2791
+	public $event_details_display_nav;
2792
+
2793
+	/**
2794
+	 * @var boolean $event_details_nav_size
2795
+	 */
2796
+	public $event_details_nav_size;
2797
+
2798
+	/**
2799
+	 * @var string $event_details_control_type
2800
+	 */
2801
+	public $event_details_control_type;
2802
+
2803
+	/**
2804
+	 * @var string $event_details_map_align
2805
+	 */
2806
+	public $event_details_map_align;
2807
+
2808
+	/**
2809
+	 * @var int $event_list_map_width
2810
+	 */
2811
+	public $event_list_map_width;
2812
+
2813
+	/**
2814
+	 * @var int $event_list_map_height
2815
+	 */
2816
+	public $event_list_map_height;
2817
+
2818
+	/**
2819
+	 * @var int $event_list_map_zoom
2820
+	 */
2821
+	public $event_list_map_zoom;
2822
+
2823
+	/**
2824
+	 * @var boolean $event_list_display_nav
2825
+	 */
2826
+	public $event_list_display_nav;
2827
+
2828
+	/**
2829
+	 * @var boolean $event_list_nav_size
2830
+	 */
2831
+	public $event_list_nav_size;
2832
+
2833
+	/**
2834
+	 * @var string $event_list_control_type
2835
+	 */
2836
+	public $event_list_control_type;
2837
+
2838
+	/**
2839
+	 * @var string $event_list_map_align
2840
+	 */
2841
+	public $event_list_map_align;
2842
+
2843
+
2844
+	/**
2845
+	 *    class constructor
2846
+	 *
2847
+	 * @access    public
2848
+	 */
2849
+	public function __construct()
2850
+	{
2851
+		// set default map settings
2852
+		$this->use_google_maps = true;
2853
+		$this->google_map_api_key = '';
2854
+		// for event details pages (reg page)
2855
+		$this->event_details_map_width = 585;            // ee_map_width_single
2856
+		$this->event_details_map_height = 362;            // ee_map_height_single
2857
+		$this->event_details_map_zoom = 14;            // ee_map_zoom_single
2858
+		$this->event_details_display_nav = true;            // ee_map_nav_display_single
2859
+		$this->event_details_nav_size = false;            // ee_map_nav_size_single
2860
+		$this->event_details_control_type = 'default';        // ee_map_type_control_single
2861
+		$this->event_details_map_align = 'center';            // ee_map_align_single
2862
+		// for event list pages
2863
+		$this->event_list_map_width = 300;            // ee_map_width
2864
+		$this->event_list_map_height = 185;        // ee_map_height
2865
+		$this->event_list_map_zoom = 12;            // ee_map_zoom
2866
+		$this->event_list_display_nav = false;        // ee_map_nav_display
2867
+		$this->event_list_nav_size = true;            // ee_map_nav_size
2868
+		$this->event_list_control_type = 'dropdown';        // ee_map_type_control
2869
+		$this->event_list_map_align = 'center';            // ee_map_align
2870
+	}
2871 2871
 }
2872 2872
 
2873 2873
 /**
@@ -2876,46 +2876,46 @@  discard block
 block discarded – undo
2876 2876
 class EE_Events_Archive_Config extends EE_Config_Base
2877 2877
 {
2878 2878
 
2879
-    public $display_status_banner;
2879
+	public $display_status_banner;
2880 2880
 
2881
-    public $display_description;
2881
+	public $display_description;
2882 2882
 
2883
-    public $display_ticket_selector;
2883
+	public $display_ticket_selector;
2884 2884
 
2885
-    public $display_datetimes;
2885
+	public $display_datetimes;
2886 2886
 
2887
-    public $display_venue;
2887
+	public $display_venue;
2888 2888
 
2889
-    public $display_expired_events;
2889
+	public $display_expired_events;
2890 2890
 
2891
-    public $use_sortable_display_order;
2891
+	public $use_sortable_display_order;
2892 2892
 
2893
-    public $display_order_tickets;
2893
+	public $display_order_tickets;
2894 2894
 
2895
-    public $display_order_datetimes;
2895
+	public $display_order_datetimes;
2896 2896
 
2897
-    public $display_order_event;
2897
+	public $display_order_event;
2898 2898
 
2899
-    public $display_order_venue;
2899
+	public $display_order_venue;
2900 2900
 
2901 2901
 
2902
-    /**
2903
-     *    class constructor
2904
-     */
2905
-    public function __construct()
2906
-    {
2907
-        $this->display_status_banner = 0;
2908
-        $this->display_description = 1;
2909
-        $this->display_ticket_selector = 0;
2910
-        $this->display_datetimes = 1;
2911
-        $this->display_venue = 0;
2912
-        $this->display_expired_events = 0;
2913
-        $this->use_sortable_display_order = false;
2914
-        $this->display_order_tickets = 100;
2915
-        $this->display_order_datetimes = 110;
2916
-        $this->display_order_event = 120;
2917
-        $this->display_order_venue = 130;
2918
-    }
2902
+	/**
2903
+	 *    class constructor
2904
+	 */
2905
+	public function __construct()
2906
+	{
2907
+		$this->display_status_banner = 0;
2908
+		$this->display_description = 1;
2909
+		$this->display_ticket_selector = 0;
2910
+		$this->display_datetimes = 1;
2911
+		$this->display_venue = 0;
2912
+		$this->display_expired_events = 0;
2913
+		$this->use_sortable_display_order = false;
2914
+		$this->display_order_tickets = 100;
2915
+		$this->display_order_datetimes = 110;
2916
+		$this->display_order_event = 120;
2917
+		$this->display_order_venue = 130;
2918
+	}
2919 2919
 }
2920 2920
 
2921 2921
 /**
@@ -2924,34 +2924,34 @@  discard block
 block discarded – undo
2924 2924
 class EE_Event_Single_Config extends EE_Config_Base
2925 2925
 {
2926 2926
 
2927
-    public $display_status_banner_single;
2927
+	public $display_status_banner_single;
2928 2928
 
2929
-    public $display_venue;
2929
+	public $display_venue;
2930 2930
 
2931
-    public $use_sortable_display_order;
2931
+	public $use_sortable_display_order;
2932 2932
 
2933
-    public $display_order_tickets;
2933
+	public $display_order_tickets;
2934 2934
 
2935
-    public $display_order_datetimes;
2935
+	public $display_order_datetimes;
2936 2936
 
2937
-    public $display_order_event;
2937
+	public $display_order_event;
2938 2938
 
2939
-    public $display_order_venue;
2939
+	public $display_order_venue;
2940 2940
 
2941 2941
 
2942
-    /**
2943
-     *    class constructor
2944
-     */
2945
-    public function __construct()
2946
-    {
2947
-        $this->display_status_banner_single = 0;
2948
-        $this->display_venue = 1;
2949
-        $this->use_sortable_display_order = false;
2950
-        $this->display_order_tickets = 100;
2951
-        $this->display_order_datetimes = 110;
2952
-        $this->display_order_event = 120;
2953
-        $this->display_order_venue = 130;
2954
-    }
2942
+	/**
2943
+	 *    class constructor
2944
+	 */
2945
+	public function __construct()
2946
+	{
2947
+		$this->display_status_banner_single = 0;
2948
+		$this->display_venue = 1;
2949
+		$this->use_sortable_display_order = false;
2950
+		$this->display_order_tickets = 100;
2951
+		$this->display_order_datetimes = 110;
2952
+		$this->display_order_event = 120;
2953
+		$this->display_order_venue = 130;
2954
+	}
2955 2955
 }
2956 2956
 
2957 2957
 /**
@@ -2960,172 +2960,172 @@  discard block
 block discarded – undo
2960 2960
 class EE_Ticket_Selector_Config extends EE_Config_Base
2961 2961
 {
2962 2962
 
2963
-    /**
2964
-     * constant to indicate that a datetime selector should NEVER be shown for ticket selectors
2965
-     */
2966
-    const DO_NOT_SHOW_DATETIME_SELECTOR = 'no_datetime_selector';
2967
-
2968
-    /**
2969
-     * constant to indicate that a datetime selector should only be shown for ticket selectors
2970
-     * when the number of datetimes for the event matches the value set for $datetime_selector_threshold
2971
-     */
2972
-    const MAYBE_SHOW_DATETIME_SELECTOR = 'maybe_datetime_selector';
2973
-
2974
-    /**
2975
-     * @var boolean $show_ticket_sale_columns
2976
-     */
2977
-    public $show_ticket_sale_columns;
2978
-
2979
-    /**
2980
-     * @var boolean $show_ticket_details
2981
-     */
2982
-    public $show_ticket_details;
2983
-
2984
-    /**
2985
-     * @var boolean $show_expired_tickets
2986
-     */
2987
-    public $show_expired_tickets;
2988
-
2989
-    /**
2990
-     * whether or not to display a dropdown box populated with event datetimes
2991
-     * that toggles which tickets are displayed for a ticket selector.
2992
-     * uses one of the *_DATETIME_SELECTOR constants defined above
2993
-     *
2994
-     * @var string $show_datetime_selector
2995
-     */
2996
-    private $show_datetime_selector = 'no_datetime_selector';
2997
-
2998
-    /**
2999
-     * the number of datetimes an event has to have before conditionally displaying a datetime selector
3000
-     *
3001
-     * @var int $datetime_selector_threshold
3002
-     */
3003
-    private $datetime_selector_threshold = 3;
3004
-
3005
-    /**
3006
-     * determines the maximum number of "checked" dates in the date and time filter
3007
-     *
3008
-     * @var int $datetime_selector_checked
3009
-     */
3010
-    private $datetime_selector_max_checked = 10;
3011
-
3012
-
3013
-    /**
3014
-     *    class constructor
3015
-     */
3016
-    public function __construct()
3017
-    {
3018
-        $this->show_ticket_sale_columns = true;
3019
-        $this->show_ticket_details = true;
3020
-        $this->show_expired_tickets = true;
3021
-        $this->show_datetime_selector = \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR;
3022
-        $this->datetime_selector_threshold = 3;
3023
-        $this->datetime_selector_max_checked = 10;
3024
-    }
3025
-
3026
-
3027
-    /**
3028
-     * returns true if a datetime selector should be displayed
3029
-     *
3030
-     * @param array $datetimes
3031
-     * @return bool
3032
-     */
3033
-    public function showDatetimeSelector(array $datetimes)
3034
-    {
3035
-        // if the settings are NOT: don't show OR below threshold, THEN active = true
3036
-        return ! (
3037
-            $this->getShowDatetimeSelector() === \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR
3038
-            || (
3039
-                $this->getShowDatetimeSelector() === \EE_Ticket_Selector_Config::MAYBE_SHOW_DATETIME_SELECTOR
3040
-                && count($datetimes) < $this->getDatetimeSelectorThreshold()
3041
-            )
3042
-        );
3043
-    }
3044
-
3045
-
3046
-    /**
3047
-     * @return string
3048
-     */
3049
-    public function getShowDatetimeSelector()
3050
-    {
3051
-        return $this->show_datetime_selector;
3052
-    }
3053
-
3054
-
3055
-    /**
3056
-     * @param bool $keys_only
3057
-     * @return array
3058
-     */
3059
-    public function getShowDatetimeSelectorOptions($keys_only = true)
3060
-    {
3061
-        return $keys_only
3062
-            ? array(
3063
-                \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR,
3064
-                \EE_Ticket_Selector_Config::MAYBE_SHOW_DATETIME_SELECTOR,
3065
-            )
3066
-            : array(
3067
-                \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR => esc_html__(
3068
-                    'Do not show date & time filter',
3069
-                    'event_espresso'
3070
-                ),
3071
-                \EE_Ticket_Selector_Config::MAYBE_SHOW_DATETIME_SELECTOR  => esc_html__(
3072
-                    'Maybe show date & time filter',
3073
-                    'event_espresso'
3074
-                ),
3075
-            );
3076
-    }
3077
-
3078
-
3079
-    /**
3080
-     * @param string $show_datetime_selector
3081
-     */
3082
-    public function setShowDatetimeSelector($show_datetime_selector)
3083
-    {
3084
-        $this->show_datetime_selector = in_array(
3085
-            $show_datetime_selector,
3086
-            $this->getShowDatetimeSelectorOptions(),
3087
-            true
3088
-        )
3089
-            ? $show_datetime_selector
3090
-            : \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR;
3091
-    }
3092
-
3093
-
3094
-    /**
3095
-     * @return int
3096
-     */
3097
-    public function getDatetimeSelectorThreshold()
3098
-    {
3099
-        return $this->datetime_selector_threshold;
3100
-    }
3101
-
3102
-
3103
-    /**
3104
-     * @param int $datetime_selector_threshold
3105
-     */
3106
-    public function setDatetimeSelectorThreshold($datetime_selector_threshold)
3107
-    {
3108
-        $datetime_selector_threshold = absint($datetime_selector_threshold);
3109
-        $this->datetime_selector_threshold = $datetime_selector_threshold ? $datetime_selector_threshold : 3;
3110
-    }
3111
-
3112
-
3113
-    /**
3114
-     * @return int
3115
-     */
3116
-    public function getDatetimeSelectorMaxChecked()
3117
-    {
3118
-        return $this->datetime_selector_max_checked;
3119
-    }
3120
-
3121
-
3122
-    /**
3123
-     * @param int $datetime_selector_max_checked
3124
-     */
3125
-    public function setDatetimeSelectorMaxChecked($datetime_selector_max_checked)
3126
-    {
3127
-        $this->datetime_selector_max_checked = absint($datetime_selector_max_checked);
3128
-    }
2963
+	/**
2964
+	 * constant to indicate that a datetime selector should NEVER be shown for ticket selectors
2965
+	 */
2966
+	const DO_NOT_SHOW_DATETIME_SELECTOR = 'no_datetime_selector';
2967
+
2968
+	/**
2969
+	 * constant to indicate that a datetime selector should only be shown for ticket selectors
2970
+	 * when the number of datetimes for the event matches the value set for $datetime_selector_threshold
2971
+	 */
2972
+	const MAYBE_SHOW_DATETIME_SELECTOR = 'maybe_datetime_selector';
2973
+
2974
+	/**
2975
+	 * @var boolean $show_ticket_sale_columns
2976
+	 */
2977
+	public $show_ticket_sale_columns;
2978
+
2979
+	/**
2980
+	 * @var boolean $show_ticket_details
2981
+	 */
2982
+	public $show_ticket_details;
2983
+
2984
+	/**
2985
+	 * @var boolean $show_expired_tickets
2986
+	 */
2987
+	public $show_expired_tickets;
2988
+
2989
+	/**
2990
+	 * whether or not to display a dropdown box populated with event datetimes
2991
+	 * that toggles which tickets are displayed for a ticket selector.
2992
+	 * uses one of the *_DATETIME_SELECTOR constants defined above
2993
+	 *
2994
+	 * @var string $show_datetime_selector
2995
+	 */
2996
+	private $show_datetime_selector = 'no_datetime_selector';
2997
+
2998
+	/**
2999
+	 * the number of datetimes an event has to have before conditionally displaying a datetime selector
3000
+	 *
3001
+	 * @var int $datetime_selector_threshold
3002
+	 */
3003
+	private $datetime_selector_threshold = 3;
3004
+
3005
+	/**
3006
+	 * determines the maximum number of "checked" dates in the date and time filter
3007
+	 *
3008
+	 * @var int $datetime_selector_checked
3009
+	 */
3010
+	private $datetime_selector_max_checked = 10;
3011
+
3012
+
3013
+	/**
3014
+	 *    class constructor
3015
+	 */
3016
+	public function __construct()
3017
+	{
3018
+		$this->show_ticket_sale_columns = true;
3019
+		$this->show_ticket_details = true;
3020
+		$this->show_expired_tickets = true;
3021
+		$this->show_datetime_selector = \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR;
3022
+		$this->datetime_selector_threshold = 3;
3023
+		$this->datetime_selector_max_checked = 10;
3024
+	}
3025
+
3026
+
3027
+	/**
3028
+	 * returns true if a datetime selector should be displayed
3029
+	 *
3030
+	 * @param array $datetimes
3031
+	 * @return bool
3032
+	 */
3033
+	public function showDatetimeSelector(array $datetimes)
3034
+	{
3035
+		// if the settings are NOT: don't show OR below threshold, THEN active = true
3036
+		return ! (
3037
+			$this->getShowDatetimeSelector() === \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR
3038
+			|| (
3039
+				$this->getShowDatetimeSelector() === \EE_Ticket_Selector_Config::MAYBE_SHOW_DATETIME_SELECTOR
3040
+				&& count($datetimes) < $this->getDatetimeSelectorThreshold()
3041
+			)
3042
+		);
3043
+	}
3044
+
3045
+
3046
+	/**
3047
+	 * @return string
3048
+	 */
3049
+	public function getShowDatetimeSelector()
3050
+	{
3051
+		return $this->show_datetime_selector;
3052
+	}
3053
+
3054
+
3055
+	/**
3056
+	 * @param bool $keys_only
3057
+	 * @return array
3058
+	 */
3059
+	public function getShowDatetimeSelectorOptions($keys_only = true)
3060
+	{
3061
+		return $keys_only
3062
+			? array(
3063
+				\EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR,
3064
+				\EE_Ticket_Selector_Config::MAYBE_SHOW_DATETIME_SELECTOR,
3065
+			)
3066
+			: array(
3067
+				\EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR => esc_html__(
3068
+					'Do not show date & time filter',
3069
+					'event_espresso'
3070
+				),
3071
+				\EE_Ticket_Selector_Config::MAYBE_SHOW_DATETIME_SELECTOR  => esc_html__(
3072
+					'Maybe show date & time filter',
3073
+					'event_espresso'
3074
+				),
3075
+			);
3076
+	}
3077
+
3078
+
3079
+	/**
3080
+	 * @param string $show_datetime_selector
3081
+	 */
3082
+	public function setShowDatetimeSelector($show_datetime_selector)
3083
+	{
3084
+		$this->show_datetime_selector = in_array(
3085
+			$show_datetime_selector,
3086
+			$this->getShowDatetimeSelectorOptions(),
3087
+			true
3088
+		)
3089
+			? $show_datetime_selector
3090
+			: \EE_Ticket_Selector_Config::DO_NOT_SHOW_DATETIME_SELECTOR;
3091
+	}
3092
+
3093
+
3094
+	/**
3095
+	 * @return int
3096
+	 */
3097
+	public function getDatetimeSelectorThreshold()
3098
+	{
3099
+		return $this->datetime_selector_threshold;
3100
+	}
3101
+
3102
+
3103
+	/**
3104
+	 * @param int $datetime_selector_threshold
3105
+	 */
3106
+	public function setDatetimeSelectorThreshold($datetime_selector_threshold)
3107
+	{
3108
+		$datetime_selector_threshold = absint($datetime_selector_threshold);
3109
+		$this->datetime_selector_threshold = $datetime_selector_threshold ? $datetime_selector_threshold : 3;
3110
+	}
3111
+
3112
+
3113
+	/**
3114
+	 * @return int
3115
+	 */
3116
+	public function getDatetimeSelectorMaxChecked()
3117
+	{
3118
+		return $this->datetime_selector_max_checked;
3119
+	}
3120
+
3121
+
3122
+	/**
3123
+	 * @param int $datetime_selector_max_checked
3124
+	 */
3125
+	public function setDatetimeSelectorMaxChecked($datetime_selector_max_checked)
3126
+	{
3127
+		$this->datetime_selector_max_checked = absint($datetime_selector_max_checked);
3128
+	}
3129 3129
 }
3130 3130
 
3131 3131
 /**
@@ -3138,86 +3138,86 @@  discard block
 block discarded – undo
3138 3138
 class EE_Environment_Config extends EE_Config_Base
3139 3139
 {
3140 3140
 
3141
-    /**
3142
-     * Hold any php environment variables that we want to track.
3143
-     *
3144
-     * @var stdClass;
3145
-     */
3146
-    public $php;
3147
-
3148
-
3149
-    /**
3150
-     *    constructor
3151
-     */
3152
-    public function __construct()
3153
-    {
3154
-        $this->php = new stdClass();
3155
-        $this->_set_php_values();
3156
-    }
3157
-
3158
-
3159
-    /**
3160
-     * This sets the php environment variables.
3161
-     *
3162
-     * @since 4.4.0
3163
-     * @return void
3164
-     */
3165
-    protected function _set_php_values()
3166
-    {
3167
-        $this->php->max_input_vars = ini_get('max_input_vars');
3168
-        $this->php->version = phpversion();
3169
-    }
3170
-
3171
-
3172
-    /**
3173
-     * helper method for determining whether input_count is
3174
-     * reaching the potential maximum the server can handle
3175
-     * according to max_input_vars
3176
-     *
3177
-     * @param int   $input_count the count of input vars.
3178
-     * @return array {
3179
-     *                           An array that represents whether available space and if no available space the error
3180
-     *                           message.
3181
-     * @type bool   $has_space   whether more inputs can be added.
3182
-     * @type string $msg         Any message to be displayed.
3183
-     *                           }
3184
-     */
3185
-    public function max_input_vars_limit_check($input_count = 0)
3186
-    {
3187
-        if (! empty($this->php->max_input_vars)
3188
-            && ($input_count >= $this->php->max_input_vars)
3189
-        ) {
3190
-            // check the server setting because the config value could be stale
3191
-            $max_input_vars = ini_get('max_input_vars');
3192
-            if ($input_count >= $max_input_vars) {
3193
-                return sprintf(
3194
-                    esc_html__(
3195
-                        'The maximum number of inputs on this page has been exceeded. You cannot make edits to this page because of your server\'s PHP "max_input_vars" setting.%1$sThere are %2$d inputs and the maximum amount currently allowed by your server is %3$d.%1$sPlease contact your web host and ask them to raise the "max_input_vars" limit.',
3196
-                        'event_espresso'
3197
-                    ),
3198
-                    '<br>',
3199
-                    $input_count,
3200
-                    $max_input_vars
3201
-                );
3202
-            } else {
3203
-                return '';
3204
-            }
3205
-        } else {
3206
-            return '';
3207
-        }
3208
-    }
3209
-
3210
-
3211
-    /**
3212
-     * The purpose of this method is just to force rechecking php values so if they've changed, they get updated.
3213
-     *
3214
-     * @since 4.4.1
3215
-     * @return void
3216
-     */
3217
-    public function recheck_values()
3218
-    {
3219
-        $this->_set_php_values();
3220
-    }
3141
+	/**
3142
+	 * Hold any php environment variables that we want to track.
3143
+	 *
3144
+	 * @var stdClass;
3145
+	 */
3146
+	public $php;
3147
+
3148
+
3149
+	/**
3150
+	 *    constructor
3151
+	 */
3152
+	public function __construct()
3153
+	{
3154
+		$this->php = new stdClass();
3155
+		$this->_set_php_values();
3156
+	}
3157
+
3158
+
3159
+	/**
3160
+	 * This sets the php environment variables.
3161
+	 *
3162
+	 * @since 4.4.0
3163
+	 * @return void
3164
+	 */
3165
+	protected function _set_php_values()
3166
+	{
3167
+		$this->php->max_input_vars = ini_get('max_input_vars');
3168
+		$this->php->version = phpversion();
3169
+	}
3170
+
3171
+
3172
+	/**
3173
+	 * helper method for determining whether input_count is
3174
+	 * reaching the potential maximum the server can handle
3175
+	 * according to max_input_vars
3176
+	 *
3177
+	 * @param int   $input_count the count of input vars.
3178
+	 * @return array {
3179
+	 *                           An array that represents whether available space and if no available space the error
3180
+	 *                           message.
3181
+	 * @type bool   $has_space   whether more inputs can be added.
3182
+	 * @type string $msg         Any message to be displayed.
3183
+	 *                           }
3184
+	 */
3185
+	public function max_input_vars_limit_check($input_count = 0)
3186
+	{
3187
+		if (! empty($this->php->max_input_vars)
3188
+			&& ($input_count >= $this->php->max_input_vars)
3189
+		) {
3190
+			// check the server setting because the config value could be stale
3191
+			$max_input_vars = ini_get('max_input_vars');
3192
+			if ($input_count >= $max_input_vars) {
3193
+				return sprintf(
3194
+					esc_html__(
3195
+						'The maximum number of inputs on this page has been exceeded. You cannot make edits to this page because of your server\'s PHP "max_input_vars" setting.%1$sThere are %2$d inputs and the maximum amount currently allowed by your server is %3$d.%1$sPlease contact your web host and ask them to raise the "max_input_vars" limit.',
3196
+						'event_espresso'
3197
+					),
3198
+					'<br>',
3199
+					$input_count,
3200
+					$max_input_vars
3201
+				);
3202
+			} else {
3203
+				return '';
3204
+			}
3205
+		} else {
3206
+			return '';
3207
+		}
3208
+	}
3209
+
3210
+
3211
+	/**
3212
+	 * The purpose of this method is just to force rechecking php values so if they've changed, they get updated.
3213
+	 *
3214
+	 * @since 4.4.1
3215
+	 * @return void
3216
+	 */
3217
+	public function recheck_values()
3218
+	{
3219
+		$this->_set_php_values();
3220
+	}
3221 3221
 }
3222 3222
 
3223 3223
 /**
@@ -3230,21 +3230,21 @@  discard block
 block discarded – undo
3230 3230
 class EE_Tax_Config extends EE_Config_Base
3231 3231
 {
3232 3232
 
3233
-    /*
3233
+	/*
3234 3234
      * flag to indicate whether or not to display ticket prices with the taxes included
3235 3235
      *
3236 3236
      * @var boolean $prices_displayed_including_taxes
3237 3237
      */
3238
-    public $prices_displayed_including_taxes;
3238
+	public $prices_displayed_including_taxes;
3239 3239
 
3240 3240
 
3241
-    /**
3242
-     *    class constructor
3243
-     */
3244
-    public function __construct()
3245
-    {
3246
-        $this->prices_displayed_including_taxes = true;
3247
-    }
3241
+	/**
3242
+	 *    class constructor
3243
+	 */
3244
+	public function __construct()
3245
+	{
3246
+		$this->prices_displayed_including_taxes = true;
3247
+	}
3248 3248
 }
3249 3249
 
3250 3250
 /**
@@ -3258,19 +3258,19 @@  discard block
 block discarded – undo
3258 3258
 class EE_Messages_Config extends EE_Config_Base
3259 3259
 {
3260 3260
 
3261
-    /**
3262
-     * This is an integer representing the deletion threshold in months for when old messages will get deleted.
3263
-     * A value of 0 represents never deleting.  Default is 0.
3264
-     *
3265
-     * @var integer
3266
-     */
3267
-    public $delete_threshold;
3261
+	/**
3262
+	 * This is an integer representing the deletion threshold in months for when old messages will get deleted.
3263
+	 * A value of 0 represents never deleting.  Default is 0.
3264
+	 *
3265
+	 * @var integer
3266
+	 */
3267
+	public $delete_threshold;
3268 3268
 
3269 3269
 
3270
-    public function __construct()
3271
-    {
3272
-        $this->delete_threshold = 0;
3273
-    }
3270
+	public function __construct()
3271
+	{
3272
+		$this->delete_threshold = 0;
3273
+	}
3274 3274
 }
3275 3275
 
3276 3276
 /**
@@ -3281,31 +3281,31 @@  discard block
 block discarded – undo
3281 3281
 class EE_Gateway_Config extends EE_Config_Base
3282 3282
 {
3283 3283
 
3284
-    /**
3285
-     * Array with keys that are payment gateways slugs, and values are arrays
3286
-     * with any config info the gateway wants to store
3287
-     *
3288
-     * @var array
3289
-     */
3290
-    public $payment_settings;
3291
-
3292
-    /**
3293
-     * Where keys are gateway slugs, and values are booleans indicating whether or not
3294
-     * the gateway is stored in the uploads directory
3295
-     *
3296
-     * @var array
3297
-     */
3298
-    public $active_gateways;
3299
-
3300
-
3301
-    /**
3302
-     *    class constructor
3303
-     *
3304
-     * @deprecated
3305
-     */
3306
-    public function __construct()
3307
-    {
3308
-        $this->payment_settings = array();
3309
-        $this->active_gateways = array('Invoice' => false);
3310
-    }
3284
+	/**
3285
+	 * Array with keys that are payment gateways slugs, and values are arrays
3286
+	 * with any config info the gateway wants to store
3287
+	 *
3288
+	 * @var array
3289
+	 */
3290
+	public $payment_settings;
3291
+
3292
+	/**
3293
+	 * Where keys are gateway slugs, and values are booleans indicating whether or not
3294
+	 * the gateway is stored in the uploads directory
3295
+	 *
3296
+	 * @var array
3297
+	 */
3298
+	public $active_gateways;
3299
+
3300
+
3301
+	/**
3302
+	 *    class constructor
3303
+	 *
3304
+	 * @deprecated
3305
+	 */
3306
+	public function __construct()
3307
+	{
3308
+		$this->payment_settings = array();
3309
+		$this->active_gateways = array('Invoice' => false);
3310
+	}
3311 3311
 }
Please login to merge, or discard this patch.