=== Custom Script Manager === Contributors: marjanmijic Tags: code, scripts, css, javascript, php, html, snippets, code-injection, custom-code, developer-tools, ace-editor, version-control Requires at least: 4.5 Tested up to: 6.7.2 Stable tag: 1.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.txt The most powerful WordPress code management plugin with professional editor, version control, and advanced targeting options. == Description == Custom Script Manager is the ultimate solution for managing custom code in WordPress. Whether you need to add JavaScript, CSS, HTML, or PHP snippets, this plugin provides a professional code editor with advanced features that make code management effortless. = Key Features = * **Professional Ace Editor** - Industry-standard code editor with syntax highlighting, auto-completion, and real-time CSS color previews * **Full Version Control** - Complete change history with one-click version restoration and rollback capabilities * **Multi-Location Targeting** - Run scripts on Frontend, Backend, Block Editor, or Login pages (select multiple contexts) * **Flexible Positioning** - Inject code in header, body, footer, or into specific elements using CSS selectors * **Page Targeting** - Run scripts on all pages, specific pages, or page ranges * **All Code Types** - Support for JavaScript, CSS, HTML, and PHP (no child theme required for PHP) * **CSS Minification** - Automatically minimize CSS code for better performance * **JavaScript Base64 Encoding** - Encode JavaScript as base64 data URIs * **Shortcode Support** - Create reusable shortcodes from your scripts * **Advanced Search** - Search through script content, not just titles * **Enterprise Security** - CSRF protection, input validation, and role-based access control = Why Choose Custom Script Manager? = * **No Child Theme Needed** - Execute PHP code directly without creating a child theme * **Version Control Built-In** - Never lose code again with complete history tracking * **Professional Editor** - Ace Editor with syntax highlighting for all supported languages * **Granular Control** - Run scripts exactly where you need them with advanced targeting * **Secure by Design** - Professional security audit completed, CSRF protection on all actions * **Developer-Friendly** - Clean interface designed for developers and power users = Use Cases = * Add custom PHP functions without a child theme * Manage tracking codes (Google Analytics, Facebook Pixel, etc.) * Inject custom CSS for styling * Add JavaScript enhancements * Create HTML widgets and embeds * Manage all site scripts in one centralized location * Version control for code changes with easy rollback == Installation == = Automatic Installation = 1. Log in to your WordPress admin panel 2. Navigate to Plugins → Add New 3. Search for "Custom Script Manager" 4. Click "Install Now" 5. Click "Activate" = Manual Installation = 1. Upload the `custom-script-manager` folder to the `/wp-content/plugins/` directory 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Navigate to CSManager in the admin menu to start adding scripts = After Installation = 1. Go to **CSManager** in your WordPress admin menu 2. Click "New Script" to create your first script 3. Select the script type (JavaScript, CSS, HTML, or PHP) 4. Choose where the script should run (Frontend, Backend, Block Editor, Login) 5. Select the position (Header, Body, Footer, or Element) 6. Write your code in the professional editor 7. Save and activate your script == Frequently Asked Questions == = Do I need a child theme to use PHP scripts? = No! Custom Script Manager allows you to execute PHP code directly without creating a child theme. This is one of the plugin's key features. = Can I run scripts on multiple locations at once? = Yes! You can select multiple contexts (Frontend, Backend, Block Editor, Login) using checkboxes. The script will run in all selected contexts. = How does version control work? = Every time you save a script, a new version is automatically saved to history. You can view all versions, compare them, and restore any previous version with one click. = Can I inject code into specific elements? = Yes! Select "Inside element..." as the position and provide a CSS selector (e.g., `#my-id` or `.my-class`). The code will be injected into all matching elements. = Is this plugin secure? = Yes. The plugin has undergone a professional security audit and includes CSRF protection, input validation, and role-based access control. Only users with administrator privileges can manage scripts. = Can I create shortcodes from my scripts? = Yes! Select "As Shortcode" as the location and provide a shortcode ID. Use `[csmanager id="your-id"]` anywhere in your content. = Does the plugin support CSS minification? = Yes! For CSS scripts, you can enable "Minimize Live CSS" to automatically minify the CSS code when it runs. = Can I encode JavaScript as base64? = Yes! For JavaScript scripts, you can enable "B64 Encode Live JavaScript" to encode the code as a base64 data URI. = How do I search for scripts? = Use the search box to search through script names and code content. You can also filter scripts by type, location, and status. = Can I reorder scripts? = Yes! Use the up/down arrows in the script list to reorder scripts. The order determines the execution sequence. == Screenshots == 1. Professional code editor with syntax highlighting 2. Script list with filtering and search 3. Version control history interface 4. Context and position selection options 5. Element selector for targeted injection 6. Shortcode creation interface == Changelog == = 1.3 = * Added CSS minification option for live CSS scripts * Added JavaScript base64 encoding option * Added shortcode support with `[csmanager id="..."]` syntax * Improved security with enhanced CSRF protection * Enhanced input validation and sanitization * Fixed context handling for multi-location scripts * Improved backward compatibility for legacy scripts * Code cleanup and optimization = 1.2a = * Initial public release * Professional Ace Editor integration * Full version control system * Multi-location targeting (Frontend, Backend, Block Editor, Login) * Element-level injection via CSS selectors * Advanced search functionality * Real-time CSS color previews * Security audit and hardening == Upgrade Notice == = 1.3 = Major update with new features including CSS minification, JavaScript base64 encoding, and shortcode support. Update recommended for all users. == Support == For support, feature requests, and bug reports, please visit: https://customscriptmanager.com/ == Credits == * Ace Editor - https://ace.c9.io/ (Apache 2.0 License) * Built with WordPress best practices and coding standards == Privacy == This plugin does not collect, store, or transmit any user data. All scripts are stored locally in your WordPress database using the Options API. No external connections are made except for loading the Ace Editor library from a CDN.