Completed
Push — issues/1132 ( f564f5...7c321a )
by Ravinder
71:42 queued 51:48
created

Give   B

Complexity

Total Complexity 24

Size/Duplication

Total Lines 493
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 16

Importance

Changes 0
Metric Value
dl 0
loc 493
rs 8.4614
c 0
b 0
f 0
wmc 24
lcom 2
cbo 16

9 Methods

Rating   Name   Duplication   Size   Complexity  
A instance() 0 7 2
A __construct() 0 7 1
A init_hooks() 0 4 1
B init() 0 39 1
A __clone() 0 4 1
A __wakeup() 0 4 1
D setup_constants() 0 37 8
B includes() 0 131 6
A load_textdomain() 0 15 3
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 53 and the first side effect is on line 43.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Plugin Name: Give - Donation Plugin
4
 * Plugin URI: https://givewp.com
5
 * Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
6
 * Author: WordImpress
7
 * Author URI: https://wordimpress.com
8
 * Version: 2.0.0
9
 * Text Domain: give
10
 * Domain Path: /languages
11
 * GitHub Plugin URI: https://github.com/WordImpress/Give
12
 *
13
 * Give is free software: you can redistribute it and/or modify
14
 * it under the terms of the GNU General Public License as published by
15
 * the Free Software Foundation, either version 3 of the License, or
16
 * any later version.
17
 *
18
 * Give is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with Give. If not, see <https://www.gnu.org/licenses/>.
25
 *
26
 * A Tribute to Open Source:
27
 *
28
 * "Open source software is software that can be freely used, changed, and shared (in modified or unmodified form) by anyone. Open
29
 * source software is made by many people, and distributed under licenses that comply with the Open Source Definition."
30
 *
31
 * -- The Open Source Initiative
32
 *
33
 * Give is a tribute to the spirit and philosophy of Open Source. We at WordImpress gladly embrace the Open Source philosophy both
34
 * in how Give itself was developed, and how we hope to see others build more from our code base.
35
 *
36
 * Give would not have been possible without the tireless efforts of WordPress and the surrounding Open Source projects and their talented developers. Thank you all for your contribution to WordPress.
37
 *
38
 * - The WordImpress Team
39
 */
40
41
// Exit if accessed directly.
42
if ( ! defined( 'ABSPATH' ) ) {
43
	exit;
44
}
45
46
if ( ! class_exists( 'Give' ) ) :
47
48
	/**
49
	 * Main Give Class
50
	 *
51
	 * @since 1.0
52
	 */
