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

AxeWP / wp-graphql-rank-math / 14947513062

10 May 2025 05:19PM UTC coverage: 86.429% (-2.0%) from 88.44%
14947513062

Pull #121

github

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

356 of 366 new or added lines in 65 files covered. (97.27%)

60 existing lines in 60 files now uncovered.

2541 of 2940 relevant lines covered (86.43%)

11.01 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';
19✔
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 [
19✔
41
                        'author'          => [
19✔
42
                                'type'        => Author::get_type_name(),
19✔
43
                                'description' => static fn () => __( 'Author sitemap settings. Null if authors are not indexable.', 'wp-graphql-rank-math' ),
19✔
44
                        ],
19✔
45
                        'contentTypes'    => [
19✔
46
                                'type'        => [ 'list_of' => ContentType::get_type_name() ],
19✔
47
                                'args'        => [
19✔
48
                                        'include' => [
19✔
49
                                                'type'        => [ 'list_of' => 'ContentTypeEnum' ],
19✔
50
                                                'description' => static fn () => __( 'Limit results to specific content types.', 'wp-graphql-rank-math' ),
19✔
51
                                        ],
19✔
52
                                ],
19✔
53
                                'description' => static fn () => __( 'Content types included in the sitemap.', 'wp-graphql-rank-math' ),
19✔
54
                                'resolve'     => static function ( $source, array $args ) {
19✔
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
                                },
19✔
63
                        ],
19✔
64
                        'general'         => [
19✔
65
                                'type'        => General::get_type_name(),
19✔
66
                                'description' => static fn () => __( 'Sitemap general settings.', 'wp-graphql-rank-math' ),
19✔
67
                        ],
19✔
68
                        'sitemapIndexUrl' => [
19✔
69
                                'type'        => 'String',
19✔
70
                                'description' => static fn () => __( 'The URL to the sitemap index.', 'wp-graphql-rank-math' ),
19✔
71
                        ],
19✔
72
                        'taxonomies'      => [
19✔
73
                                'type'        => [ 'list_of' => Taxonomy::get_type_name() ],
19✔
74
                                'args'        => [
19✔
75
                                        'include' => [
19✔
76
                                                'type'        => [ 'list_of' => 'TaxonomyEnum' ],
19✔
77
                                                'description' => static fn () => __( 'Limit results to specific taxonomies.', 'wp-graphql-rank-math' ),
19✔
78
                                        ],
19✔
79
                                ],
19✔
80
                                'description' => static fn () => __( 'Content types included in the sitemap.', 'wp-graphql-rank-math' ),
19✔
81
                                'resolve'     => static function ( $source, array $args ) {
19✔
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
                                },
19✔
90
                        ],
19✔
91
                ];
19✔
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