PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.4.17
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.4.17
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / charitable.php

charitable.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.4.17, at charitable.php

829 lines 23.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Charitable
4 * Plugin URI: https://www.wpcharitable.com
5 * Description: The WordPress fundraising alternative for non-profits, created to help non-profits raise money on their own website.
6 * Version: 1.4.17
7 * Author: WP Charitable
8 * Author URI: https://wpcharitable.com
9 * Requires at least: 4.1
10 * Tested up to: 4.8
11 *
12 * Text Domain: charitable
13 * Domain Path: /i18n/languages/
14 *
15 * @package Charitable
16 * @author Eric Daams
17 * @copyright Copyright (c) 2017, Studio 164a
18 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19 */
20
21 // Exit if accessed directly.
22 if ( ! defined( 'ABSPATH' ) ) { exit; }
23
24 if ( ! class_exists( 'Charitable' ) ) :
25
26 /**
27 * Main Charitable class
28 *
29 * @class Charitable
30 * @version 1.4.0
31 */
32 class Charitable {
33
34 /**
35 * Plugin version.
36 *
37 * @var string
38 */
39 const VERSION = '1.4.17';
40
41 /**
42 * Version of database schema.
43 *
44 * @var string A date in the format: YYYYMMDD
45 */
46 const DB_VERSION = '20150615';
47
48 /**
49 * Campaign post type.
50 *
51 * @var string
52 */
53 const CAMPAIGN_POST_TYPE = 'campaign';
54
55 /**
56 * Donation post type.
57 *
58 * @var string
59 */
60 const DONATION_POST_TYPE = 'donation';
61
62 /**
63 * Single instance of this class.
64 *
65 * @var Charitable
66 * @access private
67 */
68 private static $instance = null;
69
70 /**
71 * The absolute path to this plugin's directory.
72 *
73 * @var string
74 * @access private
75 */
76 private $directory_path;
77
78 /**
79 * The URL of this plugin's directory.
80 *
81 * @var string
82 * @access private
83 */
84 private $directory_url;
85
86 /**
87 * Directory path for the includes folder of the plugin.
88 *
89 * @var string
90 * @access private
91 */
92 private $includes_path;
93
94 /**
95 * Store of registered objects.
96 *
97 * @var array
98 * @access private
99 */
100 private $registry;
101
102 /**
103 * Donation factory instance.
104 *
105 * @var Charitable_Donation_Factory
106 */
107 public $donation_factory = null;
108
109 /**
110 * Create class instance.
111 *
112 * @since 1.0.0
113 */
114 public function __construct() {
115 $this->directory_path = plugin_dir_path( __FILE__ );
116 $this->directory_url = plugin_dir_url( __FILE__ );
117 $this->includes_path = $this->directory_path . 'includes/';
118
119 $this->load_dependencies();
120
121 register_activation_hook( __FILE__, array( $this, 'activate' ) );
122 register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
123
124 add_action( 'plugins_loaded', array( $this, 'start' ), 1 );
125 }
126
127 /**
128 * Returns the original instance of this class.
129 *
130 * @return Charitable
131 * @since 1.0.0
132 */
133 public static function get_instance() {
134 return self::$instance;
135 }
136
137 /**
138 * Run the startup sequence.
139 *
140 * This is only ever executed once.
141 *
142 * @return void
143 * @access public
144 * @since 1.0.0
145 */
146 public function start() {
147 /* If we've already started (i.e. run this function once before), do not pass go. */
148 if ( $this->started() ) {
149 return;
150 }
151
152 /* Set static instance. */
153 self::$instance = $this;
154
155 /* Factory to create new donation instances. */
156 $this->donation_factory = new Charitable_Donation_Factory();
157
158 $this->maybe_start_ajax();
159
160 $this->attach_hooks_and_filters();
161
162 $this->maybe_start_admin();
163
164 $this->maybe_start_public();
165
166 Charitable_Addons::load( $this );
167 }
168
169 /**
170 * Include necessary files.
171 *
172 * @return void
173 * @access private
174 * @since 1.0.0
175 */
176 private function load_dependencies() {
177 $includes_path = $this->get_path( 'includes' );
178
179 /* Abstracts */
180 require_once( $includes_path . 'abstracts/class-charitable-form.php' );
181 require_once( $includes_path . 'abstracts/class-charitable-query.php' );
182 require_once( $includes_path . 'abstracts/class-charitable-start-object.php' );
183
184 /* Functions & Core Classes */
185 require_once( $includes_path . 'charitable-core-functions.php' );
186 require_once( $includes_path . 'charitable-utility-functions.php' );
187 require_once( $includes_path . 'class-charitable-locations.php' );
188 require_once( $includes_path . 'class-charitable-notices.php' );
189 require_once( $includes_path . 'class-charitable-post-types.php' );
190 require_once( $includes_path . 'class-charitable-request.php' );
191 require_once( $includes_path . 'class-charitable-cron.php' );
192 require_once( $includes_path . 'class-charitable-i18n.php' );
193
194 /* Addons */
195 require_once( $includes_path . 'addons/class-charitable-addons.php' );
196
197 /* Campaigns */
198 require_once( $includes_path . 'campaigns/charitable-campaign-functions.php' );
199 require_once( $includes_path . 'campaigns/class-charitable-campaign.php' );
200 require_once( $includes_path . 'campaigns/class-charitable-campaigns.php' );
201 require_once( $includes_path . 'campaigns/charitable-campaign-hooks.php' );
202
203 /* Currency */
204 require_once( $includes_path . 'currency/charitable-currency-functions.php' );
205 require_once( $includes_path . 'currency/class-charitable-currency.php' );
206
207 /* Donations */
208 require_once( $includes_path . 'donations/abstract-charitable-donation.php' );
209 require_once( $includes_path . 'donations/interface-charitable-donation-form.php' );
210 require_once( $includes_path . 'donations/class-charitable-donation-processor.php' );
211 require_once( $includes_path . 'donations/class-charitable-donation.php' );
212 require_once( $includes_path . 'donations/class-charitable-donation-factory.php' );
213 require_once( $includes_path . 'donations/class-charitable-donations.php' );
214 require_once( $includes_path . 'donations/class-charitable-donations-query.php' );
215 require_once( $includes_path . 'donations/class-charitable-donation-form.php' );
216 require_once( $includes_path . 'donations/class-charitable-donation-amount-form.php' );
217 require_once( $includes_path . 'donations/charitable-donation-hooks.php' );
218 require_once( $includes_path . 'donations/charitable-donation-functions.php' );
219
220 /* Users */
221 require_once( $includes_path . 'users/charitable-user-functions.php' );
222 require_once( $includes_path . 'users/class-charitable-user.php' );
223 require_once( $includes_path . 'users/class-charitable-roles.php' );
224 require_once( $includes_path . 'users/class-charitable-donor.php' );
225 require_once( $includes_path . 'users/class-charitable-donor-query.php' );
226
227 /* Gateways */
228 require_once( $includes_path . 'gateways/interface-charitable-gateway.php' );
229 require_once( $includes_path . 'gateways/class-charitable-gateways.php' );
230 require_once( $includes_path . 'gateways/abstract-class-charitable-gateway.php' );
231 require_once( $includes_path . 'gateways/class-charitable-gateway-offline.php' );
232 require_once( $includes_path . 'gateways/class-charitable-gateway-paypal.php' );
233
234 /* Emails */
235 require_once( $includes_path . 'emails/interface-charitable-email.php' );
236 require_once( $includes_path . 'emails/class-charitable-emails.php' );
237 require_once( $includes_path . 'emails/abstract-class-charitable-email.php' );
238 require_once( $includes_path . 'emails/class-charitable-email-new-donation.php' );
239 require_once( $includes_path . 'emails/class-charitable-email-donation-receipt.php' );
240 require_once( $includes_path . 'emails/class-charitable-email-campaign-end.php' );
241 require_once( $includes_path . 'emails/class-charitable-email-password-reset.php' );
242 require_once( $includes_path . 'emails/charitable-email-hooks.php' );
243
244 /* Database */
245 require_once( $includes_path . 'db/abstract-class-charitable-db.php' );
246 require_once( $includes_path . 'db/class-charitable-campaign-donations-db.php' );
247 require_once( $includes_path . 'db/class-charitable-donors-db.php' );
248
249 /* Licensing */
250 require_once( $includes_path . 'licensing/class-charitable-licenses.php' );
251 require_once( $includes_path . 'licensing/class-charitable-plugin-updater.php' );
252
253 /* Public */
254 require_once( $includes_path . 'public/charitable-page-functions.php' );
255 require_once( $includes_path . 'public/charitable-template-helpers.php' );
256 require_once( $includes_path . 'public/class-charitable-session.php' );
257 require_once( $includes_path . 'public/class-charitable-template.php' );
258 require_once( $includes_path . 'public/class-charitable-template-part.php' );
259 require_once( $includes_path . 'public/class-charitable-templates.php' );
260 require_once( $includes_path . 'public/class-charitable-ghost-page.php' );
261 require_once( $includes_path . 'public/class-charitable-user-dashboard.php' );
262
263 /* Shortcodes */
264 require_once( $includes_path . 'shortcodes/class-charitable-campaigns-shortcode.php' );
265 require_once( $includes_path . 'shortcodes/class-charitable-my-donations-shortcode.php' );
266 require_once( $includes_path . 'shortcodes/class-charitable-donation-receipt-shortcode.php' );
267 require_once( $includes_path . 'shortcodes/class-charitable-login-shortcode.php' );
268 require_once( $includes_path . 'shortcodes/class-charitable-registration-shortcode.php' );
269 require_once( $includes_path . 'shortcodes/class-charitable-profile-shortcode.php' );
270 require_once( $includes_path . 'shortcodes/charitable-shortcodes-hooks.php' );
271
272 /* Widgets */
273 require_once( $includes_path . 'widgets/class-charitable-widgets.php' );
274 require_once( $includes_path . 'widgets/class-charitable-campaign-terms-widget.php' );
275 require_once( $includes_path . 'widgets/class-charitable-campaigns-widget.php' );
276 require_once( $includes_path . 'widgets/class-charitable-donors-widget.php' );
277 require_once( $includes_path . 'widgets/class-charitable-donate-widget.php' );
278 require_once( $includes_path . 'widgets/class-charitable-donation-stats-widget.php' );
279
280 /* User Management */
281 require_once( $includes_path . 'user-management/class-charitable-registration-form.php' );
282 require_once( $includes_path . 'user-management/class-charitable-profile-form.php' );
283 require_once( $includes_path . 'user-management/class-charitable-forgot-password-form.php' );
284 require_once( $includes_path . 'user-management/class-charitable-reset-password-form.php' );
285 require_once( $includes_path . 'user-management/class-charitable-user-management.php' );
286 require_once( $includes_path . 'user-management/charitable-user-management-hooks.php' );
287
288 /* Customizer */
289 require_once( $includes_path . 'admin/customizer/class-charitable-customizer.php' );
290
291 /* Deprecated */
292 require_once( $includes_path . 'deprecated/charitable-deprecated-functions.php' );
293
294 /* Compatibility */
295 if ( class_exists( 'ET_Builder_Plugin' ) || 'divi' == strtolower( wp_get_theme()->get_template() ) ) {
296 require_once( $includes_path . 'compat/charitable-divi-compat-functions.php' );
297 }
298
299 /**
300 * We are registering this object only for backwards compatibility. It
301 * will be removed in or after Charitable 1.3.
302 *
303 * @deprecated
304 */
305 $this->register_object( Charitable_Emails::get_instance() );
306 $this->register_object( Charitable_Request::get_instance() );
307 $this->register_object( Charitable_Gateways::get_instance() );
308 $this->register_object( Charitable_i18n::get_instance() );
309 $this->register_object( Charitable_Post_Types::get_instance() );
310 $this->register_object( Charitable_Cron::get_instance() );
311 $this->register_object( Charitable_Widgets::get_instance() );
312 $this->register_object( Charitable_Licenses::get_instance() );
313 $this->register_object( Charitable_User_Dashboard::get_instance() );
314 }
315
316 /**
317 * Set up hook and filter callback functions.
318 *
319 * @return void
320 * @access private
321 * @since 1.0.0
322 */
323 private function attach_hooks_and_filters() {
324 add_action( 'wpmu_new_blog', array( $this, 'maybe_activate_charitable_on_new_site' ) );
325 add_action( 'plugins_loaded', array( $this, 'charitable_install' ), 100 );
326 add_action( 'plugins_loaded', array( $this, 'charitable_start' ), 100 );
327 add_action( 'setup_theme', array( 'Charitable_Customizer', 'start' ) );
328 add_action( 'wp_enqueue_scripts', array( $this, 'maybe_start_qunit' ), 100 );
329
330 /**
331 * We do this on priority 20 so that any functionality that is loaded on init (such
332 * as addons) has a chance to run before the event.
333 */
334 add_action( 'init', array( $this, 'do_charitable_actions' ), 20 );
335 add_filter( 'charitable_sanitize_donation_meta', 'charitable_sanitize_donation_meta', 10, 2 );
336 }
337
338 /**
339 * Checks whether we're in the admin area and if so, loads the admin-only functionality.
340 *
341 * @return void
342 * @access private
343 * @since 1.0.0
344 */
345 private function maybe_start_admin() {
346 if ( ! is_admin() ) {
347 return;
348 }
349
350 require_once( $this->get_path( 'admin' ) . 'class-charitable-admin.php' );
351 require_once( $this->get_path( 'admin' ) . 'charitable-admin-hooks.php' );
352
353 /**
354 * We are registering this object only for backwards compatibility. It
355 * will be removed in or after Charitable 1.3.
356 *
357 * @deprecated
358 */
359 $this->register_object( Charitable_Admin::get_instance() );
360 }
361
362 /**
363 * Checks whether we're on the public-facing side and if so, loads the public-facing functionality.
364 *
365 * @return void
366 * @access private
367 * @since 1.0.0
368 */
369 private function maybe_start_public() {
370 if ( is_admin() ) {
371 return;
372 }
373
374 require_once( $this->get_path( 'public' ) . 'class-charitable-public.php' );
375
376 /**
377 * We are registering this object only for backwards compatibility. It
378 * will be removed in or after Charitable 1.3.
379 *
380 * @deprecated
381 */
382 $this->register_object( Charitable_Public::get_instance() );
383 }
384
385 /**
386 * Load the QUnit tests if ?qunit is appended to the request.
387 *
388 * @return boolean
389 * @access public
390 * @since 1.4.17
391 */
392 public function maybe_start_qunit() {
393 /* Skip out early if ?qunit isn't included in the request. */
394 if ( ! array_key_exists( 'qunit', $_GET ) ) {
395 return false;
396 }
397
398 /* The unit tests have to exist. */
399 if ( ! file_exists( $this->get_path( 'directory' ) . 'tests/qunit/tests.js' ) ) {
400 return false;
401 }
402
403 wp_register_script( 'qunit', 'https://code.jquery.com/qunit/qunit-2.3.3.js', array(), '2.3.3', true );
404 /* Version: '20170615-15:44' */
405 wp_register_script( 'qunit-tests', $this->get_path( 'directory', false ) . 'tests/qunit/tests.js', array( 'jquery-core', 'qunit' ), time(), true );
406 wp_enqueue_script( 'qunit-tests' );
407
408 wp_register_style( 'qunit', 'https://code.jquery.com/qunit/qunit-2.3.3.css', array(), '2.3.3', 'all' );
409 wp_enqueue_style( 'qunit' );
410 }
411
412 /**
413 * Checks whether we're executing an AJAX hook and if so, loads some AJAX functionality.
414 *
415 * @return void
416 * @access private
417 * @since 1.0.0
418 */
419 private function maybe_start_ajax() {
420 if ( false === ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
421 return;
422 }
423
424 require_once( $this->get_path( 'includes' ) . 'ajax/charitable-ajax-functions.php' );
425 require_once( $this->get_path( 'includes' ) . 'ajax/charitable-ajax-hooks.php' );
426
427 /**
428 * We are registering this object only for backwards compatibility. It
429 * will be removed in or after Charitable 1.3.
430 *
431 * @deprecated
432 */
433 $this->register_object( Charitable_Session::get_instance() );
434 }
435
436 /**
437 * This method is fired after all plugins are loaded and simply fires the charitable_start hook.
438 *
439 * Extensions can use the charitable_start event to load their own functionality.
440 *
441 * @return void
442 * @access public
443 * @since 1.0.0
444 */
445 public function charitable_start() {
446 do_action( 'charitable_start', $this );
447 }
448
449 /**
450 * Fires off an action right after Charitable is installed, allowing other
451 * plugins/themes to do something at this point.
452 *
453 * @return void
454 * @access public
455 * @since 1.0.1
456 */
457 public function charitable_install() {
458 $install = get_transient( 'charitable_install' );
459
460 if ( ! $install ) {
461 return;
462 }
463
464 require_once( $this->get_path( 'includes' ) . 'class-charitable-install.php' );
465
466 Charitable_Install::finish_installing();
467
468 do_action( 'charitable_install' );
469
470 delete_transient( 'charitable_install' );
471 }
472
473 /**
474 * Returns whether we are currently in the start phase of the plugin.
475 *
476 * @return bool
477 * @access public
478 * @since 1.0.0
479 */
480 public function is_start() {
481 return current_filter() == 'charitable_start';
482 }
483
484 /**
485 * Returns whether the plugin has already started.
486 *
487 * @return bool
488 * @access public
489 * @since 1.0.0
490 */
491 public function started() {
492 return did_action( 'charitable_start' ) || current_filter() == 'charitable_start';
493 }
494
495 /**
496 * Returns whether the plugin is being activated.
497 *
498 * @return bool
499 * @access public
500 * @since 1.0.0
501 */
502 public function is_activation() {
503 return current_filter() == 'activate_charitable/charitable.php';
504 }
505
506 /**
507 * Returns whether the plugin is being deactivated.
508 *
509 * @return bool
510 * @access public
511 * @since 1.0.0
512 */
513 public function is_deactivation() {
514 return current_filter() == 'deactivate_charitable/charitable.php';
515 }
516
517 /**
518 * Stores an object in the plugin's registry.
519 *
520 * @param mixed $object Object to be registered.
521 * @return void
522 * @access public
523 * @since 1.0.0
524 */
525 public function register_object( $object ) {
526 if ( ! is_object( $object ) ) {
527 return;
528 }
529
530 $class = get_class( $object );
531
532 $this->registry[ $class ] = $object;
533 }
534
535 /**
536 * Returns a registered object.
537 *
538 * @param string $class The type of class you want to retrieve.
539 * @return mixed The object if its registered. Otherwise false.
540 * @access public
541 * @since 1.0.0
542 */
543 public function get_registered_object( $class ) {
544 return isset( $this->registry[ $class ] ) ? $this->registry[ $class ] : false;
545 }
546
547 /**
548 * Returns plugin paths.
549 *
550 * @param string $type If empty, returns the path to the plugin.
551 * @param boolean $absolute_path If true, returns the file system path. If false, returns it as a URL.
552 * @return string
553 * @since 1.0.0
554 */
555 public function get_path( $type = '', $absolute_path = true ) {
556 $base = $absolute_path ? $this->directory_path : $this->directory_url;
557
558 switch ( $type ) {
559 case 'includes' :
560 $path = $base . 'includes/';
561 break;
562
563 case 'admin' :
564 $path = $base . 'includes/admin/';
565 break;
566
567 case 'public' :
568 $path = $base . 'includes/public/';
569 break;
570
571 case 'assets' :
572 $path = $base . 'assets/';
573 break;
574
575 case 'templates' :
576 $path = $base . 'templates/';
577 break;
578
579 case 'directory' :
580 $path = $base;
581 break;
582
583 default :
584 $path = __FILE__;
585
586 }//end switch
587
588 return $path;
589 }
590
591 /**
592 * Returns the plugin's version number.
593 *
594 * @return string
595 * @access public
596 * @since 1.0.0
597 */
598 public function get_version() {
599 $version = self::VERSION;
600
601 if ( false !== strpos( $version, '-' ) ) {
602 $parts = explode( '-', $version );
603 $version = $parts[0];
604 }
605
606 return $version;
607 }
608
609 /**
610 * Returns the public class.
611 *
612 * @return Charitable_Public
613 * @access public
614 * @since 1.0.0
615 */
616 public function get_public() {
617 return $this->get_registered_object( 'Charitable_Public' );
618 }
619
620 /**
621 * Returns the admin class.
622 *
623 * @return Charitable_Admin
624 * @access public
625 * @since 1.0.0
626 */
627 public function get_admin() {
628 return $this->get_registered_object( 'Charitable_Admin' );
629 }
630
631 /**
632 * Return the current request object.
633 *
634 * @return Charitable_Request
635 * @access public
636 * @since 1.0.0
637 */
638 public function get_request() {
639 $request = $this->get_registered_object( 'Charitable_Request' );
640
641 if ( false === $request ) {
642 $request = new Charitable_Request();
643 $this->register_object( $request );
644 }
645
646 return $request;
647 }
648
649 /**
650 * Returns the model for one of Charitable's database tables.
651 *
652 * @param string $table The database table to retrieve.
653 * @return Charitable_DB
654 * @access public
655 * @since 1.0.0
656 */
657 public function get_db_table( $table ) {
658 $tables = $this->get_tables();
659
660 if ( ! isset( $tables[ $table ] ) ) {
661 charitable_get_deprecated()->doing_it_wrong(
662 __METHOD__,
663 sprintf( 'Invalid table %s passed', $table ),
664 '1.0.0'
665 );
666 return null;
667 }
668
669 $class_name = $tables[ $table ];
670
671 $db_table = $this->get_registered_object( $class_name );
672
673 if ( false === $db_table ) {
674 $db_table = new $class_name;
675 $this->register_object( $db_table );
676 }
677
678 return $db_table;
679 }
680
681 /**
682 * Return the filtered list of registered tables.
683 *
684 * @return string[]
685 * @access private
686 * @since 1.0.0
687 */
688 private function get_tables() {
689 $default_tables = array(
690 'campaign_donations' => 'Charitable_Campaign_Donations_DB',
691 'donors' => 'Charitable_Donors_DB',
692 );
693
694 return apply_filters( 'charitable_db_tables', $default_tables );
695 }
696
697 /**
698 * Maybe activate Charitable when a new site is added in a multisite network.
699 *
700 * @param int $blog_id
701 * @return boolean
702 * @access public
703 * @since 1.4.6
704 */
705 public function maybe_activate_charitable_on_new_site( $blog_id ) {
706
707 if ( is_plugin_active_for_network( basename( $this->directory_path ) . '/charitable.php' ) ) {
708
709 switch_to_blog( $blog_id );
710
711 $this->activate( false );
712
713 restore_current_blog();
714 }
715 }
716
717 /**
718 * Runs on plugin activation.
719 *
720 * @see register_activation_hook
721 *
722 * @param boolean $network_wide Whether to enable the plugin for all sites in the network
723 * or just the current site. Multisite only. Default is false.
724 * @return void
725 * @access public
726 * @since 1.0.0
727 */
728 public function activate( $network_wide = false ) {
729
730 require_once( $this->get_path( 'includes' ) . 'class-charitable-install.php' );
731
732 if ( is_multisite() && $network_wide ) {
733
734 global $wpdb;
735
736 foreach ( $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ) as $blog_id ) {
737
738 switch_to_blog( $blog_id );
739
740 new Charitable_Install();
741
742 restore_current_blog();
743 }
744 } else {
745
746 new Charitable_Install();
747
748 }
749 }
750
751 /**
752 * Runs on plugin deactivation.
753 *
754 * @see register_deactivation_hook
755 *
756 * @return void
757 * @access public
758 * @since 1.0.0
759 */
760 public function deactivate() {
761 require_once( $this->get_path( 'includes' ) . 'class-charitable-uninstall.php' );
762 new Charitable_Uninstall();
763 }
764
765 /**
766 * If a charitable_action event is triggered, delegate the event using do_action.
767 *
768 * @return void
769 * @access public
770 * @since 1.0.0
771 */
772 public function do_charitable_actions() {
773 if ( isset( $_REQUEST['charitable_action'] ) ) {
774
775 $action = $_REQUEST['charitable_action'];
776
777 do_action( 'charitable_' . $action, 20 );
778 }
779 }
780
781 /**
782 * Throw error on object clone.
783 *
784 * This class is specifically designed to be instantiated once. You can retrieve the instance using charitable()
785 *
786 * @since 1.0.0
787 * @access public
788 * @return void
789 */
790 public function __clone() {
791 _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'charitable' ), '1.0.0' );
792 }
793
794 /**
795 * Disable unserializing of the class.
796 *
797 * @since 1.0.0
798 * @access public
799 * @return void
800 */
801 public function __wakeup() {
802 _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'charitable' ), '1.0.0' );
803 }
804
805 /**
806 * DEPRECATED METHODS
807 */
808
809 /**
810 * @deprecated
811 */
812 public function get_currency_helper() {
813 charitable_get_deprecated()->deprecated_function( __METHOD__, '1.4.0', 'charitable_get_currency_helper' );
814 return charitable_get_currency_helper();
815 }
816
817 /**
818 * @deprecated
819 */
820 public function get_location_helper() {
821 charitable_get_deprecated()->deprecated_function( __METHOD__, '1.2.0', 'charitable_get_location_helper' );
822 return charitable_get_location_helper();
823 }
824 }
825
826 $charitable = new Charitable();
827
828 endif;
829