53
	final class Give {
54
55
		/** Singleton *************************************************************/
56
57
		/**
58
		 * Give Instance
59
		 *
60
		 * @since  1.0
61
		 * @access private
62
		 *
63
		 * @var    Give() The one true Give
64
		 */
65
		protected static $_instance;
66
67
		/**
68
		 * Give Roles Object
69
		 *
70
		 * @since  1.0
71
		 * @access public
72
		 *
73
		 * @var    Give_Roles object
74
		 */
75
		public $roles;
76
77
		/**
78
		 * Give Settings Object
79
		 *
80
		 * @since  1.0
81
		 * @access public
82
		 *
83
		 * @var    Give_Plugin_Settings object
84
		 */
85
		public $give_settings;
86
87
		/**
88
		 * Give Session Object
89
		 *
90
		 * This holds donation data for user's session.
91
		 *
92
		 * @since  1.0
93
		 * @access public
94
		 *
95
		 * @var    Give_Session object
96
		 */
97
		public $session;
98
99
		/**
100
		 * Give HTML Element Helper Object
101
		 *
102
		 * @since  1.0
103
		 * @access public
104
		 *
105
		 * @var    Give_HTML_Elements object
106
		 */
107
		public $html;
108
109
		/**
110
		 * Give Emails Object
111
		 *
112
		 * @since  1.0
113
		 * @access public
114
		 *
115
		 * @var    Give_Emails object
116
		 */
117
		public $emails;
118
119
		/**
120
		 * Give Email Template Tags Object
121
		 *
122
		 * @since  1.0
123
		 * @access public
124
		 *
125
		 * @var    Give_Email_Template_Tags object
126
		 */
127
		public $email_tags;
128
129
		/**
130
		 * Give Donors DB Object
131
		 *
132
		 * @since  1.0
133
		 * @access public
134
		 *
135
		 * @var    Give_DB_Donors object
136
		 */
137
		public $donors;
138
139
		/**
140
		 * Give Donor meta DB Object
141
		 *
142
		 * @since  1.6
143
		 * @access public
144
		 *
145
		 * @var    Give_DB_Donor_Meta object
146
		 */
147
		public $donor_meta;
148
149
		/**
150
		 * Give API Object
151
		 *
152
		 * @since  1.0
153
		 * @access public
154
		 *
155
		 * @var    Give_API object
156
		 */
157
		public $api;
158
159
		/**
160
		 * Give Template Loader Object
161
		 *
162
		 * @since  1.0
163
		 * @access public
164
		 *
165
		 * @var    Give_Template_Loader object
166
		 */
167
		public $template_loader;
168
169
		/**
170
		 * Give No Login Object
171
		 *
172
		 * @since  1.0
173
		 * @access public
174
		 *
175
		 * @var    Give_Email_Access object
176
		 */
177
		public $email_access;
178
179
		/**
180
		 * Give_tooltips Object
181
		 *
182
		 * @since  2.0
183
		 * @access public
184
		 *
185
		 * @var    Give_Tooltips object
186
		 */
187
		public $tooltips;
188
189
		/**
190
		 * Give notices Object
191
		 *
192
		 * @var    Give_Notices $notices
193
		 */
194
		public $notices;
195
196
197
		/**
198
		 * Give logging Object
199
		 *
200
		 * @var    Give_Logging $logs
201
		 */
202
		public $logs;
203
204
		/**
205
		 * Give payment meta Object
206
		 *
207
		 * @var    Give_DB_Payment_Meta $notices
208
		 */
209
		public $payment_meta;
210
211
		/**
212
		 * Give form meta Object
213
		 *
214
		 * @var    Give_DB_form_Meta $notices
215
		 */
216
		public $form_meta;
217
218
		/**
219
		 * Main Give Instance
220
		 *
221
		 * Ensures that only one instance of Give exists in memory at any one
222
		 * time. Also prevents needing to define globals all over the place.
223
		 *
224
		 * @since     1.0
225
		 * @access    public
226
		 *
227
		 * @static
228
		 * @see       Give()
229
		 *
230
		 * @return    Give
231
		 */
232
		public static function instance() {
233
			if ( is_null( self::$_instance ) ) {
234
				self::$_instance = new self();
235
			}
236
237
			return self::$_instance;
238
		}
239
240
		/**
241
		 * Give Constructor.
242
		 */
243
		public function __construct() {
244
			$this->setup_constants();
245
			$this->includes();
246
			$this->init_hooks();
247
248
			do_action( 'give_loaded' );
249
		}
250
251
		/**
252
		 * Hook into actions and filters.
253
		 *
254
		 * @since  1.8.9
255
		 */
256
		private function init_hooks() {
257
			register_activation_hook( __FILE__, 'give_install' );
258
			add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
259
		}
260
261
		/**
262
		 * Init Give when WordPress Initializes.
263
		 *
264
		 * @since 1.8.9
265
		 */
266
		public function init() {
267
268
			/**
269
			 * Fires before the Give core is initialized.
270
			 *
271
			 * @since 1.8.9
272
			 */
273
			do_action( 'before_give_init' );
274
275
			// Set up localization.
276
			$this->load_textdomain();
277
278
			$this->roles           = new Give_Roles();
279
			$this->api             = new Give_API();
280
			$this->give_settings   = new Give_Admin_Settings();
281
			$this->session         = new Give_Session();
282
			$this->html            = new Give_HTML_Elements();
283
			$this->emails          = new Give_Emails();
284
			$this->email_tags      = new Give_Email_Template_Tags();
285
			$this->donors          = new Give_DB_Donors();
286
			$this->donor_meta      = new Give_DB_Donor_Meta();
287
			$this->template_loader = new Give_Template_Loader();
288
			$this->email_access    = new Give_Email_Access();
289
			$this->tooltips        = new Give_Tooltips();
290
			$this->notices         = new Give_Notices();
291
			$this->payment_meta    = new Give_DB_Payment_Meta();
292
			$this->logs            = new Give_Logging();
293
			$this->form_meta       = new Give_DB_Form_Meta();
294
295
			/**
296
			 * Fire the action after Give core loads.
297
			 *
298
			 * @param class Give class instance.
299
			 *
300
			 * @since 1.8.7
301
			 */
302
			do_action( 'give_init', $this );
303
304
		}
305
306
		/**
307
		 * Throw error on object clone
308
		 *
309
		 * The whole idea of the singleton design pattern is that there is a single
310
		 * object, therefore we don't want the object to be cloned.
311
		 *
312
		 * @since  1.0
313
		 * @access protected
314
		 *
315
		 * @return void
316
		 */
317
		public function __clone() {
318
			// Cloning instances of the class is forbidden.
319
			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
320
		}
321
322
		/**
323
		 * Disable unserializing of the class
324
		 *
325
		 * @since  1.0
326
		 * @access protected
327
		 *
328
		 * @return void
329
		 */
330
		public function __wakeup() {
331
			// Unserializing instances of the class is forbidden.
332
			_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
333
		}
334
335
		/**
336
		 * Setup plugin constants
337
		 *
338
		 * @since  1.0
339
		 * @access private
340
		 *
341
		 * @return void
342
		 */
343
		private function setup_constants() {
344
345
			// Plugin version
346
			if ( ! defined( 'GIVE_VERSION' ) ) {
347
				define( 'GIVE_VERSION', '2.0.0' );
348
			}
349
350
			// Plugin Folder Path
351
			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
352
				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
353
			}
354
355
			// Plugin Folder URL
356
			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
357
				define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
358
			}
