Issues (4296)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

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: 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.2.5
9
 * Text Domain: give
10
 * Domain Path: /languages
11
 *
12
 * Give is free software: you can redistribute it and/or modify
13
 * it under the terms of the GNU General Public License as published by
14
 * the Free Software Foundation, either version 3 of the License, or
15
 * any later version.
16
 *
17
 * Give is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
 * GNU General Public License for more details.
21
 *
22
 * You should have received a copy of the GNU General Public License
23
 * along with Give. If not, see <https://www.gnu.org/licenses/>.
24
 *
25
 * A Tribute to Open Source:
26
 *
27
 * "Open source software is software that can be freely used, changed, and shared (in modified or unmodified form) by anyone. Open
28
 * source software is made by many people, and distributed under licenses that comply with the Open Source Definition."
29
 *
30
 * -- The Open Source Initiative
31
 *
32
 * Give is a tribute to the spirit and philosophy of Open Source. We at WordImpress gladly embrace the Open Source philosophy both
33
 * in how Give itself was developed, and how we hope to see others build more from our code base.
34
 *
35
 * 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.
36
 *
37
 * - The WordImpress Team
38
 */
39
40
// Exit if accessed directly.
41
if ( ! defined( 'ABSPATH' ) ) {
42
	exit;
43
}
44
45
if ( ! class_exists( 'Give' ) ) :
46
47
	/**
48
	 * Main Give Class
49
	 *
50
	 * @since 1.0
51
	 */
52
	final class Give {
53
54
		/** Singleton *************************************************************/
55
56
		/**
57
		 * Give Instance
58
		 *
59
		 * @since  1.0
60
		 * @access private
61
		 *
62
		 * @var    Give() The one true Give
63
		 */
64
		protected static $_instance;
65
66
		/**
67
		 * Give Roles Object
68
		 *
69
		 * @since  1.0
70
		 * @access public
71
		 *
72
		 * @var    Give_Roles object
73
		 */
74
		public $roles;
75
76
		/**
77
		 * Give Settings Object
78
		 *
79
		 * @since  1.0
80
		 * @access public
81
		 *
82
		 * @var    Give_Admin_Settings object
83
		 */
84
		public $give_settings;
85
86
		/**
87
		 * Give Session Object
88
		 *
89
		 * This holds donation data for user's session.
90
		 *
91
		 * @since  1.0
92
		 * @access public
93
		 *
94
		 * @var    Give_Session object
95
		 */
96
		public $session;
97
98
		/**
99
		 * Give Session DB Object
100
		 *
101
		 * This holds donation data for user's session.
102
		 *
103
		 * @since  1.0
104
		 * @access public
105
		 *
106
		 * @var    Give_DB_Sessions object
107
		 */
108
		public $session_db;
109
110
		/**
111
		 * Give HTML Element Helper Object
112
		 *
113
		 * @since  1.0
114
		 * @access public
115
		 *
116
		 * @var    Give_HTML_Elements object
117
		 */
118
		public $html;
119
120
		/**
121
		 * Give Emails Object
122
		 *
123
		 * @since  1.0
124
		 * @access public
125
		 *
126
		 * @var    Give_Emails object
127
		 */
128
		public $emails;
129
130
		/**
131
		 * Give Email Template Tags Object
132
		 *
133
		 * @since  1.0
134
		 * @access public
135
		 *
136
		 * @var    Give_Email_Template_Tags object
137
		 */
138
		public $email_tags;
139
140
		/**
141
		 * Give Donors DB Object
142
		 *
143
		 * @since  1.0
144
		 * @access public
145
		 *
146
		 * @var    Give_DB_Donors object
147
		 */
148
		public $donors;
149
150
		/**
151
		 * Give Donor meta DB Object
152
		 *
153
		 * @since  1.6
154
		 * @access public
155
		 *
156
		 * @var    Give_DB_Donor_Meta object
157
		 */
158
		public $donor_meta;
159
160
		/**
161 60
		 * Give Sequential Donation DB Object
162 60
		 *
163
		 * @since  2.1.0
164
		 * @access public
165
		 *
166
		 * @var    Give_DB_Sequential_Ordering object
167
		 */
168
		public $sequential_donation_db;
169
170
		/**
171
		 * Give API Object
172
		 *
173
		 * @since  1.0
174
		 * @access public
175
		 *
176
		 * @var    Give_API object
177
		 */
178
		public $api;
179
180
		/**
181
		 * Give Template Loader Object
182
		 *
183 60
		 * @since  1.0
184
		 * @access public
185
		 *
186
		 * @var    Give_Template_Loader object
187
		 */
188
		public $template_loader;
189
190
		/**
191
		 * Give No Login Object
192
		 *
193
		 * @since  1.0
194
		 * @access public
195
		 *
196
		 * @var    Give_Email_Access object
197
		 */
198
		public $email_access;
199
200
		/**
201
		 * Give_tooltips Object
202
		 *
203
		 * @since  1.8.9
204
		 * @access public
205
		 *
206
		 * @var    Give_Tooltips object
207
		 */
208
		public $tooltips;
209
210
		/**
211
		 * Give notices Object
212
		 *
213
		 * @var    Give_Notices $notices
214
		 */
215
		public $notices;
216
217
218
		/**
219
		 * Give logging Object
220
		 *
221
		 * @var    Give_Logging $logs
222
		 */
223
		public $logs;
224
225
		/**
226
		 * Give payment Object
227
		 *
228
		 * @var    Give_DB_Payment_Meta $payment_meta
229
		 */
230
		public $payment_meta;
231
232
		/**
233
		 * Give form Object
234
		 *
235
		 * @var    Give_DB_Form_Meta $form_meta
236
		 */
237
		public $form_meta;
238
239
		/**
240
		 * Give form Object
241
		 *
242
		 * @var    Give_Async_Process $async_process
243
		 */
244
		public $async_process;
245
246
		/**
247
		 * Give scripts Object.
248
		 *
249
		 * @var Give_Scripts
250
		 */
251
		public $scripts;
252
253
		/**
254
		 * Give_Seq_Donation_Number Object.
255
		 *
256
		 * @var Give_Sequential_Donation_Number
257
		 */
258
		public $seq_donation_number;
259
260
		/**
261
		 * Give_Comment Object
262
		 *
263
		 * @var Give_Comment
264
		 */
265
		public $comment;
266
267
		/**
268
		 * Main Give Instance
269
		 *
270
		 * Ensures that only one instance of Give exists in memory at any one
271
		 * time. Also prevents needing to define globals all over the place.
272
		 *
273
		 * @since     1.0
274
		 * @access    public
275
		 *
276
		 * @static
277
		 * @see       Give()
278
		 *
279
		 * @return    Give
280
		 */
281
		public static function instance() {
282
			if ( is_null( self::$_instance ) ) {
283
				self::$_instance = new self();
284
			}
285
286
			return self::$_instance;
287
		}
288
289
		/**
290
		 * Give Constructor.
291
		 */
292
		public function __construct() {
293
			// PHP version
294
			if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
295
				define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
296
			}
297
298
			// Bailout: Need minimum php version to load plugin.
299
			if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
300
				add_action( 'admin_notices', array( $this, 'minimum_phpversion_notice' ) );
301
302
				return;
303
			}
