Plugin Directory

Changeset 3322181


Ignore:
Timestamp:
07/04/2025 09:17:28 AM (9 months ago)
Author:
ctomczyk
Message:

Release 1.3.15

Location:
spam-prevention-for-contact-form-7-and-comments/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • spam-prevention-for-contact-form-7-and-comments/trunk/README.txt

    r3321437 r3322181  
    44Requires at least: 4.7
    55Tested up to: 6.8.1
    6 Stable tag: 1.3.14
     6Stable tag: 1.3.15
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2626
    2727== 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.
    2831
    2932= 1.3.14 =
  • spam-prevention-for-contact-form-7-and-comments/trunk/public/sitelint-public.php

    r3312012 r3322181  
    6262          echo "  inp.name = 'sp';";
    6363          echo "  contactForm.appendChild(inp);";
    64           echo "  document.removeEventListener('scroll', handleCfScroll);\n";
    6564        echo " };" . "\n";
    6665
     
    7069          echo "  handleCfScroll();";
    7170          echo "} else {";
    72           echo "  document.addEventListener('scroll', handleCfScroll);";
     71          echo "  document.addEventListener('scroll', handleCfScroll, { once: true });";
    7372          echo "}";
    7473
     
    8584        $wpcfRequestedTokenOriginalValue = hash('sha512', $_SERVER['DOCUMENT_ROOT']);
    8685        $wpcfRequestedTokenIncomingValue = $submission->get_posted_data('sp');
     86        global $cfdb7_save_allowed;
    8787
    88         if (empty($wpcfRequestedTokenIncomingValue)
    89           || $wpcfRequestedTokenIncomingValue !== $wpcfRequestedTokenOriginalValue
    90         ) {
     88        if (empty($wpcfRequestedTokenIncomingValue) || $wpcfRequestedTokenIncomingValue !== $wpcfRequestedTokenOriginalValue) {
    9189          $abort = true;
     90          $cfdb7_save_allowed = false;
     91
     92        } else {
     93          $cfdb7_save_allowed = true;
    9294        }
    9395
    9496        return $submission;
    9597      }
     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
    96116    }
    97117
  • spam-prevention-for-contact-form-7-and-comments/trunk/sitelint.php

    r3321437 r3322181  
    1010 * Plugin Name:       Spam Prevention for Contact Form 7 and Comments
    1111 * Description:       Automatic Spam Prevention for Contact Form 7 and Comments
    12  * Version:           1.3.14
     12 * Version:           1.3.15
    1313 * Author:            SiteLint
    1414 * Author URI:        https://www.sitelint.com
     
    2727 * Currently plugin version. Use SemVer - https://semver.org
    2828 */
    29 define('SLSP_SITELINT_VERSION', '1.3.14');
     29define('SLSP_SITELINT_VERSION', '1.3.15');
    3030
    3131/**
Note: See TracChangeset for help on using the changeset viewer.