Skip to content

Commit 1be408e

Browse files
committed
Update README.md to enhance clarity and security information
- Expanded the "About" section to emphasize safe usage and live preview features. - Added detailed "Features" section outlining capabilities of the plugin. - Included a "Security" section to clarify user restrictions based on capabilities. - Updated "Changelog" to reflect compatibility with WordPress 6.5 and improvements. - Revised copyright date to reflect the current year.
1 parent 6aec7ab commit 1be408e

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

README.md

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44

55
## About
66

7-
**Additional JavaScript for WordPress Customizer** lets you add JavaScript code, to the front-end, using the WordPress Customizer.
7+
**Additional JavaScript for WordPress Customizer** lets you add JavaScript code, to the front-end, using the WordPress Customizer - safely and with live preview.
88

9-
## Note
9+
## Features
1010

11-
You need to have the `edit_css` capability to use the plugin. `edit_css` is similar to the [unfiltered_html](https://wordpress.org/support/article/roles-and-capabilities/#unfiltered_html) capability.
11+
- Add custom JavaScript through the familiar WordPress Customizer interface
12+
- Live preview of JavaScript changes
13+
- Syntax highlighting in the editor
14+
- Error reporting for JavaScript syntax issues
15+
- Revision history for your JavaScript code (uses WordPress post revisions)
16+
- Secure implementation - only users with the 'unfiltered_html' capability can edit JavaScript
17+
- Clean, minimal interface focused on code editing
18+
- Works with any WordPress theme
19+
20+
## Security
21+
22+
This plugin restricts JavaScript editing to users with the 'unfiltered_html' capability, which by default is only granted to administrators on single site installations and super administrators on multisite installations.
1223

1324
## Installation
1425

@@ -21,9 +32,47 @@ You know the drill.
2132

2233
Or add the plugin to your composer file using `composer require "soderlind/additional-javascript"`
2334

35+
## Usage
36+
37+
1. Navigate to Appearance → Customize in your WordPress admin area
38+
2. Click on the "Additional JavaScript" section at the bottom of the customizer menu
39+
3. Add your JavaScript code in the editor
40+
4. See the live preview of your changes
41+
5. Click "Publish" to apply your JavaScript to the site
42+
43+
## Requirements
44+
45+
- WordPress 6.3 or higher
46+
- PHP 8.2 or higher
47+
- User with `unfiltered_html` capability
48+
49+
## Frequently Asked Questions
50+
51+
### Who can add JavaScript using this plugin?
52+
53+
Only users with the 'unfiltered_html' capability can add JavaScript using this plugin. By default, this is limited to administrators on single site installations and super administrators on multisite installations.
54+
55+
### Will this slow down my site?
56+
57+
No, the plugin is designed to be lightweight and only loads the necessary scripts and styles when needed.
58+
59+
### Where is the JavaScript added on my site?
60+
61+
The JavaScript is added at the end of the `<head>` section of your site with a priority of 110.
62+
63+
## Changelog
64+
65+
### 1.1.0
66+
- Updated compatibility with WordPress 6.5
67+
- Code improvements and optimization
68+
- Enhanced security measures
69+
70+
### 1.0.0
71+
- Initial release
72+
2473
# Copyright and License
2574

26-
Additional JavaScript is copyright 2018 Per Soderlind
75+
Additional JavaScript is copyright 2018-2025 Per Soderlind
2776

2877
Additional JavaScript is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
2978

0 commit comments

Comments
 (0)