fix: PHP errors and clean up error_log statements

- Fixed redirect_wc_pages_to_spa: added spa_mode check (only redirect when 'full')
- Fixed PHP fatal error: use get_queried_object() instead of global $product
- Removed all error_log debug statements from codebase
- Fixed broken syntax in PaymentGatewaysProvider.php after error_log removal
This commit is contained in:
Dwindi Ramadhana
2026-01-04 10:49:47 +07:00
parent 75a82cf16c
commit 670bd7d351
12 changed files with 11 additions and 73 deletions

View File

@@ -58,7 +58,6 @@ class Installer {
$wc_page_id = get_option($page_data['wc_option']);
if ($wc_page_id && get_post($wc_page_id)) {
$page_id = $wc_page_id;
error_log("WooNooW: Found existing WooCommerce {$page_data['title']} page (ID: {$page_id})");
}
}
@@ -67,7 +66,6 @@ class Installer {
$woonoow_page_id = get_option('woonoow_' . $key . '_page_id');
if ($woonoow_page_id && get_post($woonoow_page_id)) {
$page_id = $woonoow_page_id;
error_log("WooNooW: Found existing WooNooW {$page_data['title']} page (ID: {$page_id})");
}
}
@@ -76,7 +74,6 @@ class Installer {
$existing_page = get_page_by_title($page_data['title'], OBJECT, 'page');
if ($existing_page) {
$page_id = $existing_page->ID;
error_log("WooNooW: Found existing {$page_data['title']} page by title (ID: {$page_id})");
}
}
@@ -95,9 +92,7 @@ class Installer {
'post_content' => $page_data['content'],
]);
error_log("WooNooW: Updated {$page_data['title']} page with WooNooW shortcode");
} else {
error_log("WooNooW: {$page_data['title']} page already has WooNooW shortcode");
}
} else {
// No existing page found, create new one
@@ -111,7 +106,6 @@ class Installer {
]);
if ($page_id && !is_wp_error($page_id)) {
error_log("WooNooW: Created new {$page_data['title']} page (ID: {$page_id})");
}
}
@@ -162,7 +156,6 @@ class Installer {
// Remove backup
delete_post_meta($page_id, '_woonoow_original_content');
error_log("WooNooW: Restored original content for page ID: {$page_id}");
}
}
}