Genesis Simple Hooks - Version 1.8.0.2

Version Description

  • Fixed yet another fatal error but for people using less than Genesis 1.8.0. It should now deactivate gracefully.
Download this release

Release Info

Developer nathanrice
Plugin Icon 128x128 Genesis Simple Hooks
Version 1.8.0.2
Comparing to
See all releases

Code changes from version 1.8.0.1 to 1.8.0.2

Files changed (2) hide show
  1. plugin.php +23 -15
  2. readme.txt +5 -2
plugin.php CHANGED
@@ -6,7 +6,7 @@
6
  Author: Nathan Rice
7
  Author URI: http://www.nathanrice.net/
8
 
9
- Version: 1.8.0.1
10
 
11
  License: GNU General Public License v2.0 (or later)
12
  License URI: http://www.opensource.org/licenses/gpl-license.php
@@ -18,27 +18,31 @@ define( 'SIMPLEHOOKS_PLUGIN_DIR', dirname( __FILE__ ) );
18
 
19
  register_activation_hook( __FILE__, 'simplehooks_activation' );
20
  /**
21
- * This function runs on plugin activation. It checks to make sure the required
22
- * minimum Genesis version is installed. If not, it deactivates itself.
23
  *
24
  * @since 0.1.0
25
  */
26
  function simplehooks_activation() {
27
 
28
- $latest = '1.8.0';
29
-
30
- $theme_info = get_theme_data( TEMPLATEPATH . '/style.css' );
31
-
32
- if ( 'genesis' != basename( TEMPLATEPATH ) ) {
33
- deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
34
- wp_die( sprintf( __( 'Sorry, you can\'t activate unless you have installed <a href="%s">Genesis</a>', 'simplehooks' ), 'http://www.studiopress.com/themes/genesis' ) );
35
- }
36
 
37
- if ( version_compare( $theme_info['Version'], $latest, '<' ) ) {
38
- deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
39
- wp_die( sprintf( __( 'Sorry, you cannot activate without <a href="%s">Genesis %s</a> or greater', 'simplehooks' ), 'http://www.studiopress.com/support/showthread.php?t=19576', $latest ) );
40
- }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
  add_action( 'genesis_init', 'simplehooks_init', 20 );
@@ -48,6 +52,10 @@ add_action( 'genesis_init', 'simplehooks_init', 20 );
48
  * @since 1.8.0
49
  */
50
  function simplehooks_init() {
 
 
 
 
51
 
52
  /** Admin Menu */
53
  if ( is_admin() )
6
  Author: Nathan Rice
7
  Author URI: http://www.nathanrice.net/
8
 
9
+ Version: 1.8.0.2
10
 
11
  License: GNU General Public License v2.0 (or later)
12
  License URI: http://www.opensource.org/licenses/gpl-license.php
18
 
19
  register_activation_hook( __FILE__, 'simplehooks_activation' );
20
  /**
21
+ * This function runs on plugin activation. It checks to make sure Genesis
22
+ * or a Genesis child theme is active. If not, it deactivates itself.
23
  *
24
  * @since 0.1.0
25
  */
26
  function simplehooks_activation() {
27
 
28
+ if ( 'genesis' != basename( TEMPLATEPATH ) ) {
29
+ simplehooks_deactivate( '1.8.0', '3.3' );
30
+ }
 
 
 
 
 
31
 
32
+ }
 
 
 
33
 
34
+ /**
35
+ * Deactivate Simple Hooks.
36
+ *
37
+ * This function deactivates Simple Hooks.
38
+ *
39
+ * @since 1.8.0.2
40
+ */
41
+ function simplehooks_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) {
42
+
43
+ deactivate_plugins( plugin_basename( __FILE__ ) );
44
+ wp_die( sprintf( __( 'Sorry, you cannot run Simple Hooks without WordPress %s and <a href="%s">Genesis %s</a>, or greater.', 'simplehooks' ), $wp_version, 'http://www.studiopress.com/support/showthread.php?t=19576', $genesis_version ) );
45
+
46
  }
47
 
48
  add_action( 'genesis_init', 'simplehooks_init', 20 );
52
  * @since 1.8.0
53
  */
54
  function simplehooks_init() {
55
+
56
+ /** Deactivate if not running Genesis 1.8.0 or greater */
57
+ if ( ! class_exists( 'Genesis_Admin_Boxes' ) )
58
+ add_action( 'admin_init', 'simplehooks_deactivate', 10, 0 );
59
 
60
  /** Admin Menu */
61
  if ( is_admin() )
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: hooks, genesis, genesiswp, studiopress
5
  Requires at least: 3.3
6
  Tested up to: 3.3.1
7
- Stable tag: 1.8.0.1
8
 
9
  This plugin creates a new Genesis settings page that allows you to insert code (HTML, Shortcodes, and PHP), and attach it to any of the 50+ action hooks throughout the Genesis Theme Framework, from StudioPress.
10
 
@@ -114,4 +114,7 @@ The most common request from Genesis users is how to properly modify their foote
114
  * Switched over to the Genesis 1.8 admin menu class to build admin menu.
115
 
116
  = 1.8.0.1 =
117
- * Removed an unnecessary version compare check that was causing some fatal errors.
 
 
 
4
  Tags: hooks, genesis, genesiswp, studiopress
5
  Requires at least: 3.3
6
  Tested up to: 3.3.1
7
+ Stable tag: 1.8.0.2
8
 
9
  This plugin creates a new Genesis settings page that allows you to insert code (HTML, Shortcodes, and PHP), and attach it to any of the 50+ action hooks throughout the Genesis Theme Framework, from StudioPress.
10
 
114
  * Switched over to the Genesis 1.8 admin menu class to build admin menu.
115
 
116
  = 1.8.0.1 =
117
+ * Removed an unnecessary version compare check that was causing some fatal errors.
118
+
119
+ = 1.8.0.2 =
120
+ * Fixed yet another fatal error but for people using less than Genesis 1.8.0. It should now deactivate gracefully.