• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / fe4d74ae81b231d2986738b4e4648c24370c79ea

26 Feb 2025 02:54PM UTC coverage: 45.177% (-5.5%) from 50.712%
fe4d74ae81b231d2986738b4e4648c24370c79ea

push

github

enricobattocchi
Drop compatibility with PHP 7.2 and 7.3

15990 of 35394 relevant lines covered (45.18%)

4.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/admin/views/tabs/network/integrations.php
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' );
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc