diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ff7bf39b4..30e5bf94b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,14 +1,14 @@ blank_issues_enabled: true contact_links: - name: ❓ Support Question - url: https://help.codesnippets.pro/ + url: https://codesnippets.pro/support/ about: For Code Snippets users who need assistant and have general usage questions. - name: 💎 Premium Support - For customers only - url: https://help.codesnippets.pro/ + url: https://codesnippets.pro/support/ about: If you have an active license you are entitled to premium support. - name: 🗨️ Code Snippets Facebook Community url: https://www.facebook.com/groups/codesnippetsplugin about: The main Facebook group where all kinds of users come together to help each other. - name: 📚 Code Snippets Documentation - url: https://help.codesnippets.pro/ + url: https://codesnippets.pro/docs/ about: Anything you need to know about Code Snippets and what to do if you may have an issue. diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e7d50cbd..50ab5193e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [3.9.4] (2026-01-14) + +### Added +* New import functionality to migrate snippets from file uploads with drag-and-drop interface +* Support for importing snippets from other popular plugins (Header Footer Code Manager, Insert Headers and Footers, Insert PHP Code Snippet) +* Enhanced file based execution support with improved multisite mode compatibility + +### Changed +* Updated links to more recent documentation pages + +### Fixed +* Fixed multisite capability checks in Plugin class +* Fixed snippet execution logic for multisite support by centralizing trashed snippet handling +* Fixed multisite snippet handling to ensure local snippets use correct table and filter out trashed snippets ## [3.9.3] (2025-12-03) @@ -378,7 +392,7 @@ ### Added * Added additional editor shortcuts to list in tooltip. -* Filter for changing Snippets admin menu position. [See this help article for more information.](https://help.codesnippets.pro/article/61-how-can-i-change-the-location-of-the-snippets-admin-menu) +* Filter for changing Snippets admin menu position. [See this help article for more information.](https://codesnippets.pro/doc/snippets-menu-location/) * Ability to filter shortcode output. Thanks to contributions from [Jack Szwergold](https://github.com/JackSzwergold). ### Fixed diff --git a/README.md b/README.md index 931134db4..6a8240fd3 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ WordPress plugin for managing executable code snippets through a graphical inter - [Read more on WordPress.org](https://wordpress.org/plugins/code-snippets) - [Download the latest stable version](https://downloads.wordpress.org/plugin/code-snippets.latest-stable.zip) -- [Read the help documentation](https://help.codesnippets.pro) +- [Read the help documentation](https://codesnippets.pro/docs/) - [Leave a review](https://wordpress.org/support/plugin/code-snippets/reviews/#new-post) - [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/code-snippets/) diff --git a/package-lock.json b/package-lock.json index 3260a8438..72a75d7b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "code-snippets", - "version": "3.9.3", + "version": "3.9.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "code-snippets", - "version": "3.9.3", + "version": "3.9.4", "license": "GPL-2.0-or-later", "dependencies": { "@codemirror/fold": "^0.19.4", diff --git a/package.json b/package.json index ff50f0f85..6ff420068 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "code-snippets", "description": "Manage code snippets running on a WordPress-powered site through a graphical interface.", "homepage": "https://codesnippets.pro", - "version": "3.9.3", + "version": "3.9.4", "main": "src/dist/edit.js", "directories": { "test": "tests" diff --git a/src/code-snippets.php b/src/code-snippets.php index ad9b318f5..c1ce0349f 100644 --- a/src/code-snippets.php +++ b/src/code-snippets.php @@ -8,11 +8,11 @@ * License: GPL-2.0-or-later * License URI: license.txt * Text Domain: code-snippets - * Version: 3.9.3 + * Version: 3.9.4 * Requires PHP: 7.4 * Requires at least: 5.0 * - * @version 3.9.3 + * @version 3.9.4 * @package Code_Snippets * @author Shea Bunge * @copyright 2012-2024 Code Snippets Pro @@ -37,7 +37,7 @@ * * @const string */ - define( 'CODE_SNIPPETS_VERSION', '3.9.3' ); + define( 'CODE_SNIPPETS_VERSION', '3.9.4' ); /** * The full path to the main file of this plugin. diff --git a/src/php/admin-menus/class-welcome-menu.php b/src/php/admin-menus/class-welcome-menu.php index ceb816ac3..02788d4e1 100644 --- a/src/php/admin-menus/class-welcome-menu.php +++ b/src/php/admin-menus/class-welcome-menu.php @@ -59,7 +59,7 @@ protected function get_header_links(): array { 'label' => __( 'Cloud', 'code-snippets' ), ], 'resources' => [ - 'url' => 'https://help.codesnippets.pro/', + 'url' => 'https://codesnippets.pro/support/', 'icon' => 'sos', 'label' => __( 'Support', 'code-snippets' ), ], diff --git a/src/php/class-admin.php b/src/php/class-admin.php index dfdf093dd..9b109b5df 100644 --- a/src/php/class-admin.php +++ b/src/php/class-admin.php @@ -179,7 +179,7 @@ public function plugin_row_meta( array $plugin_meta, string $plugin_file ): arra array( sprintf( $format, - 'https://help.codesnippets.pro/', + 'https://codesnippets.pro/support/', esc_attr__( 'Find out how to get support with Code Snippets', 'code-snippets' ), esc_html__( 'Docs and Support', 'code-snippets' ) ), diff --git a/src/php/class-contextual-help.php b/src/php/class-contextual-help.php index 267d55ff3..85b69e533 100644 --- a/src/php/class-contextual-help.php +++ b/src/php/class-contextual-help.php @@ -67,15 +67,15 @@ public function load() { private function load_help_sidebar() { $sidebar_links = [ 'https://wordpress.org/plugins/code-snippets' => __( 'About Plugin', 'code-snippets' ), - 'https://help.codesnippets.pro/collection/3-faq' => __( 'FAQ', 'code-snippets' ), + 'https://codesnippets.pro/docs/faq/' => __( 'FAQ', 'code-snippets' ), 'https://wordpress.org/support/plugin/code-snippets' => __( 'Support Forum', 'code-snippets' ), 'https://codesnippets.pro' => __( 'Plugin Website', 'code-snippets' ), ]; $kses = [ - 'p' => [], + 'p' => [], 'strong' => [], - 'a' => [ 'href' => [] ], + 'a' => [ 'href' => [] ], ]; $contents = sprintf( "

