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

AxeWP / wp-graphql-rank-math / 5176687204

pending completion
5176687204

push

github

web-flow
chore: Implement WPGraphQL Code Standards (PHPCS) (#51)

* chore: lint for WPGraphQL-Minimum

* chore: lint for WPGraphQL-Strict

* chore: lint for WPGraphQL-Extra

* chore: lint for WPGraphQL (full)

* chore: update PHPCS ruleset

* chore: update changelog

* fix: restore `rank_math/head` hook

* chore: update composer deps (wpcli fix)

* chore: fix missed files

* chore: update composer deps

* test: bump boilerplate

* chore: update deps to final versions

93 of 93 new or added lines in 32 files covered. (100.0%)

1963 of 2274 relevant lines covered (86.32%)

5.42 hits per line

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

0.0
/src/Admin/Settings/Settings.php
1
<?php
2
/**
3
 * Registers plugin settings to the backend.
4
 *
5
 * @package WPGraphQL\RankMath\Admin\Settings
6
 */
7

8
namespace WPGraphQL\RankMath\Admin\Settings;
9

10
use WPGraphQL\Admin\Settings\SettingsRegistry;
11

12
/**
13
 * Class - Settings
14
 */
15
class Settings {
16
        /**
17
         * An instance of the Settings API.
18
         *
19
         * @var ?\WPGraphQL\Admin\Settings\SettingsRegistry
20
         */
21
        private static $settings_api;
22

23
        /**
24
         * The section named used in the settings API.
25
         *
26
         * @var string
27
         */
28
        public static string $section_name = 'graphql_seo_settings';
29

30
        /**
31
         * {@inheritDoc}
32
         */
33
        public static function init(): void {
34
                add_action( 'admin_init', [ self::class, 'register_settings' ] );
×
35
        }
36

37
        /**
38
         * Gets an instance of the WPGraphQL settings api.
39
         */
40
        public static function get_settings_api(): SettingsRegistry {
41
                if ( ! isset( self::$settings_api ) || ! self::$settings_api instanceof SettingsRegistry ) {
×
42
                        self::$settings_api = new SettingsRegistry();
×
43
                }
44

45
                return self::$settings_api;
×
46
        }
47

48
        /**
49
         * Registers the settings to WPGraphQL
50
         */
51
        public static function register_settings(): void {
52
                $settings_api = self::get_settings_api();
×
53

54
                $settings_api->register_fields(
×
55
                        self::$section_name,
×
56
                        [
×
57
                                [
×
58
                                        'name'    => 'delete_data_on_deactivate',
×
59
                                        'label'   => __( 'Delete Data on Deactivation', 'wp-graphql-rank-math' ),
×
60
                                        'desc'    => __( 'Delete settings and any other data stored by WPGraphQL for Rank Math upon de-activation of the plugin. Un-checking this will keep data after the plugin is de-activated.', 'wp-graphql-rank-math' ),
×
61
                                        'type'    => 'checkbox',
×
62
                                        'default' => 'on',
×
63
                                ],
×
64
                        ]
×
65
                );
×
66

67
                $settings_api->admin_init();
×
68
        }
69
}
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