From 38688ef43d81380e1676c5daaef470082cb034c8 Mon Sep 17 00:00:00 2001 From: bengizmo Date: Wed, 6 Aug 2025 07:55:02 -0300 Subject: [PATCH] fix: Update registration pending page email to joe@upskillhvac.com with bot protection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated default email in HVAC_Activator from support@upskillevents.com to joe@upskillhvac.com - Added email obfuscation methods (obfuscate_email, encode_email) to HVAC_Page_Manager - Updated registration pending template to use {support_email_encoded} placeholder - Added JavaScript and HTML entity protection against email harvesting bots 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Ben Reed --- includes/class-hvac-activator.php | 2 +- includes/class-hvac-page-manager.php | 56 +++++++++++++++++- templates/content/registration-pending.html | 63 +++++++++++++++++++++ templates/page-registration-pending.php | 2 +- 4 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 templates/content/registration-pending.html diff --git a/includes/class-hvac-activator.php b/includes/class-hvac-activator.php index 46ab2cd6..4a44e6ad 100644 --- a/includes/class-hvac-activator.php +++ b/includes/class-hvac-activator.php @@ -261,7 +261,7 @@ class HVAC_Activator { */ private static function set_default_options() { // General settings - add_option('hvac_support_email', 'support@upskillevents.com'); + add_option('hvac_support_email', 'joe@upskillhvac.com'); add_option('hvac_trainer_approval_required', true); add_option('hvac_inactive_days_threshold', 180); diff --git a/includes/class-hvac-page-manager.php b/includes/class-hvac-page-manager.php index 79979f31..864cfade 100644 --- a/includes/class-hvac-page-manager.php +++ b/includes/class-hvac-page-manager.php @@ -454,7 +454,9 @@ class HVAC_Page_Manager { '{logout_url}' => wp_logout_url(home_url()), '{login_url}' => home_url('/training-login/'), '{site_name}' => get_bloginfo('name'), - '{support_email}' => get_option('hvac_support_email', 'support@upskillevents.com') + '{support_email}' => get_option('hvac_support_email', 'joe@upskillhvac.com'), + '{support_email_obfuscated}' => self::obfuscate_email(get_option('hvac_support_email', 'joe@upskillhvac.com')), + '{support_email_encoded}' => self::encode_email(get_option('hvac_support_email', 'joe@upskillhvac.com')) ]; $content = str_replace(array_keys($replacements), array_values($replacements), $content); @@ -573,4 +575,56 @@ class HVAC_Page_Manager { HVAC_Logger::info('Completed page layout and template updates', 'Page Manager'); } + + /** + * Obfuscate email address to prevent bot harvesting + * + * @param string $email Email address to obfuscate + * @return string Obfuscated email HTML + */ + public static function obfuscate_email($email) { + $obfuscated = ''; + $len = strlen($email); + + // Convert each character to HTML entity + for ($i = 0; $i < $len; $i++) { + $char = $email[$i]; + // Mix between decimal and hex entities + if (mt_rand(0, 1)) { + $obfuscated .= '&#' . ord($char) . ';'; + } else { + $obfuscated .= '&#x' . dechex(ord($char)) . ';'; + } + } + + return $obfuscated; + } + + /** + * Encode email with JavaScript protection + * + * @param string $email Email address to encode + * @return string JavaScript-protected email HTML + */ + public static function encode_email($email) { + $encoded = ''; + $len = strlen($email); + + // Create reversed and encoded email + $reversed = strrev($email); + for ($i = 0; $i < $len; $i++) { + $encoded .= '&#' . ord($reversed[$i]) . ';'; + } + + // Return JavaScript that decodes and reverses the email + return ' + '; + } } \ No newline at end of file diff --git a/templates/content/registration-pending.html b/templates/content/registration-pending.html new file mode 100644 index 00000000..50bbf536 --- /dev/null +++ b/templates/content/registration-pending.html @@ -0,0 +1,63 @@ + +
+
+
+

✓

+
+ + + +

Account is Pending Approval

+ + + +

Registration Submitted Successfully

+ + + +

Thank you for registering as an HVAC trainer! Your registration has been submitted and is currently being reviewed by our team.

+ + + +

You will receive an email notification once your account has been approved and activated. This process typically takes 1-2 business days.

+ + + +
+

What's Next?

+ + + +
    +
  • Check your email for confirmation of your registration
  • + + + +
  • Our team will review your application and credentials
  • + + + +
  • You'll receive approval notification via email
  • + + + +
  • Once approved, you can log in and start creating events
  • +
+
+ + + +

If you have any questions about your registration, please contact our support team at {support_email_encoded}.

+ + + + +
+
+ \ No newline at end of file diff --git a/templates/page-registration-pending.php b/templates/page-registration-pending.php index dbd070d0..c5f1e6cc 100644 --- a/templates/page-registration-pending.php +++ b/templates/page-registration-pending.php @@ -11,7 +11,7 @@ get_header();

Registration Pending

Thank you for registering! Your registration is currently pending approval.

You will receive an email notification once your account has been approved.

-

If you have any questions, please contact support at .

+

If you have any questions, please contact support at .

Return to Home