| @@ -4,16 +4,15 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package automattic/jetpack |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files. | |
| 9 | - | |
| 10 | 8 | use Automattic\Jetpack\Constants; |
| 11 | -use Automattic\Jetpack\Current_Plan as Jetpack_Plan; | |
| 12 | 9 | use Automattic\Jetpack\Redirect; |
| 13 | 10 | use Automattic\Jetpack\Tracking; |
| 14 | 11 | |
| 15 | -// Disable direct access and execution. | |
| 12 | +/** | |
| 13 | + * Disable direct access and execution. | |
| 14 | + */ | |
| 16 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | 16 | exit; |
| 18 | 17 | } |
| 19 | 18 | |
| @@ -212,9 +211,9 @@ | ||
| 212 | 211 | * |
| 213 | 212 | * @return bool True if $hint should be displayed. |
| 214 | 213 | */ |
| 215 | 214 | protected function should_display_hint( $hint ) { |
| 216 | - $dismissed_hints = static::get_dismissed_hints(); | |
| 215 | + $dismissed_hints = $this->get_dismissed_hints(); | |
| 217 | 216 | // If more than 2 hints have been dismissed, then show no more. |
| 218 | 217 | if ( 2 < count( $dismissed_hints ) ) { |
| 219 | 218 | return false; |
| 220 | 219 | } |
| @@ -320,16 +319,8 @@ | ||
| 320 | 319 | * @param string $action unused. |
| 321 | 320 | * @param object $args Search args. |
| 322 | 321 | */ |
| 323 | 322 | public function inject_jetpack_module_suggestion( $result, $action, $args ) { |
| 324 | - /* | |
| 325 | - * Bail if something else hooks into the Plugins' API response | |
| 326 | - * and does not return results. | |
| 327 | - */ | |
| 328 | - if ( empty( $result->plugins ) || is_wp_error( $result ) ) { | |
| 329 | - return $result; | |
| 330 | - } | |
| 331 | - | |
| 332 | 323 | // Looks like a search query; it's matching time. |
| 333 | 324 | if ( ! empty( $args->search ) ) { |
| 334 | 325 | require_once JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php'; |
| 335 | 326 | $tracking = new Tracking(); |
| @@ -599,8 +590,9 @@ | ||
| 599 | 590 | >' . esc_html__( 'Hide this suggestion', 'jetpack' ) . '</a>'; |
| 600 | 591 | |
| 601 | 592 | return $links; |
| 602 | 593 | } |
| 594 | + | |
| 603 | 595 | } |
| 604 | 596 | |
| 605 | 597 | /** |
| 606 | 598 | * Master control that checks if Plugin search hints is active. |