Code Snippets - Version 1.3.2

Version Description

  • Fixed a bug with version 1.3.1
Download this release

Release Info

Developer bungeshea
Plugin Icon Code Snippets
Version 1.3.2
Comparing to
See all releases

Code changes from version 1.3 to 1.3.2

code-snippets.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /*
3
  Plugin Name: Code Snippets
4
- Plugin URI: http://bungeshea.wordpress.com/plugins/code-snippets/
5
- Description: Provides an easy-to-manage GUI interface for adding code snippets to your blog.
6
  Author: Shea Bunge
7
- Version: 1.3
8
- Author URI: http://bungeshea.wordpress.com/
9
  License: GPLv3 or later
10
 
11
  Code Snippets - WordPress Plugin
@@ -26,19 +26,14 @@
26
  */
27
 
28
  // Exit if accessed directly
29
- if ( !defined( 'ABSPATH' ) ) exit;
30
 
31
- if( !class_exists('Code_Snippets') ) :
32
 
33
  class Code_Snippets {
34
 
35
  public $table = 'snippets';
36
- public $version = '1.3';
37
-
38
- public $file;
39
- public $plugin_dir;
40
- public $plugin_url;
41
- public $basename;
42
 
43
  var $admin_manage_url = 'snippets';
44
  var $admin_edit_url = 'snippet';
@@ -136,7 +131,7 @@ class Code_Snippets {
136
  if( $_GET['action'] == 'export' )
137
  cs_export( $_GET['id'], $this->table );
138
 
139
- require_once $this->plugin_dir . 'includes/help/admin-manage-help.php';
140
  }
141
 
142
  function admin_edit_title( $title ) {
@@ -148,11 +143,11 @@ class Code_Snippets {
148
  if( isset( $_GET['action'] ) && @$_GET['action'] == 'edit' )
149
  add_filter( 'admin_title', array( $this, 'admin_edit_title' ) );
150
 
151
- require_once $this->plugin_dir . 'includes/help/admin-edit-help.php';
152
  }
153
 
154
  function admin_import_loader() {
155
- require_once $this->plugin_dir . 'includes/help/admin-import-help.php';
156
  }
157
 
158
  function bulk_action( $action, $ids ) {
@@ -209,7 +204,7 @@ class Code_Snippets {
209
  }
210
  }
211
 
212
- require_once $this->plugin_dir . 'includes/admin-manage.php';
213
  }
214
 
215
  function admin_edit() {
@@ -236,7 +231,7 @@ class Code_Snippets {
236
  $msg = 'Please provide a name for the snippet and the code.';
237
  }
238
  }
239
- require_once $this->plugin_dir . 'includes/admin-edit.php';
240
  }
241
 
242
  function admin_import() {
@@ -249,7 +244,7 @@ class Code_Snippets {
249
 
250
  $msg = 'Imported ' . $xml->count() . ' snippets';
251
  }
252
- require_once( $this->plugin_dir . 'includes/admin-import.php');
253
  }
254
 
255
  function settings_link( $links ) {
@@ -260,7 +255,7 @@ class Code_Snippets {
260
  function plugin_meta( $links, $file ) {
261
  if ( $file == $this->basename ) {
262
  return array_merge( $links, array(
263
- '<a href="http://wordpress.org/support/plugin/code-snippets/" title="Visit the WordPress.org plugin page">' . __( 'About' ) . '</a>',
264
  '<a href="http://wordpress.org/support/plugin/code-snippets/" title="Visit the support forums">' . __( 'Support' ) . '</a>'
265
  ) );
266
  }
1
  <?php
2
  /*
3
  Plugin Name: Code Snippets
4
+ Plugin URI: http://cs.bungeshea.com
5
+ Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
6
  Author: Shea Bunge
7
+ Version: 1.3.2
8
+ Author URI: http://bungeshea.com
9
  License: GPLv3 or later
10
 
11
  Code Snippets - WordPress Plugin
26
  */
27
 
28
  // Exit if accessed directly
29
+ if ( ! defined( 'ABSPATH' ) ) exit;
30
 
31
+ if( ! class_exists('Code_Snippets') ) :
32
 
33
  class Code_Snippets {
34
 
35
  public $table = 'snippets';
36
+ public $version = '1.3.2';
 
 
 
 
 
37
 
38
  var $admin_manage_url = 'snippets';
39
  var $admin_edit_url = 'snippet';
131
  if( $_GET['action'] == 'export' )
132
  cs_export( $_GET['id'], $this->table );
133
 
134
+ include $this->plugin_dir . 'includes/help/admin-manage-help.php';
135
  }
136
 
137
  function admin_edit_title( $title ) {
143
  if( isset( $_GET['action'] ) && @$_GET['action'] == 'edit' )
144
  add_filter( 'admin_title', array( $this, 'admin_edit_title' ) );
145
 
146
+ include $this->plugin_dir . 'includes/help/admin-edit-help.php';
147
  }
148
 
149
  function admin_import_loader() {
150
+ include $this->plugin_dir . 'includes/help/admin-import-help.php';
151
  }
152
 
153
  function bulk_action( $action, $ids ) {
204
  }
205
  }
206
 
207
+ require $this->plugin_dir . 'includes/admin/admin-manage.php';
208
  }
209
 
210
  function admin_edit() {
231
  $msg = 'Please provide a name for the snippet and the code.';
232
  }
233
  }
