403Webshell
Server IP : 104.21.14.103  /  Your IP : 18.118.184.91
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/self/cwd/wp-content/plugins/wordpress-seo/admin/recalculate/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/cwd/wp-content/plugins/wordpress-seo/admin/recalculate/class-recalculate.php
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin
 */

/**
 * Abstract class to force methods in recalculate classes.
 */
abstract class WPSEO_Recalculate {

	/**
	 * Recalculations per page.
	 *
	 * @var int
	 */
	protected $items_per_page = 20;

	/**
	 * Saves the array with scores to the database.
	 *
	 * @param array $scores Array with the score for each item.
	 */
	abstract public function save_scores( array $scores );

	/**
	 * Gets the items and parses it to an response.
	 *
	 * @param integer $paged The current page number.
	 *
	 * @return string
	 */
	abstract protected function get_items( $paged );

	/**
	 * Maps the items to an array for the response.
	 *
	 * @param mixed $item Object with data to parse.
	 *
	 * @return array
	 */
	abstract protected function item_to_response( $item );

	/**
	 * Gets the items to recalculate.
	 *
	 * @param int $paged The current page number.
	 *
	 * @return array Items that can be recalculated.
	 */
	public function get_items_to_recalculate( $paged ) {
		$return = [];

		$paged = abs( $paged );

		$items = $this->get_items( $paged );

		$return['items']       = $this->parse_items( $items );
		$return['total_items'] = count( $items );

		if ( $return['total_items'] >= $this->items_per_page ) {
			$return['next_page'] = ( $paged + 1 );
		}

		return $return;
	}

	/**
	 * Parse the posts|terms with the value we need.
	 *
	 * @param array $items The items to parse.
	 *
	 * @return array
	 */
	protected function parse_items( array $items ) {
		$return = [];
		foreach ( $items as $item ) {
			$response = $this->item_to_response( $item );
			if ( ! empty( $response ) ) {
				$return[] = $response;
			}
		}

		return $return;
	}

	/**
	 * Get default from the options for given field.
	 *
	 * @param string $field  The field for which to get the default options.
	 * @param string $suffix The post type.
	 *
	 * @return bool|string
	 */
	protected function default_from_options( $field, $suffix ) {
		$target_option_field = $field . '-' . $suffix;
		if ( WPSEO_Options::get( $target_option_field, '' ) !== '' ) {
			return WPSEO_Options::get( $target_option_field );
		}

		return false;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit