class-metabox-analysis-readability.php 929 B

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