-
Notifications
You must be signed in to change notification settings - Fork 0
/
wpforms-epfl-payonline.php
89 lines (78 loc) · 2.85 KB
/
wpforms-epfl-payonline.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
<?php
/**
* Plugin Name: WPForms EPFL Payonline
* Plugin URI: https://github.com/epfl-si/wpforms-epfl-payonline
* Description: EPFL Payonline integration with WPForms.
* Author: EPFL ISAS-FSD
* Author URI: https://go.epfl.ch/idev-fsd
* Contributor: Nicolas Borboën <[email protected]>
* Version: 1.8.1
* Text Domain: wpforms-epfl-payonline
* Domain Path: languages
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*
* WPForms EPFL Payonline 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.
*
* WPForms EPFL Payonline 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 WPForms EPFL Payonline.
* If not, see <http://www.gnu.org/licenses/>.
*
* @package WPFormsEPFLPayonline
* @license GPL-2.0+
* @copyright Copyright (c) 2019, EPFL
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Plugin version.
define( 'WPFORMS_EPFL_PAYONLINE_VERSION', '1.8.1' );
// Plugin name.
define( 'WPFORMS_EPFL_PAYONLINE_NAME', 'WPForms EPFL Payonline' );
// Latest WP version tested with this plugin.
define( 'WP_LATEST_VERSION_WPFORMS_EPFL_PAYONLINE', '6.1.1' );
// Minimal WP version required for this plugin.
define( 'WP_MIN_VERSION_WPFORMS_EPFL_PAYONLINE', '5.0' );
// Plugin Folder Path.
if ( ! defined( 'WPFORMS_EPFL_PAYONLINE_PLUGIN_DIR' ) ) {
define( 'WPFORMS_EPFL_PAYONLINE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
// Plugin Folder URL.
if ( ! defined( 'WPFORMS_EPFL_PAYONLINE_PLUGIN_URL' ) ) {
define( 'WPFORMS_EPFL_PAYONLINE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
/**
* Load the payment class.
*/
function wpforms_epfl_payonline() {
// WPForms Pro is required.
if ( ! class_exists( 'WPForms_Pro' ) ) {
return;
}
load_plugin_textdomain( 'wpforms-epfl-payonline', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
require_once plugin_dir_path( __FILE__ ) . 'class-wpforms-epfl-payonline.php';
require_once plugin_dir_path( __FILE__ ) . 'class-epfl-conference-form-template.php';
require_once plugin_dir_path( __FILE__ ) . 'class-epfl-donation-form-template.php';
}
add_action( 'wpforms_loaded', 'wpforms_epfl_payonline' );
// WPForms requires WP_Filesystem() to be of ->method === "direct".
// For some reason (likely pertaining to our symlink scheme),
// WordPress' autodetection fails. This is equivalent to setting the
// `FS_METHOD` constant in `wp-confing.php`.
add_filter(
'filesystem_method',
function() {
return 'direct';
},
10,
3
);