MainWP - Code Snippets Extension icon

Release v5.1

MainWP - Code Snippets Extension v5.1

What's new in v5.1

MainWP - Code Snippets Extension v5.1 was released on . The MainWP Code Snippets Extension is a powerful PHP platform that enables you to execute php code and scripts on your child sites and view the output on your Dashboard. See the full changelog below and compare with the complete version history.

Release details

Released
285.4 KB
File available

Changelog

Other
  • Security: Improved code snippet database handling with prepared queries, sanitized values, and stricter user scoping.
  • Security: Strengthened AJAX input and output handling to improve protection against malformed or unsafe requests.
  • Dev: Refactored core database methods, including install, update_codesnippet, get_codesnippet_by, and remove_codesnippet, for safer and more consistent data handling.
  • Dev: Refactored the extension structure with clearer return semantics, improved docblocks, singleton patterns, and updated build files for better maintainability.
Fixed
  • Corrected formatting of default snippet code.
  • Ensured default snippet descriptions and data are properly migrated during upgrades.
Added
  • Code folding UI and fold keymap support.
  • Autocompletion and automatic bracket closing in the code editor.
  • Natural Tab indentation support in the code editor.
  • PHP pre-save syntax validation to help catch common syntax errors before saving snippets.
  • Added a new clients column to the Code Snippets database table to support client-based snippet organization.
Improved
  • Reworked the snippet editor layout with a cleaner, more modern interface.
  • Moved snippet settings above the code editor for easier access while editing snippets.
  • Compacted snippet action buttons to reduce visual clutter in the editor area.
  • Replaced the snippet type radio buttons with a pill-style selector for a clearer editing experience.
  • Improved the saved snippets table by combining snippet titles and descriptions into a single, more readable column.
  • Replaced plain text snippet type indicators with colored labels for better visibility in the saved snippets table.
  • Refined multiple text strings for clearer and more consistent wording.
  • Improved snippet options handling, selection normalization, and snippet type validation for better reliability.
  • Improved snippet run UI rendering for a cleaner and more consistent user experience.
  • Replaced the legacy CodeMirror 5 editor with a new CodeMirror 6 bundle.
  • Improved internal utility handling with a safer rand_string method and a more user-friendly time_elapsed_string helper.

Verified safe

MainWP - Code Snippets Extension v5.1 scanned clean with no security threats detected.

View full scan report