feat: Complete analytics implementation with all 7 pages, ROI calculation, conversion rate formatting, and chart improvements

This commit is contained in:
dwindown
2025-11-04 18:08:00 +07:00
parent 232059e928
commit 7c0d9639b6
6 changed files with 1124 additions and 120 deletions

View File

@@ -29,4 +29,12 @@ class Permissions {
$nonce = $_SERVER['HTTP_X_WP_NONCE'] ?? '';
return (bool) wp_verify_nonce($nonce, 'wp_rest');
}
/**
* Check if user has admin/manage_woocommerce permission
* Used for analytics and admin-only endpoints
*/
public static function check_admin_permission(): bool {
return current_user_can('manage_woocommerce') || current_user_can('manage_options');
}
}