|
3 | 3 | Plugin Name: Gravity Forms CLI |
4 | 4 | Plugin URI: https://gravityforms.com |
5 | 5 | Description: Manage Gravity Forms with the WP CLI. |
6 | | -Version: 1.4 |
| 6 | +Version: 1.5 |
7 | 7 | Author: Rocketgenius |
8 | 8 | Author URI: https://gravityforms.com |
9 | 9 | License: GPL-2.0+ |
|
27 | 27 | along with this program. If not, see http://www.gnu.org/licenses. |
28 | 28 | */ |
29 | 29 |
|
30 | | -defined( 'ABSPATH' ) || die(); |
| 30 | +defined( 'ABSPATH' ) || defined( 'WP_CLI' ) || die(); |
31 | 31 |
|
32 | 32 | // Defines the current version of the CLI add-on |
33 | | -define( 'GF_CLI_VERSION', '1.4' ); |
| 33 | +define( 'GF_CLI_VERSION', '1.5' ); |
34 | 34 |
|
35 | 35 | define( 'GF_CLI_MIN_GF_VERSION', '1.9.17.8' ); |
36 | 36 |
|
37 | | -add_action( 'init', array( 'GF_CLI_Bootstrap', 'load_cli' ), 1 ); |
38 | | - |
39 | 37 | // After GF is loaded, load the CLI add-on |
40 | | -add_action( 'gform_loaded', array( 'GF_CLI_Bootstrap', 'load_addon' ), 1 ); |
| 38 | +defined( 'ABSPATH' ) && add_action( 'gform_loaded', array( 'GF_CLI_Bootstrap', 'load_addon' ), 1 ); |
41 | 39 |
|
42 | 40 |
|
43 | 41 |
|
@@ -71,7 +69,7 @@ public static function load_cli() { |
71 | 69 | if ( defined( 'WP_CLI' ) && WP_CLI ) { |
72 | 70 |
|
73 | 71 | // Checks for files within the includes directory, and includes them. |
74 | | - foreach ( glob( plugin_dir_path( __FILE__ ) . 'includes/*.php' ) as $filename ) { |
| 72 | + foreach ( glob( dirname( __FILE__ ) . '/includes/*.php' ) as $filename ) { |
75 | 73 | require_once( $filename ); |
76 | 74 | } |
77 | 75 | $command_args = array( 'before_invoke' => array( 'GF_CLI_Bootstrap', 'before_invoke' ) ); |
@@ -101,6 +99,8 @@ public static function before_invoke() { |
101 | 99 | } |
102 | 100 | } |
103 | 101 |
|
| 102 | +GF_CLI_Bootstrap::load_cli(); |
| 103 | + |
104 | 104 | /** |
105 | 105 | * Returns an instance of the GF_CLI class |
106 | 106 | * |
|
0 commit comments