Migrate model layer to b8 models (2.3.5) - #526
Merged
Merged
Conversation
…ated backward-compatible getters
Css & Edit Screen Field Overflow Fixed
towfiq1997
marked this pull request as ready for review
July 16, 2026 08:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #525 — migrate the model layer to b8 models, ahead of the framework swap.
Status: foundation complete & green; the model conversion itself is the next commit and needs a design check (below) before I execute it — hence draft.
Done & verified (commits so far)
src/ → includes/consolidation — 35 files moved as tracked renames, autoload narrowed toincludes/, every class verified resolving to the new path.tests/phpunit-baseline, bytekit-native) — green: 42 tests, 130 assertions on the current framework-model code. This is the behavior oracle the migration must keep green.byteever/modelswired (dev-master) with Strauss prefixing →WooCommerceSerialNumbers\B8\Models\Model; baseline still 42 green with it installed.Remaining: the model conversion (Key, Activation) — plan + landmines
The conversion surface is small (~34 accessors, ~20 static/CRUD calls) but carries real divergences I want your call on before writing it:
insert()param order — framework-modelinsert($data, $wp_error); b8insert($data, $search, $wp_error).functions.php:165Key::insert($args, $wp_error)must becomeKey::insert($args, null, $wp_error)or it silently passes$wp_erroras$search.get()→find()— Key overridesget()to encryptserial_keybefore lookup (Key.php:583). b8 has noget(); this override + its call sites (self::get,parent::get,functions.php) convert tofind().prepare_where_query()— framework-model's custom WHERE hook has no direct b8 equivalent; b8 uses fluentwhere()+ thequery_clausesfilter. Key's custom query logic (encrypted-key lookup, custom clauses) needs re-implementing against b8's pipeline. This is the main re-write and the highest-risk piece.viewcontext — Activation getters default to'view', which in framework-model applies a per-prop filter; b8get()doesn't. Need to preserve (filter) or confirm unused.save()return — framework-model returnstrue|WP_Error; b8 returnsstatic|WP_Error. Call sites checkingtrue === save()must move tois_wp_error().get_prop/set_prop/set_date_prop(34 sites). Decision needed: faithful instance adapters on the SNModelbase (preserves contract +viewfiltering, smaller/safer, but a transitional adapter) vs full native conversion to$this->get()/set()(aligns with the convert-to-native preference, ~34 edits, dropsviewfiltering unless re-added).Gate before this leaves draft
Key) + pagination (paged) tests.byteever/models 1.0.0and pin (drop dev-master) before release.