PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.6
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.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 / dashboard / integrations.php

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

105 lines 3.0 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 echo sprintf(
26 /* translators: %1$s expands to Yoast SEO */
27 esc_html__( '%1$s can integrate with third parties products. You can enable or disable these integrations below.', '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 $url = $integration->read_more_url;
40 if ( ! empty( $integration->premium ) && $integration->premium === true ) {
41 $url = $integration->premium_url;
42 }
43
44 $help_text .= ' ';
45 $help_text .= sprintf(
46 '<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
47 esc_url( WPSEO_Shortlinker::get( $url ) ),
48 esc_html( $integration->read_more_label )
49 );
50 }
51
52 $feature_help = new WPSEO_Admin_Help_Panel(
53 $integration->setting,
54 /* translators: %s expands to an integration's name */
55 sprintf( esc_html__( 'Help on: %s', 'wordpress-seo' ), esc_html( $integration->name ) ),
56 $help_text
57 );
58
59 $name = $integration->name;
60 if ( ! empty( $integration->premium ) && $integration->premium === true ) {
61 $name .= ' ' . new Premium_Badge_Presenter( $integration->name );
62 }
63
64 if ( ! empty( $integration->new ) && $integration->new === true ) {
65 $name .= ' ' . new Badge_Presenter( $integration->name );
66 }
67
68 $attributes = [];
69
70 $disabled = false;
71 if ( $integration->premium === true && YoastSEO()->helpers->product->is_premium() === false ) {
72 $attributes = [ 'disabled' => true ];
73 }
74
75 // If the integration is disabled, do not show note showing
76 // the integration is disabled by network admin.
77 if ( isset( $integration->disabled ) && $integration->disabled === true ) {
78 $attributes = [
79 'disabled' => true,
80 'show_disabled_note' => false,
81 ];
82 }
83
84 $yform->toggle_switch(
85 $integration->setting,
86 [
87 'on' => __( 'On', 'wordpress-seo' ),
88 'off' => __( 'Off', 'wordpress-seo' ),
89 ],
90 $name,
91 $feature_help->get_button_html() . $feature_help->get_panel_html(),
92 $attributes
93 );
94
95 do_action( 'Yoast\WP\SEO\admin_integration_after', $integration );
96 }
97 ?>
98 </div>
99 <?php
100 /*
101 * Required to prevent our settings framework from saving the default because the field isn't
102 * explicitly set when saving the Dashboard page.
103 */
104 $yform->hidden( 'show_onboarding_notice', 'wpseo_show_onboarding_notice' );
105