Completed
Push — develop ( 19c9ba...5682c6 )
by Zack
38:51 queued 18:51
created

gravityview.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Plugin Name:       	GravityView
4
 * Plugin URI:        	https://gravityview.co
5
 * Description:       	The best, easiest way to display Gravity Forms entries on your website.
6
 * Version:             2.9.2.1
7
 * Author:            	GravityView
8
 * Author URI:        	https://gravityview.co
9
 * Text Domain:       	gravityview
10
 * License:           	GPLv2 or later
11
 * License URI: 		http://www.gnu.org/licenses/gpl-2.0.html
12
 * Domain Path:			/languages
13
 */
14
15
/** If this file is called directly, abort. */
16
if ( ! defined( 'ABSPATH' ) ) {
17
	die;
18
}
19
20
/** Constants */
21
22
/**
23
 * The plugin version.
24
 */
25
define( 'GV_PLUGIN_VERSION', '2.9.2.1' );
26
27
/**
28
 * Full path to the GravityView file
29
 * @define "GRAVITYVIEW_FILE" "./gravityview.php"
30
 */
31
define( 'GRAVITYVIEW_FILE', __FILE__ );
32
33
/**
34
 * The URL to this file, with trailing slash
35
 */
36
define( 'GRAVITYVIEW_URL', plugin_dir_url( __FILE__ ) );
37
38
39
/** @define "GRAVITYVIEW_DIR" "./" The absolute path to the plugin directory, with trailing slash */
40
define( 'GRAVITYVIEW_DIR', plugin_dir_path( __FILE__ ) );
41
42
/**
43
 * GravityView requires at least this version of Gravity Forms to function properly.
44
 */
45
define( 'GV_MIN_GF_VERSION', '2.3' );
46
47
/**
48
 * GravityView requires at least this version of WordPress to function properly.
49
 * @since 1.12
50
 */
51
define( 'GV_MIN_WP_VERSION', '4.7.0' );
52
53
/**
54
 * GravityView requires at least this version of PHP to function properly.
55
 * @since 1.12
56
 */
57
define( 'GV_MIN_PHP_VERSION', '5.3.0' );
58
59
/**
60
 * GravityView will require this version of PHP soon. False if no future PHP version changes are planned.
61
 * @since 1.19.2
62
 * @var string|false
63
 */
64
define( 'GV_FUTURE_MIN_PHP_VERSION', '5.6.20' );
65
66
/**
67
 * GravityView will soon require at least this version of Gravity Forms to function properly.
68
 * @since 1.19.4
69
 */
70
define( 'GV_FUTURE_MIN_GF_VERSION', '2.4' );
71
72
/**
73
 * The future is here and now.
74
 */
75
require GRAVITYVIEW_DIR . 'future/loader.php';
76
77
/**
78
 * GravityView_Plugin main class.
79
 *
80
 * @deprecated see `gravityview()->plugin` and `\GV\Plugin`
81
 */
