PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.0.5
GiveWP – Donation Plugin and Fundraising Platform v2.0.5
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 8 years ago includes 8 years ago languages 8 years ago templates 8 years ago changelog.txt 8 years ago give.php 8 years ago readme.txt 8 years ago uninstall.php 8 years ago wpml-config.xml 9 years ago
give.php
635 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.0.5
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 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 1.8.9
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 Object
206 *
207 * @var Give_DB_Payment_Meta $payment_meta
208 */
209 public $payment_meta;
210
211 /**
212 * Give form Object
213 *
214 * @var Give_DB_Form_Meta $form_meta
215 */
216 public $form_meta;
217
218 /**
219 * Give form Object
220 *
221 * @var Give_Async_Process $async_process
222 */
223 public $async_process;
224
225 /**
226 * Main Give Instance
227 *
228 * Ensures that only one instance of Give exists in memory at any one
229 * time. Also prevents needing to define globals all over the place.
230 *
231 * @since 1.0
232 * @access public
233 *
234 * @static
235 * @see Give()
236 *
237 * @return Give
238 */
239 public static function instance() {
240 if ( is_null( self::$_instance ) ) {
241 self::$_instance = new self();
242 }
243
244 return self::$_instance;
245 }
246
247 /**
248 * Give Constructor.
249 */
250 public function __construct() {
251 // PHP version
252 if ( ! defined( 'GIVE_REQUIRED_PHP_VERSION' ) ) {
253 define( 'GIVE_REQUIRED_PHP_VERSION', '5.3' );
254 }
255
256 // Bailout: Need minimum php version to load plugin.
257 if ( function_exists( 'phpversion' ) && version_compare( GIVE_REQUIRED_PHP_VERSION, phpversion(), '>' ) ) {
258 add_action( 'admin_notices', array( $this, 'minmum_phpversion_notice' ) );
259
260 return;
261 }
262
263 $this->setup_constants();
264
265 $this->includes();
266 $this->init_hooks();
267
268 do_action( 'give_loaded' );
269 }
270
271 /**
272 * Hook into actions and filters.
273 *
274 * @since 1.8.9
275 */
276 private function init_hooks() {
277 register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' );
278
279 add_action( 'plugins_loaded', array( $this, 'init' ), 0 );
280
281 // Set up localization on init Hook.
282 add_action( 'init', array( $this, 'load_textdomain' ), 0 );
283 }
284
285 /**
286 * Init Give when WordPress Initializes.
287 *
288 * @since 1.8.9
289 */
290 public function init() {
291
292 /**
293 * Fires before the Give core is initialized.
294 *
295 * @since 1.8.9
296 */
297 do_action( 'before_give_init' );
298
299 $this->roles = new Give_Roles();
300 $this->api = new Give_API();
301 $this->give_settings = new Give_Admin_Settings();
302 $this->session = new Give_Session();
303 $this->html = new Give_HTML_Elements();
304 $this->emails = new Give_Emails();
305 $this->email_tags = new Give_Email_Template_Tags();
306 $this->donors = new Give_DB_Donors();
307 $this->donor_meta = new Give_DB_Donor_Meta();
308 $this->template_loader = new Give_Template_Loader();
309 $this->email_access = new Give_Email_Access();
310 $this->tooltips = new Give_Tooltips();
311 $this->notices = new Give_Notices();
312 $this->payment_meta = new Give_DB_Payment_Meta();
313 $this->logs = new Give_Logging();
314 $this->form_meta = new Give_DB_Form_Meta();
315 $this->async_process = new Give_Async_Process();
316
317 /**
318 * Fire the action after Give core loads.
319 *
320 * @param Give Instance of Give Class
321 *
322 * @since 1.8.7
323 */
324 do_action( 'give_init', $this );
325
326 }
327
328 /**
329 * Throw error on object clone
330 *
331 * The whole idea of the singleton design pattern is that there is a single
332 * object, therefore we don't want the object to be cloned.
333 *
334 * @since 1.0
335 * @access protected
336 *
337 * @return void
338 */
339 public function __clone() {
340 // Cloning instances of the class is forbidden.
341 give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
342 }
343
344 /**
345 * Disable unserializing of the class
346 *
347 * @since 1.0
348 * @access protected
349 *
350 * @return void
351 */
352 public function __wakeup() {
353 // Unserializing instances of the class is forbidden.
354 give_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'give' ), '1.0' );
355 }
356
357 /**
358 * Setup plugin constants
359 *
360 * @since 1.0
361 * @access private
362 *
363 * @return void
364 */
365 private function setup_constants() {
366
367 // Plugin version
368 if ( ! defined( 'GIVE_VERSION' ) ) {
369 define( 'GIVE_VERSION', '2.0.5' );
370 }
371
372 // Plugin Root File
373 if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) {
374 define( 'GIVE_PLUGIN_FILE', __FILE__ );
375 }
376
377 // Plugin Folder Path
378 if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) {
379 define( 'GIVE_PLUGIN_DIR', plugin_dir_path( GIVE_PLUGIN_FILE ) );
380 }
381
382 // Plugin Folder URL
383 if ( ! defined( 'GIVE_PLUGIN_URL' ) ) {
384 define( 'GIVE_PLUGIN_URL', plugin_dir_url( GIVE_PLUGIN_FILE ) );
385 }
386
387 // Plugin Basename aka: "give/give.php"
388 if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) {
389 define( 'GIVE_PLUGIN_BASENAME', plugin_basename( GIVE_PLUGIN_FILE ) );
390 }
391
392 // Make sure CAL_GREGORIAN is defined
393 if ( ! defined( 'CAL_GREGORIAN' ) ) {
394 define( 'CAL_GREGORIAN', 1 );
395 }
396 }
397
398 /**
399 * Include required files
400 *
401 * @since 1.0
402 * @access private
403 *
404 * @return void
405 */
406 private function includes() {
407 global $give_options;
408
409 /**
410 * Load libraries.
411 */
412 if ( ! class_exists( 'WP_Async_Request' ) ) {
413 include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-async-request.php' );
414 }
415
416 if ( ! class_exists( 'WP_Background_Process' ) ) {
417 include_once( GIVE_PLUGIN_DIR . 'includes/libraries/wp-background-process.php' );
418 }
419
420 /**
421 * Load plugin files
422 */
423 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-settings.php';
424 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-give-settings.php';
425 $give_options = give_get_settings();
426
427 require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php';
428 require_once GIVE_PLUGIN_DIR . 'includes/class-give-async-process.php';
429 require_once GIVE_PLUGIN_DIR . 'includes/admin/give-metabox-functions.php';
430 require_once GIVE_PLUGIN_DIR . 'includes/class-give-cache.php';
431 require_once GIVE_PLUGIN_DIR . 'includes/post-types.php';
432 require_once GIVE_PLUGIN_DIR . 'includes/scripts.php';
433 require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php';
434 require_once GIVE_PLUGIN_DIR . 'includes/actions.php';
435 require_once GIVE_PLUGIN_DIR . 'includes/filters.php';
436 require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php';
437 require_once GIVE_PLUGIN_DIR . 'includes/class-give-tooltips.php';
438 require_once GIVE_PLUGIN_DIR . 'includes/class-notices.php';
439 require_once GIVE_PLUGIN_DIR . 'includes/class-give-translation.php';
440
441 require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php';
442 require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php';
443 require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php';
444 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php';
445 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-meta.php';
446 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donors.php';
447 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-donor-meta.php';
448 require_once GIVE_PLUGIN_DIR . 'includes/class-give-donor.php';
449 require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php';
450 require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php';
451 require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php';
452 require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php';
453 require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php';
454 require_once GIVE_PLUGIN_DIR . 'includes/class-give-email-access.php';
455 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-payment-meta.php';
456 require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-form-meta.php';
457
458 require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php';
459 require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php';
460 require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php';
461 require_once GIVE_PLUGIN_DIR . 'includes/import-functions.php';
462 require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php';
463 require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php';
464 require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php';
465 require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php';
466 require_once GIVE_PLUGIN_DIR . 'includes/formatting.php';
467 require_once GIVE_PLUGIN_DIR . 'includes/currency-functions.php';
468 require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php';
469 require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php';
470 require_once GIVE_PLUGIN_DIR . 'includes/process-donation.php';
471 require_once GIVE_PLUGIN_DIR . 'includes/login-register.php';
472 require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php';
473 require_once GIVE_PLUGIN_DIR . 'includes/plugin-compatibility.php';
474 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-classes.php';
475 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-functions.php';
476 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-actions.php';
477 require_once GIVE_PLUGIN_DIR . 'includes/deprecated/deprecated-filters.php';
478
479 require_once GIVE_PLUGIN_DIR . 'includes/payments/backward-compatibility.php';
480 require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php';
481 require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php';
482 require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php';
483 require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php';
484 require_once GIVE_PLUGIN_DIR . 'includes/payments/class-give-payment.php';
485
486 require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php';
487 require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php';
488 require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php';
489 require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php';
490 require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php';
491
492 require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php';
493 require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php';
494 require_once GIVE_PLUGIN_DIR . 'includes/admin/emails/class-email-notifications.php';
495 require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php';
496 require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php';
497 require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php';
498
499 require_once GIVE_PLUGIN_DIR . 'includes/donors/class-give-donors-query.php';
500 require_once GIVE_PLUGIN_DIR . 'includes/donors/backward-compatibility.php';
501
502 require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/class-give-updates.php';
503
504 if ( defined( 'WP_CLI' ) && WP_CLI ) {
505 require_once GIVE_PLUGIN_DIR . 'includes/class-give-cli-commands.php';
506 }
507
508 if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
509
510 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php';
511 require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php';
512 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php';
513 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php';
514 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-i18n-module.php';
515 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php';
516 require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-filters.php';
517 require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php';
518 require_once GIVE_PLUGIN_DIR . 'includes/admin/plugins.php';
519 require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php';
520 require_once GIVE_PLUGIN_DIR . 'includes/admin/class-blank-slate.php';
521
522 require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php';
523 require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php';
524
525 require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donors.php';
526 require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-functions.php';
527 require_once GIVE_PLUGIN_DIR . 'includes/admin/donors/donor-actions.php';
528
529 require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php';
530 require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/class-metabox-form-data.php';
531 require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php';
532
533 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-functions.php';
534 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/class-export.php';
535 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/export-actions.php';
536 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/export/pdf-reports.php';
537
538 require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/reports.php';
539 require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/class-give-graph.php';
540 require_once GIVE_PLUGIN_DIR . 'includes/admin/reports/graphing.php';
541
542 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/logs/logs.php';
543
544 require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/data/tools-actions.php';
545
546 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php';
547 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php';
548 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php';
549 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php';
550 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php';
551 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php';
552 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php';
553 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php';
554 require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php';
555 }// End if().
556
557 require_once GIVE_PLUGIN_DIR . 'includes/install.php';
558
559 }
560
561 /**
562 * Loads the plugin language files.
563 *
564 * @since 1.0
565 * @access public
566 *
567 * @return void
568 */
569 public function load_textdomain() {
570
571 // Set filter for Give's languages directory
572 $give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/';
573 $give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir );
574
575 // Traditional WordPress plugin locale filter.
576 $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
577 $locale = apply_filters( 'plugin_locale', $locale, 'give' );
578
579 unload_textdomain( 'give' );
580 load_textdomain( 'give', WP_LANG_DIR . '/give/give-' . $locale . '.mo' );
581 load_plugin_textdomain( 'give', false, $give_lang_dir );
582
583 }
584
585
586 /**
587 * Show minimu phpversion notice
588 *
589 * @since 1.8.12
590 * @access public
591 */
592 public function minmum_phpversion_notice() {
593 // Bailout.
594 if ( ! is_admin() ) {
595 return;
596 }
597
598 $notice_desc = '<p><strong>' . __( 'Your site could be faster and more secure with a newer PHP version.', 'give' ) . '</strong></p>';
599 $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>';
600 $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>';
601 $notice_desc .= '<p><strong>' . __( 'To which version should I update?', 'give' ) . '</strong></p>';
602 $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>';
603 $notice_desc .= '<p><strong>' . __( 'Can\'t update? Ask your host!', 'give' ) . '</strong></p>';
604 $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>';
605
606 echo sprintf(
607 '<div class="notice notice-error">%1$s</div>',
608 $notice_desc
609 );
610 }
611
612 }
613
614 endif; // End if class_exists check
615
616
617 /**
618 * Start Give
619 *
620 * The main function responsible for returning the one true Give instance to functions everywhere.
621 *
622 * Use this function like you would a global variable, except without needing
623 * to declare the global.
624 *
625 * Example: <?php $give = Give(); ?>
626 *
627 * @since 1.0
628 * @return object|Give
629 */
630 function Give() {
631 return Give::instance();
632 }
633
634 Give();
635