| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO\Admin\Metabox |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Represents the readability analysis. |
| 10 |
*/ |
| 11 |
class WPSEO_Metabox_Analysis_Readability implements WPSEO_Metabox_Analysis { |
| 12 |
|
| 13 |
/** |
| 14 |
* Whether this analysis is enabled. |
| 15 |
* |
| 16 |
* @return bool Whether or not this analysis is enabled. |
| 17 |
*/ |
| 18 |
public function is_enabled() { |
| 19 |
return $this->is_globally_enabled() && $this->is_user_enabled(); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Whether or not this analysis is enabled by the user. |
| 24 |
* |
| 25 |
* @return bool Whether or not this analysis is enabled by the user. |
| 26 |
*/ |
| 27 |
public function is_user_enabled() { |
| 28 |
return ! get_the_author_meta( 'wpseo_content_analysis_disable', get_current_user_id() ); |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Whether or not this analysis is enabled globally. |
| 33 |
* |
| 34 |
* @return bool Whether or not this analysis is enabled globally. |
| 35 |
*/ |
| 36 |
public function is_globally_enabled() { |
| 37 |
return WPSEO_Options::get( 'content_analysis_active', true ); |
| 38 |
} |
| 39 |
} |
| 40 |
|