Changeset 3226931
- Timestamp:
- 01/22/2025 03:14:12 PM (12 months ago)
- Location:
- gf-tools
- Files:
-
- 55 added
- 6 edited
-
tags/1.0.4.3 (added)
-
tags/1.0.4.3/gf-tools.php (added)
-
tags/1.0.4.3/img (added)
-
tags/1.0.4.3/img/tools-icon.svg (added)
-
tags/1.0.4.3/includes (added)
-
tags/1.0.4.3/includes/_class-TEMPLATE.php (added)
-
tags/1.0.4.3/includes/class-confirmations.php (added)
-
tags/1.0.4.3/includes/class-customize-gf.php (added)
-
tags/1.0.4.3/includes/class-dashboard.php (added)
-
tags/1.0.4.3/includes/class-developers.php (added)
-
tags/1.0.4.3/includes/class-entries.php (added)
-
tags/1.0.4.3/includes/class-form-display.php (added)
-
tags/1.0.4.3/includes/class-form-editor.php (added)
-
tags/1.0.4.3/includes/class-forms-table.php (added)
-
tags/1.0.4.3/includes/class-gf-tools.php (added)
-
tags/1.0.4.3/includes/class-helpers.php (added)
-
tags/1.0.4.3/includes/class-import-export.php (added)
-
tags/1.0.4.3/includes/class-mark-resolved.php (added)
-
tags/1.0.4.3/includes/class-merge-tags.php (added)
-
tags/1.0.4.3/includes/class-notifications.php (added)
-
tags/1.0.4.3/includes/class-populate-fields.php (added)
-
tags/1.0.4.3/includes/class-reports.php (added)
-
tags/1.0.4.3/includes/class-shortcodes.php (added)
-
tags/1.0.4.3/includes/class-spam.php (added)
-
tags/1.0.4.3/includes/class-wp-list-table.php (added)
-
tags/1.0.4.3/includes/css (added)
-
tags/1.0.4.3/includes/css/dashboard.css (added)
-
tags/1.0.4.3/includes/css/debugging.css (added)
-
tags/1.0.4.3/includes/css/form-display.css (added)
-
tags/1.0.4.3/includes/css/form-editor.css (added)
-
tags/1.0.4.3/includes/css/import-export.css (added)
-
tags/1.0.4.3/includes/css/mark-resolved.css (added)
-
tags/1.0.4.3/includes/css/reports-back.css (added)
-
tags/1.0.4.3/includes/css/reports.css (added)
-
tags/1.0.4.3/includes/css/settings.css (added)
-
tags/1.0.4.3/includes/css/shortcode-generator.css (added)
-
tags/1.0.4.3/includes/css/shortcodes.css (added)
-
tags/1.0.4.3/includes/img (added)
-
tags/1.0.4.3/includes/img/discord.png (added)
-
tags/1.0.4.3/includes/img/import_spam_list.png (added)
-
tags/1.0.4.3/includes/img/pre-populate-fields.png (added)
-
tags/1.0.4.3/includes/img/tooltip.png (added)
-
tags/1.0.4.3/includes/js (added)
-
tags/1.0.4.3/includes/js/dashboard.js (added)
-
tags/1.0.4.3/includes/js/debugging.js (added)
-
tags/1.0.4.3/includes/js/form-editor.js (added)
-
tags/1.0.4.3/includes/js/forms-table.js (added)
-
tags/1.0.4.3/includes/js/mark-resolved.js (added)
-
tags/1.0.4.3/includes/js/remove-qs.js (added)
-
tags/1.0.4.3/includes/js/reports-back.js (added)
-
tags/1.0.4.3/includes/js/settings.js (added)
-
tags/1.0.4.3/includes/js/shortcode-generator.js (added)
-
tags/1.0.4.3/includes/js/shortcodes.js (added)
-
tags/1.0.4.3/index.php (added)
-
tags/1.0.4.3/readme.txt (added)
-
trunk/gf-tools.php (modified) (2 diffs)
-
trunk/includes/class-dashboard.php (modified) (11 diffs)
-
trunk/includes/class-gf-tools.php (modified) (4 diffs)
-
trunk/includes/class-spam.php (modified) (5 diffs)
-
trunk/includes/js/dashboard.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gf-tools/trunk/gf-tools.php
r3218525 r3226931 4 4 * Plugin URI: https://apos37.com/wordpress-advanced-tools-for-gravity-forms/ 5 5 * Description: Unlock advanced tools to supercharge your Gravity Forms experience with enhanced features and streamlined management. 6 * Version: 1.0.4. 26 * Version: 1.0.4.3 7 7 * Requires at least: 5.9.0 8 8 * Tested up to: 6.7.1 … … 26 26 define( 'GFADVTOOLS_TEXTDOMAIN', 'gf-tools' ); 27 27 define( 'GFADVTOOLS_DISCORD_SUPPORT_URL', 'https://discord.gg/3HnzNEJVnR' ); 28 define( 'GFADVTOOLS_VERSION', '1.0.4. 2' );28 define( 'GFADVTOOLS_VERSION', '1.0.4.3' ); 29 29 define( 'GFADVTOOLS_ADMIN_INCLUDES_URL', trailingslashit( ABSPATH.str_replace( site_url(), '', admin_url( 'includes/' ) ) ) ); // /abspath/.../public_html/wp-admin/includes/ 30 30 define( 'GFADVTOOLS_PLUGIN_ROOT', plugin_dir_path( __FILE__ ) ); // /home/.../public_html/wp-content/plugins/gf-tools/ -
gf-tools/trunk/includes/class-dashboard.php
r3217938 r3226931 630 630 'form_id' => __( 'Form ID', 'gf-tools' ), 631 631 'count' => __( 'Number of Entries', 'gf-tools' ), 632 'source' => __( 'Source Page', 'gf-tools' )632 // 'source' => __( 'Source Page', 'gf-tools' ) 633 633 ]; 634 634 … … 665 665 666 666 // TODO: Get the source link if a page is associated with it 667 $source_link = '';667 // $source_link = ''; 668 668 669 669 // The data … … 673 673 'form_id' => $form_id, 674 674 'count' => $count, 675 'source' => $source_link675 // 'source' => $source_link 676 676 ]; 677 677 } … … 893 893 'form_id' => __( 'Form ID', 'gf-tools' ), 894 894 'count' => __( 'Number of Spam Entries', 'gf-tools' ), 895 'source' => __( 'Source Page', 'gf-tools' ),895 // 'source' => __( 'Source Page', 'gf-tools' ), 896 896 'actions' => __( 'Actions', 'gf-tools' ) 897 897 ]; … … 951 951 952 952 // TODO: Get the source link if a page is associated with it 953 $source_link = '';953 // $source_link = ''; 954 954 955 955 // Actions … … 974 974 'form_id' => $form_id, 975 975 'count' => $count, 976 'source' => $source_link,976 // 'source' => $source_link, 977 977 'actions' => $actions 978 978 ]; … … 993 993 $is_client = ( $location == 'client' ); 994 994 $host_site_url = ( $is_client && isset( $this->plugin_settings[ 'spam_list_url' ] ) ) ? sanitize_text_field( $this->plugin_settings[ 'spam_list_url' ] ) : false; 995 $api_spam_key = ( $is_client && isset( $this->plugin_settings[ 'api_spam_key' ] ) ) ? sanitize_text_field( $this->plugin_settings[ 'api_spam_key' ] ) : false; 995 996 $home_url = home_url(); 996 997 $spam_list_created = get_option( 'gfat_spam_list_table_created' ); 998 999 if ( $is_client && ( !$host_site_url || !$api_spam_key ) ) { 1000 echo '<em>This site is set up as a Client, but we are missing an API or home site URL. Please enter them in the Plugin Settings.</em>'; 1001 return; 1002 } 997 1003 998 1004 // Helpers … … 1016 1022 // Nonce 1017 1023 $nonce = wp_create_nonce( $this->nonce ); 1018 $nonce_verified = isset( $_REQUEST[ '_wpnonce' ] ) && wp_verify_nonce( sanitize_text_field( wp_unslash ( $_REQUEST[ '_wpnonce' ] ) ), $this->nonce );1024 $nonce_verified = isset( $_REQUEST[ '_wpnonce' ] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST[ '_wpnonce' ] ) ), $this->nonce ); 1019 1025 1020 1026 // Local … … 1294 1300 </div> 1295 1301 <input type="submit" value="<?php echo esc_html__( 'Submit', 'gf-tools' ); ?>" id="gfat-<?php echo esc_attr( $current_tab ); ?>-search-button" class="button button-primary"/> 1296 <a class="import-export-link" href="<?php echo esc_url( add_query_arg( [ 'page' => 'gf_export', 'subview' => 'import_spam_list' ], admin_url( 'admin.php' ) ) ); ?>">Import</a> 1302 <?php if ( !$is_client ) { ?> 1303 <a class="import-export-link" href="<?php echo esc_url( add_query_arg( [ 'page' => 'gf_export', 'subview' => 'import_spam_list' ], admin_url( 'admin.php' ) ) ); ?>">Import</a> 1304 <?php } ?> 1297 1305 </form> 1298 1306 </div> … … 2750 2758 public function ajax_get_all_spam_entry_ids() { 2751 2759 // Verify nonce 2752 if ( !isset( $_REQUEST[ ' _wpnonce' ] ) || !wp_verify_nonce( sanitize_text_field( wp_unslash ( $_REQUEST[ '_wpnonce' ] ) ), $this->nonce ) ) {2760 if ( !isset( $_REQUEST[ 'nonce' ] ) || !wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST[ 'nonce' ] ) ), $this->nonce ) ) { 2753 2761 exit( esc_html__( 'No naughty business please.', 'gf-tools' ) ); 2754 2762 } … … 2796 2804 public function ajax_delete_spam_entry() { 2797 2805 // Verify nonce 2798 if ( !isset( $_REQUEST[ ' _wpnonce' ] ) || !wp_verify_nonce( sanitize_text_field( wp_unslash ( $_REQUEST[ '_wpnonce' ] ) ), $this->nonce ) ) {2806 if ( !isset( $_REQUEST[ 'nonce' ] ) || !wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST[ 'nonce' ] ) ), $this->nonce ) ) { 2799 2807 exit( esc_html__( 'No naughty business please.', 'gf-tools' ) ); 2800 2808 } -
gf-tools/trunk/includes/class-gf-tools.php
r3208804 r3226931 525 525 'name' => 'ajax_saving_group', 526 526 'label' => esc_html__( 'Disable AJAX Saving for All Forms', 'gf-tools' ), 527 'tooltip' => esc_html__( 'Th e template library is the popup that you see when you create a new form. If you always start from scratch, this just saves you a step.', 'gf-tools' ),527 'tooltip' => esc_html__( 'This will disable saving the form in the form editor without having to refresh. Sometimes the AJAX will cause conflicts, so this just saves the form on refresh.', 'gf-tools' ), 528 528 'choices' => [ 529 529 [ … … 676 676 'name' => 'api_spam_key', 677 677 'label' => esc_html__( 'API Key for Remote Spam List Access', 'gf-tools' ), 678 'tooltip' => esc_html__( 'On your host website, choose "Host" in the "Enable Enhanced Spam Filtering" setting above. Then generate an API Key underneath it. Copy this key and enter ithere.', 'gf-tools' ),678 'tooltip' => esc_html__( 'On your client website(s), choose "Client" in the "Enable Enhanced Spam Filtering" setting above. Copy this key and enter it there.', 'gf-tools' ), 679 679 'class' => 'large', 680 680 ], … … 695 695 ], 696 696 $incl_delete_spam_list_button, 697 [ 698 'type' => 'checkbox', 699 'name' => 'disable_word_boundaries_group', 700 'label' => esc_html__( 'Disable Word Boundaries in Spam Filtering', 'gf-tools' ), 701 'tooltip' => esc_html__( 'By default, only whole words are matched. For example, the keyword "Pekly" will match "Pekly" but not "HarryPekly." Disabling word boundaries allows matching keywords anywhere, even within other words.', 'gf-tools' ), 702 'choices' => [ 703 [ 704 'label' => esc_html__( 'Yes', 'gf-tools' ), 705 'name' => 'disable_word_boundaries', 706 ], 707 ], 708 ], 697 709 [ 698 710 'type' => 'checkbox', … … 737 749 'type' => 'checkbox', 738 750 'name' => 'entries_export_roles_group', 739 'label' => wp_kses( __( 'Which Add tional Roles (Besides Administrator) Can Export Entries on <code>[gfat_export_entries]</code> Shortcode', 'gf-tools' ), [ 'code' => [] ] ),751 'label' => wp_kses( __( 'Which Additional Roles (Besides Administrator) Can Export Entries on <code>[gfat_export_entries]</code> Shortcode', 'gf-tools' ), [ 'code' => [] ] ), 740 752 'tooltip' => esc_html__( 'The [gfat_export_entries] shortcode can be used to export entries on the front-end. You must also enable "Add to Export Entries Shortcode" in the forms\' Advanced Tools settings.', 'gf-tools' ), 741 753 'choices' => $role_choices, -
gf-tools/trunk/includes/class-spam.php
r3166646 r3226931 1341 1341 1342 1342 // If the field is of type email, text, or textarea 1343 if ( in_array( $field->type, [ ' email', 'text', 'textarea' ] ) ) {1343 if ( in_array( $field->type, [ 'name', 'email', 'text', 'textarea' ] ) ) { 1344 1344 1345 1345 // $field_id = $field->id; … … 1374 1374 1375 1375 } else { 1376 1377 // Are we disabling word boundaries? 1378 $disable_word_boundaries = isset( $plugin_settings[ 'disable_word_boundaries' ] ) && $plugin_settings[ 'disable_word_boundaries' ] == 1; 1376 1379 1377 1380 // Check text and textarea fields 1378 1381 foreach ( $keyword_actions as $keyword => $allowed ) { 1379 if ( preg_match( '/\b' . preg_quote( $keyword, '/' ) . '\b/i', $value ) && !$allowed ) { 1380 $result[ 'is_valid' ] = false; 1381 $result[ 'message' ] = "Keyword '{$keyword}' is not allowed."; 1382 $pattern = $disable_word_boundaries 1383 ? '/' . preg_quote( $keyword, '/' ) . '/i' 1384 : '/\b' . preg_quote( $keyword, '/' ) . '\b/i'; 1385 1386 if ( preg_match( $pattern, $value ) && !$allowed ) { 1387 $result['is_valid'] = false; 1388 $result['message'] = "Keyword '{$keyword}' is not allowed."; 1382 1389 return $result; 1383 1390 } … … 1482 1489 } 1483 1490 1491 // Are we disabling word boundaries? 1492 $disable_word_boundaries = isset( $plugin_settings[ 'disable_word_boundaries' ] ) && $plugin_settings[ 'disable_word_boundaries' ] == 1; 1493 1484 1494 // Initialize spam status flags 1485 1495 $is_spam = false; … … 1488 1498 1489 1499 // Process each field 1490 $field_types_to_filter = [ ' email', 'text', 'textarea' ];1500 $field_types_to_filter = [ 'name', 'email', 'text', 'textarea' ]; 1491 1501 foreach ( $form[ 'fields' ] as $field ) { 1492 1502 … … 1531 1541 // Check text and textarea fields 1532 1542 foreach ( $keyword_actions as $keyword => $allowed ) { 1533 if ( preg_match( '/\b' . preg_quote( $keyword, '/' ) . '\b/i', $value ) ) { 1543 $pattern = $disable_word_boundaries 1544 ? '/' . preg_quote( $keyword, '/' ) . '/i' 1545 : '/\b' . preg_quote( $keyword, '/' ) . '\b/i'; 1546 1547 if ( preg_match( $pattern, $value ) ) { 1534 1548 $is_spam = !$allowed; 1535 1549 $log_message = "Keyword '$keyword' found in $type field with action '" . ( $allowed ? 'allow' : 'deny' ) . "'."; -
gf-tools/trunk/includes/js/dashboard.js
r3166646 r3226931 179 179 180 180 // Delete all entries 181 const deleteAllEntries = async ( ) => {181 const deleteAllEntries = async ( nonce, formID ) => { 182 182 try { 183 183 // Get the entry IDs to delete … … 261 261 262 262 // Do it 263 deleteAllEntries( );263 deleteAllEntries( nonce, formID ); 264 264 } ); 265 265 -
gf-tools/trunk/readme.txt
r3218525 r3226931 5 5 Requires PHP: 7.4 6 6 Tested up to: 6.7.1 7 Stable tag: 1.0.4. 27 Stable tag: 1.0.4.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 106 106 107 107 == Changelog == 108 = 1.0.4.3 = 109 * Update: Added plugin option to disable word boundaries in spam filtering 110 * Tweak: Update info box on some plugin settings 111 * Fix: Remove import link from spam list on client sites 112 * Fix: Spam list showing for Client sites even though API and host site URL are missing 113 * Tweak: Removed unused source columns 114 * Fix: Delete All Spam button from Spam Entries section had a nonce error 115 108 116 = 1.0.4.2 = 109 117 * Fix: User meta on report builder wasn't showing up correctly in the report
Note: See TracChangeset
for help on using the changeset viewer.