234
+ require $this->plugin_dir . 'includes/admin/admin-edit.php';
235
  }
236
 
237
  function admin_import() {
244
 
245
  $msg = 'Imported ' . $xml->count() . ' snippets';
246
  }
247
+ require $this->plugin_dir . 'includes/admin/admin-import.php';
248
  }
249
 
250
  function settings_link( $links ) {
255
  function plugin_meta( $links, $file ) {
256
  if ( $file == $this->basename ) {
257
  return array_merge( $links, array(
258
+ '<a href="http://wordpress.org/extend/plugins/code-snippets/" title="Visit the WordPress.org plugin page">' . __( 'About' ) . '</a>',
259
  '<a href="http://wordpress.org/support/plugin/code-snippets/" title="Visit the support forums">' . __( 'Support' ) . '</a>'
260
  ) );
261
  }
css/index.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
6
+
7
+ ?>
images/index.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
6
+
7
+ ?>
includes/{admin-edit.php → admin/admin-edit.php} RENAMED
File without changes
includes/{admin-import.php → admin/admin-import.php} RENAMED
File without changes
includes/{admin-manage.php → admin/admin-manage.php} RENAMED
File without changes
includes/admin/index.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
6
+
7
+ ?>
includes/edit_area/index.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
6
+
7
+ ?>
includes/edit_area/plugins/test/images/Thumbs.db DELETED
Binary file
includes/help/admin-edit-help.php CHANGED
@@ -43,5 +43,5 @@ $screen->set_help_sidebar(
43
  "<p><strong>For more information:</strong></p>" .
44
  "<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
45
  "<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
46
- "<p><a href='http://bungeshea.wordpress.com/plugins/code-snippets' target='_blank'>SheaPress</a></p>"
47
  );
43
  "<p><strong>For more information:</strong></p>" .
44
  "<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
45
  "<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
46
+ "<p><a href='http://cs.bungeshea.com' target='_blank'>SheaPress</a></p>"
47
  );
includes/help/admin-import-help.php CHANGED
@@ -25,5 +25,5 @@ $screen->set_help_sidebar(
25
  "<p><strong>For more information:</strong></p>" .
26
  "<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
27
  "<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
28
- "<p><a href='http://bungeshea.wordpress.com/plugins/code-snippets' target='_blank'>SheaPress</a></p>"
29
  );
25
  "<p><strong>For more information:</strong></p>" .
26
  "<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
27
  "<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
28
+ "<p><a href='http://cs.bungeshea.com' target='_blank'>SheaPress</a></p>"
29
  );
includes/help/admin-manage-help.php CHANGED
@@ -26,5 +26,5 @@ $screen->set_help_sidebar(
26
  "<p><strong>For more information:</strong></p>" .
27
  "<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
28
  "<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
29
- "<p><a href='http://bungeshea.wordpress.com/plugins/code-snippets' target='_blank'>SheaPress</a></p>"
30
  );
26
  "<p><strong>For more information:</strong></p>" .
27
  "<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
28
  "<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
29
+ "<p><a href='http://cs.bungeshea.com' target='_blank'>SheaPress</a></p>"
30
  );
includes/help/index.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
6
+
7
+ ?>
includes/index.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
6
+
7
+ ?>
index.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
6
+
7
+ ?>
readme.txt CHANGED
@@ -1,37 +1,35 @@
1
  === Code Snippets ===
2
  Contributors: bungeshea
3
- Donate link: http://bungeshea.wordpress.com/donate/
4
- Tags: snippets, code, php
5
  Requires at least: 3.3
6
  Tested up to: 3.4.1
7
- Stable tag: 1.3
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/copyleft/gpl.html
10
 
11
- Allows you to easily add code snippets through a GUI interface.
12
 
13
  == Description ==
14
 
15
- **Code Snippets** is a easy, clean and simple way to add code snippets to your site.
16
 
17
- Use the top level menu to manage your snippets. You can activate, deactivate, edit and delete snippets using a page similar to the Plugins menu. You can add a name for your snippet, a description using the visual editor and the code using a textarea with syntax highlighting and other features.
18
 
19
- 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).
20
 
21
- Code Snippets will automaticly clean ut its data when deleted through the WordPress dashboard. Each screen includes a help tab just in case you get stuck.
22
 
