diff --git a/assets/js/src/components/admin/Settings.js b/assets/js/src/components/admin/Settings.js
index 3d2c483..3500362 100644
--- a/assets/js/src/components/admin/Settings.js
+++ b/assets/js/src/components/admin/Settings.js
@@ -105,7 +105,8 @@ const Settings = () => {
setSettings({
bmlt_root_server: response.bmlt_root_server || '',
notification_email: response.notification_email || '',
- default_service_bodies: response.default_service_bodies || ''
+ default_service_bodies: response.default_service_bodies || '',
+ server_info: response.server_info || null
});
setExternalSources(Array.isArray(response.external_sources) ? response.external_sources : []);
@@ -351,6 +352,18 @@ const Settings = () => {
Important: This plugin requires Pretty Permalinks to be enabled for the REST API to function correctly. If you're experiencing 404 errors when accessing external source or settings BMLT server, please ensure your WordPress site is using Pretty Permalinks (Settings → Permalinks) and not the "Plain" setting.
+
+ {settings.server_info && !settings.server_info.curl_available && (
+
+ Performance Warning: The PHP curl extension is not installed. External source requests will be significantly slower. Ask your hosting provider to install the php-curl extension for PHP {settings.server_info.php_version}.
+
+ )}
+
+ {settings.server_info && settings.server_info.curl_available && (
+
+ PHP {settings.server_info.php_version} with curl {settings.server_info.curl_version} detected.
+
+ )}
{error && (
setError(null)}>
diff --git a/includes/Rest/SettingsController.php b/includes/Rest/SettingsController.php
index 1833106..d52eed8 100644
--- a/includes/Rest/SettingsController.php
+++ b/includes/Rest/SettingsController.php
@@ -38,7 +38,7 @@ public static function get_settings($request) {
$settings = get_option('mayo_settings', []);
$external_sources = get_option('mayo_external_sources', []);
- return new \WP_REST_Response([
+ $response_data = [
'bmlt_root_server' => $settings['bmlt_root_server'] ?? '',
'notification_email' => $settings['notification_email'] ?? '',
'default_service_bodies' => $settings['default_service_bodies'] ?? '',
@@ -47,7 +47,17 @@ public static function get_settings($request) {
'subscription_tags' => $settings['subscription_tags'] ?? [],
'subscription_service_bodies' => $settings['subscription_service_bodies'] ?? [],
'subscription_new_option_behavior' => $settings['subscription_new_option_behavior'] ?? 'opt_in'
- ]);
+ ];
+
+ if (current_user_can('manage_options')) {
+ $response_data['server_info'] = [
+ 'php_version' => PHP_VERSION,
+ 'curl_available' => extension_loaded('curl'),
+ 'curl_version' => extension_loaded('curl') ? curl_version()['version'] : null,
+ ];
+ }
+
+ return new \WP_REST_Response($response_data);
}
/**
diff --git a/readme.txt b/readme.txt
index abdc3c6..17dc344 100644
--- a/readme.txt
+++ b/readme.txt
@@ -195,6 +195,7 @@ This project is licensed under the GPL v2 or later.
* Changed external source event type dropdown from "Select an event type" to "All Event Types" to clarify that leaving it blank fetches all types.
* Added support for comma-separated event types in the REST API (e.g., `event_type=Activity,Service`), enabling a single external source to fetch multiple event types in one request.
* Fixed admin events list page taking minutes to load when many events exist by caching service body lookups instead of making an HTTP request per row.
+* Added server health check warning on settings page when PHP curl extension is missing, which causes significantly slower external source requests.
= 1.8.7 =
* Fixed announcement form flyer upload field never appearing even when `show_flyer="true"` shortcode attribute was set. [#252]