| @@ -19,11 +19,8 @@ | ||
| 19 | 19 | * @var string |
| 20 | 20 | */ |
| 21 | 21 | protected $plugin_slug; |
| 22 | 22 | |
| 23 | - /** | |
| 24 | - * @param array $atts | |
| 25 | - */ | |
| 26 | 23 | public function __construct( $atts ) { |
| 27 | 24 | $this->plugin_file = $atts['plugin_file']; |
| 28 | 25 | list( $slug, $file ) = explode( '/', $this->plugin_file ); |
| 29 | 26 | $this->plugin_slug = $slug; |
| @@ -28,11 +25,8 @@ | ||
| 28 | 25 | list( $slug, $file ) = explode( '/', $this->plugin_file ); |
| 29 | 26 | $this->plugin_slug = $slug; |
| 30 | 27 | } |
| 31 | 28 | |
| 32 | - /** | |
| 33 | - * @return string | |
| 34 | - */ | |
| 35 | 29 | public function get_activate_link() { |
| 36 | 30 | if ( $this->is_installed() && $this->is_active() ) { |
| 37 | 31 | return ''; |
| 38 | 32 | } |
| @@ -104,13 +98,11 @@ | ||
| 104 | 98 | 'sections' => false, |
| 105 | 99 | ), |
| 106 | 100 | ) |
| 107 | 101 | ); |
| 108 | - | |
| 109 | 102 | if ( is_wp_error( $api ) ) { |
| 110 | 103 | wp_send_json_error( $api->get_error_message() ); |
| 111 | 104 | } |
| 112 | - | |
| 113 | 105 | if ( ! FrmAddonsController::url_is_allowed( $api->versions['trunk'] ) ) { |
| 114 | 106 | wp_send_json_error( 'This download is not allowed' ); |
| 115 | 107 | } |
| 116 | 108 | |
| @@ -118,9 +110,8 @@ | ||
| 118 | 110 | $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); |
| 119 | 111 | |
| 120 | 112 | // Install the plugin. |
| 121 | 113 | $result = $upgrader->install( $api->versions['trunk'] ); |
| 122 | - | |
| 123 | 114 | if ( is_wp_error( $result ) ) { |
| 124 | 115 | wp_send_json_error( $result->get_error_message() ); |
| 125 | 116 | } |
| 126 | 117 | |
| @@ -168,9 +159,8 @@ | ||
| 168 | 159 | * |
| 169 | 160 | * @since 6.16 |
| 170 | 161 | * |
| 171 | 162 | * @param string $plugin_file |
| 172 | - * | |
| 173 | 163 | * @return bool |
| 174 | 164 | */ |
| 175 | 165 | private static function is_plugin_installed( $plugin_file ) { |
| 176 | 166 | return isset( get_plugins()[ $plugin_file ] ); |