Commit 7b44f81
Refactor/reduce complexity v2 (#402)
* WIP: Refactor reduce complexity v2 - local changes
* Remove backups folder from repository
* Remove all markdown documentation files
* Fix: Production-ready improvements and critical fixes
- Fix workflow region validation to prevent invalid API URLs
- Add input sanitization for region settings
- Early load utility class to fix critical error on plugin activation
- Wrap debug error_log statements in WP_DEBUG checks
- Remove unnecessary debug logging from wrapper functions
- Regenerate composer autoloader without dev dependencies
- Restore README.md and languages/README.md files
- Improve production readiness and WordPress coding standards compliance
* Fix: Prevent invalid public key error during key registration
- Add validation to check API keys before SDK initialization
- Gracefully handle empty keys during initial setup/registration
- Only log SDK initialization failures when WP_DEBUG is enabled
- Fix region subdomain validation to handle 'global' value
- Use null coalescing operator for safer array access
* Fix: PayPal Express webhook matching for order status updates
- Update Flow webhook handler Method 3 to check both _cko_flow_payment_id and _cko_payment_id meta keys
- Add immediate order save after PayPal Express payment ID is set (before status update)
- Process pending webhooks after payment ID is saved to handle race conditions
- Update payment ID validation to check both meta keys for compatibility
- Fixes issue where PayPal Express orders (using _cko_payment_id) were not found by webhook handler
- Ensures webhooks can match orders regardless of payment method type
* Fix payment method title spacing and improve webhook/flow integration
- Fix payment method title spacing issues on checkout page for both newer and older WooCommerce versions
- Add higher specificity CSS rules to override theme styles
- Move Terms Checkbox Guard setting to Advanced → Debug Settings
- Improve webhook/workflow duplicate detection with URL normalization
- Add auto-generated webhook/workflow names
- Enhance error messaging for multiple webhook scenarios
- Add Flow integration modules for better code organization
- Improve CSS loading order to ensure proper style precedence
* docs: update README with setup guides for Flow, Apple Pay, Google Pay, and PayPal
* Refactor: Remove Reflection, implement WooCommerce public APIs and order-first checkout flow
- Remove all Reflection usage and migrate to public WooCommerce APIs
- Implement order-first checkout flow using WC()->checkout->create_order() for subscription compatibility
- Add proper WooCommerce hooks (woocommerce_checkout_order_processed, etc.)
- Fix webhook queue cleanup handler with proper error handling and redirects
- Register standalone webhook queue admin page for action handlers
- Move diagnostics to admin-only tools page (class-wc-checkoutcom-diagnostics.php)
- Remove subscription diagnostic logs
- Add Docker setup files for local development
- Fix WordPress coding standards (sanitization, capability checks, nonces)
- Remove test scripts from build (moved to admin diagnostics page)
* Remove Docker files from repository and add to .gitignore
- Remove Docker setup files from git tracking (keep locally for development)
- Add Docker files to .gitignore to prevent future commits
* Remove composer.phar from git tracking (should be local only)
* Add plugin zip file for distribution
* Move plugin zip file to releases directory
* Add plugin zip file to releases directory
* Update .gitignore to allow zip files in releases directory
* Add defensive JSON parsing for AJAX responses with leading junk
- Handle responses that contain extra output before JSON (e.g., '200' prefix)
- Extract JSON from response text even if plugins/server inject output
- Prevents parsererror when response is valid JSON but has leading characters
- Minimal performance impact (only runs on order creation AJAX call)
* Apply WooCommerce coding standards: prefix CSS classes and global functions
- Prefix all Flow CSS classes with cko-flow__ (BEM naming convention)
- Prefix global functions with cko_ prefix
- Update JavaScript to use prefixed CSS classes
- Scope admin script enqueues to specific pages
- Fix CSS syntax errors and brace balance
* Fix Flow checkout styling and localize waiting text
* Simplify express checkout CSS and unify cart button placement
- Remove inline styles and hardcoded headings from express checkout buttons
- Move minimal CSS to external stylesheet for theme compatibility
- Remove 'Express Checkout' headings to let themes control labels
- Unify cart page button placement - all buttons now render in shared container
- Consistent placement for Apple Pay, Google Pay, and PayPal on cart page
- Industry-standard approach: minimal plugin CSS, provider handles button styling
* Update release zip with express checkout CSS simplifications
* Fix Flow postcode validation on custom checkouts
* Update release zip
* Fix webhook processing for subscription renewals
* Update release zip
* Fix Cardholder Name Position setting save and display
- Add manual sync for Flow settings (flow_component_cardholder_name_position, flow_show_card_holder_name, flow_saved_payment) in Card Settings save handler
- Normalize cardholder name position value (top/bottom/hidden) in flow-customization.js
- Only prefill cardholder name when position is not 'hidden'
- Ensures settings save correctly and pass through to Flow SDK
* Update release zip with Cardholder Name Position fix
* Fix multiple Checkout.com entries in Payments settings and update README
- Fix admin.js loading on main Payments list to hide duplicate gateways
- Update README with comprehensive upgrade guide to Flow
- Add Express Payments Apple Pay setup guide with detailed steps
- Document Card Settings and Order Settings review steps
* Clean up admin JS and Flow terms helper for CodeQL
---------
Co-authored-by: Lalit Swain <lalit@example.com>1 parent aae35f6 commit 7b44f81
File tree
60 files changed
+15231
-4663
lines changed- assets
- css
- js
- bin
- flow-integration
- assets
- css
- js
- modules
- includes
- admin
- api
- blocks
- express
- apple-pay
- google-pay
- paypal
- settings
- admin
- subscription
- lib
- releases
- templates
- tests
- vendor
- composer
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
60 files changed
+15231
-4663
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
53 | 210 | | |
54 | 211 | | |
55 | 212 | | |
| |||
86 | 243 | | |
87 | 244 | | |
88 | 245 | | |
| 246 | + | |
89 | 247 | | |
90 | 248 | | |
91 | 249 | | |
| |||
152 | 310 | | |
153 | 311 | | |
154 | 312 | | |
155 | | - | |
156 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
157 | 316 | | |
158 | 317 | | |
159 | 318 | | |
| |||
217 | 376 | | |
218 | 377 | | |
219 | 378 | | |
| 379 | + | |
220 | 380 | | |
221 | 381 | | |
222 | 382 | | |
| |||
267 | 427 | | |
268 | 428 | | |
269 | 429 | | |
270 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
271 | 441 | | |
272 | 442 | | |
273 | 443 | | |
| |||
286 | 456 | | |
287 | 457 | | |
288 | 458 | | |
| 459 | + | |
289 | 460 | | |
290 | 461 | | |
291 | 462 | | |
| |||
296 | 467 | | |
297 | 468 | | |
298 | 469 | | |
299 | | - | |
| 470 | + | |
300 | 471 | | |
301 | 472 | | |
302 | 473 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
311 | 478 | | |
312 | 479 | | |
313 | 480 | | |
| |||
0 commit comments