Plugin Directory

Changeset 3450209


Ignore:
Timestamp:
01/30/2026 08:13:02 AM (3 weeks ago)
Author:
glenwpcoder
Message:

Version 1.3.9.4 Released.

Location:
drag-and-drop-multiple-file-upload-contact-form-7
Files:
33 added
5 edited

Legend:

Unmodified
Added
Removed
  • drag-and-drop-multiple-file-upload-contact-form-7/trunk/admin/form-generator-v2.php

    r3391555 r3450209  
    3434        // Fieldname
    3535        $tgg->print( 'field_name' );
     36
     37        $server_limit = wp_max_upload_size();
     38        $threshold    = 50 * 1024 * 1024; // 100 MB in bytes
    3639    ?>
    3740
     
    5457                );
    5558            ?>
     59
     60            <!-- Only show if max upload size is less than 100 MB -->
     61            <?php if ( $server_limit < $threshold ) : ?>
     62                <br>
     63                <span>Your server max upload size: <strong><?php echo size_format( $server_limit ); ?></strong>,
     64                🔥 <a href="https://www.codedropz.com/drag-drop-multiple-file-upload-for-contact-form-7/" target="_blank">Pro</a> enables large uploads using chunked uploads.</span>
     65            <?php endif; ?>
    5666        </label>
    5767    </fieldset>
  • drag-and-drop-multiple-file-upload-contact-form-7/trunk/assets/js/dev/native-dev.js

    r3391555 r3450209  
    245245                    var xhr = new XMLHttpRequest();
    246246
    247                     // Get progress bar element
    248                     const progressBar = document.getElementById( progressBarID );
    249                     const progressElement = progressBar.querySelector('.dnd-progress-bar');
    250                     const detailsElement = progressBar.querySelector('.dnd-upload-details');
    251                     const submitButton = form_handler.querySelector('input[type="submit"], button[type="submit"]');
     247                    // Get progress bar element [changes 2026]
     248                    let progressBar = document.getElementById( progressBarID );
     249                    let progressElement = progressBar.querySelector('.dnd-progress-bar');
     250                    let detailsElement = progressBar.querySelector('.dnd-upload-details');
     251                    let submitButton = form_handler.querySelector('input[type="submit"], button[type="submit"]');
    252252
    253253                    xhr.open(form_handler.getAttribute('method'), options.ajax_url);
  • drag-and-drop-multiple-file-upload-contact-form-7/trunk/drag-n-drop-upload-cf7.php

    r3428236 r3450209  
    77    * Text Domain: drag-and-drop-multiple-file-upload-contact-form-7
    88    * Domain Path: /languages
    9     * Version: 1.3.9.3
     9    * Version: 1.3.9.4
    1010    * Author: Glen Don L. Mongaya
    1111    * Author URI: http://codedropz.com
     
    2222
    2323    /**  Define plugin Version */
    24     define( 'dnd_upload_cf7_version', '1.3.9.3' );
     24    define( 'dnd_upload_cf7_version', '1.3.9.4' );
    2525
    2626    /**  Define constant Plugin Directories  */
     
    3232    }
    3333
     34    // Activation setup cron.
     35    register_activation_hook( __FILE__, function () {
     36        if ( ! wp_next_scheduled( 'dnd_cf7_daily_event' ) ) {
     37            wp_schedule_event( time(), 'hourly', 'dnd_cf7_daily_event' );
     38        }
     39    });
     40
     41    // Deactivate clear cron.
     42    register_deactivation_hook( __FILE__, function () {
     43        wp_clear_scheduled_hook( 'dnd_cf7_daily_event' );
     44    });
     45
    3446    // require plugin core file
    3547    require_once( dnd_upload_cf7_directory .'/inc/dnd-upload-cf7.php' );
  • drag-and-drop-multiple-file-upload-contact-form-7/trunk/inc/dnd-upload-cf7.php

    r3428236 r3450209  
    1717    add_action( 'wpcf7_init', 'dnd_cf7_upload_add_form_tag_file' );
    1818    add_action( 'wpcf7_enqueue_scripts', 'dnd_cf7_scripts' );
     19    add_action( 'wpcf7_enqueue_scripts', 'dnd_cf7_cookie_scripts', 50 );
    1920
    2021    // Hook on plugins loaded
     
    3839    add_action('wpcf7_mail_components','dnd_cf7_mail_components', 50, 2);
    3940
    40     // Auto clean up dir/files
    41     add_action('shutdown', 'dnd_cf7_auto_clean_dir', 20, 1 );
     41    // Auto clean up dir/files - cron schedule.
     42    add_action('dnd_cf7_daily_event', 'dnd_cf7_auto_clean_dir');
    4243
    4344    // Add row meta links
     
    5859    // Flamingo Hooks
    5960    add_action('before_delete_post', 'dnd_remove_uploaded_files');
    60 
    61     // Generate uqique id/random
    62     add_action( 'wp_footer', 'dnd_cf7_generate_cookie' );
    6361
    6462    // Nonce
     
    206204                    if ( is_array( $posted_data ) ) {
    207205                        foreach( $posted_data[$field_name] as $key => $file ) {
    208                             if ( $send_link || strpos( dirname($file), 'wpcf7-files' ) !== false ) {
    209                                 //$file = wp_basename( $file ); // remove duplicate path "/12/file.jpg" to just "/file.jpg"
     206                            if ( strpos( dirname($file), 'wpcf7-files' ) !== false ) {
     207                                $file = wp_basename( $file ); // remove duplicate path "/12/file.jpg" to just "/file.jpg"
    210208                            }
    211209                            $posted_data[$field_name][$key] = trailingslashit( $uploads_dir['upload_url'] ) . $file;
     
    294292    // Clean up directory - From Contact Form 7
    295293    function dnd_cf7_auto_clean_dir( $dir_path = null ) {
    296         if ( is_admin() ) {
    297             return;
    298         }
    299294
    300295        // Disable auto delete
     
    485480                                    // Check if submitted and file exists then file is ready.
    486481                                    if ( $submission && file_exists( $new_file_name )  ) {
    487                                         $components['attachments'][] = $new_file_name;
     482                                        $f['attachments'][] = $new_file_name;
    488483                                    }
    489484                                }
     
    591586    }
    592587
     588    // Add inline js for cookie script.
     589    function dnd_cf7_cookie_scripts() {
     590        wp_add_inline_script( 'codedropz-uploader',
     591            "
     592            function dnd_cf7_generateUUIDv4() {
     593                const bytes = new Uint8Array(16);
     594                crypto.getRandomValues(bytes);
     595                bytes[6] = (bytes[6] & 0x0f) | 0x40; // version 4
     596                bytes[8] = (bytes[8] & 0x3f) | 0x80; // variant 10
     597                const hex = Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('');
     598                return hex.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '$1-$2-$3-$4-$5');
     599            }
     600
     601            document.addEventListener('DOMContentLoaded', function() {
     602                if ( ! document.cookie.includes('wpcf7_guest_user_id')) {
     603                    document.cookie = 'wpcf7_guest_user_id=' + dnd_cf7_generateUUIDv4() + '; path=/; max-age=' + (12 * 3600) + '; samesite=Lax';
     604                }
     605            });
     606            "
     607        );
     608    }
     609
    593610    // Generate tag
    594611    function dnd_cf7_upload_add_form_tag_file() {
     
    11711188                    esc_html__( '🔥 %1$sUpgrade Now%2$s for Extra Features: Explore the %3$sPro Version%4$s Today!', 'drag-and-drop-multiple-file-upload-contact-form-7' ),
    11721189                    '<span style="color:#038d03;">','</span>',
    1173                     '<a href="https://codedropz.com/purchase-plugin/" target="_blank">','</a>',
     1190                    '<a href="https://www.codedropz.com/drag-drop-multiple-file-upload-for-contact-form-7/" target="_blank">','</a>',
    11741191                    );
    11751192                echo ' | ';
     
    13651382    function dnd_custom_plugin_row_meta( $links, $file ) {
    13661383        if ( strpos( $file, 'drag-n-drop-upload-cf7.php' ) !== false ) {
    1367             $new_links = array('pro-version' => '<a href="https://codedropz.com/purchase-plugin/" target="_blank" style="font-weight:bold; color:#f4a647;">Pro Version</a>');
     1384            $new_links = array('pro-version' => '<a href="https://www.codedropz.com/drag-drop-multiple-file-upload-for-contact-form-7/" target="_blank" style="font-weight:bold; color:#f4a647;">Pro Version</a>');
    13681385            $links = array_merge( $links, $new_links );
    13691386        }
     
    14071424
    14081425        return $default_value;
     1426    }
     1427
     1428    function dnd_cf7_max_upload() {
     1429        $max    = wp_max_upload_size();
     1430        $max_mb = $max / 1024 / 1024;
     1431
     1432        if ( $max_mb > 1024 ) {
     1433            return round( $max_mb / 1024, 2 ) . ' GB';
     1434        }
     1435
     1436        return round( $max_mb, 2 ) . ' MB';
    14091437    }
    14101438
  • drag-and-drop-multiple-file-upload-contact-form-7/trunk/readme.txt

    r3428236 r3450209  
    55Requires at least: 3.0.1
    66Tested up to: 6.9
    7 Stable tag: 1.3.9.3
     7Stable tag: 1.3.9.4
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
     
    4848### ⭐ Premium Features ⭐
    4949
    50 Check out the available features in the **PRO version**.
     50Check out the available features in the [**PRO version**](https://www.codedropz.com/drag-drop-multiple-file-upload-for-contact-form-7/#shop).
    5151
    52521. **Upload Large File** - Supports uploading large files.
     
    8686* Advanced Contact form 7 DB – Vsourz Digital
    8787
    88 You can get [PRO Version here](https://www.codedropz.com/purchase-plugin/)!
     88You can get [PRO Version here](https://www.codedropz.com/drag-drop-multiple-file-upload-for-contact-form-7/#shop)!
    8989
    9090**PRO VERSION - PLUGIN OVERVIEW**
     
    183183== Changelog ==
    184184
     185= 1.3.9.4 =
     186- Fixes: Change shutdown hook to cron events in order to fix this issue. [Support Link](https://wordpress.org/support/topic/commands-out-of-sync-mysql-error-during-shutdown-hook-v1-3-9-3-2/)
     187- Fixes: Move the js cookie generation from wp_footer hook to wp_add_inline_script. [Support Link](https://wordpress.org/support/topic/enqueueing-of-javascript-is-not-complaint-csp-conflict/)
     188- Improvement: Minor fixes and improvement.
     189
    185190= 1.3.9.3 =
    186191- Security: Fixed vulnerability issues reported by WordFence (reported by shark3y) - unauthorized modification of data due to a missing ownership check in the dnd_codedropz_upload_delete() function.
     
    263268= 1.2.4 =
    264269Added new features and fixes.
    265 
    266 == Donations ==
    267 
    268 Would you like to support the advancement of this plugin? [Donate](http://codedropz.com/donation)
Note: See TracChangeset for help on using the changeset viewer.