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

AxeWP / wp-graphql-rank-math / 15507492505

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

push

github

web-flow
dev: add support for lazy-loading `description`/`deprecationReason` config values (#121)

* chore: update strauss and deps

* dev: use callable descriptions/deprecations

* fix: dont prefix `NodeWithRankMathSeo`

* chore: fix backcompat on connections

* chore: update dep

* chore: update deps

* tests: ensure schema can build

* chore: update and cleanup

* fix: regenerate autoloader

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

97.22
/src/Type/WPObject/Settings/Meta/GlobalMeta.php
1
<?php
2
/**
3
 * The GlobalMeta GraphQL object.
4
 *
5
 * @package WPGraphQL\RankMath\Type\WPObject\Settings\Meta
6
 */
7

8
declare( strict_types = 1 );
9

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

12
use WPGraphQL\AppContext;
13
use WPGraphQL\RankMath\Type\Enum\TwitterCardTypeEnum;
14
use WPGraphQL\RankMath\Type\WPInterface\MetaSettingWithRobots;
15
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Abstracts\ObjectType;
16
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Interfaces\TypeWithInterfaces;
17

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

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

36
        /**
37
         * {@inheritDoc}
38
         */
39
        public static function get_interfaces(): array {
40
                return [
20✔
41
                        MetaSettingWithRobots::get_type_name(),
20✔
42
                ];
20✔
43
        }
44

45
        /**
46
         * {@inheritDoc}
47
         */
48
        public static function get_fields(): array {
49
                $fields = [
20✔
50
                        'openGraphImage'             => [
20✔
51
                                'type'        => 'MediaItem',
20✔
52
                                'description' => static fn () => __( 'When a featured image or an OpenGraph Image is not set for individual posts/pages/CPTs, this image will be used as a fallback thumbnail when your post is shared on Facebook.', 'wp-graphql-rank-math' ),
20✔
53
                                'resolve'     => static function ( $source, array $args, AppContext $context ) {
20✔
54
                                        return ! empty( $source['openGraphImageId'] ) ? $context->get_loader( 'post' )->load_deferred( $source['openGraphImageId'] ) : null;
1✔
55
                                },
20✔
56
                        ],
20✔
57
                        'separator'                  => [
20✔
58
                                'type'        => 'String',
20✔
59
                                'description' => static fn () => __( 'The separator character used in titles.', 'wp-graphql-rank-math' ),
20✔
60
                        ],
20✔
61
                        'shouldCapitalizeTitles'     => [
20✔
62
                                'type'        => 'Boolean',
20✔
63
                                'description' => static fn () => __( 'Whether to automatically capitalize the first character of each word in the titles.', 'wp-graphql-rank-math' ),
20✔
64
                        ],
20✔
65
                        'shouldIndexEmptyTaxonomies' => [
20✔
66
                                'type'        => 'Boolean',
20✔
67
                                'description' => static fn () => __( 'Whether to index enpty Taxonomy archives', 'wp-graphql-rank-math' ),
20✔
68
                        ],
20✔
69
                        'twitterCardType'            => [
20✔
70
                                'type'        => TwitterCardTypeEnum::get_type_name(),
20✔
71
                                'description' => static fn () => __( 'Card type selected when creating a new post. This will also be applied for posts without a card type selected.', 'wp-graphql-rank-math' ),
20✔
72
                        ],
20✔
73
                ];
20✔
74

75
                if ( ! current_theme_supports( 'title-tag' ) ) {
20✔
76
                        $fields['shouldRewriteTitle'] = [
20✔
77
                                'type'        => 'Boolean',
20✔
78
                                'description' => static fn () => __( 'Whether titles for page, post, category, search, and archive pages can be rewritten. Only visible in themes without title-tag support', 'wp-graphql-rank-math' ),
20✔
79
                        ];
20✔
80
                }
81

82
                return $fields;
20✔
83
        }
84
}
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