Skip to content

Commit

Permalink
Updated to version 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sheabunge committed Jun 17, 2013
1 parent abebb26 commit 917d610
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 42 deletions.
33 changes: 14 additions & 19 deletions code-snippets.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/*
Plugin Name: Code Snippets
Plugin URI: http://bungeshea.wordpress.com/plugins/code-snippets/
Description: Provides an easy-to-manage GUI interface for adding code snippets to your blog.
Plugin URI: http://cs.bungeshea.com
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!
Author: Shea Bunge
Version: 1.3
Author URI: http://bungeshea.wordpress.com/
Version: 1.3.2
Author URI: http://bungeshea.com
License: GPLv3 or later
Code Snippets - WordPress Plugin
Expand All @@ -26,19 +26,14 @@
*/

// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
if ( ! defined( 'ABSPATH' ) ) exit;

if( !class_exists('Code_Snippets') ) :
if( ! class_exists('Code_Snippets') ) :

class Code_Snippets {

public $table = 'snippets';
public $version = '1.3';

public $file;
public $plugin_dir;
public $plugin_url;
public $basename;
public $version = '1.3.2';

var $admin_manage_url = 'snippets';
var $admin_edit_url = 'snippet';
Expand Down Expand Up @@ -136,7 +131,7 @@ function admin_manage_loader() {
if( $_GET['action'] == 'export' )
cs_export( $_GET['id'], $this->table );

require_once $this->plugin_dir . 'includes/help/admin-manage-help.php';
include $this->plugin_dir . 'includes/help/admin-manage-help.php';
}

function admin_edit_title( $title ) {
Expand All @@ -148,11 +143,11 @@ function admin_edit_loader() {
if( isset( $_GET['action'] ) && @$_GET['action'] == 'edit' )
add_filter( 'admin_title', array( $this, 'admin_edit_title' ) );

require_once $this->plugin_dir . 'includes/help/admin-edit-help.php';
include $this->plugin_dir . 'includes/help/admin-edit-help.php';
}

function admin_import_loader() {
require_once $this->plugin_dir . 'includes/help/admin-import-help.php';
include $this->plugin_dir . 'includes/help/admin-import-help.php';
}

function bulk_action( $action, $ids ) {
Expand Down Expand Up @@ -209,7 +204,7 @@ function admin_manage() {
}
}

require_once $this->plugin_dir . 'includes/admin-manage.php';
require $this->plugin_dir . 'includes/admin/admin-manage.php';
}

function admin_edit() {
Expand All @@ -236,7 +231,7 @@ function admin_edit() {
$msg = 'Please provide a name for the snippet and the code.';
}
}
require_once $this->plugin_dir . 'includes/admin-edit.php';
require $this->plugin_dir . 'includes/admin/admin-edit.php';
}

function admin_import() {
Expand All @@ -249,7 +244,7 @@ function admin_import() {

$msg = 'Imported ' . $xml->count() . ' snippets';
}
require_once( $this->plugin_dir . 'includes/admin-import.php');
require $this->plugin_dir . 'includes/admin/admin-import.php';
}

function settings_link( $links ) {
Expand All @@ -260,7 +255,7 @@ function settings_link( $links ) {
function plugin_meta( $links, $file ) {
if ( $file == $this->basename ) {
return array_merge( $links, array(
'<a href="http://wordpress.org/support/plugin/code-snippets/" title="Visit the WordPress.org plugin page">' . __( 'About' ) . '</a>',
'<a href="http://wordpress.org/extend/plugins/code-snippets/" title="Visit the WordPress.org plugin page">' . __( 'About' ) . '</a>',
'<a href="http://wordpress.org/support/plugin/code-snippets/" title="Visit the support forums">' . __( 'Support' ) . '</a>'
) );
}
Expand Down
7 changes: 7 additions & 0 deletions css/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Do not modify the files in this folder.
*/

?>
7 changes: 7 additions & 0 deletions images/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Do not modify the files in this folder.
*/

?>
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions includes/admin/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Do not modify the files in this folder.
*/

?>
7 changes: 7 additions & 0 deletions includes/edit_area/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Do not modify the files in this folder.
*/

?>
2 changes: 1 addition & 1 deletion includes/help/admin-edit-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
"<p><strong>For more information:</strong></p>" .
"<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
"<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
"<p><a href='http://bungeshea.wordpress.com/plugins/code-snippets' target='_blank'>SheaPress</a></p>"
"<p><a href='http://cs.bungeshea.com' target='_blank'>SheaPress</a></p>"
);
2 changes: 1 addition & 1 deletion includes/help/admin-import-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"<p><strong>For more information:</strong></p>" .
"<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
"<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
"<p><a href='http://bungeshea.wordpress.com/plugins/code-snippets' target='_blank'>SheaPress</a></p>"
"<p><a href='http://cs.bungeshea.com' target='_blank'>SheaPress</a></p>"
);
2 changes: 1 addition & 1 deletion includes/help/admin-manage-help.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"<p><strong>For more information:</strong></p>" .
"<p><a href='http://wordpress.org/extend/plugins/code-snippets' target='_blank'>WordPress Extend</a></p>" .
"<p><a href='http://wordpress.org/support/plugin/code-snippets' target='_blank'>Support Forums</a></p>" .
"<p><a href='http://bungeshea.wordpress.com/plugins/code-snippets' target='_blank'>SheaPress</a></p>"
"<p><a href='http://cs.bungeshea.com' target='_blank'>SheaPress</a></p>"
);
7 changes: 7 additions & 0 deletions includes/help/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Do not modify the files in this folder.
*/

