first commit

This commit is contained in:
2024-11-10 21:08:49 +01:00
commit 0d932ce5ee
14455 changed files with 2567501 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Views
*
* @uses Yoast_Form $yform Form object.
*/
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
?>
<h2><?php esc_html_e( 'Crawl settings', 'wordpress-seo' ); ?></h2>
<div class="yoast-measure">
<?php
echo sprintf(
/* translators: %1$s expands to Yoast SEO */
esc_html__( 'To make the crawling of your site more efficient and environmental friendly, %1$s allows you to remove URLs (added by WordPress) that might not be needed for your site.', 'wordpress-seo' ),
'Yoast SEO Premium'
);
echo '<p style="margin: 0.5em 0 1em;">';
echo sprintf(
/* translators: %1$s opens the link to the Yoast.com article about Crawl settings, %2$s closes the link, */
esc_html__( '%1$sLearn more about crawl settings and how they could benefit your site.%2$s', 'wordpress-seo' ),
'<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/crawl-settings' ) ) . '" target="_blank" rel="noopener noreferrer">',
'</a>'
);
echo '</p>';
/**
* Fires when displaying the crawl cleanup tab.
*
* @param Yoast_Form $yform The yoast form object.
*/
do_action( 'wpseo_settings_tab_crawl_cleanup', $yform );
?>
</div>
<?php
/*
* Required to prevent our settings framework from saving the default because the field isn't
* explicitly set when saving the Dashboard page.
*/
$yform->hidden( 'show_onboarding_notice', 'wpseo_show_onboarding_notice' );

View File

@@ -0,0 +1,44 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin
*/
/**
* Notifications template variables.
*
* @noinspection PhpUnusedLocalVariableInspection
*
* @var array
*/
$notifications_data = Yoast_Notifications::get_template_variables();
$wpseo_contributors_phrase = sprintf(
/* translators: %1$s expands to Yoast SEO */
__( 'See who contributed to %1$s.', 'wordpress-seo' ),
'Yoast SEO'
);
?>
<div class="tab-block">
<div class="yoast-notifications">
<div class="yoast-container yoast-container__error">
<?php require WPSEO_PATH . 'admin/views/partial-notifications-errors.php'; ?>
</div>
<div class="yoast-container yoast-container__warning">
<?php require WPSEO_PATH . 'admin/views/partial-notifications-warnings.php'; ?>
</div>
</div>
</div>
<div class="tab-block">
<h2><?php esc_html_e( 'Credits', 'wordpress-seo' ); ?></h2>
<p>
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/yoast-seo-credits' ); ?>"><?php echo esc_html( $wpseo_contributors_phrase ); ?></a>
</p>
</div>

View File

