403Webshell
Server IP : 89.39.208.18  /  Your IP : 216.73.217.74
Web Server : LiteSpeed
System :
User :  ( )
PHP Version : 7.4.33
Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home3/mahyarcake/www/wp-content/plugins/polylang/integrations/jetpack/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home3/mahyarcake/www/wp-content/plugins/polylang/integrations/jetpack/jetpack.php
<?php
/**
 * @package Polylang
 */

/**
 * Manages the compatibility with Jetpack.
 *
 * @since 2.3
 */
class PLL_Jetpack {
	/**
	 * Constructor.
	 *
	 * @since 2.3
	 */
	public function __construct() {
		add_action( 'init', array( $this, 'jetpack_init' ) );
		add_action( 'jetpack_widget_get_top_posts', array( $this, 'jetpack_widget_get_top_posts' ) );
		add_filter( 'grunion_contact_form_field_html', array( $this, 'grunion_contact_form_field_html_filter' ), 10, 2 );
		add_filter( 'jetpack_open_graph_tags', array( $this, 'jetpack_ogp' ) );
		add_filter( 'jetpack_relatedposts_filter_filters', array( $this, 'jetpack_relatedposts_filter_filters' ), 10, 2 );

		// Jetpack infinite scroll.
		if ( isset( $_GET['infinity'], $_POST['action'] ) && 'infinite_scroll' == $_POST['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification
			add_filter( 'pll_is_ajax_on_front', '__return_true' );
		}
	}

	/**
	 * Add filters
	 *
	 * @since 2.1
	 */
	public function jetpack_init() {
		if ( ! defined( 'JETPACK__VERSION' ) ) {
			return;
		}

		// Infinite scroll ajax url must be on the right domain.
		if ( did_action( 'pll_init' ) && PLL()->options['force_lang'] > 1 ) {
			add_filter( 'infinite_scroll_ajax_url', array( PLL()->links_model, 'site_url' ) );
			add_filter( 'infinite_scroll_js_settings', array( $this, 'jetpack_infinite_scroll_js_settings' ) );
		}
	}

	/**
	 * Filter the Top Posts and Pages by language.
	 * Adapted from the same function in jetpack-3.0.2/3rd-party/wpml.php
	 *
	 * @since 1.5.4
	 *
	 * @param array $posts Array of the most popular posts.
	 * @return array
	 */
	public function jetpack_widget_get_top_posts( $posts ) {
		foreach ( $posts as $k => $post ) {
			if ( pll_current_language() !== pll_get_post_language( $post['post_id'] ) ) {
				unset( $posts[ $k ] );
			}
		}

		return $posts;
	}

	/**
	 * Filter the HTML of the Contact Form and output the one requested by language.
	 * Adapted from the same function in jetpack-3.0.2/3rd-party/wpml.php
	 * Keeps using 'icl_translate' as the function registers the string.
	 *
	 * @since 1.5.4
	 *
	 * @param string $r           Contact Form HTML output.
	 * @param string $field_label Field label.
	 * @return string
	 */
	public function grunion_contact_form_field_html_filter( $r, $field_label ) {
		if ( function_exists( 'icl_translate' ) ) {
			if ( pll_current_language() !== pll_default_language() ) {
				$label_translation = icl_translate( 'jetpack ', $field_label . '_label', $field_label );
				$r = str_replace( $field_label, $label_translation, $r );
			}
		}

		return $r;
	}

	/**
	 * Adds opengraph support for locale and translations.
	 *
	 * @since 1.6
	 *
	 * @param array $tags Opengraph tags to output.
	 * @return array
	 */
	public function jetpack_ogp( $tags ) {
		if ( did_action( 'pll_init' ) ) {
			foreach ( PLL()->model->get_languages_list() as $language ) {
				if ( PLL()->curlang->slug !== $language->slug && PLL()->links->get_translation_url( $language ) && isset( $language->facebook ) ) {
					$tags['og:locale:alternate'][] = $language->facebook;
				}
				if ( PLL()->curlang->slug === $language->slug && isset( $language->facebook ) ) {
					$tags['og:locale'] = $language->facebook;
				}
			}
		}
		return $tags;
	}

	/**
	 * Allows to make sure that related posts are in the correct language.
	 *
	 * @since 1.8
	 *
	 * @param array  $filters Array of ElasticSearch filters based on the post_id and args.
	 * @param string $post_id Post ID of the post for which we are retrieving Related Posts.
	 * @return array
	 */
	public function jetpack_relatedposts_filter_filters( $filters, $post_id ) {
		$slug = sanitize_title( pll_get_post_language( $post_id, 'slug' ) );
		$filters[] = array( 'term' => array( 'taxonomy.language.slug' => $slug ) );
		return $filters;
	}

	/**
	 * Fixes the settings history host for infinite scroll when using subdomains or multiple domains.
	 *
	 * @since 2.1
	 *
	 * @param array $settings Infinite scroll JS settings outputted in the head.
	 * @return array
	 */
	public function jetpack_infinite_scroll_js_settings( $settings ) {
		$settings['history']['host'] = wp_parse_url( pll_home_url(), PHP_URL_HOST ); // Jetpack uses get_option( 'home' ).
		return $settings;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit