File: /home/luxbsolr/cardsord.store/wp-content/plugins/shopay-for-woocommerce/syntax-check.php
<?php
/**
* Quick Plugin Syntax Check
* Run this to test for PHP syntax errors
*/
if (!defined('ABSPATH')) {
define('ABSPATH', dirname(__FILE__) . '/');
}
echo "š Checking plugin files for syntax errors...\n\n";
$files_to_check = [
'woocommerce-gateway-dummy.php',
'includes/class-wc-gateway-dummy.php',
'includes/class-wc-shopay-payments-admin.php',
'includes/class-wc-shopay-webhooks.php',
'includes/blocks/class-wc-dummy-payments-blocks.php'
];
$errors_found = false;
foreach ($files_to_check as $file) {
if (file_exists($file)) {
echo "ā Checking {$file}... ";
// Check for syntax errors
$output = shell_exec("php -l \"{$file}\" 2>&1");
if (strpos($output, 'No syntax errors') !== false) {
echo "ā
OK\n";
} else {
echo "ā SYNTAX ERROR\n";
echo " {$output}\n";
$errors_found = true;
}
} else {
echo "ā ļø File not found: {$file}\n";
}
}
echo "\n";
if (!$errors_found) {
echo "š All files passed syntax check!\n";
echo " The plugin should activate without fatal errors.\n\n";
echo "š Next steps:\n";
echo " 1. Upload plugin to WordPress\n";
echo " 2. Activate in admin\n";
echo " 3. Configure Shopify settings\n";
echo " 4. Test the direct redirect flow\n";
} else {
echo "šØ Syntax errors found! Fix these before activating.\n";
}
echo "\nš Key Integration Points:\n";
echo " ⢠Gateway: Direct redirect to Shopify (no popups)\n";
echo " ⢠Return: /?shopay_return=1&order_id=X&order_key=Y\n";
echo " ⢠Webhook: /wp-json/shopay/v1/webhook/orders-paid\n";
echo " ⢠Status: /wp-json/shopay/v1/order-status\n";
?>