| Server IP : 151.101.66.159 / Your IP : 216.73.216.66 Web Server : Flywheel/5.1.0 System : Linux wordpress 6.12.113+ #1 SMP Thu Oct 22 02:38:20 UTC 2026 x86_64 User : root ( ) PHP Version : 7.4.33.18 Disable Function : disk_free_space,diskfreespace,dl,exec,fpassthru,getmypid,getmyuid,highlight_file,link,opcache_compile_file,opcache_get_configuration,opcache_is_script_cached,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,phpinfo,popen,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,socket_listen,source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wp-content/plugins/wordpress-seo/src/editors/framework/site/ |
Upload File : |
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
namespace Yoast\WP\SEO\Editors\Framework\Site;
use Exception;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Product_Helper;
use Yoast\WP\SEO\Helpers\Short_Link_Helper;
use Yoast\WP\SEO\Introductions\Infrastructure\Wistia_Embed_Permission_Repository;
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
use Yoast\WP\SEO\Surfaces\Meta_Surface;
/**
* The Base_Site_Information class.
*/
abstract class Base_Site_Information {
/**
* The short link helper.
*
* @var Short_Link_Helper
*/
protected $short_link_helper;
/**
* The wistia embed permission repository.
*
* @var Wistia_Embed_Permission_Repository
*/
protected $wistia_embed_permission_repository;
/**
* The meta surface.
*
* @var Meta_Surface
*/
protected $meta;
/**
* The product helper.
*
* @var Product_Helper
*/
protected $product_helper;
/**
* The options helper.
*
* @var Options_Helper
*/
protected $options_helper;
/**
* The promotion manager.
*
* @var Promotion_Manager
*/
protected $promotion_manager;
/**
* The constructor.
*
* @param Short_Link_Helper $short_link_helper The short link helper.
* @param Wistia_Embed_Permission_Repository $wistia_embed_permission_repository The wistia embed permission
* repository.
* @param Meta_Surface $meta The meta surface.
* @param Product_Helper $product_helper The product helper.
* @param Options_Helper $options_helper The options helper.
* @param Promotion_Manager $promotion_manager The promotion manager.
*/
public function __construct(
Short_Link_Helper $short_link_helper,
Wistia_Embed_Permission_Repository $wistia_embed_permission_repository,
Meta_Surface $meta,
Product_Helper $product_helper,
Options_Helper $options_helper,
Promotion_Manager $promotion_manager
) {
$this->short_link_helper = $short_link_helper;
$this->wistia_embed_permission_repository = $wistia_embed_permission_repository;
$this->meta = $meta;
$this->product_helper = $product_helper;
$this->options_helper = $options_helper;
$this->promotion_manager = $promotion_manager;
}
/**
* Returns site information that is the
*
* @return array<string, string|array<string, string>>
*
* @throws Exception If an invalid user ID is supplied to the wistia repository.
*/
public function get_site_information(): array {
return [
'adminUrl' => \admin_url( 'admin.php' ),
'linkParams' => $this->short_link_helper->get_query_params(),
'pluginUrl' => \plugins_url( '', \WPSEO_FILE ),
'wistiaEmbedPermission' => $this->wistia_embed_permission_repository->get_value_for_user( \get_current_user_id() ),
'site_name' => $this->meta->for_current_page()->site_name,
'contentLocale' => \get_locale(),
'userLocale' => \get_user_locale(),
'isRtl' => \is_rtl(),
'isPremium' => $this->product_helper->is_premium(),
'siteIconUrl' => \get_site_icon_url(),
'showSocial' => [
'facebook' => $this->options_helper->get( 'opengraph', false ),
'twitter' => $this->options_helper->get( 'twitter', false ),
],
'sitewideSocialImage' => $this->options_helper->get( 'og_default_image' ),
// phpcs:ignore Generic.ControlStructures.DisallowYodaConditions -- Bug: squizlabs/PHP_CodeSniffer#2962.
'isPrivateBlog' => ( (string) \get_option( 'blog_public' ) ) === '0',
'currentPromotions' => $this->promotion_manager->get_current_promotions(),
];
}
/**
* Returns site information that is the
*
* @return array<string, string|array<string, string|array<string, string>>>
*
* @throws Exception If an invalid user ID is supplied to the wistia repository.
*/
public function get_legacy_site_information(): array {
return [
'adminUrl' => \admin_url( 'admin.php' ),
'linkParams' => $this->short_link_helper->get_query_params(),
'pluginUrl' => \plugins_url( '', \WPSEO_FILE ),
'wistiaEmbedPermission' => $this->wistia_embed_permission_repository->get_value_for_user( \get_current_user_id() ),
'sitewideSocialImage' => $this->options_helper->get( 'og_default_image' ),
// phpcs:ignore Generic.ControlStructures.DisallowYodaConditions -- Bug: squizlabs/PHP_CodeSniffer#2962.
'isPrivateBlog' => ( (string) \get_option( 'blog_public' ) ) === '0',
'currentPromotions' => $this->promotion_manager->get_current_promotions(),
'metabox' => [
'site_name' => $this->meta->for_current_page()->site_name,
'contentLocale' => \get_locale(),
'userLocale' => \get_user_locale(),
'isRtl' => \is_rtl(),
'isPremium' => $this->product_helper->is_premium(),
'siteIconUrl' => \get_site_icon_url(),
'showSocial' => [
'facebook' => $this->options_helper->get( 'opengraph', false ),
'twitter' => $this->options_helper->get( 'twitter', false ),
],
],
];
}
}