PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.6
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.6
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / admin / views / tabs / network / integrations.php

integrations.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.6, at admin/views/tabs/network/integrations.php

104 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WPSEO plugin file.
4 *
5 * @package WPSEO\Admin\Views
6 *
7 * @uses Yoast_Form $yform Form object.
8 */
9
10 use Yoast\WP\SEO\Presenters\Admin\Badge_Presenter;
11 use Yoast\WP\SEO\Presenters\Admin\Premium_Badge_Presenter;
12
13 if ( ! defined( 'WPSEO_VERSION' ) ) {
14 header( 'Status: 403 Forbidden' );
15 header( 'HTTP/1.1 403 Forbidden' );
16 exit();
17 }
18
19 $integration_toggles = Yoast_Integration_Toggles::instance()->get_all();
20
21 ?>
22 <h2><?php esc_html_e( 'Integrations', 'wordpress-seo' ); ?></h2>
23 <div class="yoast-measure">
24 <?php
25 printf(
26 /* translators: %1$s expands to Yoast SEO */
27 esc_html__( 'This tab allows you to selectively disable %1$s integrations with third-party products for all sites in the network. By default all integrations are enabled, which allows site admins to choose for themselves if they want to toggle an integration on or off for their site. When you disable an integration here, site admins will not be able to use that integration at all.', 'wordpress-seo' ),
28 'Yoast SEO',
29 );
30
31 foreach ( $integration_toggles as $integration ) {
32 $help_text = esc_html( $integration->label );
33
34 if ( ! empty( $integration->extra ) ) {
35 $help_text .= ' ' . $integration->extra;
36 }
37
38 if ( ! empty( $integration->read_more_label ) ) {
39 $help_text .= ' ';
40 $help_text .= sprintf(
41 '<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
42 esc_url( WPSEO_Shortlinker::get( $integration->read_more_url ) ),
43 esc_html( $integration->read_more_label ),
44 );
45 }
46
47 $feature_help = new WPSEO_Admin_Help_Panel(
48 WPSEO_Option::ALLOW_KEY_PREFIX . $integration->setting,
49 /* translators: Hidden accessibility text; %s expands to an integration's name. */
50 sprintf( esc_html__( 'Help on: %s', 'wordpress-seo' ), esc_html( $integration->name ) ),
51 $help_text,
52 );
53
54 $name = $integration->name;
55 if ( ! empty( $integration->premium ) && $integration->premium === true ) {
56 $name .= ' ' . new Premium_Badge_Presenter( $integration->name );
57 }
58
59 if ( ! empty( $integration->new ) && $integration->new === true ) {
60 $name .= ' ' . new Badge_Presenter( $integration->name );
61 }
62
63 $disabled = $integration->disabled;
64 $show_premium_upsell = false;
65 $premium_upsell_url = '';
66
67 if ( $integration->premium === true && YoastSEO()->helpers->product->is_premium() === false ) {
68 $disabled = true;
69 $show_premium_upsell = true;
70 $premium_upsell_url = WPSEO_Shortlinker::get( $integration->premium_upsell_url );
71 }
72
73 $preserve_disabled_value = false;
74 if ( $disabled ) {
75 $preserve_disabled_value = true;
76 }
77
78 $yform->toggle_switch(
79 WPSEO_Option::ALLOW_KEY_PREFIX . $integration->setting,
80 [
81 'on' => __( 'Allow Control', 'wordpress-seo' ),
82 'off' => __( 'Disable', 'wordpress-seo' ),
83 ],
84 $name,
85 $feature_help->get_button_html() . $feature_help->get_panel_html(),
86 [
87 'disabled' => $disabled,
88 'preserve_disabled_value' => $preserve_disabled_value,
89 'show_premium_upsell' => $show_premium_upsell,
90 'premium_upsell_url' => $premium_upsell_url,
91 ],
92 );
93
94 do_action( 'Yoast\WP\SEO\admin_network_integration_after', $integration );
95 }
96 ?>
97 </div>
98 <?php
99 /*
100 * Required to prevent our settings framework from saving the default because the field isn't
101 * explicitly set when saving the Dashboard page.
102 */
103 $yform->hidden( 'show_onboarding_notice', 'wpseo_show_onboarding_notice' );
104