@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | add_filter( 'request', array( $this, 'request' ) ); |
| 54 | 54 | |
| 55 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) ); |
|
| 56 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 55 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) ); |
|
| 56 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 57 | 57 | |
| 58 | - add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 58 | + add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 59 | 59 | |
| 60 | 60 | add_action( 'load-post.php', array( $this, 'maybe_check_status' ) ); |
| 61 | 61 | |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | $screen = get_current_screen(); |
| 91 | 91 | |
| 92 | 92 | if ( self::POST_TYPE === $screen->post_type ) { |
| 93 | - if ( ! isset( $vars['post_status'] ) ) { |
|
| 94 | - $vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() ); |
|
| 93 | + if ( !isset( $vars[ 'post_status' ] ) ) { |
|
| 94 | + $vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_payment_states() ); |
|
| 95 | 95 | |
| 96 | - $vars['post_status'][] = 'publish'; |
|
| 96 | + $vars[ 'post_status' ][ ] = 'publish'; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -105,25 +105,25 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function maybe_check_status() { |
| 107 | 107 | // Current user. |
| 108 | - if ( ! current_user_can( 'edit_payments' ) ) { |
|
| 108 | + if ( !current_user_can( 'edit_payments' ) ) { |
|
| 109 | 109 | return; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // Screen. |
| 113 | 113 | $screen = get_current_screen(); |
| 114 | 114 | |
| 115 | - if ( ! ( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) { |
|
| 115 | + if ( !( 'post' === $screen->base && 'pronamic_payment' === $screen->post_type ) ) { |
|
| 116 | 116 | return; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT ); |
| 120 | 120 | |
| 121 | - if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_' . $post_id ) ) { |
|
| 121 | + if ( filter_has_var( INPUT_GET, 'pronamic_pay_check_status' ) && check_admin_referer( 'pronamic_payment_check_status_'.$post_id ) ) { |
|
| 122 | 122 | $payment = get_pronamic_payment( $post_id ); |
| 123 | 123 | |
| 124 | 124 | \Pronamic\WordPress\Pay\Plugin::update_payment( $payment, false ); |
| 125 | 125 | |
| 126 | - $this->admin_notices[] = array( |
|
| 126 | + $this->admin_notices[ ] = array( |
|
| 127 | 127 | 'type' => 'info', |
| 128 | 128 | 'message' => __( 'Payment status updated.', 'pronamic_ideal' ), |
| 129 | 129 | ); |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | foreach ( $this->admin_notices as $notice ) { |
| 138 | 138 | printf( |
| 139 | 139 | '<div class="notice notice-%1$s"><p>%2$s</p></div>', |
| 140 | - esc_attr( $notice['type'] ), |
|
| 141 | - esc_html( $notice['message'] ) |
|
| 140 | + esc_attr( $notice[ 'type' ] ), |
|
| 141 | + esc_html( $notice[ 'message' ] ) |
|
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | * @return array |
| 194 | 194 | */ |
| 195 | 195 | public function default_hidden_columns( $hidden ) { |
| 196 | - $hidden[] = 'pronamic_payment_gateway'; |
|
| 197 | - $hidden[] = 'pronamic_payment_description'; |
|
| 196 | + $hidden[ ] = 'pronamic_payment_gateway'; |
|
| 197 | + $hidden[ ] = 'pronamic_payment_description'; |
|
| 198 | 198 | |
| 199 | 199 | return $hidden; |
| 200 | 200 | } |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | * @return array |
| 207 | 207 | */ |
| 208 | 208 | public function sortable_columns( $sortable_columns ) { |
| 209 | - $sortable_columns['pronamic_payment_title'] = 'ID'; |
|
| 210 | - $sortable_columns['pronamic_payment_amount'] = 'pronamic_payment_amount'; |
|
| 211 | - $sortable_columns['pronamic_payment_date'] = 'date'; |
|
| 209 | + $sortable_columns[ 'pronamic_payment_title' ] = 'ID'; |
|
| 210 | + $sortable_columns[ 'pronamic_payment_amount' ] = 'pronamic_payment_amount'; |
|
| 211 | + $sortable_columns[ 'pronamic_payment_date' ] = 'date'; |
|
| 212 | 212 | |
| 213 | 213 | return $sortable_columns; |
| 214 | 214 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | $recurring = get_post_meta( $post_id, '_pronamic_payment_recurring', true ); |
| 257 | 257 | |
| 258 | - if ( ! $recurring ) { |
|
| 258 | + if ( !$recurring ) { |
|
| 259 | 259 | $label = __( 'First of recurring payment', 'pronamic_ideal' ); |
| 260 | 260 | $class = ' pronamic-pay-icon-recurring-first'; |
| 261 | 261 | } |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $source_id = $payment->get_source_id(); |
| 275 | 275 | $source_description = $payment->get_source_description(); |
| 276 | 276 | |
| 277 | - $source_id_text = '#' . $source_id; |
|
| 277 | + $source_id_text = '#'.$source_id; |
|
| 278 | 278 | |
| 279 | 279 | $source_link = $payment->get_source_link(); |
| 280 | 280 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | case 'pronamic_payment_gateway': |
| 311 | 311 | $config_id = get_post_meta( $post_id, '_pronamic_payment_config_id', true ); |
| 312 | 312 | |
| 313 | - if ( ! empty( $config_id ) ) { |
|
| 313 | + if ( !empty( $config_id ) ) { |
|
| 314 | 314 | echo get_the_title( $config_id ); |
| 315 | 315 | } else { |
| 316 | 316 | echo '—'; |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | * @param WP_Post $post The object for the current post/page. |
| 424 | 424 | */ |
| 425 | 425 | public function meta_box_info( $post ) { |
| 426 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-payment-info.php'; |
|
| 426 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-payment-info.php'; |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | ) |
| 441 | 441 | ); |
| 442 | 442 | |
| 443 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-notes.php'; |
|
| 443 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-notes.php'; |
|
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | /** |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | * @param WP_Post $post The object for the current post/page. |
| 450 | 450 | */ |
| 451 | 451 | public function meta_box_subscription( $post ) { |
| 452 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-payment-subscription.php'; |
|
| 452 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-payment-subscription.php'; |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | /** |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | public function meta_box_update( $post ) { |
| 461 | 461 | wp_nonce_field( 'pronamic_payment_update', 'pronamic_payment_update_nonce' ); |
| 462 | 462 | |
| 463 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-payment-update.php'; |
|
| 463 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-payment-update.php'; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | /** |
@@ -548,14 +548,14 @@ discard block |
||
| 548 | 548 | 0 => '', // Unused. Messages start at index 1. |
| 549 | 549 | 1 => __( 'Payment updated.', 'pronamic_ideal' ), |
| 550 | 550 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352799&filters[translation_id]=37947229. |
| 551 | - 2 => $messages['post'][2], |
|
| 551 | + 2 => $messages[ 'post' ][ 2 ], |
|
| 552 | 552 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352800&filters[translation_id]=37947870. |
| 553 | - 3 => $messages['post'][3], |
|
| 553 | + 3 => $messages[ 'post' ][ 3 ], |
|
| 554 | 554 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352798&filters[translation_id]=37947230. |
| 555 | 555 | 4 => __( 'Payment updated.', 'pronamic_ideal' ), |
| 556 | 556 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352801&filters[translation_id]=37947231. |
| 557 | 557 | // translators: %s: date and time of the revision |
| 558 | - 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. |
|
| 558 | + 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. |
|
| 559 | 559 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352802&filters[translation_id]=37949178. |
| 560 | 560 | 6 => __( 'Payment published.', 'pronamic_ideal' ), |
| 561 | 561 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352803&filters[translation_id]=37947232. |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352804&filters[translation_id]=37949303. |
| 564 | 564 | 8 => __( 'Payment submitted.', 'pronamic_ideal' ), |
| 565 | 565 | // @see https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352805&filters[translation_id]=37949302. |
| 566 | - 9 => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>' . $scheduled_date . '</strong>' ), |
|
| 566 | + 9 => sprintf( __( 'Payment scheduled for: %s.', 'pronamic_ideal' ), '<strong>'.$scheduled_date.'</strong>' ), |
|
| 567 | 567 | // @https://translate.wordpress.org/projects/wp/4.4.x/admin/nl/default?filters[status]=either&filters[original_id]=2352806&filters[translation_id]=37949301. |
| 568 | 568 | 10 => __( 'Payment draft updated.', 'pronamic_ideal' ), |
| 569 | 569 | ); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function load() { |
| 33 | 33 | // Current user. |
| 34 | - if ( ! current_user_can( 'edit_payments' ) ) { |
|
| 34 | + if ( !current_user_can( 'edit_payments' ) ) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Bulk actions. |
| 46 | - add_filter( 'bulk_actions-' . $screen->id, array( $this, 'bulk_actions' ) ); |
|
| 46 | + add_filter( 'bulk_actions-'.$screen->id, array( $this, 'bulk_actions' ) ); |
|
| 47 | 47 | |
| 48 | - add_filter( 'handle_bulk_actions-' . $screen->id, array( $this, 'handle_bulk_action' ), 10, 3 ); |
|
| 48 | + add_filter( 'handle_bulk_actions-'.$screen->id, array( $this, 'handle_bulk_action' ), 10, 3 ); |
|
| 49 | 49 | |
| 50 | 50 | // Admin notices. |
| 51 | 51 | add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function bulk_actions( $bulk_actions ) { |
| 63 | 63 | // Don't allow edit in bulk. |
| 64 | - unset( $bulk_actions['edit'] ); |
|
| 64 | + unset( $bulk_actions[ 'edit' ] ); |
|
| 65 | 65 | |
| 66 | 66 | // Bulk check payment status. |
| 67 | - $bulk_actions['pronamic_payment_check_status'] = __( 'Check Payment Status', 'pronamic_ideal' ); |
|
| 67 | + $bulk_actions[ 'pronamic_payment_check_status' ] = __( 'Check Payment Status', 'pronamic_ideal' ); |
|
| 68 | 68 | |
| 69 | 69 | return $bulk_actions; |
| 70 | 70 | } |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | // Make sure gateway supports `payment_status_request` feature. |
| 103 | 103 | $config_id = $payment->config_id; |
| 104 | 104 | |
| 105 | - if ( ! isset( $gateways[ $config_id ] ) ) { |
|
| 105 | + if ( !isset( $gateways[ $config_id ] ) ) { |
|
| 106 | 106 | $gateways[ $config_id ] = \Pronamic\WordPress\Pay\Plugin::get_gateway( $config_id ); |
| 107 | 107 | |
| 108 | - if ( $gateways[ $config_id ] && ! $gateways[ $config_id ]->supports( 'payment_status_request' ) ) { |
|
| 109 | - $unsupported_gateways[] = $config_id; |
|
| 108 | + if ( $gateways[ $config_id ] && !$gateways[ $config_id ]->supports( 'payment_status_request' ) ) { |
|
| 109 | + $unsupported_gateways[ ] = $config_id; |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | add_filter( 'request', array( $this, 'request' ) ); |
| 48 | 48 | |
| 49 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) ); |
|
| 50 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 49 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) ); |
|
| 50 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 51 | 51 | |
| 52 | - add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 52 | + add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 53 | 53 | |
| 54 | 54 | add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); |
| 55 | 55 | |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | $screen = get_current_screen(); |
| 72 | 72 | |
| 73 | 73 | if ( self::POST_TYPE === $screen->post_type ) { |
| 74 | - if ( ! isset( $vars['post_status'] ) ) { |
|
| 75 | - $vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() ); |
|
| 74 | + if ( !isset( $vars[ 'post_status' ] ) ) { |
|
| 75 | + $vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() ); |
|
| 76 | 76 | |
| 77 | - $vars['post_status'][] = 'publish'; |
|
| 77 | + $vars[ 'post_status' ][ ] = 'publish'; |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @return array |
| 113 | 113 | */ |
| 114 | 114 | public function sortable_columns( $sortable_columns ) { |
| 115 | - $sortable_columns['pronamic_subscription_title'] = 'ID'; |
|
| 116 | - $sortable_columns['pronamic_subscription_date'] = 'date'; |
|
| 115 | + $sortable_columns[ 'pronamic_subscription_title' ] = 'ID'; |
|
| 116 | + $sortable_columns[ 'pronamic_subscription_date' ] = 'date'; |
|
| 117 | 117 | |
| 118 | 118 | return $sortable_columns; |
| 119 | 119 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $source_id = $subscription->get_source_id(); |
| 157 | 157 | $source_description = $subscription->get_source_description(); |
| 158 | 158 | |
| 159 | - $source_id_text = '#' . $source_id; |
|
| 159 | + $source_id_text = '#'.$source_id; |
|
| 160 | 160 | |
| 161 | 161 | $source_link = $subscription->get_source_link(); |
| 162 | 162 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $config_id = get_post_meta( $payment->get_id(), '_pronamic_payment_config_id', true ); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - if ( isset( $config_id ) && ! empty( $config_id ) ) { |
|
| 199 | + if ( isset( $config_id ) && !empty( $config_id ) ) { |
|
| 200 | 200 | echo get_the_title( $config_id ); |
| 201 | 201 | } else { |
| 202 | 202 | echo '—'; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * @param WP_Post $post The object for the current post/page. |
| 321 | 321 | */ |
| 322 | 322 | public function meta_box_info( $post ) { |
| 323 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-subscription-info.php'; |
|
| 323 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-subscription-info.php'; |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | ) |
| 338 | 338 | ); |
| 339 | 339 | |
| 340 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-notes.php'; |
|
| 340 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-notes.php'; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | * @param WP_Post $post The object for the current post/page. |
| 347 | 347 | */ |
| 348 | 348 | public function meta_box_payments( $post ) { |
| 349 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-subscription-payments.php'; |
|
| 349 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-subscription-payments.php'; |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | public function meta_box_update( $post ) { |
| 358 | 358 | wp_nonce_field( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ); |
| 359 | 359 | |
| 360 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-subscription-update.php'; |
|
| 360 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-subscription-update.php'; |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
@@ -406,11 +406,11 @@ discard block |
||
| 406 | 406 | * @param WP_Post $post WordPress post. |
| 407 | 407 | */ |
| 408 | 408 | public function transition_post_status( $new_status, $old_status, $post ) { |
| 409 | - if ( ! filter_has_var( INPUT_POST, 'pronamic_subscription_update_nonce' ) ) { |
|
| 409 | + if ( !filter_has_var( INPUT_POST, 'pronamic_subscription_update_nonce' ) ) { |
|
| 410 | 410 | return; |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - if ( ! check_admin_referer( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ) ) { |
|
| 413 | + if ( !check_admin_referer( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ) ) { |
|
| 414 | 414 | return; |
| 415 | 415 | } |
| 416 | 416 | |