PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.2.0
GiveWP – Donation Plugin and Fundraising Platform v2.2.0
4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / give.php
give Last commit date
assets 7 years ago blocks 7 years ago includes 7 years ago languages 7 years ago sample-data 8 years ago templates 7 years ago changelog.txt 8 years ago give.php 7 years ago license.txt 8 years ago readme.txt 7 years ago uninstall.php 7 years ago wpml-config.xml 8 years ago
give.php
703 lines
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.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_Admin_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 Session DB Object
101 *
102 * This holds donation data for user's session.
103 *
104 * @since 1.0
105 * @access public
106 *
107 * @var Give_DB_Sessions object
108 */
109 public $session_db;
110
111 /**
112 * Give HTML Element Helper Object
113 *
114 * @since 1.0
115 * @access public
116 *
117 * @var Give_HTML_Elements object
118 */
119 public $html;
120
121 /**
122 * Give Emails Object
123 *
124 * @since 1.0
125 * @access public
126 *
127 * @var Give_Emails object
128 */
129 public $emails;
130
131 /**
132 * Give Email Template Tags Object
133 *
134 * @since 1.0
135 * @access public
136 *
137 * @var Give_Email_Template_Tags object
138 */
139 public $email_tags;
140
141 /**
142 * Give Donors DB Object
143 *
144 * @since 1.0
145 * @access public
146 *
147 * @var Give_DB_Donors object
148 */
149 public $donors;
150
151 /**
152 * Give Donor meta DB Object
153 *
154 * @since 1.6
155 * @access public
156 *
157 * @var Give_DB_Donor_Meta object
158 */
159 public $donor_meta;
160
161 /**
162 * Give Sequential Donation DB Object
163 *
164 * @since 2.1.0
165 * @access public
166 *
167 * @var Give_DB_Sequential_Ordering object
168 */
169 public $sequential_donation_db;
170
171 /**
172 * Give API Object
173 *
174 * @since 1.0
175 * @access public
176 *
177 * @var Give_API object
178 */
179 public $api;
180
181 /**
182 * Give Template Loader Object
183 *
184 * @since 1.0
185 * @access public
186 *
187 * @var Give_Template_Loader object
188 */
189 public $template_loader;
190
191 /**
192 * Give No Login Object
193 *
194 * @since 1.0
195 * @access public
196 *
197 * @var Give_Email_Access object
198 */
199 public $email_access;
200
201 /**
202 * Give_tooltips Object
203 *
204 * @since 1.8.9
205 * @access public
206 *
207 * @var Give_Tooltips object
208 */
209 public $tooltips;
210
211 /**
212 * Give notices Object
213 *
214 * @var Give_Notices $notices
215 */
216 public $notices;
217
218
219 /**
220 * Give logging Object
221 *
222 * @var Give_Logging $logs
223 */
224 public $logs;
225
226 /**
227 * Give payment Object
228 *
229 * @var Give_DB_Payment_Meta $payment_meta
230 */
231 public $payment_meta;
232
233 /**
234 * Give form Object
235 *
236 * @var Give_DB_Form_Meta $form_meta
237 */
238 public $form_meta;
239
240 /**
241 * Give form Object
242 *
243 * @var Give_Async_Process $async_process
244 */
245 public $async_process;
246
247 /**
248 * Give scripts Object.
249 *
250 * @var Give_Scripts
251 */
252 public $scripts;
253
254 /**
255 * Give_Seq_Donation_Number Object.
256 *
257 * @var Give_Sequential_Donation_Number
258 */
259 public $seq_donation_number;
260
261 /**
262 * Give_Comment Object
263 *
264 * @var Give_Comment
265 */
266 public $comment;
267
268 /**
269 * Main Give Instance
270 *
271 * Ensures that only one instance of Give exists in memory at any one
272 * time. Also prevents needing to define globals all over the place.
273 *
274 * @since 1.0
275 * @access public
276 *
277 * @static
278 * @see Give()
279 *
280 * @return Give
281 */
282 public static function instance() {
283 if ( is_null( self::$_instance ) ) {
284 self::$_instance = new self();
285 }
286
287 return self::$_instance;
288 }
289
290 /**
291 * Give Constructor.
292 */
293 public function __construct() {
294 // PHP version
295 if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
296 define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
297 }
298
299 // Bailout: Need minimum php version to load plugin.
300 if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
301 add_action( 'admin_notices', array( $this, 'minimum_phpversion_notice' ) );
302
303 return;
304 }
305
306 $this->setup_constants();
307 $this->includes();
308 $this->init_hooks();
309
310 do_action( 'give_loaded' );
311 }
312
313 /**
314 * Hook into actions and filters.
315 *
316 * @since 1.8.9
317 */
318 private function init_hooks() {
319 register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
320 add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
321
322 // Set up localization on init Hook.
323 add_action( 'init', array( $this, 'load_textdomain' ), 0 );
324 }
325
326
327 /**
328 * Init Give when WordPress Initializes.
329 *
330 * @since 1.8.9
331 */
332 public function init() {
333
334 /**
335 * Fires before the Give core is initialized.
336 *
337 * @since 1.8.9
338 */
339 do_action( 'before_give_init' );
340
341 // Set up localization.
342 $this->load_textdomain();
343
344 $this->roles = new Give_Roles();
345 $this->api = new Give_API();
346 $this->give_settings = new Give_Admin_Settings();
347 $this->html = new Give_HTML_Elements();
348 $this->emails = new Give_Emails();
349 $this->email_tags = new Give_Email_Template_Tags();
350 $this->donors = new Give_DB_Donors();
351 $this->donor_meta = new Give_DB_Donor_Meta();
352 $this->template_loader = new Give_Template_Loader();
353 $this->email_access = new Give_Email_Access();
354 $this->tooltips = new Give_Tooltips();
355 $this->notices = new Give_Notices();
356 $this->payment_meta = new Give_DB_Payment_Meta();
357 $this->logs = new Give_Logging();
358 $this->form_meta = new Give_DB_Form_Meta();
359 $this->sequential_donation_db = new Give_DB_Sequential_Ordering();
360 $this->async_process = new Give_Async_Process();
361 $this->scripts = new Give_Scripts();
362 $this->seq_donation_number = Give_Sequential_Donation_Number::get_instance();
363 $this->comment = Give_Comment::get_instance();
364 $this->session_db = new Give_DB_Sessions();
365 $this->session = Give_Session::get_instance();
366
367 /**
368 * Fire the action after Give core loads.
369 *
370 * @param Give class instance.
371 *
372 * @since 1.8.7
373 */
374 do_action( 'give_init', $this );
375
376 }
377
378 /**
379 * Throw error on object clone
380 *
381 * The whole idea of the singleton design pattern is that there is a single
382 * object, therefore we don't want the object to be cloned.
383 *
384 * @since 1.0
385 * @access protected
386 *
387 * @return void
388 */
389 public function __clone() {
390 // Cloning instances of the class is forbidden.
391 give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
392 }
393
394 /**
395 * Disable unserializing of the class
396 *
397 * @since 1.0
398 * @access protected
399 *
400 * @return void
401 */
402 public function __wakeup() {
403 // Unserializing instances of the class is forbidden.
404 give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
405 }
406
407 /**
408 * Setup plugin constants
409 *
410 * @since 1.0
411 * @access private
412 *
413 * @return void
414 */
415 private function setup_constants() {
416
417 // Plugin version
418 if ( ! defined( 'GIVE_VERSION' ) ) {
419 define( 'GIVE_VERSION', '2.2.0' );
420 }
421
422 // Plugin Root File
423 if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
424 define( 'GIVE_PLUGIN_FILE', __FILE__ );
425 }
426
427 // Plugin Folder Path
428 if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
429 define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) );
430 }
431
432 // Plugin Folder URL
433 if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
434 define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) );
435 }
436
437 // Plugin Basename aka: "give/give.php"
438 if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
439 define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) );
440 }
441
442 // Make sure CAL_GREGORIAN is defined
443 if ( ! defined( 'CAL_GREGORIAN' ) ) {
444 define( 'CAL_GREGORIAN', 1 );
445 }
446 }
447
448 /**
449 * Include required files
450 *
451 * @since 1.0
452 * @access private
453 *
454 * @return void
455 */
456 private function includes() {
457 global $give_options;
458
459 /**
460 * Load libraries.
461 */
462 if ( ! class_exists( 'WP_Async_Request' ) ) {
463 include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' );
464 }
465
466 if ( ! class_exists( 'WP_Background_Process' ) ) {
467 include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' );
468 }
469
470 /**
471 * Load plugin files
472 */
473 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
474 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
475 $give_options = give_get_settings();
476
477 require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
478 require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php';
479 require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
480 require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
481 require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
482 require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
483 require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
484 require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
485 require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
486 require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api-v2.php';
487 require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
488 require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
489 require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
490 require_once GIVE_PLUGIN_DIR . 'includes/class-give-readme-parser.php';
491
492 require_once GIVE_PLUGIN_DIR . 'includes/class-give-scripts.php';
493 require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
494 require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
495 require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
496 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
497 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php';
498 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
499 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
500 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php';
501 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sequential-ordering.php';
502 require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
503 require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor-wall-widget.php';
504 require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
505 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-sessions.php';
506 require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
507 require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
508 require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
509 require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
510 require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
511 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
512 require_once GIVE_PLUGIN_DIR . 'includes/class-give-comment.php';
513
514 require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
515 require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
516 require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
517 require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php';
518 require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
519 require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
520 require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
521 require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
522 require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
523 require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
524 require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
525 require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
526 require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
527 require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
528 require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
529 require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
530 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
531 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
532 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
533 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
534
535 require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
536 require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
537 require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
538 require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
539 require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
540 require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
541 require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-sequential-donation-number.php';
542
543 require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
544 require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
545 require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
546 require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
547 require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
548
549 require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
550 require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
551 require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
552 require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
553 require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
554 require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
555
556 require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
557 require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-wall.php';
558 require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donor-stats.php';
559 require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php';
560 require_once GIVE_PLUGIN_DIR . 'includes/donors/frontend-donor-functions.php';
561 require_once GIVE_PLUGIN_DIR . 'includes/donors/actions.php';
562
563 require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
564
565 require_once GIVE_PLUGIN_DIR . 'blocks/load.php';
566
567 if ( defined( 'WP_CLI' ) && WP_CLI ) {
568 require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
569 }
570
571 if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
572
573 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
574 require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
575 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
576 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
577 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
578 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
579 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
580 require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
581 require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
582 require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
583 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
584
585 require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
586 require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
587
588 require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
589 require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
590 require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
591
592 require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
593 require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-give-form-duplicator.php';
594 require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
595 require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
596
597 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
598 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
599 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
600 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
601 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/give-export-donations-functions.php';
602
603 require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
604 require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
605 require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
606
607 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
608
609 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
610
611 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
612 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
613 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
614 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
615 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
616 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
617 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
618 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-grid.php';
619 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
620 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
621 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-totals.php';
622 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donor-wall.php';
623 }// End if().
624
625 require_once GIVE_PLUGIN_DIR . 'includes/install.php';
626
627 }
628
629 /**
630 * Loads the plugin language files.
631 *
632 * @since 1.0
633 * @access public
634 *
635 * @return void
636 */
637 public function load_textdomain() {
638
639 // Set filter for Give's languages directory
640 $give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
641 $give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
642
643 // Traditional WordPress plugin locale filter.
644 $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
645 $locale = apply_filters( 'plugin_locale', $locale, 'give' );
646
647 unload_textdomain( 'give' );
648 load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
649 load_plugin_textdomain( 'give', false, $give_lang_dir );
650
651 }
652
653
654 /**
655 * Show minimum PHP version notice.
656 *
657 * @since 1.8.12
658 * @access public
659 */
660 public function minimum_phpversion_notice() {
661 // Bailout.
662 if ( ! is_admin() ) {
663 return;
664 }
665
666 $notice_desc = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
667 $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>';
668 $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>';
669 $notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
670 $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>';
671 $notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
672 $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>';
673
674 echo sprintf(
675 '<div class="notice notice-error">%1$s</div>',
676 wp_kses_post( $notice_desc )
677 );
678 }
679
680 }
681
682 endif; // End if class_exists check
683
684
685 /**
686 * Start Give
687 *
688 * The main function responsible for returning the one true Give instance to functions everywhere.
689 *
690 * Use this function like you would a global variable, except without needing
691 * to declare the global.
692 *
693 * Example: <?php $give = Give(); ?>
694 *
695 * @since 1.0
696 * @return object|Give
697 */
698 function Give() {
699 return Give::instance();
700 }
701
702 Give();
703