From 135bd47bd6669a317cb3ee1cef36b7145abbe36e Mon Sep 17 00:00:00 2001 From: "daan.rijpkema" Date: Thu, 10 Oct 2024 13:09:43 +0200 Subject: [PATCH] More optimizations --- bluem-idin.php | 4 +- bluem-integrations.php | 2388 +++++++++-------- bluem-payments.php | 4 +- gateways/Bluem_Bank_Based_Payment_Gateway.php | 2 +- gateways/Bluem_Mandates_Payment_Gateway.php | 19 +- src/Observability/BluemActivationNotifier.php | 193 +- views/home.php | 20 +- views/importexport.php | 14 +- views/request.php | 23 +- views/requests.php | 6 +- 10 files changed, 1344 insertions(+), 1329 deletions(-) diff --git a/bluem-idin.php b/bluem-idin.php index 347abee..ce05982 100644 --- a/bluem-idin.php +++ b/bluem-idin.php @@ -1638,8 +1638,8 @@ function bluem_get_IDINDescription_replaces(): array $current_user->display_name ?? '', // '{gebruikersnaam}', $current_user->user_email ?? '', // '{email}', (string)($current_user->ID ?? ''), // {klantnummer} - date('d-m-Y'), // '{datum}', - date('d-m-Y H:i'), // '{datumtijd}', + gmdate('d-m-Y'), // '{datum}', + gmdate('d-m-Y H:i'), // '{datumtijd}', ); } diff --git a/bluem-integrations.php b/bluem-integrations.php index 3d126eb..f70f203 100644 --- a/bluem-integrations.php +++ b/bluem-integrations.php @@ -1,89 +1,96 @@

'; +function bluem_woocommerce_integrations_settings_section() +{ + echo '

'; } -function bluem_woocommerce_get_integration_option( $key ) { - $options = bluem_woocommerce_get_integrations_options(); - if ( array_key_exists( $key, $options ) ) { - return $options[ $key ]; - } +function bluem_woocommerce_get_integration_option($key) +{ + $options = bluem_woocommerce_get_integrations_options(); + if (array_key_exists($key, $options)) { + return $options[$key]; + } - return false; + return false; } -function bluem_woocommerce_get_integrations_options() { - return array( - 'gformActive' => array( - 'key' => 'gformActive', - 'title' => 'bluem_gformActive', - 'name' => 'Gravity Forms', - 'description' => 'Activeer de Gravity Forms integratie', - 'type' => 'select', - 'default' => 'N', - 'options' => array( - 'N' => 'Niet actief', - 'Y' => 'Actief', - ), - ), - 'gformResultpage' => array( - 'key' => 'gformResultpage', - 'title' => 'bluem_gformResultpage', - 'name' => 'Slug resultaatpagina', - 'description' => 'De slug van de resultaatpagina', - 'default' => '', - ), - 'wpcf7Active' => array( - 'key' => 'wpcf7Active', - 'title' => 'bluem_wpcf7Active', - 'name' => 'ContactForm 7', - 'description' => 'Activeer de ContactForm 7 integratie', - 'type' => 'select', - 'default' => 'N', - 'options' => array( - 'N' => 'Niet actief', - 'Y' => 'Actief', - ), - ), - 'wpcf7Resultpage' => array( - 'key' => 'wpcf7Resultpage', - 'title' => 'bluem_wpcf7Resultpage', - 'name' => 'Slug resultaatpagina', - 'description' => 'De slug van de resultaatpagina', - 'default' => '', - ), - ); +function bluem_woocommerce_get_integrations_options() +{ + return array( + 'gformActive' => array( + 'key' => 'gformActive', + 'title' => 'bluem_gformActive', + 'name' => 'Gravity Forms', + 'description' => 'Activeer de Gravity Forms integratie', + 'type' => 'select', + 'default' => 'N', + 'options' => array( + 'N' => 'Niet actief', + 'Y' => 'Actief', + ), + ), + 'gformResultpage' => array( + 'key' => 'gformResultpage', + 'title' => 'bluem_gformResultpage', + 'name' => 'Slug resultaatpagina', + 'description' => 'De slug van de resultaatpagina', + 'default' => '', + ), + 'wpcf7Active' => array( + 'key' => 'wpcf7Active', + 'title' => 'bluem_wpcf7Active', + 'name' => 'ContactForm 7', + 'description' => 'Activeer de ContactForm 7 integratie', + 'type' => 'select', + 'default' => 'N', + 'options' => array( + 'N' => 'Niet actief', + 'Y' => 'Actief', + ), + ), + 'wpcf7Resultpage' => array( + 'key' => 'wpcf7Resultpage', + 'title' => 'bluem_wpcf7Resultpage', + 'name' => 'Slug resultaatpagina', + 'description' => 'De slug van de resultaatpagina', + 'default' => '', + ), + ); } -function bluem_woocommerce_settings_render_gformActive() { - bluem_woocommerce_settings_render_input( - bluem_woocommerce_get_integration_option( 'gformActive' ) - ); +function bluem_woocommerce_settings_render_gformActive() +{ + bluem_woocommerce_settings_render_input( + bluem_woocommerce_get_integration_option('gformActive') + ); } -function bluem_woocommerce_settings_render_gformResultpage() { - bluem_woocommerce_settings_render_input( - bluem_woocommerce_get_integration_option( 'gformResultpage' ) - ); +function bluem_woocommerce_settings_render_gformResultpage() +{ + bluem_woocommerce_settings_render_input( + bluem_woocommerce_get_integration_option('gformResultpage') + ); } -function bluem_woocommerce_settings_render_wpcf7Active() { - bluem_woocommerce_settings_render_input( - bluem_woocommerce_get_integration_option( 'wpcf7Active' ) - ); +function bluem_woocommerce_settings_render_wpcf7Active() +{ + bluem_woocommerce_settings_render_input( + bluem_woocommerce_get_integration_option('wpcf7Active') + ); } -function bluem_woocommerce_settings_render_wpcf7Resultpage() { - bluem_woocommerce_settings_render_input( - bluem_woocommerce_get_integration_option( 'wpcf7Resultpage' ) - ); +function bluem_woocommerce_settings_render_wpcf7Resultpage() +{ + bluem_woocommerce_settings_render_input( + bluem_woocommerce_get_integration_option('wpcf7Resultpage') + ); } /** @@ -91,16 +98,17 @@ function bluem_woocommerce_settings_render_wpcf7Resultpage() { * * Javascript code in footer. */ -add_action( 'wp_footer', 'bluem_woocommerce_integration_wpcf7_javascript' ); +add_action('wp_footer', 'bluem_woocommerce_integration_wpcf7_javascript'); -function bluem_woocommerce_integration_wpcf7_javascript() { - $bluem_config = bluem_woocommerce_get_config(); +function bluem_woocommerce_integration_wpcf7_javascript() +{ + $bluem_config = bluem_woocommerce_get_config(); - if ( $bluem_config->wpcf7Active !== 'Y' ) { - return; - } + if ($bluem_config->wpcf7Active !== 'Y') { + return; + } - echo ' + echo '