@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | defined( 'ABSPATH' ) || die( 'This plugin must be run within the scope of WordPress.' ); |
3 | 3 | |
4 | -if ( ! class_exists( 'EDU_KlarnaCheckout' ) ) { |
|
4 | +if ( !class_exists( 'EDU_KlarnaCheckout' ) ) { |
|
5 | 5 | class EDU_KlarnaCheckout extends EDU_Integration { |
6 | 6 | public function __construct() { |
7 | 7 | $this->id = 'eduadmin-klarnacheckout'; |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | defined( 'ABSPATH' ) || die( 'This plugin must be run within the scope of WordPress.' ); |
3 | 3 | |
4 | -if ( ! class_exists( 'EDU_KlarnaCheckout' ) ) { |
|
5 | - class EDU_KlarnaCheckout extends EDU_Integration { |
|
6 | - public function __construct() { |
|
4 | +if ( ! class_exists( 'EDU_KlarnaCheckout' ) ) { |
|
5 | + class EDU_KlarnaCheckout extends EDU_Integration { |
|
6 | + public function __construct() { |
|
7 | 7 | $this->id = 'eduadmin-klarnacheckout'; |
8 | 8 | $this->displayName = __( 'Klarna Checkout', 'eduadmin-wp-klarna-checkout' ); |
9 | 9 | $this->description = ''; |
@@ -16,25 +16,25 @@ discard block |
||
16 | 16 | add_action( 'wp_loaded', array( $this, 'process_klarnaresponse' ) ); |
17 | 17 | } |
18 | 18 | |
19 | - public function intercept_booking() { |
|
20 | - if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
19 | + public function intercept_booking() { |
|
20 | + if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
21 | 21 | return; |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | - public function process_booking() { |
|
26 | - if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
25 | + public function process_booking() { |
|
26 | + if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
27 | 27 | return; |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | - public function process_klarnaresponse() { |
|
32 | - if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
31 | + public function process_klarnaresponse() { |
|
32 | + if ( 'no' === $this->get_option( 'enabled', 'no' ) ) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
37 | - public function init_form_fields() { |
|
37 | + public function init_form_fields() { |
|
38 | 38 | $this->setting_fields = array( |
39 | 39 | 'enabled' => array( |
40 | 40 | 'title' => __( 'Enabled', 'edauadmin-wp-klarna-checkout' ), |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
30 | 30 | */ |
31 | 31 | |
32 | -add_action( 'admin_init', function () { |
|
33 | - if ( is_admin() && current_user_can( 'activate_plugins' ) && ( ! is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) { |
|
34 | - add_action( 'admin_notices', function () { |
|
32 | +add_action( 'admin_init', function() { |
|
33 | + if ( is_admin() && current_user_can( 'activate_plugins' ) && ( !is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && !is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) { |
|
34 | + add_action( 'admin_notices', function() { |
|
35 | 35 | ?> |
36 | 36 | <div class="error"> |
37 | 37 | <p><?php esc_html_e( 'This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-wp-klarna-checkout' ); ?></p> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | } ); |
47 | 47 | |
48 | -if ( ! class_exists( 'EDU_KlarnaCheckout_Loader' ) ) { |
|
48 | +if ( !class_exists( 'EDU_KlarnaCheckout_Loader' ) ) { |
|
49 | 49 | final class EDU_KlarnaCheckout_Loader { |
50 | 50 | public function __construct() { |
51 | 51 | add_action( 'plugins_loaded', array( $this, 'init' ) ); |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
30 | 30 | */ |
31 | 31 | |
32 | -add_action( 'admin_init', function () { |
|
33 | - if ( is_admin() && current_user_can( 'activate_plugins' ) && ( ! is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) { |
|
34 | - add_action( 'admin_notices', function () { |
|
32 | +add_action( 'admin_init', function () { |
|
33 | + if ( is_admin() && current_user_can( 'activate_plugins' ) && ( ! is_plugin_active( 'eduadmin-booking/eduadmin.php' ) && ! is_plugin_active( 'eduadmin/eduadmin.php' ) ) ) { |
|
34 | + add_action( 'admin_notices', function () { |
|
35 | 35 | ?> |
36 | 36 | <div class="error"> |
37 | 37 | <p><?php esc_html_e( 'This plugin requires the EduAdmin-WordPress-plugin to be installed and activated.', 'eduadmin-wp-klarna-checkout' ); ?></p> |
@@ -39,27 +39,27 @@ discard block |
||
39 | 39 | <?php |
40 | 40 | } ); |
41 | 41 | deactivate_plugins( plugin_basename( __FILE__ ) ); |
42 | - if ( isset( $_GET['activate'] ) ) { |
|
42 | + if ( isset( $_GET['activate'] ) ) { |
|
43 | 43 | unset( $_GET['activate'] ); |
44 | 44 | } |
45 | 45 | } |
46 | 46 | } ); |
47 | 47 | |
48 | -if ( ! class_exists( 'EDU_KlarnaCheckout_Loader' ) ) { |
|
49 | - final class EDU_KlarnaCheckout_Loader { |
|
50 | - public function __construct() { |
|
48 | +if ( ! class_exists( 'EDU_KlarnaCheckout_Loader' ) ) { |
|
49 | + final class EDU_KlarnaCheckout_Loader { |
|
50 | + public function __construct() { |
|
51 | 51 | add_action( 'plugins_loaded', array( $this, 'init' ) ); |
52 | 52 | } |
53 | 53 | |
54 | - public function init() { |
|
55 | - if ( class_exists( 'EDU_Integration' ) ) { |
|
54 | + public function init() { |
|
55 | + if ( class_exists( 'EDU_Integration' ) ) { |
|
56 | 56 | require_once __DIR__ . '/class-edu-klarnacheckout.php'; |
57 | 57 | |
58 | 58 | add_filter( 'edu_integrations', array( $this, 'add_integration' ) ); |
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | - public function add_integration( $integrations ) { |
|
62 | + public function add_integration( $integrations ) { |
|
63 | 63 | $integrations[] = 'EDU_KlarnaCheckout'; |
64 | 64 | |
65 | 65 | return $integrations; |