@@ -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 | |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | break; |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | - $args['meta_query'] = array( |
|
| 683 | + $args[ 'meta_query' ] = array( |
|
| 684 | 684 | array( |
| 685 | 685 | 'key' => '_pronamic_gateway_id', |
| 686 | 686 | 'value' => $gateways, |
@@ -727,12 +727,12 @@ discard block |
||
| 727 | 727 | * @param array $errors An array with errors to render. |
| 728 | 728 | */ |
| 729 | 729 | public static function render_errors( $errors = array() ) { |
| 730 | - if ( ! is_array( $errors ) ) { |
|
| 730 | + if ( !is_array( $errors ) ) { |
|
| 731 | 731 | $errors = array( $errors ); |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | foreach ( $errors as $error ) { |
| 735 | - include Plugin::$dirname . '/views/error.php'; |
|
| 735 | + include Plugin::$dirname.'/views/error.php'; |
|
| 736 | 736 | } |
| 737 | 737 | } |
| 738 | 738 | |
@@ -892,9 +892,9 @@ discard block |
||
| 892 | 892 | $payment->subscription_id = $data->get_subscription_id(); |
| 893 | 893 | $payment->set_credit_card( $data->get_credit_card() ); |
| 894 | 894 | // User Agent (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1962-L1965) |
| 895 | - $payment->user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : null; |
|
| 895 | + $payment->user_agent = isset( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : null; |
|
| 896 | 896 | // IP (@see https://github.com/WordPress/WordPress/blob/4.9.4/wp-includes/comment.php#L1957-L1960) |
| 897 | - $payment->user_ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null; |
|
| 897 | + $payment->user_ip = isset( $_SERVER[ 'REMOTE_ADDR' ] ) ? $_SERVER[ 'REMOTE_ADDR' ] : null; |
|
| 898 | 898 | |
| 899 | 899 | return self::start_payment( $payment, $gateway ); |
| 900 | 900 | } |
@@ -924,7 +924,7 @@ discard block |
||
| 924 | 924 | $subscription = $payment->get_subscription(); |
| 925 | 925 | |
| 926 | 926 | if ( $subscription ) { |
| 927 | - if ( ! $payment->get_recurring() ) { |
|
| 927 | + if ( !$payment->get_recurring() ) { |
|
| 928 | 928 | // First payment. |
| 929 | 929 | // Cancel subscription to prevent unwanted recurring payments in the future, |
| 930 | 930 | // when a valid customer ID might be set for the user. |
@@ -79,15 +79,15 @@ discard block |
||
| 79 | 79 | * email notifications so users can cancel or renew their subscription. |
| 80 | 80 | */ |
| 81 | 81 | public function handle_subscription() { |
| 82 | - if ( ! filter_has_var( INPUT_GET, 'subscription' ) ) { |
|
| 82 | + if ( !filter_has_var( INPUT_GET, 'subscription' ) ) { |
|
| 83 | 83 | return; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if ( ! filter_has_var( INPUT_GET, 'action' ) ) { |
|
| 86 | + if ( !filter_has_var( INPUT_GET, 'action' ) ) { |
|
| 87 | 87 | return; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if ( ! filter_has_var( INPUT_GET, 'key' ) ) { |
|
| 90 | + if ( !filter_has_var( INPUT_GET, 'key' ) ) { |
|
| 91 | 91 | return; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $key = filter_input( INPUT_GET, 'key', FILTER_SANITIZE_STRING ); |
| 100 | 100 | |
| 101 | 101 | // Check if subscription is valid. |
| 102 | - if ( ! $subscription ) { |
|
| 102 | + if ( !$subscription ) { |
|
| 103 | 103 | return; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | if ( Statuses::SUCCESS !== $subscription->get_status() ) { |
| 129 | 129 | $payment = $this->start_recurring( $subscription, $gateway, true ); |
| 130 | 130 | |
| 131 | - if ( ! $gateway->has_error() ) { |
|
| 131 | + if ( !$gateway->has_error() ) { |
|
| 132 | 132 | // Redirect. |
| 133 | 133 | $gateway->redirect( $payment ); |
| 134 | 134 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $payment->start_date = $start_date; |
| 198 | 198 | $payment->end_date = $end_date; |
| 199 | 199 | $payment->recurring_type = 'recurring'; |
| 200 | - $payment->recurring = ! $renewal; |
|
| 200 | + $payment->recurring = !$renewal; |
|
| 201 | 201 | |
| 202 | 202 | // Start payment. |
| 203 | 203 | $payment = Plugin::start_payment( $payment, $gateway ); |
@@ -240,11 +240,11 @@ discard block |
||
| 240 | 240 | * @return array |
| 241 | 241 | */ |
| 242 | 242 | public function exclude_subscription_comment_notes( $clauses, $query ) { |
| 243 | - $type = $query->query_vars['type']; |
|
| 243 | + $type = $query->query_vars[ 'type' ]; |
|
| 244 | 244 | |
| 245 | 245 | // Ignore subscription notes comments if it's not specifically requested. |
| 246 | 246 | if ( 'subscription_note' !== $type ) { |
| 247 | - $clauses['where'] .= " AND comment_type != 'subscription_note'"; |
|
| 247 | + $clauses[ 'where' ] .= " AND comment_type != 'subscription_note'"; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | return $clauses; |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | // Check if there is already subscription attached to the payment. |
| 271 | 271 | $subscription_id = $payment->get_subscription_id(); |
| 272 | 272 | |
| 273 | - if ( ! empty( $subscription_id ) ) { |
|
| 273 | + if ( !empty( $subscription_id ) ) { |
|
| 274 | 274 | // Subscription already created. |
| 275 | 275 | return; |
| 276 | 276 | } |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | delete_post_meta( $post->ID, '_pronamic_subscription_renewal_sent_1week' ); |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | - do_action( 'pronamic_subscription_renewal_notice_' . $subscription->get_source(), $subscription ); |
|
| 476 | + do_action( 'pronamic_subscription_renewal_notice_'.$subscription->get_source(), $subscription ); |
|
| 477 | 477 | |
| 478 | 478 | update_post_meta( $post->ID, '_pronamic_subscription_renewal_sent_1week', $start_date->format( DateTime::MYSQL ) ); |
| 479 | 479 | } |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | // The status of canceled or completed subscriptions will not be changed automatically. |
| 521 | - if ( ! in_array( $status_before, array( Statuses::CANCELLED, Statuses::COMPLETED ), true ) ) { |
|
| 521 | + if ( !in_array( $status_before, array( Statuses::CANCELLED, Statuses::COMPLETED ), true ) ) { |
|
| 522 | 522 | $subscription->set_status( $status_update ); |
| 523 | 523 | |
| 524 | 524 | if ( $status_before !== $status_update ) { |