PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.2
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.2
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.2, at admin/views/tabs/dashboard/integrations.php

89 lines 2.5 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\Premium_Badge_Presenter;
11
12 if ( ! defined( 'WPSEO_VERSION' ) ) {
13 header( 'Status: 403 Forbidden' );
14 header( 'HTTP/1.1 403 Forbidden' );
15 exit();
16 }
17
18 $integration_toggles = Yoast_Integration_Toggles::instance()->get_all();
19
20 ?>
21 <h2><?php esc_html_e( 'Integrations', 'wordpress-seo' ); ?></h2>
22 <div class="yoast-measure">
23 <?php
24 echo sprintf(
25 /* translators: %1$s expands to Yoast SEO */
26 esc_html__( '%1$s can integrate with third parties products. You can enable or disable these integrations below.', 'wordpress-seo' ),
27 'Yoast SEO'
28 );
29
30 foreach ( $integration_toggles as $integration ) {
31 $help_text = esc_html( $integration->label );
32
33 if ( ! empty( $integration->extra ) ) {
34 $help_text .= ' ' . $integration->extra;
35 }
36
37 if ( ! empty( $integration->read_more_label ) ) {
38 $url = $integration->read_more_url;
39 if ( ! empty( $integration->premium ) && $integration->premium === true ) {
40 $url = $integration->premium_url;
41 }
42
43 $help_text .= ' ';
44 $help_text .= sprintf(
45 '<a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s</a>',
46 esc_url( WPSEO_Shortlinker::get( $url ) ),
47 esc_html( $integration->read_more_label )
48 );
49 }
50
51 $feature_help = new WPSEO_Admin_Help_Panel(
52 $integration->setting,
53 /* translators: %s expands to an integration's name */
54 sprintf( esc_html__( 'Help on: %s', 'wordpress-seo' ), esc_html( $integration->name ) ),
55 $help_text
56 );
57
58 $name = $integration->name;
59 if ( ! empty( $integration->premium ) && $integration->premium === true ) {
60 $name .= ' ' . new Premium_Badge_Presenter( $integration->name );
61 }
62
63 $disabled = false;
64 if ( $integration->premium === true && YoastSEO()->helpers->product->is_premium() === false ) {
65 $disabled = true;
66 }
67
68 $yform->toggle_switch(
69 $integration->setting,
70 [
71 'on' => __( 'On', 'wordpress-seo' ),
72 'off' => __( 'Off', 'wordpress-seo' ),
73 ],
74 $name,
75 $feature_help->get_button_html() . $feature_help->get_panel_html(),
76 [ 'disabled' => $disabled ]
77 );
78
79 do_action( 'Yoast\WP\SEO\admin_integration_after', $integration );
80 }
81 ?>
82 </div>
83 <?php
84 /*
85 * Required to prevent our settings framework from saving the default because the field isn't
86 * explicitly set when saving the Dashboard page.
87 */
88 $yform->hidden( 'show_onboarding_notice', 'wpseo_show_onboarding_notice' );
89