%s

\n", esc_html__( 'For more information:', 'code-snippets' ) ); @@ -143,7 +143,7 @@ private function load_manage_help() { __( 'Be sure to check your snippets for errors before you activate them, as a faulty snippet could bring your whole blog down. If your site starts doing strange things, deactivate all your snippets and activate them one at a time.', 'code-snippets' ), __( "If something goes wrong with a snippet, and you can't use WordPress, you can cause all snippets to stop executing by turning on safe mode.", 'code-snippets' ), /* translators: %s: URL to Code Snippets Pro Docs */ - sprintf( __( 'You can find out how to enable safe mode in the Code Snippets Pro Docs.', 'code-snippets' ), 'https://help.codesnippets.pro/article/12-safe-mode' ) + sprintf( __( 'You can find out how to enable safe mode in the Code Snippets Pro Docs.', 'code-snippets' ), 'https://codesnippets.pro/doc/safe-mode/' ), ] ); } @@ -159,7 +159,7 @@ private function load_edit_help() { $this->get_intro_text() . __( 'Here you can add a new snippet, or edit an existing one.', 'code-snippets' ), /* translators: %s: URL to Code Snippets Pro Docs */ - sprintf( __( "If you're not sure about the types of snippets you can add, take a look at the Code Snippets Pro Docs for inspiration.", 'code-snippets' ), 'https://help.codesnippets.pro/collection/2-adding-snippets' ), + sprintf( __( "If you're not sure about the types of snippets you can add, take a look at the Code Snippets Pro Docs for inspiration.", 'code-snippets' ), 'https://codesnippets.pro/docs/adding-snippets/' ), ] ); diff --git a/src/php/migration/importers/files/file-upload-importer.php b/src/php/migration/importers/files/file-upload-importer.php index e4ec32f91..84d82005e 100644 --- a/src/php/migration/importers/files/file-upload-importer.php +++ b/src/php/migration/importers/files/file-upload-importer.php @@ -280,7 +280,7 @@ private function parse_json_file( string $file_path, string $file_name ) { 'id' => $snippet_data['id'] ?? uniqid(), 'title' => $snippet_data['name'] ?? __( 'Untitled Snippet', 'code-snippets' ), 'scope' => $snippet_data['scope'] ?? 'global', - 'tags' => is_array( $snippet_data['tags'] ?? [] ) ? implode( ', ', $snippet_data['tags'] ) : '', + 'tags' => is_array( $snippet_data['tags'] ?? null ) ? implode( ', ', $snippet_data['tags'] ) : '', 'description' => $snippet_data['desc'] ?? $snippet_data['description'] ?? '', 'type' => Snippet::get_type_from_scope( $snippet_data['scope'] ?? 'global' ) ]; diff --git a/src/php/views/partials/list-table-notices.php b/src/php/views/partials/list-table-notices.php index c3d345611..ff6b16eab 100644 --- a/src/php/views/partials/list-table-notices.php +++ b/src/php/views/partials/list-table-notices.php @@ -30,7 +30,7 @@ printf( esc_html( $text ), 'CODE_SNIPPETS_SAFE_MODE', 'wp-config.php' ); ?> - +

