@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $data = get_transient( 'pronamic_pay_license_data' ); |
51 | 51 | |
52 | 52 | if ( $data ) { |
53 | - include $this->plugin->get_plugin_dir_path() . 'admin/notice-license.php'; |
|
53 | + include $this->plugin->get_plugin_dir_path().'admin/notice-license.php'; |
|
54 | 54 | |
55 | 55 | delete_transient( 'pronamic_pay_license_data' ); |
56 | 56 | } |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | if ( $newvalue !== $oldvalue ) { |
70 | 70 | delete_option( 'pronamic_pay_license_status' ); |
71 | 71 | |
72 | - if ( ! empty( $oldvalue ) ) { |
|
72 | + if ( !empty( $oldvalue ) ) { |
|
73 | 73 | $this->deactivate_license( $oldvalue ); |
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | 77 | delete_transient( 'pronamic_pay_license_data' ); |
78 | 78 | |
79 | - if ( ! empty( $newvalue ) ) { |
|
79 | + if ( !empty( $newvalue ) ) { |
|
80 | 80 | // Always try to activate the new license, it could be deactivated. |
81 | 81 | $this->activate_license( $newvalue ); |
82 | 82 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ), $atts, 'pronamic_payment_form' |
47 | 47 | ); |
48 | 48 | |
49 | - $id = $atts['id']; |
|
49 | + $id = $atts[ 'id' ]; |
|
50 | 50 | |
51 | 51 | return $this->forms_module->get_form_output( $id ); |
52 | 52 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * Shortcode user interface register. |
56 | 56 | */ |
57 | 57 | public function shortcode_ui_register() { |
58 | - if ( ! function_exists( 'shortcode_ui_register_for_shortcode' ) ) { |
|
58 | + if ( !function_exists( 'shortcode_ui_register_for_shortcode' ) ) { |
|
59 | 59 | return; |
60 | 60 | } |
61 | 61 |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | */ |
61 | 61 | add_action( 'init', array( $this, 'register_post_type' ), 0 ); // Highest priority. |
62 | 62 | |
63 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'edit_columns' ) ); |
|
63 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'edit_columns' ) ); |
|
64 | 64 | |
65 | - add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
65 | + add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
66 | 66 | |
67 | 67 | /* |
68 | 68 | * Add meta box, we use priority 9 to make sure it loads before Yoast SEO meta box. |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 9 ); |
72 | 72 | |
73 | - add_action( 'save_post_' . self::POST_TYPE, array( $this, 'save_post' ) ); |
|
73 | + add_action( 'save_post_'.self::POST_TYPE, array( $this, 'save_post' ) ); |
|
74 | 74 | |
75 | 75 | add_action( 'post_submitbox_misc_actions', array( $this, 'post_submitbox_misc_actions' ) ); |
76 | 76 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | case 'pronamic_payment_form_gateway': |
153 | 153 | $config_id = get_post_meta( $post_id, '_pronamic_payment_form_config_id', true ); |
154 | 154 | |
155 | - if ( ! empty( $config_id ) ) { |
|
155 | + if ( !empty( $config_id ) ) { |
|
156 | 156 | echo get_the_title( $config_id ); |
157 | 157 | } else { |
158 | 158 | echo '—'; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @param WP_Post $post The object for the current post/page. |
268 | 268 | */ |
269 | 269 | public function meta_box_form_options( $post ) { |
270 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-form-options.php'; |
|
270 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-form-options.php'; |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
@@ -277,14 +277,14 @@ discard block |
||
277 | 277 | */ |
278 | 278 | public function save_post( $post_id ) { |
279 | 279 | // Check if our nonce is set. |
280 | - if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) { |
|
280 | + if ( !filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) { |
|
281 | 281 | return $post_id; |
282 | 282 | } |
283 | 283 | |
284 | 284 | $nonce = filter_input( INPUT_POST, 'pronamic_pay_nonce', FILTER_SANITIZE_STRING ); |
285 | 285 | |
286 | 286 | // Verify that the nonce is valid. |
287 | - if ( ! wp_verify_nonce( $nonce, 'pronamic_pay_save_form_options' ) ) { |
|
287 | + if ( !wp_verify_nonce( $nonce, 'pronamic_pay_save_form_options' ) ) { |
|
288 | 288 | return $post_id; |
289 | 289 | } |
290 | 290 | |
@@ -307,15 +307,15 @@ discard block |
||
307 | 307 | $data = filter_input_array( INPUT_POST, $definition ); |
308 | 308 | |
309 | 309 | // Convert amount choices to cents. |
310 | - if ( isset( $data['_pronamic_payment_form_amount_choices'] ) ) { |
|
311 | - foreach ( $data['_pronamic_payment_form_amount_choices'] as $i => $amount ) { |
|
310 | + if ( isset( $data[ '_pronamic_payment_form_amount_choices' ] ) ) { |
|
311 | + foreach ( $data[ '_pronamic_payment_form_amount_choices' ] as $i => $amount ) { |
|
312 | 312 | $amount = \Pronamic\WordPress\Pay\Core\Util::string_to_amount( $amount ); |
313 | 313 | |
314 | - $data['_pronamic_payment_form_amount_choices'][ $i ] = \Pronamic\WordPress\Pay\Core\Util::amount_to_cents( $amount ); |
|
314 | + $data[ '_pronamic_payment_form_amount_choices' ][ $i ] = \Pronamic\WordPress\Pay\Core\Util::amount_to_cents( $amount ); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | // Remove empty choices. |
318 | - $data['_pronamic_payment_form_amount_choices'] = array_filter( $data['_pronamic_payment_form_amount_choices'] ); |
|
318 | + $data[ '_pronamic_payment_form_amount_choices' ] = array_filter( $data[ '_pronamic_payment_form_amount_choices' ] ); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | // Update post meta data. |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @return string |
70 | 70 | */ |
71 | 71 | public function get_form_output( $id ) { |
72 | - $file = plugin_dir_path( Plugin::$file ) . 'templates/form.php'; |
|
72 | + $file = plugin_dir_path( Plugin::$file ).'templates/form.php'; |
|
73 | 73 | |
74 | 74 | ob_start(); |
75 | 75 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return string |
89 | 89 | */ |
90 | 90 | public function source_text( $text, Payment $payment ) { |
91 | - $text = __( 'Payment Form', 'pronamic_ideal' ) . '<br />'; |
|
91 | + $text = __( 'Payment Form', 'pronamic_ideal' ).'<br />'; |
|
92 | 92 | |
93 | 93 | $text .= sprintf( |
94 | 94 | '<a href="%s">%s</a>', |
@@ -39,20 +39,20 @@ discard block |
||
39 | 39 | $pronamic_pay_errors = array(); |
40 | 40 | |
41 | 41 | // Nonce. |
42 | - if ( ! filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) { |
|
42 | + if ( !filter_has_var( INPUT_POST, 'pronamic_pay_nonce' ) ) { |
|
43 | 43 | return; |
44 | 44 | } |
45 | 45 | |
46 | 46 | $nonce = filter_input( INPUT_POST, 'pronamic_pay_nonce', FILTER_SANITIZE_STRING ); |
47 | 47 | |
48 | - if ( ! wp_verify_nonce( $nonce, 'pronamic_pay' ) ) { |
|
48 | + if ( !wp_verify_nonce( $nonce, 'pronamic_pay' ) ) { |
|
49 | 49 | return; |
50 | 50 | } |
51 | 51 | |
52 | 52 | // Validate. |
53 | 53 | $valid = $this->validate(); |
54 | 54 | |
55 | - if ( ! $valid ) { |
|
55 | + if ( !$valid ) { |
|
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $gateway = \Pronamic\WordPress\Pay\Plugin::get_gateway( $config_id ); |
65 | 65 | |
66 | - if ( ! $gateway ) { |
|
66 | + if ( !$gateway ) { |
|
67 | 67 | return; |
68 | 68 | } |
69 | 69 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $user = get_user_by( 'email', $email ); |
90 | 90 | |
91 | - if ( ! $user ) { |
|
91 | + if ( !$user ) { |
|
92 | 92 | // Make a random string for password. |
93 | 93 | $password = wp_generate_password( 10 ); |
94 | 94 | |
@@ -132,14 +132,14 @@ discard block |
||
132 | 132 | $first_name = filter_input( INPUT_POST, 'pronamic_pay_first_name', FILTER_SANITIZE_STRING ); |
133 | 133 | |
134 | 134 | if ( empty( $first_name ) ) { |
135 | - $pronamic_pay_errors['first_name'] = __( 'Please enter your first name', 'pronamic_ideal' ); |
|
135 | + $pronamic_pay_errors[ 'first_name' ] = __( 'Please enter your first name', 'pronamic_ideal' ); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | // E-mail. |
139 | 139 | $email = filter_input( INPUT_POST, 'pronamic_pay_email', FILTER_VALIDATE_EMAIL ); |
140 | 140 | |
141 | 141 | if ( empty( $email ) ) { |
142 | - $pronamic_pay_errors['email'] = __( 'Please enter a valid email address', 'pronamic_ideal' ); |
|
142 | + $pronamic_pay_errors[ 'email' ] = __( 'Please enter a valid email address', 'pronamic_ideal' ); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return empty( $pronamic_pay_errors ); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | wp_register_style( |
40 | 40 | 'pronamic-pay-forms', |
41 | - plugins_url( 'css/forms' . $min . '.css', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
41 | + plugins_url( 'css/forms'.$min.'.css', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
42 | 42 | array(), |
43 | 43 | $this->plugin->get_version() |
44 | 44 | ); |
@@ -131,7 +131,7 @@ |
||
131 | 131 | $first_name = filter_input( INPUT_POST, 'pronamic_pay_first_name', FILTER_SANITIZE_STRING ); |
132 | 132 | $last_name = filter_input( INPUT_POST, 'pronamic_pay_last_name', FILTER_SANITIZE_STRING ); |
133 | 133 | |
134 | - return $first_name . ' ' . $last_name; |
|
134 | + return $first_name.' '.$last_name; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | * @return array |
196 | 196 | */ |
197 | 197 | public function exclude_comment_notes( $clauses, $query ) { |
198 | - $type = $query->query_vars['type']; |
|
198 | + $type = $query->query_vars[ 'type' ]; |
|
199 | 199 | |
200 | 200 | // Ignore payment notes comments if it's not specifically requested. |
201 | 201 | if ( 'payment_note' !== $type ) { |
202 | - $clauses['where'] .= " AND comment_type != 'payment_note'"; |
|
202 | + $clauses[ 'where' ] .= " AND comment_type != 'payment_note'"; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | return $clauses; |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | break; |
244 | 244 | } |
245 | 245 | |
246 | - if ( ! empty( $page_id ) ) { |
|
246 | + if ( !empty( $page_id ) ) { |
|
247 | 247 | $page_url = get_permalink( $page_id ); |
248 | 248 | |
249 | 249 | if ( false !== $page_url ) { |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * Handle returns. |
307 | 307 | */ |
308 | 308 | public function handle_returns() { |
309 | - if ( ! filter_has_var( INPUT_GET, 'payment' ) ) { |
|
309 | + if ( !filter_has_var( INPUT_GET, 'payment' ) ) { |
|
310 | 310 | return; |
311 | 311 | } |
312 | 312 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $valid_key = ( $key === $payment->key ); |
326 | 326 | } |
327 | 327 | |
328 | - if ( ! $valid_key ) { |
|
328 | + if ( !$valid_key ) { |
|
329 | 329 | wp_redirect( home_url() ); |
330 | 330 | |
331 | 331 | exit; |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * Maybe redirect. |
354 | 354 | */ |
355 | 355 | public function maybe_redirect() { |
356 | - if ( ! filter_has_var( INPUT_GET, 'payment_redirect' ) ) { |
|
356 | + if ( !filter_has_var( INPUT_GET, 'payment_redirect' ) ) { |
|
357 | 357 | return; |
358 | 358 | } |
359 | 359 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | // HTML Answer. |
365 | 365 | $html_answer = $payment->get_meta( 'ogone_directlink_html_answer' ); |
366 | 366 | |
367 | - if ( ! empty( $html_answer ) ) { |
|
367 | + if ( !empty( $html_answer ) ) { |
|
368 | 368 | echo $html_answer; // WPCS: XSS ok. |
369 | 369 | |
370 | 370 | exit; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | |
373 | 373 | $redirect_message = $payment->get_meta( 'payment_redirect_message' ); |
374 | 374 | |
375 | - if ( ! empty( $redirect_message ) ) { |
|
375 | + if ( !empty( $redirect_message ) ) { |
|
376 | 376 | $key = filter_input( INPUT_GET, 'key', FILTER_SANITIZE_STRING ); |
377 | 377 | |
378 | 378 | if ( $key !== $payment->key ) { |
@@ -383,29 +383,29 @@ discard block |
||
383 | 383 | |
384 | 384 | // @see https://github.com/woothemes/woocommerce/blob/2.3.11/includes/class-wc-cache-helper.php |
385 | 385 | // @see https://www.w3-edge.com/products/w3-total-cache/ |
386 | - if ( ! defined( 'DONOTCACHEPAGE' ) ) { |
|
386 | + if ( !defined( 'DONOTCACHEPAGE' ) ) { |
|
387 | 387 | define( 'DONOTCACHEPAGE', true ); |
388 | 388 | } |
389 | 389 | |
390 | - if ( ! defined( 'DONOTCACHEDB' ) ) { |
|
390 | + if ( !defined( 'DONOTCACHEDB' ) ) { |
|
391 | 391 | define( 'DONOTCACHEDB', true ); |
392 | 392 | } |
393 | 393 | |
394 | - if ( ! defined( 'DONOTMINIFY' ) ) { |
|
394 | + if ( !defined( 'DONOTMINIFY' ) ) { |
|
395 | 395 | define( 'DONOTMINIFY', true ); |
396 | 396 | } |
397 | 397 | |
398 | - if ( ! defined( 'DONOTCDN' ) ) { |
|
398 | + if ( !defined( 'DONOTCDN' ) ) { |
|
399 | 399 | define( 'DONOTCDN', true ); |
400 | 400 | } |
401 | 401 | |
402 | - if ( ! defined( 'DONOTCACHEOBJECT' ) ) { |
|
402 | + if ( !defined( 'DONOTCACHEOBJECT' ) ) { |
|
403 | 403 | define( 'DONOTCACHEOBJECT', true ); |
404 | 404 | } |
405 | 405 | |
406 | 406 | nocache_headers(); |
407 | 407 | |
408 | - include Plugin::$dirname . '/views/redirect-message.php'; |
|
408 | + include Plugin::$dirname.'/views/redirect-message.php'; |
|
409 | 409 | |
410 | 410 | exit; |
411 | 411 | } |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | } |
425 | 425 | } |
426 | 426 | |
427 | - if ( ! empty( $payment->action_url ) ) { |
|
427 | + if ( !empty( $payment->action_url ) ) { |
|
428 | 428 | wp_redirect( $payment->action_url ); |
429 | 429 | |
430 | 430 | exit; |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | */ |
454 | 454 | public function plugins_loaded() { |
455 | 455 | // Load plugin text domain. |
456 | - $rel_path = dirname( plugin_basename( self::$file ) ) . '/languages/'; |
|
456 | + $rel_path = dirname( plugin_basename( self::$file ) ).'/languages/'; |
|
457 | 457 | |
458 | 458 | load_plugin_textdomain( 'pronamic_ideal', false, $rel_path ); |
459 | 459 | |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | 'test' => 'https://abnamro-test.ideal-payment.de/', |
514 | 514 | 'live' => 'https://abnamro.ideal-payment.de/', |
515 | 515 | ); |
516 | - $integration->provider = 'abnamro'; |
|
516 | + $integration->provider = 'abnamro'; |
|
517 | 517 | |
518 | 518 | $integrations[ $integration->get_id() ] = $integration; |
519 | 519 | |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | 'test' => 'https://myideal.test.db.com/', |
541 | 541 | 'live' => 'https://myideal.db.com/', |
542 | 542 | ); |
543 | - $integration->provider = 'deutschebank'; |
|
543 | + $integration->provider = 'deutschebank'; |
|
544 | 544 | |
545 | 545 | $integrations[ $integration->get_id() ] = $integration; |
546 | 546 | |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | break; |
950 | 950 | } |
951 | 951 | |
952 | - $args['meta_query'] = array( |
|
952 | + $args[ 'meta_query' ] = array( |
|
953 | 953 | array( |
954 | 954 | 'key' => '_pronamic_gateway_id', |
955 | 955 | 'value' => $gateways, |
@@ -996,12 +996,12 @@ discard block |
||
996 | 996 | * @param array $errors An array with errors to render. |
997 | 997 | */ |
998 | 998 | public static function render_errors( $errors = array() ) { |
999 | - if ( ! is_array( $errors ) ) { |
|
999 | + if ( !is_array( $errors ) ) { |
|
1000 | 1000 | $errors = array( $errors ); |
1001 | 1001 | } |
1002 | 1002 | |
1003 | 1003 | foreach ( $errors as $error ) { |
1004 | - include Plugin::$dirname . '/views/error.php'; |
|
1004 | + include Plugin::$dirname.'/views/error.php'; |
|
1005 | 1005 | } |
1006 | 1006 | } |
1007 | 1007 | |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | $subscription = $payment->get_subscription(); |
1190 | 1190 | |
1191 | 1191 | if ( $subscription ) { |
1192 | - if ( ! $payment->get_recurring() ) { |
|
1192 | + if ( !$payment->get_recurring() ) { |
|
1193 | 1193 | // First payment. |
1194 | 1194 | // Cancel subscription to prevent unwanted recurring payments in the future, |
1195 | 1195 | // when a valid customer ID might be set for the user. |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | // Payments. |
155 | 155 | $payment_capabilities = PaymentPostType::get_capabilities(); |
156 | 156 | |
157 | - unset( $payment_capabilities['publish_posts'] ); |
|
158 | - unset( $payment_capabilities['create_posts'] ); |
|
157 | + unset( $payment_capabilities[ 'publish_posts' ] ); |
|
158 | + unset( $payment_capabilities[ 'create_posts' ] ); |
|
159 | 159 | |
160 | 160 | foreach ( $payment_capabilities as $capability ) { |
161 | 161 | $roles->add_cap( 'administrator', $capability ); |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | |
180 | 180 | if ( $current_db_version ) { |
181 | 181 | foreach ( $this->db_updates as $version ) { |
182 | - if ( ! version_compare( $current_db_version, $version, '<' ) ) { |
|
182 | + if ( !version_compare( $current_db_version, $version, '<' ) ) { |
|
183 | 183 | continue; |
184 | 184 | } |
185 | 185 | |
186 | - $file = plugin_dir_path( Plugin::$file ) . 'includes/updates/update-' . $version . '.php'; |
|
186 | + $file = plugin_dir_path( Plugin::$file ).'includes/updates/update-'.$version.'.php'; |
|
187 | 187 | |
188 | 188 | if ( is_readable( $file ) ) { |
189 | 189 | include $file; |