| @@ -34,14 +34,11 @@ | ||
| 34 | 34 | /** |
| 35 | 35 | * Constructor. |
| 36 | 36 | * |
| 37 | 37 | * @param Migration_Status $migration_status Object used to determine whether the links table is accessible. |
| 38 | - * @param Options_Helper $options_helper Object used to determine whether the health check should run. | |
| 38 | + * @param Options_Helper $options_helper Object used to determine whether the health check should run. | |
| 39 | 39 | */ |
| 40 | - public function __construct( | |
| 41 | - Migration_Status $migration_status, | |
| 42 | - Options_Helper $options_helper | |
| 43 | - ) { | |
| 40 | + public function __construct( Migration_Status $migration_status, Options_Helper $options_helper ) { | |
| 44 | 41 | $this->migration_status = $migration_status; |
| 45 | 42 | $this->options_helper = $options_helper; |
| 46 | 43 | } |
| 47 | 44 | |
| @@ -50,34 +47,15 @@ | ||
| 50 | 47 | * |
| 51 | 48 | * @return void |
| 52 | 49 | */ |
| 53 | 50 | public function run() { |
| 54 | - if ( ! $this->should_run() ) { | |
| 55 | - return; | |
| 56 | - } | |
| 57 | - | |
| 58 | - $this->links_table_accessible = $this->migration_status->is_version( 'free', WPSEO_VERSION ); | |
| 51 | + $this->links_table_accessible = $this->migration_status->is_version( 'free', \WPSEO_VERSION ); | |
| 59 | 52 | } |
| 60 | 53 | |
| 61 | 54 | /** |
| 62 | - * Determines whether the health check should run or not. | |
| 63 | - * | |
| 64 | - * @return bool True if the text link counter feature is enabled. | |
| 65 | - */ | |
| 66 | - public function should_run() { | |
| 67 | - $text_link_counter_enabled = $this->options_helper->get( 'enable_text_link_counter' ); | |
| 68 | - | |
| 69 | - if ( ! is_bool( $text_link_counter_enabled ) ) { | |
| 70 | - return false; | |
| 71 | - } | |
| 72 | - | |
| 73 | - return $text_link_counter_enabled; | |
| 74 | - } | |
| 75 | - | |
| 76 | - /** | |
| 77 | 55 | * Returns true if the links table is accessible |
| 78 | 56 | * |
| 79 | - * @return bool The boolean indicating if the health check was succesful. | |
| 57 | + * @return bool The boolean indicating if the health check was successful. | |
| 80 | 58 | */ |
| 81 | 59 | public function is_successful() { |
| 82 | 60 | return $this->links_table_accessible; |
| 83 | 61 | } |