@@ -45,54 +45,54 @@ $result = sanitize_key( $_REQUEST['result'] ); $result_messages = [ - 'executed' => __( 'Snippet executed.', 'code-snippets' ), - 'activated' => __( 'Snippet activated.', 'code-snippets' ), - 'activated-multi' => __( 'Selected snippets activated.', 'code-snippets' ), - 'deactivated' => __( 'Snippet deactivated.', 'code-snippets' ), - 'deactivated-multi' => __( 'Selected snippets deactivated.', 'code-snippets' ), - 'deleted' => __( 'Snippet trashed.', 'code-snippets' ), - 'deleted-multi' => __( 'Selected snippets trashed.', 'code-snippets' ), - 'deleted_permanently' => __( 'Snippet permanently deleted.', 'code-snippets' ), + 'executed' => __( 'Snippet executed.', 'code-snippets' ), + 'activated' => __( 'Snippet activated.', 'code-snippets' ), + 'activated-multi' => __( 'Selected snippets activated.', 'code-snippets' ), + 'deactivated' => __( 'Snippet deactivated.', 'code-snippets' ), + 'deactivated-multi' => __( 'Selected snippets deactivated.', 'code-snippets' ), + 'deleted' => __( 'Snippet trashed.', 'code-snippets' ), + 'deleted-multi' => __( 'Selected snippets trashed.', 'code-snippets' ), + 'deleted_permanently' => __( 'Snippet permanently deleted.', 'code-snippets' ), 'deleted-permanently-multi' => __( 'Selected snippets permanently deleted.', 'code-snippets' ), - 'restored' => __( 'Snippet restored.', 'code-snippets' ), - 'restored-multi' => __( 'Selected snippets restored.', 'code-snippets' ), - 'cloned' => __( 'Snippet cloned.', 'code-snippets' ), - 'cloned-multi' => __( 'Selected snippets cloned.', 'code-snippets' ), - 'cloud-refreshed' => __( 'Synced cloud data has been successfully refreshed.', 'code-snippets' ), + 'restored' => __( 'Snippet restored.', 'code-snippets' ), + 'restored-multi' => __( 'Selected snippets restored.', 'code-snippets' ), + 'cloned' => __( 'Snippet cloned.', 'code-snippets' ), + 'cloned-multi' => __( 'Selected snippets cloned.', 'code-snippets' ), + 'cloud-refreshed' => __( 'Synced cloud data has been successfully refreshed.', 'code-snippets' ), ]; // Add undo link for single snippet trash action if ( 'deleted' === $result && ! empty( $_REQUEST['ids'] ) ) { $deleted_ids = sanitize_text_field( $_REQUEST['ids'] ); - $undo_url = wp_nonce_url( - add_query_arg( array( - 'action' => 'restore', - 'ids' => $deleted_ids - ) ), + $undo_url = wp_nonce_url( + add_query_arg( + [ + 'action' => 'restore', + 'ids' => $deleted_ids, + ] + ), 'bulk-snippets' ); - $result_messages['deleted'] = sprintf( - __( 'Snippet trashed. Undo', 'code-snippets' ), - esc_url( $undo_url ) - ); + // translators: %s: Undo URL. + $undo_message = __( 'Snippet trashed. Undo', 'code-snippets' ); + $result_messages['deleted'] = sprintf( $undo_message, esc_url( $undo_url ) ); } // Add undo link for bulk snippet trash action if ( 'deleted-multi' === $result && ! empty( $_REQUEST['ids'] ) ) { $deleted_ids = sanitize_text_field( $_REQUEST['ids'] ); - $undo_url = wp_nonce_url( - add_query_arg( array( - 'action' => 'restore', - 'ids' => $deleted_ids - ) ), + $undo_url = wp_nonce_url( + add_query_arg( array( + 'action' => 'restore', + 'ids' => $deleted_ids, + ) ), 'bulk-snippets' ); - $result_messages['deleted-multi'] = sprintf( - __( 'Selected snippets trashed. Undo', 'code-snippets' ), - esc_url( $undo_url ) - ); + // translators: %s: Undo URL. + $undo_message = __( 'Selected snippets trashed. Undo', 'code-snippets' ); + $result_messages['deleted-multi'] = sprintf( $undo_message, esc_url( $undo_url ) ); } $result_messages = apply_filters( 'code_snippets/manage/result_messages', $result_messages ); @@ -100,7 +100,7 @@ if ( isset( $result_messages[ $result ] ) ) { $result_kses = [ 'strong' => [], - 'a' => [ + 'a' => [ 'href' => [], ], ]; diff --git a/src/readme.txt b/src/readme.txt index 344ab2c04..16514bc46 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -4,7 +4,7 @@ Donate link: https://codesnippets.pro Tags: code, snippets, multisite, php, css License: GPL-2.0-or-later License URI: license.txt -Stable tag: 3.9.3 +Stable tag: 3.9.4 Tested up to: 6.8 An easy, clean and simple way to enhance your site with code snippets. @@ -63,10 +63,10 @@ Network Activating Code Snippets through the Network Dashboard will enable a spe == Frequently Asked Questions == -A full list of our Frequently Asked Questions can be found at [help.codesnippets.pro](https://help.codesnippets.pro/collection/3-faq). +A full list of our Frequently Asked Questions can be found at [codesnippets.pro](https://codesnippets.pro/docs/faq/). = How can I recover my site if it is crashed by a buggy snippet? = -You can recover your site by enabling the Code Snippets safe mode feature. Instructions for how to turn it on are available here: . +You can recover your site by enabling the Code Snippets safe mode feature. Instructions for how to turn it on are available here: . = Will I lose my snippets if I change the theme or upgrade WordPress? = No, the snippets are stored in the WordPress database, independent of the theme and unaffected by WordPress upgrades. @@ -104,6 +104,23 @@ You can report security bugs found in the source code of this plugin through the == Changelog == += 3.9.4 (2026-01-14) = + +__Added__ + +* New import functionality to migrate snippets from file uploads with drag-and-drop interface +* Support for importing snippets from other popular plugins (Header Footer Code Manager, Insert Headers and Footers, Insert PHP Code Snippet) +* Enhanced file based execution support with improved multisite mode compatibility + +__Changed__ + +* Updated links to more recent documentation pages + +__Fixed__ + +* Fixed multisite capability checks in Plugin class +* Fixed snippet execution logic for multisite support by centralizing trashed snippet handling +* Fixed multisite snippet handling to ensure local snippets use correct table and filter out trashed snippets = 3.9.3 (2025-12-03) =