WordPress.org

Plugin Directory

Code Snippets

An easy, clean and simple way to add code snippets to your site.

2.0.3

2.0.2

  • Fix error in table creation code
  • Remove settings database option when plugin is uninstalled

2.0.1

  • Fix table creation code not running on upgrade
  • Fix snippets per page option not saving

2.0

Highlights

  • Better import/export functionality
  • New settings page with code editor settings
  • Code rewritten for cleaner and more efficient code
  • Lots of new translations

Added

  • Added link to Code Snippets importer under Snippets admin menu
  • Added settings component and admin page
  • Added support for different CodeMirror themes
  • Integrated tags component into main plugin. Current users of the Code Snippets Tags plugin can safely uninstall it.
  • Added Auto Close Brackets CodeMirror addon (props to TronicLabs)
  • Added Serbo-Croatian translation by Borisa Djuraskovic from Web Hosting Hub
  • Added Highlight Selection Matches CodeMirror addon (props to TronicLabs)
  • Added Chinese translation thanks to Jincheng Shan
  • Added Russian translation by Alexander Samsonov
  • Added Slovak translation by [Ján Fajčák] from WordPress Slovakia
  • Added setting to always save and activate snippets by default

Changed

  • Added braces to single-line conditionals in line with new coding standards
  • Split up large classes into separate functions
  • Improved plugin file structure
  • Replaced uninstall hook with single file method
  • Updated CodeMirror library to version 5.0
  • Rewritten import/export functionality to use DOMDocument
  • Merged Code_Snippets_Export_PHP class into Code_Snippets_Export class

Deprecated

  • Removed old admin style support
  • Removed backwards-compatible support

Fixed

  • Fixed incompatibility errors with PHP 5.2
  • Fixed empty MO translation files
  • Removed duplicate MySQL primary key indexing

1.9

  • Add and remove network capabilities as super admins are added and removed
  • Updated MP6 icon implementation
  • Replaced buggy trim <?php and ?> functionality with a much more reliable regex method (#)
  • Added French translation thanks to translator oWEB
  • Fixed snippet failing to save when code contains % character, props to nikan06 (#)
  • Added 'Save & Deactivate' button to the edit snippet page (#)
  • Removed edit and install capabilities (now only uses the manage capability)
  • Fixed HTML breaking in export files (#)
  • Make the title of each snippet on the manage page a clickable link to edit the snippet (#)
  • Added nonce to edit snippet page
  • Hide row actions on manage snippet page by default
  • Removed screenshots from plugin
  • Improved CodeMirror implementation
  • Added a fallback MP6 icon
  • Use the proper WordPress database APIs all of the time
  • Rewritten export functionality
  • Fixed incorrect export filename
  • Updated CodeMirror to version 3.19
  • Removed CodeMirror bundled with plugin
  • Updated WordPress.org plugin banner
  • Fixed CodeMirror incompatibility with the WP Editor plugin
  • Fixed CodeMirror incompatibility with the Debug Bar Console plugin

1.8.1

  • Compiled all CodeMirror scripts into a single file
  • Use Sass + Compass for CSS
  • Use Grunt for build automation
  • Minify CSS
  • Fixed code typo that was breaking export files
  • Updated CodeMirror to 3.15

1.8

  • Allow no snippet name or code to be set
  • Prevented an error on fresh multisite installations
  • Refactored code to use best practices
  • Improved database table creation method: on a single-site install, the snippets table will always be created. On a multisite install, the network snippets table will always be created; the site-specific table will always be created for the main site; for sub-sites the snippets table will only be created on a visit to a snippets admin page.
  • Updated to CodeMirror 3.14
  • Changes to action and filter hook API
  • Added error message handling for import snippets page
  • Don't encode HTML entities in database

1.7.1.2

  • Correct path to admin menu icon (#)

1.7.1.1

  • Fix a minor bug with custom capabilities and admin menus

1.7.1

  • Fix a bug with snippet being set as deactivated when saved
  • Updated PHP Documentation completely. View online
  • Only load admin functions when viewing dashboard
  • Added German translation thanks to David Decker
  • Allow or deny site administrators access to snippet admin menus. Set your preference in the Enable Administration Menus setting under the Settings > Network Settings network admin menu.
  • Improve database table creation and upgrade process
  • Optimized to use less database queries

1.7

  • Improved plugin API
  • Fixed a bug with saving snippets per page option (#)
  • Updated CodeMirror to version 3.11
  • Allow plugin to be activated on individual sites on multisite (#)
  • Slimmed down the description visual editor
  • Added icon for the new MP6 admin UI (#)
  • Strip PHP tags from the beginning and end of a snippet in case someone forgets
  • Changed to MIT license
  • Removed HTML, CSS and JavaScript CodeMirror modes that were messing things up
  • Made everything leaner, faster, and better

1.6.1

  • Fixed a bug with permissions not being applied on install (#)
  • Fixed a bug in the uninstall method (#)

1.6

  • Updated code editor to use CodeMirror 3
  • Improved compatibility with Clean Options plugin
  • Code improvements and optimization
  • Changed namespace from cs to code_snippets
  • Move css and js under assets
  • Organized CodeMirror scripts
  • Improved updating process
  • Current line of code editor is now highlighted
  • Highlight matches of selected text in code editor
  • Only create snippet tables when needed
  • Store multisite only options in site options table
  • Fixed compatibility bugs with WordPress 3.5

1.5

  • Updated CodeMirror to version 2.33
  • Updated the 'Manage Snippets' page to use the WP_List_Table class
    • Added 'Screen Options' tab to 'Manage Snippets' page
    • Added search capability to 'Manage Snippets' page
    • Added views to easily filter activated, deactivated and recently activated snippets
    • Added ID column to 'Manage Snippets' page
    • Added sortable name and ID column on 'Manage Snippets' page (#)
  • Added custom capabilities
  • Improved API
  • Added 'Export to PHP' feature (#)
  • Lengthened snippet name field to 64 characters (#)
  • Added i18n

1.4

  • Added interface to Network Dashboard
  • Updated uninstall to support multisite
  • Replaced EditArea with CodeMirror
  • Small improvements

1.3.2

  • Fixed a bug with version 1.3.1

1.3.1

  • Changed plugin website URI
  • Cleaned up some code

1.3

  • Added export option to 'Manage Snippets' page
  • Added 'Import Snippets' page

1.2

  • Minor improvements
  • Added code highlighting
  • Removed 'Uninstall Plugin' page
  • Data will now be cleaned up when plugin is deleted through WordPress admin

1.1

  • Fixed a permissions bug with DISALLOW_FILE_EDIT being set to true (#)
  • Fixed a bug with the page title reading 'Add New Snippet' on the 'Edit Snippets' page
  • Fixed a bug not allowing the plugin to be Network Activated (#)

1.0

  • Stable version released.

Requires: 3.3 or higher
Compatible up to: 4.1.1
Last Updated: 2015-3-17
Active Installs: 10,000+

Ratings

4.8 out of 5 stars

Support

11 of 15 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,1,1 100,1,1
100,2,2 100,2,2
100,1,1 67,3,2 100,1,1 100,3,3 100,3,3 100,6,6 100,1,1
100,3,3
25,4,1 100,1,1 100,2,2
75,4,3 67,3,2 100,1,1
50,2,1
100,1,1
100,2,2
100,1,1
75,4,3
100,1,1
100,2,2
100,3,3
100,3,3
100,1,1
100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1