diff --git a/bootstrap.php b/bootstrap.php index fb5bdd5e..4565ddad 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -164,7 +164,6 @@ function () { require HOSTGATOR_PLUGIN_DIR . '/inc/jetpack.php'; require HOSTGATOR_PLUGIN_DIR . '/inc/LoginRedirect.php'; require HOSTGATOR_PLUGIN_DIR . '/inc/partners.php'; -require HOSTGATOR_PLUGIN_DIR . '/inc/RestApi/CachingController.php'; require HOSTGATOR_PLUGIN_DIR . '/inc/RestApi/SettingsController.php'; require HOSTGATOR_PLUGIN_DIR . '/inc/RestApi/rest-api.php'; require HOSTGATOR_PLUGIN_DIR . '/inc/settings.php'; diff --git a/inc/RestApi/CachingController.php b/inc/RestApi/CachingController.php deleted file mode 100644 index 7586caf9..00000000 --- a/inc/RestApi/CachingController.php +++ /dev/null @@ -1,68 +0,0 @@ -namespace, - '/caching', - array( - 'methods' => \WP_REST_Server::DELETABLE, - 'callback' => array( $this, 'purge_all' ), - 'permission_callback' => array( $this, 'check_permission' ), - ) - ); - } - - /** - * Clears the entire cache - */ - public function purge_all() { - - container()->get( 'cachePurger' )->purgeAll(); - - return array( - 'status' => 'success', - 'message' => 'Cache purged', - ); - } - - /** - * Check permissions for route. - * - * @return bool|\WP_Error - */ - public function check_permission() { - if ( ! current_user_can( 'manage_options' ) ) { - return new \WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to access this endpoint.', 'wp-plugin-hostgator' ), array( 'status' => rest_authorization_required_code() ) ); - } - - return true; - } -} diff --git a/inc/RestApi/SettingsController.php b/inc/RestApi/SettingsController.php index c7ca7567..b7620b0a 100644 --- a/inc/RestApi/SettingsController.php +++ b/inc/RestApi/SettingsController.php @@ -124,9 +124,6 @@ public function update_item( $request ) { case 'emptyTrashDays': update_option( 'nfd_empty_trash_days', intval( $new_value ) ); break; - case 'cacheLevel': - update_option( 'endurance_cache_level', $new_value ); - break; case 'hasSetHomepage': update_option( 'bh_has_set_homepage', (bool) $new_value ); break; @@ -185,7 +182,6 @@ public function get_current_settings() { 'commentsPerPage' => intval( get_option( 'comments_per_page', 50 ) ), 'contentRevisions' => intval( get_option( 'nfd_wp_post_revisions', 5 ) ), 'emptyTrashDays' => intval( get_option( 'nfd_empty_trash_days', 30 ) ), - 'cacheLevel' => intval( get_option( 'endurance_cache_level', 2 ) ), 'hasSetHomepage' => (bool) get_option( 'bh_has_set_homepage', false ), 'showOnFront' => (string) get_option( 'show_on_front' ), 'pageOnFront' => (int) get_option( 'page_on_front' ), diff --git a/inc/RestApi/rest-api.php b/inc/RestApi/rest-api.php index 33d474ba..152fadf1 100644 --- a/inc/RestApi/rest-api.php +++ b/inc/RestApi/rest-api.php @@ -13,7 +13,6 @@ function init_rest_api() { $controllers = array( - 'HostGator\\RestApi\\CachingController', 'HostGator\\RestApi\\SettingsController', ); diff --git a/languages/wp-plugin-hostgator-es_MX.po b/languages/wp-plugin-hostgator-es_MX.po index b3bb18c6..d3eabc09 100644 --- a/languages/wp-plugin-hostgator-es_MX.po +++ b/languages/wp-plugin-hostgator-es_MX.po @@ -154,8 +154,7 @@ msgstr "%1$s requiere la versión de WordPress %2$s o posterior. Actualmente est msgid "The \"%s\" plugin has been deactivated." msgstr "El plugin \"%s\" ha sido desactivado." -#: inc/RestApi/CachingController.php:63 -#: inc/RestApi/SettingsController.php:204 +#: inc/RestApi/SettingsController.php:200 msgid "Sorry, you are not allowed to access this endpoint." msgstr "Lo sentimos, no tienes permiso para acceder a esta terminal." diff --git a/languages/wp-plugin-hostgator-pt_BR.po b/languages/wp-plugin-hostgator-pt_BR.po index 908bad01..28bceabf 100644 --- a/languages/wp-plugin-hostgator-pt_BR.po +++ b/languages/wp-plugin-hostgator-pt_BR.po @@ -164,8 +164,7 @@ msgstr "%1$s requer a versão do WordPress %2$s ou posterior. Você está execut msgid "The \"%s\" plugin has been deactivated." msgstr "O\"%s\" plugin foi desativado." -#: inc/RestApi/CachingController.php:63 -#: inc/RestApi/SettingsController.php:204 +#: inc/RestApi/SettingsController.php:200 msgid "Sorry, you are not allowed to access this endpoint." msgstr "Desculpe, você não tem permissão para acessar este endpoint." diff --git a/languages/wp-plugin-hostgator.pot b/languages/wp-plugin-hostgator.pot index e79b05ee..ef2b7584 100644 --- a/languages/wp-plugin-hostgator.pot +++ b/languages/wp-plugin-hostgator.pot @@ -176,8 +176,7 @@ msgstr "" msgid "The \"%s\" plugin has been deactivated." msgstr "" -#: inc/RestApi/CachingController.php:63 -#: inc/RestApi/SettingsController.php:204 +#: inc/RestApi/SettingsController.php:200 msgid "Sorry, you are not allowed to access this endpoint." msgstr ""