| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/Output.php.tar |
home/xbodynamge/dev/wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Output.php 0000644 00000011644 15114053600 0025245 0 ustar 00 <?php
namespace AIOSEO\Plugin\Common\Sitemap;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Handles outputting the sitemap.
*
* @since 4.0.0
*/
class Output {
/**
* Outputs the sitemap.
*
* @since 4.0.0
*
* @param array $entries The sitemap entries.
* @return void
*/
public function output( $entries ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
if ( ! in_array( aioseo()->sitemap->type, [ 'general', 'rss' ], true ) ) {
return;
}
// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
$entries = aioseo()->sitemap->helpers->decodeSitemapEntries( $entries );
$charset = aioseo()->helpers->getCharset();
$excludeImages = aioseo()->sitemap->helpers->excludeImages();
$generation = ! isset( aioseo()->sitemap->isStatic ) || aioseo()->sitemap->isStatic ? __( 'statically', 'all-in-one-seo-pack' ) : __( 'dynamically', 'all-in-one-seo-pack' );
$version = aioseo()->helpers->getAioseoVersion();
if ( ! empty( $version ) ) {
$version = 'v' . $version;
}
// Clear all output buffers to avoid conflicts.
aioseo()->helpers->clearBuffers();
echo '<?xml version="1.0" encoding="' . esc_attr( $charset ) . "\"?>\r\n";
echo '<!-- ' . sprintf(
// Translators: 1 - "statically" or "dynamically", 2 - The date, 3 - The time, 4 - The plugin name ("All in One SEO"), 5 - Currently installed version.
esc_html__( 'This sitemap was %1$s generated on %2$s at %3$s by %4$s %5$s - the original SEO plugin for WordPress.', 'all-in-one-seo-pack' ),
esc_html( $generation ),
esc_html( date_i18n( get_option( 'date_format' ) ) ),
esc_html( date_i18n( get_option( 'time_format' ) ) ),
esc_html( AIOSEO_PLUGIN_NAME ),
esc_html( $version )
) . ' -->';
if ( 'rss' === aioseo()->sitemap->type ) {
$xslUrl = home_url() . '/default-sitemap.xsl';
if ( ! is_multisite() ) {
$title = get_bloginfo( 'name' );
$description = get_bloginfo( 'blogdescription' );
$link = home_url();
} else {
$title = get_blog_option( get_current_blog_id(), 'blogname' );
$description = get_blog_option( get_current_blog_id(), 'blogdescription' );
$link = get_blog_option( get_current_blog_id(), 'siteurl' );
}
$ttl = apply_filters( 'aioseo_sitemap_rss_ttl', 60 );
echo "\r\n\r\n<?xml-stylesheet type=\"text/xsl\" href=\"" . esc_url( $xslUrl ) . "\"?>\r\n";
include_once AIOSEO_DIR . '/app/Common/Views/sitemap/xml/rss.php';
return;
}
if ( 'root' === aioseo()->sitemap->indexName && aioseo()->sitemap->indexes ) {
$xslUrl = add_query_arg( 'sitemap', aioseo()->sitemap->indexName, home_url() . '/default-sitemap.xsl' );
echo "\r\n\r\n<?xml-stylesheet type=\"text/xsl\" href=\"" . esc_url( $xslUrl ) . "\"?>\r\n";
include AIOSEO_DIR . '/app/Common/Views/sitemap/xml/root.php';
return;
}
$xslUrl = add_query_arg( 'sitemap', aioseo()->sitemap->indexName, home_url() . '/default-sitemap.xsl' );
echo "\r\n\r\n<?xml-stylesheet type=\"text/xsl\" href=\"" . esc_url( $xslUrl ) . "\"?>\r\n";
include AIOSEO_DIR . '/app/Common/Views/sitemap/xml/default.php';
}
/**
* Escapes and echoes the given XML tag value.
*
* @since 4.0.0
*
* @param string $value The tag value.
* @param bool $wrap Whether the value should we wrapped in a CDATA section.
* @return void
*/
public function escapeAndEcho( $value, $wrap = true ) {
$safeText = is_string( $value ) ? wp_check_invalid_utf8( $value, true ) : $value;
$isZero = is_numeric( $value ) ? 0 === (int) $value : false;
if ( ! $safeText && ! $isZero ) {
return;
}
$cdataRegex = '\<\!\[CDATA\[.*?\]\]\>';
$regex = "/(?=.*?{$cdataRegex})(?<non_cdata_followed_by_cdata>(.*?))(?<cdata>({$cdataRegex}))|(?<non_cdata>(.*))/sx";
$safeText = (string) preg_replace_callback(
$regex,
static function( $matches ) {
if ( ! $matches[0] ) {
return '';
}
if ( ! empty( $matches['non_cdata'] ) ) {
// Escape HTML entities in the non-CDATA section.
return _wp_specialchars( $matches['non_cdata'], ENT_XML1 );
}
// Return the CDATA Section unchanged, escape HTML entities in the rest.
return _wp_specialchars( $matches['non_cdata_followed_by_cdata'], ENT_XML1 ) . $matches['cdata'];
},
$safeText
);
$safeText = $safeText ? $safeText : ( $isZero ? $value : '' );
if ( ! $wrap ) {
return print( $safeText ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
printf( '<![CDATA[%1$s]]>', $safeText ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Returns the URL for the sitemap stylesheet.
*
* This is needed for compatibility with multilingual plugins such as WPML.
*
* @since 4.0.0
*
* @return string The URL to the sitemap stylesheet.
*/
private function xslUrl() {
return esc_url( apply_filters( 'aioseo_sitemap_xsl_url', aioseo()->helpers->localizedUrl( '/sitemap.xsl' ) ) );
}
} home/xbodynamge/dev/wp-content/plugins/all-in-one-seo-pack/app/Common/Social/Output.php 0000644 00000011065 15114613344 0025061 0 ustar 00 <?php
namespace AIOSEO\Plugin\Common\Social;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
use AIOSEO\Plugin\Common\Integrations\BuddyPress as BuddyPressIntegration;
/**
* Outputs our social meta.
*
* @since 4.0.0
*/
class Output {
/**
* Checks if the current page should have social meta.
*
* @since 4.0.0
*
* @return bool Whether or not the page should have social meta.
*/
public function isAllowed() {
if ( BuddyPressIntegration::isComponentPage() ) {
return false;
}
if (
! is_front_page() &&
! is_home() &&
! is_singular() &&
! is_post_type_archive() &&
! aioseo()->helpers->isWooCommerceShopPage()
) {
return false;
}
return true;
}
/**
* Returns the Open Graph meta.
*
* @since 4.0.0
*
* @return array The Open Graph meta.
*/
public function getFacebookMeta() {
if ( ! $this->isAllowed() || ! aioseo()->options->social->facebook->general->enable ) {
return [];
}
$meta = [
'og:locale' => aioseo()->social->facebook->getLocale(),
'og:site_name' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->facebook->getSiteName() ),
'og:type' => aioseo()->social->facebook->getObjectType(),
'og:title' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->facebook->getTitle() ),
'og:description' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->facebook->getDescription() ),
'og:url' => esc_url( aioseo()->helpers->canonicalUrl() ),
'fb:app_id' => aioseo()->options->social->facebook->advanced->appId,
'fb:admins' => implode( ',', array_map( 'trim', explode( ',', aioseo()->options->social->facebook->advanced->adminId ) ) ),
];
$image = aioseo()->social->facebook->getImage();
if ( $image ) {
$image = is_array( $image ) ? $image[0] : $image;
$image = aioseo()->helpers->makeUrlAbsolute( $image );
$image = set_url_scheme( esc_url( $image ) );
$meta += [
'og:image' => $image,
'og:image:secure_url' => is_ssl() ? $image : '',
'og:image:width' => aioseo()->social->facebook->getImageWidth(),
'og:image:height' => aioseo()->social->facebook->getImageHeight(),
];
}
$video = aioseo()->social->facebook->getVideo();
if ( $video ) {
$video = set_url_scheme( esc_url( $video ) );
$meta += [
'og:video' => $video,
'og:video:secure_url' => is_ssl() ? $video : '',
'og:video:width' => aioseo()->social->facebook->getVideoWidth(),
'og:video:height' => aioseo()->social->facebook->getVideoHeight(),
];
}
if ( ! empty( $meta['og:type'] ) && 'article' === $meta['og:type'] ) {
$meta += [
'article:section' => aioseo()->social->facebook->getSection(),
'article:tag' => aioseo()->social->facebook->getArticleTags(),
'article:published_time' => aioseo()->social->facebook->getPublishedTime(),
'article:modified_time' => aioseo()->social->facebook->getModifiedTime(),
'article:publisher' => aioseo()->social->facebook->getPublisher(),
'article:author' => aioseo()->social->facebook->getAuthor()
];
}
return array_filter( apply_filters( 'aioseo_facebook_tags', $meta ) );
}
/**
* Returns the Twitter meta.
*
* @since 4.0.0
*
* @return array The Twitter meta.
*/
public function getTwitterMeta() {
if ( ! $this->isAllowed() || ! aioseo()->options->social->twitter->general->enable ) {
return [];
}
$meta = [
'twitter:card' => aioseo()->social->twitter->getCardType(),
'twitter:site' => aioseo()->social->twitter->prepareUsername( aioseo()->social->twitter->getTwitterUrl() ),
'twitter:title' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->twitter->getTitle() ),
'twitter:description' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->twitter->getDescription() ),
'twitter:creator' => aioseo()->social->twitter->getCreator()
];
$image = aioseo()->social->twitter->getImage();
if ( $image ) {
$image = is_array( $image ) ? $image[0] : $image;
$image = aioseo()->helpers->makeUrlAbsolute( $image );
// Set the twitter image meta.
$meta['twitter:image'] = $image;
}
if ( is_singular() ) {
$additionalData = apply_filters( 'aioseo_social_twitter_additional_data', aioseo()->social->twitter->getAdditionalData() );
if ( $additionalData ) {
$i = 1;
foreach ( $additionalData as $data ) {
$meta[ "twitter:label$i" ] = $data['label'];
$meta[ "twitter:data$i" ] = $data['value'];
$i++;
}
}
}
return array_filter( apply_filters( 'aioseo_twitter_tags', $meta ) );
}
} home/xbodynamge/namtation/wp-content/plugins/all-in-one-seo-pack/app/Common/Social/Output.php 0000644 00000011065 15114636446 0026305 0 ustar 00 <?php
namespace AIOSEO\Plugin\Common\Social;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
use AIOSEO\Plugin\Common\Integrations\BuddyPress as BuddyPressIntegration;
/**
* Outputs our social meta.
*
* @since 4.0.0
*/
class Output {
/**
* Checks if the current page should have social meta.
*
* @since 4.0.0
*
* @return bool Whether or not the page should have social meta.
*/
public function isAllowed() {
if ( BuddyPressIntegration::isComponentPage() ) {
return false;
}
if (
! is_front_page() &&
! is_home() &&
! is_singular() &&
! is_post_type_archive() &&
! aioseo()->helpers->isWooCommerceShopPage()
) {
return false;
}
return true;
}
/**
* Returns the Open Graph meta.
*
* @since 4.0.0
*
* @return array The Open Graph meta.
*/
public function getFacebookMeta() {
if ( ! $this->isAllowed() || ! aioseo()->options->social->facebook->general->enable ) {
return [];
}
$meta = [
'og:locale' => aioseo()->social->facebook->getLocale(),
'og:site_name' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->facebook->getSiteName() ),
'og:type' => aioseo()->social->facebook->getObjectType(),
'og:title' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->facebook->getTitle() ),
'og:description' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->facebook->getDescription() ),
'og:url' => esc_url( aioseo()->helpers->canonicalUrl() ),
'fb:app_id' => aioseo()->options->social->facebook->advanced->appId,
'fb:admins' => implode( ',', array_map( 'trim', explode( ',', aioseo()->options->social->facebook->advanced->adminId ) ) ),
];
$image = aioseo()->social->facebook->getImage();
if ( $image ) {
$image = is_array( $image ) ? $image[0] : $image;
$image = aioseo()->helpers->makeUrlAbsolute( $image );
$image = set_url_scheme( esc_url( $image ) );
$meta += [
'og:image' => $image,
'og:image:secure_url' => is_ssl() ? $image : '',
'og:image:width' => aioseo()->social->facebook->getImageWidth(),
'og:image:height' => aioseo()->social->facebook->getImageHeight(),
];
}
$video = aioseo()->social->facebook->getVideo();
if ( $video ) {
$video = set_url_scheme( esc_url( $video ) );
$meta += [
'og:video' => $video,
'og:video:secure_url' => is_ssl() ? $video : '',
'og:video:width' => aioseo()->social->facebook->getVideoWidth(),
'og:video:height' => aioseo()->social->facebook->getVideoHeight(),
];
}
if ( ! empty( $meta['og:type'] ) && 'article' === $meta['og:type'] ) {
$meta += [
'article:section' => aioseo()->social->facebook->getSection(),
'article:tag' => aioseo()->social->facebook->getArticleTags(),
'article:published_time' => aioseo()->social->facebook->getPublishedTime(),
'article:modified_time' => aioseo()->social->facebook->getModifiedTime(),
'article:publisher' => aioseo()->social->facebook->getPublisher(),
'article:author' => aioseo()->social->facebook->getAuthor()
];
}
return array_filter( apply_filters( 'aioseo_facebook_tags', $meta ) );
}
/**
* Returns the Twitter meta.
*
* @since 4.0.0
*
* @return array The Twitter meta.
*/
public function getTwitterMeta() {
if ( ! $this->isAllowed() || ! aioseo()->options->social->twitter->general->enable ) {
return [];
}
$meta = [
'twitter:card' => aioseo()->social->twitter->getCardType(),
'twitter:site' => aioseo()->social->twitter->prepareUsername( aioseo()->social->twitter->getTwitterUrl() ),
'twitter:title' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->twitter->getTitle() ),
'twitter:description' => aioseo()->helpers->encodeOutputHtml( aioseo()->social->twitter->getDescription() ),
'twitter:creator' => aioseo()->social->twitter->getCreator()
];
$image = aioseo()->social->twitter->getImage();
if ( $image ) {
$image = is_array( $image ) ? $image[0] : $image;
$image = aioseo()->helpers->makeUrlAbsolute( $image );
// Set the twitter image meta.
$meta['twitter:image'] = $image;
}
if ( is_singular() ) {
$additionalData = apply_filters( 'aioseo_social_twitter_additional_data', aioseo()->social->twitter->getAdditionalData() );
if ( $additionalData ) {
$i = 1;
foreach ( $additionalData as $data ) {
$meta[ "twitter:label$i" ] = $data['label'];
$meta[ "twitter:data$i" ] = $data['value'];
$i++;
}
}
}
return array_filter( apply_filters( 'aioseo_twitter_tags', $meta ) );
}
} home/xbodynamge/namtation/wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Output.php 0000644 00000011644 15115040635 0026466 0 ustar 00 <?php
namespace AIOSEO\Plugin\Common\Sitemap;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Handles outputting the sitemap.
*
* @since 4.0.0
*/
class Output {
/**
* Outputs the sitemap.
*
* @since 4.0.0
*
* @param array $entries The sitemap entries.
* @return void
*/
public function output( $entries ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
if ( ! in_array( aioseo()->sitemap->type, [ 'general', 'rss' ], true ) ) {
return;
}
// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
$entries = aioseo()->sitemap->helpers->decodeSitemapEntries( $entries );
$charset = aioseo()->helpers->getCharset();
$excludeImages = aioseo()->sitemap->helpers->excludeImages();
$generation = ! isset( aioseo()->sitemap->isStatic ) || aioseo()->sitemap->isStatic ? __( 'statically', 'all-in-one-seo-pack' ) : __( 'dynamically', 'all-in-one-seo-pack' );
$version = aioseo()->helpers->getAioseoVersion();
if ( ! empty( $version ) ) {
$version = 'v' . $version;
}
// Clear all output buffers to avoid conflicts.
aioseo()->helpers->clearBuffers();
echo '<?xml version="1.0" encoding="' . esc_attr( $charset ) . "\"?>\r\n";
echo '<!-- ' . sprintf(
// Translators: 1 - "statically" or "dynamically", 2 - The date, 3 - The time, 4 - The plugin name ("All in One SEO"), 5 - Currently installed version.
esc_html__( 'This sitemap was %1$s generated on %2$s at %3$s by %4$s %5$s - the original SEO plugin for WordPress.', 'all-in-one-seo-pack' ),
esc_html( $generation ),
esc_html( date_i18n( get_option( 'date_format' ) ) ),
esc_html( date_i18n( get_option( 'time_format' ) ) ),
esc_html( AIOSEO_PLUGIN_NAME ),
esc_html( $version )
) . ' -->';
if ( 'rss' === aioseo()->sitemap->type ) {
$xslUrl = home_url() . '/default-sitemap.xsl';
if ( ! is_multisite() ) {
$title = get_bloginfo( 'name' );
$description = get_bloginfo( 'blogdescription' );
$link = home_url();
} else {
$title = get_blog_option( get_current_blog_id(), 'blogname' );
$description = get_blog_option( get_current_blog_id(), 'blogdescription' );
$link = get_blog_option( get_current_blog_id(), 'siteurl' );
}
$ttl = apply_filters( 'aioseo_sitemap_rss_ttl', 60 );
echo "\r\n\r\n<?xml-stylesheet type=\"text/xsl\" href=\"" . esc_url( $xslUrl ) . "\"?>\r\n";
include_once AIOSEO_DIR . '/app/Common/Views/sitemap/xml/rss.php';
return;
}
if ( 'root' === aioseo()->sitemap->indexName && aioseo()->sitemap->indexes ) {
$xslUrl = add_query_arg( 'sitemap', aioseo()->sitemap->indexName, home_url() . '/default-sitemap.xsl' );
echo "\r\n\r\n<?xml-stylesheet type=\"text/xsl\" href=\"" . esc_url( $xslUrl ) . "\"?>\r\n";
include AIOSEO_DIR . '/app/Common/Views/sitemap/xml/root.php';
return;
}
$xslUrl = add_query_arg( 'sitemap', aioseo()->sitemap->indexName, home_url() . '/default-sitemap.xsl' );
echo "\r\n\r\n<?xml-stylesheet type=\"text/xsl\" href=\"" . esc_url( $xslUrl ) . "\"?>\r\n";
include AIOSEO_DIR . '/app/Common/Views/sitemap/xml/default.php';
}
/**
* Escapes and echoes the given XML tag value.
*
* @since 4.0.0
*
* @param string $value The tag value.
* @param bool $wrap Whether the value should we wrapped in a CDATA section.
* @return void
*/
public function escapeAndEcho( $value, $wrap = true ) {
$safeText = is_string( $value ) ? wp_check_invalid_utf8( $value, true ) : $value;
$isZero = is_numeric( $value ) ? 0 === (int) $value : false;
if ( ! $safeText && ! $isZero ) {
return;
}
$cdataRegex = '\<\!\[CDATA\[.*?\]\]\>';
$regex = "/(?=.*?{$cdataRegex})(?<non_cdata_followed_by_cdata>(.*?))(?<cdata>({$cdataRegex}))|(?<non_cdata>(.*))/sx";
$safeText = (string) preg_replace_callback(
$regex,
static function( $matches ) {
if ( ! $matches[0] ) {
return '';
}
if ( ! empty( $matches['non_cdata'] ) ) {
// Escape HTML entities in the non-CDATA section.
return _wp_specialchars( $matches['non_cdata'], ENT_XML1 );
}
// Return the CDATA Section unchanged, escape HTML entities in the rest.
return _wp_specialchars( $matches['non_cdata_followed_by_cdata'], ENT_XML1 ) . $matches['cdata'];
},
$safeText
);
$safeText = $safeText ? $safeText : ( $isZero ? $value : '' );
if ( ! $wrap ) {
return print( $safeText ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
printf( '<![CDATA[%1$s]]>', $safeText ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Returns the URL for the sitemap stylesheet.
*
* This is needed for compatibility with multilingual plugins such as WPML.
*
* @since 4.0.0
*
* @return string The URL to the sitemap stylesheet.
*/
private function xslUrl() {
return esc_url( apply_filters( 'aioseo_sitemap_xsl_url', aioseo()->helpers->localizedUrl( '/sitemap.xsl' ) ) );
}
}