@@ -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 | /** |
@@ -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; |
@@ -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 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | array( $this, 'page_about' ) |
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | - add_action( 'admin_print_styles-' . $hook_suffix, array( $this, 'admin_css' ) ); |
|
| 71 | + add_action( 'admin_print_styles-'.$hook_suffix, array( $this, 'admin_css' ) ); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | wp_enqueue_style( |
| 89 | 89 | 'proanmic-pay-admin-about', |
| 90 | - plugins_url( 'css/admin-about' . $min . '.css', Plugin::$file ), |
|
| 90 | + plugins_url( 'css/admin-about'.$min.'.css', Plugin::$file ), |
|
| 91 | 91 | array(), |
| 92 | 92 | $this->plugin->get_version() |
| 93 | 93 | ); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $screen = get_current_screen(); |
| 44 | 44 | |
| 45 | 45 | // Show notices only to options managers (administrators). |
| 46 | - if ( ! current_user_can( 'manage_options' ) ) { |
|
| 46 | + if ( !current_user_can( 'manage_options' ) ) { |
|
| 47 | 47 | return; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $notices = get_option( 'pronamic_pay_admin_notices', array() ); |
| 85 | 85 | |
| 86 | 86 | foreach ( $notices as $name ) { |
| 87 | - $file = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ) . 'admin/notice-' . $name . '.php'; |
|
| 87 | + $file = plugin_dir_path( \Pronamic\WordPress\Pay\Plugin::$file ).'admin/notice-'.$name.'.php'; |
|
| 88 | 88 | |
| 89 | 89 | if ( is_readable( $file ) ) { |
| 90 | 90 | include $file; |
@@ -76,6 +76,6 @@ |
||
| 76 | 76 | ), admin_url( 'edit.php' ) |
| 77 | 77 | ); |
| 78 | 78 | |
| 79 | - include \Pronamic\WordPress\Pay\Plugin::$dirname . '/admin/widget-payments-status-list.php'; |
|
| 79 | + include \Pronamic\WordPress\Pay\Plugin::$dirname.'/admin/widget-payments-status-list.php'; |
|
| 80 | 80 | } |
| 81 | 81 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * @param array $args Arguments. |
| 168 | 168 | */ |
| 169 | 169 | public function settings_section( $args ) { |
| 170 | - switch ( $args['id'] ) { |
|
| 170 | + switch ( $args[ 'id' ] ) { |
|
| 171 | 171 | case 'pronamic_pay_pages': |
| 172 | 172 | echo '<p>'; |
| 173 | 173 | esc_html_e( 'The page an user will get redirected to after payment, based on the payment status.', 'pronamic_ideal' ); |
@@ -180,12 +180,12 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | $option = get_option( $option_name ); |
| 182 | 182 | |
| 183 | - if ( ! empty( $option ) ) { |
|
| 183 | + if ( !empty( $option ) ) { |
|
| 184 | 184 | $hide_button = true; |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if ( ! isset( $hide_button ) ) { |
|
| 188 | + if ( !isset( $hide_button ) ) { |
|
| 189 | 189 | submit_button( |
| 190 | 190 | __( 'Set default pages', 'pronamic_ideal' ), |
| 191 | 191 | '', |
@@ -212,14 +212,14 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | $args = wp_parse_args( $args, $defaults ); |
| 214 | 214 | |
| 215 | - $name = $args['label_for']; |
|
| 215 | + $name = $args[ 'label_for' ]; |
|
| 216 | 216 | $value = get_option( $name ); |
| 217 | 217 | |
| 218 | 218 | $atts = array( |
| 219 | 219 | 'name' => $name, |
| 220 | 220 | 'id' => $name, |
| 221 | - 'type' => $args['type'], |
|
| 222 | - 'class' => $args['classes'], |
|
| 221 | + 'type' => $args[ 'type' ], |
|
| 222 | + 'class' => $args[ 'classes' ], |
|
| 223 | 223 | 'value' => $value, |
| 224 | 224 | ); |
| 225 | 225 | |
@@ -230,10 +230,10 @@ discard block |
||
| 230 | 230 | // @codingStandardsIgnoreEn |
| 231 | 231 | ); |
| 232 | 232 | |
| 233 | - if ( ! empty( $args['description'] ) ) { |
|
| 233 | + if ( !empty( $args[ 'description' ] ) ) { |
|
| 234 | 234 | printf( |
| 235 | 235 | '<p class="description">%s</p>', |
| 236 | - esc_html( $args['description'] ) |
|
| 236 | + esc_html( $args[ 'description' ] ) |
|
| 237 | 237 | ); |
| 238 | 238 | } |
| 239 | 239 | } |
@@ -246,10 +246,10 @@ discard block |
||
| 246 | 246 | * @param array $args Arguments. |
| 247 | 247 | */ |
| 248 | 248 | public function input_checkbox( $args ) { |
| 249 | - $id = $args['label_for']; |
|
| 250 | - $name = $args['label_for']; |
|
| 249 | + $id = $args[ 'label_for' ]; |
|
| 250 | + $name = $args[ 'label_for' ]; |
|
| 251 | 251 | $value = get_option( $name ); |
| 252 | - $legend = $args['legend']; |
|
| 252 | + $legend = $args[ 'legend' ]; |
|
| 253 | 253 | |
| 254 | 254 | echo '<fieldset>'; |
| 255 | 255 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | checked( $value, 1, false ) |
| 271 | 271 | ); |
| 272 | 272 | |
| 273 | - echo esc_html( $args['description'] ); |
|
| 273 | + echo esc_html( $args[ 'description' ] ); |
|
| 274 | 274 | |
| 275 | 275 | echo '</label>'; |
| 276 | 276 | |
@@ -300,13 +300,13 @@ discard block |
||
| 300 | 300 | * @param array $args Arguments. |
| 301 | 301 | */ |
| 302 | 302 | public function input_page( $args ) { |
| 303 | - $name = $args['label_for']; |
|
| 303 | + $name = $args[ 'label_for' ]; |
|
| 304 | 304 | |
| 305 | 305 | wp_dropdown_pages( array( |
| 306 | 306 | 'name' => esc_attr( $name ), |
| 307 | - 'post_type' => esc_attr( isset( $args['post_type'] ) ? $args['post_type'] : 'page' ), |
|
| 307 | + 'post_type' => esc_attr( isset( $args[ 'post_type' ] ) ? $args[ 'post_type' ] : 'page' ), |
|
| 308 | 308 | 'selected' => esc_attr( get_option( $name, '' ) ), |
| 309 | - 'show_option_none' => esc_attr( isset( $args['show_option_none'] ) ? $args['show_option_none'] : __( '— Select a page —', 'pronamic_ideal' ) ), |
|
| 309 | + 'show_option_none' => esc_attr( isset( $args[ 'show_option_none' ] ) ? $args[ 'show_option_none' ] : __( '— Select a page —', 'pronamic_ideal' ) ), |
|
| 310 | 310 | 'class' => 'regular-text', |
| 311 | 311 | ) ); |
| 312 | 312 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | 64 | // @see https://github.com/WordPress/WordPress/blob/4.2.4/wp-admin/admin-header.php#L82-L87. |
| 65 | - add_action( 'admin_print_styles-' . $hook_suffix, array( $this, 'admin_css' ) ); |
|
| 65 | + add_action( 'admin_print_styles-'.$hook_suffix, array( $this, 'admin_css' ) ); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | wp_register_script( |
| 85 | 85 | 'flot', |
| 86 | - plugins_url( 'assets/flot/jquery.flot' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 86 | + plugins_url( 'assets/flot/jquery.flot'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 87 | 87 | array( 'jquery' ), |
| 88 | 88 | $flot_version, |
| 89 | 89 | true |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | wp_register_script( |
| 93 | 93 | 'flot-time', |
| 94 | - plugins_url( 'assets/flot/jquery.flot.time' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 94 | + plugins_url( 'assets/flot/jquery.flot.time'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 95 | 95 | array( 'flot' ), |
| 96 | 96 | $flot_version, |
| 97 | 97 | true |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | wp_register_script( |
| 101 | 101 | 'flot-resize', |
| 102 | - plugins_url( 'assets/flot/jquery.flot.resize' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 102 | + plugins_url( 'assets/flot/jquery.flot.resize'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 103 | 103 | array( 'flot' ), |
| 104 | 104 | $flot_version, |
| 105 | 105 | true |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // Accounting.js - http://openexchangerates.github.io/accounting.js. |
| 109 | 109 | wp_register_script( |
| 110 | 110 | 'accounting', |
| 111 | - plugins_url( 'assets/accounting/accounting' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 111 | + plugins_url( 'assets/accounting/accounting'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 112 | 112 | array( 'jquery' ), |
| 113 | 113 | '0.4.1', |
| 114 | 114 | true |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // Reports. |
| 118 | 118 | wp_register_script( |
| 119 | 119 | 'proanmic-pay-admin-reports', |
| 120 | - plugins_url( 'js/admin-reports' . $min . '.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 120 | + plugins_url( 'js/admin-reports'.$min.'.js', \Pronamic\WordPress\Pay\Plugin::$file ), |
|
| 121 | 121 | array( |
| 122 | 122 | 'jquery', |
| 123 | 123 | 'flot', |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $value = (float) $data[ $key ]->value; |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | - $report[] = array( |
|
| 350 | + $report[ ] = array( |
|
| 351 | 351 | // Flot requires milliseconds so multiply with 1000. |
| 352 | 352 | $date->getTimestamp() * 1000, |
| 353 | 353 | $value, |