404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.238.184: ~ $
<?php
/**
 * Enhanced Open Graph for Jetpack.
 *
 * @package automattic/jetpack
 */

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 );

	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 );

	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 );

	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 );
			$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( Jetpack_PostImages::from_thumbnail( $post_id ) );
}

Filemanager

Name Type Size Permission Actions
3rd-party Folder 0755
_inc Folder 0755
css Folder 0755
extensions Folder 0755
images Folder 0755
jetpack_vendor Folder 0755
json-endpoints Folder 0755
modules Folder 0755
sal Folder 0755
src Folder 0755
vendor Folder 0755
views Folder 0755
CHANGELOG.md File 572 KB 0644
LICENSE.txt File 17.98 KB 0644
SECURITY.md File 2.45 KB 0644
class-jetpack-connection-status.php File 728 B 0644
class-jetpack-connection-widget.php File 3.29 KB 0644
class-jetpack-gallery-settings.php File 3.38 KB 0644
class-jetpack-pre-connection-jitms.php File 5.77 KB 0644
class-jetpack-recommendations-banner.php File 9.1 KB 0644
class-jetpack-stats-dashboard-widget.php File 7.77 KB 0644
class-jetpack-wizard-banner.php File 214 B 0644
class-jetpack-xmlrpc-methods.php File 8.33 KB 0644
class.frame-nonce-preview.php File 3.22 KB 0644
class.jetpack-admin.php File 19.86 KB 0644
class.jetpack-affiliate.php File 205 B 0644
class.jetpack-autoupdate.php File 9.74 KB 0644
class.jetpack-bbpress-json-api.compat.php File 220 B 0644
class.jetpack-boost-modules.php File 1.23 KB 0644
class.jetpack-cli.php File 71.41 KB 0644
class.jetpack-client-server.php File 2.79 KB 0644
class.jetpack-connection-banner.php File 13.88 KB 0644
class.jetpack-data.php File 275 B 0644
class.jetpack-gutenberg.php File 41.34 KB 0644
class.jetpack-heartbeat.php File 4.55 KB 0644
class.jetpack-idc.php File 351 B 0644
class.jetpack-modules-list-table.php File 14.79 KB 0644
class.jetpack-network-sites-list-table.php File 5.93 KB 0644
class.jetpack-network.php File 21.03 KB 0644
class.jetpack-plan.php File 4.09 KB 0644
class.jetpack-post-images.php File 31.98 KB 0644
class.jetpack-twitter-cards.php File 12.92 KB 0644
class.jetpack-user-agent.php File 25.84 KB 0644
class.jetpack.php File 227.95 KB 0644
class.json-api-endpoints.php File 82.42 KB 0644
class.json-api.php File 33.34 KB 0644
class.photon.php File 1.74 KB 0644
composer.json File 3.8 KB 0644
enhanced-open-graph.php File 4.35 KB 0644
functions.compat.php File 4.1 KB 0644
functions.cookies.php File 2.04 KB 0644
functions.global.php File 15.08 KB 0644
functions.is-mobile.php File 2.47 KB 0644
functions.opengraph.php File 17.72 KB 0644
functions.photon.php File 3.04 KB 0644
jetpack.php File 8.24 KB 0644
json-api-config.php File 338 B 0644
json-endpoints.php File 6.92 KB 0644
load-jetpack.php File 3.39 KB 0644
locales.php File 324 B 0644
readme.txt File 28.39 KB 0644
uninstall.php File 1.6 KB 0644
wpml-config.xml File 1.26 KB 0644