diff --git a/includes/class-hvac-menu-system.php b/includes/class-hvac-menu-system.php
index 7ea48dbe..c190a78f 100644
--- a/includes/class-hvac-menu-system.php
+++ b/includes/class-hvac-menu-system.php
@@ -44,6 +44,38 @@ class HVAC_Menu_System {
add_filter('wp_nav_menu_items', array($this, 'add_logout_to_menu'), 10, 2);
}
+ /**
+ * Detect if user is using Safari browser
+ * Uses centralized browser detection service
+ *
+ * @return bool
+ */
+ private function is_safari_browser() {
+ return HVAC_Browser_Detection::instance()->is_safari_browser();
+ }
+
+ /**
+ * Get script path based on browser compatibility
+ * Uses centralized browser detection service
+ *
+ * @param string $script_name
+ * @return string
+ */
+ private function get_compatible_script_path($script_name) {
+ $browser_detection = HVAC_Browser_Detection::instance();
+
+ // If Safari and doesn't support ES6, load Safari-compatible version
+ if ($browser_detection->is_safari_browser() && !$browser_detection->safari_supports_es6()) {
+ $safari_script = HVAC_PLUGIN_DIR . 'assets/js/' . $script_name . '-safari-compatible.js';
+ if (file_exists($safari_script)) {
+ return HVAC_PLUGIN_URL . 'assets/js/' . $script_name . '-safari-compatible.js';
+ }
+ }
+
+ // Default to standard version
+ return HVAC_PLUGIN_URL . 'assets/js/' . $script_name . '.js';
+ }
+
/**
* Register menu locations
*/
@@ -288,7 +320,7 @@ class HVAC_Menu_System {
wp_enqueue_script(
'hvac-menu-system',
- HVAC_PLUGIN_URL . 'assets/js/hvac-menu-system.js',
+ $this->get_compatible_script_path('hvac-menu-system'),
array('jquery'),
HVAC_PLUGIN_VERSION,
true
diff --git a/includes/class-hvac-qr-generator.php b/includes/class-hvac-qr-generator.php
index 73c87714..3333d40e 100644
--- a/includes/class-hvac-qr-generator.php
+++ b/includes/class-hvac-qr-generator.php
@@ -242,6 +242,7 @@ class HVAC_QR_Generator {
diff --git a/includes/class-hvac-safari-script-blocker.php b/includes/class-hvac-safari-script-blocker.php
new file mode 100644
index 00000000..5d919501
--- /dev/null
+++ b/includes/class-hvac-safari-script-blocker.php
@@ -0,0 +1,261 @@
+init_hooks();
+ }
+
+ /**
+ * Initialize hooks
+ */
+ private function init_hooks() {
+ // Only activate for Safari browsers
+ if ($this->is_safari_browser()) {
+ add_action('wp_head', [$this, 'add_script_blocking_code'], 1);
+ add_action('wp_footer', [$this, 'add_script_monitoring'], 999);
+ add_filter('script_loader_src', [$this, 'filter_problematic_scripts'], 10, 2);
+ }
+ }
+
+ /**
+ * Check if current request is from Safari
+ *
+ * @return bool
+ */
+ private function is_safari_browser() {
+ if (!isset($_SERVER['HTTP_USER_AGENT'])) {
+ return false;
+ }
+
+ $user_agent = $_SERVER['HTTP_USER_AGENT'];
+
+ return (strpos($user_agent, 'Safari') !== false &&
+ strpos($user_agent, 'Chrome') === false &&
+ strpos($user_agent, 'Chromium') === false);
+ }
+
+ /**
+ * Add script blocking code in head
+ */
+ public function add_script_blocking_code() {
+ ?>
+
+ blocked_scripts as $pattern) {
+ if (strpos(strtolower($src), $pattern) !== false) {
+ error_log('[SAFARI-BLOCKER] Blocked script: ' . $src);
+ return false; // Don't load this script
+ }
+ }
+
+ return $src;
+ }
+
+ /**
+ * Add script monitoring in footer
+ */
+ public function add_script_monitoring() {
+ ?>
+
+ version
);
+ // Mobile responsive optimizations - Load after base styles
+ wp_enqueue_style(
+ 'hvac-mobile-responsive',
+ HVAC_PLUGIN_URL . 'assets/css/hvac-mobile-responsive.css',
+ array('hvac-common', 'hvac-accessibility-fixes'),
+ $this->version
+ );
+
// Load the rest of the page-specific CSS
$this->enqueue_page_specific_css();
}
@@ -470,6 +479,15 @@ class HVAC_Scripts_Styles {
true
);
+ // Mobile responsive functionality - Load on all plugin pages
+ wp_enqueue_script(
+ 'hvac-mobile-responsive',
+ HVAC_PLUGIN_URL . 'assets/js/hvac-mobile-responsive.js',
+ array('jquery', 'hvac-community-events'),
+ $this->version,
+ true
+ );
+
// Dashboard scripts
if ($this->is_dashboard_page()) {
wp_enqueue_script(
diff --git a/scripts/cache-trainer-event-counts.sh b/scripts/cache-trainer-event-counts.sh
new file mode 100755
index 00000000..3b24b9cd
--- /dev/null
+++ b/scripts/cache-trainer-event-counts.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Cache Trainer Event Counts Script
+# Pre-populates event count cache to improve find-a-trainer page performance
+
+echo "=== Caching Trainer Event Counts ==="
+
+# For staging server
+if [[ "$1" == "staging" ]]; then
+ echo "Caching event counts on staging server..."
+ ssh roodev@146.190.76.204 'cd /home/974670.cloudwaysapps.com/uberrxmprk/public_html && wp eval "
+ \$profiles = get_posts([
+ \"post_type\" => \"trainer_profile\",
+ \"posts_per_page\" => -1,
+ \"post_status\" => \"publish\"
+ ]);
+
+ \$cached = 0;
+
+ foreach (\$profiles as \$profile) {
+ \$user_id = get_post_meta(\$profile->ID, \"user_id\", true);
+ if (\$user_id) {
+ \$count_query = new WP_Query([
+ \"post_type\" => \"tribe_events\",
+ \"author\" => \$user_id,
+ \"post_status\" => \"publish\",
+ \"fields\" => \"ids\",
+ \"posts_per_page\" => 1,
+ \"no_found_rows\" => false
+ ]);
+ \$event_count = \$count_query->found_posts;
+ wp_reset_postdata();
+
+ update_post_meta(\$profile->ID, \"cached_event_count\", \$event_count);
+ update_post_meta(\$profile->ID, \"cached_event_count_timestamp\", time());
+
+ \$trainer_name = get_post_meta(\$profile->ID, \"trainer_display_name\", true);
+ echo \"Cached \" . \$trainer_name . \": \" . \$event_count . \" events\" . PHP_EOL;
+ \$cached++;
+ }
+ }
+
+ echo \"Cached event counts for \" . \$cached . \" trainers\" . PHP_EOL;
+ "'
+
+else
+ echo "Usage: $0 staging"
+ echo "Caches trainer event counts to improve find-a-trainer page performance"
+fi
+
+echo "=== Cache Update Complete ==="
\ No newline at end of file
diff --git a/templates/page-find-trainer-minimal.php b/templates/page-find-trainer-minimal.php
new file mode 100644
index 00000000..76de838f
--- /dev/null
+++ b/templates/page-find-trainer-minimal.php
@@ -0,0 +1,96 @@
+
+
+
+
+
Find a Trainer - Minimal Test
+
If you can see this text, the basic page loading works.
+
+
Browser Info:
+
+ - User Agent:
+ - Browser:
+ - JavaScript: ❌ Not loaded
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/template-hvac-dashboard.php b/templates/template-hvac-dashboard.php
index 27438333..62a4ed75 100644
--- a/templates/template-hvac-dashboard.php
+++ b/templates/template-hvac-dashboard.php
@@ -128,7 +128,7 @@ $revenue_target = $dashboard_data->get_annual_revenue_target();
'Total Events
',
'All events you\'ve created, including drafts and published events'
); ?>
-
+
@@ -139,7 +139,7 @@ $revenue_target = $dashboard_data->get_annual_revenue_target();
'Upcoming Events
',
'Published events scheduled for future dates'
); ?>
-
+
@@ -150,7 +150,7 @@ $revenue_target = $dashboard_data->get_annual_revenue_target();
'Past Events
',
'Completed events where you can generate certificates'
); ?>
-
+
@@ -161,7 +161,7 @@ $revenue_target = $dashboard_data->get_annual_revenue_target();
'Tickets Sold
',
'Total number of tickets sold across all your events'
); ?>
-
+
@@ -172,7 +172,7 @@ $revenue_target = $dashboard_data->get_annual_revenue_target();
'Total Revenue
',
'Total earnings from all ticket sales (before Stripe fees)'
); ?>
- $
+ $
Target: $
@@ -375,6 +375,134 @@ $revenue_target = $dashboard_data->get_annual_revenue_target();
+
+
\ No newline at end of file