Changeset 3383620
- Timestamp:
- 10/23/2025 07:17:37 PM (5 months ago)
- Location:
- yournotify/trunk
- Files:
-
- 3 edited
-
admin-settings-tabbed.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
yournotify.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
yournotify/trunk/admin-settings-tabbed.php
r3383615 r3383620 61 61 <tr><th><?php esc_html_e('Username','yournotify'); ?></th><td><input type="text" name="yournotify_smtp_user" class="regular-text" value="<?php echo esc_attr(get_option('yournotify_smtp_user','')); ?>"></td></tr> 62 62 <tr><th><?php esc_html_e('Password','yournotify'); ?></th><td><input type="password" name="yournotify_smtp_pass" class="regular-text" value="<?php echo esc_attr(get_option('yournotify_smtp_pass','')); ?>"></td></tr> 63 <tr><th><?php esc_html_e('From Email','yournotify'); ?></th><td><input type="email" name="yournotify_smtp_from_email" class="regular-text" value="<?php echo esc_attr(get_option('yournotify_smtp_from_email','')); ?>"> <p class="description"><?php esc_html_e(' Optional. Sets the From address on outgoing emails.','yournotify'); ?></p></td></tr>63 <tr><th><?php esc_html_e('From Email','yournotify'); ?></th><td><input type="email" name="yournotify_smtp_from_email" class="regular-text" value="<?php echo esc_attr(get_option('yournotify_smtp_from_email','')); ?>"> <p class="description"><?php esc_html_e('Required when SMTP Override is enabled. Enter Yournotify SenderID (verified sender email).','yournotify'); ?></p></td></tr> 64 64 <tr><th><?php esc_html_e('From Name','yournotify'); ?></th><td><input type="text" name="yournotify_smtp_from_name" class="regular-text" value="<?php echo esc_attr(get_option('yournotify_smtp_from_name','')); ?>"> <p class="description"><?php esc_html_e('Optional. Sets the From name on outgoing emails.','yournotify'); ?></p></td></tr> 65 65 </table> -
yournotify/trunk/readme.txt
r3383615 r3383620 4 4 Requires at least: 4.6 5 5 Tested up to: 6.7 6 Stable tag: 2.1. 46 Stable tag: 2.1.5 7 7 License: GPLv3 or later 8 8 -
yournotify/trunk/yournotify.php
r3383615 r3383620 4 4 * Plugin URI: https://yournotify.com 5 5 * Description: Yournotify WP Plugin — SMTP, Subscriber Form, Contact Form. 6 * Version: 2.1. 46 * Version: 2.1.5 7 7 * Author: Yournotify 8 8 * Author URI: https://yournotify.com … … 24 24 $phpmailer->SMTPSecure = 'tls'; 25 25 $phpmailer->Port = 587; 26 // Optionally set From address/name27 $from_email = trim((string) get_option('yournotify_smtp_from_email',''));26 // Require From address/name; default name falls back to site name 27 $from_email = sanitize_email((string) get_option('yournotify_smtp_from_email','')); 28 28 $from_name = trim((string) get_option('yournotify_smtp_from_name','')); 29 if ($from_name === '') { $from_name = get_bloginfo('name'); } 29 30 if ($from_email) { 30 31 try { $phpmailer->setFrom($from_email, $from_name); } catch (Throwable $e) { /* ignore invalid from */ } 32 } else { 33 // No valid From: do not proceed with SMTP override 34 return; 31 35 } 32 36 }, 10); … … 70 74 // Removed: Double Opt-in and Success Redirect settings 71 75 72 register_setting('yournotify_smtp','yournotify_smtp_enable', ['type'=>'boolean','sanitize_callback'=>function($v){return $v?1:0;} ]); 76 register_setting('yournotify_smtp','yournotify_smtp_enable', ['type'=>'boolean','sanitize_callback'=>function($v){ 77 $enabled = $v?1:0; 78 if ($enabled) { 79 $email = isset($_POST['yournotify_smtp_from_email']) ? sanitize_email(trim($_POST['yournotify_smtp_from_email'])) : ''; 80 if (!$email) { 81 add_settings_error('yournotify_smtp_from_email','yn_from_missing', __('From Email is required when SMTP Override is enabled. Enter your Yournotify SenderID email.','yournotify'),'error'); 82 return 0; // prevent enabling without required From 83 } 84 } 85 return $enabled; 86 } ]); 73 87 register_setting('yournotify_smtp','yournotify_smtp_user', ['type'=>'string','sanitize_callback'=>function($v){return is_string($v)?trim($v):'';} ]); 74 88 register_setting('yournotify_smtp','yournotify_smtp_pass', ['type'=>'string','sanitize_callback'=>function($v){return is_string($v)?trim($v):'';} ]); 75 register_setting('yournotify_smtp','yournotify_smtp_from_email', ['type'=>'string','sanitize_callback'=>function($v){ return is_string($v)? trim($v):''; }]); 89 register_setting('yournotify_smtp','yournotify_smtp_from_email', ['type'=>'string','sanitize_callback'=>function($v){ 90 $email = is_string($v)? sanitize_email(trim($v)) : ''; 91 return $email ?: ''; 92 }]); 76 93 register_setting('yournotify_smtp','yournotify_smtp_from_name', ['type'=>'string','sanitize_callback'=>function($v){ return is_string($v)? trim($v):''; }]); 77 94 });
Note: See TracChangeset
for help on using the changeset viewer.