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

Yoast / wordpress-seo / 6987097851

25 Nov 2023 04:49AM UTC coverage: 49.206% (-0.1%) from 49.302%
6987097851

push

github

web-flow
Merge pull request #20878 from Yoast/JRF/ghactions-minor-tweak

GH Actions: update a few links in inline comments

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

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

0.0
/admin/menu/class-network-admin-menu.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin\Menu
6
 */
7

8
/**
9
 * Network Admin Menu handler.
10
 */
11
class WPSEO_Network_Admin_Menu extends WPSEO_Base_Menu {
12

13
        /**
14
         * Registers all hooks to WordPress.
15
         *
16
         * @return void
17
         */
18
        public function register_hooks() {
×
19
                // Needs the lower than default priority so other plugins can hook underneath it without issue.
20
                add_action( 'network_admin_menu', [ $this, 'register_settings_page' ], 5 );
×
21
        }
22

23
        /**
24
         * Register the settings page for the Network settings.
25
         *
26
         * @return void
27
         */
28
        public function register_settings_page() {
×
29
                if ( ! $this->check_manage_capability() ) {
×
30
                        return;
×
31
                }
32

33
                add_menu_page(
×
34
                        __( 'Network Settings', 'wordpress-seo' ) . ' - Yoast SEO',
×
35
                        'Yoast SEO',
×
36
                        $this->get_manage_capability(),
×
37
                        $this->get_page_identifier(),
×
38
                        [ $this, 'network_config_page' ],
×
39
                        $this->get_icon_svg()
×
40
                );
×
41

42
                $submenu_pages = $this->get_submenu_pages();
×
43
                $this->register_submenu_pages( $submenu_pages );
×
44
        }
45

46
        /**
47
         * Returns the list of registered submenu pages.
48
         *
49
         * @return array List of registered submenu pages.
50
         */
51
        public function get_submenu_pages() {
×
52

53
                // Submenu pages.
54
                $submenu_pages = [
×
55
                        $this->get_submenu_page(
×
56
                                __( 'General', 'wordpress-seo' ),
×
57
                                $this->get_page_identifier(),
×
58
                                [ $this, 'network_config_page' ]
×
59
                        ),
×
60
                ];
×
61

62
                if ( WPSEO_Utils::allow_system_file_edit() === true ) {
×
63
                        $submenu_pages[] = $this->get_submenu_page( __( 'Edit Files', 'wordpress-seo' ), 'wpseo_files' );
×
64
                }
65

66
                $submenu_pages[] = $this->get_submenu_page( __( 'Extensions', 'wordpress-seo' ), 'wpseo_licenses' );
×
67

68
                return $submenu_pages;
×
69
        }
70

71
        /**
72
         * Loads the form for the network configuration page.
73
         *
74
         * @return void
75
         */
76
        public function network_config_page() {
×
77
                require_once WPSEO_PATH . 'admin/pages/network.php';
×
78
        }
79

80
        /**
81
         * Checks whether the current user has capabilities to manage all options.
82
         *
83
         * @return bool True if capabilities are sufficient, false otherwise.
84
         */
85
        protected function check_manage_capability() {
×
86
                return current_user_can( $this->get_manage_capability() );
×
87
        }
88

89
        /**
90
         * Returns the capability that is required to manage all options.
91
         *
92
         * @return string Capability to check against.
93
         */
94
        protected function get_manage_capability() {
×
95
                return 'wpseo_manage_network_options';
×
96
        }
97
}
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

© 2025 Coveralls, Inc