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

AxeWP / wp-graphql-rank-math / 15507442176

07 Jun 2025 11:36AM UTC coverage: 86.429% (-2.0%) from 88.44%
15507442176

Pull #121

github

web-flow
Merge c854da69f into 3bd3ede8c
Pull Request #121: dev: add support for lazy-loading `description`/`deprecationReason` config values

357 of 367 new or added lines in 66 files covered. (97.28%)

60 existing lines in 60 files now uncovered.

2541 of 2940 relevant lines covered (86.43%)

11.49 hits per line

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

93.75
/src/Type/WPObject/Settings/Sitemap.php
1
<?php
2
/**
3
 * The Rank Math sitemaps settings GraphQL Object.
4
 *
5
 * @package WPGraphQL\RankMath\Type\WPObject
6
 */
7

8
declare( strict_types = 1 );
9

10
namespace WPGraphQL\RankMath\Type\WPObject\Settings;
11

12
use WPGraphQL\RankMath\Type\WPObject\Settings\Sitemap\Author;
13
use WPGraphQL\RankMath\Type\WPObject\Settings\Sitemap\ContentType;
14
use WPGraphQL\RankMath\Type\WPObject\Settings\Sitemap\General;
15
use WPGraphQL\RankMath\Type\WPObject\Settings\Sitemap\Taxonomy;
16
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Abstracts\ObjectType;
17

18
/**
19
 * Class - Sitemap
20
 */
21
class Sitemap extends ObjectType {
22
        /**
23
         * {@inheritDoc}
24
         */
25
        protected static function type_name(): string {
26
                return 'Sitemap';
20✔
27
        }
28

29
        /**
30
         * {@inheritDoc}
31
         */
32
        public static function get_description(): string {
UNCOV
33
                return __( 'The RankMath SEO titles and meta site settings', 'wp-graphql-rank-math' );
×
34
        }
35

36
        /**
37
         * {@inheritDoc}
38
         */
39
        public static function get_fields(): array {
40
                return [
20✔
41
                        'author'          => [
20✔
42
                                'type'        => Author::get_type_name(),
20✔
43
                                'description' => static fn () => __( 'Author sitemap settings. Null if authors are not indexable.', 'wp-graphql-rank-math' ),
20✔
44
                        ],
20✔
45
                        'contentTypes'    => [
20✔
46
                                'type'        => [ 'list_of' => ContentType::get_type_name() ],
20✔
47
                                'args'        => [
20✔
48
                                        'include' => [
20✔
49
                                                'type'        => [ 'list_of' => 'ContentTypeEnum' ],
20✔
50
                                                'description' => static fn () => __( 'Limit results to specific content types.', 'wp-graphql-rank-math' ),
20✔
51
                                        ],
20✔
52
                                ],
20✔
53
                                'description' => static fn () => __( 'Content types included in the sitemap.', 'wp-graphql-rank-math' ),
20✔
54
                                'resolve'     => static function ( $source, array $args ) {
20✔
55
                                        $content_types = $source['contentTypes'];
1✔
56

57
                                        if ( ! empty( $args['include'] ) ) {
1✔
58
                                                $content_types = array_intersect_key( $content_types, array_flip( $args['include'] ) );
×
59
                                        }
60

61
                                        return ! empty( $content_types ) ? $content_types : null;
1✔
62
                                },
20✔
63
                        ],
20✔
64
                        'general'         => [
20✔
65
                                'type'        => General::get_type_name(),
20✔
66
                                'description' => static fn () => __( 'Sitemap general settings.', 'wp-graphql-rank-math' ),
20✔
67
                        ],
20✔
68
                        'sitemapIndexUrl' => [
20✔
69
                                'type'        => 'String',
20✔
70
                                'description' => static fn () => __( 'The URL to the sitemap index.', 'wp-graphql-rank-math' ),
20✔
71
                        ],
20✔
72
                        'taxonomies'      => [
20✔
73
                                'type'        => [ 'list_of' => Taxonomy::get_type_name() ],
20✔
74
                                'args'        => [
20✔
75
                                        'include' => [
20✔
76
                                                'type'        => [ 'list_of' => 'TaxonomyEnum' ],
20✔
77
                                                'description' => static fn () => __( 'Limit results to specific taxonomies.', 'wp-graphql-rank-math' ),
20✔
78
                                        ],
20✔
79
                                ],
20✔
80
                                'description' => static fn () => __( 'Content types included in the sitemap.', 'wp-graphql-rank-math' ),
20✔
81
                                'resolve'     => static function ( $source, array $args ) {
20✔
82
                                        $taxonomies = $source['taxonomies'];
1✔
83

84
                                        if ( ! empty( $args['include'] ) ) {
1✔
85
                                                $taxonomies = array_intersect_key( $taxonomies, array_flip( $args['include'] ) );
×
86
                                        }
87

88
                                        return ! empty( $taxonomies ) ? $taxonomies : null;
1✔
89
                                },
20✔
90
                        ],
20✔
91
                ];
20✔
92
        }
93
}
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