Server IP : 172.67.157.199 / Your IP : 18.223.125.170 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/wordpress-seo/src/user-meta/user-interface/ |
Upload File : |
<?php namespace Yoast\WP\SEO\User_Meta\User_Interface; use Yoast\WP\SEO\Conditionals\No_Conditionals; use Yoast\WP\SEO\Integrations\Integration_Interface; use Yoast\WP\SEO\User_Meta\Application\Cleanup_Service; /** * Handles the cleanup for user meta. */ class Cleanup_Integration implements Integration_Interface { use No_Conditionals; /** * The cleanup service. * * @var Cleanup_Service $cleanup_service The cleanup service. */ private $cleanup_service; /** * The constructor. * * @param Cleanup_Service $cleanup_service The cleanup service. */ public function __construct( Cleanup_Service $cleanup_service ) { $this->cleanup_service = $cleanup_service; } /** * Registers action hook. * * @return void */ public function register_hooks(): void { \add_filter( 'wpseo_misc_cleanup_tasks', [ $this, 'add_user_meta_cleanup_tasks' ] ); } /** * Adds cleanup tasks for the cleanup integration. * * @param Closure[] $tasks Array of tasks to be added. * * @return Closure[] An associative array of tasks to be added to the cleanup integration. */ public function add_user_meta_cleanup_tasks( $tasks ) { return \array_merge( $tasks, [ 'clean_selected_empty_usermeta' => function ( $limit ) { return $this->cleanup_service->cleanup_selected_empty_usermeta( $limit ); }, ] ); } }