PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

wheel spins for 90 sec before the form is submitted.

  1. Hi
    On this site adszoom . com we are using a form on a page that uses header and footer. The form has 4 image uploads to it and but the issue is happening with or without the photos. Its taking 90 seconds to process. Here is the code im using for the form I don’t know why its taking so long but on the avg. I get 2 support tickets saying that the wheel keeps spinning.

    Any idea?

    <?php add_action('gform_pre_render_2', 'gform_limit_submissions');
    function gform_limit_submissions($form){
        global $wpdb;
    
        $limit_message = '<strong>Oops!</strong> You may only submit a new classified ad<br /> every 5 minutes  and a total of 25 every 24 hours.<br /> You may want to read <br />(<em> Posting your ads in high competition topics ....</em> ) <br /> under (<em> Help / Edit  Ads</em> )  tab above as you wait.<br /> Your last ads keywords selection should have bin <br /> chosen with pinpoint topic accuracy after reading<br /> this. Doing this step will make you money by<br /> putting your ads on page 1# of all search engines!<br /> <strong>Note:</strong> If you post something in the <strong>wrong</strong><br /> category<br /> for example: a ( <em>house for rent</em> ) in
    ( <em>services</em>),<br /> it will be <strong>deleted</strong> without warning within reason.<br /> You may also post <strong>duplicate</strong> ads but change the <br />title and keywords each time so its rated as<br /> ( <em>new content</em> ). <br /><br /><br /><br /><br />
    <strong>Thank you</strong> for your patients as we review your last<br /> classified ad.<br /> Less then 3 minutes to go!';
        $limit_time = 300; // must be specified in seconds; 86400 seconds is equal to 24 hours
    
        /* You do not need to edit below this line */
    
        $current_user = wp_get_current_user();
        $last_submission = $wpdb->get_var($wpdb->prepare("SELECT date_created FROM {$wpdb->prefix}rg_lead WHERE created_by = %d and form_id = %d ORDER BY date_created DESC", $current_user->ID, $form['id']));
    
        if(empty($last_submission))
            return $form;
    
        $time_out = strtotime($last_submission) + $limit_time;
        $current_time = time();
    
        if($current_time > $time_out)
            return $form;
    
        $is_submit = rgpost("is_submit_{$form['id']}");
    
        if(!$is_submit) {
          add_filter('gform_get_form_filter', create_function('', "return '<div class=\"limit-message\">$limit_message</div>';") );
        }
    
        return $form;
    }
    ?>
    <?php
    add_filter('gform_validation_2', 'title_length');
    function title_length($validation_result){
    	$form = $validation_result["form"];
    
        //supposing we don't want input_1 to be longer than 100 characters.
        if(strlen($_POST['input_1']) > 100){
    
            // set the form validation to false
            $validation_result["is_valid"] = false;
    
            //finding Field with ID of 1 and marking it as failed validation
            foreach($form["fields"] as &$field){
    
                //NOTE: replace 1 with the field you would like to validate
                if($field["id"] == "1"){
                    $field["failed_validation"] = true;
                    $field["validation_message"] = "Your title is too long 100 characters Google max";
                    break;
                }
            }
    
        }
    
        //Assign modified $form object back to the validation result
        $validation_result["form"] = $form;
        return $validation_result;
    
    }
    ?>
    <?php
    add_filter('gform_validation_2', 'tags_length');
    function tags_length($validation_result){
    	$form = $validation_result["form"];
    
        //supposing we don't want input_1 to be longer than 100 characters.
        if(strlen($_POST['input_8']) > 100){
    
            // set the form validation to false
            $validation_result["is_valid"] = false;
    
            //finding Field with ID of 1 and marking it as failed validation
            foreach($form["fields"] as &$field){
    
                //NOTE: replace 1 with the field you would like to validate
                if($field["id"] == "8"){
                    $field["failed_validation"] = true;
                    $field["validation_message"] = "<strong>100 words and spaces.</strong> Please only use a handful of pinpointed keywords. You do not need many, just pick the ones that are pinpoint. For example: If your title is ( <em>Tile floor cleaning</em> ) do not used keywords like ( <em>carpet cleaning</em> ) You will <strong>confuse the search engines.</strong> Post separate ads for each service or item your offering. See ( <em>Things to know before you post</em> ) here to the right in yellow for more info.";
                    break;
                }
            }
    
        }
    
        //Assign modified $form object back to the validation result
        $validation_result["form"] = $form;
        return $validation_result;
    
    }
    ?>
    <?php
    add_filter('gform_validation_2', 'email_length');
    function email_length($validation_result){
    	$form = $validation_result["form"];
    
        //supposing we don't want input_1 to be longer than 100 characters.
        if(strlen($_POST['input_11']) > 50){
    
            // set the form validation to false
            $validation_result["is_valid"] = false;
    
            //finding Field with ID of 1 and marking it as failed validation
            foreach($form["fields"] as &$field){
    
                //NOTE: replace 1 with the field you would like to validate
                if($field["id"] == "11"){
                    $field["failed_validation"] = true;
                    $field["validation_message"] = "<strong>50 word and spaces max.</strong>.";
                    break;
                }
            }
    
        }
    
        //Assign modified $form object back to the validation result
        $validation_result["form"] = $form;
        return $validation_result;
    
    }
    ?>
    <?php
    add_filter('gform_validation_2', 'companies_length');
    function companies_length($validation_result){
    	$form = $validation_result["form"];
    
        //supposing we don't want input_1 to be longer than 100 characters.
        if(strlen($_POST['input_17']) > 50){
    
            // set the form validation to false
            $validation_result["is_valid"] = false;
    
            //finding Field with ID of 1 and marking it as failed validation
            foreach($form["fields"] as &$field){
    
                //NOTE: replace 1 with the field you would like to validate
                if($field["id"] == "17"){
                    $field["failed_validation"] = true;
                    $field["validation_message"] = "<strong>50 word and spaces max.</strong>.";
                    break;
                }
            }
    
        }
    
        //Assign modified $form object back to the validation result
        $validation_result["form"] = $form;
        return $validation_result;
    
    }
    ?>
    <?php
    add_filter('gform_validation_2', 'contact_name_length');
    function contact_name_length($validation_result){
    	$form = $validation_result["form"];
    
        //supposing we don't want input_1 to be longer than 100 characters.
        if(strlen($_POST['input_18']) > 50){
    
            // set the form validation to false
            $validation_result["is_valid"] = false;
    
            //finding Field with ID of 1 and marking it as failed validation
            foreach($form["fields"] as &$field){
    
                //NOTE: replace 1 with the field you would like to validate
                if($field["id"] == "18"){
                    $field["failed_validation"] = true;
                    $field["validation_message"] = "<strong>50 word and spaces max.</strong>.";
                    break;
                }
            }
    
        }
    
        //Assign modified $form object back to the validation result
        $validation_result["form"] = $form;
        return $validation_result;
    
    }
    ?>
    <?php
    add_filter('gform_validation_2', 'web_address_length');
    function web_address_length($validation_result){
    	$form = $validation_result["form"];
    
        //supposing we don't want input_1 to be longer than 100 characters.
        if(strlen($_POST['input_19']) > 50){
    
            // set the form validation to false
            $validation_result["is_valid"] = false;
    
            //finding Field with ID of 1 and marking it as failed validation
            foreach($form["fields"] as &$field){
    
                //NOTE: replace 1 with the field you would like to validate
                if($field["id"] == "19"){
                    $field["failed_validation"] = true;
                    $field["validation_message"] = "<strong>50 word and spaces max.</strong>.";
                    break;
                }
            }
    
        }
    
        //Assign modified $form object back to the validation result
        $validation_result["form"] = $form;
        return $validation_result;
    
    }
    ?>
    Posted 11 years ago on Thursday September 27, 2012 | Permalink
  2. Ok took all the code out with the same issue now. Restarted the plug in and disabled all others to see if there was interference with 0 luck any ideas?

    Posted 11 years ago on Monday October 1, 2012 | Permalink
  3. David Peralty

    Hi, can you check with your host to see if anything is being written in the PHP error logs or what your server cpu/memory utilization is at? Have them make sure your database isn't having issues as well. There isn't any reason I can think of beyond server issues if you've already tested potential plugin conflicts.

    Posted 11 years ago on Monday October 1, 2012 | Permalink
  4. Hi
    Thanks dave quick question if i Installed a subdomain in the public_HTML folder and copied over the site to the sub would that affect it? the new site would have its own wp-content and such maybe thats it?

    Ill check what you suggested

    Posted 11 years ago on Monday October 1, 2012 | Permalink
  5. David Peralty

    Yeah, if your WordPress database wasn't changed to understand where it really resides, then submitting might fail all together, unless it is still submitting to the "original" that wasn't in the sub domain folder. I'm not entirely sure man...

    Posted 11 years ago on Monday October 1, 2012 | Permalink
  6. Ya its just spinning and spin spin spin got the admin at HostG Looking into it they cloned the site all files then where going to point the stuff to the sub-domain so i wonder if that the issue.. Ill let you know..

    Posted 11 years ago on Monday October 1, 2012 | Permalink
  7. Ah issue was the leenk.me plug in " be aware all " thanks again dave! do you have a plug in recommendation for posts too the social networks like this one did??

    Posted 11 years ago on Monday October 1, 2012 | Permalink
  8. David Peralty

    Glad you figured it out, but sorry, I haven't kept up with what plugins exist in the marketplace currently. I hope you find something great to use.

    Posted 11 years ago on Monday October 1, 2012 | Permalink