Commit realizado el 12:13:52 08-04-2024
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard compatibility step.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
use RankMath\KB;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $wp_version;
|
||||
|
||||
update_option( 'rank_math_wizard_completed', true );
|
||||
|
||||
$php_version = phpversion();
|
||||
$php_version_ok = version_compare( $php_version, rank_math()->php_version, '>' );
|
||||
$php_version_recommend = version_compare( $php_version, '7.4', '<' );
|
||||
|
||||
$dom_ext = extension_loaded( 'dom' );
|
||||
$simplexml_ext = extension_loaded( 'SimpleXML' );
|
||||
$image_ext = extension_loaded( 'gd' ) || extension_loaded( 'imagick' );
|
||||
$mb_string = extension_loaded( 'mbstring' );
|
||||
$openssl = extension_loaded( 'openssl' );
|
||||
$base64_func = function_exists( 'base64_encode' ) && function_exists( 'base64_decode' ) && (bool) base64_decode( base64_encode( '1' ) );
|
||||
$all_good = $php_version_ok && $dom_ext && $simplexml_ext && $image_ext && $mb_string && $openssl && $base64_func;
|
||||
|
||||
?>
|
||||
|
||||
<?php $wizard->cmb->show_form(); ?>
|
||||
|
||||
<?php
|
||||
|
||||
if ( $all_good ) :
|
||||
?>
|
||||
<br>
|
||||
<h2 class="text-center compatibility-check">
|
||||
<i class="dashicons <?php echo $php_version_recommend ? 'dashicons-warning' : 'dashicons-yes'; ?>"></i> <?php esc_html_e( 'Your website is compatible to run Rank Math SEO', 'rank-math' ); ?>
|
||||
<a href="#" data-target="rank-math-compatibility-collapsible" class="rank-math-collapsible-trigger">
|
||||
<span class="dashicons dashicons-arrow-down-alt2"><span><?php esc_html_e( 'More', 'rank-math' ); ?></span></span>
|
||||
<span class="dashicons dashicons-arrow-up-alt2"><span><?php esc_html_e( 'Less', 'rank-math' ); ?></span></span>
|
||||
</a>
|
||||
</h2>
|
||||
<div id="rank-math-compatibility-collapsible" class="rank-math-collapsible-content">
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="form-table">
|
||||
<tr class="check-<?php echo $php_version_ok ? 'yes' : 'no'; ?>">
|
||||
<th>
|
||||
<?php
|
||||
if ( $php_version_ok ) {
|
||||
/* translators: php version */
|
||||
printf( esc_html__( 'Your PHP Version: %s', 'rank-math' ), $php_version );
|
||||
if ( $php_version_recommend ) {
|
||||
?>
|
||||
<?php echo ' | ' . esc_html__( 'Recommended: PHP 7.4 or later', 'rank-math' ); ?>
|
||||
<p class="description">
|
||||
<?php
|
||||
echo ( ! Helper::is_whitelabel() ) ?
|
||||
esc_html__( 'Rank Math is compatible with your PHP version but we recommend updating to PHP 7.4 for increased speed and security.', 'rank-math' ) . ' <a href="' . KB::get( 'requirements', 'Setup wizard compatibility step' ) . '" target="_blank">' . esc_html__( 'More information', 'rank-math' ) . '</a>' :
|
||||
esc_html__( 'This plugin is compatible with your PHP version but we recommend updating to PHP 7.4 for increased speed and security.', 'rank-math' );
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
/* translators: php version */
|
||||
printf( esc_html__( 'Your PHP Version: %s | Recommended version: 7.4 | Minimal required: 7.2', 'rank-math' ), $php_version );
|
||||
}
|
||||
?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-<?php echo $php_version_ok ? ( $php_version_recommend ? 'warning' : 'yes' ) : 'no'; ?>"></span></td>
|
||||
</tr>
|
||||
<tr class="check-yes">
|
||||
<th>
|
||||
<?php
|
||||
echo esc_html__( 'You are using the recommended WordPress version.', 'rank-math' );
|
||||
?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-yes"></span></td>
|
||||
</tr>
|
||||
<tr class="check-<?php echo $dom_ext ? 'yes' : 'no'; ?>">
|
||||
<th>
|
||||
<?php echo $dom_ext ? esc_html__( 'PHP DOM Extension installed', 'rank-math' ) : esc_html__( 'PHP DOM Extension missing', 'rank-math' ); ?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-<?php echo $dom_ext ? 'yes' : 'no'; ?>"></span></td>
|
||||
</tr>
|
||||
<tr class="check-<?php echo $simplexml_ext ? 'yes' : 'no'; ?>">
|
||||
<th>
|
||||
<?php echo $simplexml_ext ? esc_html__( 'PHP SimpleXML Extension installed', 'rank-math' ) : esc_html__( 'PHP SimpleXML Extension missing', 'rank-math' ); ?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-<?php echo $simplexml_ext ? 'yes' : 'no'; ?>"></span></td>
|
||||
</tr>
|
||||
<tr class="check-<?php echo $image_ext ? 'yes' : 'no'; ?>">
|
||||
<th>
|
||||
<?php echo $image_ext ? esc_html__( 'PHP GD or Imagick Extension installed', 'rank-math' ) : esc_html__( 'PHP GD or Imagick Extension missing', 'rank-math' ); ?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-<?php echo $image_ext ? 'yes' : 'no'; ?>"></span></td>
|
||||
</tr>
|
||||
<tr class="check-<?php echo $mb_string ? 'yes' : 'no'; ?>">
|
||||
<th>
|
||||
<?php echo $mb_string ? esc_html__( 'PHP MBstring Extension installed', 'rank-math' ) : esc_html__( 'PHP MBstring Extension missing', 'rank-math' ); ?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-<?php echo $mb_string ? 'yes' : 'no'; ?>"></span></td>
|
||||
</tr>
|
||||
<tr class="check-<?php echo $openssl ? 'yes' : 'no'; ?>">
|
||||
<th>
|
||||
<?php echo $openssl ? esc_html__( 'PHP OpenSSL Extension installed', 'rank-math' ) : esc_html__( 'PHP OpenSSL Extension missing', 'rank-math' ); ?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-<?php echo $mb_string ? 'yes' : 'no'; ?>"></span></td>
|
||||
</tr>
|
||||
<tr class="check-<?php echo $base64_func ? 'yes' : 'no'; ?>">
|
||||
<th>
|
||||
<?php echo $base64_func ? esc_html__( 'Base64 encode & decode functions available', 'rank-math' ) : esc_html__( 'Base64 encode & decode functions missing', 'rank-math' ); ?>
|
||||
</th>
|
||||
<td><span class="dashicons dashicons-<?php echo $base64_func ? 'yes' : 'no'; ?>"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php if ( $all_good ) { ?>
|
||||
<p class="description checklist-ok">
|
||||
<?php
|
||||
echo ( ! Helper::is_whitelabel() ) ?
|
||||
esc_html__( 'Your server is correctly configured to use Rank Math.', 'rank-math' ) :
|
||||
esc_html__( 'Your server is correctly configured to use this plugin.', 'rank-math' );
|
||||
?>
|
||||
</p>
|
||||
<?php } else { ?>
|
||||
<p class="description checklist-not-ok">
|
||||
<?php
|
||||
echo ( ! Helper::is_whitelabel() ) ?
|
||||
esc_html__( 'Please resolve the issues above to be able to use all features of Rank Math plugin. If you are not sure how to do it, please contact your hosting provider.', 'rank-math' ) :
|
||||
esc_html__( 'Please resolve the issues above to be able to use all SEO features. If you are not sure how to do it, please contact your hosting provider.', 'rank-math' );
|
||||
?>
|
||||
</p>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
//
|
||||
// PLUGINS.
|
||||
//
|
||||
$conflicting_plugins = $this->get_conflicting_plugins();
|
||||
?>
|
||||
<?php if ( $conflicting_plugins ) : ?>
|
||||
<p class="conflict-text">
|
||||
<?php
|
||||
echo ( ! Helper::is_whitelabel() ) ?
|
||||
esc_html__( 'The following active plugins on your site may cause conflict issues when used alongside Rank Math: ', 'rank-math' ) :
|
||||
esc_html__( 'The following active plugins on your site may cause conflict issues when used alongside this plugin: ', 'rank-math' );
|
||||
?>
|
||||
</p>
|
||||
<table class="form-table wp-core-ui wizard-conflicts">
|
||||
<?php foreach ( $conflicting_plugins as $pk => $plugin ) { ?>
|
||||
<tr>
|
||||
<td><span class="dashicons dashicons-warning"></span></td>
|
||||
<td><?php echo $plugin . ( in_array( $pk, [ 'all-in-one-schemaorg-rich-snippets/index.php', 'wordpress-seo/wp-seo.php', 'wordpress-seo-premium/wp-seo-premium.php', 'all-in-one-seo-pack/all_in_one_seo_pack.php' ], true ) ? '<span class="import-info">' . esc_html__( 'You can import settings in the next step.', 'rank-math' ) . '</span>' : '' ); ?></td>
|
||||
<td><a href="#" class="button button-small wizard-deactivate-plugin" data-plugin="<?php echo esc_attr( $pk ); ?>"><?php esc_html_e( 'Deactivate Plugin', 'rank-math' ); ?></a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<?php
|
||||
set_transient( '_rank_math_conflicting_plugins', array_keys( $conflicting_plugins ) );
|
||||
else :
|
||||
delete_transient( '_rank_math_conflicting_plugins' );
|
||||
?>
|
||||
<p class="conflict-text noconflict"><?php esc_html_e( 'No known conflicting plugins found.', 'rank-math' ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $all_good ) : ?>
|
||||
</div> <!-- /collapsible -->
|
||||
<?php endif; ?>
|
||||
|
||||
<footer class="form-footer rank-math-custom wp-core-ui rank-math-ui text-center">
|
||||
<?php if ( $all_good ) : ?>
|
||||
<button type="submit" class="button button-primary button-animated"><?php esc_html_e( 'Start Wizard', 'rank-math' ); ?> <i class="dashicons dashicons-arrow-right-alt2"></i></button>
|
||||
<?php endif; ?>
|
||||
</footer>
|
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard content template.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\KB;
|
||||
use RankMath\Helpers\Param;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<div class="header">
|
||||
<div class="logo text-center">
|
||||
<a href="<?php KB::the( 'logo', 'SW Logo' ); ?>" target="_blank"><img src="<?php echo esc_url( rank_math()->plugin_url() . 'assets/admin/img/logo.svg' ); ?>" width="245"></a>
|
||||
</div>
|
||||
|
||||
<?php require_once $this->get_view( 'navigation' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="main-content wizard-content--<?php echo esc_attr( $this->step_slug ); ?>">
|
||||
|
||||
<form class="cmb-form" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="post">
|
||||
<input type="hidden" name="action" value="<?php echo 'rank-math-registration' === $this->slug ? 'rank_math_save_registration' : 'rank_math_save_wizard'; ?>">
|
||||
<input type="hidden" name="step" value="<?php echo esc_attr( $this->step ); ?>">
|
||||
<?php wp_nonce_field( 'rank-math-wizard', 'security' ); ?>
|
||||
|
||||
<?php $this->body(); ?>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( ! in_array( $this->step_slug, [ 'register', 'ready' ], true ) ) :
|
||||
echo sprintf( '<div class="return-to-dashboard"><a href="%s">%s</a></div>', esc_url( 'rank-math-registration' === Param::get( 'page' ) ? admin_url( '/' ) : RankMath\Helper::get_dashboard_url() ), esc_html__( 'Return to dashboard', 'rank-math' ) );
|
||||
endif;
|
||||
?>
|
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard footer template.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
echo '</body>' . "\n";
|
||||
|
||||
CMB2_JS::enqueue();
|
||||
rank_math()->json->output();
|
||||
if ( function_exists( 'wp_print_media_templates' ) ) {
|
||||
wp_print_media_templates();
|
||||
}
|
||||
wp_print_footer_scripts();
|
||||
wp_print_scripts( 'rank-math-wizard' );
|
||||
wp_print_scripts( 'cmb2-scripts' );
|
||||
|
||||
echo '</html>';
|
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Search console ui.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\KB;
|
||||
use RankMath\Google\Authentication;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// phpcs:disable
|
||||
$is_authorized = Authentication::is_authorized();
|
||||
$authorize = ! $is_authorized ? ( '<div class="connect-wrap" style="margin-top: 30px;"><a href="' . esc_url( Authentication::get_auth_url() ) . '" class="button button-primary button-animated rank-math-authorize-account">' . esc_html__( 'Connect Google Services', 'rank-math' ) . '</a></div>' ) : '';
|
||||
$deauthorize = $is_authorized ? '<button class="button button-primary rank-math-deauthorize-account">' . esc_html__( 'Disconnect Account', 'rank-math' ) . '</button>' : '';
|
||||
|
||||
echo $authorize . $deauthorize;
|
||||
?>
|
||||
<div id="rank-math-pro-cta" class="analytics">
|
||||
<div class="rank-math-cta-box width-100 no-shadow no-padding no-border">
|
||||
<h3><?php echo esc_attr__( 'Benefits of Connecting Google Account', 'rank-math' ); ?></h3>
|
||||
<ul>
|
||||
<li><?php echo esc_attr__( 'Verify site ownership on Google Search Console in a single click', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Track page and keyword rankings with the Advanced Analytics module', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Easily set up Google Analytics without using another 3rd party plugin', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Automatically submit sitemaps to the Google Search Console', 'rank-math' ); ?></li>
|
||||
<li><a href="<?php echo KB::get( 'help-analytics', 'SW Analytics Step Benefits' ); ?>" target="_blank"><?php echo esc_html__( 'Learn more about the benefits of connecting your account here.', 'rank-math' ); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rank-math-pro-cta" class="rank-math-privacy-box">
|
||||
<div class="rank-math-cta-table">
|
||||
<div class="rank-math-cta-body less-padding">
|
||||
<i class="dashicons dashicons-lock"></i>
|
||||
<p><?php printf( esc_html__( 'We do not store any of the data from your Google account on our servers, everything is processed & stored on your server. We take your privacy extremely seriously and ensure it is never misused. %s', 'rank-math' ), '<a href="' . KB::get( 'usage-policy', 'Analytics Privacy Notice' ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Learn more.', 'rank-math' ) . '</a>' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard header template.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title><?php esc_html_e( 'Setup Wizard - Rank Math', 'rank-math' ); ?></title>
|
||||
<?php wp_print_head_scripts(); ?>
|
||||
<?php wp_print_styles( 'rank-math-wizard' ); ?>
|
||||
</head>
|
||||
<body class="rank-math-wizard rank-math-page rank-math-wizard-body--<?php echo sanitize_html_class( $this->step_slug ); ?><?php echo is_rtl() ? ' rtl' : ''; ?><?php echo Helper::is_advanced_mode() ? ' rank-math-mode-advanced' : ' rank-math-mode-basic'; ?>">
|
@@ -0,0 +1 @@
|
||||
<?php // Silence is golden.
|
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard navigation template.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$output_steps = $this->steps;
|
||||
$array_keys = array_keys( $this->steps );
|
||||
$current_step = array_search( $this->step, $array_keys, true );
|
||||
?>
|
||||
<div class="wizard-navigation">
|
||||
|
||||
<a class="step step-label" href="<?php echo esc_url( apply_filters( 'rank_math/wizard/step/label_url', \RankMath\Helper::get_admin_url( 'wizard' ) ) ); ?>" title="<?php echo apply_filters( 'rank_math/wizard/step/label', esc_html__( 'Getting Started', 'rank-math' ) ); ?>"></a>
|
||||
|
||||
<?php
|
||||
foreach ( $output_steps as $step_key => $step ) :
|
||||
|
||||
if ( $this->is_nav_item_hidden( $step_key ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$class_attr = '';
|
||||
|
||||
if ( $step_key === $this->step ) {
|
||||
$class_attr = 'active';
|
||||
} elseif ( $current_step > array_search( $step_key, $array_keys, true ) ) {
|
||||
$class_attr = 'done';
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="<?php echo esc_attr( $class_attr ); ?>" href="<?php echo esc_url( $this->get_step_link( $step_key ) ); ?>" title="<?php echo esc_attr( $step['name'] ); ?>"><span></span></a>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard no navigation template.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<br>
|
||||
<br>
|
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Search console ui.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\KB;
|
||||
use RankMath\Helpers\Param;
|
||||
use RankMath\Admin\Admin_Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$page = Param::get( 'page', '', FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK );
|
||||
$page = in_array( $page, [ 'rank-math-options-general', 'rank-math-analytics' ], true ) ? 'rank-math-options-general' : 'rank-math-wizard&step=analytics';
|
||||
$url = Admin_Helper::get_activate_url( admin_url( 'admin.php?analytics=1&page=' . $page ) );
|
||||
|
||||
$site_url_valid = Admin_Helper::is_site_url_valid();
|
||||
$button_class = 'button button-primary button-connect' . ( $site_url_valid ? ' button-animated' : ' disabled' );
|
||||
?>
|
||||
<?php Admin_Helper::maybe_show_invalid_siteurl_notice(); ?>
|
||||
|
||||
<div class="wp-core-ui rank-math-ui connect-wrap" style="margin-top: 30px;">
|
||||
<a href="<?php echo esc_url( $url ); ?>" class="<?php echo esc_attr( $button_class ); ?>" name="rank_math_activate"><?php echo esc_attr__( 'Connect Your Rank Math Account', 'rank-math' ); ?></a>
|
||||
</div>
|
||||
<div id="rank-math-pro-cta" class="analytics">
|
||||
<div class="rank-math-cta-box width-100 no-shadow no-padding no-border">
|
||||
<h3><?php echo esc_attr__( 'Benefits of Connecting Rank Math Account', 'rank-math' ); ?></h3>
|
||||
<ul>
|
||||
<li><?php echo esc_attr__( 'Verify site ownership on Google Search Console in a single click', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Track page and keyword rankings with the Advanced Analytics module', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Easily set up Google Analytics without using another 3rd party plugin', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Automatically submit sitemaps to the Google Search Console', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Free keyword suggestions when entering a focus keyword', 'rank-math' ); ?></li>
|
||||
<li><?php echo esc_attr__( 'Use our revolutionary SEO Analyzer to scan your website for SEO errors', 'rank-math' ); ?></li>
|
||||
<li><a href="<?php echo esc_url( KB::get( 'free-account-benefits', 'SW Analytics Step' ) ); ?>" target="_blank"><?php echo esc_html__( 'Learn more about the benefits of connecting your account here.', 'rank-math' ); ?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="rank-math-pro-cta" class="rank-math-privacy-box">
|
||||
<div class="rank-math-cta-table">
|
||||
<div class="rank-math-cta-body less-padding">
|
||||
<i class="dashicons dashicons-lock"></i>
|
||||
<p>
|
||||
<?php
|
||||
// Translators: placeholder is the KB link.
|
||||
printf( esc_html__( 'We do not store any of the data from your Google account on our servers, everything is processed & stored on your server. We take your privacy extremely seriously and ensure it is never misused. %s', 'rank-math' ), '<a href="' . esc_url( KB::get( 'usage-policy', 'Analytics Privacy Notice' ) ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Learn more.', 'rank-math' ) . '</a>' );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard ready step.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\KB;
|
||||
use RankMath\Helper;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<header>
|
||||
<h1>
|
||||
<i class="dashicons dashicons-yes"></i> <?php esc_html_e( 'Your site is ready!', 'rank-math' ); ?>
|
||||
<?php \RankMath\Admin\Admin_Helper::get_social_share(); ?>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<div class="rank-math-additional-options">
|
||||
<div class="rank-math-auto-update-wrapper">
|
||||
<h3><?php esc_html_e( 'Enable auto update of the plugin', 'rank-math' ); ?></h3>
|
||||
<span class="cmb2-toggle">
|
||||
<input type="checkbox" class="rank-math-modules" id="auto-update" value="" <?php checked( Helper::get_auto_update_setting() ); ?> data-key="enable_auto_update" />
|
||||
<label for="auto-update" class="cmb2-slider">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br class="clear">
|
||||
|
||||
<?php if ( ! Helper::is_whitelabel() ) : ?>
|
||||
|
||||
<div class="wizard-next-steps wp-clearfix">
|
||||
<div class="score-100">
|
||||
<a href="<?php KB::the( 'score-100', 'SW Ready Score Image' ); ?>" target="_blank">
|
||||
<img src="<?php echo esc_url( rank_math()->plugin_url() ); ?>/assets/admin/img/score-100.png">
|
||||
</a>
|
||||
</div>
|
||||
<div class="learn-more">
|
||||
<h2><?php esc_html_e( 'Learn more', 'rank-math' ); ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<?php if ( ! defined( 'RANK_MATH_PRO_FILE' ) ) { ?>
|
||||
<span class="dashicons dashicons-star-filled pro"></span><a href="<?php KB::the( 'pro', 'SW Ready Step Upgrade' ); ?>" target="_blank"><strong class="pro-label"><?php esc_html_e( 'Know more about the PRO version', 'rank-math' ); ?></strong></a>
|
||||
<?php } else { ?>
|
||||
<span class="dashicons dashicons-video-alt3"></span><a href="<?php KB::the( 'yt-link', 'SW Ready Step Upgrade' ); ?>" target="_blank"><?php esc_html_e( 'Subscribe to Our YouTube Channel', 'rank-math' ); ?></a>
|
||||
<?php } ?>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dashicons dashicons-facebook"></span><a href="<?php KB::the( 'fb-group', 'SW Ready Step Upgrade' ); ?>" target="_blank"><?php esc_html_e( 'Join FREE Facebook Group', 'rank-math' ); ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dashicons dashicons-welcome-learn-more"></span><a href="<?php KB::the( 'kb-seo-suite', 'SW Ready Step KB' ); ?>" target="_blank"><?php esc_html_e( 'Rank Math Knowledge Base', 'rank-math' ); ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dashicons dashicons-sos"></span><a href="<?php KB::the( 'support', 'SW Ready Step Support' ); ?>" target="_blank"><?php esc_html_e( 'Get 24x7 Support', 'rank-math' ); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="form-footer wp-core-ui rank-math-ui">
|
||||
<a href="<?php echo esc_url( Helper::get_dashboard_url() ); ?>" class="button button-secondary rank-math-return-dashboard"><?php esc_html_e( 'Return to dashboard', 'rank-math' ); ?></a>
|
||||
<a href="<?php echo esc_url( Helper::get_admin_url( '', 'view=help' ) ); ?>" class="button button-secondary"><?php esc_html_e( 'Proceed to Help Page', 'rank-math' ); ?></a>
|
||||
<a href="<?php echo esc_url( $wizard->step_next_link() ); ?>" class="button button-primary rank-math-advanced-option"><?php esc_html_e( 'Setup Advanced Options', 'rank-math' ); ?></a>
|
||||
<?php do_action( 'rank_math/wizard/ready_footer', $wizard ); ?>
|
||||
</footer>
|
||||
<?php else : ?>
|
||||
<p><?php esc_html_e( 'Your site is now optimized.', 'rank-math' ); ?></p>
|
||||
<footer class="form-footer wp-core-ui rank-math-ui">
|
||||
<a href="<?php echo esc_url( Helper::get_admin_url( 'options-general' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Proceed to Settings', 'rank-math' ); ?></a>
|
||||
</footer>
|
||||
<?php
|
||||
endif;
|
@@ -0,0 +1,412 @@
|
||||
<?php
|
||||
/**
|
||||
* Search console UI.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\KB;
|
||||
use RankMath\Helper;
|
||||
use RankMath\Google\Authentication;
|
||||
use RankMath\Google\Permissions;
|
||||
use RankMath\Analytics\Url_Inspection;
|
||||
use RankMath\Helpers\Str;
|
||||
use RankMath\Google\Analytics;
|
||||
use RankMath\Google\Console;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
// phpcs:disable
|
||||
if ( ! Helper::is_site_connected() ) {
|
||||
require_once 'rank-math-connect.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$is_authorized = Authentication::is_authorized();
|
||||
if ( ! $is_authorized ) {
|
||||
require_once 'google-connect.php';
|
||||
return;
|
||||
}
|
||||
|
||||
$profile = wp_parse_args(
|
||||
get_option( 'rank_math_google_analytic_profile' ),
|
||||
[
|
||||
'profile' => '',
|
||||
'country' => 'all',
|
||||
]
|
||||
);
|
||||
$analytics = wp_parse_args(
|
||||
get_option( 'rank_math_google_analytic_options' ),
|
||||
[
|
||||
'adsense_id' => '',
|
||||
'account_id' => '',
|
||||
'property_id' => '',
|
||||
'view_id' => '',
|
||||
'measurement_id' => '',
|
||||
'stream_name' => '',
|
||||
'country' => 'all',
|
||||
'install_code' => false,
|
||||
'anonymize_ip' => false,
|
||||
'local_ga_js' => false,
|
||||
'exclude_loggedin' => false,
|
||||
]
|
||||
);
|
||||
|
||||
$is_profile_connected = Console::is_console_connected();
|
||||
$is_adsense_connected = ! empty( $analytics['adsense_id'] );
|
||||
$is_analytics_connected = Analytics::is_analytics_connected();
|
||||
$is_index_status_enabled = Url_Inspection::is_enabled() || ! $is_profile_connected;
|
||||
$all_services = get_option( 'rank_math_analytics_all_services', [
|
||||
'isVerified' => '',
|
||||
'inSearchConsole' => '',
|
||||
'hasSitemap' => '',
|
||||
'hasAnalytics' => '',
|
||||
'hasAnalyticsProperty' => '',
|
||||
'homeUrl' => '',
|
||||
'sites' => '',
|
||||
'accounts' => [],
|
||||
'adsenseAccounts' => [],
|
||||
] );
|
||||
$is_pro_active = defined( 'RANK_MATH_PRO_FILE' );
|
||||
$is_ga4 = ! Str::starts_with( 'UA-', $analytics['property_id'] );
|
||||
?>
|
||||
<input type="hidden" class="cmb2-id-check-all-services" value="<?php echo $is_profile_connected && $is_analytics_connected ? '1' : '0'; ?>" />
|
||||
|
||||
<?php
|
||||
$actions = [
|
||||
'reconnect' => [
|
||||
'link' => wp_nonce_url( admin_url( 'admin.php?reconnect=google' ), 'rank_math_reconnect_google' ),
|
||||
'class' => 'rank-math-reconnect-google',
|
||||
'text' => esc_html__( 'Reconnect', 'rank-math' ),
|
||||
],
|
||||
'disconnect' => [
|
||||
'link' => '#',
|
||||
'class' => 'rank-math-disconnect-google',
|
||||
'text' => esc_html__( 'Disconnect', 'rank-math' ),
|
||||
],
|
||||
];
|
||||
|
||||
if ( Helper::is_advanced_mode() && ( $is_profile_connected || $is_adsense_connected || $is_analytics_connected ) ) {
|
||||
$actions['test-connections'] = [
|
||||
'link' => '#',
|
||||
'class' => 'rank-math-test-connection-google',
|
||||
'text' => esc_html__( 'Test Connections', 'rank-math' ),
|
||||
];
|
||||
}
|
||||
|
||||
$actions = apply_filters( 'rank_math/analytics/connect_actions', $actions );
|
||||
?>
|
||||
<div class="connect-actions">
|
||||
<?php foreach( $actions as $action ) { ?>
|
||||
<a href="<?php echo esc_attr( $action['link'] ); ?>" class="button button-link <?php echo esc_attr( $action['class'] ); ?>"><?php echo esc_html( $action['text'] ); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$console_classes = Helper::classnames(
|
||||
'rank-math-box no-padding rank-math-accordion rank-math-connect-search-console',
|
||||
[
|
||||
'connected' => $is_profile_connected,
|
||||
'disconnected' => ! $is_profile_connected,
|
||||
'disabled' => ! Permissions::has_console(),
|
||||
]
|
||||
);
|
||||
$console_status_classes = Helper::classnames(
|
||||
'rank-math-connection-status',
|
||||
[
|
||||
'rank-math-connection-status-success' => $is_profile_connected,
|
||||
'rank-math-connection-status-error' => ! $is_profile_connected,
|
||||
]
|
||||
);
|
||||
|
||||
$console_status = $is_profile_connected ? 'Connected' : 'Not Connected';
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $console_classes ); ?>" tabindex="0">
|
||||
<header>
|
||||
<h3><span class="rank-math-connection-status-wrap"><span class="<?php echo esc_attr( $console_status_classes ); ?>" title="<?php echo esc_attr( $console_status ); ?>"></span></span> <?php esc_html_e( 'Search Console', 'rank-math' ); ?></h3>
|
||||
</header>
|
||||
<div class="rank-math-accordion-content">
|
||||
|
||||
<?php
|
||||
if ( ! Permissions::has_console() ) {
|
||||
Permissions::print_warning();
|
||||
} ?>
|
||||
|
||||
<div class="cmb-row cmb-type-select">
|
||||
<div class="cmb-row-col">
|
||||
<label for="site-console-profile"><?php esc_html_e( 'Site', 'rank-math' ); ?></label>
|
||||
<select class="cmb2_select site-console-profile notrack" name="site-console-profile" id="site-console-profile" data-selected="<?php echo $profile['profile']; ?>" disabled="disabled">
|
||||
<?php if ( $is_profile_connected ) : ?>
|
||||
<option value="<?php echo $profile['profile']; ?>"><?php echo $profile['profile']; ?></option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php do_action( 'rank_math/analytics/options/console' ); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="cmb-row cmb-type-toggle">
|
||||
<div class="cmb-td">
|
||||
<label class="cmb2-toggle">
|
||||
<input type="checkbox" class="regular-text notrack" name="enable-index-status" id="enable-index-status" value="on"<?php checked( $is_index_status_enabled ); ?> <?php echo disabled( ! $is_profile_connected ) ?>>
|
||||
<span class="cmb2-slider">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
<label for="enable-index-status"><?php esc_html_e( 'Enable the Index Status tab', 'rank-math' ); ?></label>
|
||||
<div class="cmb2-metabox-description"><?php esc_html_e( 'Enable this option to show the Index Status tab in the Analytics module.', 'rank-math' ); ?> <a href="<?php echo KB::get( 'url-inspection-api', 'SW Analytics Index Status Option' ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Learn more.', 'rank-math' ); ?></a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$analytic_classes = Helper::classnames(
|
||||
'rank-math-box no-padding rank-math-accordion rank-math-connect-analytics',
|
||||
[
|
||||
'connected' => $is_analytics_connected,
|
||||
'disconnected' => ! $is_analytics_connected,
|
||||
'disabled' => ! Permissions::has_analytics(),
|
||||
]
|
||||
);
|
||||
$analytic_status_classes = Helper::classnames(
|
||||
'rank-math-connection-status',
|
||||
[
|
||||
'rank-math-connection-status-success' => $is_analytics_connected,
|
||||
'rank-math-connection-status-error' => ! $is_analytics_connected,
|
||||
]
|
||||
);
|
||||
$analytic_status = $is_analytics_connected ? 'Connected' : 'Not Connected';
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $analytic_classes ); ?>" tabindex="0">
|
||||
<header>
|
||||
<h3><span class="rank-math-connection-status-wrap"><span class="<?php echo esc_attr( $analytic_status_classes ); ?>" title="<?php echo esc_attr( $analytic_status ); ?>"></span></span><?php esc_html_e( 'Analytics', 'rank-math' ); ?></h3>
|
||||
</header>
|
||||
<div class="rank-math-accordion-content rank-math-analytics-content">
|
||||
|
||||
<?php
|
||||
if ( ! Permissions::has_analytics() ) {
|
||||
Permissions::print_warning();
|
||||
} ?>
|
||||
|
||||
<p class="warning yellow">
|
||||
<strong class="note"><?php echo esc_attr( 'Note', 'rank-math' ); ?></strong>
|
||||
<?php
|
||||
/* translators: GA4 KB link */
|
||||
echo sprintf(
|
||||
esc_html__( 'Ready to switch to Google Analytics 4? %s', 'rank-math' ),
|
||||
'<a href="'. KB::get( 'using-ga4', 'Analytics GA4 KB' ) . '" target="_blank">' . esc_html__( 'Click here to know how', 'rank-math' ) . '</a>.'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<div class="cmb-row cmb-type-select">
|
||||
<div class="cmb-row-col">
|
||||
<label for="site-analytics-account"><?php esc_html_e( 'Account', 'rank-math' ); ?></label>
|
||||
<select class="cmb2_select site-analytics-account notrack" name="site-analytics-account" id="site-analytics-account" data-selected="<?php echo esc_attr( $analytics['account_id'] ); ?>" disabled="disabled">
|
||||
<?php
|
||||
if ( $is_analytics_connected ) :
|
||||
$analytic_account = $all_services['accounts'][ $analytics['account_id'] ];
|
||||
?>
|
||||
<option value="<?php echo $analytics['account_id']; ?>"><?php echo $analytic_account['name']; ?></option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="cmb-row-col">
|
||||
<label for="site-analytics-property"><?php esc_html_e( 'Property', 'rank-math' ); ?></label>
|
||||
<select class="cmb2_select site-analytics-property notrack" name="site-analytics-property" id="site-analytics-property" data-selected="<?php echo esc_attr( $analytics['property_id'] ); ?>" disabled="disabled">
|
||||
<?php
|
||||
if ( $is_analytics_connected ) :
|
||||
$analytic_property = $all_services['accounts'][ $analytics['account_id'] ]['properties'][ $analytics['property_id'] ]['name'];
|
||||
?>
|
||||
<option value="<?php echo $analytics['property_id']; ?>"><?php echo $analytic_property; ?></option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="cmb-row-col">
|
||||
<label for="site-analytics-view">
|
||||
<?php echo $is_ga4 ? esc_html__( 'Data Stream', 'rank-math' ) : esc_html__( 'View', 'rank-math' ); ?>
|
||||
</label>
|
||||
<select class="cmb2_select site-analytics-view notrack" name="site-analytics-view" id="site-analytics-view" data-selected="<?php echo esc_attr( $analytics['view_id'] ); ?>" disabled="disabled">
|
||||
<?php
|
||||
if ( $is_analytics_connected ) :
|
||||
$analytic_view = $is_ga4 ? $analytics['stream_name'] : $all_services['accounts'][ $analytics['account_id'] ]['properties'][ $analytics['property_id'] ]['profiles'][ $analytics['view_id'] ]['name'];
|
||||
$analytic_view = $is_ga4 && ! $analytic_view && ! empty( $analytics['view_id'] ) ? 'Website' : $analytic_view;
|
||||
?>
|
||||
<option value="<?php echo esc_attr( $analytics['view_id'] ); ?>"><?php echo esc_attr( $analytic_view ); ?></option>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden" id="rank-math-analytics-measurement-id" name="measurementID" value="<?php echo esc_attr( $analytics['measurement_id'] ) ?>" />
|
||||
<input type="hidden" id="rank-math-analytics-stream-name" name="streamName" value="<?php echo esc_attr( $analytics['stream_name'] ) ?>" />
|
||||
<?php do_action( 'rank_math/analytics/options/analytics' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="cmb-row cmb-type-toggle">
|
||||
<div class="cmb-td">
|
||||
<label class="cmb2-toggle">
|
||||
<input type="checkbox" class="regular-text notrack" name="install-code" id="install-code" value="on"<?php checked( $analytics['install_code'] ); ?>>
|
||||
<span class="cmb2-slider">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
<label for="install-code"><?php esc_html_e( 'Install analytics code', 'rank-math' ); ?></label>
|
||||
<div class="cmb2-metabox-description"><?php esc_html_e( 'Enable this option only if you are not using any other plugin/theme to install Google Analytics code.', 'rank-math' ); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cmb-row cmb-type-toggle <?php echo ! $is_pro_active ? 'cmb-redirector-element' : ''; ?>" <?php echo ! $is_pro_active ? 'data-url="' . KB::the( 'free-vs-pro', 'Anonymize IP' ) .'"' : ''; ?>>
|
||||
<div class="cmb-td">
|
||||
<label class="cmb2-toggle">
|
||||
<input type="checkbox" class="regular-text notrack" name="anonymize-ip" id="anonymize-ip" value="on"<?php checked( $analytics['anonymize_ip'] ); ?><?php disabled( ! $is_pro_active ); ?>>
|
||||
<span class="cmb2-slider<?php echo ! $is_pro_active ? ' disabled' : ''; ?> ">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
<label for="anonymize-ip">
|
||||
<?php esc_html_e( 'Anonymize IP addresses', 'rank-math' ); ?>
|
||||
<?php if ( ! $is_pro_active ) : ?>
|
||||
<span class="rank-math-pro-badge">
|
||||
<a href="<?php KB::the( 'pro', 'Anonymize IP' ); ?>" target="_blank" rel="noopener noreferrer">
|
||||
<?php esc_html_e( 'PRO', 'rank-math' ); ?>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<div class="rank-math-cmb-dependency hidden" data-relation="or">
|
||||
<span class="hidden" data-field="install-code" data-comparison="=" data-value="on"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cmb-row cmb-type-toggle <?php echo ! $is_pro_active ? 'cmb-redirector-element' : ''; ?>" <?php echo ! $is_pro_active ? 'data-url="' . KB::the( 'pro', 'Localjs IP' ) . '"' : ''; ?>>
|
||||
<div class="cmb-td">
|
||||
<label class="cmb2-toggle">
|
||||
<input type="checkbox" class="regular-text notrack" name="local-ga-js" id="local-ga-js" value="on"<?php checked( $analytics['local_ga_js'] ); ?><?php disabled( ! $is_pro_active ); ?>>
|
||||
<span class="cmb2-slider<?php echo ! $is_pro_active ? ' disabled' : ''; ?> ">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
<label for="local-ga-js">
|
||||
<?php esc_html_e( 'Self-Hosted Analytics JS File', 'rank-math' ); ?>
|
||||
<?php if ( ! $is_pro_active ) : ?>
|
||||
<span class="rank-math-pro-badge">
|
||||
<a href="<?php KB::the( 'pro', 'Localjs IP' ); ?>" target="_blank" rel="noopener noreferrer">
|
||||
<?php esc_html_e( 'PRO', 'rank-math' ); ?>
|
||||
</a>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<div class="rank-math-cmb-dependency hidden" data-relation="or">
|
||||
<span class="hidden" data-field="install-code" data-comparison="=" data-value="on"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cmb-row cmb-type-toggle">
|
||||
<div class="cmb-td">
|
||||
<label class="cmb2-toggle">
|
||||
<input type="checkbox" class="regular-text notrack" name="exclude-loggedin" id="exclude-loggedin" value="on"<?php checked( $analytics['exclude_loggedin'] ); ?>>
|
||||
<span class="cmb2-slider">
|
||||
<svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg>
|
||||
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg>
|
||||
</span>
|
||||
</label>
|
||||
<label for="exclude-loggedin"><?php esc_html_e( 'Exclude Logged-in users', 'rank-math' ); ?></label>
|
||||
<div class="rank-math-cmb-dependency hidden" data-relation="or">
|
||||
<span class="hidden" data-field="install-code" data-comparison="=" data-value="on"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$adsense_classes = Helper::classnames(
|
||||
'rank-math-box no-padding rank-math-accordion rank-math-connect-adsense',
|
||||
[
|
||||
'connected' => $is_adsense_connected,
|
||||
'disconnected' => ! $is_adsense_connected,
|
||||
'disabled' => ! Permissions::has_adsense(),
|
||||
]
|
||||
);
|
||||
$adsense_status_classes = Helper::classnames(
|
||||
'rank-math-connection-status',
|
||||
[
|
||||
'rank-math-connection-status-success' => Permissions::has_adsense() && $is_adsense_connected,
|
||||
'rank-math-connection-status-error' => Permissions::has_adsense() && ! $is_adsense_connected,
|
||||
]
|
||||
);
|
||||
$adsense_status = $is_adsense_connected ? 'Connected' : 'Not Connected';
|
||||
?>
|
||||
<div class="<?php echo esc_attr( $adsense_classes ); ?>" tabindex="0">
|
||||
<header>
|
||||
<h3><span class="rank-math-connection-status-wrap"><span class="<?php echo esc_attr( $adsense_status_classes ); ?>" title="<?php echo esc_attr( $adsense_status ); ?>"></span></span><?php esc_html_e( 'AdSense', 'rank-math' ); ?></h3>
|
||||
</header>
|
||||
<div class="rank-math-accordion-content">
|
||||
|
||||
<?php
|
||||
if ( defined( 'RANK_MATH_PRO_FILE' ) && ! Permissions::has_adsense() ) {
|
||||
Permissions::print_warning();
|
||||
} ?>
|
||||
|
||||
<div class="cmb-row cmb-type-select">
|
||||
<div class="cmb-row-col">
|
||||
<label for="site-adsense-account"><?php esc_html_e( 'Account', 'rank-math' ); ?></label>
|
||||
<select class="cmb2_select site-adsense-account notrack" name="site-adsense-account" id="site-adsense-account" data-selected="<?php echo esc_attr( $analytics['adsense_id'] ); ?>" disabled="disabled">
|
||||
<?php
|
||||
if ( $is_adsense_connected ) :
|
||||
$adsense = $all_services['adsenseAccounts'][ $analytics['adsense_id'] ];
|
||||
?>
|
||||
<option value="<?php echo $analytics['adsense_id']; ?>"><?php echo $adsense['name']; ?></option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( ! $is_pro_active ) : ?>
|
||||
<div id="rank-math-pro-cta" class="no-margin">
|
||||
<div class="rank-math-cta-text">
|
||||
<span class="rank-math-pro-badge"><a href="<?php KB::the( 'pro', 'AdSense Toggle' ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'PRO', 'rank-math' ); ?></a></span> <?php esc_html_e( "Google AdSense support is only available in Rank Math Pro's Advanced Analytics module.", 'rank-math' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="rank-math-pro-cta" class="rank-math-privacy-box width-100">
|
||||
<div class="rank-math-cta-table">
|
||||
<div class="rank-math-cta-body less-padding">
|
||||
<i class="dashicons dashicons-lock"></i>
|
||||
<p><?php printf( esc_html__( 'We do not store any of the data from your Google account on our servers, everything is processed & stored on your server. We take your privacy extremely seriously and ensure it is never misused. %s', 'rank-math' ), '<a href="' . KB::get( 'usage-policy', 'Analytics Privacy Notice' ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Learn more.', 'rank-math' ) . '</a>' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
// phpcs:enable
|
||||
|
||||
if ( Helper::is_wizard() && ! RankMath\Analytics\Email_Reports::are_fields_hidden() ) {
|
||||
?>
|
||||
<div class="cmb-row email-reports-header text-center" style="border-top:0;">
|
||||
<h1><?php esc_html_e( 'Email Reports', 'rank-math' ); ?></h1>
|
||||
<div class="email-reports-desc text-center"><?php esc_html_e( 'Receive Analytics reports periodically in email.', 'rank-math' ); ?> <a href="#" target="_blank"><?php esc_html_e( 'Learn more about Email Reports.', 'rank-math' ); ?></a></div>
|
||||
</div>
|
||||
<div class="cmb-row cmb-type-toggle cmb2-id-console-email-reports" data-fieldtype="toggle">
|
||||
<div class="cmb-th">
|
||||
<label for="console_email_reports"><?php esc_html_e( 'Email Reports', 'rank-math' ); ?></label>
|
||||
</div>
|
||||
<div class="cmb-td">
|
||||
<label class="cmb2-toggle"><input type="checkbox" class="regular-text" name="console_email_reports" id="console_email_reports" value="on" <?php checked( Helper::get_settings( 'general.console_email_reports' ) ); ?> data-hash="7e0rimtbvig0"><span class="cmb2-slider"><svg width="3" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2 6" class="toggle_on" role="img" aria-hidden="true" focusable="false"><path d="M0 0h2v6H0z"></path></svg><svg width="8" height="8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 6" class="toggle_off" role="img" aria-hidden="true" focusable="false"><path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path></svg></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
do_action( 'rank_math/analytics/options/wizard_after_email_report' );
|
||||
}
|
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Setup wizard your site step.
|
||||
*
|
||||
* @package RankMath
|
||||
* @subpackage RankMath\Admin\Wizard
|
||||
*/
|
||||
|
||||
use RankMath\Helper;
|
||||
use RankMath\KB;
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
?>
|
||||
<header>
|
||||
<h1>
|
||||
<?php
|
||||
/* translators: sitename */
|
||||
printf( esc_html__( 'Your Website: %s', 'rank-math' ), esc_attr( $this->get_site_display_name() ) );
|
||||
?>
|
||||
</h1>
|
||||
<p><?php esc_html_e( 'Let us know a few things about your site…', 'rank-math' ); ?></p>
|
||||
</header>
|
||||
|
||||
<?php if ( ! Helper::is_whitelabel() ) : ?>
|
||||
<div class="rank-math-wizard-tutorial">
|
||||
<header>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: help link */
|
||||
esc_html__( 'If you are new to Rank Math, %s to learn more.', 'rank-math' ),
|
||||
'<a href="#" data-target="rank-math-wizard-tabs" class="rank-math-collapsible-trigger">' . esc_html__( 'click here', 'rank-math' ) . '</a>'
|
||||
);
|
||||
?>
|
||||
</header>
|
||||
|
||||
<div id="rank-math-wizard-tabs" class="rank-math-collapsible-content rank-math-tabs">
|
||||
<div class="rank-math-tabs-navigation rank-math-custom wp-clearfix">
|
||||
<a href="#help-panel-video" class="active"><span class="rm-icon rm-icon-video"></span><?php esc_html_e( 'Setup Tutorial', 'rank-math' ); ?></a>
|
||||
<a href="#help-panel-knowledge"><span class="rm-icon rm-icon-post"></span><?php esc_html_e( 'Knowledge Base', 'rank-math' ); ?></a>
|
||||
</div>
|
||||
<div class="rank-math-tabs-content rank-math-custom">
|
||||
<div id="help-panel-video" class="rank-math-tab">
|
||||
<a href="<?php KB::the( 'how-to-setup-your-site', 'SW Your Site Setup KB' ); ?>" target="_blank" style="font-size: 15px; border-bottom: 1px dashed;">
|
||||
<?php echo esc_html_e( 'Click here to learn how to setup Rank Math properly', 'rank-math' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div id="help-panel-knowledge" class="rank-math-tab">
|
||||
<div class="search-form wp-core-ui rank-math-ui">
|
||||
<label for="rank-math-search-input"><?php esc_html_e( 'Search the Knowledge Base for answers to your questions:', 'rank-math' ); ?></label>
|
||||
<input type="text" class="regular-text" id="rank-math-search-input" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" placeholder="<?php esc_attr_e( 'Type here to search...', 'rank-math' ); ?>" value="">
|
||||
<a data-href="<?php KB::the( 'kb-search', 'SW Your Site Search' ); ?>&s=&lang=<?php echo get_locale(); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Search', 'rank-math' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $wizard->cmb->show_form(); ?>
|
||||
|
||||
<footer class="form-footer wp-core-ui rank-math-ui">
|
||||
<?php $wizard->get_skip_link(); ?>
|
||||
<button type="submit" class="button button-primary"><?php esc_html_e( 'Save and Continue', 'rank-math' ); ?></button>
|
||||
</footer>
|
Reference in New Issue
Block a user