| @@ -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 ); |