$94 GRAYBYTE WORDPRESS FILE MANAGER $32

SERVER : premium134.web-hosting.com #1 SMP Thu Mar 13 14:29:12 UTC 2025
SERVER IP : 162.0.232.104 | ADMIN IP 216.73.216.173
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/raydofqv/raydget.vip/wp-content/plugins/jetpack/

HOME
Current File : /home/raydofqv/raydget.vip/wp-content/plugins/jetpack//enhanced-open-graph.php
<?php
/**
 * Enhanced Open Graph for Jetpack.
 *
 * @package automattic/jetpack
 */

use Automattic\Jetpack\Post_Media\Images;

if ( ! defined( 'ABSPATH' ) ) {
	exit( 0 );
}

if ( ! class_exists( 'Jetpack_Media_Summary' ) ) {
	require_once JETPACK__PLUGIN_DIR . '_inc/lib/class.media-summary.php';
}

/**
 * Better OG Image Tags for Image Post Formats
 *
 * @param array $tags Array of Open Graph tags.
 */
function enhanced_og_image( $tags ) {
	if ( ! is_singular() || post_password_required() ) {
		return $tags;
	}

	global $post;

	// Bail if we do not have info about the post.
	if ( ! $post instanceof WP_Post ) {
		return $tags;
	}

	// Always favor featured images.
	if ( enhanced_og_has_featured_image( $post->ID ) ) {
		return $tags;
	}

	$summary = Jetpack_Media_Summary::get(
		$post->ID,
		0,
		array(
			'include_excerpt' => false,
			'include_count'   => false,
		)
	);

	if ( 'image' !== $summary['type'] ) {
		return $tags;
	}

	$tags['og:image']            = $summary['image'];
	$tags['og:image:secure_url'] = $summary['secure']['image'];

	return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'enhanced_og_image' );

/**
 * Better OG Image Tags for Gallery Post Formats
 *
 * @param array $tags Array of Open Graph tags.
 */
function enhanced_og_gallery( $tags ) {
	if ( ! is_singular() || post_password_required() ) {
		return $tags;
	}

	global $post;

	// Bail if we do not have info about the post.
	if ( ! $post instanceof WP_Post ) {
		return $tags;
	}

	// Always favor featured images.
	if ( enhanced_og_has_featured_image( $post->ID ) ) {
		return $tags;
	}

	$summary = Jetpack_Media_Summary::get(
		$post->ID,
		0,
		array(
			'include_excerpt' => false,
			'include_count'   => false,
		)
	);

	if ( 'gallery' !== $summary['type'] ) {
		return $tags;
	}

	if ( ! isset( $summary['images'] ) || ! is_array( $summary['images'] ) || empty( $summary['images'] ) ) {
		return $tags;
	}

	$images  = array();
	$secures = array();

	foreach ( $summary['images'] as $i => $image ) {
		$images[]  = $image['url'];
		$secures[] = $summary['secure']['images'][ $i ]['url'];
	}

	$tags['og:image']            = $images;
	$tags['og:image:secure_url'] = $secures;

	return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'enhanced_og_gallery' );

/**
 * Allows VideoPress, YouTube, and Vimeo videos to play inline on Facebook
 *
 * @param array $tags Array of Open Graph tags.
 */
