PluginProbe
FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel / 1.0
FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel v1.0
1.7.1 1.7.0 1.6.0 1.5.2 trunk 0.1 0.2.0 0.2.1 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.4 0.4.1 0.4.2 0.4.3 1.0 1.1 1.2 1.3.1 1.4.0 1.4.1 1.5.0 1.5.1 All 26 releases
← All changes | includes/FlyApi.php +4 -7 trunk1.0 View file →
@@ -19,14 +19,13 @@
19 19 * @param string $action
20 20 *
21 21 * @return array|false
22 22 */
23 - public function cache_toggle( $action = 'enable', $type = 'fastcgi' ) {
23 + public function cache_toggle( $action = 'enable' ) {
24 24 return $this->post(
25 25 '/cache-toggle',
26 26 [
27 27 'action' => $action,
28 - 'type' => $type,
29 28 ]
30 29 );
31 30 }
32 31
@@ -35,9 +34,9 @@
35 34 *
36 35 * @return string
37 36 */
38 37 protected function get_endpoint() {
39 - return apply_filters( 'flywp_api_endpoint', 'https://app.flywp.com/site-api' );
38 + return apply_filters( 'flywp_api_endpoint', 'https://app.flywp.com/api/site-api' );
40 39 }
41 40
42 41 /**
43 42 * Send a GET request to the API.
@@ -72,9 +71,9 @@
72 71 /**
73 72 * Send a POST request to the API.
74 73 *
75 74 * @param string $path
76 - * @param array $data
75 + * @param array $data
77 76 *
78 77 * @return array|false
79 78 */
80 79 public function post( $path, $data = [] ) {
@@ -85,15 +84,13 @@
85 84 [
86 85 'headers' => [
87 86 'Authorization' => 'Bearer ' . flywp()->get_key(),
88 87 ],
89 - 'body' => $data,
88 + 'body' => $data,
90 89 ]
91 90 );
92 91
93 92 if ( is_wp_error( $response ) ) {
94 - error_log( print_r( $response, true ) );
95 -
96 93 return false;
97 94 }
98 95
99 96 $body = wp_remote_retrieve_body( $response );