Changeset 3322181
- Timestamp:
- 07/04/2025 09:17:28 AM (9 months ago)
- Location:
- spam-prevention-for-contact-form-7-and-comments/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
public/sitelint-public.php (modified) (3 diffs)
-
sitelint.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
spam-prevention-for-contact-form-7-and-comments/trunk/README.txt
r3321437 r3322181 4 4 Requires at least: 4.7 5 5 Tested up to: 6.8.1 6 Stable tag: 1.3.1 46 Stable tag: 1.3.15 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 27 27 == Changelog == 28 29 = 1.3.15 = 30 * Supports the "Contact Form 7 Database Addon - CFDB7" and prevents contact form submissions from being saved if validation fails. 28 31 29 32 = 1.3.14 = -
spam-prevention-for-contact-form-7-and-comments/trunk/public/sitelint-public.php
r3312012 r3322181 62 62 echo " inp.name = 'sp';"; 63 63 echo " contactForm.appendChild(inp);"; 64 echo " document.removeEventListener('scroll', handleCfScroll);\n";65 64 echo " };" . "\n"; 66 65 … … 70 69 echo " handleCfScroll();"; 71 70 echo "} else {"; 72 echo " document.addEventListener('scroll', handleCfScroll );";71 echo " document.addEventListener('scroll', handleCfScroll, { once: true });"; 73 72 echo "}"; 74 73 … … 85 84 $wpcfRequestedTokenOriginalValue = hash('sha512', $_SERVER['DOCUMENT_ROOT']); 86 85 $wpcfRequestedTokenIncomingValue = $submission->get_posted_data('sp'); 86 global $cfdb7_save_allowed; 87 87 88 if (empty($wpcfRequestedTokenIncomingValue) 89 || $wpcfRequestedTokenIncomingValue !== $wpcfRequestedTokenOriginalValue 90 ) { 88 if (empty($wpcfRequestedTokenIncomingValue) || $wpcfRequestedTokenIncomingValue !== $wpcfRequestedTokenOriginalValue) { 91 89 $abort = true; 90 $cfdb7_save_allowed = false; 91 92 } else { 93 $cfdb7_save_allowed = true; 92 94 } 93 95 94 96 return $submission; 95 97 } 98 99 function cfdb7_before_send_mail_override($form_tag) { 100 global $cfdb7_save_allowed; 101 102 if (isset($cfdb7_save_allowed) && !$cfdb7_save_allowed) { 103 return; 104 } 105 106 $original_function = 'cfdb7_before_send_mail'; 107 108 if (function_exists($original_function)) { 109 $original_function($form_tag); 110 } 111 } 112 113 remove_action('wpcf7_before_send_mail', 'cfdb7_before_send_mail'); 114 add_action('wpcf7_before_send_mail', 'cfdb7_before_send_mail_override', 10, 1); 115 96 116 } 97 117 -
spam-prevention-for-contact-form-7-and-comments/trunk/sitelint.php
r3321437 r3322181 10 10 * Plugin Name: Spam Prevention for Contact Form 7 and Comments 11 11 * Description: Automatic Spam Prevention for Contact Form 7 and Comments 12 * Version: 1.3.1 412 * Version: 1.3.15 13 13 * Author: SiteLint 14 14 * Author URI: https://www.sitelint.com … … 27 27 * Currently plugin version. Use SemVer - https://semver.org 28 28 */ 29 define('SLSP_SITELINT_VERSION', '1.3.1 4');29 define('SLSP_SITELINT_VERSION', '1.3.15'); 30 30 31 31 /**
Note: See TracChangeset
for help on using the changeset viewer.