From 40c7892f4b26043d3e060bc6b5baf77dea460560 Mon Sep 17 00:00:00 2001 From: carlhandy Date: Thu, 18 Jul 2024 02:19:57 -0400 Subject: [PATCH] debugging --- includes/class-mmg-checkout-payment.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/class-mmg-checkout-payment.php b/includes/class-mmg-checkout-payment.php index 8f8087b6..db6ae818 100644 --- a/includes/class-mmg-checkout-payment.php +++ b/includes/class-mmg-checkout-payment.php @@ -23,7 +23,14 @@ public function __construct() { new MMG_Checkout_Settings(); // Include phpseclib - require_once dirname(__FILE__) . '/vendor/autoload.php'; + $autoload_path = dirname(__FILE__) . '/vendor/autoload.php'; + if (!file_exists($autoload_path)) { + add_action('admin_notices', function() { + echo '

MMG Checkout Payment: phpseclib3 library is missing. Please run "composer install" in the plugin directory.

'; + }); + return; // Exit the constructor to prevent further errors + } + require_once $autoload_path; add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts')); add_action('wp_ajax_generate_checkout_url', array($this, 'generate_checkout_url'));