| @@ -26,9 +26,8 @@ | ||
| 26 | 26 | /** |
| 27 | 27 | * Add actions and filters only if this is the plugin installation screen and it's the first page. |
| 28 | 28 | * |
| 29 | 29 | * @since 4.12 |
| 30 | - * | |
| 31 | 30 | * @param object $screen WP Screen object. |
| 32 | 31 | * |
| 33 | 32 | * @return void |
| 34 | 33 | */ |
| @@ -57,18 +56,12 @@ | ||
| 57 | 56 | if ( empty( $args->search ) ) { |
| 58 | 57 | return $result; |
| 59 | 58 | } |
| 60 | 59 | |
| 61 | - if ( is_wp_error( $result ) ) { | |
| 62 | - // This may happen if the request failed due to an internet connection issue. | |
| 63 | - return $result; | |
| 64 | - } | |
| 65 | - | |
| 66 | 60 | $addon_list = $this->get_addons(); |
| 67 | 61 | |
| 68 | 62 | // Lowercase, trim, remove punctuation/special chars, decode url, remove 'formidable'. |
| 69 | 63 | $normalized_term = $this->search_to_array( $args->search ); |
| 70 | - | |
| 71 | 64 | if ( empty( $normalized_term ) ) { |
| 72 | 65 | // Don't add anything extra. |
| 73 | 66 | return $result; |
| 74 | 67 | } |
| @@ -189,9 +182,8 @@ | ||
| 189 | 182 | /** |
| 190 | 183 | * Modify URL used to fetch to plugin information so it pulls Formidable plugin page. |
| 191 | 184 | * |
| 192 | 185 | * @since 4.12 |
| 193 | - * | |
| 194 | 186 | * @param string $url URL to load in dialog pulling the plugin page from wporg. |
| 195 | 187 | * |
| 196 | 188 | * @return string The URL with 'formidable' instead of 'frm-plugin-search'. |
| 197 | 189 | */ |
| @@ -207,9 +199,8 @@ | ||
| 207 | 199 | * @return void |
| 208 | 200 | */ |
| 209 | 201 | private function maybe_dismiss() { |
| 210 | 202 | $addon = FrmAppHelper::get_param( 'frm-dismiss', '', 'get', 'absint' ); |
| 211 | - | |
| 212 | 203 | if ( ! empty( $addon ) ) { |
| 213 | 204 | $this->add_to_dismissed_hints( $addon ); |
| 214 | 205 | } |
| 215 | 206 | } |
| @@ -266,9 +257,8 @@ | ||
| 266 | 257 | * Take a raw search query and return something a bit more standardized and |
| 267 | 258 | * easy to work with. |
| 268 | 259 | * |
| 269 | 260 | * @param string $term The raw search term. |
| 270 | - * | |
| 271 | 261 | * @return string A simplified/sanitized version. |
| 272 | 262 | */ |
| 273 | 263 | private function sanitize_search_term( $term ) { |
| 274 | 264 | $term = strtolower( urldecode( $term ) ); |
| @@ -285,9 +275,8 @@ | ||
| 285 | 275 | /** |
| 286 | 276 | * @since 4.12 |
| 287 | 277 | * |
| 288 | 278 | * @param string $terms |
| 289 | - * | |
| 290 | 279 | * @return array |
| 291 | 280 | */ |
| 292 | 281 | private function search_to_array( $terms ) { |
| 293 | 282 | $terms = $this->sanitize_search_term( $terms ); |
| @@ -356,9 +345,8 @@ | ||
| 356 | 345 | } |
| 357 | 346 | |
| 358 | 347 | /** |
| 359 | 348 | * @param string $plugin |
| 360 | - * | |
| 361 | 349 | * @return bool |
| 362 | 350 | */ |
| 363 | 351 | protected function is_installed( $plugin ) { |
| 364 | 352 | $all_plugins = FrmAppHelper::get_plugins(); |