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

Yoast / wordpress-seo / c710c31289d8b4f262939f3a3ca36271a63cce16

13 Mar 2026 09:22AM UTC coverage: 53.449% (+2.5%) from 50.9%
c710c31289d8b4f262939f3a3ca36271a63cce16

push

github

leonidasmi
Merge branch 'trunk' into feature/task-list-phase-3

9052 of 16649 branches covered (54.37%)

Branch coverage included in aggregate %.

828 of 870 new or added lines in 44 files covered. (95.17%)

718 existing lines in 33 files now uncovered.

34354 of 64561 relevant lines covered (53.21%)

46593.28 hits per line

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

0.0
/src/ai-generator/user-interface/bust-subscription-cache-route.php
1
<?php
2

3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4
namespace Yoast\WP\SEO\AI_Generator\User_Interface;
5

6
use WP_REST_Response;
7
use WPSEO_Addon_Manager;
8
use Yoast\WP\SEO\Conditionals\AI_Conditional;
9
use Yoast\WP\SEO\Main;
10
use Yoast\WP\SEO\Routes\Route_Interface;
11

12
/**
13
 * Registers a route to bust the subscription cache.
14
 *
15
 * @makePublic
16
 *
17
 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
18
 */
19
class Bust_Subscription_Cache_Route implements Route_Interface {
20

21
        use Route_Permission_Trait;
22

23
        /**
24
         *  The namespace for this route.
25
         *
26
         * @var string
27
         */
28
        public const ROUTE_NAMESPACE = Main::API_V1_NAMESPACE;
29

30
        /**
31
         *  The prefix for this route.
32
         *
33
         * @var string
34
         */
35
        public const ROUTE_PREFIX = '/ai_generator/bust_subscription_cache';
36

37
        /**
38
         * The addon manager instance.
39
         *
40
         * @var WPSEO_Addon_Manager
41
         */
42
        private $addon_manager;
43

44
        /**
45
         * Returns the conditionals based in which this loadable should be active.
46
         *
47
         * @return array<string> The conditionals.
48
         */
UNCOV
49
        public static function get_conditionals() {
×
UNCOV
50
                return [ AI_Conditional::class ];
×
51
        }
52

53
        /**
54
         * Class constructor.
55
         *
56
         * @param WPSEO_Addon_Manager $addon_manager The addon manager instance.
57
         */
UNCOV
58
        public function __construct( WPSEO_Addon_Manager $addon_manager ) {
×
UNCOV
59
                $this->addon_manager = $addon_manager;
×
60
        }
61

62
        /**
63
         * Registers routes with WordPress.
64
         *
65
         * @return void
66
         */
UNCOV
67
        public function register_routes() {
×
UNCOV
68
                \register_rest_route(
×
UNCOV
69
                        self::ROUTE_NAMESPACE,
×
UNCOV
70
                        self::ROUTE_PREFIX,
×
UNCOV
71
                        [
×
UNCOV
72
                                'methods'             => 'POST',
×
UNCOV
73
                                'args'                => [],
×
UNCOV
74
                                'callback'            => [ $this, 'bust_subscription_cache' ],
×
UNCOV
75
                                'permission_callback' => [ $this, 'check_permissions' ],
×
UNCOV
76
                        ],
×
UNCOV
77
                );
×
78
        }
79

80
        /**
81
         * Runs the callback that busts the subscription cache.
82
         *
83
         * @return WP_REST_Response The response of the callback action.
84
         */
UNCOV
85
        public function bust_subscription_cache(): WP_REST_Response {
×
UNCOV
86
                $this->addon_manager->remove_site_information_transients();
×
87

UNCOV
88
                return new WP_REST_Response( 'Subscription cache successfully busted.' );
×
89
        }
90
}
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