| @@ -53,30 +53,30 @@ | ||
| 53 | 53 | $response['message'] = 'Pro Plugin'; |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if ( ! $is_installed ) { | |
| 58 | - /** | |
| 59 | - * @var array|object $api | |
| 60 | - */ | |
| 61 | - $api = plugins_api( 'plugin_information', [ | |
| 62 | - 'slug' => sanitize_key( wp_unslash( $plugin['slug'] ) ), | |
| 63 | - 'fields' => [ | |
| 64 | - 'sections' => false, | |
| 65 | - ], | |
| 66 | - ] ); | |
| 57 | + /** | |
| 58 | + * @var array|object $api | |
| 59 | + */ | |
| 60 | + $api = plugins_api( 'plugin_information', [ | |
| 61 | + 'slug' => sanitize_key( wp_unslash( $plugin['slug'] ) ), | |
| 62 | + 'fields' => [ | |
| 63 | + 'sections' => false, | |
| 64 | + ], | |
| 65 | + ] ); | |
| 67 | 66 | |
| 68 | - if ( is_wp_error( $api ) ) { | |
| 69 | - $response['message'] = $api->get_error_message(); | |
| 67 | + if ( is_wp_error( $api ) ) { | |
| 68 | + $response['message'] = $api->get_error_message(); | |
| 70 | 69 | |
| 71 | - return $response; | |
| 72 | - } | |
| 70 | + return $response; | |
| 71 | + } | |
| 73 | 72 | |
| 74 | - $compatibility = $this->check_compatibility($api); | |
| 75 | - if (!$compatibility['success']) { | |
| 76 | - return $compatibility; | |
| 77 | - } | |
| 73 | + $compatibility = $this->check_compatibility($api); | |
| 74 | + if (!$compatibility['success']) { | |
| 75 | + return $compatibility; | |
| 76 | + } | |
| 78 | 77 | |
| 78 | + if ( ! $is_installed ) { | |
| 79 | 79 | $response['name'] = $api->name; |
| 80 | 80 | |
| 81 | 81 | $skin = new WP_Ajax_Upgrader_Skin(); |
| 82 | 82 | $upgrader = new Plugin_Upgrader( $skin ); |