| Server IP : 192.241.186.36 / Your IP : 216.73.216.164 Web Server : Apache/2.4.29 (Ubuntu) System : Linux webserver7 4.15.0-194-generic #205-Ubuntu SMP Fri Sep 16 19:49:27 UTC 2022 x86_64 User : root ( 0) PHP Version : 7.4.32 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/adsonicdigital/wp-content/plugins/seo-by-rank-math/includes/ |
Upload File : |
<?php
/**
* The compatibility functionality for 3rd party plugins.
*
* @since 0.9.0
* @package RankMath
* @subpackage RankMath\Core
* @author Rank Math <support@rankmath.com>
*/
namespace RankMath;
use RankMath\Traits\Hooker;
use MyThemeShop\Helpers\Str;
defined( 'ABSPATH' ) || exit;
/**
* Compatibility class.
*/
class Compatibility {
use Hooker;
/**
* The Constructor.
*/
public function __construct() {
if ( is_admin() ) {
if ( \defined( 'PIRATE_FORMS_VERSION' ) ) {
$this->action( 'admin_enqueue_scripts', 'pirate_forms_dequeue_scripts' );
}
}
$this->filter( 'rank_math/pre_simple_page_id', 'subscribe_to_comments_reloaded' );
$this->filter( 'genesis_detect_seo_plugins', 'disable_genesis_seo' );
}
/**
* Subscribe to comments reloaded page ID.
*
* @param int $page_id Change page id to real page.
* @return int
*/
public function subscribe_to_comments_reloaded( $page_id ) {
if ( is_plugin_active( 'subscribe-to-comments-reloaded/subscribe-to-comments-reloaded.php' ) ) {
$page_permalink = get_option( 'subscribe_reloaded_manager_page', '/comment-subscriptions/' );
if ( function_exists( 'qtrans_convertURL' ) ) {
$page_permalink = qtrans_convertURL( $page_permalink );
}
if ( ( strpos( $_SERVER['REQUEST_URI'], $page_permalink ) !== false ) ) {
$this->action( 'rank_math/head', 'subscribe_to_comments_reloaded_remove_robots', 1 );
return get_queried_object_id();
}
}
return $page_id;
}
/**
* Remove robots for this plugin.
*/
public function subscribe_to_comments_reloaded_remove_robots() {
remove_action( 'rank_math/frontend/robots', '__return_empty_array' );
}
/**
* Remove Pirate forms plugin scripts and styles from setting panels.
*/
public function pirate_forms_dequeue_scripts() {
if ( ! wp_script_is( 'pirate_forms_pro_admin_scripts' ) ) {
return;
}
$screen = get_current_screen();
if (
( ! Str::contains( 'rank-math', $screen->id ) && ! in_array( $screen->base, [ 'post', 'term', 'profile', 'user-edit' ], true ) ) ||
'pf_form' === $screen->id
) {
return;
}
wp_dequeue_script( 'pirate_forms_pro_admin_scripts' );
wp_dequeue_style( 'pirate_forms_pro_admin_styles' );
}
/**
* Disable Genesis SEO functionality.
*
* @param array $array Array hold disable info.
*
* @return array
*/
public function disable_genesis_seo( $array ) {
$array['classes'][] = '\RankMath\RankMath';
$array['functions'][] = 'rank_math';
return $array;
}
}