Completed
Pull Request — develop (#1577)
by Zack
18:22
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.10
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.10' );
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
 * GravityView will soon require at least this version of WordPress to function properly.
74
 * @since 2.9.3
75
 */
76
define( 'GV_FUTURE_MIN_WP_VERSION', '4.9.16' );
77
78
/**
79
 * The future is here and now.
80
 */
81
require GRAVITYVIEW_DIR . 'future/loader.php';
82
83
/**
84
 * GravityView_Plugin main class.
85
 *
86
 * @deprecated see `gravityview()->plugin` and `\GV\Plugin`
87
 */
88
final class GravityView_Plugin {
89
90
	/**
91
	 * @deprecated Use \GV\Plugin::$version
92
	 */
93
	const version = GV_PLUGIN_VERSION;
94
95
	private static $instance;
96
97
	/**
98
	 * Singleton instance
99
	 *
100
	 * @deprecated See \GV\Plugin
101
	 *
102
	 * @return GravityView_Plugin GravityView_Plugin object
103
	 */
104
	public static function getInstance() {
105
		if ( empty( self::$instance ) ) {
106
			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...
107
		}
108
109
		return self::$instance;
110
	}
111
112
	/**
113
	 * @deprecated See \GV\Plugin
114
	 */
115
	private function __construct() {
116
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
117
	}
118
119
	/**
120
	 * Include global plugin files
121
	 *
122
	 * @deprecated Use gravityview()->plugin->include_legacy_core
123
	 *
124
	 * @since 1.12
125
	 */
126
	public function include_files() {
127
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
128
		gravityview()->plugin->include_legacy_core();
129
	}
130
131
	/**
132
	 * Check whether GravityView is network activated
133
	 *
134
	 * @deprecated See \GV\Plugin
135
	 *
136
	 * @since 1.7.6
137
	 * @return bool
138
	 */
139
	public static function is_network_activated() {
140
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
141
		return gravityview()->plugin->is_network_activated();
142
	}
143
144
145
	/**
146
	 * Plugin activate function.
147
	 *
148
	 * @static
149
	 * @return void
150
	 */
151
	public static function activate() {
152
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
153
	}
154
155
156
	/**
157
	 * Plugin deactivate function.
158
	 *
159
	 * @deprecated see \GV\Plugin::deactivate()
160
	 * @return void
161
	 */
162
	public static function deactivate() {
163
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
164
	}
165
166
	/**
167
	 * Include the extension class
168
	 *
169
	 * @deprecated The extension framework is included by default now.
170
	 *
171
	 * @since 1.5.1
172
	 * @return void
173
	 */
174
	public static function include_extension_framework() {
175
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
176
	}
177
178
	/**
179
	 * Load GravityView_Widget class
180
	 *
181
	 * @deprecated The widget class is loaded elsewhere in legacy core.
182
	 *
183
	 * @since 1.7.5.1
184
	 */
185
	public static function include_widget_class() {
186
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
187
	}
188
189
190
	/**
191
	 * Loads the plugin's translated strings.
192
	 *
193
	 * @deprecated Use \GV\Plugin::load_textdomain()
194
	 *
195
	 * @return void
196
	 */
197
	public function load_plugin_textdomain() {
198
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
199
		gravityview()->plugin->load_textdomain();
200
	}
201
202
	/**
203
	 * Check if is_admin(), and make sure not DOING_AJAX
204
	 * @since 1.7.5
205
	 * @deprecated
206
	 * @see \GV\Frontend_Request::is_admin via gravityview()->request->is_admin()
207
	 * @return bool
208
	 */
209
	public static function is_admin() {
210
		gravityview()->log->notice( '\GravityView_Plugin::is_admin() is deprecated. Use \GV\Request::is_admin() instead.' );
211
		return gravityview()->request->is_admin();
212
	}
213
214
	/**
215
	 * Function to launch frontend objects
216
	 *
217
	 * @since 1.17 Added $force param
218
	 *
219
	 *
220
	 * @param bool $force Whether to force loading
221
	 *
222
	 * @return void
223
	 */
224
	public function frontend_actions( $force = false ) {
225
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
226
		gravityview()->plugin->include_legacy_frontend( $force );
227
	}
228
229
	/**
230
	 * Helper function to define the default widget areas.
231
	 *
232
	 * @deprecated Moved to GravityView_Widget::get_default_widget_areas()
233
	 *
234
	 * @return array definition for default widget areas
235
	 */
236
	public static function get_default_widget_areas() {
237
		return GravityView_Widget::get_default_widget_areas();
238
	}
239
240
	/** DEBUG */
241
242
    /**
243
     * Logs messages using Gravity Forms logging add-on
244
     * @param  string $message log message
245
     * @param mixed $data Additional data to display
246
	 * @deprecated use gravityview()->log
247
     * @return void
248
     */
249
    public static function log_debug( $message, $data = null ){
250
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
251
		gravityview()->log->debug( $message, $data );
252
    }
253
254
    /**
255
     * Logs messages using Gravity Forms logging add-on
256
     * @param  string $message log message
257
	 * @deprecated use gravityview()->log
258
     * @return void
259
     */
260
    public static function log_error( $message, $data = null ){
261
		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
262
		gravityview()->log->error( $message, $data );
263
    }
264
} // end class GravityView_Plugin
265