@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | <ul class="wp-people-group" id="ee-people-group-owners"> |
4 | 4 | <li class="wp-person" id="ee-person-sshoultes"> |
5 | 5 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
6 | - <?php echo esp_gravatar_image( '[email protected]', 'Seth Shoultes' ); ?> |
|
6 | + <?php echo esp_gravatar_image('[email protected]', 'Seth Shoultes'); ?> |
|
7 | 7 | </a> |
8 | 8 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
9 | 9 | Seth Shoultes |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | </li> |
13 | 13 | <li class="wp-person" id="ee-person-gkoyle"> |
14 | 14 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
15 | - <?php echo esp_gravatar_image( '[email protected]', 'Garth Koyle' ); ?> |
|
15 | + <?php echo esp_gravatar_image('[email protected]', 'Garth Koyle'); ?> |
|
16 | 16 | </a> |
17 | 17 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
18 | 18 | Garth Koyle |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | <ul class="wp-people-group" id="ee-people-group-core-developers"> |
25 | 25 | <li class="wp-person" id="ee-person-bchristensen"> |
26 | 26 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
27 | - <?php echo esp_gravatar_image( '[email protected]', 'Brent Christensen' ); ?> |
|
27 | + <?php echo esp_gravatar_image('[email protected]', 'Brent Christensen'); ?> |
|
28 | 28 | </a> |
29 | 29 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
30 | 30 | Brent Christensen |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | </li> |
34 | 34 | <li class="wp-person" id="ee-person-dethier"> |
35 | 35 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
36 | - <?php echo esp_gravatar_image( '[email protected]', 'Darren Ethier' ); ?> |
|
36 | + <?php echo esp_gravatar_image('[email protected]', 'Darren Ethier'); ?> |
|
37 | 37 | </a> |
38 | 38 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
39 | 39 | Darren Ethier |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | </li> |
43 | 43 | <li class="wp-person" id="ee-person-mnelson"> |
44 | 44 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
45 | - <?php echo esp_gravatar_image( '[email protected]', 'Michael Nelson' ); ?> |
|
45 | + <?php echo esp_gravatar_image('[email protected]', 'Michael Nelson'); ?> |
|
46 | 46 | </a> |
47 | 47 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
48 | 48 | Michael Nelson |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | </li> |
52 | 52 | <li class="wp-person" id="ee-person-nkolivoshka"> |
53 | 53 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
54 | - <?php echo esp_gravatar_image( '[email protected]', 'Nazar Kolivoshka' ); ?> |
|
54 | + <?php echo esp_gravatar_image('[email protected]', 'Nazar Kolivoshka'); ?> |
|
55 | 55 | </a> |
56 | 56 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
57 | 57 | Nazar Kolivoshka |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | <ul class="wp-people-group" id="ee-people-group-support-staff"> |
64 | 64 | <li class="wp-person" id="ee-person-jfeck"> |
65 | 65 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
66 | - <?php echo esp_gravatar_image( '[email protected]', 'Josh Feck' ); ?> |
|
66 | + <?php echo esp_gravatar_image('[email protected]', 'Josh Feck'); ?> |
|
67 | 67 | </a> |
68 | 68 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
69 | 69 | Josh Feck |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | </li> |
72 | 72 | <li class="wp-person" id="ee-person-twarwick"> |
73 | 73 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
74 | - <?php echo esp_gravatar_image( '[email protected]', 'Tony Warwick' ); ?> |
|
74 | + <?php echo esp_gravatar_image('[email protected]', 'Tony Warwick'); ?> |
|
75 | 75 | </a> |
76 | 76 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
77 | 77 | Tony Warwick |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | </li> |
80 | 80 | <li class="wp-person" id="ee-person-lcaum"> |
81 | 81 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
82 | - <?php echo esp_gravatar_image( '[email protected]', 'Lorenzo Caum' ); ?> |
|
82 | + <?php echo esp_gravatar_image('[email protected]', 'Lorenzo Caum'); ?> |
|
83 | 83 | </a> |
84 | 84 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
85 | 85 | Lorenzo Caum |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | </li> |
88 | 88 | <li class="wp-person" id="ee-logan-lenz"> |
89 | 89 | <a href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
90 | - <?php echo esp_gravatar_image( '[email protected]', 'Logan Lenz' ); ?> |
|
90 | + <?php echo esp_gravatar_image('[email protected]', 'Logan Lenz'); ?> |
|
91 | 91 | </a> |
92 | 92 | <a class="web" href="<?php esp_gravatar_profile('[email protected]'); ?>"> |
93 | 93 | Logan Lenz |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | </ul> |
98 | 98 | <h3 class="wp-people-group"><?php _e('Contributor Recognition', 'event_espresso'); ?></h3> |
99 | 99 | <p class="description"> |
100 | - <?php printf( __('For every major release we want to recognize the people who contributed to the release via a GitHub pull request. Want to see your name listed here? %sWhen you submit a pull request that gets included in a major release%s, we\'ll add your name here linked to your GitHub profile.', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core" title="Contribute to Event Espresso by making a pull request via GitHub">', '</a>' ); ?> |
|
100 | + <?php printf(__('For every major release we want to recognize the people who contributed to the release via a GitHub pull request. Want to see your name listed here? %sWhen you submit a pull request that gets included in a major release%s, we\'ll add your name here linked to your GitHub profile.', 'event_espresso'), '<a href="https://github.com/eventespresso/event-espresso-core" title="Contribute to Event Espresso by making a pull request via GitHub">', '</a>'); ?> |
|
101 | 101 | </p> |
102 | 102 | <p class="wp-credits-list"> |
103 | 103 | <ul> |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | </p> |
112 | 112 | <h3 class="wp-people-group"><?php _e('External Libraries', 'event_espresso'); ?></h3> |
113 | 113 | <p class="description"> |
114 | - <?php printf( __('Along with the libraries %sincluded with WordPress%s, Event Espresso utilizes the following third party libraries:', 'event_espresso'), '<a href="credits.php">', '</a>' ); ?> |
|
114 | + <?php printf(__('Along with the libraries %sincluded with WordPress%s, Event Espresso utilizes the following third party libraries:', 'event_espresso'), '<a href="credits.php">', '</a>'); ?> |
|
115 | 115 | </p> |
116 | 116 | <p class="wp-credits-list"> |
117 | 117 | <a href="http://josscrowcroft.github.io/accounting.js/"><?php _e('accounting.js', 'event_espresso'); ?></a>, |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | |
128 | 128 | <?php |
129 | 129 | function esp_gravatar_profile($email) { |
130 | - echo 'http://www.gravatar.com/' . md5($email); |
|
130 | + echo 'http://www.gravatar.com/'.md5($email); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | function esp_gravatar_image($email, $name) { |
134 | - echo '<img src="http://0.gravatar.com/avatar/' . md5($email) . '?s=60" class="gravatar" alt="' . $name . '"/>'; |
|
134 | + echo '<img src="http://0.gravatar.com/avatar/'.md5($email).'?s=60" class="gravatar" alt="'.$name.'"/>'; |
|
135 | 135 | } |
136 | 136 | ?> |
@@ -118,40 +118,40 @@ |
||
118 | 118 | * @return EE_Template_Config |
119 | 119 | */ |
120 | 120 | public static function update_template_settings(EE_Template_Config $CFG, $REQ ) { |
121 | - if(! $CFG->EED_Event_Single instanceof EE_Event_Single_Config){ |
|
122 | - $CFG->EED_Event_Single = new EE_Event_Single_Config(); |
|
123 | - } |
|
124 | - $display_order_event = $CFG->EED_Event_Single->display_order_event !== null |
|
125 | - ? $CFG->EED_Event_Single->display_order_event |
|
126 | - : EED_Event_Single::EVENT_DETAILS_PRIORITY; |
|
121 | + if(! $CFG->EED_Event_Single instanceof EE_Event_Single_Config){ |
|
122 | + $CFG->EED_Event_Single = new EE_Event_Single_Config(); |
|
123 | + } |
|
124 | + $display_order_event = $CFG->EED_Event_Single->display_order_event !== null |
|
125 | + ? $CFG->EED_Event_Single->display_order_event |
|
126 | + : EED_Event_Single::EVENT_DETAILS_PRIORITY; |
|
127 | 127 | $display_order_datetimes = $CFG->EED_Event_Single->display_order_datetimes !== null |
128 | - ? $CFG->EED_Event_Single->display_order_datetimes |
|
129 | - : EED_Event_Single::EVENT_DATETIMES_PRIORITY; |
|
130 | - $display_order_tickets = $CFG->EED_Event_Single->display_order_tickets !== null |
|
131 | - ? $CFG->EED_Event_Single->display_order_tickets |
|
132 | - : EED_Event_Single::EVENT_TICKETS_PRIORITY; |
|
128 | + ? $CFG->EED_Event_Single->display_order_datetimes |
|
129 | + : EED_Event_Single::EVENT_DATETIMES_PRIORITY; |
|
130 | + $display_order_tickets = $CFG->EED_Event_Single->display_order_tickets !== null |
|
131 | + ? $CFG->EED_Event_Single->display_order_tickets |
|
132 | + : EED_Event_Single::EVENT_TICKETS_PRIORITY; |
|
133 | 133 | $display_order_venue = $CFG->EED_Event_Single->display_order_venue !== null |
134 | - ? $CFG->EED_Event_Single->display_order_venue |
|
135 | - : EED_Event_Single::EVENT_VENUES_PRIORITY; |
|
134 | + ? $CFG->EED_Event_Single->display_order_venue |
|
135 | + : EED_Event_Single::EVENT_VENUES_PRIORITY; |
|
136 | 136 | $CFG->EED_Event_Single = new EE_Event_Single_Config(); |
137 | 137 | $CFG->EED_Event_Single->display_status_banner_single = ! empty( $REQ['display_status_banner_single'] ) |
138 | - && $REQ['display_status_banner_single']; |
|
138 | + && $REQ['display_status_banner_single']; |
|
139 | 139 | $CFG->EED_Event_Single->display_venue = ! empty( $REQ['display_venue'] ) && $REQ['display_venue']; |
140 | 140 | $CFG->EED_Event_Single->use_sortable_display_order = ! empty( $REQ[ 'EED_Events_Single_use_sortable_display_order' ] ) |
141 | - ? absint( $REQ[ 'EED_Events_Single_use_sortable_display_order' ] ) |
|
142 | - : 0; |
|
141 | + ? absint( $REQ[ 'EED_Events_Single_use_sortable_display_order' ] ) |
|
142 | + : 0; |
|
143 | 143 | $CFG->EED_Event_Single->display_order_event = $CFG->EED_Event_Single->use_sortable_display_order |
144 | - ? $display_order_event |
|
145 | - : EED_Event_Single::EVENT_DETAILS_PRIORITY; |
|
144 | + ? $display_order_event |
|
145 | + : EED_Event_Single::EVENT_DETAILS_PRIORITY; |
|
146 | 146 | $CFG->EED_Event_Single->display_order_datetimes = $CFG->EED_Event_Single->use_sortable_display_order |
147 | - ? $display_order_datetimes |
|
148 | - : EED_Event_Single::EVENT_DATETIMES_PRIORITY; |
|
147 | + ? $display_order_datetimes |
|
148 | + : EED_Event_Single::EVENT_DATETIMES_PRIORITY; |
|
149 | 149 | $CFG->EED_Event_Single->display_order_tickets = $CFG->EED_Event_Single->use_sortable_display_order |
150 | - ? $display_order_tickets |
|
151 | - : EED_Event_Single::EVENT_TICKETS_PRIORITY; |
|
150 | + ? $display_order_tickets |
|
151 | + : EED_Event_Single::EVENT_TICKETS_PRIORITY; |
|
152 | 152 | $CFG->EED_Event_Single->display_order_venue = $CFG->EED_Event_Single->use_sortable_display_order |
153 | - ? $display_order_venue |
|
154 | - : EED_Event_Single::EVENT_VENUES_PRIORITY; |
|
153 | + ? $display_order_venue |
|
154 | + : EED_Event_Single::EVENT_VENUES_PRIORITY; |
|
155 | 155 | do_action( 'AHEE__EED_Event_Single__update_template_settings__after_update', $CFG, $REQ ); |
156 | 156 | return $CFG; |
157 | 157 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @return EED_Event_Single_Caff |
30 | 30 | */ |
31 | 31 | public static function instance() { |
32 | - return parent::get_instance( __CLASS__ ); |
|
32 | + return parent::get_instance(__CLASS__); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -50,34 +50,34 @@ discard block |
||
50 | 50 | * @return void |
51 | 51 | */ |
52 | 52 | public static function set_hooks_admin() { |
53 | - define( 'EVENT_SINGLE_CAFF_TEMPLATES_PATH', plugin_dir_path( __FILE__ ) . 'templates' . DS ); |
|
54 | - define( 'EVENT_SINGLE_CAFF_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
53 | + define('EVENT_SINGLE_CAFF_TEMPLATES_PATH', plugin_dir_path(__FILE__).'templates'.DS); |
|
54 | + define('EVENT_SINGLE_CAFF_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
55 | 55 | add_action( |
56 | 56 | 'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__template_settings', |
57 | - array( 'EED_Event_Single_Caff', 'load_scripts_styles' ), |
|
57 | + array('EED_Event_Single_Caff', 'load_scripts_styles'), |
|
58 | 58 | 10 |
59 | 59 | ); |
60 | - add_action( 'AHEE__template_settings__template__before_settings_form', array( 'EED_Event_Single_Caff', 'template_settings_form' ), 10 ); |
|
61 | - add_filter( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', array( 'EED_Event_Single_Caff', 'update_template_settings' ), 10, 2 ); |
|
60 | + add_action('AHEE__template_settings__template__before_settings_form', array('EED_Event_Single_Caff', 'template_settings_form'), 10); |
|
61 | + add_filter('FHEE__General_Settings_Admin_Page__update_template_settings__data', array('EED_Event_Single_Caff', 'update_template_settings'), 10, 2); |
|
62 | 62 | // AJAX |
63 | - add_action( 'wp_ajax_espresso_update_event_single_order', array( 'EED_Event_Single_Caff', 'update_event_single_order' ) ); |
|
64 | - add_action( 'wp_ajax_nopriv_espresso_update_event_single_order', array( 'EED_Event_Single_Caff', 'update_event_single_order' ) ); |
|
63 | + add_action('wp_ajax_espresso_update_event_single_order', array('EED_Event_Single_Caff', 'update_event_single_order')); |
|
64 | + add_action('wp_ajax_nopriv_espresso_update_event_single_order', array('EED_Event_Single_Caff', 'update_event_single_order')); |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | |
68 | 68 | |
69 | 69 | |
70 | 70 | public static function load_scripts_styles() { |
71 | - add_action( 'admin_enqueue_scripts', array( 'EED_Event_Single_Caff', 'enqueue_scripts_styles' ), 10 ); |
|
71 | + add_action('admin_enqueue_scripts', array('EED_Event_Single_Caff', 'enqueue_scripts_styles'), 10); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
75 | 75 | |
76 | 76 | public static function enqueue_scripts_styles() { |
77 | - wp_register_style( 'eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL . 'eed_event_single_sortable.css', array(), EVENT_ESPRESSO_VERSION ); |
|
78 | - wp_enqueue_style( 'eed-event-single-sortable' ); |
|
79 | - wp_register_script( 'eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL . 'eed_event_single_sortable.js', array( 'jquery-ui-sortable' ), EVENT_ESPRESSO_VERSION, true ); |
|
80 | - wp_enqueue_script( 'eed-event-single-sortable' ); |
|
77 | + wp_register_style('eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL.'eed_event_single_sortable.css', array(), EVENT_ESPRESSO_VERSION); |
|
78 | + wp_enqueue_style('eed-event-single-sortable'); |
|
79 | + wp_register_script('eed-event-single-sortable', EVENT_SINGLE_CAFF_ASSETS_URL.'eed_event_single_sortable.js', array('jquery-ui-sortable'), EVENT_ESPRESSO_VERSION, true); |
|
80 | + wp_enqueue_script('eed-event-single-sortable'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -91,21 +91,21 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public static function template_settings_form() { |
93 | 93 | $config = EE_Registry::instance()->CFG->template_settings; |
94 | - $config = isset( $config->EED_Event_Single ) && $config->EED_Event_Single instanceof EE_Event_Single_Config ? $config->EED_Event_Single : new EE_Event_Single_Config(); |
|
95 | - $config->use_sortable_display_order = isset( $config->use_sortable_display_order ) ? $config->use_sortable_display_order : false; |
|
96 | - $config = apply_filters( 'FHEE__EED_Event_Single__template_settings_form__event_list_config', $config ); |
|
94 | + $config = isset($config->EED_Event_Single) && $config->EED_Event_Single instanceof EE_Event_Single_Config ? $config->EED_Event_Single : new EE_Event_Single_Config(); |
|
95 | + $config->use_sortable_display_order = isset($config->use_sortable_display_order) ? $config->use_sortable_display_order : false; |
|
96 | + $config = apply_filters('FHEE__EED_Event_Single__template_settings_form__event_list_config', $config); |
|
97 | 97 | |
98 | 98 | $event_single_order_array = array(); |
99 | - $event_single_order_array[ $config->display_order_tickets ] = 'tickets'; |
|
100 | - $event_single_order_array[ $config->display_order_datetimes ] = 'datetimes'; |
|
101 | - $event_single_order_array[ $config->display_order_event ] = 'event'; |
|
102 | - $event_single_order_array[ $config->display_order_venue ] = 'venue'; |
|
99 | + $event_single_order_array[$config->display_order_tickets] = 'tickets'; |
|
100 | + $event_single_order_array[$config->display_order_datetimes] = 'datetimes'; |
|
101 | + $event_single_order_array[$config->display_order_event] = 'event'; |
|
102 | + $event_single_order_array[$config->display_order_venue] = 'venue'; |
|
103 | 103 | // get template parts |
104 | - $template_parts = EED_Event_Single::instance()->initialize_template_parts( $config ); |
|
104 | + $template_parts = EED_Event_Single::instance()->initialize_template_parts($config); |
|
105 | 105 | // convert to array so that we can add more properties |
106 | - $config = get_object_vars( $config ); |
|
107 | - $config[ 'event_single_display_order' ] = $template_parts->generate_sortable_list_of_template_parts( 'event-single-sortable-js', '', 'single-sortable-li single-sortable-js' ); |
|
108 | - EEH_Template::display_template( EVENT_SINGLE_CAFF_TEMPLATES_PATH . 'admin-event-single-settings.template.php', $config ); |
|
106 | + $config = get_object_vars($config); |
|
107 | + $config['event_single_display_order'] = $template_parts->generate_sortable_list_of_template_parts('event-single-sortable-js', '', 'single-sortable-li single-sortable-js'); |
|
108 | + EEH_Template::display_template(EVENT_SINGLE_CAFF_TEMPLATES_PATH.'admin-event-single-settings.template.php', $config); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | * @param array $REQ |
118 | 118 | * @return EE_Template_Config |
119 | 119 | */ |
120 | - public static function update_template_settings(EE_Template_Config $CFG, $REQ ) { |
|
121 | - if(! $CFG->EED_Event_Single instanceof EE_Event_Single_Config){ |
|
120 | + public static function update_template_settings(EE_Template_Config $CFG, $REQ) { |
|
121 | + if ( ! $CFG->EED_Event_Single instanceof EE_Event_Single_Config) { |
|
122 | 122 | $CFG->EED_Event_Single = new EE_Event_Single_Config(); |
123 | 123 | } |
124 | 124 | $display_order_event = $CFG->EED_Event_Single->display_order_event !== null |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | ? $CFG->EED_Event_Single->display_order_venue |
135 | 135 | : EED_Event_Single::EVENT_VENUES_PRIORITY; |
136 | 136 | $CFG->EED_Event_Single = new EE_Event_Single_Config(); |
137 | - $CFG->EED_Event_Single->display_status_banner_single = ! empty( $REQ['display_status_banner_single'] ) |
|
137 | + $CFG->EED_Event_Single->display_status_banner_single = ! empty($REQ['display_status_banner_single']) |
|
138 | 138 | && $REQ['display_status_banner_single']; |
139 | - $CFG->EED_Event_Single->display_venue = ! empty( $REQ['display_venue'] ) && $REQ['display_venue']; |
|
140 | - $CFG->EED_Event_Single->use_sortable_display_order = ! empty( $REQ[ 'EED_Events_Single_use_sortable_display_order' ] ) |
|
141 | - ? absint( $REQ[ 'EED_Events_Single_use_sortable_display_order' ] ) |
|
139 | + $CFG->EED_Event_Single->display_venue = ! empty($REQ['display_venue']) && $REQ['display_venue']; |
|
140 | + $CFG->EED_Event_Single->use_sortable_display_order = ! empty($REQ['EED_Events_Single_use_sortable_display_order']) |
|
141 | + ? absint($REQ['EED_Events_Single_use_sortable_display_order']) |
|
142 | 142 | : 0; |
143 | 143 | $CFG->EED_Event_Single->display_order_event = $CFG->EED_Event_Single->use_sortable_display_order |
144 | 144 | ? $display_order_event |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $CFG->EED_Event_Single->display_order_venue = $CFG->EED_Event_Single->use_sortable_display_order |
153 | 153 | ? $display_order_venue |
154 | 154 | : EED_Event_Single::EVENT_VENUES_PRIORITY; |
155 | - do_action( 'AHEE__EED_Event_Single__update_template_settings__after_update', $CFG, $REQ ); |
|
155 | + do_action('AHEE__EED_Event_Single__update_template_settings__after_update', $CFG, $REQ); |
|
156 | 156 | return $CFG; |
157 | 157 | } |
158 | 158 | |
@@ -166,23 +166,23 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public static function update_event_single_order() { |
168 | 168 | $config_saved = false; |
169 | - $template_parts = sanitize_text_field( $_POST[ 'elements' ] ); |
|
170 | - if ( ! empty( $template_parts ) ) { |
|
171 | - $template_parts = explode( ',', trim( $template_parts, ',' ) ); |
|
172 | - foreach ( $template_parts as $key => $template_part ) { |
|
169 | + $template_parts = sanitize_text_field($_POST['elements']); |
|
170 | + if ( ! empty($template_parts)) { |
|
171 | + $template_parts = explode(',', trim($template_parts, ',')); |
|
172 | + foreach ($template_parts as $key => $template_part) { |
|
173 | 173 | $template_part = "display_order_$template_part"; |
174 | - $priority = ( $key * 10 ) + EED_Event_Single::EVENT_DETAILS_PRIORITY; |
|
174 | + $priority = ($key * 10) + EED_Event_Single::EVENT_DETAILS_PRIORITY; |
|
175 | 175 | EE_Registry::instance()->CFG->template_settings->EED_Event_Single->{$template_part} = $priority; |
176 | - do_action( "AHEE__EED_Event_Single__update_event_single_order__$template_part", $priority ); |
|
176 | + do_action("AHEE__EED_Event_Single__update_event_single_order__$template_part", $priority); |
|
177 | 177 | } |
178 | - $config_saved = EE_Registry::instance()->CFG->update_espresso_config( false, false ); |
|
178 | + $config_saved = EE_Registry::instance()->CFG->update_espresso_config(false, false); |
|
179 | 179 | } |
180 | - if ( $config_saved ) { |
|
181 | - EE_Error::add_success( __( 'Display Order has been successfully updated.', 'event_espresso' ) ); |
|
180 | + if ($config_saved) { |
|
181 | + EE_Error::add_success(__('Display Order has been successfully updated.', 'event_espresso')); |
|
182 | 182 | } else { |
183 | - EE_Error::add_error( __( 'Display Order was not updated.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
183 | + EE_Error::add_error(__('Display Order was not updated.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
184 | 184 | } |
185 | - echo wp_json_encode( EE_Error::get_notices( false )); |
|
185 | + echo wp_json_encode(EE_Error::get_notices(false)); |
|
186 | 186 | exit(); |
187 | 187 | } |
188 | 188 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param WP $WP |
196 | 196 | * @return void |
197 | 197 | */ |
198 | - public function run( $WP ) { |
|
198 | + public function run($WP) { |
|
199 | 199 | } |
200 | 200 | |
201 | 201 |
@@ -16,669 +16,669 @@ |
||
16 | 16 | class EE_Encryption |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * key used for saving the encryption key to the wp_options table |
|
21 | - */ |
|
22 | - const ENCRYPTION_OPTION_KEY = 'ee_encryption_key'; |
|
23 | - |
|
24 | - /** |
|
25 | - * the OPENSSL cipher method used |
|
26 | - */ |
|
27 | - const OPENSSL_CIPHER_METHOD = 'AES-128-CBC'; |
|
28 | - |
|
29 | - /** |
|
30 | - * WP "options_name" used to store a verified available cipher method |
|
31 | - */ |
|
32 | - const OPENSSL_CIPHER_METHOD_OPTION_NAME = 'ee_openssl_cipher_method'; |
|
33 | - |
|
34 | - /** |
|
35 | - * the OPENSSL digest method used |
|
36 | - */ |
|
37 | - const OPENSSL_DIGEST_METHOD = 'sha512'; |
|
38 | - |
|
39 | - /** |
|
40 | - * separates the encrypted text from the initialization vector |
|
41 | - */ |
|
42 | - const OPENSSL_IV_DELIMITER = ':iv:'; |
|
43 | - |
|
44 | - /** |
|
45 | - * appended to text encrypted using the acme encryption |
|
46 | - */ |
|
47 | - const ACME_ENCRYPTION_FLAG = '::ae'; |
|
48 | - |
|
49 | - |
|
50 | - |
|
51 | - /** |
|
52 | - * instance of the EE_Encryption object |
|
53 | - */ |
|
54 | - protected static $_instance; |
|
55 | - |
|
56 | - /** |
|
57 | - * @var string $_encryption_key |
|
58 | - */ |
|
59 | - protected $_encryption_key; |
|
60 | - |
|
61 | - /** |
|
62 | - * @var string $cipher_method |
|
63 | - */ |
|
64 | - private $cipher_method = ''; |
|
65 | - |
|
66 | - /** |
|
67 | - * @var array $cipher_methods |
|
68 | - */ |
|
69 | - private $cipher_methods = array(); |
|
70 | - |
|
71 | - /** |
|
72 | - * @var array $digest_methods |
|
73 | - */ |
|
74 | - private $digest_methods = array(); |
|
75 | - |
|
76 | - /** |
|
77 | - * @var boolean $_use_openssl_encrypt |
|
78 | - */ |
|
79 | - protected $_use_openssl_encrypt = false; |
|
80 | - |
|
81 | - /** |
|
82 | - * @var boolean $_use_mcrypt |
|
83 | - */ |
|
84 | - protected $_use_mcrypt = false; |
|
85 | - |
|
86 | - /** |
|
87 | - * @var boolean $_use_base64_encode |
|
88 | - */ |
|
89 | - protected $_use_base64_encode = false; |
|
90 | - |
|
91 | - |
|
92 | - |
|
93 | - /** |
|
94 | - * protected constructor to prevent direct creation |
|
95 | - */ |
|
96 | - protected function __construct() |
|
97 | - { |
|
98 | - if (! defined('ESPRESSO_ENCRYPT')) { |
|
99 | - define('ESPRESSO_ENCRYPT', true); |
|
100 | - } |
|
101 | - if (extension_loaded('openssl')) { |
|
102 | - $this->_use_openssl_encrypt = true; |
|
103 | - } else if (extension_loaded('mcrypt')) { |
|
104 | - $this->_use_mcrypt = true; |
|
105 | - } |
|
106 | - if (function_exists('base64_encode')) { |
|
107 | - $this->_use_base64_encode = true; |
|
108 | - } |
|
109 | - } |
|
110 | - |
|
111 | - |
|
112 | - |
|
113 | - /** |
|
114 | - * singleton method used to instantiate class object |
|
115 | - * |
|
116 | - * @return EE_Encryption |
|
117 | - */ |
|
118 | - public static function instance() |
|
119 | - { |
|
120 | - // check if class object is instantiated |
|
121 | - if (! self::$_instance instanceof EE_Encryption) { |
|
122 | - self::$_instance = new self(); |
|
123 | - } |
|
124 | - return self::$_instance; |
|
125 | - } |
|
126 | - |
|
127 | - |
|
128 | - |
|
129 | - /** |
|
130 | - * get encryption key |
|
131 | - * |
|
132 | - * @return string |
|
133 | - */ |
|
134 | - public function get_encryption_key() |
|
135 | - { |
|
136 | - // if encryption key has not been set |
|
137 | - if (empty($this->_encryption_key)) { |
|
138 | - // retrieve encryption_key from db |
|
139 | - $this->_encryption_key = get_option(EE_Encryption::ENCRYPTION_OPTION_KEY, ''); |
|
140 | - // WHAT?? No encryption_key in the db ?? |
|
141 | - if ($this->_encryption_key === '') { |
|
142 | - // let's make one. And md5 it to make it just the right size for a key |
|
143 | - $new_key = md5($this->generate_random_string()); |
|
144 | - // now save it to the db for later |
|
145 | - add_option(EE_Encryption::ENCRYPTION_OPTION_KEY, $new_key); |
|
146 | - // here's the key - FINALLY ! |
|
147 | - $this->_encryption_key = $new_key; |
|
148 | - } |
|
149 | - } |
|
150 | - return $this->_encryption_key; |
|
151 | - } |
|
152 | - |
|
153 | - |
|
154 | - |
|
155 | - /** |
|
156 | - * encrypts data |
|
157 | - * |
|
158 | - * @param string $text_string - the text to be encrypted |
|
159 | - * @return string |
|
160 | - * @throws RuntimeException |
|
161 | - */ |
|
162 | - public function encrypt($text_string = '') |
|
163 | - { |
|
164 | - // you give me nothing??? GET OUT ! |
|
165 | - if (empty($text_string)) { |
|
166 | - return $text_string; |
|
167 | - } |
|
168 | - if ($this->_use_openssl_encrypt) { |
|
169 | - $encrypted_text = $this->openssl_encrypt($text_string); |
|
170 | - } else { |
|
171 | - $encrypted_text = $this->acme_encrypt($text_string); |
|
172 | - } |
|
173 | - return $encrypted_text; |
|
174 | - } |
|
175 | - |
|
176 | - |
|
177 | - |
|
178 | - /** |
|
179 | - * decrypts data |
|
180 | - * |
|
181 | - * @param string $encrypted_text - the text to be decrypted |
|
182 | - * @return string |
|
183 | - * @throws RuntimeException |
|
184 | - */ |
|
185 | - public function decrypt($encrypted_text = '') |
|
186 | - { |
|
187 | - // you give me nothing??? GET OUT ! |
|
188 | - if (empty($encrypted_text)) { |
|
189 | - return $encrypted_text; |
|
190 | - } |
|
191 | - // if PHP's mcrypt functions are installed then we'll use them |
|
192 | - if ($this->_use_openssl_encrypt) { |
|
193 | - $decrypted_text = $this->openssl_decrypt($encrypted_text); |
|
194 | - } else { |
|
195 | - $decrypted_text = $this->acme_decrypt($encrypted_text); |
|
196 | - } |
|
197 | - return $decrypted_text; |
|
198 | - } |
|
199 | - |
|
200 | - |
|
201 | - |
|
202 | - /** |
|
203 | - * encodes string with PHP's base64 encoding |
|
204 | - * |
|
205 | - * @see http://php.net/manual/en/function.base64-encode.php |
|
206 | - * @param string $text_string the text to be encoded |
|
207 | - * @return string |
|
208 | - */ |
|
209 | - public function base64_string_encode($text_string = '') |
|
210 | - { |
|
211 | - // you give me nothing??? GET OUT ! |
|
212 | - if (empty($text_string) || ! $this->_use_base64_encode) { |
|
213 | - return $text_string; |
|
214 | - } |
|
215 | - // encode |
|
216 | - return base64_encode($text_string); |
|
217 | - } |
|
218 | - |
|
219 | - |
|
220 | - |
|
221 | - /** |
|
222 | - * decodes string that has been encoded with PHP's base64 encoding |
|
223 | - * |
|
224 | - * @see http://php.net/manual/en/function.base64-encode.php |
|
225 | - * @param string $encoded_string the text to be decoded |
|
226 | - * @return string |
|
227 | - */ |
|
228 | - public function base64_string_decode($encoded_string = '') |
|
229 | - { |
|
230 | - // you give me nothing??? GET OUT ! |
|
231 | - if (empty($encoded_string) || ! $this->valid_base_64($encoded_string)) { |
|
232 | - return $encoded_string; |
|
233 | - } |
|
234 | - // decode |
|
235 | - return base64_decode($encoded_string); |
|
236 | - } |
|
237 | - |
|
238 | - |
|
239 | - |
|
240 | - /** |
|
241 | - * encodes url string with PHP's base64 encoding |
|
242 | - * |
|
243 | - * @see http://php.net/manual/en/function.base64-encode.php |
|
244 | - * @param string $text_string the text to be encoded |
|
245 | - * @return string |
|
246 | - */ |
|
247 | - public function base64_url_encode($text_string = '') |
|
248 | - { |
|
249 | - // you give me nothing??? GET OUT ! |
|
250 | - if (empty($text_string) || ! $this->_use_base64_encode) { |
|
251 | - return $text_string; |
|
252 | - } |
|
253 | - // encode |
|
254 | - $encoded_string = base64_encode($text_string); |
|
255 | - // remove chars to make encoding more URL friendly |
|
256 | - return strtr($encoded_string, '+/=', '-_,'); |
|
257 | - } |
|
258 | - |
|
259 | - |
|
260 | - |
|
261 | - /** |
|
262 | - * decodes url string that has been encoded with PHP's base64 encoding |
|
263 | - * |
|
264 | - * @see http://php.net/manual/en/function.base64-encode.php |
|
265 | - * @param string $encoded_string the text to be decoded |
|
266 | - * @return string |
|
267 | - */ |
|
268 | - public function base64_url_decode($encoded_string = '') |
|
269 | - { |
|
270 | - // you give me nothing??? GET OUT ! |
|
271 | - if (empty($encoded_string) || ! $this->valid_base_64($encoded_string)) { |
|
272 | - return $encoded_string; |
|
273 | - } |
|
274 | - // replace previously removed characters |
|
275 | - $encoded_string = strtr($encoded_string, '-_,', '+/='); |
|
276 | - // decode |
|
277 | - return base64_decode($encoded_string); |
|
278 | - } |
|
279 | - |
|
280 | - |
|
281 | - |
|
282 | - /** |
|
283 | - * encrypts data using PHP's openssl functions |
|
284 | - * |
|
285 | - * @param string $text_string the text to be encrypted |
|
286 | - * @return string |
|
287 | - * @throws RuntimeException |
|
288 | - */ |
|
289 | - protected function openssl_encrypt($text_string = '') |
|
290 | - { |
|
291 | - // you give me nothing??? GET OUT ! |
|
292 | - if (empty($text_string)) { |
|
293 | - return $text_string; |
|
294 | - } |
|
295 | - $this->cipher_method = $this->getCipherMethod(); |
|
296 | - // get initialization vector size |
|
297 | - $iv_size = openssl_cipher_iv_length($this->cipher_method); |
|
298 | - // generate initialization vector. |
|
299 | - // The second parameter ("crypto_strong") is passed by reference, |
|
300 | - // and is used to determines if the algorithm used was "cryptographically strong" |
|
301 | - // openssl_random_pseudo_bytes() will toggle it to either true or false |
|
302 | - $iv = openssl_random_pseudo_bytes($iv_size, $is_strong); |
|
303 | - if ($iv === false || $is_strong === false) { |
|
304 | - throw new RuntimeException( |
|
305 | - esc_html__('Failed to generate OpenSSL initialization vector.', 'event_espresso') |
|
306 | - ); |
|
307 | - } |
|
308 | - // encrypt it |
|
309 | - $encrypted_text = openssl_encrypt( |
|
310 | - $text_string, |
|
311 | - $this->cipher_method, |
|
312 | - $this->getDigestHashValue(), |
|
313 | - 0, |
|
314 | - $iv |
|
315 | - ); |
|
316 | - // append the initialization vector |
|
317 | - $encrypted_text .= EE_Encryption::OPENSSL_IV_DELIMITER . $iv; |
|
318 | - // trim and maybe encode |
|
319 | - return $this->_use_base64_encode |
|
320 | - ? trim(base64_encode($encrypted_text)) |
|
321 | - : trim($encrypted_text); |
|
322 | - } |
|
323 | - |
|
324 | - |
|
325 | - |
|
326 | - /** |
|
327 | - * Returns a cipher method that has been verified to work. |
|
328 | - * First checks if the cached cipher has been set already and if so, returns that. |
|
329 | - * Then tests the incoming default and returns that if it's good. |
|
330 | - * If not, then it retrieves the previously tested and saved cipher method. |
|
331 | - * But if that doesn't exist, then calls getAvailableCipherMethod() |
|
332 | - * to see what is available on the server, and returns the results. |
|
333 | - * |
|
334 | - * @param string $cipher_method |
|
335 | - * @return string |
|
336 | - * @throws RuntimeException |
|
337 | - */ |
|
338 | - protected function getCipherMethod($cipher_method = EE_Encryption::OPENSSL_CIPHER_METHOD) |
|
339 | - { |
|
340 | - if($this->cipher_method !== ''){ |
|
341 | - return $this->cipher_method; |
|
342 | - } |
|
343 | - // verify that the default cipher method can produce an initialization vector |
|
344 | - if (openssl_cipher_iv_length($cipher_method) === false) { |
|
345 | - // nope? okay let's get what we found in the past to work |
|
346 | - $cipher_method = get_option(EE_Encryption::OPENSSL_CIPHER_METHOD_OPTION_NAME, ''); |
|
347 | - // oops... haven't tested available cipher methods yet |
|
348 | - if($cipher_method === '' || openssl_cipher_iv_length($cipher_method) === false) { |
|
349 | - $cipher_method = $this->getAvailableCipherMethod($cipher_method); |
|
350 | - } |
|
351 | - } |
|
352 | - return $cipher_method; |
|
353 | - } |
|
354 | - |
|
355 | - |
|
356 | - |
|
357 | - /** |
|
358 | - * @param string $cipher_method |
|
359 | - * @return string |
|
360 | - * @throws \RuntimeException |
|
361 | - */ |
|
362 | - protected function getAvailableCipherMethod($cipher_method) |
|
363 | - { |
|
364 | - // verify that the incoming cipher method can produce an initialization vector |
|
365 | - if (openssl_cipher_iv_length($cipher_method) === false) { |
|
366 | - // nope? then check the next cipher in the list of available cipher methods |
|
367 | - $cipher_method = next($this->cipher_methods); |
|
368 | - // what? there's no list? then generate that list and cache it, |
|
369 | - if (empty($this->cipher_methods)) { |
|
370 | - $this->cipher_methods = openssl_get_cipher_methods(); |
|
371 | - // then grab the first item from the list |
|
372 | - $cipher_method = reset($this->cipher_methods); |
|
373 | - } |
|
374 | - if($cipher_method === false){ |
|
375 | - throw new RuntimeException( |
|
376 | - esc_html__( |
|
377 | - 'OpenSSL support appears to be enabled on the server, but no cipher methods are available. Please contact the server administrator.', |
|
378 | - 'event_espresso' |
|
379 | - ) |
|
380 | - ); |
|
381 | - } |
|
382 | - // verify that the next cipher method works |
|
383 | - return $this->getAvailableCipherMethod($cipher_method); |
|
384 | - } |
|
385 | - // if we've gotten this far, then we found an available cipher method that works |
|
386 | - // so save that for next time |
|
387 | - update_option( |
|
388 | - EE_Encryption::OPENSSL_CIPHER_METHOD_OPTION_NAME, |
|
389 | - $cipher_method |
|
390 | - ); |
|
391 | - return $cipher_method; |
|
392 | - } |
|
393 | - |
|
394 | - |
|
395 | - |
|
396 | - /** |
|
397 | - * decrypts data that has been encrypted with PHP's openssl functions |
|
398 | - * |
|
399 | - * @param string $encrypted_text the text to be decrypted |
|
400 | - * @return string |
|
401 | - * @throws RuntimeException |
|
402 | - */ |
|
403 | - protected function openssl_decrypt($encrypted_text = '') |
|
404 | - { |
|
405 | - // you give me nothing??? GET OUT ! |
|
406 | - if (empty($encrypted_text)) { |
|
407 | - return $encrypted_text; |
|
408 | - } |
|
409 | - // decode |
|
410 | - $encrypted_text = $this->valid_base_64($encrypted_text) |
|
411 | - ? base64_decode($encrypted_text) |
|
412 | - : $encrypted_text; |
|
413 | - $encrypted_components = explode( |
|
414 | - EE_Encryption::OPENSSL_IV_DELIMITER, |
|
415 | - $encrypted_text, |
|
416 | - 2 |
|
417 | - ); |
|
418 | - // check that iv exists, and if not, maybe text was encoded using mcrypt? |
|
419 | - if ($this->_use_mcrypt && ! isset($encrypted_components[1])) { |
|
420 | - return $this->m_decrypt($encrypted_text); |
|
421 | - } |
|
422 | - // decrypt it |
|
423 | - $decrypted_text = openssl_decrypt( |
|
424 | - $encrypted_components[0], |
|
425 | - $this->getCipherMethod(), |
|
426 | - $this->getDigestHashValue(), |
|
427 | - 0, |
|
428 | - $encrypted_components[1] |
|
429 | - ); |
|
430 | - $decrypted_text = trim($decrypted_text); |
|
431 | - return $decrypted_text; |
|
432 | - } |
|
433 | - |
|
434 | - |
|
435 | - |
|
436 | - /** |
|
437 | - * Computes the digest hash value using the specified digest method. |
|
438 | - * If that digest method fails to produce a valid hash value, |
|
439 | - * then we'll grab the next digest method and recursively try again until something works. |
|
440 | - * |
|
441 | - * @param string $digest_method |
|
442 | - * @return string |
|
443 | - * @throws RuntimeException |
|
444 | - */ |
|
445 | - protected function getDigestHashValue($digest_method = EE_Encryption::OPENSSL_DIGEST_METHOD){ |
|
446 | - $digest_hash_value = openssl_digest($this->get_encryption_key(), $digest_method); |
|
447 | - if ($digest_hash_value === false) { |
|
448 | - return $this->getDigestHashValue($this->getDigestMethod()); |
|
449 | - } |
|
450 | - return $digest_hash_value; |
|
451 | - } |
|
452 | - |
|
453 | - |
|
454 | - |
|
455 | - /** |
|
456 | - * Returns the NEXT element in the $digest_methods array. |
|
457 | - * If the $digest_methods array is empty, then we populate it |
|
458 | - * with the available values returned from openssl_get_md_methods(). |
|
459 | - * |
|
460 | - * @return string |
|
461 | - * @throws \RuntimeException |
|
462 | - */ |
|
463 | - protected function getDigestMethod(){ |
|
464 | - $digest_method = prev($this->digest_methods); |
|
465 | - if (empty($this->digest_methods)) { |
|
466 | - $this->digest_methods = openssl_get_md_methods(); |
|
467 | - $digest_method = end($this->digest_methods); |
|
468 | - } |
|
469 | - if ($digest_method === false) { |
|
470 | - throw new RuntimeException( |
|
471 | - esc_html__( |
|
472 | - 'OpenSSL support appears to be enabled on the server, but no digest methods are available. Please contact the server administrator.', |
|
473 | - 'event_espresso' |
|
474 | - ) |
|
475 | - ); |
|
476 | - } |
|
477 | - return $digest_method; |
|
478 | - } |
|
479 | - |
|
480 | - |
|
481 | - /** |
|
482 | - * encrypts data for acme servers that didn't bother to install PHP mcrypt |
|
483 | - * |
|
484 | - * @see http://stackoverflow.com/questions/800922/how-to-encrypt-string-without-mcrypt-library-in-php |
|
485 | - * @param string $text_string the text to be decrypted |
|
486 | - * @return string |
|
487 | - */ |
|
488 | - protected function acme_encrypt($text_string = '') |
|
489 | - { |
|
490 | - // you give me nothing??? GET OUT ! |
|
491 | - if (empty($text_string)) { |
|
492 | - return $text_string; |
|
493 | - } |
|
494 | - $key_bits = str_split( |
|
495 | - str_pad( |
|
496 | - '', |
|
497 | - strlen($text_string), |
|
498 | - $this->get_encryption_key(), |
|
499 | - STR_PAD_RIGHT |
|
500 | - ) |
|
501 | - ); |
|
502 | - $string_bits = str_split($text_string); |
|
503 | - foreach ($string_bits as $k => $v) { |
|
504 | - $temp = ord($v) + ord($key_bits[$k]); |
|
505 | - $string_bits[$k] = chr($temp > 255 ? ($temp - 256) : $temp); |
|
506 | - } |
|
507 | - $encrypted_text = implode('', $string_bits); |
|
508 | - $encrypted_text .= EE_Encryption::ACME_ENCRYPTION_FLAG; |
|
509 | - return $this->_use_base64_encode |
|
510 | - ? base64_encode($encrypted_text) |
|
511 | - : $encrypted_text; |
|
512 | - } |
|
513 | - |
|
514 | - |
|
515 | - |
|
516 | - /** |
|
517 | - * decrypts data for acme servers that didn't bother to install PHP mcrypt |
|
518 | - * |
|
519 | - * @see http://stackoverflow.com/questions/800922/how-to-encrypt-string-without-mcrypt-library-in-php |
|
520 | - * @param string $encrypted_text the text to be decrypted |
|
521 | - * @return string |
|
522 | - * @throws RuntimeException |
|
523 | - */ |
|
524 | - protected function acme_decrypt($encrypted_text = '') |
|
525 | - { |
|
526 | - // you give me nothing??? GET OUT ! |
|
527 | - if (empty($encrypted_text)) { |
|
528 | - return $encrypted_text; |
|
529 | - } |
|
530 | - // decode the data ? |
|
531 | - $encrypted_text = $this->valid_base_64($encrypted_text) |
|
532 | - ? base64_decode($encrypted_text) |
|
533 | - : $encrypted_text; |
|
534 | - if ( |
|
535 | - $this->_use_mcrypt |
|
536 | - && strpos($encrypted_text, EE_Encryption::ACME_ENCRYPTION_FLAG) === false |
|
537 | - ){ |
|
538 | - return $this->m_decrypt($encrypted_text); |
|
539 | - } |
|
540 | - $encrypted_text = substr($encrypted_text, 0, -4); |
|
541 | - $key_bits = str_split( |
|
542 | - str_pad( |
|
543 | - '', |
|
544 | - strlen($encrypted_text), |
|
545 | - $this->get_encryption_key(), |
|
546 | - STR_PAD_RIGHT |
|
547 | - ) |
|
548 | - ); |
|
549 | - $string_bits = str_split($encrypted_text); |
|
550 | - foreach ($string_bits as $k => $v) { |
|
551 | - $temp = ord($v) - ord($key_bits[$k]); |
|
552 | - $string_bits[$k] = chr($temp < 0 ? ($temp + 256) : $temp); |
|
553 | - } |
|
554 | - return implode('', $string_bits); |
|
555 | - } |
|
556 | - |
|
557 | - |
|
558 | - |
|
559 | - /** |
|
560 | - * @see http://stackoverflow.com/questions/2556345/detect-base64-encoding-in-php#30231906 |
|
561 | - * @param $string |
|
562 | - * @return bool |
|
563 | - */ |
|
564 | - protected function valid_base_64($string) |
|
565 | - { |
|
566 | - // ensure data is a string |
|
567 | - if (! is_string($string) || ! $this->_use_base64_encode) { |
|
568 | - return false; |
|
569 | - } |
|
570 | - $decoded = base64_decode($string, true); |
|
571 | - // Check if there is no invalid character in string |
|
572 | - if (! preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $string)) { |
|
573 | - return false; |
|
574 | - } |
|
575 | - // Decode the string in strict mode and send the response |
|
576 | - if (! base64_decode($string, true)) { |
|
577 | - return false; |
|
578 | - } |
|
579 | - // Encode and compare it to original one |
|
580 | - return base64_encode($decoded) === $string; |
|
581 | - } |
|
582 | - |
|
583 | - |
|
584 | - |
|
585 | - /** |
|
586 | - * generate random string |
|
587 | - * |
|
588 | - * @see http://stackoverflow.com/questions/637278/what-is-the-best-way-to-generate-a-random-key-within-php |
|
589 | - * @param int $length number of characters for random string |
|
590 | - * @return string |
|
591 | - */ |
|
592 | - public function generate_random_string($length = 40) |
|
593 | - { |
|
594 | - $iterations = ceil($length / 40); |
|
595 | - $random_string = ''; |
|
596 | - for ($i = 0; $i < $iterations; $i++) { |
|
597 | - $random_string .= sha1(microtime(true) . mt_rand(10000, 90000)); |
|
598 | - } |
|
599 | - $random_string = substr($random_string, 0, $length); |
|
600 | - return $random_string; |
|
601 | - } |
|
602 | - |
|
603 | - |
|
604 | - |
|
605 | - /** |
|
606 | - * encrypts data using PHP's mcrypt functions |
|
607 | - * |
|
608 | - * @deprecated 4.9.39 |
|
609 | - * @param string $text_string |
|
610 | - * @internal param $string - the text to be encrypted |
|
611 | - * @return string |
|
612 | - * @throws RuntimeException |
|
613 | - */ |
|
614 | - protected function m_encrypt($text_string = '') |
|
615 | - { |
|
616 | - // you give me nothing??? GET OUT ! |
|
617 | - if (empty($text_string)) { |
|
618 | - return $text_string; |
|
619 | - } |
|
620 | - // get the initialization vector size |
|
621 | - $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); |
|
622 | - // initialization vector |
|
623 | - $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
|
624 | - if ($iv === false) { |
|
625 | - throw new RuntimeException( |
|
626 | - esc_html__('Failed to generate mcrypt initialization vector.', 'event_espresso') |
|
627 | - ); |
|
628 | - } |
|
629 | - // encrypt it |
|
630 | - $encrypted_text = mcrypt_encrypt( |
|
631 | - MCRYPT_RIJNDAEL_256, |
|
632 | - $this->get_encryption_key(), |
|
633 | - $text_string, |
|
634 | - MCRYPT_MODE_ECB, |
|
635 | - $iv |
|
636 | - ); |
|
637 | - // trim and maybe encode |
|
638 | - return $this->_use_base64_encode |
|
639 | - ? trim(base64_encode($encrypted_text)) |
|
640 | - : trim($encrypted_text); |
|
641 | - } |
|
642 | - |
|
643 | - |
|
644 | - |
|
645 | - /** |
|
646 | - * decrypts data that has been encrypted with PHP's mcrypt functions |
|
647 | - * |
|
648 | - * @deprecated 4.9.39 |
|
649 | - * @param string $encrypted_text the text to be decrypted |
|
650 | - * @return string |
|
651 | - * @throws RuntimeException |
|
652 | - */ |
|
653 | - protected function m_decrypt($encrypted_text = '') |
|
654 | - { |
|
655 | - // you give me nothing??? GET OUT ! |
|
656 | - if (empty($encrypted_text)) { |
|
657 | - return $encrypted_text; |
|
658 | - } |
|
659 | - // decode |
|
660 | - $encrypted_text = $this->valid_base_64($encrypted_text) |
|
661 | - ? base64_decode($encrypted_text) |
|
662 | - : $encrypted_text; |
|
663 | - // get the initialization vector size |
|
664 | - $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); |
|
665 | - $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
|
666 | - if ($iv === false) { |
|
667 | - throw new RuntimeException( |
|
668 | - esc_html__('Failed to generate mcrypt initialization vector.', 'event_espresso') |
|
669 | - ); |
|
670 | - } |
|
671 | - // decrypt it |
|
672 | - $decrypted_text = mcrypt_decrypt( |
|
673 | - MCRYPT_RIJNDAEL_256, |
|
674 | - $this->get_encryption_key(), |
|
675 | - $encrypted_text, |
|
676 | - MCRYPT_MODE_ECB, |
|
677 | - $iv |
|
678 | - ); |
|
679 | - $decrypted_text = trim($decrypted_text); |
|
680 | - return $decrypted_text; |
|
681 | - } |
|
19 | + /** |
|
20 | + * key used for saving the encryption key to the wp_options table |
|
21 | + */ |
|
22 | + const ENCRYPTION_OPTION_KEY = 'ee_encryption_key'; |
|
23 | + |
|
24 | + /** |
|
25 | + * the OPENSSL cipher method used |
|
26 | + */ |
|
27 | + const OPENSSL_CIPHER_METHOD = 'AES-128-CBC'; |
|
28 | + |
|
29 | + /** |
|
30 | + * WP "options_name" used to store a verified available cipher method |
|
31 | + */ |
|
32 | + const OPENSSL_CIPHER_METHOD_OPTION_NAME = 'ee_openssl_cipher_method'; |
|
33 | + |
|
34 | + /** |
|
35 | + * the OPENSSL digest method used |
|
36 | + */ |
|
37 | + const OPENSSL_DIGEST_METHOD = 'sha512'; |
|
38 | + |
|
39 | + /** |
|
40 | + * separates the encrypted text from the initialization vector |
|
41 | + */ |
|
42 | + const OPENSSL_IV_DELIMITER = ':iv:'; |
|
43 | + |
|
44 | + /** |
|
45 | + * appended to text encrypted using the acme encryption |
|
46 | + */ |
|
47 | + const ACME_ENCRYPTION_FLAG = '::ae'; |
|
48 | + |
|
49 | + |
|
50 | + |
|
51 | + /** |
|
52 | + * instance of the EE_Encryption object |
|
53 | + */ |
|
54 | + protected static $_instance; |
|
55 | + |
|
56 | + /** |
|
57 | + * @var string $_encryption_key |
|
58 | + */ |
|
59 | + protected $_encryption_key; |
|
60 | + |
|
61 | + /** |
|
62 | + * @var string $cipher_method |
|
63 | + */ |
|
64 | + private $cipher_method = ''; |
|
65 | + |
|
66 | + /** |
|
67 | + * @var array $cipher_methods |
|
68 | + */ |
|
69 | + private $cipher_methods = array(); |
|
70 | + |
|
71 | + /** |
|
72 | + * @var array $digest_methods |
|
73 | + */ |
|
74 | + private $digest_methods = array(); |
|
75 | + |
|
76 | + /** |
|
77 | + * @var boolean $_use_openssl_encrypt |
|
78 | + */ |
|
79 | + protected $_use_openssl_encrypt = false; |
|
80 | + |
|
81 | + /** |
|
82 | + * @var boolean $_use_mcrypt |
|
83 | + */ |
|
84 | + protected $_use_mcrypt = false; |
|
85 | + |
|
86 | + /** |
|
87 | + * @var boolean $_use_base64_encode |
|
88 | + */ |
|
89 | + protected $_use_base64_encode = false; |
|
90 | + |
|
91 | + |
|
92 | + |
|
93 | + /** |
|
94 | + * protected constructor to prevent direct creation |
|
95 | + */ |
|
96 | + protected function __construct() |
|
97 | + { |
|
98 | + if (! defined('ESPRESSO_ENCRYPT')) { |
|
99 | + define('ESPRESSO_ENCRYPT', true); |
|
100 | + } |
|
101 | + if (extension_loaded('openssl')) { |
|
102 | + $this->_use_openssl_encrypt = true; |
|
103 | + } else if (extension_loaded('mcrypt')) { |
|
104 | + $this->_use_mcrypt = true; |
|
105 | + } |
|
106 | + if (function_exists('base64_encode')) { |
|
107 | + $this->_use_base64_encode = true; |
|
108 | + } |
|
109 | + } |
|
110 | + |
|
111 | + |
|
112 | + |
|
113 | + /** |
|
114 | + * singleton method used to instantiate class object |
|
115 | + * |
|
116 | + * @return EE_Encryption |
|
117 | + */ |
|
118 | + public static function instance() |
|
119 | + { |
|
120 | + // check if class object is instantiated |
|
121 | + if (! self::$_instance instanceof EE_Encryption) { |
|
122 | + self::$_instance = new self(); |
|
123 | + } |
|
124 | + return self::$_instance; |
|
125 | + } |
|
126 | + |
|
127 | + |
|
128 | + |
|
129 | + /** |
|
130 | + * get encryption key |
|
131 | + * |
|
132 | + * @return string |
|
133 | + */ |
|
134 | + public function get_encryption_key() |
|
135 | + { |
|
136 | + // if encryption key has not been set |
|
137 | + if (empty($this->_encryption_key)) { |
|
138 | + // retrieve encryption_key from db |
|
139 | + $this->_encryption_key = get_option(EE_Encryption::ENCRYPTION_OPTION_KEY, ''); |
|
140 | + // WHAT?? No encryption_key in the db ?? |
|
141 | + if ($this->_encryption_key === '') { |
|
142 | + // let's make one. And md5 it to make it just the right size for a key |
|
143 | + $new_key = md5($this->generate_random_string()); |
|
144 | + // now save it to the db for later |
|
145 | + add_option(EE_Encryption::ENCRYPTION_OPTION_KEY, $new_key); |
|
146 | + // here's the key - FINALLY ! |
|
147 | + $this->_encryption_key = $new_key; |
|
148 | + } |
|
149 | + } |
|
150 | + return $this->_encryption_key; |
|
151 | + } |
|
152 | + |
|
153 | + |
|
154 | + |
|
155 | + /** |
|
156 | + * encrypts data |
|
157 | + * |
|
158 | + * @param string $text_string - the text to be encrypted |
|
159 | + * @return string |
|
160 | + * @throws RuntimeException |
|
161 | + */ |
|
162 | + public function encrypt($text_string = '') |
|
163 | + { |
|
164 | + // you give me nothing??? GET OUT ! |
|
165 | + if (empty($text_string)) { |
|
166 | + return $text_string; |
|
167 | + } |
|
168 | + if ($this->_use_openssl_encrypt) { |
|
169 | + $encrypted_text = $this->openssl_encrypt($text_string); |
|
170 | + } else { |
|
171 | + $encrypted_text = $this->acme_encrypt($text_string); |
|
172 | + } |
|
173 | + return $encrypted_text; |
|
174 | + } |
|
175 | + |
|
176 | + |
|
177 | + |
|
178 | + /** |
|
179 | + * decrypts data |
|
180 | + * |
|
181 | + * @param string $encrypted_text - the text to be decrypted |
|
182 | + * @return string |
|
183 | + * @throws RuntimeException |
|
184 | + */ |
|
185 | + public function decrypt($encrypted_text = '') |
|
186 | + { |
|
187 | + // you give me nothing??? GET OUT ! |
|
188 | + if (empty($encrypted_text)) { |
|
189 | + return $encrypted_text; |
|
190 | + } |
|
191 | + // if PHP's mcrypt functions are installed then we'll use them |
|
192 | + if ($this->_use_openssl_encrypt) { |
|
193 | + $decrypted_text = $this->openssl_decrypt($encrypted_text); |
|
194 | + } else { |
|
195 | + $decrypted_text = $this->acme_decrypt($encrypted_text); |
|
196 | + } |
|
197 | + return $decrypted_text; |
|
198 | + } |
|
199 | + |
|
200 | + |
|
201 | + |
|
202 | + /** |
|
203 | + * encodes string with PHP's base64 encoding |
|
204 | + * |
|
205 | + * @see http://php.net/manual/en/function.base64-encode.php |
|
206 | + * @param string $text_string the text to be encoded |
|
207 | + * @return string |
|
208 | + */ |
|
209 | + public function base64_string_encode($text_string = '') |
|
210 | + { |
|
211 | + // you give me nothing??? GET OUT ! |
|
212 | + if (empty($text_string) || ! $this->_use_base64_encode) { |
|
213 | + return $text_string; |
|
214 | + } |
|
215 | + // encode |
|
216 | + return base64_encode($text_string); |
|
217 | + } |
|
218 | + |
|
219 | + |
|
220 | + |
|
221 | + /** |
|
222 | + * decodes string that has been encoded with PHP's base64 encoding |
|
223 | + * |
|
224 | + * @see http://php.net/manual/en/function.base64-encode.php |
|
225 | + * @param string $encoded_string the text to be decoded |
|
226 | + * @return string |
|
227 | + */ |
|
228 | + public function base64_string_decode($encoded_string = '') |
|
229 | + { |
|
230 | + // you give me nothing??? GET OUT ! |
|
231 | + if (empty($encoded_string) || ! $this->valid_base_64($encoded_string)) { |
|
232 | + return $encoded_string; |
|
233 | + } |
|
234 | + // decode |
|
235 | + return base64_decode($encoded_string); |
|
236 | + } |
|
237 | + |
|
238 | + |
|
239 | + |
|
240 | + /** |
|
241 | + * encodes url string with PHP's base64 encoding |
|
242 | + * |
|
243 | + * @see http://php.net/manual/en/function.base64-encode.php |
|
244 | + * @param string $text_string the text to be encoded |
|
245 | + * @return string |
|
246 | + */ |
|
247 | + public function base64_url_encode($text_string = '') |
|
248 | + { |
|
249 | + // you give me nothing??? GET OUT ! |
|
250 | + if (empty($text_string) || ! $this->_use_base64_encode) { |
|
251 | + return $text_string; |
|
252 | + } |
|
253 | + // encode |
|
254 | + $encoded_string = base64_encode($text_string); |
|
255 | + // remove chars to make encoding more URL friendly |
|
256 | + return strtr($encoded_string, '+/=', '-_,'); |
|
257 | + } |
|
258 | + |
|
259 | + |
|
260 | + |
|
261 | + /** |
|
262 | + * decodes url string that has been encoded with PHP's base64 encoding |
|
263 | + * |
|
264 | + * @see http://php.net/manual/en/function.base64-encode.php |
|
265 | + * @param string $encoded_string the text to be decoded |
|
266 | + * @return string |
|
267 | + */ |
|
268 | + public function base64_url_decode($encoded_string = '') |
|
269 | + { |
|
270 | + // you give me nothing??? GET OUT ! |
|
271 | + if (empty($encoded_string) || ! $this->valid_base_64($encoded_string)) { |
|
272 | + return $encoded_string; |
|
273 | + } |
|
274 | + // replace previously removed characters |
|
275 | + $encoded_string = strtr($encoded_string, '-_,', '+/='); |
|
276 | + // decode |
|
277 | + return base64_decode($encoded_string); |
|
278 | + } |
|
279 | + |
|
280 | + |
|
281 | + |
|
282 | + /** |
|
283 | + * encrypts data using PHP's openssl functions |
|
284 | + * |
|
285 | + * @param string $text_string the text to be encrypted |
|
286 | + * @return string |
|
287 | + * @throws RuntimeException |
|
288 | + */ |
|
289 | + protected function openssl_encrypt($text_string = '') |
|
290 | + { |
|
291 | + // you give me nothing??? GET OUT ! |
|
292 | + if (empty($text_string)) { |
|
293 | + return $text_string; |
|
294 | + } |
|
295 | + $this->cipher_method = $this->getCipherMethod(); |
|
296 | + // get initialization vector size |
|
297 | + $iv_size = openssl_cipher_iv_length($this->cipher_method); |
|
298 | + // generate initialization vector. |
|
299 | + // The second parameter ("crypto_strong") is passed by reference, |
|
300 | + // and is used to determines if the algorithm used was "cryptographically strong" |
|
301 | + // openssl_random_pseudo_bytes() will toggle it to either true or false |
|
302 | + $iv = openssl_random_pseudo_bytes($iv_size, $is_strong); |
|
303 | + if ($iv === false || $is_strong === false) { |
|
304 | + throw new RuntimeException( |
|
305 | + esc_html__('Failed to generate OpenSSL initialization vector.', 'event_espresso') |
|
306 | + ); |
|
307 | + } |
|
308 | + // encrypt it |
|
309 | + $encrypted_text = openssl_encrypt( |
|
310 | + $text_string, |
|
311 | + $this->cipher_method, |
|
312 | + $this->getDigestHashValue(), |
|
313 | + 0, |
|
314 | + $iv |
|
315 | + ); |
|
316 | + // append the initialization vector |
|
317 | + $encrypted_text .= EE_Encryption::OPENSSL_IV_DELIMITER . $iv; |
|
318 | + // trim and maybe encode |
|
319 | + return $this->_use_base64_encode |
|
320 | + ? trim(base64_encode($encrypted_text)) |
|
321 | + : trim($encrypted_text); |
|
322 | + } |
|
323 | + |
|
324 | + |
|
325 | + |
|
326 | + /** |
|
327 | + * Returns a cipher method that has been verified to work. |
|
328 | + * First checks if the cached cipher has been set already and if so, returns that. |
|
329 | + * Then tests the incoming default and returns that if it's good. |
|
330 | + * If not, then it retrieves the previously tested and saved cipher method. |
|
331 | + * But if that doesn't exist, then calls getAvailableCipherMethod() |
|
332 | + * to see what is available on the server, and returns the results. |
|
333 | + * |
|
334 | + * @param string $cipher_method |
|
335 | + * @return string |
|
336 | + * @throws RuntimeException |
|
337 | + */ |
|
338 | + protected function getCipherMethod($cipher_method = EE_Encryption::OPENSSL_CIPHER_METHOD) |
|
339 | + { |
|
340 | + if($this->cipher_method !== ''){ |
|
341 | + return $this->cipher_method; |
|
342 | + } |
|
343 | + // verify that the default cipher method can produce an initialization vector |
|
344 | + if (openssl_cipher_iv_length($cipher_method) === false) { |
|
345 | + // nope? okay let's get what we found in the past to work |
|
346 | + $cipher_method = get_option(EE_Encryption::OPENSSL_CIPHER_METHOD_OPTION_NAME, ''); |
|
347 | + // oops... haven't tested available cipher methods yet |
|
348 | + if($cipher_method === '' || openssl_cipher_iv_length($cipher_method) === false) { |
|
349 | + $cipher_method = $this->getAvailableCipherMethod($cipher_method); |
|
350 | + } |
|
351 | + } |
|
352 | + return $cipher_method; |
|
353 | + } |
|
354 | + |
|
355 | + |
|
356 | + |
|
357 | + /** |
|
358 | + * @param string $cipher_method |
|
359 | + * @return string |
|
360 | + * @throws \RuntimeException |
|
361 | + */ |
|
362 | + protected function getAvailableCipherMethod($cipher_method) |
|
363 | + { |
|
364 | + // verify that the incoming cipher method can produce an initialization vector |
|
365 | + if (openssl_cipher_iv_length($cipher_method) === false) { |
|
366 | + // nope? then check the next cipher in the list of available cipher methods |
|
367 | + $cipher_method = next($this->cipher_methods); |
|
368 | + // what? there's no list? then generate that list and cache it, |
|
369 | + if (empty($this->cipher_methods)) { |
|
370 | + $this->cipher_methods = openssl_get_cipher_methods(); |
|
371 | + // then grab the first item from the list |
|
372 | + $cipher_method = reset($this->cipher_methods); |
|
373 | + } |
|
374 | + if($cipher_method === false){ |
|
375 | + throw new RuntimeException( |
|
376 | + esc_html__( |
|
377 | + 'OpenSSL support appears to be enabled on the server, but no cipher methods are available. Please contact the server administrator.', |
|
378 | + 'event_espresso' |
|
379 | + ) |
|
380 | + ); |
|
381 | + } |
|
382 | + // verify that the next cipher method works |
|
383 | + return $this->getAvailableCipherMethod($cipher_method); |
|
384 | + } |
|
385 | + // if we've gotten this far, then we found an available cipher method that works |
|
386 | + // so save that for next time |
|
387 | + update_option( |
|
388 | + EE_Encryption::OPENSSL_CIPHER_METHOD_OPTION_NAME, |
|
389 | + $cipher_method |
|
390 | + ); |
|
391 | + return $cipher_method; |
|
392 | + } |
|
393 | + |
|
394 | + |
|
395 | + |
|
396 | + /** |
|
397 | + * decrypts data that has been encrypted with PHP's openssl functions |
|
398 | + * |
|
399 | + * @param string $encrypted_text the text to be decrypted |
|
400 | + * @return string |
|
401 | + * @throws RuntimeException |
|
402 | + */ |
|
403 | + protected function openssl_decrypt($encrypted_text = '') |
|
404 | + { |
|
405 | + // you give me nothing??? GET OUT ! |
|
406 | + if (empty($encrypted_text)) { |
|
407 | + return $encrypted_text; |
|
408 | + } |
|
409 | + // decode |
|
410 | + $encrypted_text = $this->valid_base_64($encrypted_text) |
|
411 | + ? base64_decode($encrypted_text) |
|
412 | + : $encrypted_text; |
|
413 | + $encrypted_components = explode( |
|
414 | + EE_Encryption::OPENSSL_IV_DELIMITER, |
|
415 | + $encrypted_text, |
|
416 | + 2 |
|
417 | + ); |
|
418 | + // check that iv exists, and if not, maybe text was encoded using mcrypt? |
|
419 | + if ($this->_use_mcrypt && ! isset($encrypted_components[1])) { |
|
420 | + return $this->m_decrypt($encrypted_text); |
|
421 | + } |
|
422 | + // decrypt it |
|
423 | + $decrypted_text = openssl_decrypt( |
|
424 | + $encrypted_components[0], |
|
425 | + $this->getCipherMethod(), |
|
426 | + $this->getDigestHashValue(), |
|
427 | + 0, |
|
428 | + $encrypted_components[1] |
|
429 | + ); |
|
430 | + $decrypted_text = trim($decrypted_text); |
|
431 | + return $decrypted_text; |
|
432 | + } |
|
433 | + |
|
434 | + |
|
435 | + |
|
436 | + /** |
|
437 | + * Computes the digest hash value using the specified digest method. |
|
438 | + * If that digest method fails to produce a valid hash value, |
|
439 | + * then we'll grab the next digest method and recursively try again until something works. |
|
440 | + * |
|
441 | + * @param string $digest_method |
|
442 | + * @return string |
|
443 | + * @throws RuntimeException |
|
444 | + */ |
|
445 | + protected function getDigestHashValue($digest_method = EE_Encryption::OPENSSL_DIGEST_METHOD){ |
|
446 | + $digest_hash_value = openssl_digest($this->get_encryption_key(), $digest_method); |
|
447 | + if ($digest_hash_value === false) { |
|
448 | + return $this->getDigestHashValue($this->getDigestMethod()); |
|
449 | + } |
|
450 | + return $digest_hash_value; |
|
451 | + } |
|
452 | + |
|
453 | + |
|
454 | + |
|
455 | + /** |
|
456 | + * Returns the NEXT element in the $digest_methods array. |
|
457 | + * If the $digest_methods array is empty, then we populate it |
|
458 | + * with the available values returned from openssl_get_md_methods(). |
|
459 | + * |
|
460 | + * @return string |
|
461 | + * @throws \RuntimeException |
|
462 | + */ |
|
463 | + protected function getDigestMethod(){ |
|
464 | + $digest_method = prev($this->digest_methods); |
|
465 | + if (empty($this->digest_methods)) { |
|
466 | + $this->digest_methods = openssl_get_md_methods(); |
|
467 | + $digest_method = end($this->digest_methods); |
|
468 | + } |
|
469 | + if ($digest_method === false) { |
|
470 | + throw new RuntimeException( |
|
471 | + esc_html__( |
|
472 | + 'OpenSSL support appears to be enabled on the server, but no digest methods are available. Please contact the server administrator.', |
|
473 | + 'event_espresso' |
|
474 | + ) |
|
475 | + ); |
|
476 | + } |
|
477 | + return $digest_method; |
|
478 | + } |
|
479 | + |
|
480 | + |
|
481 | + /** |
|
482 | + * encrypts data for acme servers that didn't bother to install PHP mcrypt |
|
483 | + * |
|
484 | + * @see http://stackoverflow.com/questions/800922/how-to-encrypt-string-without-mcrypt-library-in-php |
|
485 | + * @param string $text_string the text to be decrypted |
|
486 | + * @return string |
|
487 | + */ |
|
488 | + protected function acme_encrypt($text_string = '') |
|
489 | + { |
|
490 | + // you give me nothing??? GET OUT ! |
|
491 | + if (empty($text_string)) { |
|
492 | + return $text_string; |
|
493 | + } |
|
494 | + $key_bits = str_split( |
|
495 | + str_pad( |
|
496 | + '', |
|
497 | + strlen($text_string), |
|
498 | + $this->get_encryption_key(), |
|
499 | + STR_PAD_RIGHT |
|
500 | + ) |
|
501 | + ); |
|
502 | + $string_bits = str_split($text_string); |
|
503 | + foreach ($string_bits as $k => $v) { |
|
504 | + $temp = ord($v) + ord($key_bits[$k]); |
|
505 | + $string_bits[$k] = chr($temp > 255 ? ($temp - 256) : $temp); |
|
506 | + } |
|
507 | + $encrypted_text = implode('', $string_bits); |
|
508 | + $encrypted_text .= EE_Encryption::ACME_ENCRYPTION_FLAG; |
|
509 | + return $this->_use_base64_encode |
|
510 | + ? base64_encode($encrypted_text) |
|
511 | + : $encrypted_text; |
|
512 | + } |
|
513 | + |
|
514 | + |
|
515 | + |
|
516 | + /** |
|
517 | + * decrypts data for acme servers that didn't bother to install PHP mcrypt |
|
518 | + * |
|
519 | + * @see http://stackoverflow.com/questions/800922/how-to-encrypt-string-without-mcrypt-library-in-php |
|
520 | + * @param string $encrypted_text the text to be decrypted |
|
521 | + * @return string |
|
522 | + * @throws RuntimeException |
|
523 | + */ |
|
524 | + protected function acme_decrypt($encrypted_text = '') |
|
525 | + { |
|
526 | + // you give me nothing??? GET OUT ! |
|
527 | + if (empty($encrypted_text)) { |
|
528 | + return $encrypted_text; |
|
529 | + } |
|
530 | + // decode the data ? |
|
531 | + $encrypted_text = $this->valid_base_64($encrypted_text) |
|
532 | + ? base64_decode($encrypted_text) |
|
533 | + : $encrypted_text; |
|
534 | + if ( |
|
535 | + $this->_use_mcrypt |
|
536 | + && strpos($encrypted_text, EE_Encryption::ACME_ENCRYPTION_FLAG) === false |
|
537 | + ){ |
|
538 | + return $this->m_decrypt($encrypted_text); |
|
539 | + } |
|
540 | + $encrypted_text = substr($encrypted_text, 0, -4); |
|
541 | + $key_bits = str_split( |
|
542 | + str_pad( |
|
543 | + '', |
|
544 | + strlen($encrypted_text), |
|
545 | + $this->get_encryption_key(), |
|
546 | + STR_PAD_RIGHT |
|
547 | + ) |
|
548 | + ); |
|
549 | + $string_bits = str_split($encrypted_text); |
|
550 | + foreach ($string_bits as $k => $v) { |
|
551 | + $temp = ord($v) - ord($key_bits[$k]); |
|
552 | + $string_bits[$k] = chr($temp < 0 ? ($temp + 256) : $temp); |
|
553 | + } |
|
554 | + return implode('', $string_bits); |
|
555 | + } |
|
556 | + |
|
557 | + |
|
558 | + |
|
559 | + /** |
|
560 | + * @see http://stackoverflow.com/questions/2556345/detect-base64-encoding-in-php#30231906 |
|
561 | + * @param $string |
|
562 | + * @return bool |
|
563 | + */ |
|
564 | + protected function valid_base_64($string) |
|
565 | + { |
|
566 | + // ensure data is a string |
|
567 | + if (! is_string($string) || ! $this->_use_base64_encode) { |
|
568 | + return false; |
|
569 | + } |
|
570 | + $decoded = base64_decode($string, true); |
|
571 | + // Check if there is no invalid character in string |
|
572 | + if (! preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $string)) { |
|
573 | + return false; |
|
574 | + } |
|
575 | + // Decode the string in strict mode and send the response |
|
576 | + if (! base64_decode($string, true)) { |
|
577 | + return false; |
|
578 | + } |
|
579 | + // Encode and compare it to original one |
|
580 | + return base64_encode($decoded) === $string; |
|
581 | + } |
|
582 | + |
|
583 | + |
|
584 | + |
|
585 | + /** |
|
586 | + * generate random string |
|
587 | + * |
|
588 | + * @see http://stackoverflow.com/questions/637278/what-is-the-best-way-to-generate-a-random-key-within-php |
|
589 | + * @param int $length number of characters for random string |
|
590 | + * @return string |
|
591 | + */ |
|
592 | + public function generate_random_string($length = 40) |
|
593 | + { |
|
594 | + $iterations = ceil($length / 40); |
|
595 | + $random_string = ''; |
|
596 | + for ($i = 0; $i < $iterations; $i++) { |
|
597 | + $random_string .= sha1(microtime(true) . mt_rand(10000, 90000)); |
|
598 | + } |
|
599 | + $random_string = substr($random_string, 0, $length); |
|
600 | + return $random_string; |
|
601 | + } |
|
602 | + |
|
603 | + |
|
604 | + |
|
605 | + /** |
|
606 | + * encrypts data using PHP's mcrypt functions |
|
607 | + * |
|
608 | + * @deprecated 4.9.39 |
|
609 | + * @param string $text_string |
|
610 | + * @internal param $string - the text to be encrypted |
|
611 | + * @return string |
|
612 | + * @throws RuntimeException |
|
613 | + */ |
|
614 | + protected function m_encrypt($text_string = '') |
|
615 | + { |
|
616 | + // you give me nothing??? GET OUT ! |
|
617 | + if (empty($text_string)) { |
|
618 | + return $text_string; |
|
619 | + } |
|
620 | + // get the initialization vector size |
|
621 | + $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); |
|
622 | + // initialization vector |
|
623 | + $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
|
624 | + if ($iv === false) { |
|
625 | + throw new RuntimeException( |
|
626 | + esc_html__('Failed to generate mcrypt initialization vector.', 'event_espresso') |
|
627 | + ); |
|
628 | + } |
|
629 | + // encrypt it |
|
630 | + $encrypted_text = mcrypt_encrypt( |
|
631 | + MCRYPT_RIJNDAEL_256, |
|
632 | + $this->get_encryption_key(), |
|
633 | + $text_string, |
|
634 | + MCRYPT_MODE_ECB, |
|
635 | + $iv |
|
636 | + ); |
|
637 | + // trim and maybe encode |
|
638 | + return $this->_use_base64_encode |
|
639 | + ? trim(base64_encode($encrypted_text)) |
|
640 | + : trim($encrypted_text); |
|
641 | + } |
|
642 | + |
|
643 | + |
|
644 | + |
|
645 | + /** |
|
646 | + * decrypts data that has been encrypted with PHP's mcrypt functions |
|
647 | + * |
|
648 | + * @deprecated 4.9.39 |
|
649 | + * @param string $encrypted_text the text to be decrypted |
|
650 | + * @return string |
|
651 | + * @throws RuntimeException |
|
652 | + */ |
|
653 | + protected function m_decrypt($encrypted_text = '') |
|
654 | + { |
|
655 | + // you give me nothing??? GET OUT ! |
|
656 | + if (empty($encrypted_text)) { |
|
657 | + return $encrypted_text; |
|
658 | + } |
|
659 | + // decode |
|
660 | + $encrypted_text = $this->valid_base_64($encrypted_text) |
|
661 | + ? base64_decode($encrypted_text) |
|
662 | + : $encrypted_text; |
|
663 | + // get the initialization vector size |
|
664 | + $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); |
|
665 | + $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); |
|
666 | + if ($iv === false) { |
|
667 | + throw new RuntimeException( |
|
668 | + esc_html__('Failed to generate mcrypt initialization vector.', 'event_espresso') |
|
669 | + ); |
|
670 | + } |
|
671 | + // decrypt it |
|
672 | + $decrypted_text = mcrypt_decrypt( |
|
673 | + MCRYPT_RIJNDAEL_256, |
|
674 | + $this->get_encryption_key(), |
|
675 | + $encrypted_text, |
|
676 | + MCRYPT_MODE_ECB, |
|
677 | + $iv |
|
678 | + ); |
|
679 | + $decrypted_text = trim($decrypted_text); |
|
680 | + return $decrypted_text; |
|
681 | + } |
|
682 | 682 | |
683 | 683 | } |
684 | 684 | /* End of file EE_Encryption.class.php */ |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected function __construct() |
97 | 97 | { |
98 | - if (! defined('ESPRESSO_ENCRYPT')) { |
|
98 | + if ( ! defined('ESPRESSO_ENCRYPT')) { |
|
99 | 99 | define('ESPRESSO_ENCRYPT', true); |
100 | 100 | } |
101 | 101 | if (extension_loaded('openssl')) { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public static function instance() |
119 | 119 | { |
120 | 120 | // check if class object is instantiated |
121 | - if (! self::$_instance instanceof EE_Encryption) { |
|
121 | + if ( ! self::$_instance instanceof EE_Encryption) { |
|
122 | 122 | self::$_instance = new self(); |
123 | 123 | } |
124 | 124 | return self::$_instance; |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $iv |
315 | 315 | ); |
316 | 316 | // append the initialization vector |
317 | - $encrypted_text .= EE_Encryption::OPENSSL_IV_DELIMITER . $iv; |
|
317 | + $encrypted_text .= EE_Encryption::OPENSSL_IV_DELIMITER.$iv; |
|
318 | 318 | // trim and maybe encode |
319 | 319 | return $this->_use_base64_encode |
320 | 320 | ? trim(base64_encode($encrypted_text)) |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | */ |
338 | 338 | protected function getCipherMethod($cipher_method = EE_Encryption::OPENSSL_CIPHER_METHOD) |
339 | 339 | { |
340 | - if($this->cipher_method !== ''){ |
|
340 | + if ($this->cipher_method !== '') { |
|
341 | 341 | return $this->cipher_method; |
342 | 342 | } |
343 | 343 | // verify that the default cipher method can produce an initialization vector |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | // nope? okay let's get what we found in the past to work |
346 | 346 | $cipher_method = get_option(EE_Encryption::OPENSSL_CIPHER_METHOD_OPTION_NAME, ''); |
347 | 347 | // oops... haven't tested available cipher methods yet |
348 | - if($cipher_method === '' || openssl_cipher_iv_length($cipher_method) === false) { |
|
348 | + if ($cipher_method === '' || openssl_cipher_iv_length($cipher_method) === false) { |
|
349 | 349 | $cipher_method = $this->getAvailableCipherMethod($cipher_method); |
350 | 350 | } |
351 | 351 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | // then grab the first item from the list |
372 | 372 | $cipher_method = reset($this->cipher_methods); |
373 | 373 | } |
374 | - if($cipher_method === false){ |
|
374 | + if ($cipher_method === false) { |
|
375 | 375 | throw new RuntimeException( |
376 | 376 | esc_html__( |
377 | 377 | 'OpenSSL support appears to be enabled on the server, but no cipher methods are available. Please contact the server administrator.', |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | * @return string |
443 | 443 | * @throws RuntimeException |
444 | 444 | */ |
445 | - protected function getDigestHashValue($digest_method = EE_Encryption::OPENSSL_DIGEST_METHOD){ |
|
445 | + protected function getDigestHashValue($digest_method = EE_Encryption::OPENSSL_DIGEST_METHOD) { |
|
446 | 446 | $digest_hash_value = openssl_digest($this->get_encryption_key(), $digest_method); |
447 | 447 | if ($digest_hash_value === false) { |
448 | 448 | return $this->getDigestHashValue($this->getDigestMethod()); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | * @return string |
461 | 461 | * @throws \RuntimeException |
462 | 462 | */ |
463 | - protected function getDigestMethod(){ |
|
463 | + protected function getDigestMethod() { |
|
464 | 464 | $digest_method = prev($this->digest_methods); |
465 | 465 | if (empty($this->digest_methods)) { |
466 | 466 | $this->digest_methods = openssl_get_md_methods(); |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | if ( |
535 | 535 | $this->_use_mcrypt |
536 | 536 | && strpos($encrypted_text, EE_Encryption::ACME_ENCRYPTION_FLAG) === false |
537 | - ){ |
|
537 | + ) { |
|
538 | 538 | return $this->m_decrypt($encrypted_text); |
539 | 539 | } |
540 | 540 | $encrypted_text = substr($encrypted_text, 0, -4); |
@@ -564,16 +564,16 @@ discard block |
||
564 | 564 | protected function valid_base_64($string) |
565 | 565 | { |
566 | 566 | // ensure data is a string |
567 | - if (! is_string($string) || ! $this->_use_base64_encode) { |
|
567 | + if ( ! is_string($string) || ! $this->_use_base64_encode) { |
|
568 | 568 | return false; |
569 | 569 | } |
570 | 570 | $decoded = base64_decode($string, true); |
571 | 571 | // Check if there is no invalid character in string |
572 | - if (! preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $string)) { |
|
572 | + if ( ! preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $string)) { |
|
573 | 573 | return false; |
574 | 574 | } |
575 | 575 | // Decode the string in strict mode and send the response |
576 | - if (! base64_decode($string, true)) { |
|
576 | + if ( ! base64_decode($string, true)) { |
|
577 | 577 | return false; |
578 | 578 | } |
579 | 579 | // Encode and compare it to original one |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | $iterations = ceil($length / 40); |
595 | 595 | $random_string = ''; |
596 | 596 | for ($i = 0; $i < $iterations; $i++) { |
597 | - $random_string .= sha1(microtime(true) . mt_rand(10000, 90000)); |
|
597 | + $random_string .= sha1(microtime(true).mt_rand(10000, 90000)); |
|
598 | 598 | } |
599 | 599 | $random_string = substr($random_string, 0, $length); |
600 | 600 | return $random_string; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | - public function __construct( $routing = TRUE ) { |
|
36 | - parent::__construct( $routing ); |
|
37 | - define( 'EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'about/templates/' ); |
|
35 | + public function __construct($routing = TRUE) { |
|
36 | + parent::__construct($routing); |
|
37 | + define('EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'about/templates/'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | 42 | protected function _extend_page_config() { |
43 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'about'; |
|
43 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'about'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | protected function _set_page_routes() { |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | protected function _whats_new() { |
113 | 113 | $steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE; |
114 | 114 | $steps = $steps !== FALSE ? $steps : ''; |
115 | - $this->_admin_page_title = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
|
115 | + $this->_admin_page_title = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION); |
|
116 | 116 | $settings_message = $steps; |
117 | - $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso'). $settings_message ; |
|
118 | - $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php'; |
|
119 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
117 | + $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso').$settings_message; |
|
118 | + $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'whats_new.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH.'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH.'whats_new.template.php'; |
|
119 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
120 | 120 | $this->display_about_admin_page(); |
121 | 121 | } |
122 | 122 | |
@@ -124,32 +124,32 @@ discard block |
||
124 | 124 | protected function _overview() { |
125 | 125 | $this->_admin_page_title = __('About Event Espresso', 'event_espresso'); |
126 | 126 | $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso'); |
127 | - $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php' : EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php'; |
|
128 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
127 | + $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'ee4-overview.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH.'ee4-overview.template.php' : EE_ABOUT_TEMPLATE_PATH.'ee4-overview.template.php'; |
|
128 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
129 | 129 | $this->display_about_admin_page(); |
130 | 130 | } |
131 | 131 | |
132 | 132 | protected function _credits() { |
133 | 133 | // $this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
134 | 134 | $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso'); |
135 | - $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php'; |
|
136 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
135 | + $template = EE_ABOUT_TEMPLATE_PATH.'credits.template.php'; |
|
136 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
137 | 137 | $this->display_about_admin_page(); |
138 | 138 | } |
139 | 139 | |
140 | 140 | protected function _decafvpro() { |
141 | - $this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
|
141 | + $this->_template_args['admin_page_title'] = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION); |
|
142 | 142 | $this->_template_args['admin_page_subtitle'] = sprintf(__('Event Espresso lets you focus on doing %swhat you love%s — %sorganizing your events%s', 'event_espresso'), '<em>', '</em>', '<strong>', '</strong>'); |
143 | - $template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php'; |
|
144 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
143 | + $template = EE_ABOUT_TEMPLATE_PATH.'decafvpro.template.php'; |
|
144 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
145 | 145 | $this->display_about_admin_page(); |
146 | 146 | } |
147 | 147 | |
148 | 148 | protected function _reviews() { |
149 | 149 | $this->_template_args['admin_page_title'] = __('Rave Reviews About Event Espresso 4', 'event_espresso'); |
150 | 150 | $this->_template_args['admin_page_subtitle'] = __('At Event Espresso, customer satisfaction is our ultimate goal.', 'event_espresso'); |
151 | - $template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php'; |
|
152 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
151 | + $template = EE_ABOUT_TEMPLATE_PATH.'reviews.template.php'; |
|
152 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
153 | 153 | $this->display_about_admin_page(); |
154 | 154 | } |
155 | 155 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <div class="changelog"> |
2 | 2 | <h2 class="about-headline-callout"><?php esc_html_e('Welcome to Event Espresso 4!', 'event_espresso'); ?></h2> |
3 | - <p><?php echo sprintf( esc_html__('Manage your events from your WordPress dashboard. Reduce your admin, reduce your costs, make your life easier! This is the Caffeinated/Regular version of Event Espresso, but we also have a hosted version called %sEvent Smart%s for customers that want to cut back on their hosting and security expenses.', 'event_espresso'),'<a href="https://eventsmart.com//?utm_source=ee4_decaf&utm_medium=link&utm_campaign=espresso_about_tab&utm_content=EE4+Caffeinated">','</a>'); ?></p> |
|
3 | + <p><?php echo sprintf(esc_html__('Manage your events from your WordPress dashboard. Reduce your admin, reduce your costs, make your life easier! This is the Caffeinated/Regular version of Event Espresso, but we also have a hosted version called %sEvent Smart%s for customers that want to cut back on their hosting and security expenses.', 'event_espresso'), '<a href="https://eventsmart.com//?utm_source=ee4_decaf&utm_medium=link&utm_campaign=espresso_about_tab&utm_content=EE4+Caffeinated">', '</a>'); ?></p> |
|
4 | 4 | <h2><?php esc_html_e('Powering 40,000+ event websites; $100 million in ticket sales per year!', 'event_espresso'); ?></h2> |
5 | - <p><?php echo sprintf( esc_html__('Event Espresso is a %sWordPress event manager%s which makes it easy for you to register attendees for classes, workshops, events, trainings, conferences or concerts, all from your WordPress website. Event Espresso events are created from the WordPress admin area. You can create signup forms to collect information about your attendees, accept payments, and create reports. The lite version of the plugin provides everything that you need to manage your event using WordPress.', 'event_espresso'),'<a href="http://eventespresso.com/?utm_source=wordpress_org&utm_medium=link&utm_campaign=espresso_about_tab&utm_content=EE4+Decaf" rel="nofollow">','</a>'); ?></p> |
|
5 | + <p><?php echo sprintf(esc_html__('Event Espresso is a %sWordPress event manager%s which makes it easy for you to register attendees for classes, workshops, events, trainings, conferences or concerts, all from your WordPress website. Event Espresso events are created from the WordPress admin area. You can create signup forms to collect information about your attendees, accept payments, and create reports. The lite version of the plugin provides everything that you need to manage your event using WordPress.', 'event_espresso'), '<a href="http://eventespresso.com/?utm_source=wordpress_org&utm_medium=link&utm_campaign=espresso_about_tab&utm_content=EE4+Decaf" rel="nofollow">', '</a>'); ?></p> |
|
6 | 6 | <div class="feature-section col three-col about-updates"> |
7 | 7 | <div class="col-1"> |
8 | 8 | <img src="<?php echo EE_GLOBAL_ASSETS_URL; ?>images/screenshots/publish_meta_box.jpg"> |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | <h2 class="about-headline-callout"><?php esc_html_e('People Like You Manage Event Registration with WordPress', 'event_espresso'); ?></h2> |
61 | 61 | <div class="feature-section col two-col"> |
62 | 62 | <div class="grid_6"> |
63 | - <p><?php echo sprintf( esc_html__('Trusted by thousands, Event Espresso is the best WordPress event online registration and ticketing manager plugin–and the best supported with full-time support. Turn your existing blog or website into a %sfully-featured event management website%s and a new way to make money. With Event Espresso you get it all; everything from custom registration forms and emails, seating limits, multiple price options, and discount codes to printable tickets.', 'event_espresso'),'<strong>','</strong>'); ?></p> |
|
63 | + <p><?php echo sprintf(esc_html__('Trusted by thousands, Event Espresso is the best WordPress event online registration and ticketing manager plugin–and the best supported with full-time support. Turn your existing blog or website into a %sfully-featured event management website%s and a new way to make money. With Event Espresso you get it all; everything from custom registration forms and emails, seating limits, multiple price options, and discount codes to printable tickets.', 'event_espresso'), '<strong>', '</strong>'); ?></p> |
|
64 | 64 | <p><?php esc_html_e('Event Espresso works perfectly for classes, workshops, fundraisers, sporting, trainings, conferences, networking, religion, social, non-profit, and nearly any other type of event.', 'event_espresso'); ?></p> |
65 | 65 | </div> |
66 | 66 | <div class="grid_6"> |
67 | - <p><?php echo sprintf( esc_html__('Our online event registration software can %smake your organization more profitable and efficient%s by helping you save money on registration and ticketing fees, reduce the countless hours of time you spend manually processing registrations, create a “green” and paperless event registration process and you will be open for business to accept registrations and payment 24/7.', 'event_espresso'),'<strong>','</strong>'); ?></p> |
|
67 | + <p><?php echo sprintf(esc_html__('Our online event registration software can %smake your organization more profitable and efficient%s by helping you save money on registration and ticketing fees, reduce the countless hours of time you spend manually processing registrations, create a “green” and paperless event registration process and you will be open for business to accept registrations and payment 24/7.', 'event_espresso'), '<strong>', '</strong>'); ?></p> |
|
68 | 68 | <p><?php esc_html_e('If you\'re doing event registration and ticketing any other way, then you’re wasting time and money. We offer packages and prices to fit any budget, so get started with your online event registration and ticketing management system today.', 'event_espresso'); ?></p> |
69 | 69 | </div> |
70 | 70 | </div> |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | <h3><?php esc_html_e('Turn your blog into a complete event registration and management system', 'event_espresso'); ?></h3> |
75 | 75 | <p><?php esc_html_e('Create a beautiful event page with ticket selection, venue details, and an integrated single page checkout system. With WordPress, Event Espresso, and Espresso Arabica 2014 (based on the "Twenty Fourteen" theme by WordPress), your events will certainly sell out faster than ever!', 'event_espresso'); ?></p> |
76 | 76 | <p><?php esc_html_e('With a striking design that does not compromise the simplicity of WordPress and Event Espresso 4, Espresso Arabica 2014 will be the best event theme on the market.', 'event_espresso'); ?></p> |
77 | - <p><?php echo sprintf( esc_html__('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>' ); ?></p> |
|
77 | + <p><?php echo sprintf(esc_html__('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>'); ?></p> |
|
78 | 78 | </div> |
79 | 79 | <div><img src="<?php echo EE_GLOBAL_ASSETS_URL; ?>images/screenshots/single-event-page.jpg"></div> |
80 | 80 | </div> |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<h2 style="text-align: left;"><?php esc_html_e( 'Who uses Event Espresso?', 'event_espresso'); ?></h2> |
|
2 | -<p><?php echo sprintf( esc_html__('Event Espresso is used by over 40,000 event organizers across the world. They host %sconferences%s, %sart classes%s, training courses, concerts, fundraisers, workshops, %sfilm festivals%s, %spaint and wine%s, and more.', 'event_espresso'), '<a href="https://eventespresso.com/use-cases/conferences/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', '</a>', '<a href="https://eventespresso.com/use-cases/art-classes/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', '</a>','<a href="https://eventespresso.com/use-cases/film-festival-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">','</a>','<a href="https://eventespresso.com/use-cases/paint-wine-party-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">','</a>');?></p> |
|
1 | +<h2 style="text-align: left;"><?php esc_html_e('Who uses Event Espresso?', 'event_espresso'); ?></h2> |
|
2 | +<p><?php echo sprintf(esc_html__('Event Espresso is used by over 40,000 event organizers across the world. They host %sconferences%s, %sart classes%s, training courses, concerts, fundraisers, workshops, %sfilm festivals%s, %spaint and wine%s, and more.', 'event_espresso'), '<a href="https://eventespresso.com/use-cases/conferences/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', '</a>', '<a href="https://eventespresso.com/use-cases/art-classes/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', '</a>', '<a href="https://eventespresso.com/use-cases/film-festival-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', '</a>', '<a href="https://eventespresso.com/use-cases/paint-wine-party-ticketing-software/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', '</a>'); ?></p> |
|
3 | 3 | |
4 | 4 | <div class="changelog"> |
5 | 5 | <h2 class="about-headline-callout"><?php _e('Rave Reviews About Event Espresso 4', 'event_espresso'); ?></h2> |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | |
62 | 62 | </div> |
63 | 63 | <?php |
64 | - if ( !defined('EE_CAF_URL') ) { |
|
64 | + if ( ! defined('EE_CAF_URL')) { |
|
65 | 65 | ?> |
66 | - <div align="right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e( 'Upgrade Now!', 'event_espresso' ) ?></a></div> |
|
66 | + <div align="right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e('Upgrade Now!', 'event_espresso') ?></a></div> |
|
67 | 67 | <?php |
68 | 68 | } |
69 | 69 | ?> |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | |
125 | 125 | </div> |
126 | 126 | <?php |
127 | - if ( !defined('EE_CAF_URL') ) { |
|
127 | + if ( ! defined('EE_CAF_URL')) { |
|
128 | 128 | ?> |
129 | - <div align="right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e( 'Upgrade Now!', 'event_espresso' ) ?></a></div> |
|
129 | + <div align="right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e('Upgrade Now!', 'event_espresso') ?></a></div> |
|
130 | 130 | <?php |
131 | 131 | } |
132 | 132 | ?> |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | </div> |
180 | 180 | </div> |
181 | 181 | <?php |
182 | - if ( !defined('EE_CAF_URL') ) { |
|
182 | + if ( ! defined('EE_CAF_URL')) { |
|
183 | 183 | ?> |
184 | - <div align="right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e( 'Upgrade Now!', 'event_espresso' ) ?></a></div> |
|
184 | + <div align="right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=reviews+tab" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e('Upgrade Now!', 'event_espresso') ?></a></div> |
|
185 | 185 | <?php |
186 | 186 | } |
187 | 187 | ?> |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <div class="changelog"> |
2 | 2 | <?php |
3 | 3 | //maintenance mode on? |
4 | - if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) { |
|
4 | + if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
5 | 5 | ?> |
6 | 6 | <div class="ee-attention"> |
7 | - <h2 class="ee-maintenance-mode-callout"><?php esc_html_e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2> |
|
7 | + <h2 class="ee-maintenance-mode-callout"><?php esc_html_e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2> |
|
8 | 8 | <p> |
9 | 9 | <?php |
10 | 10 | printf( |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | ?> |
21 | 21 | |
22 | 22 | <h2 class="about-headline-callout"><?php esc_html_e('Welcome to the Decaf (free) Version of Event Espresso 4!', 'event_espresso'); ?></h2> |
23 | - <p><?php echo sprintf( esc_html__('Manage your events from your WordPress dashboard. Reduce your admin, reduce your costs, make your life easier! This is the Decaf version of Event Espresso, but we also have a premium version called %sEvent Espreso 4 Regular%s and a hosted version called %sEvent Smart%s (SaaS).', 'event_espresso'),'<a href="?page=espresso_about&action=decafvpro">','</a>','<a href="https://eventsmart.com//?utm_source=ee4_decaf&utm_medium=link&utm_campaign=espresso_about_tab&utm_content=EE4+Decaf">','</a>'); ?></p> |
|
23 | + <p><?php echo sprintf(esc_html__('Manage your events from your WordPress dashboard. Reduce your admin, reduce your costs, make your life easier! This is the Decaf version of Event Espresso, but we also have a premium version called %sEvent Espreso 4 Regular%s and a hosted version called %sEvent Smart%s (SaaS).', 'event_espresso'), '<a href="?page=espresso_about&action=decafvpro">', '</a>', '<a href="https://eventsmart.com//?utm_source=ee4_decaf&utm_medium=link&utm_campaign=espresso_about_tab&utm_content=EE4+Decaf">', '</a>'); ?></p> |
|
24 | 24 | <h2><?php esc_html_e('Powering 40,000+ event websites; $100 million in ticket sales per year!', 'event_espresso'); ?></h2> |
25 | - <p><?php echo sprintf( esc_html__('Event Espresso is a %sWordPress event manager%s which makes it easy for you to register attendees for classes, workshops, events, trainings, conferences or concerts, all from your WordPress website. Event Espresso events are created from the WordPress admin area. You can create signup forms to collect information about your attendees, accept payments, and create reports. The Decaf (free) version of the plugin provides everything that you need to manage your event using WordPress.', 'event_espresso'),'<a href="http://eventespresso.com/?utm_source=wordpress_org&utm_medium=link&utm_campaign=plugin_description_tab&utm_content=EE4+Decaf">','</a>'); ?></p> |
|
25 | + <p><?php echo sprintf(esc_html__('Event Espresso is a %sWordPress event manager%s which makes it easy for you to register attendees for classes, workshops, events, trainings, conferences or concerts, all from your WordPress website. Event Espresso events are created from the WordPress admin area. You can create signup forms to collect information about your attendees, accept payments, and create reports. The Decaf (free) version of the plugin provides everything that you need to manage your event using WordPress.', 'event_espresso'), '<a href="http://eventespresso.com/?utm_source=wordpress_org&utm_medium=link&utm_campaign=plugin_description_tab&utm_content=EE4+Decaf">', '</a>'); ?></p> |
|
26 | 26 | <div class="feature-section col three-col about-updates"> |
27 | 27 | <div class="col-1"> |
28 | 28 | <img src="<?php echo EE_GLOBAL_ASSETS_URL; ?>images/screenshots/publish_meta_box.jpg"> |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | <h2 class="about-headline-callout"><?php esc_html_e('People Like You Manage Event Registration with WordPress', 'event_espresso'); ?></h2> |
81 | 81 | <div class="feature-section col two-col"> |
82 | 82 | <div class="grid_6"> |
83 | - <p><?php echo sprintf( esc_html__('Trusted by thousands, Event Espresso is the best WordPress event online registration and ticketing manager plugin–and the best supported with full-time support. Turn your existing blog or website into a %sfully-featured event management website%s and a new way to make money. With Event Espresso you get it all; everything from custom registration forms and emails, seating limits, multiple price options, and discount codes to printable tickets.', 'event_espresso'),'<strong>','</strong>'); ?></p> |
|
83 | + <p><?php echo sprintf(esc_html__('Trusted by thousands, Event Espresso is the best WordPress event online registration and ticketing manager plugin–and the best supported with full-time support. Turn your existing blog or website into a %sfully-featured event management website%s and a new way to make money. With Event Espresso you get it all; everything from custom registration forms and emails, seating limits, multiple price options, and discount codes to printable tickets.', 'event_espresso'), '<strong>', '</strong>'); ?></p> |
|
84 | 84 | <p><?php esc_html_e('Event Espresso works perfectly for classes, workshops, fundraisers, sporting, trainings, conferences, networking, religion, social, non-profit, and nearly any other type of event.', 'event_espresso'); ?></p> |
85 | 85 | </div> |
86 | 86 | <div class="grid_6"> |
87 | - <p><?php echo sprintf( esc_html__('Our online event registration software can %smake your organization more profitable and efficient%s by helping you save money on registration and ticketing fees, reduce the countless hours of time you spend manually processing registrations, create a “green” and paperless event registration process and you will be open for business to accept registrations and payment 24/7.', 'event_espresso'),'<strong>','</strong>'); ?></p> |
|
87 | + <p><?php echo sprintf(esc_html__('Our online event registration software can %smake your organization more profitable and efficient%s by helping you save money on registration and ticketing fees, reduce the countless hours of time you spend manually processing registrations, create a “green” and paperless event registration process and you will be open for business to accept registrations and payment 24/7.', 'event_espresso'), '<strong>', '</strong>'); ?></p> |
|
88 | 88 | <p><?php esc_html_e('If you\'re doing event registration and ticketing any other way, then you’re wasting time and money. We offer packages and prices to fit any budget, so get started with your online event registration and ticketing management system today.', 'event_espresso'); ?></p> |
89 | 89 | </div> |
90 | 90 | </div> |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | <h3><?php esc_html_e('Turn your blog into a complete event registration and management system', 'event_espresso'); ?></h3> |
95 | 95 | <p><?php esc_html_e('Create a beautiful event page with ticket selection, venue details, and an integrated single page checkout system. With WordPress, Event Espresso, and Espresso Arabica 2014 (based on the "Twenty Fourteen" theme by WordPress), your events will certainly sell out faster than ever!', 'event_espresso'); ?></p> |
96 | 96 | <p><?php esc_html_e('With a striking design that does not compromise the simplicity of WordPress and Event Espresso 4, Espresso Arabica 2014 will be the best event theme on the market.', 'event_espresso'); ?></p> |
97 | - <p><?php echo sprintf( esc_html__('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>' ); ?></p> |
|
97 | + <p><?php echo sprintf(esc_html__('%sLearn more >>%s', 'event_espresso'), '<a href="http://eventespresso.com/wiki/setup-event-espresso-arabica-theme/">', '</a>'); ?></p> |
|
98 | 98 | </div> |
99 | 99 | <div><img src="<?php echo EE_GLOBAL_ASSETS_URL; ?>images/screenshots/single-event-page.jpg"></div> |
100 | 100 | </div> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<p><?php echo sprintf( esc_html__('We offer a free version of Event Espresso 4 called Decaf which is a good fit for basic events. Need more features like custom registration forms and advanced email notifications? %sUpgrade to Event Espresso 4 (Regular)%s.', 'event_espresso'),'<a href="https://eventespresso.com/pricing/?ee_ver=ee4&utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">','</a>');?><br> |
|
1 | +<p><?php echo sprintf(esc_html__('We offer a free version of Event Espresso 4 called Decaf which is a good fit for basic events. Need more features like custom registration forms and advanced email notifications? %sUpgrade to Event Espresso 4 (Regular)%s.', 'event_espresso'), '<a href="https://eventespresso.com/pricing/?ee_ver=ee4&utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular">', '</a>'); ?><br> |
|
2 | 2 | |
3 | 3 | <?php |
4 | 4 | |
@@ -8,43 +8,43 @@ discard block |
||
8 | 8 | |
9 | 9 | $features = array( |
10 | 10 | 'pricing-options' => array( |
11 | - 'label' => esc_html__( 'Handle multiple dates and pricing options', 'event_espresso' ), |
|
11 | + 'label' => esc_html__('Handle multiple dates and pricing options', 'event_espresso'), |
|
12 | 12 | 'decaf' => '<span class="dashicons dashicons-no-alt"></span>', |
13 | 13 | 'regular' => '<span class="dashicons dashicons-yes"></span></i>', |
14 | 14 | 'class' => 'alternate' |
15 | 15 | ), |
16 | 16 | 'custom-registration' => array( |
17 | - 'label' => esc_html__( 'Create custom registration forms', 'event_espresso' ), |
|
17 | + 'label' => esc_html__('Create custom registration forms', 'event_espresso'), |
|
18 | 18 | 'decaf' => '<span class="dashicons dashicons-no-alt"></span>', |
19 | 19 | 'regular' => '<span class="dashicons dashicons-yes"></span></i>', |
20 | 20 | 'class' => 'none' |
21 | 21 | ), |
22 | 22 | 'advanced-notifications' => array( |
23 | - 'label' => esc_html__( 'Customize advanced email notifications', 'event_espresso' ), |
|
23 | + 'label' => esc_html__('Customize advanced email notifications', 'event_espresso'), |
|
24 | 24 | 'decaf' => '<span class="dashicons dashicons-no-alt"></span>', |
25 | 25 | 'regular' => '<span class="dashicons dashicons-yes"></span></i>', |
26 | 26 | 'class' => 'alternate' |
27 | 27 | ), |
28 | 28 | 'manage-taxes' => array( |
29 | - 'label' => esc_html__( 'Manage taxes', 'event_espresso' ), |
|
29 | + 'label' => esc_html__('Manage taxes', 'event_espresso'), |
|
30 | 30 | 'decaf' => '<span class="dashicons dashicons-no-alt"></span>', |
31 | 31 | 'regular' => '<span class="dashicons dashicons-yes"></span></i>', |
32 | 32 | 'class' => 'none' |
33 | 33 | ), |
34 | 34 | 'typography' => array( |
35 | - 'label' => esc_html__( 'Additional payment methods available', 'event_espresso' ), |
|
35 | + 'label' => esc_html__('Additional payment methods available', 'event_espresso'), |
|
36 | 36 | 'decaf' => '<span class="dashicons dashicons-no-alt"></span>', |
37 | 37 | 'regular' => '<span class="dashicons dashicons-yes"></span></i>', |
38 | 38 | 'class' => 'alternate' |
39 | 39 | ), |
40 | 40 | 'add-on-compatibility' => array( |
41 | - 'label' => esc_html__( 'Compatibility with add-ons', 'event_espresso' ), |
|
41 | + 'label' => esc_html__('Compatibility with add-ons', 'event_espresso'), |
|
42 | 42 | 'decaf' => '<span class="dashicons dashicons-no-alt"></span>', |
43 | 43 | 'regular' => '<span class="dashicons dashicons-yes"></span></i>', |
44 | 44 | 'class' => 'none' |
45 | 45 | ), |
46 | 46 | 'best-support' => array( |
47 | - 'label' => esc_html__( 'Best in class support', 'event_espresso' ), |
|
47 | + 'label' => esc_html__('Best in class support', 'event_espresso'), |
|
48 | 48 | 'decaf' => '<span class="dashicons dashicons-no-alt"></span>', |
49 | 49 | 'regular' => '<span class="dashicons dashicons-yes"></span></i>', |
50 | 50 | 'class' => 'alternate' |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | <thead> |
57 | 57 | <tr> |
58 | 58 | <th></th> |
59 | - <th><?php esc_html_e( 'Decaf', 'event_espresso' ) ?></th> |
|
60 | - <th><?php esc_html_e( 'Regular', 'event_espresso' ) ?></th> |
|
59 | + <th><?php esc_html_e('Decaf', 'event_espresso') ?></th> |
|
60 | + <th><?php esc_html_e('Regular', 'event_espresso') ?></th> |
|
61 | 61 | </tr> |
62 | 62 | </thead> |
63 | 63 | <tbody> |
64 | - <?php foreach ( $features as $feature ): ?> |
|
64 | + <?php foreach ($features as $feature): ?> |
|
65 | 65 | <tr class="<?php echo $feature['class']; ?>"> |
66 | 66 | <td class="feature"> |
67 | 67 | <h3> |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | <?php endforeach; ?> |
79 | 79 | <tr> |
80 | 80 | <td></td> |
81 | - <td colspan="2" class="text-right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e( 'Upgrade Now!', 'event_espresso' ) ?></a></td> |
|
81 | + <td colspan="2" class="text-right"><a href="https://eventespresso.com/pricing/?utm_source=wordpress_org&utm_medium=link&utm_campaign=decaf_about_page&utm_content=Decaf+vs+Regular" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-cart"></span><?php esc_html_e('Upgrade Now!', 'event_espresso') ?></a></td> |
|
82 | 82 | </tr> |
83 | 83 | </tbody> |
84 | 84 | </table> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | //Copied from _whats_new() |
140 | 140 | $steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE; |
141 | 141 | $steps = $steps !== FALSE ? $steps : ''; |
142 | - $this->_admin_page_title = sprintf( esc_html__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
|
142 | + $this->_admin_page_title = sprintf(esc_html__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION); |
|
143 | 143 | $settings_message = $steps; |
144 | - $this->_template_args['admin_page_subtitle'] = esc_html__('Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso' ) . $settings_message; |
|
145 | - $template = EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php'; |
|
146 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
144 | + $this->_template_args['admin_page_subtitle'] = esc_html__('Thank you for choosing Event Espresso, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso').$settings_message; |
|
145 | + $template = EE_ABOUT_TEMPLATE_PATH.'ee4-overview.template.php'; |
|
146 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
147 | 147 | $this->display_about_admin_page(); |
148 | 148 | } |
149 | 149 | |
@@ -151,36 +151,36 @@ discard block |
||
151 | 151 | |
152 | 152 | protected function _get_started_steps() { |
153 | 153 | $steps = '<h2>'.esc_html__('Getting Started').'</h2>'; |
154 | - $step_one = '<p>'.sprintf( esc_html__('%sStep 1%s: Visit your %sOrganization Settings%s and add/update your details.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_general_settings">', '</a>') .'</strong></p>'; |
|
155 | - $step_two = '<p>'.sprintf( esc_html__('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_payment_settings">', '</a>') .'</strong></p>'; |
|
156 | - $step_three = '<p>'.sprintf( esc_html__('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_events&action=create_new">', '</a>') .'</strong></p>'; |
|
154 | + $step_one = '<p>'.sprintf(esc_html__('%sStep 1%s: Visit your %sOrganization Settings%s and add/update your details.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_general_settings">', '</a>').'</strong></p>'; |
|
155 | + $step_two = '<p>'.sprintf(esc_html__('%sStep 2%s: Setup your %sPayment Methods%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_payment_settings">', '</a>').'</strong></p>'; |
|
156 | + $step_three = '<p>'.sprintf(esc_html__('%sStep 3%s: Create your %sFirst Event%s.', 'event_espresso'), '<strong>', '</strong>', '<a href="admin.php?page=espresso_events&action=create_new">', '</a>').'</strong></p>'; |
|
157 | 157 | |
158 | 158 | //done? |
159 | 159 | $done_step_one = EE_Registry::instance()->CFG->organization->address_1 == '123 Onna Road' ? FALSE : TRUE; |
160 | - $active_invoice_pm = EEM_Payment_Method::instance()->get_one_active( EEM_Payment_Method::scope_cart, array( array( 'PMD_type' => 'Invoice' ) ) ); |
|
161 | - $active_pms_count = EEM_Payment_Method::instance()->count_active( EEM_Payment_Method::scope_cart ); |
|
160 | + $active_invoice_pm = EEM_Payment_Method::instance()->get_one_active(EEM_Payment_Method::scope_cart, array(array('PMD_type' => 'Invoice'))); |
|
161 | + $active_pms_count = EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart); |
|
162 | 162 | //done step two if a non-invoice paymetn method is active; or there is more than one PM active, or |
163 | 163 | //if only the invoice is active but it's clearly been updated |
164 | - $done_step_two = $active_pms_count > 1 || |
|
165 | - ( $active_pms_count === 1 && ! $active_invoice_pm ) || |
|
166 | - ( $active_invoice_pm instanceof EE_Payment_Method && ( |
|
167 | - $active_invoice_pm->get_extra_meta( 'pdf_payee_name', TRUE, '' ) || |
|
168 | - $active_invoice_pm->get_extra_meta( 'pdf_payee_email', TRUE, '' ) || |
|
169 | - $active_invoice_pm->get_extra_meta( 'pdf_payee_tax_number', TRUE, '' ) || |
|
170 | - $active_invoice_pm->get_extra_meta( 'pdf_payee_address', TRUE, '' ) || |
|
171 | - $active_invoice_pm->get_extra_meta( 'page_extra_info', TRUE, '' ) |
|
164 | + $done_step_two = $active_pms_count > 1 || |
|
165 | + ($active_pms_count === 1 && ! $active_invoice_pm) || |
|
166 | + ($active_invoice_pm instanceof EE_Payment_Method && ( |
|
167 | + $active_invoice_pm->get_extra_meta('pdf_payee_name', TRUE, '') || |
|
168 | + $active_invoice_pm->get_extra_meta('pdf_payee_email', TRUE, '') || |
|
169 | + $active_invoice_pm->get_extra_meta('pdf_payee_tax_number', TRUE, '') || |
|
170 | + $active_invoice_pm->get_extra_meta('pdf_payee_address', TRUE, '') || |
|
171 | + $active_invoice_pm->get_extra_meta('page_extra_info', TRUE, '') |
|
172 | 172 | ) |
173 | 173 | ); |
174 | 174 | $done_step_three = EE_Registry::instance()->load_model('Event')->count() > 0 ? TRUE : FALSE; |
175 | 175 | |
176 | 176 | //if ALL steps are done, let's just return FALSE so we don't display anything |
177 | - if ( $done_step_one && $done_step_two && $done_step_three ) |
|
177 | + if ($done_step_one && $done_step_two && $done_step_three) |
|
178 | 178 | return FALSE; |
179 | 179 | |
180 | 180 | //now let's put it together |
181 | - $steps .= sprintf( '%s' . $step_one . '%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>': '' ); |
|
182 | - $steps .= sprintf( '%s' . $step_two . '%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>': '' ); |
|
183 | - $steps .= sprintf( '%s' . $step_three . '%s', $done_step_three ? '<strike>' : '', $done_step_three ? '</strike>': '' ); |
|
181 | + $steps .= sprintf('%s'.$step_one.'%s', $done_step_one ? '<strike>' : '', $done_step_one ? '</strike>' : ''); |
|
182 | + $steps .= sprintf('%s'.$step_two.'%s', $done_step_two ? '<strike>' : '', $done_step_two ? '</strike>' : ''); |
|
183 | + $steps .= sprintf('%s'.$step_three.'%s', $done_step_three ? '<strike>' : '', $done_step_three ? '</strike>' : ''); |
|
184 | 184 | |
185 | 185 | return $steps; |
186 | 186 | } |
@@ -188,27 +188,27 @@ discard block |
||
188 | 188 | |
189 | 189 | |
190 | 190 | protected function _credits() { |
191 | - $this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
|
191 | + $this->_template_args['admin_page_title'] = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION); |
|
192 | 192 | $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso Decaf, the most powerful, and free, Event Management plugin for WordPress.', 'event_espresso'); |
193 | - $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php'; |
|
194 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
193 | + $template = EE_ABOUT_TEMPLATE_PATH.'credits.template.php'; |
|
194 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
195 | 195 | $this->display_about_admin_page(); |
196 | 196 | } |
197 | 197 | |
198 | 198 | |
199 | 199 | protected function _decafvpro() { |
200 | - $this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
|
200 | + $this->_template_args['admin_page_title'] = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION); |
|
201 | 201 | $this->_template_args['admin_page_subtitle'] = sprintf(__('Event Espresso lets you focus on doing %swhat you love%s — %sorganizing your events%s', 'event_espresso'), '<em>', '</em>', '<strong>', '</strong>'); |
202 | - $template = EE_ABOUT_TEMPLATE_PATH . 'decafvpro.template.php'; |
|
203 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
202 | + $template = EE_ABOUT_TEMPLATE_PATH.'decafvpro.template.php'; |
|
203 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
204 | 204 | $this->display_about_admin_page(); |
205 | 205 | } |
206 | 206 | |
207 | 207 | protected function _reviews() { |
208 | 208 | $this->_template_args['admin_page_title'] = __('Rave Reviews About Event Espresso 4', 'event_espresso'); |
209 | 209 | $this->_template_args['admin_page_subtitle'] = __('At Event Espresso, customer satisfaction is our ultimate goal.', 'event_espresso'); |
210 | - $template = EE_ABOUT_TEMPLATE_PATH . 'reviews.template.php'; |
|
211 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
210 | + $template = EE_ABOUT_TEMPLATE_PATH.'reviews.template.php'; |
|
211 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
212 | 212 | $this->display_about_admin_page(); |
213 | 213 | } |
214 | 214 |