| Server IP : 213.186.33.4 / Your IP : 216.73.216.146 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/plugins/glaza-core/includes/ |
Upload File : |
<?php
/**
* opengraph meta
*/
if ( ! function_exists( 'glaza_opengraph_meta' ) ) :
function glaza_opengraph_meta() {
if ( ! is_single() ) {
return false;
}
if ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) {
$yoast_social = get_option( 'wpseo_social' );
if ( ! empty( $yoast_social['opengraph'] ) ) {
return false;
}
}
global $post;
$open_graph = glaza_get_option( 'open_graph' );
$app_id = glaza_get_option( 'app_id' );
if ( empty( $open_graph ) ) {
return false;
}
if ( ! empty( $post->post_excerpt ) ) {
$post_excerpt = $post->post_excerpt;
} else {
$post_content = preg_replace( '`\[[^\]]*\]`', '', $post->post_content );
$post_content = stripslashes( wp_filter_nohtml_kses( $post_content ) );
$post_excerpt = wp_trim_words( esc_html( $post_content ), 30, '' );
} ?>
<meta property="og:title" content="<?php echo esc_attr( get_the_title() ); ?>"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="<?php echo get_permalink(); ?>"/>
<meta property="og:site_name" content="<?php bloginfo( 'name' ); ?>"/>
<meta property="og:description" content="<?php echo esc_attr( $post_excerpt ); ?>"/>
<?php if ( has_post_thumbnail( $post->ID ) ) :
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'glaza_crop_1200x0' ); ?>
<meta property="og:image" content="<?php echo esc_url( $thumbnail_src[0] ); ?>"/>
<?php
else :
$logo = glaza_get_option( 'header_logo' );
if ( ! empty( $logo['url'] ) ): ?>
<meta property="og:image" content="<?php echo esc_url( $logo['url'] ); ?>"/>
<?php endif;
endif;
if ( ! empty( $app_id ) ) : ?>
<meta property="fb:app_id" content="<?php echo esc_attr( $app_id ); ?>"/>
<?php endif;
return false;
}
endif;
add_action( 'wp_head', 'glaza_opengraph_meta', 10 );
/**
* microdata_markup
*/
if ( ! function_exists( 'glaza_microdata_markup' ) ) :
function glaza_microdata_markup() {
$markup = glaza_get_option( 'microdata_markup' );
if ( empty( $markup ) ) {
return false;
}
$post_id = get_the_ID();
$protocol = 'http';
if ( is_ssl() ) {
$protocol = 'https';
}
$publisher = get_the_author_meta( 'display_name' );
if ( empty( $publisher ) ) {
$publisher = get_bloginfo( 'name' );
}
$logo = glaza_get_option( 'header_logo' );
if ( ! empty( $logo['url'] ) ) {
$publisher_logo = esc_url( $logo['url'] );
}
$attachment = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' );
$enable_review = get_post_meta( $post_id, 'glaza_meta_review_enable', true );
$total_score = get_post_meta( $post_id, 'glaza_as', true );
?>
<meta itemscope itemprop="mainEntityOfPage" itemType="<?php echo esc_attr( $protocol ); ?>://schema.org/WebPage" itemid="<?php echo get_permalink(); ?>"/>
<meta itemprop="headline " content="<?php echo esc_attr( get_the_title() ); ?>">
<span style="display: none;" itemprop="author" itemscope itemtype="<?php echo esc_attr( $protocol ); ?>://schema.org/Person">
<meta itemprop="name" content="<?php echo esc_attr( get_the_author_meta( 'display_name' ) ); ?>">
</span>
<span style="display: none;" itemprop="image" itemscope itemtype="<?php echo esc_attr( $protocol ); ?>://schema.org/ImageObject">
<meta itemprop="url" content="<?php echo esc_url( $attachment[0] ); ?>">
<meta itemprop="width" content="<?php echo esc_attr( $attachment[1] ); ?>">
<meta itemprop="height" content="<?php echo esc_attr( $attachment[2] ); ?>">
</span>
<?php if ( ! empty( $publisher_logo ) && ! empty( $publisher ) ) : ?>
<span style="display: none;" itemprop="publisher" itemscope itemtype="<?php echo esc_attr( $protocol ); ?>://schema.org/Organization">
<span style="display: none;" itemprop="logo" itemscope itemtype="<?php echo esc_attr( $protocol ); ?>://schema.org/ImageObject">
<meta itemprop="url" content="<?php echo esc_url( $publisher_logo ); ?>">
<meta itemprop="name" content="<?php echo esc_attr( $publisher ); ?>">
</span>
</span>
<?php endif; ?>
<meta itemprop="datePublished" content="<?php echo get_the_time( 'U' ); ?>"/>
<meta itemprop="dateModified" content="<?php echo get_the_modified_time( 'U' ); ?>"/>
<?php if ( ! empty( $enable_review ) && ! empty( $total_score ) ):
$review_summary = get_post_meta( $post_id, 'glaza_review_summary', true );
?>
<span itemprop="itemReviewed" itemscope itemtype="<?php echo esc_attr( $protocol ); ?>://schema.org/Thing">
<meta itemprop="name " content="<?php echo esc_attr( get_the_title() ); ?>">
</span>
<meta itemprop="reviewBody" content="<?php esc_attr( $review_summary ); ?>">
<span style="display: none;" itemprop="reviewRating" itemscope itemtype="<?php echo esc_attr( $protocol ); ?>://schema.org/Rating">
<meta itemprop="worstRating" content="1">
<meta itemprop="ratingValue" content="<?php echo esc_attr( $total_score ); ?>">
<meta itemprop="bestRating" content="10">
</span>
<?php endif;
}
endif;