function enhanced_og_video( $tags ) {
	if ( ! is_singular() || post_password_required() ) {
		return $tags;
	}

	global $post;

	// Bail if we do not have info about the post.
	if ( ! $post instanceof WP_Post ) {
		return $tags;
	}

	// Always favor featured images.
	if ( enhanced_og_has_featured_image( $post->ID ) ) {
		return $tags;
	}

	$summary = Jetpack_Media_Summary::get(
		$post->ID,
		0,
		array(
			'include_excerpt' => false,
			'include_count'   => false,
		)
	);

	if ( 'video' !== $summary['type'] ) {
		if ( $summary['count']['video'] > 0 && $summary['count']['image'] < 1 ) {
			$tags['og:image']            = $summary['image'];
			$tags['og:image:secure_url'] = $summary['secure']['image'];
		}
		return $tags;
	}

	$tags['og:image']            = $summary['image'];
	$tags['og:image:secure_url'] = $summary['secure']['image'];

	// This should be html by default for youtube/vimeo, since we're linking to HTML pages.
	$tags['og:video:type'] = isset( $summary['video_type'] ) ? $summary['video_type'] : 'text/html';

	$video_url        = $summary['video'];
	$secure_video_url = $summary['secure']['video'];

	if ( preg_match( '/((youtube|vimeo)\.com|youtu.be)/', $video_url ) ) {
		if ( strstr( $video_url, 'youtube' ) ) {
			$id               = jetpack_get_youtube_id( $video_url );
			$video_url        = 'http://www.youtube.com/embed/' . $id;
			$secure_video_url = 'https://www.youtube.com/embed/' . $id;
		} elseif ( strstr( $video_url, 'vimeo' ) ) {
			preg_match( '|vimeo\.com/(\d+)/?$|i', $video_url, $match );
			if ( isset( $match[1] ) ) {
				$id               = (int) $match[1];
				$video_url        = 'http://vimeo.com/moogaloop.swf?clip_id=' . $id;
				$secure_video_url = 'https://vimeo.com/moogaloop.swf?clip_id=' . $id;
			}
		}
	}

	$tags['og:video']            = $video_url;
	$tags['og:video:secure_url'] = $secure_video_url;

	if ( empty( $post->post_title ) ) {
		/* translators: %s is the name of the site */
		$tags['og:title'] = sprintf( __( 'Video on %s', 'jetpack' ), get_option( 'blogname' ) );
	}

	return $tags;
}
add_filter( 'jetpack_open_graph_tags', 'enhanced_og_video' );

/**
 * Check if a post has a suitable featured image.
 *
 * @param int $post_id The post ID to check.
 * @return bool True if the post has a suitable featured image, false otherwise.
 */
function enhanced_og_has_featured_image( $post_id ) {
	return ! empty( Images::from_thumbnail( $post_id ) );
}


Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
11 Jun 2026 2.40 PM
raydofqv / raydofqv
0755
3rd-party
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
_inc
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
css
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
extensions
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
images
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
jetpack_vendor
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
json-endpoints
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
modules
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
sal
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
src
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
vendor
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
views
--
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0755
.htaccess
0.231 KB
8 Jun 2026 8.15 AM
raydofqv / raydofqv
0555
CHANGELOG.md
759.954 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
LICENSE.txt
18.199 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
SECURITY.md
2.447 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class-jetpack-connection-status.php
0.711 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class-jetpack-gallery-settings.php
3.474 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class-jetpack-newsletter-dashboard-widget.php
0.426 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class-jetpack-pre-connection-jitms.php
2.338 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class-jetpack-stats-dashboard-widget.php
7.457 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class-jetpack-xmlrpc-methods.php
7.383 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.frame-nonce-preview.php
3.217 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-admin.php
21.087 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-autoupdate.php
9.929 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-cli.php
74.319 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-client-server.php
2.621 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-gutenberg.php
45.75 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-heartbeat.php
4.441 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-modules-list-table.php
14.813 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-network-sites-list-table.php
6.028 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-network.php
21.081 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-plan.php
4.094 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-post-images.php
38.536 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-twitter-cards.php
5.692 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack-user-agent.php
25.304 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.jetpack.php
204.667 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.json-api-endpoints.php
91.355 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.json-api.php
38.305 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
class.photon.php
1.736 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
composer.json
4.244 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
enhanced-open-graph.php
4.71 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
functions.compat.php
4.336 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
functions.cookies.php
2.038 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
functions.global.php
13.905 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
functions.is-mobile.php
2.47 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
functions.opengraph.php
30.789 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
functions.photon.php
3.037 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
jetpack.php
8.917 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
json-api-config.php
0.33 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
json-endpoints.php
6.925 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
load-jetpack.php
3.559 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
locales.php
0.362 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
readme.txt
34.262 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
unauth-file-upload.php
5.854 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
uninstall.php
1.649 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644
wpml-config.xml
1.259 KB
16 Mar 2026 4.43 PM
raydofqv / raydofqv
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF