Changeset 3226740
- Timestamp:
- 01/22/2025 10:49:26 AM (2 months ago)
- 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 4 4 * Plugin Name: Anti-Spam Filter for Gravity Forms 5 5 * 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. 06 * Version: 1.0.1 7 7 * Author: teamtp 8 8 * Author URI: https://techpumpkin.ca … … 17 17 exit; 18 18 } 19 define( 'ASFGF_PLUGIN_VERSION', '1.0. 0' ); // Define the plugin version at the top of your plugin file19 define( 'ASFGF_PLUGIN_VERSION', '1.0.1' ); // Define the plugin version at the top of your plugin file 20 20 21 21 add_action('admin_init', 'asfgf_my_plugin_activation'); … … 112 112 $form_ids = get_option('asfgf_form_id'); 113 113 114 $form_ids = array_map('intval', explode(',', $form_ids 114 $form_ids = array_map('intval', explode(',', $form_ids)); 115 115 116 116 … … 118 118 // Only apply for the specified form ID 119 119 120 if ( !in_array($form['id'], $form_ids)) {120 if ($form['id'] != $form_ids[0]) { 121 121 122 122 return $notification; … … 409 409 add_action('admin_notices', 'asfgf_settings_notice'); 410 410 function 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 } 411 414 // Check if 'settings-updated' is set and if we have a valid nonce 412 415 if (isset($_GET['settings-updated']) && $_GET['settings-updated'] === 'true') { … … 481 484 482 485 // 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) { 485 488 echo '<div class="bubble"> 486 489 <span>' . esc_html($form_id) . '</span> … … 572 575 573 576 // 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) { 576 579 echo '<div class="bubble"> 577 580 <span>' . esc_html($keyword) . '</span> … … 594 597 function asfgf_subject_text_callback() { 595 598 // Get the current subject text option, escape it to prevent XSS issues 596 // $asfgf_subject = get_option('asfgf_subject_text');597 599 $asfgf_subject = "SPAM Alert -"; 598 600 … … 608 610 echo '<li style="color: #666; font-size: 0.9em;">' . esc_html__('Before the text (Subject: - Abc subject)', 'anti-spam-filter-gravityform') . '</li>'; 609 611 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>'; 611 613 echo '</ul>'; 612 614 } … … 631 633 632 634 // 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 4 4 function updateHiddenInput() { 5 5 var formIds = []; 6 $(' #bubble-container .bubble span').each(function() {6 $('.asfgf_wrap #bubble-container .bubble span').each(function() { 7 7 formIds.push($(this).text()); 8 8 }); … … 12 12 function updateHiddenKeywordInput() { 13 13 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() { 15 15 formIds.push($(this).text()); 16 16 }); … … 30 30 $('.asfgf_form_id_box').hide(); 31 31 $('.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'); 33 33 34 34 … … 36 36 $('.asfgf_form_id_box').show(); 37 37 $('.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'); 39 39 40 40 } … … 72 72 73 73 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'); 76 76 var value = input.val() 77 const bubbleContainer = $(' #bubble-container');77 const bubbleContainer = $('.asfgf_wrap #bubble-container'); 78 78 if(bubbleContainer.children('.bubble').length < 1) { 79 79 if (value) { 80 $(' #bubble-container').append(80 $('.asfgf_wrap #bubble-container').append( 81 81 '<div class="bubble"><span>' + value + '</span><button class="remove-button remove-bubble-button">×</button></div>' 82 82 ); … … 85 85 } 86 86 }else{ 87 console.log("ehklo")88 87 $(".asfgf_form_id_box #error-message").show() 89 88 } … … 91 90 92 91 // 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() { 94 93 $(this).parent('.bubble').remove(); 95 94 $(".asfgf_form_id_box #error-message").hide() … … 98 97 99 98 100 $(' #add-button-keywords').on('click', function() {99 $('.asfgf_wrap #add-button-keywords').on('click', function() { 101 100 var input = $('#keyword-text-id'); 102 101 var value = input.val() 103 const bubbleContainer = $(' #bubble-container-remove-button-filter_keywords');102 const bubbleContainer = $('.asfgf_wrap #bubble-container-remove-button-filter_keywords'); 104 103 if(bubbleContainer.children('.bubble').length < 3) { 105 104 if (value) { 106 $(' #bubble-container-remove-button-filter_keywords').append(105 $('.asfgf_wrap #bubble-container-remove-button-filter_keywords').append( 107 106 '<div class="bubble"><span>' + value + '</span><button class="remove-button-filter_keywords remove-bubble-button">×</button></div>' 108 107 ); … … 116 115 117 116 // 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() { 119 118 $(this).parent('.bubble').remove(); 120 119 $("#asfgf_keywords_container #error-message").hide() -
anti-spam-filter-gravity-forms/trunk/readme.txt
r3208720 r3226740 3 3 Tags: gravity forms, anti-spam, spam filter, form protection, keyword filtering 4 4 Requires at least: 6.5 5 Tested up to: 6.7 6 Stable tag: 1.0. 05 Tested up to: 6.7.1 6 Stable tag: 1.0.1 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 52 52 Yes, the plugin automatically detects and filters out form submissions containing Cyrillic characters, which are often used in spam messages. 53 53 54 == Changelog == 55 = 1.0.1 = 56 * Compatible with the Pro edition. 54 57 55 58 == Changelog ==
Note: See TracChangeset
for help on using the changeset viewer.