← All changes
|
src/integrations/admin/indexing-tool-integration.php
+16
-46
18.0
→
28.5
View file →
| @@ -13,11 +13,11 @@ | ||
| 13 | 13 | use Yoast\WP\SEO\Helpers\Short_Link_Helper; |
| 14 | 14 | use Yoast\WP\SEO\Integrations\Integration_Interface; |
| 15 | 15 | use Yoast\WP\SEO\Presenters\Admin\Indexing_Error_Presenter; |
| 16 | 16 | use Yoast\WP\SEO\Presenters\Admin\Indexing_List_Item_Presenter; |
| 17 | -use Yoast\WP\SEO\Services\Importing\Importable_Detector; | |
| 18 | 17 | use Yoast\WP\SEO\Routes\Importing_Route; |
| 19 | 18 | use Yoast\WP\SEO\Routes\Indexing_Route; |
| 19 | +use Yoast\WP\SEO\Services\Importing\Importable_Detector_Service; | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Class Indexing_Tool_Integration. Bridge to the Javascript indexing tool on Yoast SEO Tools page. |
| 23 | 23 | * |
| @@ -69,9 +69,9 @@ | ||
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * The Importable Detector service. |
| 72 | 72 | * |
| 73 | - * @var Importable_Detector | |
| 73 | + * @var Importable_Detector_Service | |
| 74 | 74 | */ |
| 75 | 75 | protected $importable_detector; |
| 76 | 76 | |
| 77 | 77 | /** |
| @@ -96,16 +96,16 @@ | ||
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * Indexing_Integration constructor. |
| 99 | 99 | * |
| 100 | - * @param WPSEO_Admin_Asset_Manager $asset_manager The admin asset manager. | |
| 101 | - * @param Indexable_Helper $indexable_helper The indexable helper. | |
| 102 | - * @param Short_Link_Helper $short_link_helper The short link helper. | |
| 103 | - * @param Indexing_Helper $indexing_helper The indexing helper. | |
| 104 | - * @param WPSEO_Addon_Manager $addon_manager The addon manager. | |
| 105 | - * @param Product_Helper $product_helper The product helper. | |
| 106 | - * @param Importable_Detector $importable_detector The importable detector. | |
| 107 | - * @param Importing_Route $importing_route The importing route. | |
| 100 | + * @param WPSEO_Admin_Asset_Manager $asset_manager The admin asset manager. | |
| 101 | + * @param Indexable_Helper $indexable_helper The indexable helper. | |
| 102 | + * @param Short_Link_Helper $short_link_helper The short link helper. | |
| 103 | + * @param Indexing_Helper $indexing_helper The indexing helper. | |
| 104 | + * @param WPSEO_Addon_Manager $addon_manager The addon manager. | |
| 105 | + * @param Product_Helper $product_helper The product helper. | |
| 106 | + * @param Importable_Detector_Service $importable_detector The importable detector. | |
| 107 | + * @param Importing_Route $importing_route The importing route. | |
| 108 | 108 | */ |
| 109 | 109 | public function __construct( |
| 110 | 110 | WPSEO_Admin_Asset_Manager $asset_manager, |
| 111 | 111 | Indexable_Helper $indexable_helper, |
| @@ -112,9 +112,9 @@ | ||
| 112 | 112 | Short_Link_Helper $short_link_helper, |
| 113 | 113 | Indexing_Helper $indexing_helper, |
| 114 | 114 | WPSEO_Addon_Manager $addon_manager, |
| 115 | 115 | Product_Helper $product_helper, |
| 116 | - Importable_Detector $importable_detector, | |
| 116 | + Importable_Detector_Service $importable_detector, | |
| 117 | 117 | Importing_Route $importing_route |
| 118 | 118 | ) { |
| 119 | 119 | $this->asset_manager = $asset_manager; |
| 120 | 120 | $this->indexable_helper = $indexable_helper; |
| @@ -127,11 +127,13 @@ | ||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | 130 | * Register hooks. |
| 131 | + * | |
| 132 | + * @return void | |
| 131 | 133 | */ |
| 132 | 134 | public function register_hooks() { |
| 133 | - \add_action( 'wpseo_tools_overview_list_items', [ $this, 'render_indexing_list_item' ], 10 ); | |
| 135 | + \add_action( 'wpseo_tools_overview_list_items_internal', [ $this, 'render_indexing_list_item' ], 10 ); | |
| 134 | 136 | \add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_scripts' ], 10 ); |
| 135 | 137 | } |
| 136 | 138 | |
| 137 | 139 | /** |
| @@ -175,9 +177,9 @@ | ||
| 175 | 177 | protected function render_indexing_error() { |
| 176 | 178 | $presenter = new Indexing_Error_Presenter( |
| 177 | 179 | $this->short_link_helper, |
| 178 | 180 | $this->product_helper, |
| 179 | - $this->addon_manager | |
| 181 | + $this->addon_manager, | |
| 180 | 182 | ); |
| 181 | 183 | |
| 182 | 184 | return $presenter->present(); |
| 183 | 185 | } |
| @@ -232,9 +234,9 @@ | ||
| 232 | 234 | * |
| 233 | 235 | * @return array The endpoints. |
| 234 | 236 | */ |
| 235 | 237 | protected function get_importing_endpoints() { |
| 236 | - $available_actions = $this->importable_detector->detect(); | |
| 238 | + $available_actions = $this->importable_detector->detect_importers(); | |
| 237 | 239 | $importing_endpoints = []; |
| 238 | 240 | |
| 239 | 241 | foreach ( $available_actions as $plugin => $types ) { |
| 240 | 242 | foreach ( $types as $type ) { |
| @@ -242,38 +244,6 @@ | ||
| 242 | 244 | } |
| 243 | 245 | } |
| 244 | 246 | |
| 245 | 247 | return $importing_endpoints; |
| 246 | - } | |
| 247 | - | |
| 248 | - /** | |
| 249 | - * Returns the total number of unindexed objects. | |
| 250 | - * | |
| 251 | - * @deprecated 15.3 | |
| 252 | - * @codeCoverageIgnore | |
| 253 | - * | |
| 254 | - * @param int $unindexed_count The total number of unindexed indexables. | |
| 255 | - * | |
| 256 | - * @return int The total number of unindexed objects. | |
| 257 | - */ | |
| 258 | - public function get_unindexed_indexables_count( $unindexed_count = 0 ) { | |
| 259 | - \_deprecated_function( __METHOD__, 'WPSEO 15.3' ); | |
| 260 | - | |
| 261 | - return $this->indexing_helper->get_unindexed_count(); | |
| 262 | - } | |
| 263 | - | |
| 264 | - /** | |
| 265 | - * Returns the total number of unindexed objects and applies a filter for third party integrations. | |
| 266 | - * | |
| 267 | - * @deprecated 15.3 | |
| 268 | - * @codeCoverageIgnore | |
| 269 | - * | |
| 270 | - * @param int $unindexed_count The total number of unindexed objects. | |
| 271 | - * | |
| 272 | - * @return int The total number of unindexed objects. | |
| 273 | - */ | |
| 274 | - public function get_unindexed_count( $unindexed_count = 0 ) { | |
| 275 | - \_deprecated_function( __METHOD__, 'WPSEO 15.3' ); | |
| 276 | - | |
| 277 | - return $this->indexing_helper->get_filtered_unindexed_count(); | |
| 278 | 248 | } |
| 279 | 249 | } |