?>
7 changes: 7 additions & 0 deletions includes/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Do not modify the files in this folder.
*/

?>
7 changes: 7 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

/**
* Do not modify the files in this folder.
*/

?>
57 changes: 37 additions & 20 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
=== Code Snippets ===
Contributors: bungeshea
Donate link: http://bungeshea.wordpress.com/donate/
Tags: snippets, code, php
Donate link: http://cs.bungeshea.com/donate/
Tags: snippets, code, php, plugins
Requires at least: 3.3
Tested up to: 3.4.1
Stable tag: 1.3
Stable tag: 1.3.2
License: GPLv3 or later
License URI: http://www.gnu.org/copyleft/gpl.html

Allows you to easily add code snippets through a GUI interface.
An easy, clean and simple way to add code snippets to your site.

== Description ==

**Code Snippets** is a easy, clean and simple way to add code snippets to your site.
**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!

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.
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.

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).
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.

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.
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.

Further information and screenshots are available on the [plugin homepage](http://bungeshea.wordpress.com/plugins/code-snippets).
Further information and screenshots are available on the [plugin homepage](http://cs.bungeshea.com).

Code Snippets was featured on WPMU: [WordPress Code Snippets: Keep them Organized with this Plugin!](http://wpmu.org/wordpress-code-snippets)
As featured on the WPMU blog: [WordPress Code Snippets: Keep them Organized with this Plugin!](http://wpmu.org/wordpress-code-snippets)

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) :-)

You can also contribute to the code at [GitHub](https://github.com/bungeshea/code-snippets).
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) :-)

== Installation ==

1. Download the `code-snippets.zip` file to your local machine.
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.
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.
3. Activate the plugin through the Plugins menu
4. Visit the **Add New Snippet** menu page *(Snippets > Add New)* to add or edit Snippets.
5. Activate your snippets through the Manage Snippets page *(Snippets > Manage Snippets)*
Expand All @@ -45,7 +43,7 @@ No, just copy all the content inside those tags.
Yes. Just add it but do not activate it yet.

= What do I use to write my snippets? =
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.
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.

= Will I lose my snippets if I change the theme or upgrade WordPress? =
No, the snippets are added to the WordPress database so are independent of the theme and unaffected by WordPress upgrades.
Expand All @@ -54,10 +52,10 @@ No, the snippets are added to the WordPress database so are independent of the t
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.

= Can I copy any snippets I've created to another WordPress site? =
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.
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.

= Can I run network-wide snippets on a multisite installation? =
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.
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.

= I have an idea for a cool feature for Code Snippets! =
That's great! Let me know by starting (or adding to) a topic in the [Support Forums](http://wordpress.org/support/plugin/code-snippets/).
Expand All @@ -71,6 +69,13 @@ That's great! Let me know by starting (or adding to) a topic in the [Support For

== Changelog ==

= 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
Expand All @@ -79,7 +84,7 @@ That's great! Let me know by starting (or adding to) a topic in the [Support For
* Minor improvements
* Added code highlighting
* Removed 'Uninstall Plugin' page
* Data will now be cleaned up when plugin is deleted through WordPress admin.
* 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
Expand All @@ -88,15 +93,27 @@ That's great! Let me know by starting (or adding to) a topic in the [Support For
= 1.0 =
* Stable version released.

== Other Notes ==

Plugin updates will be posted on the [plugin's homepage](http://cs.bungeshea.com) ([RSS](http://cs.bungehea.tk/feed/)).

* 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).
* Code Snippets will automatically clean up its data when deleted through the WordPress dashboard

You can also contribute to the code at [GitHub](https://github.com/bungeshea/code-snippets).

== Upgrade Notice ==

= 1.3.2 =
Check out Code Snippet's new website: http://cs.bungeshea.com

= 1.3 =
Added import/export feature

= 1.2 =
Minor improvments |
Minor improvements |
Added code highlighting |
Plugin data will now be cleaned up when you delete the plugin.

= 1.1 =
* Minor bug fixes and improvements on the the 'Edit Snippet' page
Minor bug fixes and improvements on the the 'Edit Snippet' page

0 comments on commit 917d610

Please sign in to comment.