> Forms wordpress plugin resources analysis

Forms wordpress plugin resources analysis

Download This Plugin
Download Elegant Themes
Name Forms
Version 0.4 (beta11)
Author Weston Ruter
Rating 0
Last updated 2010-04-01 11:17:00
Downloads
9238
Download Plugins Speed Test plugin for Wordpress
90Score

Home page

Delta: 0%
89Score

Post page

Delta: 0%
Forms plugin has no negative impact on PageSpeed score.

Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%

Forms plugin added 0 bytes of resources to the Home page and 7 bytes of resources to the sample Post page.

Forms plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.

Great! Forms plugin ads no tables to your Wordpress blog database.

This plugin is developed at Shepherd Interactive for the benefit of the community. No support is available. Please post any questions to the support forum.

Allows forms to be written with new HTML5 input type and validation attributes, and then to have them validate themselves server-side: DRY forms (don't repeat yourself). Forms are embedded into posts via the form shortcode. Results can be automatically emailed. A web form is defined in a PHP function that returns an entire form element, for example:

function my_contact_form($attrs, $content = null){
    ob_start();
    ?>
    <form method="post">
        <p hidden="hidden" class="form_error_message"></p>
        <p>Name: <input type="text" required="required" name="contact_name" maxlength="255" placeholder="Jo Smith" autofocus="autofocus" /></p>
        <p>Email: <input type="email" required="required" name="contact_email" maxlength="255" placeholder="jsmith@example.com" /></p>
        <p>Message: <textarea required="required" name="contact_message" maxlength="1000" placeholder="Enter your message here"></textarea></p>
        <p><button type="submit">Submit</button></p>
    </form>
    <?php
    $ret = ob_get_contents();
    ob_end_clean();
    return $ret;
}

And this form can be embedded into a post by entering [form name="my_contact_form"]. Here are the shortcode options:

  • name
  • email_to
  • email_cc
  • email_bcc
  • email_subject
  • success_url
  • success_page_id
  • cc_sender default: false
  • email_type default: (HTML) table: other options dl, text, form

These options may also be specified via Custom Fields (postmeta):

  • form_name
  • form_email_to
  • form_email_cc
  • form_email_bcc
  • form_email_subject
  • form_success_page_id
  • form_success_url
  • form_email_type

Many filters and actions are available. Please see the source code.

When the form is submitted and the server determines that user data is invalid, then the server will respond with 400 Invalid Request. In the 400 response, the page containing the form is returned and the form repopulated with the user's original request with class names and data- attributes that describe the errors on an invalid element.

If the server successfully validates the form, then the user will be redirected to success_url or success_page_id if they are provided.

Please see source code for full documentation.

Handling File Inputs

Files are uploaded to /wp-content/uploads/ (or whatever this is specified to be in your install), unless filtered to be something different via form_file_upload_path filter, or if the data-upload-path attribute is set on the file input element, for example:

<input type="file" data-upload-path="<?php
        $uploadDir = wp_upload_dir();
        echo esc_attr(parse_url(trailingslashit($uploadDir['baseurl']) . 'form-submissions/', PHP_URL_PATH));
?>" name="my_image" pattern=".+\.(jpe?g|gif|png)" />

The upload path is appended to the ABSPATH, and it must be within the /wp-content/uploads/ directory (or equivalent) or a security exception will be raised. When the server fails to move the file or if it is too big or if some other error occurs (e.g. directory not writable), then the form submission will respond with a 500 error and the file control will be marked as invalid customError and the specific error will be included on the data-validationMessage attribute.

Resources added by plugin to Home page/Post page in kB
Created with Raphaël 2.1.00 kB0.25 kB0.5 kB0.75 kB1 kBOtherJavaScriptImagesCSSHTML
Other
Home Page: 0 kB
Post Page: 0 kB
Total size of resources for Home page/Post page in kB
Created with Raphaël 2.1.00 kB125 kB250 kB375 kB500 kBOtherJavaScriptImagesCSSHTML
Other
Home Page: 365 kB
Post Page: 440 kB
Random Theme Tests
D5 Design screenshot

D5 Design

by: d5creation

86404
100%
Pratt screenshot

Pratt

by: timnicholson

9015
80%