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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 3.6.4 (15 Mar 2024)
* Fixed: Minor type compatability issue with newer versions of PHP.
* Improvement: Increment the revision number of CSS and JS snippet when using the 'Reset Caches' debug action. (PRO)
* Fixed: Undefined array key issue when initiating cloud sync. (PRO)
* Fixed: Bug preventing downloading a single snippet from a bundle. (PRO)
* Added: AI generation for all snippet types: HTML, CSS, JS. (PRO)
* Fixed: Translations not loading for strings in JavaScript files.
* Improved: UX in generate dialog, such as allowing 'Enter' to submit the form. (PRO)
* Added: Button to create a cloud connection directly from the Snippets menu when disconnected. (PRO)

## 3.6.3 (13 Nov 2023)
* Fixed: Import error when initialising cloud sync configuration. (PRO)
* Improved: Added debug action for resetting snippets caches.
Expand Down
82 changes: 82 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

## Translators

Code Snippets can be used in these different languages thanks to the following translators:

* Belarusian
* [Hrank.com](https://www.hrank.com)
* Brazilian Portuguese
* [Bruno Borges](http://brunoborges.info)
* Chinese
* [Jincheng Shan](http://shanjincheng.com)
* [诗语](https://profiles.wordpress.org/f2010525/)
* Chinese (Taiwan)
* [Alex Lion](https://www.alexclassroom.com/)
* [Chun-Chih Cheng](https://profiles.wordpress.org/alex1114/)
* Croatian
* [Borisa Djuraskovic from Web Hosting Hub](https://www.webhostinghub.com/)
* Czech
* [Lukáš Tesař](mailto:lukastesar03@gmail.com) and [Jakub Humpolec](https://profiles.wordpress.org/jumphy/)
* Danish
* [Finn Sommer Jensen](https://profiles.wordpress.org/finnsommer/)
* Dutch
* [Sander Spies](https://github.com/sander1)
* [Peter Smits](https://psmits.com)
* [mother.of.code.a11n](https://profiles.wordpress.org/imazed/)
* English (New Zealand) and English (UK)
* [webaware](https://profiles.wordpress.org/webaware/)
* English (South Africa)
* [webaware](https://profiles.wordpress.org/webaware/)
* [Ian Barnes](https://profiles.wordpress.org/ianbarnes/)
* French
* [momo-fr](https://www.momofr.net/)
* [Didier Demory](https://www.wptrads.com/)
* [Cyrille Sanson](https://100son.net/)
* [Shea Bunge](https://sheabunge.com)
* French (Canada)
* [Dominic Desbiens](https://www.dominicdesbiens.com/)
* German
* [Mario Siegmann](https://web-alltag.de/)
* [Joerg Knoerchen](https://www.sensorgrafie.de/)
* [David Decker](https://deckerweb.de)
* [Andreas](https://profiles.wordpress.org/perryzelda/)
* Greek
* [Konstantinos Megas](https://profiles.wordpress.org/nextdoorpanda/)
* [Toni Bishop from Jrop](https://www.jrop.com/)
* Indonesian
* [Jordan Silaen from ChameleonJohn.com](https://www.chameleonjohn.com/)
* Italian
* [Usman Wagan](https://coupontoaster.com/)
* [Luisa Ravelli](https://profiles.wordpress.org/darkavenger/)
* [ElectricFeet](https://profiles.wordpress.org/electricfeet/)
* Japanese
* [mt8](https://mt8.biz/)
* [Takakazu Nagaya](https://profiles.wordpress.org/tanagaya/)
* [Naoko Takano](https://naoko.blog/)
* [melvas](https://profiles.wordpress.org/melvas/)
* Persian
* [Mohammad Novintanon](http://mnovintan.ir/)
* Russian
* [Alexander Samsonov](http://www.wordpressplugins.ru/administration/code-snippets.html)
* [Yui](https://profiles.wordpress.org/fierevere/)
* [Denis Yanchevskiy](https://denisco.pro/)
* [krioteh](https://profiles.wordpress.org/krioteh/)
* Slovak
* [Ján Fajčák](https://wp.sk)
* Spanish (Colombia) and Spanish (Ecuador)
* [Javier Esteban](https://javieresteban.org/)
* Spanish (Spain)
* [Ibidem Group](https://www.ibidemgroup.com)
* [Javier Esteban](https://javieresteban.org/)
* [Fernando Tellado](https://ayudawp.com/)
* [Juanma Aranda](https://juanmaaranda.com/)
* Spanish (Venezuela)
* [Yordan Soares](https://yordansoar.es/)
* Swedish
* [Argentum](https://profiles.wordpress.org/argentum/)
* [Fredrik](https://profiles.wordpress.org/elbogen/)
* [Tor-Bjorn Fjellner](https://profiles.wordpress.org/tobifjellner/)
* Urdu
* [Samuel Badree](https://mobilemall.pk/)
* Vietnamese
* [Tuan Phan](https://profiles.wordpress.org/khunglong/)
6 changes: 3 additions & 3 deletions 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.6.3
* Version: 3.6.4
* Requires PHP: 7.4
* Requires at least: 5.0
*
* @version 3.6.3
* @version 3.6.4
* @package Code_Snippets
* @author Shea Bunge <shea@codesnippets.pro>
* @copyright 2012-2023 Code Snippets Pro
Expand All @@ -37,7 +37,7 @@
*
* @const string
*/
define( 'CODE_SNIPPETS_VERSION', '3.6.3' );
define( 'CODE_SNIPPETS_VERSION', '3.6.4' );

/**
* The full path to the main file of this plugin.
Expand Down
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 @@ -3,7 +3,7 @@
"description": "Manage code snippets running on a WordPress-powered site through a graphical interface.",
"homepage": "https://wordpress.org/plugins/code-snippets",
"main": "gulpfile.babel.ts",
"version": "3.6.3",
"version": "3.6.4",
"directories": {
"test": "tests"
},
Expand Down
34 changes: 16 additions & 18 deletions php/admin-menus/class-edit-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,37 +149,35 @@ public function enqueue_assets() {

enqueue_code_editor( $this->snippet->type );

$css_deps = [
'code-editor',
'wp-components',
];

$js_deps = [
'code-snippets-code-editor',
'react',
'react-dom',
'wp-url',
'wp-i18n',
'wp-api-fetch',
'wp-components',
'wp-block-editor',
];

wp_enqueue_style(
self::CSS_HANDLE,
plugins_url( "dist/edit$rtl.css", $plugin->file ),
$css_deps,
[
'code-editor',
'wp-components',
],
$plugin->version
);

wp_enqueue_script(
self::JS_HANDLE,
plugins_url( 'dist/edit.js', $plugin->file ),
$js_deps,
[
'code-snippets-code-editor',
'react',
'react-dom',
'wp-url',
'wp-i18n',
'wp-api-fetch',
'wp-components',
'wp-block-editor',
],
$plugin->version,
true
);

wp_set_script_translations( self::JS_HANDLE, 'code-snippets' );

if ( $desc_enabled ) {
remove_editor_styles();
wp_enqueue_editor();
Expand Down
2 changes: 2 additions & 0 deletions php/admin-menus/class-manage-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public function enqueue_assets() {
true
);

wp_set_script_translations( 'code-snippets-manage-js', 'code-snippets' );

if ( 'cloud_search' === $this->get_current_type() ) {
Frontend::enqueue_all_prism_themes();
}
Expand Down
2 changes: 2 additions & 0 deletions php/settings/editor-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ function enqueue_editor_preview_assets() {
true
);

wp_set_script_translations( 'code-snippets-settings-menu', 'code-snippets' );

// Extract the CodeMirror-specific editor settings.
$setting_fields = get_settings_fields();
$editor_fields = array();
Expand Down
99 changes: 32 additions & 67 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,45 @@
=== Code Snippets ===
Contributors: bungeshea, ver3, lightbulbman, 0aksmith, codesnippetspro
Donate link: https://codesnippets.pro
Tags: snippets, functions, multisite, code, php, html, css, javascript
Tags: snippets, functions, multisite, code, php, html, css, javascript, js, content, scripts, styles, cloud, shortcode
License: MIT
License URI: license.txt
Stable tag: 3.6.2
Tested up to: 6.4
Stable tag: 3.6.4
Tested up to: 6.5-RC2

An easy, clean and simple way to run code snippets on your site.
An easy, clean and simple way to enhance your site with code snippets.

== Description ==

Code Snippets is an easy, clean and simple way to run code snippets on your site. It removes the need to add custom snippets to your theme's `functions.php` file.
**✂ Code Snippets** provides an effortless way to enhance your WordPress site.

[**Code Snippets Pro** is now available, with full CSS, JavaScript, Gutenberg and Elementor integrations.](https://codesnippets.pro/pricing/)
**🚀 Upgrade to Code Snippets Pro** for complete CSS, JavaScript, Gutenberg, Elementor and cloud synchronisation integrations. **[Elevate your snippets experience now!](https://codesnippets.pro/pricing)**

A snippet is a small chunk of PHP code that you can use to extend the functionality of a WordPress-powered website; essentially a mini-plugin with less load on your site.
Say goodbye to the hassle of tweaking your theme's `functions.php` file and downloading endless plugins – Code Snippets simplifies the process!

Most snippet-hosting sites tell you to add snippet code to your active theme's `functions.php` file, which can get rather long and messy after a while.
A snippet is like a mini-plugin for your WordPress site, providing added functionality without the clutter.

Code Snippets changes that by providing a GUI interface for adding snippets and **actually running them on your site** just as if they were in your theme's `functions.php` file.
Unlike other solutions that involve dumping code into your `functions.php` file, Code Snippets offers an intuitive graphical interface for seamless integration and real-time execution. Managing snippets is as easy as activating and deactivating plugins, only without the bloat and overhead.

**Quick overview of Code Snippets by Imran Siddiq**
**🎥 Watch a quick overview by Imran Siddiq:**

https://youtu.be/EMjIWjcYONk

Code Snippets provides graphical interface, similar to the Plugins menu, for managing snippets. Snippets can be activated and deactivated, just like plugins.
☁️ Each copy of Code Snippets includes full integration with the community-powered [Code Snippets Cloud](https://codesnippets.cloud/) platform, providing easy access to hundreds of tweaks and enhancements ready to power-up any WordPress site.

The snippet editor includes fields for a name, a visual editor-enabled description, tags to allow you to categorize snippets, and a full-featured code editor. Snippets can be exported for transfer to another site, either in JSON for later importing by the Code Snippets plugin, or in PHP for creating your own plugin or theme.

**Comprehensive Code Snippets tutorial with practical examples by Ferdy Korpershoek**
**📚 Learn from Ferdy Korpershoek's tutorial:**

https://youtu.be/29jD2BcBX5w

If you have any feedback, issues, or suggestions for improvements please leave a topic in the [Support Forum](https://wordpress.org/support/plugin/code-snippets), [join the community on Facebook](https://facebook.com/groups/codesnippetsplugin), or [check us out on GitHub](https://github.com/codesnippetspro/code-snippets).

If you like this plugin, or it is useful to you in some way, please consider reviewing it on [WordPress.org](https://wordpress.org/support/view/plugin-reviews/code-snippets).

== Translations ==

Code Snippets can be used in these different languages thanks to the following translators:

* Belarusian – [Hrank.com](https://www.hrank.com)
* Brazilian Portuguese – [Bruno Borges](http://brunoborges.info)
* Chinese – [Jincheng Shan](http://shanjincheng.com) and [诗语](https://profiles.wordpress.org/f2010525/)
* Chinese (Taiwan) – [Alex Lion](https://www.alexclassroom.com/) and [Chun-Chih Cheng](https://profiles.wordpress.org/alex1114/)
* Croatian – [Borisa Djuraskovic from Web Hosting Hub](https://www.webhostinghub.com/)
* Czech – [Lukáš Tesař](mailto:lukastesar03@gmail.com) and [Jakub Humpolec](https://profiles.wordpress.org/jumphy/)
* Danish – [Finn Sommer Jensen](https://profiles.wordpress.org/finnsommer/)
* Dutch – [Sander Spies](https://github.com/sander1), [Peter Smits](https://psmits.com) and [mother.of.code.a11n](https://profiles.wordpress.org/imazed/)
* English (New Zealand) and English (UK) – [webaware](https://profiles.wordpress.org/webaware/)
* English (South Africa) – [webaware](https://profiles.wordpress.org/webaware/) and [Ian Barnes](https://profiles.wordpress.org/ianbarnes/)
* French – [momo-fr](https://www.momofr.net/), [Didier Demory](https://www.wptrads.com/), [Cyrille Sanson](https://100son.net/) and [Shea Bunge](https://sheabunge.com)
* French (Canada) – [Dominic Desbiens](https://www.dominicdesbiens.com/)
* German – [Mario Siegmann](https://web-alltag.de/), [Joerg Knoerchen](https://www.sensorgrafie.de/), [David Decker](https://deckerweb.de) and [Andreas](https://profiles.wordpress.org/perryzelda/)
* Greek – [Konstantinos Megas](https://profiles.wordpress.org/nextdoorpanda/) and [Toni Bishop from Jrop](https://www.jrop.com/)
* Indonesian – [Jordan Silaen from ChameleonJohn.com](https://www.chameleonjohn.com/)
* Italian – [Usman Wagan](https://coupontoaster.com/), [Luisa Ravelli](https://profiles.wordpress.org/darkavenger/) and [ElectricFeet](https://profiles.wordpress.org/electricfeet/)
* Japanese – [mt8](https://mt8.biz/), [Takakazu Nagaya](https://profiles.wordpress.org/tanagaya/), [Naoko Takano](https://naoko.blog/) and [melvas](https://profiles.wordpress.org/melvas/)
* Persian – [Mohammad Novintanon](http://mnovintan.ir/)
* Russian – [Alexander Samsonov](http://www.wordpressplugins.ru/administration/code-snippets.html), [Yui](https://profiles.wordpress.org/fierevere/), [Denis Yanchevskiy](https://denisco.pro/) and [krioteh](https://profiles.wordpress.org/krioteh/)
* Slovak – [Ján Fajčák](https://wp.sk)
* Spanish (Colombia) and Spanish (Ecuador) – [Javier Esteban](https://javieresteban.org/)
* Spanish (Spain) – [Ibidem Group](https://www.ibidemgroup.com), [Javier Esteban](https://javieresteban.org/), [Fernando Tellado](https://ayudawp.com/) and [Juanma Aranda](https://juanmaaranda.com/)
* Spanish (Venezuela) – [Yordan Soares](https://yordansoar.es/)
* Swedish – [Argentum](https://profiles.wordpress.org/argentum/), [Fredrik](https://profiles.wordpress.org/elbogen/) and [Tor-Bjorn Fjellner](https://profiles.wordpress.org/tobifjellner/)
* Urdu – [Samuel Badree](https://mobilemall.pk/)
* Vietnamese – [Tuan Phan](https://profiles.wordpress.org/khunglong/)
**🌐 Connect with us:**

* [Support Forum](https://wordpress.org/support/plugin/code-snippets)
* [Facebook Community](https://facebook.com/groups/codesnippetsplugin)
* [GitHub Repository](https://github.com/codesnippetspro/code-snippets)

🌟 Like our plugin? Find it useful? Please consider sharing your experience by [leaving a review on WordPress.org](https://wordpress.org/support/view/plugin-reviews/code-snippets). Your feedback is instrumental to shaping our future growth!

🌍 We'd like to thank the wonderful people who have helped contribute translations to allow Code Snippets to be used in different languages. [You can find a full list here](https://github.com/codesnippetspro/code-snippets/blob/core/CREDITS.md#translators).

== Installation ==

Expand Down Expand Up @@ -114,7 +87,7 @@ You can run snippets across an entire multisite network by **Network Activating*
Snippets are stored in the `wp_snippets` table in the WordPress database. The table name may differ depending on what your table prefix is set to.

= Where can I go for help or suggest new features? =
You can get help with Code Snippets, report bugs or errors, and suggest new features and improvements either on the [WordPress Support Forums](https://wordpress.org/support/plugin/code-snippets) or on [GitHub](https://github.com/codesnippetspro/code-snippets)
You can get help with Code Snippets, report bugs or errors, and suggest new features and improvements either on the [WordPress Support Forums](https://wordpress.org/support/plugin/code-snippets) or on [GitHub](https://github.com/codesnippetspro/code-snippets).

= How can I help contribute to the development of the Code Snippets plugin? =
The best way to do this is to fork the [repository on GitHub](https://github.com/codesnippetspro/code-snippets) and send a pull request.
Expand All @@ -131,6 +104,16 @@ You can report security bugs found in the source code of this plugin through the

== Changelog ==

= 3.6.4 (15 Mar 2024) =
* Fixed: Minor type compatability issue with newer versions of PHP.
* Improvement: Increment the revision number of CSS and JS snippet when using the 'Reset Caches' debug action. (PRO)
* Fixed: Undefined array key issue when initiating cloud sync. (PRO)
* Fixed: Bug preventing downloading a single snippet from a bundle. (PRO)
* Added: AI generation for all snippet types: HTML, CSS, JS. (PRO)
* Fixed: Translations not loading for strings in JavaScript files.
* Improved: UX in generate dialog, such as allowing 'Enter' to submit the form. (PRO)
* Added: Button to create a cloud connection directly from the Snippets menu when disconnected. (PRO)

= 3.6.3 (13 Nov 2023) =
* Fixed: Import error when initialising cloud sync configuration. (PRO)
* Improved: Added debug action for resetting snippets caches.
Expand Down Expand Up @@ -257,22 +240,4 @@ thanks to contributions made by [Amaral Krichman](https://github.com/karmaral).
* Improved: Compatibility of Elementor widgets with the latest version of Elementor. (PRO)
* Improved: Replace icon font menu icon with embedded SVG icon.

= 3.1.2 (03 Jul 2022) =
* Updated external links and branding for Code Snippets Pro.
* Improved: Add link URLs to settings pages, as an alternative to in-page navigation.
* Fixed: Various fixes to block editor scripts. (PRO)
* Fixed: Improved visual style of Gutenberg editor blocks. (PRO)

= 3.1.1 (13 Jun 2022) =
* Fixed: Download snippets feature not including snippet content.
* Fixed: Alignment of 'opens externally' dashicon.
* Improved: Added additional parameters to `code_snippets/export/filename` filter.

= 3.1.0 (17 May 2022) =
* Fixed: Caching inconsistencies preventing snippets and settings from refreshing on sites with persistent object caching.
* Improved: Simplified database queries.
* Added: More comprehensive cache coverage, including for active snippets.
* Added: Icon to 'Go Pro' button indicating it opens an external tab.
* Improved: Allow display styles in snippet descriptions.

**[The full changelog is available on GitHub](https://github.com/codesnippetspro/code-snippets/blob/master/CHANGELOG.md)**