82
final class GravityView_Plugin {
83
84
	/**
85
	 * @deprecated Use \GV\Plugin::$version
86
	 */
87
	const version = GV_PLUGIN_VERSION;
88
89
	private static $instance;
90
91
	/**
92
	 * Singleton instance
93
	 *
94
	 * @deprecated See \GV\Plugin
95
	 *
96
	 * @return GravityView_Plugin GravityView_Plugin object
97
	 */
98
	public static function getInstance() {
99
		if ( empty( self::$instance ) ) {
100
			self::$instance = new self;
0 ignored issues
show
Deprecated Code introduced by
The class GravityView_Plugin has been deprecated with message: see `gravityview()->plugin` and `\GV\Plugin`

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
101
		}
102
103
		return self::$instance;
104
	}
105
106
	/**
107
	 * @deprecated See \GV\Plugin
108
	 */
109
	private function __construct() {
110
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
111
	}
112
113
	/**
114
	 * Include global plugin files
115
	 *
116
	 * @deprecated Use gravityview()->plugin->include_legacy_core
117
	 *
118
	 * @since 1.12
119
	 */
120
	public function include_files() {
121
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
122
		gravityview()->plugin->include_legacy_core();
123
	}
124
125
	/**
126
	 * Check whether GravityView is network activated
127
	 *
128
	 * @deprecated See \GV\Plugin
129
	 *
130
	 * @since 1.7.6
131
	 * @return bool
132
	 */
133
	public static function is_network_activated() {
134
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
135
		return gravityview()->plugin->is_network_activated();
136
	}
137
138
139
	/**
140
	 * Plugin activate function.
141
	 *
142
	 * @static
143
	 * @return void
144
	 */
145
	public static function activate() {
146
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
147
	}
148
149
150
	/**
151
	 * Plugin deactivate function.
152
	 *
153
	 * @deprecated see \GV\Plugin::deactivate()
154
	 * @return void
155
	 */
156
	public static function deactivate() {
157
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
158
	}
159
160
	/**
161
	 * Include the extension class
162
	 *
163
	 * @deprecated The extension framework is included by default now.
164
	 *
165
	 * @since 1.5.1
166
	 * @return void
167
	 */
168
	public static function include_extension_framework() {
169
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
170
	}
171
172
	/**
173
	 * Load GravityView_Widget class
174
	 *
175
	 * @deprecated The widget class is loaded elsewhere in legacy core.
176
	 *
177
	 * @since 1.7.5.1
178
	 */
179
	public static function include_widget_class() {
180
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
181
	}
182
183
184
	/**
185
	 * Loads the plugin's translated strings.
186
	 *
187
	 * @deprecated Use \GV\Plugin::load_textdomain()
188
	 *
189
	 * @return void
190
	 */
191
	public function load_plugin_textdomain() {
192
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
193
		gravityview()->plugin->load_textdomain();
194
	}
195
196
	/**
197
	 * Check if is_admin(), and make sure not DOING_AJAX
198
	 * @since 1.7.5
199
	 * @deprecated
200
	 * @see \GV\Frontend_Request::is_admin via gravityview()->request->is_admin()
201
	 * @return bool
202
	 */
203
	public static function is_admin() {
204
		gravityview()->log->notice( '\GravityView_Plugin::is_admin() is deprecated. Use \GV\Request::is_admin() instead.' );
205
		return gravityview()->request->is_admin();
206
	}
207
208
	/**
209
	 * Function to launch frontend objects
210
	 *
211
	 * @since 1.17 Added $force param
212
	 *
213
	 *
214
	 * @param bool $force Whether to force loading
215
	 *
216
	 * @return void
217
	 */
218
	public function frontend_actions( $force = false ) {
219
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
220
		gravityview()->plugin->include_legacy_frontend( $force );
221
	}
222
223
	/**
224
	 * Helper function to define the default widget areas.
225
	 *
226
	 * @deprecated Moved to GravityView_Widget::get_default_widget_areas()
227
	 *
228
	 * @return array definition for default widget areas
229
	 */
230
	public static function get_default_widget_areas() {
231
		return GravityView_Widget::get_default_widget_areas();
232
	}
233
234
	/** DEBUG */
235
236
    /**
237
     * Logs messages using Gravity Forms logging add-on
238
     * @param  string $message log message
239
     * @param mixed $data Additional data to display
240
	 * @deprecated use gravityview()->log
241
     * @return void
242
     */
243
    public static function log_debug( $message, $data = null ){
244
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
245
		gravityview()->log->debug( $message, $data );
246
    }
247
248
    /**
249
     * Logs messages using Gravity Forms logging add-on
250
     * @param  string $message log message
251
	 * @deprecated use gravityview()->log
252
     * @return void
253
     */
254
    public static function log_error( $message, $data = null ){
255
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
256
		gravityview()->log->error( $message, $data );
257
    }
258
} // end class GravityView_Plugin
259