/wp-content/plugins/wordpress-seo/admin/import/class-import-detector.php

https://bitbucket.org/carloskikea/helpet · PHP · 33 lines · 13 code · 2 blank · 18 comment · 1 complexity · 123ffc5a1c3e9748b0071936931aaf37 MD5 · raw file

  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Import\Plugins
  6. */
  7. /**
  8. * Class WPSEO_Import_Plugins_Detector
  9. *
  10. * Class with functionality to detect whether we should import from another SEO plugin.
  11. */
  12. class WPSEO_Import_Plugins_Detector {
  13. /**
  14. * Plugins we need to import from.
  15. *
  16. * @var array
  17. */
  18. public $needs_import = array();
  19. /**
  20. * Detects whether we need to import anything.
  21. */
  22. public function detect() {
  23. foreach ( WPSEO_Plugin_Importers::get() as $importer_class ) {
  24. $importer = new $importer_class();
  25. $detect = new WPSEO_Import_Plugin( $importer, 'detect' );
  26. if ( $detect->status->status ) {
  27. $this->needs_import[ $importer_class ] = $importer->get_plugin_name();
  28. }
  29. }
  30. }
  31. }