304
305
			$this->setup_constants();
306
			$this->includes();
307
			$this->init_hooks();
308
309
			do_action( 'give_loaded' );
310
		}
311
312
		/**
313
		 * Hook into actions and filters.
314
		 *
315
		 * @since  1.8.9
316
		 */
317
		private function init_hooks() {
318
			register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
319
			add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
320
321
			// Set up localization on init Hook.
322
			add_action( 'init', array( $this, 'load_textdomain' ), 0 );
323
		}
324
325
326
		/**
327
		 * Init Give when WordPress Initializes.
328
		 *
329
		 * @since 1.8.9
330
		 */
331
		public function init() {
332
333
			/**
334
			 * Fires before the Give core is initialized.
335
			 *
336
			 * @since 1.8.9
337
			 */
338
			do_action( 'before_give_init' );
339
340
			// Set up localization.
341
			$this->load_textdomain();
342
343
			$this->roles                  = new Give_Roles();
344
			$this->api                    = new Give_API();
345
			$this->give_settings          = new Give_Admin_Settings();
346
			$this->html                   = new Give_HTML_Elements();
347
			$this->emails                 = new Give_Emails();
348
			$this->email_tags             = new Give_Email_Template_Tags();
349
			$this->donors                 = new Give_DB_Donors();
350
			$this->donor_meta             = new Give_DB_Donor_Meta();
351
			$this->template_loader        = new Give_Template_Loader();
352
			$this->email_access           = new Give_Email_Access();
353
			$this->tooltips               = new Give_Tooltips();
354
			$this->notices                = new Give_Notices();
355
			$this->payment_meta           = new Give_DB_Payment_Meta();
356
			$this->logs                   = new Give_Logging();
357
			$this->form_meta              = new Give_DB_Form_Meta();
358
			$this->sequential_donation_db = new Give_DB_Sequential_Ordering();
359
			$this->async_process          = new Give_Async_Process();
360
			$this->scripts                = new Give_Scripts();
361
			$this->seq_donation_number    = Give_Sequential_Donation_Number::get_instance();
362
			$this->comment                = Give_Comment::get_instance();
363
			$this->session_db             = new Give_DB_Sessions();
364
			$this->session                = Give_Session::get_instance();
365
366
			/**
367
			 * Fire the action after Give core loads.
368
			 *
369
			 * @param Give class instance.
370
			 *
371
			 * @since 1.8.7
372
			 */
373
			do_action( 'give_init', $this );
374
375
		}