@@ -0,0 +1,132 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Views
*
* @uses Yoast_Form $yform Form object.
*/
use Yoast\WP\SEO\Presenters\Admin\Beta_Badge_Presenter;
use Yoast\WP\SEO\Presenters\Admin\Premium_Badge_Presenter;
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
$feature_toggles = Yoast_Feature_Toggles::instance()->get_all();
?>
<h2><?php esc_html_e( 'Features', 'wordpress-seo' ); ?></h2>
<div class="yoast-measure">
<?php
echo sprintf(
/* translators: %1$s expands to Yoast SEO */
esc_html__( '%1$s comes with a lot of features. You can enable / disable some of them below. Clicking the question mark gives more information about the feature.', 'wordpress-seo' ),
'Yoast SEO'
);
foreach ( $feature_toggles as $feature ) {
$is_premium = YoastSEO()->helpers->product->is_premium();
$premium_version = YoastSEO()->helpers->product->get_premium_version();
$help_text = esc_html( $feature->label );
if ( ! empty( $feature->extra ) ) {
$help_text .= ' ' . $feature->extra;
}
if ( ! empty( $feature->read_more_label ) ) {
$url = $feature->read_more_url;
if ( ! empty( $feature->premium ) && $feature->premium === true ) {
$url = $feature->premium_url;
}
$help_text .= ' ';
$help_text .= sprintf(
'<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
esc_url( WPSEO_Shortlinker::get( $url ) ),
esc_html( $feature->read_more_label )
);
}
$feature_help = new WPSEO_Admin_Help_Panel(
$feature->setting,
/* translators: %s expands to a feature's name */
sprintf( esc_html__( 'Help on: %s', 'wordpress-seo' ), esc_html( $feature->name ) ),
$help_text
);
$name = $feature->name;
if ( ! empty( $feature->premium ) && $feature->premium === true ) {
$name .= ' ' . new Premium_Badge_Presenter( $feature->name );
}
if ( ! empty( $feature->in_beta ) && $feature->in_beta === true ) {
$name .= ' ' . new Beta_Badge_Presenter( $feature->name );
}
$disabled = false;
$show_premium_upsell = false;
$premium_upsell_url = '';
$note_when_disabled = '';
if ( $feature->premium === true && YoastSEO()->helpers->product->is_premium() === false ) {
$disabled = true;
$show_premium_upsell = true;
$premium_upsell_url = WPSEO_Shortlinker::get( $feature->premium_upsell_url );
}
$current_language = WPSEO_Language_Utils::get_language( \get_locale() );
$feature_is_not_supported_in_current_language = $feature->supported_languages && ! \in_array( $current_language, $feature->supported_languages, true );
if ( $feature_is_not_supported_in_current_language ) {
$disabled = true;
$show_premium_upsell = false;
$note_when_disabled = __( 'This feature has been disabled, since it is not supported for your language yet.', 'wordpress-seo' );
// Do not show Premium or Beta badge.
$name = $feature->name;
}
if ( $feature->premium && $feature->premium_version ) {
$not_supported_in_current_premium_version = $is_premium && \version_compare( $premium_version, $feature->premium_version, '<' );
if ( $not_supported_in_current_premium_version ) {
$disabled = true;
$note_when_disabled = __( 'Please update your Yoast SEO Premium plugin to the latest version to be able to use this feature.', 'wordpress-seo' );
}
}
$preserve_disabled_value = false;
if ( $disabled ) {
$preserve_disabled_value = true;
}
$yform->toggle_switch(
$feature->setting,
[
'on' => __( 'On', 'wordpress-seo' ),
'off' => __( 'Off', 'wordpress-seo' ),
],
$name,
$feature_help->get_button_html() . $feature_help->get_panel_html(),
[
'disabled' => $disabled,
'preserve_disabled_value' => $preserve_disabled_value,
'show_premium_upsell' => $show_premium_upsell,
'premium_upsell_url' => $premium_upsell_url,
'note_when_disabled' => $note_when_disabled,
]
);
if ( ! empty( $feature->after ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaping handled in integrations.
echo $feature->after;
}
}
?>
</div>
<?php
/*
* Required to prevent our settings framework from saving the default because the field isn't
* explicitly set when saving the Dashboard page.
*/
$yform->hidden( 'show_onboarding_notice', 'wpseo_show_onboarding_notice' );

View File

@@ -0,0 +1,14 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Views
*/
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
echo '<div id="wpseo-first-time-configuration"></div>';

View File

@@ -0,0 +1,50 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Views
*
* @uses Yoast_Form $yform Form object.
*/
use Yoast\WP\SEO\Presenters\Admin\Alert_Presenter;
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
$integration_toggles = Yoast_Integration_Toggles::instance()->get_all();
?>
<h2><?php esc_html_e( 'Integrations', 'wordpress-seo' ); ?></h2>
<div class="yoast-measure">
<?php
$integrations_moved_message = sprintf(
/* translators: 1: link open tag; 2: link close tag. */
esc_html__( 'Looking for your integrations settings? We\'ve moved them to a %1$sseparate Integrations page%2$s.', 'wordpress-seo' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_integrations' ) ) . '">',
'</a>'
);
$frontpage_settings_alert = new Alert_Presenter( $integrations_moved_message, 'info' );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output from present() is considered safe.
echo $frontpage_settings_alert->present();
$yform->hidden( 'semrush_integration_active', 'semrush_integration_active' );
$yform->hidden( 'ryte_indexability', 'ryte_indexability' );
$yform->hidden( 'zapier_integration_active', 'zapier_integration_active' );
$yform->hidden( 'algolia_integration_active', 'algolia_integration_active' );
$yform->hidden( 'wincher_integration_active', 'wincher_integration_active' );
$yform->hidden( 'wordproof_integration_active', 'wordproof_integration_active' );
?>
</div>
<?php
/*
* Required to prevent our settings framework from saving the default because the field isn't
* explicitly set when saving the Dashboard page.
*/
$yform->hidden( 'show_onboarding_notice', 'wpseo_show_onboarding_notice' );

View File

@@ -0,0 +1,21 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Views
*
* @uses Yoast_Form $yform Form object.
*/
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
/**
* Fires when displaying the site wide analysis tab.
*
* @param Yoast_Form $yform The yoast form object.
*/
do_action( 'wpseo_settings_tab_site_analysis', $yform );

View File

@@ -0,0 +1,83 @@
<?php
/**
* WPSEO plugin file.
*
* @package WPSEO\Admin\Views
*
* @uses Yoast_Form $yform Form object.
*/
if ( ! defined( 'WPSEO_VERSION' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit();
}
$webmaster_tools_help = new WPSEO_Admin_Help_Panel(
'dashboard-webmaster-tools',
esc_html__( 'Learn more about the Webmaster Tools verification', 'wordpress-seo' ),
esc_html__( 'You can use the boxes below to verify with the different Webmaster Tools. This feature will add a verification meta tag on your home page. Follow the links to the different Webmaster Tools and look for instructions for the meta tag verification method to get the verification code. If your site is already verified, you can just forget about these.', 'wordpress-seo' ),
'has-wrapper'
);
// phpcs:ignore WordPress.Security.EscapeOutput -- get_button_html() output is properly escaped.
echo '<h2 class="help-button-inline">' . esc_html__( 'Webmaster Tools verification', 'wordpress-seo' ) . $webmaster_tools_help->get_button_html() . '</h2>';
// phpcs:ignore WordPress.Security.EscapeOutput -- get_panel_html() output is properly escaped.
echo $webmaster_tools_help->get_panel_html();
$msverify_link = 'https://www.bing.com/toolbox/webmaster/#/Dashboard/?url=' .
rawurlencode( str_replace( 'http://', '', get_bloginfo( 'url' ) ) );
$googleverify_link = add_query_arg(
[
'hl' => 'en',
'tid' => 'alternate',
'siteUrl' => rawurlencode( get_bloginfo( 'url' ) ) . '/',
],
'https://www.google.com/webmasters/verification/verification'
);
$yform->textinput( 'baiduverify', __( 'Baidu verification code', 'wordpress-seo' ) );
echo '<p class="desc label">';
printf(
/* translators: %1$s expands to a link start tag to the Baidu Webmaster Tools site add page, %2$s is the link closing tag. */
esc_html__( 'Get your Baidu verification code in %1$sBaidu Webmaster Tools%2$s.', 'wordpress-seo' ),
/*
* Get the Baidu Webmaster Tools site add link from this 3rd party article.
* {@link http://www.dragonmetrics.com/how-to-optimize-your-site-with-baidu-webmaster-tools/}
* We are unable to create a Baidu Webmaster Tools account due to the Chinese phone number verification.
*/
'<a target="_blank" href="' . esc_url( 'https://ziyuan.baidu.com/site/siteadd' ) . '" rel="noopener noreferrer">',
'</a>'
);
echo '</p>';
$yform->textinput( 'msverify', __( 'Bing verification code', 'wordpress-seo' ) );
echo '<p class="desc label">';
printf(
/* translators: 1: link open tag; 2: link close tag. */
esc_html__( 'Get your Bing verification code in %1$sBing Webmaster Tools%2$s.', 'wordpress-seo' ),
'<a target="_blank" href="' . esc_url( $msverify_link ) . '" rel="noopener noreferrer">',
'</a>'
);
echo '</p>';
$yform->textinput( 'googleverify', __( 'Google verification code', 'wordpress-seo' ) );
echo '<p class="desc label">';
printf(
/* translators: 1: link open tag; 2: link close tag. */
esc_html__( 'Get your Google verification code in %1$sGoogle Search Console%2$s.', 'wordpress-seo' ),
'<a target="_blank" href="' . esc_url( $googleverify_link ) . '" rel="noopener noreferrer">',
'</a>'
);
echo '</p>';
$yform->textinput( 'yandexverify', __( 'Yandex verification code', 'wordpress-seo' ) );
echo '<p class="desc label">';
printf(
/* translators: 1: link open tag; 2: link close tag. */
esc_html__( 'Get your Yandex verification code in %1$sYandex Webmaster Tools%2$s.', 'wordpress-seo' ),
'<a target="_blank" href="' . esc_url( 'https://webmaster.yandex.com/sites/add/' ) . '" rel="noopener noreferrer">',
'</a>'
);
echo '</p>';