359
360
			// Plugin Basename aka: "give/give.php"
361
			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
362
				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
363
			}
364
365
			// Plugin Root File
366
			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
367
				define( 'GIVE_PLUGIN_FILE', __FILE__ );
368
			}
369
370
			// Make sure CAL_GREGORIAN is defined
371
			if ( ! defined( 'CAL_GREGORIAN' ) ) {
372
				define( 'CAL_GREGORIAN', 1 );
373
			}
374
375
			// PHP version
376
			if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
377
				define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
378
			}
379
		}
380
381
		/**
382
		 * Include required files
383
		 *
384
		 * @since  1.0
385
		 * @access private
386
		 *
387
		 * @return void
388
		 */
389
		private function includes() {
390
			global $give_options;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
391
392
			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
393
			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
394
			$give_options = give_get_settings();
395
396
			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
397
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
398
			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
399
			require_once GIVE_PLUGIN_DIR . 'includes/scripts.php';
400
			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
401
			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
402
			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
403
			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
404
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
405
			require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
406
407
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
408
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
409
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
410
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
411
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
412
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
413
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
414
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
415
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
416
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
417
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
418
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
419
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
420
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
421
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
422
423
			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
424
			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
425
			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
426
			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
427
			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
428
			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
429
			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
430
			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
431
			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
432
			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
433
			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
434
			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
435
			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
436
			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
437
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
438
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
439
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
440
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
441
442
			require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
443
			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
444
			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
445
			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
446
			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
447
			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
448
449
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
450
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
451
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
452
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
453
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
454
455
			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
456
			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
457
			require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
458
			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
459
			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
460
			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
461
462
			if ( defined( 'WP_CLI' ) && WP_CLI ) {
463
				require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
464
			}
465
466
			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
467
468
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
469
				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
470
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
471
				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
472
				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
473
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
474
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
475
				require_once GIVE_PLUGIN_DIR . 'includes/admin/system-info.php';
476
				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
477
				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
478
				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
479
480
				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
481
				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
482
483
				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
484
				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
485
				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
486
487
				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
488
				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
489
				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
490
491
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
492
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
493
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
494
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
495
496
				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/reports.php';
497
				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-give-graph.php';
498
				require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/graphing.php';
499
500
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
501
502
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
503
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
504
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
505
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
506
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
507
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
508
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
509
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
510
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
511
512
				require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
513
				require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php';
514
515
			}// End if().
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
516
517
			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
518
519
		}
520
521
		/**
522
		 * Loads the plugin language files.
523
		 *
524
		 * @since  1.0
525
		 * @access public
526
		 *
527
		 * @return void
528
		 */
529
		public function load_textdomain() {
530
531
			// Set filter for Give's languages directory
532
			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
533
			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
534
535
			// Traditional WordPress plugin locale filter.
536
			$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
537
			$locale = apply_filters( 'plugin_locale', $locale, 'give' );
538
539
			unload_textdomain( 'give' );
540
			load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
541
			load_plugin_textdomain( 'give', false, $give_lang_dir );
542
543
		}
544
545
	}
546
547
endif; // End if class_exists check
548
549
550
/**
551
 * Start Give
552
 *
553
 * The main function responsible for returning the one true Give instance to functions everywhere.
554
 *
555
 * Use this function like you would a global variable, except without needing
556
 * to declare the global.
557
 *
558
 * Example: <?php $give = Give(); ?>
559
 *
560
 * @since 1.0
561
 * @return object|Give
562
 */
563
function Give() {
564
	return Give::instance();
565
}
566
567
Give();
568