376
377
		/**
378
		 * Throw error on object clone
379
		 *
380
		 * The whole idea of the singleton design pattern is that there is a single
381
		 * object, therefore we don't want the object to be cloned.
382
		 *
383
		 * @since  1.0
384
		 * @access protected
385
		 *
386
		 * @return void
387
		 */
388
		public function __clone() {
389
			// Cloning instances of the class is forbidden.
390
			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
391
		}
392
393
		/**
394
		 * Disable unserializing of the class
395
		 *
396
		 * @since  1.0
397
		 * @access protected
398
		 *
399
		 * @return void
400
		 */
401
		public function __wakeup() {
402
			// Unserializing instances of the class is forbidden.
403
			give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
404
		}
405
406
		/**
407
		 * Setup plugin constants
408
		 *
409
		 * @since  1.0
410
		 * @access private
411
		 *
412
		 * @return void
413
		 */
414
		private function setup_constants() {
415
416
			// Plugin version
417
			if ( ! defined( 'GIVE_VERSION' ) ) {
418
				define( 'GIVE_VERSION', '2.2.5' );
419 59
			}
420
421
			// Plugin Root File
422
			if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
423
				define( 'GIVE_PLUGIN_FILE', __FILE__ );
424
			}
425
426
			// Plugin Folder Path
427
			if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
428
				define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) );
429
			}
430
431
			// Plugin Folder URL
432
			if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
433
				define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) );
434
			}
435
436
			// Plugin Basename aka: "give/give.php"
437
			if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
438
				define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) );
439
			}
440
441
			// Make sure CAL_GREGORIAN is defined
442
			if ( ! defined( 'CAL_GREGORIAN' ) ) {
443
				define( 'CAL_GREGORIAN', 1 );
444
			}
445
		}
446
447
		/**
448
		 * Include required files
449
		 *
450
		 * @since  1.0
451
		 * @access private
452
		 *
453
		 * @return void
454
		 */
455
		private function includes() {
456
			global $give_options;
457
458
			/**
459
			 * Load libraries.
460
			 */
461
			if ( ! class_exists( 'WP_Async_Request' ) ) {
462
				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' );
463
			}
464
465
			if ( ! class_exists( 'WP_Background_Process' ) ) {
466
				include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' );
467
			}
468
469
			/**
470
			 * Load plugin files
471
			 */
472
			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
473
			require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
474
			$give_options = give_get_settings();
475
476
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
477
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php';
478
			require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
479
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
480
			require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
481
			require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
482
			require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
483
			require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
484
			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
485
			require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api-v2.php';
486
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
487
			require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
488
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
489
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-readme-parser.php';
490
491
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php';
492
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
493
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
494
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
495
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
496
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php';
497
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
498
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
499
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php';
500
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sequential-ordering.php';
501
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
502
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor-wall-widget.php';
503
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
504
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sessions.php';
505
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
506
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
507
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
508
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
509
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
510
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
511
			require_once GIVE_PLUGIN_DIR . 'includes/class-give-comment.php';
512
513
			require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
514
			require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
515
			require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
516
			require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php';
517
			require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
518
			require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
519
			require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
520
			require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
521
			require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
522
			require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
523
			require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
524
			require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
525
			require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
526
			require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
527
			require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
528
			require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
529
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
530
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
531
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
532
			require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
533
534
			require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
535
			require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
536
			require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
537
			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
538
			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
539
			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
540
			require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-sequential-donation-number.php';
541
542
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
543
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
544
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
545
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
546
			require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
547
548
			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
549
			require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
550
			require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
551
			require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
552
			require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
553
			require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
554
555
			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
556
			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-wall.php';
557
			require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-stats.php';
558
			require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php';
559
			require_once GIVE_PLUGIN_DIR . 'includes/donors/frontend-donor-functions.php';
560
			require_once GIVE_PLUGIN_DIR . 'includes/donors/actions.php';
561
562
			require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
563
564
			require_once GIVE_PLUGIN_DIR . 'blocks/load.php';
565
566
			if ( defined( 'WP_CLI' ) && WP_CLI ) {
567
				require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
568
			}
569
570
			if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
571
572
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
573
				require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
574
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
575
				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
576
				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
577
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
578
				require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
579
				require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
580
				require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
581
				require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
582
				require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
583
584
				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
585
				require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
586
587
				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
588
				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
589
				require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
590
591
				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
592
				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-give-form-duplicator.php';
593
				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
594
				require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
595
596
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
597
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
598
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
599
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
600
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/give-export-donations-functions.php';
601
602
				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
603
				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
604
				require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
605
606
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
607
608
				require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
609
610
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
611
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
612
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
613
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
614
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
615
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
616
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
617
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-grid.php';
618
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
619
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
620
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-totals.php';
621
				require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donor-wall.php';
622
			}// End if().
