Files
WooNooW/scratch.php
Dwindi Ramadhana 396ca25be4 feat: Page Editor v1.0 - canonical schema, SSR parity, and migration
Major improvements to WooNooW Page Editor system:

Schema & Architecture:
- Canonical section schema with unified sectionSchema.ts
- Normalized feature-grid to use items (not features)
- Standardized default values across all section types
- Schema versioning with automatic migration on read

Backend (PHP):
- Enhanced PlaceholderRenderer with typed output contracts
- Added fallback behavior for empty/invalid dynamic sources
- Added caching support for post data resolution
- New SchemaMigration class for backward compatibility
- New Features class for feature flags
- Enhanced PageSSR with full style support
- Removed controller-level special-casing for related_posts

Frontend (Admin SPA):
- Updated CanvasRenderer with schema-aware transformation
- Enhanced InspectorPanel with canonical schema metadata
- Added new section renderers

Frontend (Customer SPA):
- New section components: BentoCategoryGrid, MarqueeBanner, ProductCarousel, ShoppableImage
- Updated FeatureGridSection for items prop contract

Testing:
- Add PHP tests: SchemaMigrationTest, PlaceholderRendererTest, PageSSRTest
- Add TypeScript tests: schema-integration, feature-grid-regression
- Add parity tests for React vs SSR content matching
- Add CI script: check-schema-drift.mjs
- Add VERIFICATION_CHECKLIST.md

Documentation:
- RELEASE_NOTES-v1.0.md with full release notes
- docs/PAGE_EDITOR_SECTION_SCHEMA_V1.md
- docs/PAGE_EDITOR_SSR_COVERAGE_AUDIT.md
2026-05-30 13:02:08 +07:00

22 lines
686 B
PHP

<?php
require_once '/Users/dwindown/Local Sites/woonoow/app/public/wp-load.php';
$product = new WC_Product_Simple();
$product->set_name('Test API Virtual ' . time());
$product->set_regular_price('10.00');
$product->set_virtual(true);
$product->set_downloadable(true);
$id = $product->save();
$p2 = wc_get_product($id);
echo "Virtual: " . ($p2->is_virtual() ? 'yes' : 'no') . "\n";
echo "Downloadable: " . ($p2->is_downloadable() ? 'yes' : 'no') . "\n";
$p2->set_virtual(false);
$p2->set_downloadable(false);
$p2->save();
$p3 = wc_get_product($id);
echo "Virtual: " . ($p3->is_virtual() ? 'yes' : 'no') . "\n";
echo "Downloadable: " . ($p3->is_downloadable() ? 'yes' : 'no') . "\n";