23
- Further information and screenshots are available on the [plugin homepage](http://bungeshea.wordpress.com/plugins/code-snippets).
24
 
25
- Code Snippets was featured on WPMU: [WordPress Code Snippets: Keep them Organized with this Plugin!](http://wpmu.org/wordpress-code-snippets)
26
 
27
- If you have any feedback, issues or suggestions for improvements please leave start a topic in the [Support Forum](http://wordpress.org/support/plugin/code-snippets) and if you like the plugin please give it a perfect rating at [WordPress.org](http://wordpress.org/extend/plugins/code-snippets) :-)
28
-
29
- You can also contribute to the code at [GitHub](https://github.com/bungeshea/code-snippets).
30
 
31
  == Installation ==
32
 
33
  1. Download the `code-snippets.zip` file to your local machine.
34
- 2. Either use the automatic plugin installer *(Plugins - Add New)* or Unzip the file and upload the **code-snippets** folder to your `/wp-content/plugins/` directory.
35
  3. Activate the plugin through the Plugins menu
36
  4. Visit the **Add New Snippet** menu page *(Snippets > Add New)* to add or edit Snippets.
37
  5. Activate your snippets through the Manage Snippets page *(Snippets > Manage Snippets)*
@@ -45,7 +43,7 @@ No, just copy all the content inside those tags.
45
  Yes. Just add it but do not activate it yet.
46
 
47
  = What do I use to write my snippets? =
48
- The [EditArea](http://www.cdolivet.com/editarea/) source-code editor will add line numbers, syntax highlighting, search and replace, tablature and other cool features to the code editor.
49
 
50
  = Will I lose my snippets if I change the theme or upgrade WordPress? =
51
  No, the snippets are added to the WordPress database so are independent of the theme and unaffected by WordPress upgrades.
@@ -54,10 +52,10 @@ No, the snippets are added to the WordPress database so are independent of the t
54
  Yes, when you delete Code Snippets using the 'Plugins' menu in WordPress it will clean up the database table and a few other bits of data. Be careful not to remove Code Snippets using the Plugins menu unless you want this to happen.
55
 
56
  = Can I copy any snippets I've created to another WordPress site? =
57
- Yes! You can individualy export a single snippet using the link below the snippet name on the 'Manage Snippets' page or bulk export multiple snippets using the 'Bulk Actions' feature. Snippets can later be imported using the 'Import Snippets' page by uploading the export file.
58
 
59
  = Can I run network-wide snippets on a multisite installation? =
60
- No, this feature is currently not avalible and will be coming in a future release. In the mean time activate Code Snippets individualy on the desired sites.
61
 
62
  = I have an idea for a cool feature for Code Snippets! =
63
  That's great! Let me know by starting (or adding to) a topic in the [Support Forums](http://wordpress.org/support/plugin/code-snippets/).
@@ -71,6 +69,13 @@ That's great! Let me know by starting (or adding to) a topic in the [Support For
71
 
72
  == Changelog ==
73
 
 
 
 
 
 
 
 
74
  = 1.3 =
75
  * Added export option to 'Manage Snippets' page
76
  * Added 'Import Snippets' page
@@ -79,7 +84,7 @@ That's great! Let me know by starting (or adding to) a topic in the [Support For
79
  * Minor improvements
80
  * Added code highlighting
81
  * Removed 'Uninstall Plugin' page
82
- * Data will now be cleaned up when plugin is deleted through WordPress admin.
83
 
84
  = 1.1 =
85
  * Fixed a permissions bug with `DISALLOW_FILE_EDIT` being set to true
@@ -88,15 +93,27 @@ That's great! Let me know by starting (or adding to) a topic in the [Support For
88
  = 1.0 =
89
  * Stable version released.
90
 
 
 
 
 
 
 
 
 
 
91
  == Upgrade Notice ==
92
 
 
 
 
93
  = 1.3 =
94
  Added import/export feature
95
 
96
  = 1.2 =
97
- Minor improvments |
98
  Added code highlighting |
99
  Plugin data will now be cleaned up when you delete the plugin.
100
 
101
  = 1.1 =
102
- * Minor bug fixes and improvements on the the 'Edit Snippet' page
1
  === Code Snippets ===
2
  Contributors: bungeshea
3
+ Donate link: http://cs.bungeshea.com/donate/
4
+ Tags: snippets, code, php, plugins
5
  Requires at least: 3.3
6
  Tested up to: 3.4.1
7
+ Stable tag: 1.3.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/copyleft/gpl.html
10
 
11
+ An easy, clean and simple way to add code snippets to your site.
12
 
13
  == Description ==
14
 
15
+ **Code Snippets** is an easy, clean and simple way to add code snippets to your site. No need to edit to your theme's `functions.php` file again!
16
 
17
+ 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 much less load on your site. 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. Code Snippets aims to change that by providing a graphical interface for adding snippets.
18
 
19
+ You can use a graphical interface similar to the Plugins menu to manage, activate, deactivate, edit and delete your snippets. Easily organise your snippets by adding add a name an description using the visual editor. Code Snippets includes built-in syntax highlighting and other features to help you write your code.
20
 
21
+ Although Code Snippets is designed to be easy-to-use and its interface looks, feels and acts as if it was a native part of WordPress, each screen includes a help tab, just in case you get stuck.
22
 
23
+ Further information and screenshots are available on the [plugin homepage](http://cs.bungeshea.com).
24
 
25
+ As featured on the WPMU blog: [WordPress Code Snippets: Keep them Organized with this Plugin!](http://wpmu.org/wordpress-code-snippets)
26
 
27
+ If you have any feedback, issues or suggestions for improvements please leave a topic in the [Support Forum](http://wordpress.org/support/plugin/code-snippets) and if you like the plugin please give it a perfect rating at [WordPress.org](http://wordpress.org/extend/plugins/code-snippets) :-)
 
 
28
 
29
  == Installation ==
30
 
31
  1. Download the `code-snippets.zip` file to your local machine.
32
+ 2. Either use the automatic plugin installer *(Plugins > Add New)* or Unzip the file and upload the **code-snippets** folder to your `/wp-content/plugins/` directory.
33
  3. Activate the plugin through the Plugins menu
34
  4. Visit the **Add New Snippet** menu page *(Snippets > Add New)* to add or edit Snippets.
35
  5. Activate your snippets through the Manage Snippets page *(Snippets > Manage Snippets)*
43
  Yes. Just add it but do not activate it yet.
44
 
45
  = What do I use to write my snippets? =
46
+ The [EditArea](http://www.cdolivet.com/editarea/) source-code editor will add line numbers, syntax highlighting, search and replace, tabulate and other cool features to the code editor.
47
 
48
  = Will I lose my snippets if I change the theme or upgrade WordPress? =
49
  No, the snippets are added to the WordPress database so are independent of the theme and unaffected by WordPress upgrades.
52
  Yes, when you delete Code Snippets using the 'Plugins' menu in WordPress it will clean up the database table and a few other bits of data. Be careful not to remove Code Snippets using the Plugins menu unless you want this to happen.
53
 
54
  = Can I copy any snippets I've created to another WordPress site? =
55
+ Yes! You can individually export a single snippet using the link below the snippet name on the 'Manage Snippets' page or bulk export multiple snippets using the 'Bulk Actions' feature. Snippets can later be imported using the 'Import Snippets' page by uploading the export file.
56
 
57
  = Can I run network-wide snippets on a multisite installation? =
58
+ This feature if planned for a future release. You can, however, 'Network Activate' Code Snippets through the Network Dashboard to use the plugin on all of the sites in your network.
59
 
60
  = I have an idea for a cool feature for Code Snippets! =
61
  That's great! Let me know by starting (or adding to) a topic in the [Support Forums](http://wordpress.org/support/plugin/code-snippets/).
69
 
70
  == Changelog ==
71
 
72
+ = 1.3.2 =
73
+ * Fixed a bug with version 1.3.1
74
+
75
+ = 1.3.1 =
76
+ * Changed plugin website URI
77
+ * Cleaned up some code
78
+
79
  = 1.3 =
80
  * Added export option to 'Manage Snippets' page
81
  * Added 'Import Snippets' page
84
  * Minor improvements
85
  * Added code highlighting
86
  * Removed 'Uninstall Plugin' page
87
+ * Data will now be cleaned up when plugin is deleted through WordPress admin
88
 
89
  = 1.1 =
90
  * Fixed a permissions bug with `DISALLOW_FILE_EDIT` being set to true
93
  = 1.0 =
94
  * Stable version released.
95
 
96
+ == Other Notes ==
97
+
98
+ Plugin updates will be posted on the [plugin's homepage](http://cs.bungeshea.com) ([RSS](http://cs.bungehea.tk/feed/)).
99
+
100
+ * 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).
101
+ * Code Snippets will automatically clean up its data when deleted through the WordPress dashboard
102
+
103
+ You can also contribute to the code at [GitHub](https://github.com/bungeshea/code-snippets).
104
+
105
  == Upgrade Notice ==
106
 
107
+ = 1.3.2 =
108
+ Check out Code Snippet's new website: http://cs.bungeshea.com
109
+
110
  = 1.3 =
111
  Added import/export feature
112
 
113
  = 1.2 =
114
+ Minor improvements |
115
  Added code highlighting |
116
  Plugin data will now be cleaned up when you delete the plugin.
117
 
118
  = 1.1 =
119
+ Minor bug fixes and improvements on the the 'Edit Snippet' page