623
624
			require_once GIVE_PLUGIN_DIR . 'includes/install.php';
625
626
		}
627
628
		/**
629
		 * Loads the plugin language files.
630
		 *
631
		 * @since  1.0
632
		 * @access public
633
		 *
634
		 * @return void
635
		 */
636
		public function load_textdomain() {
637
638
			// Set filter for Give's languages directory
639
			$give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
640
			$give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
641
642
			// Traditional WordPress plugin locale filter.
643
			$locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
644
			$locale = apply_filters( 'plugin_locale', $locale, 'give' );
645
646
			unload_textdomain( 'give' );
647
			load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
648
			load_plugin_textdomain( 'give', false, $give_lang_dir );
649
650
		}
651
652
653
		/**
654
		 *  Show minimum PHP version notice.
655
		 *
656
		 * @since  1.8.12
657
		 * @access public
658
		 */
659
		public function minimum_phpversion_notice() {
660
			// Bailout.
661
			if ( ! is_admin() ) {
662
				return;
663
			}
664
665
			$notice_desc  = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
666
			$notice_desc .= '<p>' . __( 'Hey, we\'ve noticed that you\'re running an outdated version of PHP. PHP is the programming language that WordPress and Give are built on. The version that is currently used for your site is no longer supported. Newer versions of PHP are both faster and more secure. In fact, your version of PHP no longer receives security updates, which is why we\'re sending you this notice.', 'give' ) . '</p>';
667
			$notice_desc .= '<p>' . __( 'Hosts have the ability to update your PHP version, but sometimes they don\'t dare to do that because they\'re afraid they\'ll break your site.', 'give' ) . '</p>';
668
			$notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
669
			$notice_desc .= '<p>' . __( 'You should update your PHP version to either 5.6 or to 7.0 or 7.1. On a normal WordPress site, switching to PHP 5.6 should never cause issues. We would however actually recommend you switch to PHP7. There are some plugins that are not ready for PHP7 though, so do some testing first. PHP7 is much faster than PHP 5.6. It\'s also the only PHP version still in active development and therefore the better option for your site in the long run.', 'give' ) . '</p>';
670
			$notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
671
			$notice_desc .= '<p>' . sprintf( __( 'If you cannot upgrade your PHP version yourself, you can send an email to your host. If they don\'t want to upgrade your PHP version, we would suggest you switch hosts. Have a look at one of the recommended %1$sWordPress hosting partners%2$s.', 'give' ), sprintf( '<a href="%1$s" target="_blank">', esc_url( 'https://wordpress.org/hosting/' ) ), '</a>' ) . '</p>';
672
673
			echo sprintf(
0 ignored issues
show
Expected a sanitizing function (see Codex for 'Data Validation'), but instead saw 'sprintf'
Loading history...
674
				'<div class="notice notice-error">%1$s</div>',
675
				wp_kses_post( $notice_desc )
676
			);
677
		}
678
679
	}
680
681
endif; // End if class_exists check
682
683
684
/**
685
 * Start Give
686
 *
687
 * The main function responsible for returning the one true Give instance to functions everywhere.
688
 *
689
 * Use this function like you would a global variable, except without needing
690
 * to declare the global.
691
 *
692
 * Example: <?php $give = Give(); ?>
693
 *
694
 * @since 1.0
695
 * @return object|Give
696
 */
697
function Give() {
0 ignored issues
show
The function name Give is in camel caps, but expected _give instead as per the coding standard.
Loading history...
698
	return Give::instance();
699
}
700
701
Give();
702