PluginProbe
Extendify / 3.2.2
Extendify v3.2.2
3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 All 128 releases
← All changes | app/Shared/Services/PluginsActivation/PluginActivation.php +15 -1 3.1.6 → 3.2.2 View file →
@@ -7,8 +7,13 @@
7 7 abstract class PluginActivation
8 8 {
9 9 abstract public static function slug(): string;
10 10
11 + public static function createAccountRoute(): string
12 + {
13 + return '/' . static::slug() . '/create-account';
14 + }
15 +
11 16 public static function scriptData(): array
12 17 {
13 18 return [];
14 19 }
@@ -27,8 +32,17 @@
27 32 {
28 33 return true;
29 34 }
30 35
36 + // rest_no_route names the failure better than the code we would mint.
37 + protected static function withFallbackCode(\WP_REST_Response $response, string $code): \WP_REST_Response
38 + {
39 + return new \WP_REST_Response(
40 + array_merge(['code' => $code], (array) $response->get_data()),
41 + $response->get_status()
42 + );
43 + }
44 +
31 45 protected static function pluginNotActiveResponse(): \WP_REST_Response
32 46 {
33 47 return new \WP_REST_Response(
34 48 [
@@ -54,9 +68,9 @@
54 68 $body = (array) ($request->get_param('body') ?? []);
55 69
56 70 $response = \wp_safe_remote_post(static::API_URL, [
57 71 // http_request_args only lifts Extendify hosts, and it overrides this value if it ever matches.
58 - 'timeout' => 15,
72 + 'timeout' => 45,
59 73 'headers' => array_merge(['Content-Type' => 'application/json'], $headers),
60 74 'body' => \wp_json_encode(array_merge(['email' => $email], $body)),
61 75 ]);
62 76