Conversation
… BladeTemplate, BladeSection, BladeInclude types in types.go- Implement BladeAnalyzer with 8 regex extractors for Blade directives (@extends, @section, @yield, @include, @component, @each, @push/@stack, @props)- Add findBladeFiles() for recursive .blade.php discovery- Add convertBladeToChunks() with inheritance/dependency relations- Integrate BladeAnalyzer into Laravel Enrich() pipeline- Add 9 comprehensive unit tests (all passing)Closes: Trello cards #104-#111
- Add OxygenInfo and WooCommerceInfo fields to WordPressInfo struct - Add oxygen.Analyzer and woocommerce.Analyzer to WordPress Analyzer - Call Oxygen analyzer in analyzeWordPress() for OxyEl element detection - Call WooCommerce analyzer for hook classification by area (cart, checkout, product, etc.) - Convert Oxygen elements/templates and WC hooks/API calls to CodeChunks - Break import cycle: woocommerce package no longer imports wordpress - Define WPHookInput in woocommerce as local mirror of WPHook - Reimplement AST helpers locally in woocommerce package - Add integration tests: - TestAnalyzer_OxygenElementDetection (end-to-end OxyEl detection) - TestAnalyzer_WooCommerceHookClassification (end-to-end WC area classification) - TestConvertToChunks_OxygenAndWooCommerce (nil safety)
There was a problem hiding this comment.
Pull request overview
Integrates existing Oxygen Builder and WooCommerce analyzers into the WordPress parsing pipeline to emit enriched framework-specific CodeChunks; additionally introduces Laravel Blade template parsing/chunking.
Changes:
- WordPress: call Oxygen/WooCommerce analyzers during
analyzeWordPress()and emitoxy_*/wc_*chunks inconvertToChunks(). - WooCommerce: break
wordpressimport cycle by introducing localWPHookInputand local AST helpers. - Laravel: add Blade template analyzer + adapter conversions + tests; update
.gitignore.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/parser/php/wordpress/woocommerce/analyzer_test.go | Updates WooCommerce hook classification test to use local WPHookInput. |
| pkg/parser/php/wordpress/woocommerce/analyzer.go | Removes wordpress dependency; adds WPHookInput + local AST helpers. |
| pkg/parser/php/wordpress/types.go | Extends WordPressInfo with OxygenInfo / WooCommerceInfo (as any) to avoid cycles. |
| pkg/parser/php/wordpress/analyzer_test.go | Adds WordPress integration tests for Oxygen/WooCommerce + nil-safety check. |
| pkg/parser/php/wordpress/analyzer.go | Wires Oxygen/WooCommerce analyzers into WP pipeline and chunk conversion. |
| pkg/parser/php/laravel/types.go | Adds BladeTemplate types to LaravelInfo. |
| pkg/parser/php/laravel/enricher.go | Runs Blade discovery + Blade analyzer and appends resulting chunks. |
| pkg/parser/php/laravel/blade_test.go | Adds unit tests for Blade directive extraction and view-name formatting. |
| pkg/parser/php/laravel/blade.go | Implements line-oriented Blade directive parser via regexes. |
| pkg/parser/php/laravel/adapter.go | Adds Blade file discovery and template→chunk conversion with relations. |
| .gitignore | Ignores docs/plans/*.md. |
You can also share your feedback on Copilot code review. Take the survey.
- Fix misleading 'Enrich DONE' log emitted before Blade analysis (enricher.go) - Fix wc_hook signature to use real WP functions (add_action/add_filter/etc.) - Populate WooCommerce APICalls via woocommerceAnalyzer.Analyze() in AST walk - Add missing AST cases to extractExprValue (ScalarDnumber, ExprConstFetch, ExprClassConstFetch) - Fix Blade reSection regex to capture inline sections like @section('title', 'Dashboard') - Set EndLine on blade_template chunks using TotalLines from BladeTemplate struct Signed-off-by: doITmagic <doitmagic@users.noreply.github.com>
- Fix misleading 'Enrich DONE' log emitted before Blade analysis (enricher.go) - Fix wc_hook signature to use real WP functions (add_action/add_filter/etc.) - Populate WooCommerce APICalls via woocommerceAnalyzer.Analyze() in AST walk - Add missing AST cases to extractExprValue (ScalarDnumber, ExprConstFetch, ExprClassConstFetch) - Fix Blade reSection regex to capture inline sections like @section('title', 'Dashboard') - Set EndLine on blade_template chunks using TotalLines from BladeTemplate struct Signed-off-by: doITmagic <razvan@doitmagic.com>
967107e to
4cbac50
Compare
go.mod requires Go 1.24.4 but CI workflows were using Go 1.22, causing 'no such file or directory' errors during test runs. Signed-off-by: doITmagic <razvan@doitmagic.com>
There was a problem hiding this comment.
Pull request overview
Integrates plugin-specific analyzers (Oxygen Builder + WooCommerce) into the main WordPress analyzer so their patterns are indexed as enriched CodeChunks; additionally introduces Laravel Blade template analysis in the Laravel enricher.
Changes:
- WordPress: wire
oxygen+woocommerceanalyzers intoanalyzeWordPress()and emit new chunk types (oxy_element,oxy_template,wc_hook,wc_api_call). - WooCommerce: break
wordpressimport cycle by introducingWPHookInputand local AST helper logic. - Laravel: add Blade template parsing + chunk conversion (new analyzer + tests) and run it from the Laravel enricher.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/parser/php/wordpress/analyzer.go | Integrates Oxygen/WooCommerce analyzers; emits Oxygen/WooCommerce chunks; adds WC hook signature builder |
| pkg/parser/php/wordpress/types.go | Adds OxygenInfo any and WooCommerceInfo any fields to WordPressInfo |
| pkg/parser/php/wordpress/analyzer_test.go | Adds end-to-end integration tests for Oxygen/WooCommerce and nil-safety coverage |
| pkg/parser/php/wordpress/woocommerce/analyzer.go | Removes wordpress dependency; adds WPHookInput + local AST helpers |
| pkg/parser/php/wordpress/woocommerce/analyzer_test.go | Updates tests to use WPHookInput and string hook types |
| pkg/parser/php/laravel/types.go | Adds BladeTemplates to LaravelInfo and defines Blade template structs |
| pkg/parser/php/laravel/enricher.go | Runs Blade analysis during Laravel enrichment (adds Blade-generated chunks) |
| pkg/parser/php/laravel/adapter.go | Adds Blade file discovery + conversion of Blade templates into chunks and relations |
| pkg/parser/php/laravel/blade.go | New Blade analyzer (regex-based directive extraction) |
| pkg/parser/php/laravel/blade_test.go | New unit tests for Blade analyzer behavior |
| .github/workflows/test.yml | Updates CI Go version to 1.24 |
| .github/workflows/release.yml | Updates release workflow Go version to 1.24 |
| .gitignore | Ignores docs/plans/*.md |
You can also share your feedback on Copilot code review. Take the survey.
- Add NameFullyQualified support to woocommerce extractFuncName - Add action_check/filter_check cases to buildWCHookSignature - Use dynamic BaseClass for Oxygen element signatures - Increase bufio.Scanner buffer to 1MB for Blade templates - Update CI Go version from 1.22 to 1.24 to match go.mod Signed-off-by: doITmagic <razvan@doitmagic.com>
PR Review Resolution SummaryAll 12 review comments from Copilot code review have been verified against the current branch state. ✅ All Code Issues Already Resolved (10/12)
📋 Process Comment Addressed (2/12)
Proposed Title UpdateThe PR body should be updated to include a Section 2: Laravel Blade Template Analysis alongside the existing WordPress documentation, covering:
|
Description
Integrate the existing Oxygen Builder and WooCommerce analyzers into the main WordPress parsing pipeline, so that plugin-specific patterns are automatically detected and indexed as enriched
CodeChunkobjects.Previously,
wordpress/oxygen/analyzer.goandwordpress/woocommerce/analyzer.goexisted with passing tests, but were never imported from the mainwordpress/analyzer.go. This meant:OxyElclasses were parsed as generic PHP classes (nooxy_elementmetadata)woocommerce_before_cartwere detected as genericwp_hook(no area classification likecart,checkout,product)What this adds:
oxygenAnalyzer.AnalyzeFromPackages()inanalyzeWordPress():oxy_elementchunks for classes extendingOxyEl/OxyElShadow/OxygenElementoxy_templatechunks forct_templatepost type registrationsframework=wordpress,wp_type=oxygen_element, namespace, methods, slugwoocommerceAnalyzer.AnalyzeHooksFromWP():wc_hookchunks with area classification (cart,checkout,product,order,payment, etc.)wc_api_callchunks for WC API functions (wc_get_product,wc_get_order, etc.)wc_area,hook_type,callback,prioritywoocommercepackage previously importedwordpress(forWPHooktype andASTHelper), creating a cycle whenwordpressimportswoocommerce. Resolved by:WPHookInputstruct locally inwoocommercepackageextractHookFromFunctionCall,extractCallArgs, etc.) locallyWPHook → WPHookInputat call site inanalyzer.goTestAnalyzer_OxygenElementDetection— end-to-end OxyEl detection viaAnalyzePaths()TestAnalyzer_WooCommerceHookClassification— end-to-end WC area classificationTestConvertToChunks_OxygenAndWooCommerce— nil safety for new fieldsArchitecture decision:
Implemented as direct integration (Oxygen/WooCommerce analyzers called from
wordpress/analyzer.go), not as separate enrichers, because:Closes: Trello cards #114-#119
Type of change
Checklist:
go fmt ./...go test ./...and they passFiles Changed
pkg/parser/php/wordpress/types.goOxygenInfo anyandWooCommerceInfo anyfields toWordPressInfopkg/parser/php/wordpress/analyzer.gooxygen+woocommerce, added analyzers to struct, integrated calls inanalyzeWordPress()andconvertToChunks()pkg/parser/php/wordpress/analyzer_test.gopkg/parser/php/wordpress/woocommerce/analyzer.gowordpressimport, definedWPHookInput, reimplemented AST helpers locallypkg/parser/php/wordpress/woocommerce/analyzer_test.goTestAnalyzeHooksFromWPto useWPHookInputinstead ofwordpress.WPHook