@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | |
65 | 65 | add_action( |
66 | 66 | 'admin_menu', |
67 | - function () use ( $black_friday_menu_label ) { |
|
67 | + function() use ( $black_friday_menu_label ) { |
|
68 | 68 | add_submenu_page( |
69 | 69 | 'formidable', |
70 | 70 | 'Formidable', |
71 | 71 | $black_friday_menu_label, |
72 | 72 | 'frm_change_settings', |
73 | 73 | 'formidable-black-friday', |
74 | - function () { |
|
74 | + function() { |
|
75 | 75 | // This function should do nothing. The redirect is handled earlier to avoid header conflicts. |
76 | 76 | } |
77 | 77 | ); |
@@ -1395,15 +1395,15 @@ discard block |
||
1395 | 1395 | global $wp_filter; |
1396 | 1396 | |
1397 | 1397 | foreach ( $actions as $action ) { |
1398 | - if ( empty( $wp_filter[ $action ]->callbacks ) ) { |
|
1398 | + if ( empty( $wp_filter[$action]->callbacks ) ) { |
|
1399 | 1399 | continue; |
1400 | 1400 | } |
1401 | - foreach ( $wp_filter[ $action ]->callbacks as $priority => $callbacks ) { |
|
1401 | + foreach ( $wp_filter[$action]->callbacks as $priority => $callbacks ) { |
|
1402 | 1402 | foreach ( $callbacks as $callback_name => $callback ) { |
1403 | 1403 | if ( self::is_our_callback_string( $callback_name ) || self::is_our_callback_array( $callback ) ) { |
1404 | 1404 | continue; |
1405 | 1405 | } |
1406 | - unset( $wp_filter[ $action ]->callbacks[ $priority ][ $callback_name ] ); |
|
1406 | + unset( $wp_filter[$action]->callbacks[$priority][$callback_name] ); |
|
1407 | 1407 | } |
1408 | 1408 | } |
1409 | 1409 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | '<span class="frm-upgrade-submenu">' . __( 'Upgrade', 'formidable' ) . '</span>', |
112 | 112 | 'frm_view_forms', |
113 | 113 | 'formidable-pro-upgrade', |
114 | - function () { |
|
114 | + function() { |
|
115 | 115 | // This function doesn't need to do anything. |
116 | 116 | // The redirect is handled earlier to avoid issues with the headers being sent. |
117 | 117 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | unset( $addons['error'] ); |
143 | 143 | } |
144 | 144 | |
145 | - $pro = array( |
|
145 | + $pro = array( |
|
146 | 146 | 'pro' => array( |
147 | 147 | 'title' => 'Formidable Forms Pro', |
148 | 148 | 'slug' => 'formidable-pro', |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | |
185 | 185 | // Extract the elements to move |
186 | 186 | foreach ( $plans as $plan ) { |
187 | - if ( isset( self::$categories[ $plan ] ) ) { |
|
188 | - $bottom_categories[ $plan ] = self::$categories[ $plan ]; |
|
189 | - unset( self::$categories[ $plan ] ); |
|
187 | + if ( isset( self::$categories[$plan] ) ) { |
|
188 | + $bottom_categories[$plan] = self::$categories[$plan]; |
|
189 | + unset( self::$categories[$plan] ); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -240,14 +240,12 @@ discard block |
||
240 | 240 | // Add the slug to the new array. |
241 | 241 | $addon['category-slugs'][] = $category_slug; |
242 | 242 | |
243 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
244 | - self::$categories[ $category_slug ] = array( |
|
243 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
244 | + self::$categories[$category_slug] = array( |
|
245 | 245 | 'name' => $category, |
246 | 246 | 'count' => 0, |
247 | 247 | ); |
248 | - } |
|
249 | - |
|
250 | - ++self::$categories[ $category_slug ]['count']; |
|
248 | + } ++self::$categories[$category_slug]['count']; |
|
251 | 249 | } |
252 | 250 | } |
253 | 251 | |
@@ -279,7 +277,7 @@ discard block |
||
279 | 277 | } else { |
280 | 278 | foreach ( $addons as $k => $addon ) { |
281 | 279 | if ( empty( $addon['excerpt'] ) && $k !== 'error' ) { |
282 | - unset( $addons[ $k ] ); |
|
280 | + unset( $addons[$k] ); |
|
283 | 281 | } |
284 | 282 | } |
285 | 283 | } |
@@ -393,7 +391,7 @@ discard block |
||
393 | 391 | |
394 | 392 | foreach ( $list as $k => $info ) { |
395 | 393 | $info['slug'] = $k; |
396 | - $list[ $k ] = array_merge( $defaults, $info ); |
|
394 | + $list[$k] = array_merge( $defaults, $info ); |
|
397 | 395 | } |
398 | 396 | return $list; |
399 | 397 | } |
@@ -544,17 +542,17 @@ discard block |
||
544 | 542 | continue; |
545 | 543 | } |
546 | 544 | |
547 | - $wp_plugin = isset( $wp_plugins[ $folder ] ) ? $wp_plugins[ $folder ] : array(); |
|
545 | + $wp_plugin = isset( $wp_plugins[$folder] ) ? $wp_plugins[$folder] : array(); |
|
548 | 546 | $wp_version = isset( $wp_plugin['Version'] ) ? $wp_plugin['Version'] : '1.0'; |
549 | 547 | $plugin->slug = explode( '/', $folder )[0]; |
550 | 548 | |
551 | 549 | if ( version_compare( $wp_version, $plugin->new_version, '<' ) ) { |
552 | - $transient->response[ $folder ] = $plugin; |
|
550 | + $transient->response[$folder] = $plugin; |
|
553 | 551 | } else { |
554 | - $transient->no_update[ $folder ] = $plugin; |
|
552 | + $transient->no_update[$folder] = $plugin; |
|
555 | 553 | } |
556 | 554 | |
557 | - $transient->checked[ $folder ] = $wp_version; |
|
555 | + $transient->checked[$folder] = $wp_version; |
|
558 | 556 | |
559 | 557 | }//end foreach |
560 | 558 | |
@@ -587,7 +585,7 @@ discard block |
||
587 | 585 | */ |
588 | 586 | protected static function is_installed( $plugin ) { |
589 | 587 | $all_plugins = self::get_plugins(); |
590 | - return isset( $all_plugins[ $plugin ] ); |
|
588 | + return isset( $all_plugins[$plugin] ); |
|
591 | 589 | } |
592 | 590 | |
593 | 591 | /** |
@@ -626,13 +624,13 @@ discard block |
||
626 | 624 | } |
627 | 625 | |
628 | 626 | $download_id = isset( $plugin['id'] ) ? $plugin['id'] : 0; |
629 | - if ( ! empty( $download_id ) && ! isset( $version_info[ $download_id ]['package'] ) ) { |
|
627 | + if ( ! empty( $download_id ) && ! isset( $version_info[$download_id]['package'] ) ) { |
|
630 | 628 | // if this addon is using its own license, get the update url |
631 | 629 | $addon_info = $api->get_api_info(); |
632 | 630 | |
633 | - $version_info[ $download_id ] = $addon_info[ $download_id ]; |
|
631 | + $version_info[$download_id] = $addon_info[$download_id]; |
|
634 | 632 | if ( isset( $addon_info['error'] ) ) { |
635 | - $version_info[ $download_id ]['error'] = array( |
|
633 | + $version_info[$download_id]['error'] = array( |
|
636 | 634 | 'message' => $addon_info['error']['message'], |
637 | 635 | 'code' => $addon_info['error']['code'], |
638 | 636 | ); |
@@ -731,8 +729,8 @@ discard block |
||
731 | 729 | return $addon; |
732 | 730 | } |
733 | 731 | } |
734 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
735 | - $plugin = $addons[ $download_id ]; |
|
732 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
733 | + $plugin = $addons[$download_id]; |
|
736 | 734 | } |
737 | 735 | |
738 | 736 | return $plugin; |
@@ -798,7 +796,7 @@ discard block |
||
798 | 796 | self::set_addon_status( $addon ); |
799 | 797 | self::set_categories( $addon ); |
800 | 798 | |
801 | - $addons[ $id ] = $addon; |
|
799 | + $addons[$id] = $addon; |
|
802 | 800 | }//end foreach |
803 | 801 | } |
804 | 802 | |
@@ -839,7 +837,7 @@ discard block |
||
839 | 837 | 'utm_medium' => 'addons', |
840 | 838 | 'utm_campaign' => 'liteplugin', |
841 | 839 | ); |
842 | - $link = add_query_arg( $query_args, $link ); |
|
840 | + $link = add_query_arg( $query_args, $link ); |
|
843 | 841 | } |
844 | 842 | |
845 | 843 | /** |
@@ -1057,7 +1055,7 @@ discard block |
||
1057 | 1055 | */ |
1058 | 1056 | public static function ajax_activate_addon() { |
1059 | 1057 | self::process_addon_action( |
1060 | - function ( $plugin ) { |
|
1058 | + function( $plugin ) { |
|
1061 | 1059 | return self::handle_addon_action( $plugin, 'activate' ); |
1062 | 1060 | }, |
1063 | 1061 | array( 'FrmAddonsController', 'get_addon_activation_response' ) |
@@ -1082,7 +1080,7 @@ discard block |
||
1082 | 1080 | */ |
1083 | 1081 | public static function ajax_deactivate_addon() { |
1084 | 1082 | self::process_addon_action( |
1085 | - function ( $plugin ) { |
|
1083 | + function( $plugin ) { |
|
1086 | 1084 | return self::handle_addon_action( $plugin, 'deactivate' ); |
1087 | 1085 | } |
1088 | 1086 | ); |
@@ -1097,7 +1095,7 @@ discard block |
||
1097 | 1095 | */ |
1098 | 1096 | public static function ajax_uninstall_addon() { |
1099 | 1097 | self::process_addon_action( |
1100 | - function ( $plugin ) { |
|
1098 | + function( $plugin ) { |
|
1101 | 1099 | return self::handle_addon_action( $plugin, 'uninstall' ); |
1102 | 1100 | } |
1103 | 1101 | ); |
@@ -1494,7 +1492,7 @@ discard block |
||
1494 | 1492 | $addons = $api->get_api_info(); |
1495 | 1493 | |
1496 | 1494 | if ( is_array( $addons ) && array_key_exists( $addon_id, $addons ) ) { |
1497 | - $dates = $addons[ $addon_id ]; |
|
1495 | + $dates = $addons[$addon_id]; |
|
1498 | 1496 | $requires = FrmFormsHelper::get_plan_required( $dates ); |
1499 | 1497 | } |
1500 | 1498 |