You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: README.md
+53-4Lines changed: 53 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,22 @@
4
4
5
5
## About
6
6
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.
8
8
9
-
## Note
9
+
## Features
10
10
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.
12
23
13
24
## Installation
14
25
@@ -21,9 +32,47 @@ You know the drill.
21
32
22
33
Or add the plugin to your composer file using `composer require "soderlind/additional-javascript"`
23
34
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
+
24
73
# Copyright and License
25
74
26
-
Additional JavaScript is copyright 2018 Per Soderlind
75
+
Additional JavaScript is copyright 2018-2025 Per Soderlind
27
76
28
77
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.
0 commit comments