Plugin Directory

Changeset 2048422


Ignore:
Timestamp:
03/11/2019 03:54:55 PM (7 years ago)
Author:
palasthotel
Message:

readme.txt update

Location:
inline-javascript-in-head/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inline-javascript-in-head/trunk/plugin.php

    r2048245 r2048422  
    33/**
    44 * Plugin Name: Inline JavaScript in Head
    5  * Description: Removes given local enqueued script handles and places their contents into the head. Useful for small scripts with a size lower than ~500 Bytes to boost site performance. Caution: Use with care and sparingly!
    6  * Version: 1.1
     5 * Description: Boosts performance of critical short JavaScripts by placing their content directly into the HTML head.
     6 * Version: 1.1.1
    77 * Author: Palasthotel <rezeption@palasthotel.de> (Kim Meyer)
    88 * Author URI: https://palasthotel.de
  • inline-javascript-in-head/trunk/readme.txt

    r2048245 r2048422  
    22Contributors: palasthotel, greatestview
    33Donate link: https://palasthotel.de/
    4 Tags: javascript, inline, head, performance
     4Tags: javascript, scripts, enqueue, inline, head, performance, filter, hook
    55Requires at least: 4.0
    66Tested up to: 5.1
    7 Stable tag: 1.1
     7Stable tag: 1.1.1
     8Requires PHP: 5.4
    89License: GNU General Public License v3
    910License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1011
    11 Removes given local enqueued script handles and places their content into the head. Useful for small scripts with a size lower than ~500 Bytes to boost site performance. Caution: Use with care and sparingly!
     12Boosts performance of critical short JavaScripts by placing their content directly into the HTML head.
    1213
    1314== Description ==
    1415In some cases you cannot wait for a JavaScript file to load, even if it is placed early in the `<head>` section of your template. You can benefit from better performance, if you place the JavaScript code directly inside a `<script>` tag into the header. This is where this plugin comes in: It provides a filter `inline_javascript_in_head_handles`, which takes JavaScript handles, dequeues those scripts and echos their code content inline into the head section instead of linking them via a script tag.
    1516
    16 Please beware that placing lots of JavaScript code inline in the `<head>` section can be critical. First you lose caching benefits and second the general document size can increase easily. A general rule of thumb is that you should only consider JavaScript files for inline placement, which are critical and which have a file size lower than ~500 Bytes.
     17Please beware that placing lots of JavaScript code inline in the `<head>` section can be critical! First you lose caching benefits and second the document size can increase easily. A general rule of thumb is that you should only consider JavaScript files for inline placement, which are critical and which have a file size lower than ~500 Bytes.
    1718
    1819= Example =
    1920
    20 ```
     21`
    2122add_action( 'wp_enqueue_scripts', 'my_scripts' );
    2223function my_scripts() {
     
    3435    return array_merge( $handles, $scripts );
    3536}
    36 ```
     37`
    3738
    3839
     
    4546== Changelog ==
    4647
     48= 1.1.1 =
     49* readme.txt update
     50
    4751= 1.1 =
    4852* Added filter `inline_javascript_in_head_wrap_try_catch`, which can add add a try catch wrapper around the JavaScript code.
Note: See TracChangeset for help on using the changeset viewer.