Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions src/code-snippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <shea@codesnippets.pro>
* @copyright 2012-2024 Code Snippets Pro
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/php/admin-menus/class-welcome-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
],
Expand Down
2 changes: 1 addition & 1 deletion src/php/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' )
),
Expand Down
10 changes: 5 additions & 5 deletions src/php/class-contextual-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -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( "<p><strong>%s</strong></p>\n", esc_html__( 'For more information:', 'code-snippets' ) );
Expand Down Expand Up @@ -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 <strong>safe mode</strong>.", 'code-snippets' ),
/* translators: %s: URL to Code Snippets Pro Docs */
sprintf( __( 'You can find out how to enable safe mode in the <a href="%s">Code Snippets Pro Docs</a>.', 'code-snippets' ), 'https://help.codesnippets.pro/article/12-safe-mode' )
sprintf( __( 'You can find out how to enable safe mode in the <a href="%s">Code Snippets Pro Docs</a>.', 'code-snippets' ), 'https://codesnippets.pro/doc/safe-mode/' ),
]
);
}
Expand All @@ -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 <a href=\"%s\">Code Snippets Pro Docs</a> 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 <a href=\"%s\">Code Snippets Pro Docs</a> for inspiration.", 'code-snippets' ), 'https://codesnippets.pro/docs/adding-snippets/' ),
]
);

Expand Down
2 changes: 1 addition & 1 deletion src/php/migration/importers/files/file-upload-importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' )
];
Expand Down
66 changes: 33 additions & 33 deletions src/php/views/partials/list-table-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
printf( esc_html( $text ), '<code>CODE_SNIPPETS_SAFE_MODE</code>', '<code>wp-config.php</code>' );
?>

<a href="https://help.codesnippets.pro/article/12-safe-mode" target="_blank">
<a href="https://codesnippets.pro/doc/safe-mode/" target="_blank">
<?php esc_html_e( 'Help', 'code-snippets' ); ?>
</a>
</p>
Expand All @@ -45,62 +45,62 @@
$result = sanitize_key( $_REQUEST['result'] );

$result_messages = [
'executed' => __( 'Snippet <strong>executed</strong>.', 'code-snippets' ),
'activated' => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
'activated-multi' => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
'deactivated' => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
'deactivated-multi' => __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ),
'deleted' => __( 'Snippet <strong>trashed</strong>.', 'code-snippets' ),
'deleted-multi' => __( 'Selected snippets <strong>trashed</strong>.', 'code-snippets' ),
'deleted_permanently' => __( 'Snippet <strong>permanently deleted</strong>.', 'code-snippets' ),
'executed' => __( 'Snippet <strong>executed</strong>.', 'code-snippets' ),
'activated' => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
'activated-multi' => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
'deactivated' => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
'deactivated-multi' => __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ),
'deleted' => __( 'Snippet <strong>trashed</strong>.', 'code-snippets' ),
'deleted-multi' => __( 'Selected snippets <strong>trashed</strong>.', 'code-snippets' ),
'deleted_permanently' => __( 'Snippet <strong>permanently deleted</strong>.', 'code-snippets' ),
'deleted-permanently-multi' => __( 'Selected snippets <strong>permanently deleted</strong>.', 'code-snippets' ),
'restored' => __( 'Snippet <strong>restored</strong>.', 'code-snippets' ),
'restored-multi' => __( 'Selected snippets <strong>restored</strong>.', 'code-snippets' ),
'cloned' => __( 'Snippet <strong>cloned</strong>.', 'code-snippets' ),
'cloned-multi' => __( 'Selected snippets <strong>cloned</strong>.', 'code-snippets' ),
'cloud-refreshed' => __( 'Synced cloud data has been <strong>successfully</strong> refreshed.', 'code-snippets' ),
'restored' => __( 'Snippet <strong>restored</strong>.', 'code-snippets' ),
'restored-multi' => __( 'Selected snippets <strong>restored</strong>.', 'code-snippets' ),
'cloned' => __( 'Snippet <strong>cloned</strong>.', 'code-snippets' ),
'cloned-multi' => __( 'Selected snippets <strong>cloned</strong>.', 'code-snippets' ),
'cloud-refreshed' => __( 'Synced cloud data has been <strong>successfully</strong> 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 <strong>trashed</strong>. <a href="%s">Undo</a>', 'code-snippets' ),
esc_url( $undo_url )
);
// translators: %s: Undo URL.
$undo_message = __( 'Snippet <strong>trashed</strong>. <a href="%s">Undo</a>', '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 <strong>trashed</strong>. <a href="%s">Undo</a>', 'code-snippets' ),
esc_url( $undo_url )
);
// translators: %s: Undo URL.
$undo_message = __( 'Selected snippets <strong>trashed</strong>. <a href="%s">Undo</a>', 'code-snippets' );
$result_messages['deleted-multi'] = sprintf( $undo_message, esc_url( $undo_url ) );
}

$result_messages = apply_filters( 'code_snippets/manage/result_messages', $result_messages );

if ( isset( $result_messages[ $result ] ) ) {
$result_kses = [
'strong' => [],
'a' => [
'a' => [
'href' => [],
],
];
Expand Down
23 changes: 20 additions & 3 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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: <https://help.codesnippets.pro/article/12-safe-mode>.
You can recover your site by enabling the Code Snippets safe mode feature. Instructions for how to turn it on are available here: <https://codesnippets.pro/doc/safe-mode/>.

= 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.
Expand Down Expand Up @@ -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) =

Expand Down
Loading