Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/2/values.tar
Ðазад
indexables/indexable-builder-versions.php 0000644 00000003075 15154325351 0014631 0 ustar 00 <?php namespace Yoast\WP\SEO\Values\Indexables; /** * Class Indexable_Builder_Versions */ class Indexable_Builder_Versions { const DEFAULT_INDEXABLE_BUILDER_VERSION = 1; /** * The list of indexable builder versions defined by Yoast SEO Free. * If the key is not in this list, the indexable type will not be managed. * These numbers should be increased if one of the builders implements a new feature. * * @var array */ protected $indexable_builder_versions_by_type = [ 'date-archive' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, 'general' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, 'home-page' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, 'post' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, 'post-type-archive' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, 'term' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, 'user' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, 'system-page' => self::DEFAULT_INDEXABLE_BUILDER_VERSION, ]; /** * Provides the most recent version number for an Indexable's object type. * * @param string $object_type The Indexable type for which you want to know the most recent version. * * @return int The most recent version number for the type, or 1 if the version doesn't exist. */ public function get_latest_version_for_type( $object_type ) { if ( ! \array_key_exists( $object_type, $this->indexable_builder_versions_by_type ) ) { return self::DEFAULT_INDEXABLE_BUILDER_VERSION; } return $this->indexable_builder_versions_by_type[ $object_type ]; } } semrush/semrush-token.php 0000644 00000005526 15154325351 0011563 0 ustar 00 <?php namespace Yoast\WP\SEO\Values\SEMrush; use Yoast\WP\SEO\Exceptions\SEMrush\Tokens\Empty_Property_Exception; use YoastSEO_Vendor\League\OAuth2\Client\Token\AccessTokenInterface; /** * Class SEMrush_Token */ class SEMrush_Token { /** * The access token. * * @var string */ public $access_token; /** * The refresh token. * * @var string */ public $refresh_token; /** * The expiration date. * * @var int */ public $expires; /** * Whether or not the token has expired. * * @var bool */ public $has_expired; /** * The timestamp at which the token was created. * * @var int */ public $created_at; /** * SEMrush_Token constructor. * * @param string $access_token The access token. * @param string $refresh_token The refresh token. * @param int $expires The date and time at which the token will expire. * @param bool $has_expired Whether or not the token has expired. * @param int $created_at The timestamp of when the token was created. * * @throws Empty_Property_Exception Exception thrown if a token property is empty. */ public function __construct( $access_token, $refresh_token, $expires, $has_expired, $created_at ) { if ( empty( $access_token ) ) { throw new Empty_Property_Exception( 'access_token' ); } $this->access_token = $access_token; if ( empty( $access_token ) ) { throw new Empty_Property_Exception( 'refresh_token' ); } $this->refresh_token = $refresh_token; if ( empty( $expires ) ) { throw new Empty_Property_Exception( 'expires' ); } $this->expires = $expires; if ( \is_null( $has_expired ) ) { throw new Empty_Property_Exception( 'has_expired' ); } $this->has_expired = $has_expired; $this->created_at = $created_at; } /** * Creates a new instance based on the passed response. * * @param AccessTokenInterface $response The response object to create a new instance from. * * @return SEMrush_Token The token object. * * @throws Empty_Property_Exception Exception thrown if a token property is empty. */ public static function from_response( AccessTokenInterface $response ) { return new self( $response->getToken(), $response->getRefreshToken(), $response->getExpires(), $response->hasExpired(), \time() ); } /** * Determines whether or not the token has expired. * * @return bool Whether or not the token has expired. */ public function has_expired() { return ( \time() >= $this->expires ) || $this->has_expired === true; } /** * Converts the object to an array. * * @return array The converted object. */ public function to_array() { return [ 'access_token' => $this->access_token, 'refresh_token' => $this->refresh_token, 'expires' => $this->expires, 'has_expired' => $this->has_expired(), 'created_at' => $this->created_at, ]; } } open-graph/images.php 0000644 00000002205 15154325351 0010565 0 ustar 00 <?php namespace Yoast\WP\SEO\Values\Open_Graph; use Yoast\WP\SEO\Helpers\Open_Graph\Image_Helper as Open_Graph_Image_Helper; use Yoast\WP\SEO\Values\Images as Base_Images; /** * Value object for the Open Graph Images. */ class Images extends Base_Images { /** * The Open Graph image helper. * * @var Open_Graph_Image_Helper */ protected $open_graph_image; /** * Sets the helpers. * * @required * * @codeCoverageIgnore - Is handled by DI-container. * * @param Open_Graph_Image_Helper $open_graph_image Image helper for Open Graph. */ public function set_helpers( Open_Graph_Image_Helper $open_graph_image ) { $this->open_graph_image = $open_graph_image; } /** * Outputs the images. * * @codeCoverageIgnore - The method is empty, nothing to test. * * @return void */ public function show() {} /** * Adds an image to the list by image ID. * * @param int $image_id The image ID to add. * * @return void */ public function add_image_by_id( $image_id ) { $attachment = $this->open_graph_image->get_image_by_id( $image_id ); if ( $attachment ) { $this->add_image( $attachment ); } } } images.php 0000644 00000005420 15154325351 0006527 0 ustar 00 <?php namespace Yoast\WP\SEO\Values; use Yoast\WP\SEO\Helpers\Image_Helper; use Yoast\WP\SEO\Helpers\Url_Helper; /** * Class Images * * Value object for the Images. */ class Images { /** * The image size. * * @var string */ public $image_size = 'full'; /** * Holds the images that have been put out as image. * * @var array */ protected $images = []; /** * The image helper. * * @var Image_Helper */ protected $image; /** * The URL helper. * * @var Url_Helper */ protected $url; /** * Images constructor. * * @codeCoverageIgnore * * @param Image_Helper $image The image helper. * @param Url_Helper $url The url helper. */ public function __construct( Image_Helper $image, Url_Helper $url ) { $this->image = $image; $this->url = $url; } /** * Adds an image to the list by image ID. * * @param int $image_id The image ID to add. * * @return void */ public function add_image_by_id( $image_id ) { $image = $this->image->get_attachment_image_source( $image_id, $this->image_size ); if ( $image ) { $this->add_image( $image ); } } /** * Adds an image to the list by image ID. * * @param string $image_meta JSON encoded image meta. * * @return void */ public function add_image_by_meta( $image_meta ) { $this->add_image( (array) \json_decode( $image_meta ) ); } /** * Return the images array. * * @return array The images. */ public function get_images() { return $this->images; } /** * Check whether we have images or not. * * @return bool True if we have images, false if we don't. */ public function has_images() { return ! empty( $this->images ); } /** * Adds an image based on a given URL. * * @param string $url The given URL. * * @return number|null Returns the found image ID if it exists. Otherwise -1. * If the URL is empty we return null. */ public function add_image_by_url( $url ) { if ( empty( $url ) ) { return null; } $image_id = $this->image->get_attachment_by_url( $url ); if ( $image_id ) { $this->add_image_by_id( $image_id ); return $image_id; } $this->add_image( $url ); return -1; } /** * Adds an image to the list of images. * * @param string|array $image Image array. * * @return void */ public function add_image( $image ) { if ( \is_string( $image ) ) { $image = [ 'url' => $image ]; } if ( ! \is_array( $image ) || empty( $image['url'] ) || ! \is_string( $image['url'] ) ) { return; } if ( $this->url->is_relative( $image['url'] ) && $image['url'][0] === '/' ) { $image['url'] = $this->url->build_absolute_url( $image['url'] ); } if ( \array_key_exists( $image['url'], $this->images ) ) { return; } $this->images[ $image['url'] ] = $image; } } meta.php 0000644 00000024567 15155605761 0006234 0 ustar 00 <?php namespace Yoast\WP\SEO\Surfaces\Values; use Exception; use WPSEO_Replace_Vars; use Yoast\WP\SEO\Context\Meta_Tags_Context; use Yoast\WP\SEO\Integrations\Front_End_Integration; use Yoast\WP\SEO\Presenters\Abstract_Indexable_Presenter; use Yoast\WP\SEO\Presenters\Rel_Next_Presenter; use Yoast\WP\SEO\Presenters\Rel_Prev_Presenter; use Yoast\WP\SEO\Surfaces\Helpers_Surface; use YoastSEO_Vendor\Symfony\Component\DependencyInjection\ContainerInterface; /** * Meta value object. * * @property array $breadcrumbs The breadcrumbs array for the current page. * @property string $canonical The canonical URL for the current page. * @property string $company_name The company name from the Knowledge graph settings. * @property int $company_logo_id The attachment ID for the company logo. * @property string $description The meta description for the current page, if set. * @property int $estimated_reading_time_minutes The estimated reading time in minutes for posts. * @property string $main_schema_id Schema ID that points to the main Schema thing on the page, usually the webpage or article Schema piece. * @property string $meta_description The meta description for the current page, if set. * @property string $open_graph_article_author The article:author value. * @property string $open_graph_article_modified_time The article:modified_time value. * @property string $open_graph_article_published_time The article:published_time value. * @property string $open_graph_article_publisher The article:publisher value. * @property string $open_graph_description The og:description. * @property bool $open_graph_enabled Whether OpenGraph is enabled on this site. * @property string $open_graph_fb_app_id The Facebook App ID. * @property array $open_graph_images The array of images we have for this page. * @property string $open_graph_locale The og:locale for the current page. * @property string $open_graph_publisher The OpenGraph publisher reference. * @property string $open_graph_site_name The og:site_name. * @property string $open_graph_title The og:title. * @property string $open_graph_type The og:type. * @property string $open_graph_url The og:url. * @property string $page_type The Schema page type. * @property array $robots An array of the robots values set for the current page. * @property string $rel_next The next page in the series, if any. * @property string $rel_prev The previous page in the series, if any. * @property array $schema The entire Schema array for the current page. * @property string $schema_page_type The Schema page type. * @property string $site_name The site name from the Yoast SEO settings. * @property string $site_represents Whether the site represents a 'person' or a 'company'. * @property array|false $site_represents_reference The schema reference ID for what this site represents. * @property string $site_url The site's main URL. * @property int $site_user_id If the site represents a 'person', this is the ID of the accompanying user profile. * @property string $title The SEO title for the current page. * @property string $twitter_card The Twitter card type for the current page. * @property string $twitter_creator The Twitter card author for the current page. * @property string $twitter_description The Twitter card description for the current page. * @property string $twitter_image The Twitter card image for the current page. * @property string $twitter_site The Twitter card site reference for the current page. * @property string $twitter_title The Twitter card title for the current page. * @property string $wordpress_site_name The site name from the WordPress settings. */ class Meta { /** * The container. * * @var ContainerInterface */ protected $container; /** * The meta tags context. * * @var Meta_Tags_Context */ protected $context; /** * The front end integration. * * @var Front_End_Integration */ protected $front_end; /** * The helpers surface. * * @var Helpers_Surface */ protected $helpers; /** * The replace vars helper * * @var WPSEO_Replace_Vars */ protected $replace_vars; /** * Create a meta value object. * * @param Meta_Tags_Context $context The indexable presentation. * @param ContainerInterface $container The DI container. */ public function __construct( Meta_Tags_Context $context, ContainerInterface $container ) { $this->container = $container; $this->context = $context; $this->helpers = $this->container->get( Helpers_Surface::class ); $this->replace_vars = $this->container->get( WPSEO_Replace_Vars::class ); $this->front_end = $this->container->get( Front_End_Integration::class ); } /** * Returns the output as would be presented in the head. * * @return object The HTML and JSON presentation of the head metadata. */ public function get_head() { $presenters = $this->get_presenters(); /** This filter is documented in src/integrations/front-end-integration.php */ $presentation = \apply_filters( 'wpseo_frontend_presentation', $this->context->presentation, $this->context ); $html_output = ''; $json_head_fields = []; foreach ( $presenters as $presenter ) { $presenter->presentation = $presentation; $presenter->replace_vars = $this->replace_vars; $presenter->helpers = $this->helpers; $html_output .= $this->create_html_presentation( $presenter ); $json_field = $this->create_json_field( $presenter ); // Only use the output of presenters that could successfully present their data. if ( $json_field !== null && ! empty( $json_field->key ) ) { $json_head_fields[ $json_field->key ] = $json_field->value; } } $html_output = \trim( $html_output ); return (object) [ 'html' => $html_output, 'json' => $json_head_fields, ]; } /** * Magic getter for presenting values through the appropriate presenter, if it exists. * * @param string $name The property to get. * * @return mixed The value, as presented by teh appropriate presenter. * * @throws Exception If an invalid property is accessed. */ public function __get( $name ) { /** This filter is documented in src/integrations/front-end-integration.php */ $presentation = \apply_filters( 'wpseo_frontend_presentation', $this->context->presentation, $this->context ); if ( ! isset( $presentation->{$name} ) ) { if ( isset( $this->context->{$name} ) ) { $this->{$name} = $this->context->{$name}; return $this->{$name}; } return null; } $presenter_namespace = 'Yoast\WP\SEO\Presenters\\'; $parts = \explode( '_', $name ); if ( $parts[0] === 'twitter' ) { $presenter_namespace .= 'Twitter\\'; $parts = \array_slice( $parts, 1 ); } elseif ( $parts[0] === 'open' && $parts[1] === 'graph' ) { $presenter_namespace .= 'Open_Graph\\'; $parts = \array_slice( $parts, 2 ); } $presenter_class = $presenter_namespace . \implode( '_', \array_map( 'ucfirst', $parts ) ) . '_Presenter'; if ( \class_exists( $presenter_class ) ) { /** * The indexable presenter. * * @var Abstract_Indexable_Presenter */ $presenter = new $presenter_class(); $presenter->presentation = $presentation; $presenter->helpers = $this->helpers; $presenter->replace_vars = $this->replace_vars; $value = $presenter->get(); } else { $value = $presentation->{$name}; } $this->{$name} = $value; return $this->{$name}; } /** * Magic isset for ensuring properties on the presentation are recognised. * * @param string $name The property to get. * * @return bool Whether or not the requested property exists. */ public function __isset( $name ) { return isset( $this->context->presentation->{$name} ); } /** * Strips all nested dependencies from the debug info. * * @return array */ public function __debugInfo() { return [ 'context' => $this->context ]; } /** * Returns all presenters. * * @return Abstract_Indexable_Presenter[] */ protected function get_presenters() { $presenters = $this->front_end->get_presenters( $this->context->page_type, $this->context ); if ( $this->context->page_type === 'Date_Archive' ) { /** * Define a filter that removes objects of type Rel_Next_Presenter or Rel_Prev_Presenter from a list. * * @param object $presenter The presenter to verify. * * @return bool True if the presenter is not a Rel_Next or Rel_Prev presenter. */ $callback = static function ( $presenter ) { return ! \is_a( $presenter, Rel_Next_Presenter::class ) && ! \is_a( $presenter, Rel_Prev_Presenter::class ); }; $presenters = \array_filter( $presenters, $callback ); } return $presenters; } /** * Uses the presenter to create a line of HTML. * * @param Abstract_Indexable_Presenter $presenter The presenter. * * @return string */ protected function create_html_presentation( $presenter ) { $presenter_output = $presenter->present(); if ( ! empty( $presenter_output ) ) { return $presenter_output . \PHP_EOL; } return ''; } /** * Converts a presenter's key and value to JSON. * * @param Abstract_Indexable_Presenter $presenter The presenter whose key and value are to be converted to JSON. * * @return object|null */ protected function create_json_field( $presenter ) { if ( $presenter->get_key() === 'NO KEY PROVIDED' ) { return null; } $value = $presenter->get(); if ( empty( $value ) ) { return null; } return (object) [ 'key' => $presenter->escape_key(), 'value' => $value, ]; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка