@@ -71,7 +71,7 @@ |
||
| 71 | 71 | ), |
| 72 | 72 | 'test' => array( |
| 73 | 73 | 'sanitize' => 'sanitize_text_field', |
| 74 | - 'default' => NULL, |
|
| 74 | + 'default' => null, |
|
| 75 | 75 | ), |
| 76 | 76 | ); |
| 77 | 77 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } else { |
| 102 | 102 | foreach ( $addons as $k => $addon ) { |
| 103 | 103 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
| 104 | - unset( $addons[ $k ] ); |
|
| 104 | + unset( $addons[$k] ); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | foreach ( $list as $k => $info ) { |
| 204 | 204 | $info['slug'] = $k; |
| 205 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
| 205 | + $list[$k] = array_merge( $defaults, $info ); |
|
| 206 | 206 | } |
| 207 | 207 | return $list; |
| 208 | 208 | } |
@@ -352,17 +352,17 @@ discard block |
||
| 352 | 352 | continue; |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
| 355 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
| 356 | 356 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
| 357 | 357 | $plugin->slug = explode( '/', $folder )[0]; |
| 358 | 358 | |
| 359 | 359 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
| 360 | - $transient->response[ $folder ] = $plugin; |
|
| 360 | + $transient->response[$folder] = $plugin; |
|
| 361 | 361 | } else { |
| 362 | - $transient->no_update[ $folder ] = $plugin; |
|
| 362 | + $transient->no_update[$folder] = $plugin; |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | - $transient->checked[ $folder ] = $wp_version; |
|
| 365 | + $transient->checked[$folder] = $wp_version; |
|
| 366 | 366 | |
| 367 | 367 | } |
| 368 | 368 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | */ |
| 396 | 396 | protected static function is_installed( $plugin ) { |
| 397 | 397 | $all_plugins = self::get_plugins(); |
| 398 | - return isset( $all_plugins[ $plugin ] ); |
|
| 398 | + return isset( $all_plugins[$plugin] ); |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /** |
@@ -434,13 +434,13 @@ discard block |
||
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
| 437 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
| 437 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
| 438 | 438 | // if this addon is using its own license, get the update url |
| 439 | 439 | $addon_info = $api->get_api_info(); |
| 440 | 440 | |
| 441 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
| 441 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
| 442 | 442 | if ( isset( $addon_info['error'] ) ) { |
| 443 | - $version_info[ $download_id ]['error'] = array( |
|
| 443 | + $version_info[$download_id]['error'] = array( |
|
| 444 | 444 | 'message' => $addon_info['error']['message'], |
| 445 | 445 | 'code' => $addon_info['error']['code'], |
| 446 | 446 | ); |
@@ -539,8 +539,8 @@ discard block |
||
| 539 | 539 | return $addon; |
| 540 | 540 | } |
| 541 | 541 | } |
| 542 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
| 543 | - $plugin = $addons[ $download_id ]; |
|
| 542 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
| 543 | + $plugin = $addons[$download_id]; |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | return $plugin; |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | self::prepare_addon_link( $addon['link'] ); |
| 605 | 605 | |
| 606 | 606 | self::set_addon_status( $addon ); |
| 607 | - $addons[ $id ] = $addon; |
|
| 607 | + $addons[$id] = $addon; |
|
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | 'utm_medium' => 'addons', |
| 646 | 646 | 'utm_campaign' => 'liteplugin', |
| 647 | 647 | ); |
| 648 | - $link = add_query_arg( $query_args, $link ); |
|
| 648 | + $link = add_query_arg( $query_args, $link ); |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | /** |
@@ -1373,7 +1373,7 @@ discard block |
||
| 1373 | 1373 | $addons = $api->get_api_info(); |
| 1374 | 1374 | |
| 1375 | 1375 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
| 1376 | - $dates = $addons[ $addon_id ]; |
|
| 1376 | + $dates = $addons[$addon_id]; |
|
| 1377 | 1377 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
| 1378 | 1378 | } |
| 1379 | 1379 | |
@@ -231,11 +231,11 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public static function get_last_sent_date( $type ) { |
| 233 | 233 | $options = self::get_options(); |
| 234 | - if ( empty( $options[ 'last_' . $type ] ) ) { |
|
| 234 | + if ( empty( $options['last_' . $type] ) ) { |
|
| 235 | 235 | return false; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - return $options[ 'last_' . $type ]; |
|
| 238 | + return $options['last_' . $type]; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | public static function set_last_sent_date( $type, $value = null ) { |
| 248 | 248 | $options = self::get_options(); |
| 249 | 249 | |
| 250 | - $options[ 'last_' . $type ] = null === $value ? gmdate( 'Y-m-d' ) : ''; |
|
| 250 | + $options['last_' . $type] = null === $value ? gmdate( 'Y-m-d' ) : ''; |
|
| 251 | 251 | self::save_options( $options ); |
| 252 | 252 | } |
| 253 | 253 | |
@@ -309,11 +309,11 @@ discard block |
||
| 309 | 309 | foreach ( $payments as $payment ) { |
| 310 | 310 | list( $amount, $currency ) = FrmTransLiteAppHelper::get_amount_and_currency_from_payment( $payment ); |
| 311 | 311 | |
| 312 | - if ( ! isset( $data[ $currency ] ) ) { |
|
| 313 | - $data[ $currency ] = 0; |
|
| 312 | + if ( ! isset( $data[$currency] ) ) { |
|
| 313 | + $data[$currency] = 0; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - $data[ $currency ] += floatval( $amount ); |
|
| 316 | + $data[$currency] += floatval( $amount ); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | return $data; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param array $stats Statistics section data. |
| 123 | 123 | */ |
| 124 | 124 | protected function add_payments_data( &$stats ) { |
| 125 | - $payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date ); |
|
| 125 | + $payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date ); |
|
| 126 | 126 | $stats['payments_count'] = array( |
| 127 | 127 | 'label' => __( 'Payments collected', 'formidable' ), |
| 128 | 128 | 'count' => $payment_data['count'], |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Build total for each currency. |
| 133 | 133 | foreach ( $payment_data['total'] as $currency => $amount ) { |
| 134 | - $stats[ 'payments_total_' . $currency ] = array( |
|
| 134 | + $stats['payments_total_' . $currency] = array( |
|
| 135 | 135 | // translators: currency name. |
| 136 | 136 | 'label' => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ), |
| 137 | 137 | 'count' => $amount, |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if ( $this->has_comparison ) { |
| 144 | - $prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date ); |
|
| 144 | + $prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date ); |
|
| 145 | 145 | |
| 146 | 146 | if ( ! $payment_data['count'] && ! $prev_payment_data['count'] ) { |
| 147 | 147 | // Maybe this site doesn't collect payment, hide these sections. |
@@ -153,23 +153,23 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | // Compare total for each currency. |
| 155 | 155 | foreach ( $payment_data['total'] as $currency => $amount ) { |
| 156 | - if ( ! isset( $prev_payment_data['total'][ $currency ] ) ) { |
|
| 157 | - $stats[ 'payments_total_' . $currency ]['compare'] = 1; |
|
| 156 | + if ( ! isset( $prev_payment_data['total'][$currency] ) ) { |
|
| 157 | + $stats['payments_total_' . $currency]['compare'] = 1; |
|
| 158 | 158 | continue; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - $stats[ 'payments_total_' . $currency ]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][ $currency ] ); |
|
| 162 | - unset( $prev_payment_data['total'][ $currency ] ); |
|
| 161 | + $stats['payments_total_' . $currency]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][$currency] ); |
|
| 162 | + unset( $prev_payment_data['total'][$currency] ); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | // If prev month has more currencies. |
| 166 | 166 | foreach ( $prev_payment_data['total'] as $currency => $amount ) { |
| 167 | - $stats[ 'payments_total_' . $currency ] = array( |
|
| 167 | + $stats['payments_total_' . $currency] = array( |
|
| 168 | 168 | // translators: currency name. |
| 169 | 169 | 'label' => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ), |
| 170 | 170 | 'count' => 0, |
| 171 | 171 | 'display' => $this->get_formatted_price( 0, $currency ), |
| 172 | - 'compare' => -1, |
|
| 172 | + 'compare' => - 1, |
|
| 173 | 173 | ); |
| 174 | 174 | } |
| 175 | 175 | } |