PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.2.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.2.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
← All changes | src/Performance/API/Provider.php +12 -45 trunk1.2.0 View file →
@@ -8,17 +8,12 @@
8 8 */
9 9
10 10 namespace SolidWP\Performance\API;
11 11
12 -use SolidWP\Performance\API\Routes\Page_Cache\Cache_Count;
13 -use SolidWP\Performance\API\Routes\Page_Cache\Cache_Delivery;
14 12 use SolidWP\Performance\API\Routes\Page_Cache\Clear;
15 13 use SolidWP\Performance\API\Routes\Page_Cache\Debug;
16 -use SolidWP\Performance\API\Routes\Page_Cache\Nginx;
17 14 use SolidWP\Performance\API\Routes\Page_Cache\Off;
18 15 use SolidWP\Performance\API\Routes\Page_Cache\On;
19 -use SolidWP\Performance\API\Routes\Page_Cache\Preload;
20 -use SolidWP\Performance\API\Routes\Page_Cache\Htaccess;
21 16 use SolidWP\Performance\API\Routes\Page_Cache\Status;
22 17 use SolidWP\Performance\API\Routes\Page_Cache\Regenerate;
23 18 use SolidWP\Performance\Contracts\Service_Provider;
24 19
@@ -57,13 +52,8 @@
57 52 Off::class,
58 53 On::class,
59 54 Regenerate::class,
60 55 Status::class,
61 - Cache_Count::class,
62 - Preload::class,
63 - Htaccess::class,
64 - Nginx::class,
65 - Cache_Delivery::class,
66 56 ];
67 57
68 58 /**
69 59 * {@inheritdoc}
@@ -80,45 +70,22 @@
80 70 * @return void
81 71 */
82 72 public function register_all_endpoints(): void {
83 73 foreach ( $this->endpoints as $class ) {
84 - /** @var Route $endpoint */
74 + /** @var Route */
85 75 $endpoint = $this->container->get( $class );
86 - $methods = $endpoint->get_methods();
87 -
88 - if ( is_array( $methods ) ) {
89 - foreach ( $methods as $method ) {
90 - $args = $endpoint->get_arguments();
91 - $args = $args[ $method ] ?? [];
92 -
93 - register_rest_route(
94 - $this->namespace,
95 - $endpoint->get_path(),
96 - [
97 - [
98 - 'methods' => $method,
99 - 'callback' => [ $endpoint, 'callback' ],
100 - 'args' => $args,
101 - 'permission_callback' => [ $endpoint, 'permission_callback' ],
102 - ],
103 - 'schema' => [ $endpoint, 'schema_callback' ],
104 - ],
105 - );
106 - }
107 - } else {
108 - register_rest_route(
109 - $this->namespace,
110 - $endpoint->get_path(),
76 + register_rest_route(
77 + $this->namespace,
78 + $endpoint->get_path(),
79 + [
111 80 [
112 - [
113 - 'methods' => $endpoint->get_methods(),
114 - 'callback' => [ $endpoint, 'callback' ],
115 - 'args' => $endpoint->get_arguments(),
116 - 'permission_callback' => [ $endpoint, 'permission_callback' ],
117 - ],
118 - 'schema' => [ $endpoint, 'schema_callback' ],
81 + 'methods' => $endpoint->get_methods(),
82 + 'callback' => [ $endpoint, 'callback' ],
83 + 'args' => $endpoint->get_arguments(),
84 + 'permission_callback' => [ $endpoint, 'permission_callback' ],
119 85 ],
120 - );
121 - }
86 + 'schema' => [ $endpoint, 'schema_callback' ],
87 + ],
88 + );
122 89 }
123 90 }
124 91 }