-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·104 lines (77 loc) · 3.93 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
/*
Plugin Name: Gravity Forms + Profiler Add-On
Plugin URI: https://mediarealm.com.au/
Description: Integrates Gravity Forms with Profiler, enabling donation data and more to be sent directly to Profiler.
Version: 2.5.1
Author: Media Realm
Author URI: https://www.mediarealm.com.au/
License: GPL2
'Profiler Donations - Gravity Forms Add-On' is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.
'Profiler Donations - Gravity Forms Add-On' is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with 'Profiler Donations - Gravity Forms Add-On'. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
*/
add_action('gform_loaded', array('ProfilerDonation_GF_Launch', 'ProfilerDonation_load'), 5);
class ProfilerDonation_GF_Launch {
public static function ProfilerDonation_load() {
if (!class_exists('GFForms') || !method_exists('GFForms', 'include_payment_addon_framework')) {
return;
}
// Ensure the framework is included
GFForms::include_payment_addon_framework();
// Include the new common class
require_once('class-profilercommon.php');
// Inclue the feed classes
require_once('class-profilerdonate-gfaddon.php');
GFAddOn::register('GFProfilerDonate');
require_once('class-profilerinteraction-gfaddon.php');
GFAddOn::register('GFProfilerInteraction');
require_once('class-profilerpostdonate-gfaddon.php');
GFAddOn::register('GFProfilerPostDonate');
require_once('class-profilerlists-gfaddon.php');
GFAddOn::register('GFProfilerLists');
require_once('class-profilerlistsbasic-gfaddon.php');
GFAddOn::register('GFProfilerListsBasic');
require_once('class-profilermembership-gfaddon.php');
GFAddOn::register('GFProfilerMembership');
require_once('class-profilerupdate-gfaddon.php');
GFAddOn::register('GFProfilerUpdate');
//require_once('class-profilerevents-gfaddon.php');
//GFAddOn::register('GFProfilerEvents');
// This is a settings screen to list all Profiler feeds in the system
require_once('class-feedlist-gfaddon.php');
GFAddOn::register('GF_Profiler_FeedList');
// Include some random helper functions
require_once(plugin_dir_path(__FILE__) . '/shortcodes.php');
require_once(plugin_dir_path(__FILE__) . '/states_australia.php');
require_once(plugin_dir_path(__FILE__) . '/cardprocess.php');
// Feature to allow importing user accounts from Profiler
require_once(plugin_dir_path(__FILE__) . '/sync_users.php');
// Feature to allow importing Organisations from Profiler
require_once(plugin_dir_path(__FILE__) . '/sync_orgtype.php');
if(isset($_POST['gform_submit'])) {
// If we're receiving a Gravity Form submission, ensure the session is started
// We use sessions to communicate with shortcodes
if(!session_id()) {
session_start();
}
}
// Warning if the SimpleXML Functions aren't available on this system
add_action('admin_notices', function() {
if(!function_exists('simplexml_load_string')) {
echo '<div class="notice notice-warning">
<p>SimpleXML Module is not found in PHP. Your Gravity Forms + Profiler integration will not work. Please install the PHP XML package.</p>
</div>';
}
});
}
}
// Load WooCommerce extension
require_once(plugin_dir_path(__FILE__) . '/woocommerce/load.php');