Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
carlHandy committed Jul 18, 2024
1 parent 453e171 commit 40c7892
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion includes/class-mmg-checkout-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<div class="error"><p>MMG Checkout Payment: phpseclib3 library is missing. Please run "composer install" in the plugin directory.</p></div>';
});
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'));
Expand Down

0 comments on commit 40c7892

Please sign in to comment.