@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $post_status = $this->get_post_status( $subscription->get_status(), null ); |
| 97 | 97 | |
| 98 | 98 | if ( null !== $post_status ) { |
| 99 | - $data['post_status'] = $post_status; |
|
| 99 | + $data[ 'post_status' ] = $post_status; |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | wp_update_post( $data ); |
@@ -245,8 +245,8 @@ discard block |
||
| 245 | 245 | if ( $previous_status !== $subscription->status ) { |
| 246 | 246 | $can_redirect = false; |
| 247 | 247 | |
| 248 | - do_action( 'pronamic_subscription_status_update_' . $subscription->source . '_' . strtolower( $previous_status ) . '_to_' . strtolower( $subscription->status ), $subscription, $can_redirect ); |
|
| 249 | - do_action( 'pronamic_subscription_status_update_' . $subscription->source, $subscription, $can_redirect ); |
|
| 248 | + do_action( 'pronamic_subscription_status_update_'.$subscription->source.'_'.strtolower( $previous_status ).'_to_'.strtolower( $subscription->status ), $subscription, $can_redirect ); |
|
| 249 | + do_action( 'pronamic_subscription_status_update_'.$subscription->source, $subscription, $can_redirect ); |
|
| 250 | 250 | do_action( 'pronamic_subscription_status_update', $subscription, $can_redirect ); |
| 251 | 251 | } |
| 252 | 252 | } |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | * @throws \Exception Throws an Exception when the `interval_spec` cannot be parsed as an interval. |
| 381 | 381 | */ |
| 382 | 382 | public function get_date_interval() { |
| 383 | - $interval_spec = 'P' . $this->interval . $this->interval_period; |
|
| 383 | + $interval_spec = 'P'.$this->interval.$this->interval_period; |
|
| 384 | 384 | |
| 385 | 385 | $interval = new DateInterval( $interval_spec ); |
| 386 | 386 | |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | * @return string |
| 510 | 510 | */ |
| 511 | 511 | public function get_meta( $key ) { |
| 512 | - $key = '_pronamic_subscription_' . $key; |
|
| 512 | + $key = '_pronamic_subscription_'.$key; |
|
| 513 | 513 | |
| 514 | 514 | return get_post_meta( $this->id, $key, true ); |
| 515 | 515 | } |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | * @return boolean True on successful update, false on failure. |
| 524 | 524 | */ |
| 525 | 525 | public function set_meta( $key, $value = false ) { |
| 526 | - $key = '_pronamic_subscription_' . $key; |
|
| 526 | + $key = '_pronamic_subscription_'.$key; |
|
| 527 | 527 | |
| 528 | 528 | if ( $value instanceof DateTime ) { |
| 529 | 529 | $value = $value->format( 'Y-m-d H:i:s' ); |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | |
| 549 | 549 | if ( $payment ) { |
| 550 | 550 | $description = apply_filters( 'pronamic_payment_source_description', $description, $payment ); |
| 551 | - $description = apply_filters( 'pronamic_payment_source_description_' . $this->source, $description, $payment ); |
|
| 551 | + $description = apply_filters( 'pronamic_payment_source_description_'.$this->source, $description, $payment ); |
|
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | return $description; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | if ( $payment ) { |
| 568 | 568 | $url = apply_filters( 'pronamic_payment_source_url', $url, $payment ); |
| 569 | - $url = apply_filters( 'pronamic_payment_source_url_' . $this->source, $url, $payment ); |
|
| 569 | + $url = apply_filters( 'pronamic_payment_source_url_'.$this->source, $url, $payment ); |
|
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | return $url; |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | $payments = $this->get_payments(); |
| 642 | 642 | |
| 643 | 643 | if ( count( $payments ) > 0 ) { |
| 644 | - return $payments[0]; |
|
| 644 | + return $payments[ 0 ]; |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | return null; |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | * @param array $meta The meta data to update. |
| 898 | 898 | */ |
| 899 | 899 | public function update_meta( $meta ) { |
| 900 | - if ( ! is_array( $meta ) || count( $meta ) === 0 ) { |
|
| 900 | + if ( !is_array( $meta ) || count( $meta ) === 0 ) { |
|
| 901 | 901 | return; |
| 902 | 902 | } |
| 903 | 903 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function test_construct() { |
| 26 | 26 | $subscription = new Subscription(); |
| 27 | 27 | |
| 28 | - $this->assertInstanceOf( __NAMESPACE__ . '\Subscription', $subscription ); |
|
| 28 | + $this->assertInstanceOf( __NAMESPACE__.'\Subscription', $subscription ); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $inputs = array(); |
| 31 | 31 | |
| 32 | - foreach ( $payment_methods['choices'][0]['options'] as $payment_method => $method_name ) { |
|
| 32 | + foreach ( $payment_methods[ 'choices' ][ 0 ][ 'options' ] as $payment_method => $method_name ) { |
|
| 33 | 33 | $gateway->set_payment_method( $payment_method ); |
| 34 | 34 | |
| 35 | 35 | // Payment method input HTML. |
| 36 | 36 | $html = $gateway->get_input_html(); |
| 37 | 37 | |
| 38 | - if ( ! empty( $html ) ) { |
|
| 38 | + if ( !empty( $html ) ) { |
|
| 39 | 39 | $inputs[ $payment_method ] = array( |
| 40 | 40 | 'label' => $method_name, |
| 41 | 41 | 'html' => $html, |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if ( $gateway->has_error() ) { |
| 47 | - $pronamic_ideal_errors[] = $gateway->get_error(); |
|
| 47 | + $pronamic_ideal_errors[ ] = $gateway->get_error(); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - include Plugin::$dirname . '/views/errors.php'; |
|
| 50 | + include Plugin::$dirname.'/views/errors.php'; |
|
| 51 | 51 | |
| 52 | 52 | ?> |
| 53 | 53 | <table class="form-table"> |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | <select id="pronamic-pay-test-payment-methods" name="pronamic_pay_test_payment_method"> |
| 62 | 62 | <?php |
| 63 | 63 | |
| 64 | - foreach ( $payment_methods['choices'][0]['options'] as $payment_method => $method_name ) { |
|
| 64 | + foreach ( $payment_methods[ 'choices' ][ 0 ][ 'options' ] as $payment_method => $method_name ) { |
|
| 65 | 65 | printf( |
| 66 | 66 | '<option value="%s" data-is-recurring="%d">%s</option>', |
| 67 | 67 | esc_attr( $payment_method ), |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | <tr class="pronamic-pay-cloack pronamic-pay-test-payment-method <?php echo esc_attr( $method ); ?>"> |
| 81 | 81 | <th scope="row"> |
| 82 | - <?php echo esc_html( $input['label'] ); ?> |
|
| 82 | + <?php echo esc_html( $input[ 'label' ] ); ?> |
|
| 83 | 83 | </th> |
| 84 | 84 | <td> |
| 85 | 85 | <?php |
| 86 | 86 | |
| 87 | - echo $input['html']; // WPCS: XSS ok. |
|
| 87 | + echo $input[ 'html' ]; // WPCS: XSS ok. |
|
| 88 | 88 | |
| 89 | 89 | ?> |
| 90 | 90 | </td> |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | <?php |
| 297 | 297 | |
| 298 | 298 | if ( $is_ideal || $gateway instanceof \Pronamic\WordPress\Pay\Gateways\OmniKassa2\Gateway ) { |
| 299 | - include Plugin::$dirname . '/views/ideal-test-cases.php'; |
|
| 299 | + include Plugin::$dirname.'/views/ideal-test-cases.php'; |
|
| 300 | 300 | } |
| 301 | 301 | } else { |
| 302 | 302 | printf( |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | public function get_subscription() { |
| 153 | 153 | $test_subscription = filter_input( INPUT_POST, 'pronamic_pay_test_subscription', FILTER_VALIDATE_BOOLEAN ); |
| 154 | 154 | |
| 155 | - if ( ! $test_subscription ) { |
|
| 155 | + if ( !$test_subscription ) { |
|
| 156 | 156 | return false; |
| 157 | 157 | } |
| 158 | 158 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | case 'count': |
| 178 | 178 | $count = filter_input( INPUT_POST, 'pronamic_pay_ends_on_count', FILTER_VALIDATE_INT ); |
| 179 | 179 | |
| 180 | - if ( ! empty( $count ) ) { |
|
| 180 | + if ( !empty( $count ) ) { |
|
| 181 | 181 | $times = $count; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | case 'date': |
| 186 | 186 | $end_date = filter_input( INPUT_POST, 'pronamic_pay_ends_on_date', FILTER_SANITIZE_STRING ); |
| 187 | 187 | |
| 188 | - if ( ! empty( $end_date ) ) { |
|
| 188 | + if ( !empty( $end_date ) ) { |
|
| 189 | 189 | /* translators: 1: interval, 2: interval period */ |
| 190 | 190 | $interval_spec = sprintf( 'P%1$s%2$s', $interval, Core_Util::to_period( $interval_period ) ); |
| 191 | 191 | |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | * @package Pronamic\WordPress\Pay |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if ( ! isset( $notes ) ) { |
|
| 11 | +if ( !isset( $notes ) ) { |
|
| 12 | 12 | return; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | -if ( ! is_array( $notes ) ) { |
|
| 15 | +if ( !is_array( $notes ) ) { |
|
| 16 | 16 | return; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -20,12 +20,15 @@ |
||
| 20 | 20 | |
| 21 | 21 | <?php esc_html_e( 'No notes found.', 'pronamic_ideal' ); ?> |
| 22 | 22 | |
| 23 | -<?php else : ?> |
|
| 23 | +<?php else { |
|
| 24 | + : ?> |
|
| 24 | 25 | |
| 25 | 26 | <table class="pronamic-pay-table widefat"> |
| 26 | 27 | <thead> |
| 27 | 28 | <tr> |
| 28 | - <th scope="col"><?php esc_html_e( 'Date', 'pronamic_ideal' ); ?></th> |
|
| 29 | + <th scope="col"><?php esc_html_e( 'Date', 'pronamic_ideal' ); |
|
| 30 | +} |
|
| 31 | +?></th> |
|
| 29 | 32 | <th scope="col"><?php esc_html_e( 'Note', 'pronamic_ideal' ); ?></th> |
| 30 | 33 | </tr> |
| 31 | 34 | </thead> |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | public function __construct() { |
| 39 | 39 | add_filter( 'request', array( $this, 'request' ) ); |
| 40 | 40 | |
| 41 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) ); |
|
| 42 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 41 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) ); |
|
| 42 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 43 | 43 | |
| 44 | - add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 44 | + add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 45 | 45 | |
| 46 | 46 | add_action( 'load-post.php', array( $this, 'maybe_check_status' ) ); |
| 47 | 47 | |
@@ -76,10 +76,10 @@ discard block |
||
| 76 | 76 | $screen = get_current_screen(); |
| 77 | 77 | |
| 78 | 78 | if ( self::POST_TYPE === $screen->post_type ) { |
| 79 | - if ( ! isset( $vars['post_status'] ) ) { |
|
| 80 | - $vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() ); |
|
| 79 | + if ( !isset( $vars[ 'post_status' ] ) ) { |
|
| 80 | + $vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() ); |
|
| 81 | 81 | |
| 82 | - $vars['post_status'][] = 'publish'; |
|
| 82 | + $vars[ 'post_status' ][ ] = 'publish'; |
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
@@ -91,25 +91,25 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function maybe_check_status() { |
| 93 | 93 | // Current user. |
| 94 | - if ( ! current_user_can( 'edit_payments' ) ) { |
|
| 94 | + if ( !current_user_can( 'edit_payments' ) ) { |
|
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Screen. |
| 99 | 99 | $screen = get_current_screen(); |
| 100 | 100 | |
| 101 | - if ( ! ( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) { |
|
| 101 | + if ( !( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) { |
|
| 102 | 102 | return; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT ); |
| 106 | 106 | |
| 107 | - if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_' . $post_id ) ) { |
|
| 107 | + if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_'.$post_id ) ) { |
|
| 108 | 108 | $payment = get_pronamic_payment( $post_id ); |
| 109 | 109 | |
| 110 | 110 | \Pronamic\WordPress\Pay\Plugin::update_payment( $payment, false ); |
| 111 | 111 | |
| 112 | - $this->admin_notices[] = array( |
|
| 112 | + $this->admin_notices[ ] = array( |
|
| 113 | 113 | 'type' => 'info', |
| 114 | 114 | 'message' => __( 'Payment status updated.', 'pronamic_ideal' ), |
| 115 | 115 | ); |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | foreach ( $this->admin_notices as $notice ) { |
| 124 | 124 | printf( |
| 125 | 125 | '<div class="notice notice-%1$s"><p>%2$s</p></div>', |
| 126 | - esc_attr( $notice['type'] ), |
|
| 127 | - esc_html( $notice['message'] ) |
|
| 126 | + esc_attr( $notice[ 'type' ] ), |
|
| 127 | + esc_html( $notice[ 'message' ] ) |
|
| 128 | 128 | ); |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | * @return array |
| 180 | 180 | */ |
| 181 | 181 | public function default_hidden_columns( $hidden ) { |
| 182 | - $hidden[] = 'pronamic_payment_gateway'; |
|
| 183 | - $hidden[] = 'pronamic_payment_description'; |
|
| 182 | + $hidden[ ] = 'pronamic_payment_gateway'; |
|
| 183 | + $hidden[ ] = 'pronamic_payment_description'; |
|
| 184 | 184 | |
| 185 | 185 | return $hidden; |
| 186 | 186 | } |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | * @return array |
| 193 | 193 | */ |
| 194 | 194 | public function sortable_columns( $sortable_columns ) { |
| 195 | - $sortable_columns['pronamic_payment_title'] = 'ID'; |
|
| 196 | - $sortable_columns['pronamic_payment_amount'] = 'pronamic_payment_amount'; |
|
| 197 | - $sortable_columns['pronamic_payment_date'] = 'date'; |
|
| 195 | + $sortable_columns[ 'pronamic_payment_title' ] = 'ID'; |
|
| 196 | + $sortable_columns[ 'pronamic_payment_amount' ] = 'pronamic_payment_amount'; |
|
| 197 | + $sortable_columns[ 'pronamic_payment_date' ] = 'date'; |
|
| 198 | 198 | |
| 199 | 199 | return $sortable_columns; |
| 200 | 200 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | $recurring = get_post_meta( $post_id, '_pronamic_payment_recurring', true ); |
| 243 | 243 | |
| 244 | - if ( ! $recurring ) { |
|
| 244 | + if ( !$recurring ) { |
|
| 245 | 245 | $label = __( 'First of recurring payment', 'pronamic_ideal' ); |
| 246 | 246 | $class = ' pronamic-pay-icon-recurring-first'; |
| 247 | 247 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $source_id = $payment->get_source_id(); |
| 261 | 261 | $source_description = $payment->get_source_description(); |
| 262 | 262 | |
| 263 | - $source_id_text = '#' . $source_id; |
|
| 263 | + $source_id_text = '#'.$source_id; |
|
| 264 | 264 | |
| 265 | 265 | $source_link = $payment->get_source_link(); |
| 266 | 266 | |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | case 'pronamic_payment_gateway': |
| 297 | 297 | $config_id = get_post_meta( $post_id, '_pronamic_payment_config_id', true ); |
| 298 | 298 | |
| 299 | - if ( ! empty( $config_id ) ) { |
|
| 299 | + if ( !empty( $config_id ) ) { |
|
| 300 | 300 | echo get_the_title( $config_id ); |
| 301 | 301 | } else { |
| 302 | 302 | echo '—'; |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | * @param WP_Post $post The object for the current post/page. |
| 410 | 410 | */ |
| 411 | 411 | public function meta_box_info( $post ) { |
| 412 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-info.php'; |
|
| 412 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-info.php'; |
|
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /** |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | ) |
| 426 | 426 | ); |
| 427 | 427 | |
| 428 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-notes.php'; |
|
| 428 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-notes.php'; |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | /** |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | * @param WP_Post $post The object for the current post/page. |
| 435 | 435 | */ |
| 436 | 436 | public function meta_box_subscription( $post ) { |
| 437 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-subscription.php'; |
|
| 437 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-subscription.php'; |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | /** |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | public function meta_box_update( $post ) { |
| 446 | 446 | wp_nonce_field( 'pronamic_payment_update', 'pronamic_payment_update_nonce' ); |
| 447 | 447 | |
| 448 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-payment-update.php'; |
|
| 448 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-payment-update.php'; |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | /** |
@@ -514,8 +514,8 @@ discard block |
||
| 514 | 514 | |
| 515 | 515 | $payment = get_pronamic_payment( $post->ID ); |
| 516 | 516 | |
| 517 | - do_action( 'pronamic_payment_status_update_' . $payment->source . '_' . strtolower( $old_status_meta ) . '_to_' . strtolower( $new_status_meta ), $payment, $can_redirect ); |
|
| 518 | - do_action( 'pronamic_payment_status_update_' . $payment->source, $payment, $can_redirect ); |
|
| 517 | + do_action( 'pronamic_payment_status_update_'.$payment->source.'_'.strtolower( $old_status_meta ).'_to_'.strtolower( $new_status_meta ), $payment, $can_redirect ); |
|
| 518 | + do_action( 'pronamic_payment_status_update_'.$payment->source, $payment, $can_redirect ); |
|
| 519 | 519 | do_action( 'pronamic_payment_status_update', $payment, $can_redirect ); |
| 520 | 520 | } |
| 521 | 521 | } |
@@ -539,14 +539,14 @@ discard block |
||
| 539 | 539 | 0 => '', // Unused. Messages start at index 1. |
| 540 | 540 | 1 => __( 'Payment updated.', 'pronamic_ideal' ), |
| 541 | 541 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229. |
| 542 | - 2 => $messages['post'][2], |
|
| 542 | + 2 => $messages[ 'post' ][ 2 ], |
|
| 543 | 543 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870. |
| 544 | - 3 => $messages['post'][3], |
|
| 544 | + 3 => $messages[ 'post' ][ 3 ], |
|
| 545 | 545 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230. |
| 546 | 546 | 4 => __( 'Payment updated.', 'pronamic_ideal' ), |
| 547 | 547 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231. |
| 548 | 548 | // translators: %s: date and time of the revision |
| 549 | - 5 => isset( $_GET['revision'] ) ? sprintf( __( 'Payment restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, // WPCS: CSRF ok. |
|
| 549 | + 5 => isset( $_GET[ 'revision' ] ) ? sprintf( __( 'Payment restored to revision from %s.', 'pronamic_ideal' ), wp_post_revision_title( (int) $_GET[ 'revision' ], false ) ) : false, // WPCS: CSRF ok. |
|
| 550 | 550 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178. |
| 551 | 551 | 6 => __( 'Payment published.', 'pronamic_ideal' ), |
| 552 | 552 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232. |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352804&filters[translation_id]=37949303. |
| 555 | 555 | 8 => __( 'Payment submitted.', 'pronamic_ideal' ), |
| 556 | 556 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352805&filters[translation_id]=37949302. |
| 557 | - 9 => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>' . $scheduled_date . '</strong>' ), |
|
| 557 | + 9 => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>'.$scheduled_date.'</strong>' ), |
|
| 558 | 558 | // @https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352806&filters[translation_id]=37949301. |
| 559 | 559 | 10 => __( 'Payment draft updated.', 'pronamic_ideal' ), |
| 560 | 560 | ); |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | public function __construct() { |
| 30 | 30 | add_filter( 'request', array( $this, 'request' ) ); |
| 31 | 31 | |
| 32 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) ); |
|
| 33 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 32 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) ); |
|
| 33 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 34 | 34 | |
| 35 | - add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 35 | + add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 36 | 36 | |
| 37 | 37 | add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); |
| 38 | 38 | |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | $screen = get_current_screen(); |
| 55 | 55 | |
| 56 | 56 | if ( self::POST_TYPE === $screen->post_type ) { |
| 57 | - if ( ! isset( $vars['post_status'] ) ) { |
|
| 58 | - $vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() ); |
|
| 57 | + if ( !isset( $vars[ 'post_status' ] ) ) { |
|
| 58 | + $vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() ); |
|
| 59 | 59 | |
| 60 | - $vars['post_status'][] = 'publish'; |
|
| 60 | + $vars[ 'post_status' ][ ] = 'publish'; |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | * @return array |
| 96 | 96 | */ |
| 97 | 97 | public function sortable_columns( $sortable_columns ) { |
| 98 | - $sortable_columns['pronamic_subscription_title'] = 'ID'; |
|
| 99 | - $sortable_columns['pronamic_subscription_date'] = 'date'; |
|
| 98 | + $sortable_columns[ 'pronamic_subscription_title' ] = 'ID'; |
|
| 99 | + $sortable_columns[ 'pronamic_subscription_date' ] = 'date'; |
|
| 100 | 100 | |
| 101 | 101 | return $sortable_columns; |
| 102 | 102 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $source_id = $subscription->get_source_id(); |
| 140 | 140 | $source_description = $subscription->get_source_description(); |
| 141 | 141 | |
| 142 | - $source_id_text = '#' . $source_id; |
|
| 142 | + $source_id_text = '#'.$source_id; |
|
| 143 | 143 | |
| 144 | 144 | $source_link = $subscription->get_source_link(); |
| 145 | 145 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $config_id = get_post_meta( $payment->get_id(), '_pronamic_payment_config_id', true ); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - if ( isset( $config_id ) && ! empty( $config_id ) ) { |
|
| 182 | + if ( isset( $config_id ) && !empty( $config_id ) ) { |
|
| 183 | 183 | echo get_the_title( $config_id ); |
| 184 | 184 | } else { |
| 185 | 185 | echo '—'; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | * @param WP_Post $post The object for the current post/page. |
| 302 | 302 | */ |
| 303 | 303 | public function meta_box_info( $post ) { |
| 304 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-info.php'; |
|
| 304 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-info.php'; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | ) |
| 318 | 318 | ); |
| 319 | 319 | |
| 320 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-notes.php'; |
|
| 320 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-notes.php'; |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @param WP_Post $post The object for the current post/page. |
| 327 | 327 | */ |
| 328 | 328 | public function meta_box_payments( $post ) { |
| 329 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-payments.php'; |
|
| 329 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-payments.php'; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | public function meta_box_update( $post ) { |
| 338 | 338 | wp_nonce_field( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ); |
| 339 | 339 | |
| 340 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/meta-box-subscription-update.php'; |
|
| 340 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/meta-box-subscription-update.php'; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -412,8 +412,8 @@ discard block |
||
| 412 | 412 | add_action( 'transition_post_status', array( $this, 'transition_post_status' ), 10, 3 ); |
| 413 | 413 | |
| 414 | 414 | // Do subscription status update actions. |
| 415 | - do_action( 'pronamic_subscription_status_update_' . $subscription->source . '_' . strtolower( $old_status_meta ) . '_to_' . strtolower( $new_status_meta ), $subscription, $can_redirect ); |
|
| 416 | - do_action( 'pronamic_subscription_status_update_' . $subscription->source, $subscription, $can_redirect ); |
|
| 415 | + do_action( 'pronamic_subscription_status_update_'.$subscription->source.'_'.strtolower( $old_status_meta ).'_to_'.strtolower( $new_status_meta ), $subscription, $can_redirect ); |
|
| 416 | + do_action( 'pronamic_subscription_status_update_'.$subscription->source, $subscription, $can_redirect ); |
|
| 417 | 417 | do_action( 'pronamic_subscription_status_update', $subscription, $can_redirect ); |
| 418 | 418 | } |
| 419 | 419 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public static function remote_get_body( $url, $required_response_code = 200, array $args = array() ) { |
| 36 | 36 | $result = wp_remote_request( $url, $args ); |
| 37 | 37 | |
| 38 | - if ( ! is_array( $result ) ) { |
|
| 38 | + if ( !is_array( $result ) ) { |
|
| 39 | 39 | return $result; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | // @see https://en.wikipedia.org/wiki/Non-breaking_space#Keyboard_entry_methods |
| 191 | 191 | $non_breaking_space = ' '; |
| 192 | 192 | |
| 193 | - return '' . $currency_symbol . $non_breaking_space . number_format_i18n( $float, 2 ); |
|
| 193 | + return ''.$currency_symbol.$non_breaking_space.number_format_i18n( $float, 2 ); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | * @return string |
| 269 | 269 | */ |
| 270 | 270 | public static function build_url( $url, array $parameters ) { |
| 271 | - return $url . '?' . _http_build_query( $parameters, null, '&' ); |
|
| 271 | + return $url.'?'._http_build_query( $parameters, null, '&' ); |
|
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
@@ -320,14 +320,14 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | if ( is_array( $groups ) ) { |
| 322 | 322 | foreach ( $groups as $group ) { |
| 323 | - $optgroup = isset( $group['name'] ) && ! empty( $group['name'] ); |
|
| 323 | + $optgroup = isset( $group[ 'name' ] ) && !empty( $group[ 'name' ] ); |
|
| 324 | 324 | |
| 325 | 325 | if ( $optgroup ) { |
| 326 | - $html .= '<optgroup label="' . $group['name'] . '">'; |
|
| 326 | + $html .= '<optgroup label="'.$group[ 'name' ].'">'; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - foreach ( $group['options'] as $value => $label ) { |
|
| 330 | - $html .= '<option value="' . $value . '" ' . selected( $selected_value, $value, false ) . '>' . $label . '</option>'; |
|
| 329 | + foreach ( $group[ 'options' ] as $value => $label ) { |
|
| 330 | + $html .= '<option value="'.$value.'" '.selected( $selected_value, $value, false ).'>'.$label.'</option>'; |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | if ( $optgroup ) { |