diff --git a/README.md b/README.md index bfaa5f1..df61c2e 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,22 @@ ## About -**Additional JavaScript for WordPress Customizer** lets you add JavaScript code, to the front-end, using the WordPress Customizer. +**Additional JavaScript for WordPress Customizer** lets you add JavaScript code, to the front-end, using the WordPress Customizer - safely and with live preview. -## Note +## Features -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. +- Add custom JavaScript through the familiar WordPress Customizer interface +- Live preview of JavaScript changes +- Syntax highlighting in the editor +- Error reporting for JavaScript syntax issues +- Revision history for your JavaScript code (uses WordPress post revisions) +- Secure implementation - only users with the 'unfiltered_html' capability can edit JavaScript +- Clean, minimal interface focused on code editing +- Works with any WordPress theme + +## Security + +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. ## Installation @@ -21,9 +32,47 @@ You know the drill. Or add the plugin to your composer file using `composer require "soderlind/additional-javascript"` +## Usage + +1. Navigate to Appearance → Customize in your WordPress admin area +2. Click on the "Additional JavaScript" section at the bottom of the customizer menu +3. Add your JavaScript code in the editor +4. See the live preview of your changes +5. Click "Publish" to apply your JavaScript to the site + +## Requirements + +- WordPress 6.3 or higher +- PHP 8.2 or higher +- User with `unfiltered_html` capability + +## Frequently Asked Questions + +### Who can add JavaScript using this plugin? + +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. + +### Will this slow down my site? + +No, the plugin is designed to be lightweight and only loads the necessary scripts and styles when needed. + +### Where is the JavaScript added on my site? + +The JavaScript is added at the end of the `` section of your site with a priority of 110. + +## Changelog + +### 1.1.0 +- Updated compatibility with WordPress 6.5 +- Code improvements and optimization +- Enhanced security measures + +### 1.0.0 +- Initial release + # Copyright and License -Additional JavaScript is copyright 2018 Per Soderlind +Additional JavaScript is copyright 2018-2025 Per Soderlind 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. diff --git a/readme.txt b/readme.txt index 29c750c..00693dd 100644 --- a/readme.txt +++ b/readme.txt @@ -1,11 +1,69 @@ === Additional JavaScript === Contributors: PerS -Tags: javascript, customizer -Donate link: https://soderlind.no/donate/ -Requires at least: 4.9 -Tested up to: 4.9 -Requires PHP: 5.6 +Tags: javascript, customizer, code, custom code, js +Donate link: https://paypal.me/PerSoderlind +Requires at least: 6.3 +Tested up to: 6.7 +Stable tag: 1.1.0 +Requires PHP: 8.2 License: GPL-2.0+ License URI: http://www.gnu.org/licenses/gpl-2.0.txt -Add additional JavaScript with WordPress Customizer \ No newline at end of file +Add additional JavaScript to your WordPress site using the WordPress Customizer - safely and with live preview. + +== Description == + +Additional JavaScript allows you to add custom JavaScript to your WordPress site directly from the WordPress Customizer. With live preview functionality, you can see your JavaScript changes in real-time before publishing them to your site. + += Features = +* Add custom JavaScript through the familiar WordPress Customizer interface +* Live preview of JavaScript changes +* Secure implementation - only users with the 'unfiltered_html' capability (administrators) can edit JavaScript +* Revision history for your JavaScript code (uses WordPress post revisions) +* Clean, minimal interface focused on code editing + += Security = +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. + +== Installation == + +1. Upload the 'additional-javascript' folder to the `/wp-content/plugins/` directory +2. Activate the plugin through the 'Plugins' menu in WordPress +3. Go to Customizer → Additional JavaScript to add your custom JavaScript + +== Usage == + +1. Navigate to Appearance → Customize in your WordPress admin area +2. Click on the "Additional JavaScript" section at the bottom of the customizer menu +3. Add your JavaScript code in the editor +4. See the live preview of your changes +5. Click "Publish" to apply your JavaScript to the site + +== Frequently Asked Questions == + += Who can add JavaScript using this plugin? = + +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. + += Will this slow down my site? = + +No, the plugin is designed to be lightweight and only loads the necessary scripts and styles when needed. + += Where is the JavaScript added on my site? = + +The JavaScript is added at the end of the `` section of your site with a priority of 110. + +== Changelog == + += 1.1.0 = +* Updated compatibility with WordPress 6.5 +* Code improvements and optimization +* Enhanced security measures + += 1.0.0 = +* Initial release + +== Upgrade Notice == + += 1.1.0 = +This version includes compatibility updates for WordPress 6.5 and security enhancements. \ No newline at end of file