Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion assets/js/src/components/admin/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 : []);

Expand Down Expand Up @@ -351,6 +352,18 @@ const Settings = () => {
<Notice status="warning" isDismissible={false}>
<p><strong>Important:</strong> 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.</p>
</Notice>

{settings.server_info && !settings.server_info.curl_available && (
<Notice status="warning" isDismissible={false}>
<p><strong>Performance Warning:</strong> 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}.</p>
</Notice>
)}

{settings.server_info && settings.server_info.curl_available && (
<Notice status="success" isDismissible={false}>
<p>PHP {settings.server_info.php_version} with curl {settings.server_info.curl_version} detected.</p>
</Notice>
)}

{error && (
<Notice status="error" isDismissible={true} onRemove={() => setError(null)}>
Expand Down
14 changes: 12 additions & 2 deletions includes/Rest/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? '',
Expand All @@ -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);
}

/**
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down