Plugin Directory

Changeset 3226740


Ignore:
Timestamp:
01/22/2025 10:49:26 AM (2 months ago)
Author:
teamtp
Message:

Compatible with the Pro edition

Location:
anti-spam-filter-gravity-forms
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • anti-spam-filter-gravity-forms/trunk/anti-spam-filter-gravityform.php

    r3206521 r3226740  
    44 * Plugin Name: Anti-Spam Filter for Gravity Forms
    55 * Description: Anti-Spam Filter for Gravity Forms is a lightweight yet powerful tool designed to protect your Gravity Forms from spam  submissions. It automatically detects and filters out spam based on customizable settings, ensuring only legitimate form entries are    received.
    6  * Version: 1.0.0
     6 * Version: 1.0.1
    77 * Author: teamtp
    88 * Author URI: https://techpumpkin.ca
     
    1717    exit;
    1818}
    19 define( 'ASFGF_PLUGIN_VERSION', '1.0.0' ); // Define the plugin version at the top of your plugin file
     19define( 'ASFGF_PLUGIN_VERSION', '1.0.1' ); // Define the plugin version at the top of your plugin file
    2020
    2121add_action('admin_init', 'asfgf_my_plugin_activation');
     
    112112    $form_ids = get_option('asfgf_form_id');
    113113
    114     $form_ids = array_map('intval', explode(',', $form_ids ));
     114    $form_ids = array_map('intval', explode(',', $form_ids));
    115115
    116116
     
    118118    // Only apply for the specified form ID
    119119
    120     if (!in_array($form['id'], $form_ids)) {
     120    if ($form['id'] != $form_ids[0]) {
    121121
    122122         return $notification;
     
    409409add_action('admin_notices', 'asfgf_settings_notice');
    410410function asfgf_settings_notice() {
     411    if (get_current_screen()->id !== 'toplevel_page_asfgf_spam_filter') {
     412        return; // Exit if we're not on the correct settings page
     413    }
    411414    // Check if 'settings-updated' is set and if we have a valid nonce
    412415    if (isset($_GET['settings-updated']) && $_GET['settings-updated'] === 'true') {
     
    481484
    482485    // Display existing form IDs
    483     foreach ($form_ids_array as $form_id) {
    484         if (!empty($form_id)) {
     486    foreach ($form_ids_array as $index => $form_id) {
     487        if (!empty($form_id) && $form_id < 2) {
    485488            echo '<div class="bubble">
    486489                    <span>' . esc_html($form_id) . '</span>
     
    572575
    573576    // Display existing keywords
    574     foreach ($keywords_array as $keyword) {
    575         if (!empty($keyword)) {
     577    foreach ($keywords_array as $index => $keyword) {
     578        if (!empty($keyword) && $index < 4) {
    576579            echo '<div class="bubble">
    577580                    <span>' . esc_html($keyword) . '</span>
     
    594597function asfgf_subject_text_callback() {
    595598    // Get the current subject text option, escape it to prevent XSS issues
    596     // $asfgf_subject = get_option('asfgf_subject_text');
    597599    $asfgf_subject = "SPAM Alert -";
    598600
     
    608610        echo '<li style="color: #666; font-size: 0.9em;">' . esc_html__('Before the text (Subject: - Abc subject)', 'anti-spam-filter-gravityform') . '</li>';
    609611        echo '<li style="color: #666; font-size: 0.9em;">' . esc_html__('After the text (Subject: - SPAM Alert - Abc subject)', 'anti-spam-filter-gravityform') . '</li>';
    610         echo '<li style="color: #666; font-size: 0.9em;">' . esc_html__('Maximum character requirement: 20 characters', 'anti-spam-filter-gravityform') . '</li>';
     612        echo '<li style="color: #666; font-size: 0.9em;">' . esc_html__('Maximum character requirement: 20 characters.', 'anti-spam-filter-gravityform') . '</li>';
    611613    echo '</ul>';
    612614}
     
    631633
    632634    // Ensure that the description text is also safe to output and uses the 'asfgf' domain for translation
    633     echo '<p style="color: #666; font-size: 0.9em;">' . esc_html__('The Kill Spam feature keeps your inbox free from unwanted email notifications. It detects and eliminates unwanted email notifications based on specified keywords and any Cyrillic characters', 'anti-spam-filter-gravityform') . '</p>';
    634 }
    635 
    636 
    637 
     635    echo '<p style="color: #666; font-size: 0.9em;">' . esc_html__('The Kill Spam feature keeps your inbox free from unwanted email notifications. It detects and eliminates unwanted email notifications based on specified keywords and any Cyrillic characters.', 'anti-spam-filter-gravityform') . '</p>';
     636}
     637
     638
     639
  • anti-spam-filter-gravity-forms/trunk/assets/js/asfgf-admin-script.js

    r3206521 r3226740  
    44        function updateHiddenInput() {
    55            var formIds = [];
    6             $('#bubble-container .bubble span').each(function() {
     6            $('.asfgf_wrap #bubble-container .bubble span').each(function() {
    77                formIds.push($(this).text());
    88            });
     
    1212        function updateHiddenKeywordInput() {
    1313            var formIds = [];
    14             $('#bubble-container-remove-button-filter_keywords .bubble span').each(function() {
     14            $('.asfgf_wrap #bubble-container-remove-button-filter_keywords .bubble span').each(function() {
    1515                formIds.push($(this).text());
    1616            });
     
    3030                $('.asfgf_form_id_box').hide();
    3131                $('.asfgf_cyrillic_enabled_switch , .asfgf_keywords_enabled_switch,.asfgf_kill_spam_enabled_switch').addClass('disabled');
    32                 $('#add-button-keywords , #keyword-text-id,.remove-button-filter_keywords').attr('disabled', 'disabled');
     32                $('.asfgf_wrap #add-button-keywords ,.asfgf_wrap #keyword-text-id,.asfgf_wrap .remove-button-filter_keywords').attr('disabled', 'disabled');
    3333
    3434               
     
    3636                $('.asfgf_form_id_box').show();
    3737                $('.asfgf_cyrillic_enabled_switch , .asfgf_keywords_enabled_switch,.asfgf_kill_spam_enabled_switch').removeClass('disabled');
    38                 $('#add-button-keywords , #keyword-text-id,.remove-button-filter_keywords').removeAttr('disabled');
     38                $('.asfgf_wrap #add-button-keywords , .asfgf_wrap #keyword-text-id,.asfgf_wrap .remove-button-filter_keywords').removeAttr('disabled');
    3939
    4040            }
     
    7272
    7373
    74         $('#add-button').on('click', function() {
    75             var input = $('#form-id-input');
     74        $('.asfgf_wrap #add-button').on('click', function() {
     75            var input = $('.asfgf_wrap #form-id-input');
    7676            var value = input.val()
    77             const bubbleContainer = $('#bubble-container');
     77            const bubbleContainer = $('.asfgf_wrap #bubble-container');
    7878            if(bubbleContainer.children('.bubble').length < 1) {
    7979                if (value) {
    80                     $('#bubble-container').append(
     80                    $('.asfgf_wrap #bubble-container').append(
    8181                        '<div class="bubble"><span>' + value + '</span><button class="remove-button remove-bubble-button">×</button></div>'
    8282                    );
     
    8585                }
    8686            }else{
    87                 console.log("ehklo")
    8887                $(".asfgf_form_id_box #error-message").show()
    8988            }
     
    9190   
    9291        // Delegate the click event to dynamically created remove buttons
    93         $('#bubble-container').on('click', '.remove-button', function() {
     92        $('.asfgf_wrap #bubble-container').on('click', '.remove-button', function() {
    9493            $(this).parent('.bubble').remove();
    9594            $(".asfgf_form_id_box #error-message").hide()
     
    9897
    9998
    100         $('#add-button-keywords').on('click', function() {
     99        $('.asfgf_wrap #add-button-keywords').on('click', function() {
    101100            var input = $('#keyword-text-id');     
    102101            var value = input.val()
    103             const bubbleContainer = $('#bubble-container-remove-button-filter_keywords');
     102            const bubbleContainer = $('.asfgf_wrap #bubble-container-remove-button-filter_keywords');
    104103            if(bubbleContainer.children('.bubble').length < 3) {
    105104                if (value) {
    106                     $('#bubble-container-remove-button-filter_keywords').append(
     105                    $('.asfgf_wrap #bubble-container-remove-button-filter_keywords').append(
    107106                        '<div class="bubble"><span>' + value + '</span><button class="remove-button-filter_keywords remove-bubble-button">×</button></div>'
    108107                    );
     
    116115   
    117116        // Delegate the click event to dynamically created remove buttons
    118         $('#bubble-container-remove-button-filter_keywords').on('click', '.remove-button-filter_keywords', function() {
     117        $('.asfgf_wrap #bubble-container-remove-button-filter_keywords').on('click', '.asfgf_wrap .remove-button-filter_keywords', function() {
    119118            $(this).parent('.bubble').remove();
    120119            $("#asfgf_keywords_container #error-message").hide()
  • anti-spam-filter-gravity-forms/trunk/readme.txt

    r3208720 r3226740  
    33Tags: gravity forms, anti-spam, spam filter, form protection, keyword filtering
    44Requires at least: 6.5
    5 Tested up to: 6.7
    6 Stable tag: 1.0.0
     5Tested up to: 6.7.1
     6Stable tag: 1.0.1
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5252Yes, the plugin automatically detects and filters out form submissions containing Cyrillic characters, which are often used in spam messages.
    5353
     54== Changelog ==
     55= 1.0.1 =
     56* Compatible with the Pro edition.
    5457
    5558== Changelog ==
Note: See TracChangeset for help on using the changeset viewer.