PageRenderTime 11ms CodeModel.GetById 8ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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/**
 9 * Class WPSEO_Import_Plugins_Detector
10 *
11 * Class with functionality to detect whether we should import from another SEO plugin.
12 */
13class WPSEO_Import_Plugins_Detector {
14	/**
15	 * Plugins we need to import from.
16	 *
17	 * @var array
18	 */
19	public $needs_import = array();
20
21	/**
22	 * Detects whether we need to import anything.
23	 */
24	public function detect() {
25		foreach ( WPSEO_Plugin_Importers::get() as $importer_class ) {
26			$importer = new $importer_class();
27			$detect   = new WPSEO_Import_Plugin( $importer, 'detect' );
28			if ( $detect->status->status ) {
29				$this->needs_import[ $importer_class ] = $importer->get_plugin_name();
30			}
31		}
32	}
33}