@@ -15,20 +15,20 @@ discard block |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | // If this file is called directly, abort. |
18 | -if ( ! defined( 'WPINC' ) ) { |
|
18 | +if ( ! defined('WPINC')) { |
|
19 | 19 | die; |
20 | 20 | } |
21 | 21 | |
22 | 22 | ?> |
23 | 23 | <div class="wrap about-wrap"> |
24 | - <h1><?php esc_html_e( 'Welcome to Pronamic Pay', 'pronamic_ideal' ); ?></h1> |
|
24 | + <h1><?php esc_html_e('Welcome to Pronamic Pay', 'pronamic_ideal'); ?></h1> |
|
25 | 25 | |
26 | 26 | <div class="about-text"> |
27 | 27 | <?php |
28 | 28 | |
29 | 29 | printf( |
30 | - esc_html__( 'Thanks for installing Pronamic Pay. Version %s is more powerful, stable and secure than ever before. We hope you enjoy using it.', 'pronamic_ideal' ), |
|
31 | - esc_html( $this->plugin->get_version() ) |
|
30 | + esc_html__('Thanks for installing Pronamic Pay. Version %s is more powerful, stable and secure than ever before. We hope you enjoy using it.', 'pronamic_ideal'), |
|
31 | + esc_html($this->plugin->get_version()) |
|
32 | 32 | ); |
33 | 33 | |
34 | 34 | ?> |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | <?php |
39 | 39 | |
40 | 40 | printf( |
41 | - esc_html__( 'Version: %s', 'pronamic_ideal' ), |
|
42 | - esc_html( $this->plugin->get_version() ) |
|
41 | + esc_html__('Version: %s', 'pronamic_ideal'), |
|
42 | + esc_html($this->plugin->get_version()) |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | ?> |
@@ -49,27 +49,27 @@ discard block |
||
49 | 49 | <?php |
50 | 50 | |
51 | 51 | $tabs = array( |
52 | - 'new' => __( 'What is new', 'pronamic_ideal' ), |
|
53 | - 'getting-started' => __( 'Getting started', 'pronamic_ideal' ), |
|
52 | + 'new' => __('What is new', 'pronamic_ideal'), |
|
53 | + 'getting-started' => __('Getting started', 'pronamic_ideal'), |
|
54 | 54 | ); |
55 | 55 | |
56 | - $current_tab = filter_input( INPUT_GET, 'tab', FILTER_SANITIZE_STRING ); |
|
57 | - $current_tab = empty( $current_tab ) ? key( $tabs ) : $current_tab; |
|
56 | + $current_tab = filter_input(INPUT_GET, 'tab', FILTER_SANITIZE_STRING); |
|
57 | + $current_tab = empty($current_tab) ? key($tabs) : $current_tab; |
|
58 | 58 | |
59 | - foreach ( $tabs as $tab => $title ) { |
|
60 | - $classes = array( 'nav-tab' ); |
|
59 | + foreach ($tabs as $tab => $title) { |
|
60 | + $classes = array('nav-tab'); |
|
61 | 61 | |
62 | - if ( $current_tab === $tab ) { |
|
62 | + if ($current_tab === $tab) { |
|
63 | 63 | $classes[] = 'nav-tab-active'; |
64 | 64 | } |
65 | 65 | |
66 | - $url = add_query_arg( 'tab', $tab ); |
|
66 | + $url = add_query_arg('tab', $tab); |
|
67 | 67 | |
68 | 68 | printf( |
69 | 69 | '<a class="nav-tab %s" href="%s">%s</a>', |
70 | - esc_attr( implode( ' ', $classes ) ), |
|
71 | - esc_attr( $url ), |
|
72 | - esc_html( $title ) |
|
70 | + esc_attr(implode(' ', $classes)), |
|
71 | + esc_attr($url), |
|
72 | + esc_html($title) |
|
73 | 73 | ); |
74 | 74 | } |
75 | 75 | |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | |
79 | 79 | <?php |
80 | 80 | |
81 | - $file = plugin_dir_path( Plugin::$file ) . 'admin/tab-' . $current_tab . '.php'; |
|
81 | + $file = plugin_dir_path(Plugin::$file) . 'admin/tab-' . $current_tab . '.php'; |
|
82 | 82 | |
83 | - if ( is_readable( $file ) ) { |
|
83 | + if (is_readable($file)) { |
|
84 | 84 | include $file; |
85 | 85 | } |
86 | 86 |
@@ -19,12 +19,12 @@ discard block |
||
19 | 19 | <select id="pronamic-subscription-status" name="post_status" class="medium-text"> |
20 | 20 | <?php |
21 | 21 | |
22 | - foreach ( $states as $status => $label ) { |
|
22 | + foreach ($states as $status => $label) { |
|
23 | 23 | printf( |
24 | 24 | '<option value="%s" %s>%s</option>', |
25 | - esc_attr( $status ), |
|
26 | - selected( $status, $post->post_status, false ), |
|
27 | - esc_html( $label ) |
|
25 | + esc_attr($status), |
|
26 | + selected($status, $post->post_status, false), |
|
27 | + esc_html($label) |
|
28 | 28 | ); |
29 | 29 | } |
30 | 30 | |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | <div class="pronamic-pay-action"> |
38 | 38 | <?php |
39 | 39 | |
40 | - wp_nonce_field( 'pronamic_subscription_update', 'pronamic_subscription_nonce' ); |
|
40 | + wp_nonce_field('pronamic_subscription_update', 'pronamic_subscription_nonce'); |
|
41 | 41 | |
42 | 42 | submit_button( |
43 | - __( 'Update', 'pronamic_ideal' ), |
|
43 | + __('Update', 'pronamic_ideal'), |
|
44 | 44 | 'primary', |
45 | 45 | 'pronamic_subscription_update', |
46 | 46 | false |
@@ -12,19 +12,19 @@ |
||
12 | 12 | <div class="pronamic-pay-status-widget"> |
13 | 13 | <ul class="pronamic-pay-status-list"> |
14 | 14 | |
15 | - <?php foreach ( $states as $status => $label ) : ?> |
|
15 | + <?php foreach ($states as $status => $label) : ?> |
|
16 | 16 | |
17 | - <li class="<?php echo esc_attr( 'payment_status-' . $status ); ?>"> |
|
18 | - <a href="<?php echo esc_attr( add_query_arg( 'post_status', $status, $url ) ); ?>"> |
|
17 | + <li class="<?php echo esc_attr('payment_status-' . $status); ?>"> |
|
18 | + <a href="<?php echo esc_attr(add_query_arg('post_status', $status, $url)); ?>"> |
|
19 | 19 | <?php |
20 | 20 | |
21 | - $count = isset( $counts->$status ) ? $counts->$status : 0; |
|
21 | + $count = isset($counts->$status) ? $counts->$status : 0; |
|
22 | 22 | |
23 | 23 | printf( // WPCS: XSS ok. |
24 | 24 | $label, |
25 | 25 | '<strong>' . sprintf( |
26 | - esc_html( _n( '%s payment', '%s payments', $count, 'pronamic_ideal' ) ), |
|
27 | - esc_html( number_format_i18n( $count ) ) |
|
26 | + esc_html(_n('%s payment', '%s payments', $count, 'pronamic_ideal')), |
|
27 | + esc_html(number_format_i18n($count)) |
|
28 | 28 | ) . '</strong>' |
29 | 29 | ); |
30 | 30 |
@@ -12,35 +12,35 @@ discard block |
||
12 | 12 | <table class="pronamic-pay-table pronamic-pay-status-table widefat"> |
13 | 13 | <thead> |
14 | 14 | <tr> |
15 | - <th colspan="3"><?php esc_html_e( 'License', 'pronamic_ideal' ); ?></th> |
|
15 | + <th colspan="3"><?php esc_html_e('License', 'pronamic_ideal'); ?></th> |
|
16 | 16 | </tr> |
17 | 17 | </thead> |
18 | 18 | |
19 | 19 | <tbody> |
20 | 20 | <tr> |
21 | 21 | <th scope="row"> |
22 | - <?php esc_html_e( 'License Status', 'pronamic_ideal' ); ?> |
|
22 | + <?php esc_html_e('License Status', 'pronamic_ideal'); ?> |
|
23 | 23 | </th> |
24 | 24 | <td> |
25 | 25 | <?php |
26 | 26 | |
27 | - $status = get_option( 'pronamic_pay_license_status' ); |
|
27 | + $status = get_option('pronamic_pay_license_status'); |
|
28 | 28 | |
29 | - switch ( $status ) { |
|
29 | + switch ($status) { |
|
30 | 30 | case 'valid': |
31 | - esc_html_e( 'Valid', 'pronamic_ideal' ); |
|
31 | + esc_html_e('Valid', 'pronamic_ideal'); |
|
32 | 32 | |
33 | 33 | break; |
34 | 34 | case 'invalid': |
35 | - esc_html_e( 'Invalid', 'pronamic_ideal' ); |
|
35 | + esc_html_e('Invalid', 'pronamic_ideal'); |
|
36 | 36 | |
37 | 37 | break; |
38 | 38 | case 'site_inactive': |
39 | - esc_html_e( 'Site Inactive', 'pronamic_ideal' ); |
|
39 | + esc_html_e('Site Inactive', 'pronamic_ideal'); |
|
40 | 40 | |
41 | 41 | break; |
42 | 42 | default: |
43 | - echo esc_html( $status ); |
|
43 | + echo esc_html($status); |
|
44 | 44 | |
45 | 45 | break; |
46 | 46 | } |
@@ -50,19 +50,19 @@ discard block |
||
50 | 50 | </tr> |
51 | 51 | <tr> |
52 | 52 | <th scope="row"> |
53 | - <?php esc_html_e( 'Next License Check', 'pronamic_ideal' ); ?> |
|
53 | + <?php esc_html_e('Next License Check', 'pronamic_ideal'); ?> |
|
54 | 54 | </th> |
55 | 55 | <td> |
56 | 56 | <?php |
57 | 57 | |
58 | - $timestamp = wp_next_scheduled( 'pronamic_pay_license_check' ); |
|
58 | + $timestamp = wp_next_scheduled('pronamic_pay_license_check'); |
|
59 | 59 | |
60 | - if ( $timestamp ) { |
|
61 | - $timestamp = get_date_from_gmt( date( 'Y-m-d H:i:s', $timestamp ), 'U' ); |
|
60 | + if ($timestamp) { |
|
61 | + $timestamp = get_date_from_gmt(date('Y-m-d H:i:s', $timestamp), 'U'); |
|
62 | 62 | |
63 | - echo esc_html( date_i18n( 'D j M Y H:i:s', $timestamp ) ); |
|
63 | + echo esc_html(date_i18n('D j M Y H:i:s', $timestamp)); |
|
64 | 64 | } else { |
65 | - esc_html_e( 'Not scheduled', 'pronamic_ideal' ); |
|
65 | + esc_html_e('Not scheduled', 'pronamic_ideal'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | ?> |
@@ -74,17 +74,17 @@ discard block |
||
74 | 74 | <table class="pronamic-pay-table pronamic-pay-status-table widefat"> |
75 | 75 | <thead> |
76 | 76 | <tr> |
77 | - <th colspan="3"><?php esc_html_e( 'WordPress Environment', 'pronamic_ideal' ); ?></th> |
|
77 | + <th colspan="3"><?php esc_html_e('WordPress Environment', 'pronamic_ideal'); ?></th> |
|
78 | 78 | </tr> |
79 | 79 | </thead> |
80 | 80 | |
81 | 81 | <tbody> |
82 | 82 | <tr> |
83 | 83 | <th scope="row"> |
84 | - <?php esc_html_e( 'Site URL', 'pronamic_ideal' ); ?> |
|
84 | + <?php esc_html_e('Site URL', 'pronamic_ideal'); ?> |
|
85 | 85 | </th> |
86 | 86 | <td> |
87 | - <?php echo esc_html( site_url() ); ?> |
|
87 | + <?php echo esc_html(site_url()); ?> |
|
88 | 88 | </td> |
89 | 89 | <td> |
90 | 90 | ✓ |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | </tr> |
93 | 93 | <tr class="alternate"> |
94 | 94 | <th scope="row"> |
95 | - <?php esc_html_e( 'Home URL', 'pronamic_ideal' ); ?> |
|
95 | + <?php esc_html_e('Home URL', 'pronamic_ideal'); ?> |
|
96 | 96 | </th> |
97 | 97 | <td> |
98 | - <?php echo esc_html( home_url() ); ?> |
|
98 | + <?php echo esc_html(home_url()); ?> |
|
99 | 99 | </td> |
100 | 100 | <td> |
101 | 101 | ✓ |
@@ -103,18 +103,18 @@ discard block |
||
103 | 103 | </tr> |
104 | 104 | <tr> |
105 | 105 | <th scope="row"> |
106 | - <?php esc_html_e( 'PHP Version', 'pronamic_ideal' ); ?> |
|
106 | + <?php esc_html_e('PHP Version', 'pronamic_ideal'); ?> |
|
107 | 107 | </th> |
108 | 108 | <td> |
109 | - <?php echo esc_html( phpversion() ); ?> |
|
109 | + <?php echo esc_html(phpversion()); ?> |
|
110 | 110 | </td> |
111 | 111 | <td> |
112 | 112 | <?php |
113 | 113 | |
114 | - if ( version_compare( phpversion(), '5.2', '>' ) ) { |
|
114 | + if (version_compare(phpversion(), '5.2', '>')) { |
|
115 | 115 | echo '✓'; |
116 | 116 | } else { |
117 | - esc_html_e( 'Pronamic Pay requires PHP 5.2 or above.', 'pronamic_ideal' ); |
|
117 | + esc_html_e('Pronamic Pay requires PHP 5.2 or above.', 'pronamic_ideal'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | ?> |
@@ -122,24 +122,24 @@ discard block |
||
122 | 122 | </tr> |
123 | 123 | <tr class="alternate"> |
124 | 124 | <th scope="row"> |
125 | - <?php esc_html_e( 'MySQL Version', 'pronamic_ideal' ); ?> |
|
125 | + <?php esc_html_e('MySQL Version', 'pronamic_ideal'); ?> |
|
126 | 126 | </th> |
127 | 127 | <td> |
128 | 128 | <?php |
129 | 129 | |
130 | 130 | global $wpdb; |
131 | 131 | |
132 | - echo esc_html( $wpdb->db_version() ); |
|
132 | + echo esc_html($wpdb->db_version()); |
|
133 | 133 | |
134 | 134 | ?> |
135 | 135 | </td> |
136 | 136 | <td> |
137 | 137 | <?php |
138 | 138 | |
139 | - if ( version_compare( $wpdb->db_version(), '5', '>' ) ) { |
|
139 | + if (version_compare($wpdb->db_version(), '5', '>')) { |
|
140 | 140 | echo '✓'; |
141 | 141 | } else { |
142 | - esc_html_e( 'Pronamic Pay requires MySQL 5 or above.', 'pronamic_ideal' ); |
|
142 | + esc_html_e('Pronamic Pay requires MySQL 5 or above.', 'pronamic_ideal'); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | ?> |
@@ -147,18 +147,18 @@ discard block |
||
147 | 147 | </tr> |
148 | 148 | <tr> |
149 | 149 | <th scope="row"> |
150 | - <?php esc_html_e( 'WordPress Version', 'pronamic_ideal' ); ?> |
|
150 | + <?php esc_html_e('WordPress Version', 'pronamic_ideal'); ?> |
|
151 | 151 | </th> |
152 | 152 | <td> |
153 | - <?php echo esc_html( get_bloginfo( 'version' ) ); ?> |
|
153 | + <?php echo esc_html(get_bloginfo('version')); ?> |
|
154 | 154 | </td> |
155 | 155 | <td> |
156 | 156 | <?php |
157 | 157 | |
158 | - if ( version_compare( get_bloginfo( 'version' ), '3.2', '>' ) ) { |
|
158 | + if (version_compare(get_bloginfo('version'), '3.2', '>')) { |
|
159 | 159 | echo '✓'; |
160 | 160 | } else { |
161 | - esc_html_e( 'Pronamic Pay requires WordPress 3.2 or above.', 'pronamic_ideal' ); |
|
161 | + esc_html_e('Pronamic Pay requires WordPress 3.2 or above.', 'pronamic_ideal'); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | ?> |
@@ -166,27 +166,27 @@ discard block |
||
166 | 166 | </tr> |
167 | 167 | <tr class="alternate"> |
168 | 168 | <th scope="row"> |
169 | - <?php esc_html_e( 'WP Memory Limit', 'pronamic_ideal' ); ?> |
|
169 | + <?php esc_html_e('WP Memory Limit', 'pronamic_ideal'); ?> |
|
170 | 170 | </th> |
171 | 171 | <td> |
172 | 172 | <?php |
173 | 173 | |
174 | - $memory = pronamic_pay_let_to_num( WP_MEMORY_LIMIT ); |
|
174 | + $memory = pronamic_pay_let_to_num(WP_MEMORY_LIMIT); |
|
175 | 175 | |
176 | - echo esc_html( size_format( $memory ) ); |
|
176 | + echo esc_html(size_format($memory)); |
|
177 | 177 | |
178 | 178 | ?> |
179 | 179 | </td> |
180 | 180 | <td> |
181 | 181 | <?php |
182 | 182 | |
183 | - if ( $memory >= 67108864 ) { // 64 MB |
|
183 | + if ($memory >= 67108864) { // 64 MB |
|
184 | 184 | echo '✓'; |
185 | 185 | } else { |
186 | 186 | echo wp_kses( |
187 | 187 | sprintf( |
188 | - __( 'We recommend setting memory to at least 64MB. See: <a href="%s" target="_blank">Increasing memory allocated to PHP</a>', 'pronamic_ideal' ), |
|
189 | - esc_attr( 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) |
|
188 | + __('We recommend setting memory to at least 64MB. See: <a href="%s" target="_blank">Increasing memory allocated to PHP</a>', 'pronamic_ideal'), |
|
189 | + esc_attr('http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP') |
|
190 | 190 | ), |
191 | 191 | array( |
192 | 192 | 'a' => array( |
@@ -202,19 +202,19 @@ discard block |
||
202 | 202 | </tr> |
203 | 203 | <tr> |
204 | 204 | <th scope="row"> |
205 | - <?php esc_html_e( 'Character Set', 'pronamic_ideal' ); ?> |
|
205 | + <?php esc_html_e('Character Set', 'pronamic_ideal'); ?> |
|
206 | 206 | </th> |
207 | 207 | <td> |
208 | - <?php bloginfo( 'charset' ); ?> |
|
208 | + <?php bloginfo('charset'); ?> |
|
209 | 209 | </td> |
210 | 210 | <td> |
211 | 211 | <?php |
212 | 212 | |
213 | 213 | // @see http://codex.wordpress.org/Function_Reference/bloginfo#Show_Character_Set |
214 | - if ( 0 === strcasecmp( get_bloginfo( 'charset' ), 'UTF-8' ) ) { |
|
214 | + if (0 === strcasecmp(get_bloginfo('charset'), 'UTF-8')) { |
|
215 | 215 | echo '✓'; |
216 | 216 | } else { |
217 | - esc_html_e( 'Pronamic Pay advices to set the character encoding to UTF-8.', 'pronamic_ideal' ); |
|
217 | + esc_html_e('Pronamic Pay advices to set the character encoding to UTF-8.', 'pronamic_ideal'); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | ?> |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | </tr> |
223 | 223 | <tr class="alternate"> |
224 | 224 | <th scope="row"> |
225 | - <?php esc_html_e( 'Time', 'pronamic_ideal' ); ?> |
|
225 | + <?php esc_html_e('Time', 'pronamic_ideal'); ?> |
|
226 | 226 | </th> |
227 | 227 | <td> |
228 | - <?php echo esc_html( date( __( 'Y/m/d g:i:s A', 'pronamic_ideal' ) ) ); ?> |
|
228 | + <?php echo esc_html(date(__('Y/m/d g:i:s A', 'pronamic_ideal'))); ?> |
|
229 | 229 | </td> |
230 | 230 | <td> |
231 | 231 | ✓ |
@@ -233,20 +233,20 @@ discard block |
||
233 | 233 | </tr> |
234 | 234 | <tr> |
235 | 235 | <th scope="row"> |
236 | - <?php esc_html_e( 'cURL', 'pronamic_ideal' ); ?> |
|
236 | + <?php esc_html_e('cURL', 'pronamic_ideal'); ?> |
|
237 | 237 | </th> |
238 | 238 | <td> |
239 | 239 | <?php |
240 | 240 | |
241 | - if ( function_exists( 'curl_version' ) ) { |
|
241 | + if (function_exists('curl_version')) { |
|
242 | 242 | // @codingStandardsIgnoreStart |
243 | 243 | // Using cURL functions is highly discouraged within VIP context |
244 | 244 | // We only use this cURL function for on the system status page |
245 | 245 | $version = curl_version(); |
246 | 246 | // @codingStandardsIgnoreEnd |
247 | 247 | |
248 | - if ( isset( $version['version'] ) ) { |
|
249 | - echo esc_html( $version['version'] ); |
|
248 | + if (isset($version['version'])) { |
|
249 | + echo esc_html($version['version']); |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
@@ -258,13 +258,13 @@ discard block |
||
258 | 258 | </tr> |
259 | 259 | <tr class="alternate"> |
260 | 260 | <th scope="row"> |
261 | - <?php esc_html_e( 'OpenSSL', 'pronamic_ideal' ); ?> |
|
261 | + <?php esc_html_e('OpenSSL', 'pronamic_ideal'); ?> |
|
262 | 262 | </th> |
263 | 263 | <td> |
264 | 264 | <?php |
265 | 265 | |
266 | - if ( defined( 'OPENSSL_VERSION_TEXT' ) ) { |
|
267 | - echo esc_html( OPENSSL_VERSION_TEXT ); |
|
266 | + if (defined('OPENSSL_VERSION_TEXT')) { |
|
267 | + echo esc_html(OPENSSL_VERSION_TEXT); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | // @see https://www.openssl.org/docs/crypto/OPENSSL_VERSION_NUMBER.html |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | <td> |
276 | 276 | <?php |
277 | 277 | |
278 | - if ( version_compare( OPENSSL_VERSION_NUMBER, 0x000908000, '>' ) ) { |
|
278 | + if (version_compare(OPENSSL_VERSION_NUMBER, 0x000908000, '>')) { |
|
279 | 279 | echo '✓'; |
280 | 280 | } else { |
281 | - esc_html_e( 'Pronamic Pay requires OpenSSL 0.9.8 or above.', 'pronamic_ideal' ); |
|
281 | + esc_html_e('Pronamic Pay requires OpenSSL 0.9.8 or above.', 'pronamic_ideal'); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | ?> |
@@ -286,24 +286,24 @@ discard block |
||
286 | 286 | </tr> |
287 | 287 | <tr> |
288 | 288 | <th scope="row"> |
289 | - <?php esc_html_e( 'Registered Hashing Algorithms', 'pronamic_ideal' ); ?> |
|
289 | + <?php esc_html_e('Registered Hashing Algorithms', 'pronamic_ideal'); ?> |
|
290 | 290 | </th> |
291 | 291 | <td> |
292 | 292 | <?php |
293 | 293 | |
294 | 294 | $algorithms = hash_algos(); |
295 | 295 | |
296 | - echo esc_html( implode( ', ', $algorithms ) ); |
|
296 | + echo esc_html(implode(', ', $algorithms)); |
|
297 | 297 | |
298 | 298 | ?> |
299 | 299 | </td> |
300 | 300 | <td> |
301 | 301 | <?php |
302 | 302 | |
303 | - if ( in_array( 'sha1', $algorithms, true ) ) { |
|
303 | + if (in_array('sha1', $algorithms, true)) { |
|
304 | 304 | echo '✓'; |
305 | 305 | } else { |
306 | - esc_html_e( 'Pronamic Pay requires the "sha1" hashing algorithm.', 'pronamic_ideal' ); |
|
306 | + esc_html_e('Pronamic Pay requires the "sha1" hashing algorithm.', 'pronamic_ideal'); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | ?> |
@@ -311,18 +311,18 @@ discard block |
||
311 | 311 | </tr> |
312 | 312 | <tr class="alternate"> |
313 | 313 | <th scope="row"> |
314 | - <?php esc_html_e( 'Travis CI build status', 'pronamic_ideal' ); ?> |
|
314 | + <?php esc_html_e('Travis CI build status', 'pronamic_ideal'); ?> |
|
315 | 315 | </th> |
316 | 316 | <td> |
317 | 317 | <?php |
318 | 318 | |
319 | 319 | global $pronamic_pay_version; |
320 | 320 | |
321 | - $url = add_query_arg( 'branch', $pronamic_pay_version, 'https://travis-ci.org/pronamic/wp-pronamic-ideal.png' ); |
|
321 | + $url = add_query_arg('branch', $pronamic_pay_version, 'https://travis-ci.org/pronamic/wp-pronamic-ideal.png'); |
|
322 | 322 | |
323 | 323 | ?> |
324 | 324 | <a href="https://travis-ci.org/pronamic/wp-pronamic-ideal"> |
325 | - <img src="<?php echo esc_attr( $url ); ?>" alt="" /> |
|
325 | + <img src="<?php echo esc_attr($url); ?>" alt="" /> |
|
326 | 326 | </a> |
327 | 327 | </td> |
328 | 328 | <td> |
@@ -334,24 +334,24 @@ discard block |
||
334 | 334 | |
335 | 335 | <?php |
336 | 336 | |
337 | -$data = get_transient( 'pronamic_pay_ideal_issuers_status' ); |
|
337 | +$data = get_transient('pronamic_pay_ideal_issuers_status'); |
|
338 | 338 | |
339 | -if ( ! $data ) { |
|
339 | +if ( ! $data) { |
|
340 | 340 | |
341 | 341 | $url = 'http://www.ideal-status.nl/static/issuers_current.json'; |
342 | 342 | |
343 | - $response = wp_remote_get( $url ); |
|
343 | + $response = wp_remote_get($url); |
|
344 | 344 | |
345 | 345 | $status_data = null; |
346 | 346 | |
347 | - if ( ! is_wp_error( $response ) ) { |
|
348 | - if ( 200 === wp_remote_retrieve_response_code( $response ) ) { |
|
349 | - $body = wp_remote_retrieve_body( $response ); |
|
347 | + if ( ! is_wp_error($response)) { |
|
348 | + if (200 === wp_remote_retrieve_response_code($response)) { |
|
349 | + $body = wp_remote_retrieve_body($response); |
|
350 | 350 | |
351 | - $data = json_decode( $body ); |
|
351 | + $data = json_decode($body); |
|
352 | 352 | |
353 | - if ( false !== $data ) { |
|
354 | - set_transient( 'pronamic_pay_ideal_issuers_status', $data, 30 ); |
|
353 | + if (false !== $data) { |
|
354 | + set_transient('pronamic_pay_ideal_issuers_status', $data, 30); |
|
355 | 355 | } |
356 | 356 | } |
357 | 357 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | <thead> |
364 | 364 | <tr> |
365 | 365 | <th colspan="5"> |
366 | - <?php esc_html_e( 'iDEAL issuers status', 'pronamic_ideal' ); ?> |
|
366 | + <?php esc_html_e('iDEAL issuers status', 'pronamic_ideal'); ?> |
|
367 | 367 | |
368 | 368 | — |
369 | 369 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | |
372 | 372 | echo wp_kses( |
373 | 373 | sprintf( |
374 | - __( 'monitored by <a href="%s" target="_blank">iDEAL-status.nl</a>', 'pronamic_ideal' ), |
|
374 | + __('monitored by <a href="%s" target="_blank">iDEAL-status.nl</a>', 'pronamic_ideal'), |
|
375 | 375 | 'http://www.ideal-status.nl/' |
376 | 376 | ), |
377 | 377 | array( |
@@ -387,46 +387,46 @@ discard block |
||
387 | 387 | </tr> |
388 | 388 | <tr class="alternate"> |
389 | 389 | <th scope="col"> |
390 | - <?php esc_html_e( 'Issuer', 'pronamic_ideal' ); ?> |
|
390 | + <?php esc_html_e('Issuer', 'pronamic_ideal'); ?> |
|
391 | 391 | </th> |
392 | 392 | <th scope="col"> |
393 | - <?php esc_html_e( 'Success', 'pronamic_ideal' ); ?> |
|
393 | + <?php esc_html_e('Success', 'pronamic_ideal'); ?> |
|
394 | 394 | </th> |
395 | 395 | <th scope="col"> |
396 | - <?php esc_html_e( 'Failure', 'pronamic_ideal' ); ?> |
|
396 | + <?php esc_html_e('Failure', 'pronamic_ideal'); ?> |
|
397 | 397 | </th> |
398 | 398 | <th scope="col"> |
399 | - <?php esc_html_e( 'Date', 'pronamic_ideal' ); ?> |
|
399 | + <?php esc_html_e('Date', 'pronamic_ideal'); ?> |
|
400 | 400 | </th> |
401 | 401 | </tr> |
402 | 402 | </thead> |
403 | 403 | |
404 | 404 | <tbody> |
405 | 405 | |
406 | - <?php if ( is_object( $data ) ) : ?> |
|
406 | + <?php if (is_object($data)) : ?> |
|
407 | 407 | |
408 | 408 | <?php $alternate = true; ?> |
409 | 409 | |
410 | - <?php foreach ( $data as $status ) : ?> |
|
410 | + <?php foreach ($data as $status) : ?> |
|
411 | 411 | |
412 | 412 | <?php $alternate = ! $alternate; ?> |
413 | 413 | |
414 | - <tr<?php if ( $alternate ) : ?> class="alternate"<?php endif; ?>> |
|
414 | + <tr<?php if ($alternate) : ?> class="alternate"<?php endif; ?>> |
|
415 | 415 | <td> |
416 | - <small><?php echo esc_html( $status->issuer_id ); ?></small> |
|
416 | + <small><?php echo esc_html($status->issuer_id); ?></small> |
|
417 | 417 | |
418 | 418 | – |
419 | 419 | |
420 | - <?php echo esc_html( $status->issuer_name ); ?> |
|
420 | + <?php echo esc_html($status->issuer_name); ?> |
|
421 | 421 | </td> |
422 | 422 | <td> |
423 | - <?php echo esc_html( number_format( $status->rate_success * 100, 1, ',', '.' ) ); ?>% |
|
423 | + <?php echo esc_html(number_format($status->rate_success * 100, 1, ',', '.')); ?>% |
|
424 | 424 | </td> |
425 | 425 | <td> |
426 | - <?php echo esc_html( number_format( $status->rate_failure * 100, 1, ',', '.' ) ); ?>% |
|
426 | + <?php echo esc_html(number_format($status->rate_failure * 100, 1, ',', '.')); ?>% |
|
427 | 427 | </td> |
428 | 428 | <td> |
429 | - <?php echo esc_html( $status->datetime ); ?> |
|
429 | + <?php echo esc_html($status->datetime); ?> |
|
430 | 430 | </td> |
431 | 431 | </tr> |
432 | 432 |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | * @package Pronamic\WordPress\Pay |
9 | 9 | */ |
10 | 10 | |
11 | -if ( ! defined( 'WPINC' ) ) { |
|
11 | +if ( ! defined('WPINC')) { |
|
12 | 12 | die; |
13 | 13 | } |
14 | 14 | |
15 | 15 | ?> |
16 | 16 | <div class="feature-section two-col"> |
17 | 17 | <div class="col"> |
18 | - <h3><?php esc_html_e( 'Rabobank OmniKassa 2.0', 'pronamic_ideal' ); ?></h3> |
|
18 | + <h3><?php esc_html_e('Rabobank OmniKassa 2.0', 'pronamic_ideal'); ?></h3> |
|
19 | 19 | |
20 | 20 | <p> |
21 | 21 | <?php |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | </div> |
43 | 43 | |
44 | 44 | <div class="col"> |
45 | - <h3><?php esc_html_e( 'Better subscriptions', 'pronamic_ideal' ); ?></h3> |
|
45 | + <h3><?php esc_html_e('Better subscriptions', 'pronamic_ideal'); ?></h3> |
|
46 | 46 | |
47 | 47 | <p> |
48 | 48 | <?php |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | <div class="feature-section two-col"> |
62 | 62 | <div class="col"> |
63 | - <h3><?php esc_html_e( 'Restrict Content Pro', 'pronamic_ideal' ); ?></h3> |
|
63 | + <h3><?php esc_html_e('Restrict Content Pro', 'pronamic_ideal'); ?></h3> |
|
64 | 64 | |
65 | 65 | <p> |
66 | 66 | <?php |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | </div> |
88 | 88 | |
89 | 89 | <div class="col"> |
90 | - <h3><?php esc_html_e( 'Gravity Forms + Moneybird', 'pronamic_ideal' ); ?></h3> |
|
90 | + <h3><?php esc_html_e('Gravity Forms + Moneybird', 'pronamic_ideal'); ?></h3> |
|
91 | 91 | |
92 | 92 | <p> |
93 | 93 | <?php |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | <div class="feature-section two-col"> |
108 | 108 | <div class="col"> |
109 | - <h3><?php esc_html_e( 'Check status of pending payments', 'pronamic_ideal' ); ?></h3> |
|
109 | + <h3><?php esc_html_e('Check status of pending payments', 'pronamic_ideal'); ?></h3> |
|
110 | 110 | |
111 | 111 | <p> |
112 | 112 | <?php |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | </div> |
134 | 134 | |
135 | 135 | <div class="col"> |
136 | - <h3><?php esc_html_e( 'Refreshed payments overview', 'pronamic_ideal' ); ?></h3> |
|
136 | + <h3><?php esc_html_e('Refreshed payments overview', 'pronamic_ideal'); ?></h3> |
|
137 | 137 | |
138 | 138 | <p> |
139 | 139 | <?php |
@@ -8,23 +8,23 @@ discard block |
||
8 | 8 | * @package Pronamic\WordPress\Pay |
9 | 9 | */ |
10 | 10 | |
11 | -if ( ! defined( 'WPINC' ) ) { |
|
11 | +if ( ! defined('WPINC')) { |
|
12 | 12 | die; |
13 | 13 | } |
14 | 14 | |
15 | -$class = ( 'valid' === $data->license ) ? 'updated' : 'error'; |
|
15 | +$class = ('valid' === $data->license) ? 'updated' : 'error'; |
|
16 | 16 | |
17 | 17 | ?> |
18 | -<div class="<?php echo esc_attr( $class ); ?>"> |
|
18 | +<div class="<?php echo esc_attr($class); ?>"> |
|
19 | 19 | <p> |
20 | - <strong><?php esc_html_e( 'Pronamic Pay', 'pronamic_ideal' ); ?></strong> — |
|
20 | + <strong><?php esc_html_e('Pronamic Pay', 'pronamic_ideal'); ?></strong> — |
|
21 | 21 | <?php |
22 | 22 | |
23 | - if ( 'valid' === $data->license ) { |
|
24 | - esc_html_e( 'You succesfully activated your website.', 'pronamic_ideal' ); |
|
25 | - } elseif ( 'invalid' === $data->license && 0 === $data->activations_left ) { |
|
23 | + if ('valid' === $data->license) { |
|
24 | + esc_html_e('You succesfully activated your website.', 'pronamic_ideal'); |
|
25 | + } elseif ('invalid' === $data->license && 0 === $data->activations_left) { |
|
26 | 26 | echo wp_kses( |
27 | - __( 'This license does not have any activations left. Maybe you have to deactivate your license on a local/staging server. This can be done on your <a href="http://www.pronamic.eu/" target="_blank">Pronamic.eu account</a>.', 'pronamic_ideal' ), |
|
27 | + __('This license does not have any activations left. Maybe you have to deactivate your license on a local/staging server. This can be done on your <a href="http://www.pronamic.eu/" target="_blank">Pronamic.eu account</a>.', 'pronamic_ideal'), |
|
28 | 28 | array( |
29 | 29 | 'a' => array( |
30 | 30 | 'href' => true, |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | ) |
34 | 34 | ); |
35 | 35 | } else { |
36 | - esc_html_e( 'There was a problem activating your license key, please try again or contact support.', 'pronamic_ideal' ); |
|
36 | + esc_html_e('There was a problem activating your license key, please try again or contact support.', 'pronamic_ideal'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | ?> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | ?> |
12 | -<h2><?php esc_html_e( 'Supported Payment Gateways', 'pronamic_ideal' ); ?></h2> |
|
12 | +<h2><?php esc_html_e('Supported Payment Gateways', 'pronamic_ideal'); ?></h2> |
|
13 | 13 | |
14 | 14 | <?php |
15 | 15 | |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | <table class="wp-list-table widefat" cellspacing="0"> |
23 | 23 | <thead> |
24 | 24 | <tr> |
25 | - <th scope="col"><?php esc_html_e( 'Payment provider', 'pronamic_ideal' ); ?></th> |
|
26 | - <th scope="col"><?php esc_html_e( 'Gateway', 'pronamic_ideal' ); ?></th> |
|
27 | - <th scope="col"><?php esc_html_e( 'Site', 'pronamic_ideal' ); ?></th> |
|
25 | + <th scope="col"><?php esc_html_e('Payment provider', 'pronamic_ideal'); ?></th> |
|
26 | + <th scope="col"><?php esc_html_e('Gateway', 'pronamic_ideal'); ?></th> |
|
27 | + <th scope="col"><?php esc_html_e('Site', 'pronamic_ideal'); ?></th> |
|
28 | 28 | </tr> |
29 | 29 | </thead> |
30 | 30 | |
@@ -35,25 +35,25 @@ discard block |
||
35 | 35 | $current_provider = ''; |
36 | 36 | $alternate = false; |
37 | 37 | |
38 | - foreach ( $pronamic_pay_providers as $provider ) : |
|
38 | + foreach ($pronamic_pay_providers as $provider) : |
|
39 | 39 | |
40 | - if ( isset( $provider['integrations'] ) && is_array( $provider['integrations'] ) ) : |
|
40 | + if (isset($provider['integrations']) && is_array($provider['integrations'])) : |
|
41 | 41 | |
42 | - foreach ( $provider['integrations'] as $integration ) : |
|
42 | + foreach ($provider['integrations'] as $integration) : |
|
43 | 43 | $name = $integration->get_name(); |
44 | 44 | |
45 | - $name = explode( ' - ', $name ); |
|
45 | + $name = explode(' - ', $name); |
|
46 | 46 | |
47 | 47 | // Provider. |
48 | - if ( count( $name ) > 1 ) : |
|
49 | - $provider = array_shift( $name ); |
|
48 | + if (count($name) > 1) : |
|
49 | + $provider = array_shift($name); |
|
50 | 50 | else : |
51 | - $provider_name = explode( '(', $name[0] ); |
|
51 | + $provider_name = explode('(', $name[0]); |
|
52 | 52 | |
53 | - $provider = array_shift( $provider_name ); |
|
53 | + $provider = array_shift($provider_name); |
|
54 | 54 | endif; |
55 | 55 | |
56 | - if ( $current_provider === $integration->provider ) : |
|
56 | + if ($current_provider === $integration->provider) : |
|
57 | 57 | $provider = ''; |
58 | 58 | else : |
59 | 59 | $current_provider = $integration->provider; |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | $alternate = ! $alternate; |
62 | 62 | endif; |
63 | 63 | |
64 | - $name = implode( '', $name ); |
|
64 | + $name = implode('', $name); |
|
65 | 65 | |
66 | 66 | // Deprecated notice. |
67 | - if ( isset( $integration->deprecated ) && $integration->deprecated ) { |
|
68 | - $name = sprintf( __( '%s (obsoleted)', 'pronamic_ideal' ), $name ); |
|
67 | + if (isset($integration->deprecated) && $integration->deprecated) { |
|
68 | + $name = sprintf(__('%s (obsoleted)', 'pronamic_ideal'), $name); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | // Product link. |
72 | 72 | $site = ''; |
73 | 73 | |
74 | - if ( $integration->get_product_url() ) { |
|
74 | + if ($integration->get_product_url()) { |
|
75 | 75 | $site = sprintf( |
76 | 76 | '<a href="%s" target="_blank" title="%s">%2$s</a>', |
77 | 77 | $integration->get_product_url(), |
78 | - __( 'Site', 'pronamic_ideal' ) |
|
78 | + __('Site', 'pronamic_ideal') |
|
79 | 79 | ); |
80 | 80 | } |
81 | 81 | |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | <td>%s</td> |
86 | 86 | <td>%s</td> |
87 | 87 | </tr>', |
88 | - ( $alternate ? ' class="alternate"' : null ), |
|
89 | - esc_html( $provider ), |
|
90 | - esc_html( $name ), |
|
88 | + ($alternate ? ' class="alternate"' : null), |
|
89 | + esc_html($provider), |
|
90 | + esc_html($name), |
|
91 | 91 | $site |
92 | 92 | ); |
93 | 93 |
@@ -47,16 +47,20 @@ |
||
47 | 47 | // Provider. |
48 | 48 | if ( count( $name ) > 1 ) : |
49 | 49 | $provider = array_shift( $name ); |
50 | - else : |
|
50 | + else { |
|
51 | + : |
|
51 | 52 | $provider_name = explode( '(', $name[0] ); |
53 | + } |
|
52 | 54 | |
53 | 55 | $provider = array_shift( $provider_name ); |
54 | 56 | endif; |
55 | 57 | |
56 | 58 | if ( $current_provider === $integration->provider ) : |
57 | 59 | $provider = ''; |
58 | - else : |
|
60 | + else { |
|
61 | + : |
|
59 | 62 | $current_provider = $integration->provider; |
63 | + } |
|
60 | 64 | |
61 | 65 | $alternate = ! $alternate; |
62 | 66 | endif; |
@@ -9,18 +9,18 @@ |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | ?> |
12 | -<h3><?php esc_html_e( 'Dashboard', 'pronamic_ideal' ); ?></h3> |
|
12 | +<h3><?php esc_html_e('Dashboard', 'pronamic_ideal'); ?></h3> |
|
13 | 13 | |
14 | 14 | <p> |
15 | - <?php esc_html_e( 'On the Pronamic Pay dashboard you can restart this tour and see an overview of the latest pending payments.', 'pronamic_ideal' ); ?> |
|
16 | - <?php esc_html_e( 'It also gives you access to the “Getting Started” and “System Status” pages in case you have issues.', 'pronamic_ideal' ); ?> |
|
17 | - <?php esc_html_e( 'And you can follow the latest news from the Pronamic.eu weblog.', 'pronamic_ideal' ); ?> |
|
15 | + <?php esc_html_e('On the Pronamic Pay dashboard you can restart this tour and see an overview of the latest pending payments.', 'pronamic_ideal'); ?> |
|
16 | + <?php esc_html_e('It also gives you access to the “Getting Started” and “System Status” pages in case you have issues.', 'pronamic_ideal'); ?> |
|
17 | + <?php esc_html_e('And you can follow the latest news from the Pronamic.eu weblog.', 'pronamic_ideal'); ?> |
|
18 | 18 | </p> |
19 | 19 | |
20 | 20 | <div class="wp-pointer-buttons pp-pointer-buttons"> |
21 | 21 | <span class="pp-pointer-buttons-right"> |
22 | - <a href="<?php echo esc_attr( add_query_arg( 'post_type', 'pronamic_payment', admin_url( 'edit.php' ) ) ); ?>" class="button-primary pp-pointer-button-next"><?php esc_html_e( 'Next', 'pronamic_ideal' ); ?></a> |
|
22 | + <a href="<?php echo esc_attr(add_query_arg('post_type', 'pronamic_payment', admin_url('edit.php'))); ?>" class="button-primary pp-pointer-button-next"><?php esc_html_e('Next', 'pronamic_ideal'); ?></a> |
|
23 | 23 | |
24 | - <a href="<?php echo esc_attr( $this->get_close_url() ); ?>" class="button-secondary pp-pointer-button-close"><?php esc_html_e( 'Close', 'pronamic_ideal' ); ?></a> |
|
24 | + <a href="<?php echo esc_attr($this->get_close_url()); ?>" class="button-secondary pp-pointer-button-close"><?php esc_html_e('Close', 'pronamic_ideal'); ?></a> |
|
25 | 25 | </span> |
26 | 26 | </div> |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | |
16 | 16 | $sections_fields = array(); |
17 | 17 | |
18 | -foreach ( $sections as $id => $section ) { |
|
19 | - $sections_fields[ $id ] = array(); |
|
18 | +foreach ($sections as $id => $section) { |
|
19 | + $sections_fields[$id] = array(); |
|
20 | 20 | } |
21 | 21 | |
22 | -foreach ( $fields as $id => $field ) { |
|
22 | +foreach ($fields as $id => $field) { |
|
23 | 23 | $section = $field['section']; |
24 | 24 | |
25 | - $sections_fields[ $section ][ $id ] = $field; |
|
25 | + $sections_fields[$section][$id] = $field; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | // Sections. |
29 | -$variant_id = get_post_meta( get_the_ID(), '_pronamic_gateway_id', true ); |
|
29 | +$variant_id = get_post_meta(get_the_ID(), '_pronamic_gateway_id', true); |
|
30 | 30 | |
31 | 31 | $options = array(); |
32 | 32 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | <tr> |
41 | 41 | <th scope="row"> |
42 | 42 | <label for="pronamic_gateway_id"> |
43 | - <?php esc_html_e( 'Payment provider', 'pronamic_ideal' ); ?> |
|
43 | + <?php esc_html_e('Payment provider', 'pronamic_ideal'); ?> |
|
44 | 44 | </label> |
45 | 45 | </th> |
46 | 46 | <td> |
@@ -49,23 +49,23 @@ discard block |
||
49 | 49 | |
50 | 50 | <?php |
51 | 51 | |
52 | - foreach ( $pronamic_pay_providers as $provider ) { |
|
53 | - if ( isset( $provider['integrations'] ) && is_array( $provider['integrations'] ) ) { |
|
54 | - printf( '<optgroup label="%s">', esc_attr( $provider['name'] ) ); |
|
52 | + foreach ($pronamic_pay_providers as $provider) { |
|
53 | + if (isset($provider['integrations']) && is_array($provider['integrations'])) { |
|
54 | + printf('<optgroup label="%s">', esc_attr($provider['name'])); |
|
55 | 55 | |
56 | - foreach ( $provider['integrations'] as $integration ) { |
|
56 | + foreach ($provider['integrations'] as $integration) { |
|
57 | 57 | $id = $integration->get_id(); |
58 | 58 | $name = $integration->get_name(); |
59 | 59 | $classes = array(); |
60 | 60 | $description = ''; |
61 | 61 | $links = array(); |
62 | 62 | |
63 | - if ( isset( $integration->deprecated ) && $integration->deprecated ) { |
|
63 | + if (isset($integration->deprecated) && $integration->deprecated) { |
|
64 | 64 | $classes[] = 'deprecated'; |
65 | 65 | |
66 | - $name = sprintf( __( '%s (obsoleted)', 'pronamic_ideal' ), $name ); |
|
66 | + $name = sprintf(__('%s (obsoleted)', 'pronamic_ideal'), $name); |
|
67 | 67 | |
68 | - if ( $variant_id !== $id ) { |
|
68 | + if ($variant_id !== $id) { |
|
69 | 69 | continue; |
70 | 70 | } |
71 | 71 | } |
@@ -73,53 +73,53 @@ discard block |
||
73 | 73 | // Dashboard links. |
74 | 74 | $dashboards = $integration->get_dashboard_url(); |
75 | 75 | |
76 | - if ( 1 === count( $dashboards ) ) { |
|
76 | + if (1 === count($dashboards)) { |
|
77 | 77 | $links[] = sprintf( |
78 | 78 | '<a href="%s" title="%s">%2$s</a>', |
79 | - esc_attr( $dashboards[0] ), |
|
80 | - __( 'Dashboard', 'pronamic_ideal' ) |
|
79 | + esc_attr($dashboards[0]), |
|
80 | + __('Dashboard', 'pronamic_ideal') |
|
81 | 81 | ); |
82 | - } elseif ( count( $dashboards ) > 1 ) { |
|
82 | + } elseif (count($dashboards) > 1) { |
|
83 | 83 | $dashboard_urls = array(); |
84 | 84 | |
85 | - foreach ( $dashboards as $dashboard_name => $dashboard_url ) { |
|
85 | + foreach ($dashboards as $dashboard_name => $dashboard_url) { |
|
86 | 86 | $dashboard_urls[] = sprintf( |
87 | 87 | '<a href="%s" title="%s">%2$s</a>', |
88 | - esc_attr( $dashboard_url ), |
|
89 | - esc_html( ucfirst( $dashboard_name ) ) |
|
88 | + esc_attr($dashboard_url), |
|
89 | + esc_html(ucfirst($dashboard_name)) |
|
90 | 90 | ); |
91 | 91 | } |
92 | 92 | |
93 | 93 | $links[] = sprintf( |
94 | 94 | '%s: %s', |
95 | - __( 'Dashboards', 'pronamic_ideal' ), |
|
96 | - strtolower( implode( ', ', $dashboard_urls ) ) |
|
95 | + __('Dashboards', 'pronamic_ideal'), |
|
96 | + strtolower(implode(', ', $dashboard_urls)) |
|
97 | 97 | ); |
98 | 98 | } |
99 | 99 | |
100 | 100 | // Product link. |
101 | - if ( $integration->get_product_url() ) { |
|
101 | + if ($integration->get_product_url()) { |
|
102 | 102 | $links[] = sprintf( |
103 | 103 | '<a href="%s" target="_blank" title="%s">%2$s</a>', |
104 | 104 | $integration->get_product_url(), |
105 | - __( 'Product information', 'pronamic_ideal' ) |
|
105 | + __('Product information', 'pronamic_ideal') |
|
106 | 106 | ); |
107 | 107 | } |
108 | 108 | |
109 | - $description = implode( ' | ', $links ); |
|
109 | + $description = implode(' | ', $links); |
|
110 | 110 | |
111 | 111 | printf( |
112 | 112 | '<option data-gateway-description="%s" data-pronamic-pay-settings="%s" value="%s" %s class="%s">%s</option>', |
113 | - esc_attr( $description ), |
|
114 | - esc_attr( wp_json_encode( $integration->get_settings() ) ), |
|
115 | - esc_attr( $id ), |
|
116 | - selected( $variant_id, $id, false ), |
|
117 | - esc_attr( implode( ' ', $classes ) ), |
|
118 | - esc_attr( $name ) |
|
113 | + esc_attr($description), |
|
114 | + esc_attr(wp_json_encode($integration->get_settings())), |
|
115 | + esc_attr($id), |
|
116 | + selected($variant_id, $id, false), |
|
117 | + esc_attr(implode(' ', $classes)), |
|
118 | + esc_attr($name) |
|
119 | 119 | ); |
120 | 120 | } |
121 | 121 | |
122 | - printf( '</optgroup>' ); |
|
122 | + printf('</optgroup>'); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
@@ -134,34 +134,34 @@ discard block |
||
134 | 134 | <div class="pronamic-pay-tabs"> |
135 | 135 | <ul class="pronamic-pay-tabs-items"></ul> |
136 | 136 | |
137 | - <?php foreach ( $sections as $id => $section ) : ?> |
|
137 | + <?php foreach ($sections as $id => $section) : ?> |
|
138 | 138 | |
139 | 139 | <?php |
140 | 140 | |
141 | 141 | $classes = array(); |
142 | - if ( isset( $section['methods'] ) ) { |
|
142 | + if (isset($section['methods'])) { |
|
143 | 143 | $classes[] = 'pronamic-pay-tab'; |
144 | 144 | $classes[] = 'pronamic-pay-cloack'; |
145 | 145 | $classes[] = 'extra-settings'; |
146 | 146 | |
147 | - foreach ( $section['methods'] as $method ) { |
|
147 | + foreach ($section['methods'] as $method) { |
|
148 | 148 | $classes[] = 'setting-' . $method; |
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | 152 | ?> |
153 | 153 | |
154 | - <div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"> |
|
155 | - <?php if ( ! empty( $section['title'] ) || ! empty( $section['description'] ) ) : ?> |
|
154 | + <div class="<?php echo esc_attr(implode(' ', $classes)); ?>"> |
|
155 | + <?php if ( ! empty($section['title']) || ! empty($section['description'])) : ?> |
|
156 | 156 | |
157 | 157 | <div class="pronamic-pay-tab-block gateway-config-section-header"> |
158 | - <?php if ( ! empty( $section['title'] ) ) : ?> |
|
158 | + <?php if ( ! empty($section['title'])) : ?> |
|
159 | 159 | |
160 | - <h4 class="pronamic-pay-cloack"><?php echo esc_html( $section['title'] ); ?></h4> |
|
160 | + <h4 class="pronamic-pay-cloack"><?php echo esc_html($section['title']); ?></h4> |
|
161 | 161 | |
162 | 162 | <?php endif; ?> |
163 | 163 | |
164 | - <?php if ( ! empty( $section['description'] ) ) : ?> |
|
164 | + <?php if ( ! empty($section['description'])) : ?> |
|
165 | 165 | |
166 | 166 | <p> |
167 | 167 | <?php |
@@ -180,46 +180,46 @@ discard block |
||
180 | 180 | |
181 | 181 | <?php |
182 | 182 | |
183 | - foreach ( $sections_fields[ $id ] as $field ) : |
|
183 | + foreach ($sections_fields[$id] as $field) : |
|
184 | 184 | |
185 | 185 | $classes = array(); |
186 | - if ( isset( $field['methods'] ) ) { |
|
186 | + if (isset($field['methods'])) { |
|
187 | 187 | $classes[] = 'pronamic-pay-cloack'; |
188 | 188 | $classes[] = 'extra-settings'; |
189 | 189 | |
190 | - foreach ( $field['methods'] as $method ) { |
|
190 | + foreach ($field['methods'] as $method) { |
|
191 | 191 | $classes[] = 'setting-' . $method; |
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | - if ( isset( $field['group'] ) ) { |
|
195 | + if (isset($field['group'])) { |
|
196 | 196 | $classes[] = $field['group']; |
197 | 197 | } |
198 | 198 | |
199 | - if ( isset( $field['id'] ) ) { |
|
199 | + if (isset($field['id'])) { |
|
200 | 200 | $id = $field['id']; |
201 | - } elseif ( isset( $field['meta_key'] ) ) { |
|
201 | + } elseif (isset($field['meta_key'])) { |
|
202 | 202 | $id = $field['meta_key']; |
203 | 203 | } else { |
204 | 204 | $id = uniqid(); |
205 | 205 | } |
206 | 206 | |
207 | 207 | ?> |
208 | - <tr class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>"> |
|
208 | + <tr class="<?php echo esc_attr(implode(' ', $classes)); ?>"> |
|
209 | 209 | |
210 | - <?php if ( 'html' !== $field['type'] ) { ?> |
|
210 | + <?php if ('html' !== $field['type']) { ?> |
|
211 | 211 | |
212 | 212 | <th scope="col"> |
213 | - <label for="<?php echo esc_attr( $id ); ?>"> |
|
214 | - <?php echo esc_html( $field['title'] ); ?> |
|
213 | + <label for="<?php echo esc_attr($id); ?>"> |
|
214 | + <?php echo esc_html($field['title']); ?> |
|
215 | 215 | </label> |
216 | 216 | |
217 | 217 | <?php |
218 | 218 | |
219 | - if ( isset( $field['tooltip'] ) && ! empty( $field['tooltip'] ) ) { |
|
219 | + if (isset($field['tooltip']) && ! empty($field['tooltip'])) { |
|
220 | 220 | printf( |
221 | 221 | '<span class="dashicons dashicons-editor-help pronamic-pay-tip" title="%s"></span>', |
222 | - esc_attr( $field['tooltip'] ) |
|
222 | + esc_attr($field['tooltip']) |
|
223 | 223 | ); |
224 | 224 | } |
225 | 225 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | <?php } ?> |
230 | 230 | |
231 | - <td <?php if ( 'html' === $field['type'] ) : ?>colspan="2"<?php endif; ?>> |
|
231 | + <td <?php if ('html' === $field['type']) : ?>colspan="2"<?php endif; ?>> |
|
232 | 232 | <?php |
233 | 233 | |
234 | 234 | $attributes = array(); |
@@ -236,47 +236,47 @@ discard block |
||
236 | 236 | $attributes['name'] = $id; |
237 | 237 | |
238 | 238 | $classes = array(); |
239 | - if ( isset( $field['classes'] ) ) { |
|
239 | + if (isset($field['classes'])) { |
|
240 | 240 | $classes = $field['classes']; |
241 | 241 | } |
242 | 242 | |
243 | - if ( isset( $field['readonly'] ) && $field['readonly'] ) { |
|
243 | + if (isset($field['readonly']) && $field['readonly']) { |
|
244 | 244 | $attributes['readonly'] = 'readonly'; |
245 | 245 | |
246 | 246 | $classes[] = 'readonly'; |
247 | 247 | } |
248 | 248 | |
249 | - if ( isset( $field['size'] ) ) { |
|
249 | + if (isset($field['size'])) { |
|
250 | 250 | $attributes['size'] = $field['size']; |
251 | 251 | } |
252 | 252 | |
253 | - if ( in_array( $field['type'], array( 'text', 'password', 'textarea', 'select' ), true ) ) { |
|
253 | + if (in_array($field['type'], array('text', 'password', 'textarea', 'select'), true)) { |
|
254 | 254 | $classes[] = 'pronamic-pay-form-control'; |
255 | 255 | } |
256 | 256 | |
257 | - if ( in_array( $field['type'], array( 'textarea' ), true ) ) { |
|
257 | + if (in_array($field['type'], array('textarea'), true)) { |
|
258 | 258 | $classes[] = 'pronamic-pay-form-control-lg'; |
259 | 259 | } |
260 | 260 | |
261 | - if ( ! empty( $classes ) ) { |
|
262 | - $attributes['class'] = implode( ' ', $classes ); |
|
261 | + if ( ! empty($classes)) { |
|
262 | + $attributes['class'] = implode(' ', $classes); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | $value = ''; |
266 | - if ( isset( $field['meta_key'] ) ) { |
|
266 | + if (isset($field['meta_key'])) { |
|
267 | 267 | $attributes['name'] = $field['meta_key']; |
268 | 268 | |
269 | - $value = get_post_meta( get_the_ID(), $field['meta_key'], true ); |
|
270 | - } elseif ( isset( $field['value'] ) ) { |
|
269 | + $value = get_post_meta(get_the_ID(), $field['meta_key'], true); |
|
270 | + } elseif (isset($field['value'])) { |
|
271 | 271 | $value = $field['value']; |
272 | 272 | } |
273 | 273 | |
274 | 274 | // Set default. |
275 | - if ( empty( $value ) && isset( $field['default'] ) ) { |
|
275 | + if (empty($value) && isset($field['default'])) { |
|
276 | 276 | $value = $field['default']; |
277 | 277 | } |
278 | 278 | |
279 | - switch ( $field['type'] ) { |
|
279 | + switch ($field['type']) { |
|
280 | 280 | case 'text': |
281 | 281 | case 'password': |
282 | 282 | $attributes['type'] = $field['type']; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | printf( |
286 | 286 | '<input %s />', |
287 | 287 | // @codingStandardsIgnoreStart |
288 | - Util::array_to_html_attributes( $attributes ) |
|
288 | + Util::array_to_html_attributes($attributes) |
|
289 | 289 | // @codingStandardsIgnoreEnd |
290 | 290 | ); |
291 | 291 | |
@@ -297,17 +297,17 @@ discard block |
||
297 | 297 | printf( |
298 | 298 | '<input %s %s />', |
299 | 299 | // @codingStandardsIgnoreStart |
300 | - Util::array_to_html_attributes( $attributes ), |
|
300 | + Util::array_to_html_attributes($attributes), |
|
301 | 301 | // @codingStandardsIgnoreEnd |
302 | - checked( $value, true, false ) |
|
302 | + checked($value, true, false) |
|
303 | 303 | ); |
304 | 304 | |
305 | - printf( ' ' ); |
|
305 | + printf(' '); |
|
306 | 306 | |
307 | 307 | printf( |
308 | 308 | '<label for="%s">%s</label>', |
309 | - esc_attr( $attributes['id'] ), |
|
310 | - esc_html( $field['label'] ) |
|
309 | + esc_attr($attributes['id']), |
|
310 | + esc_html($field['label']) |
|
311 | 311 | ); |
312 | 312 | |
313 | 313 | break; |
@@ -318,9 +318,9 @@ discard block |
||
318 | 318 | printf( |
319 | 319 | '<textarea %s />%s</textarea>', |
320 | 320 | // @codingStandardsIgnoreStart |
321 | - Util::array_to_html_attributes( $attributes ), |
|
321 | + Util::array_to_html_attributes($attributes), |
|
322 | 322 | // @codingStandardsIgnoreEnd |
323 | - esc_textarea( $value ) |
|
323 | + esc_textarea($value) |
|
324 | 324 | ); |
325 | 325 | |
326 | 326 | break; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | printf( |
331 | 331 | '<input %s />', |
332 | 332 | // @codingStandardsIgnoreStart |
333 | - Util::array_to_html_attributes( $attributes ) |
|
333 | + Util::array_to_html_attributes($attributes) |
|
334 | 334 | // @codingStandardsIgnoreEnd |
335 | 335 | ); |
336 | 336 | |
@@ -339,54 +339,54 @@ discard block |
||
339 | 339 | printf( |
340 | 340 | '<select %s>%s</select>', |
341 | 341 | // @codingStandardsIgnoreStart |
342 | - Util::array_to_html_attributes( $attributes ), |
|
343 | - Util::select_options_grouped( $field['options'], $value ) |
|
342 | + Util::array_to_html_attributes($attributes), |
|
343 | + Util::select_options_grouped($field['options'], $value) |
|
344 | 344 | // @codingStandardsIgnoreEnd |
345 | 345 | ); |
346 | 346 | |
347 | 347 | break; |
348 | 348 | case 'optgroup': |
349 | - printf( '<fieldset>' ); |
|
350 | - printf( '<legend class="screen-reader-text">%s</legend>', esc_html( $field['title'] ) ); |
|
349 | + printf('<fieldset>'); |
|
350 | + printf('<legend class="screen-reader-text">%s</legend>', esc_html($field['title'])); |
|
351 | 351 | |
352 | - foreach ( $field['options'] as $key => $label ) { |
|
352 | + foreach ($field['options'] as $key => $label) { |
|
353 | 353 | printf( |
354 | 354 | '<label>%s %s</label><br />', |
355 | 355 | sprintf( |
356 | 356 | '<input type="radio" value="%s" name="%s" %s />', |
357 | - esc_attr( $key ), |
|
358 | - esc_attr( $attributes['name'] ), |
|
359 | - checked( $value, $key, false ) |
|
357 | + esc_attr($key), |
|
358 | + esc_attr($attributes['name']), |
|
359 | + checked($value, $key, false) |
|
360 | 360 | ), |
361 | - esc_html( $label ) |
|
361 | + esc_html($label) |
|
362 | 362 | ); |
363 | 363 | } |
364 | 364 | |
365 | 365 | break; |
366 | 366 | } |
367 | 367 | |
368 | - if ( isset( $field['html'] ) ) { |
|
369 | - if ( 'description' !== $field['type'] && isset( $field['title'] ) && ! empty( $field['title'] ) ) { |
|
368 | + if (isset($field['html'])) { |
|
369 | + if ('description' !== $field['type'] && isset($field['title']) && ! empty($field['title'])) { |
|
370 | 370 | printf( |
371 | 371 | '<strong>%s</strong><br>', |
372 | - esc_html( $field['title'] ) |
|
372 | + esc_html($field['title']) |
|
373 | 373 | ); |
374 | 374 | } |
375 | 375 | |
376 | 376 | echo $field['html']; // WPCS: XSS ok. |
377 | 377 | } |
378 | 378 | |
379 | - if ( isset( $field['description'] ) ) { |
|
379 | + if (isset($field['description'])) { |
|
380 | 380 | printf( // WPCS: XSS ok. |
381 | 381 | '<p class="pronamic-pay-description description">%s</p>', |
382 | 382 | $field['description'] |
383 | 383 | ); |
384 | 384 | } |
385 | 385 | |
386 | - if ( isset( $field['callback'] ) ) { |
|
386 | + if (isset($field['callback'])) { |
|
387 | 387 | $callback = $field['callback']; |
388 | 388 | |
389 | - call_user_func( $callback, $field ); |
|
389 | + call_user_func($callback, $field); |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | ?> |