Skip to content

refactor(deps): scope wedevs/wp-kit via Mozart - #96

Merged
kzamanbd merged 1 commit into
developfrom
refactor/scope-wp-kit-mozart
Jul 1, 2026
Merged

refactor(deps): scope wedevs/wp-kit via Mozart#96
kzamanbd merged 1 commit into
developfrom
refactor/scope-wp-kit-mozart

Conversation

@kzamanbd

@kzamanbd kzamanbd commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What

Vendor wedevs/wp-kit under the Texty\Dependencies\ namespace via Mozart, matching how Appsero is already scoped.

Why

Previously wedevs/wp-kit loaded under its own WeDevs\WPKit\ namespace from vendor/. If another active plugin ships its own (possibly different-version) copy of wp-kit under the same namespace, the two collide — whichever autoloads first wins, and the loser silently runs against the wrong class definitions. Scoping isolates Texty's copy.

Changes

  • Add wedevs/wp-kit to extra.mozart.packages.
  • Rewrite every use WeDevs\WPKit\...use Texty\Dependencies\WeDevs\WPKit\... (19 imports across includes/ + texty.php).
  • Move appsero/client and wedevs/wp-kit from requirerequire-dev. In a production composer install --no-dev mozart doesn't run, so keeping them in require pulled unscoped copies into vendor/ alongside the scoped dependencies/ output. As dev deps, --no-dev no longer installs them; runtime resolves both from the generated dependencies/ dir (same model Appsero already relies on).

Verification

  • mozart compose generates dependencies/WeDevs/WPKit/** with the rewritten namespace; vendor/wedevs + vendor/appsero deleted.
  • Autoloader exposes only Texty\Dependencies\dependencies/; no live unscoped WeDevs\WPKit\ / Appsero\ mappings.
  • Scoped classes resolve; old WeDevs\WPKit\... no longer resolves.
  • composer install --no-dev dry-run: neither package lands in vendor/.

No data/state impact

Scoping renamed only wp-kit internals. Everything Texty persists as identity stays in the untouched Texty\ namespace:

  • Migrations are keyed by version string (texty_db_version), and registered migration classes (V_2_0_0::class, etc.) are Texty\... — unaffected.
  • DataLayer store registry is runtime-only; Texty\Models\SmsStat unscoped; table uses the texty prefix, not a FQCN.
  • wp-kit BackgroundProcess (keys off md5(static::class)) is not used by Texty.
  • No option/meta stores a WeDevs\WPKit FQCN.

Note for reviewers

dependencies/ is gitignored (generated by mozart on a dev composer install). bin/build.sh copies it into the zip, then runs --no-dev. A dev composer install must run before building so the scoped output exists — already the assumption for Appsero.

Summary by CodeRabbit

  • Chores

    • Updated the plugin’s minimum PHP requirement to 7.4.
    • Adjusted bundled dependencies so the plugin uses its included copies consistently.
  • Bug Fixes

    • Improved compatibility with newer packaged components, helping prevent runtime issues and installation problems.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kzamanbd, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ca4dba73-cf1a-4f3e-b321-7d5191771ab0

📥 Commits

Reviewing files that changed from the base of the PR and between 3cde152 and 3f657d2.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • composer.json
  • includes/Api/Logs.php
  • includes/Api/Metrics.php
  • includes/Api/SettingsController.php
  • includes/Dispatcher.php
  • includes/Install.php
  • includes/Migrations.php
  • includes/Migrations/NoticeProvider.php
  • includes/Migrations/TextyMigration.php
  • includes/Models/SmsStat.php
  • includes/Models/SmsStatStore.php
  • includes/Notices.php
  • texty.php
📝 Walkthrough

Walkthrough

composer.json adds a PHP version constraint, moves appsero/client and wedevs/wp-kit from require to require-dev, and expands the Mozart vendoring package list to include wedevs/wp-kit. Across the plugin, multiple PHP files update their WeDevs\WPKit\* import statements to reference the vendored Texty\Dependencies\WeDevs\WPKit\* namespace instead.

Changes

Vendored dependency namespace migration

Layer / File(s) Summary
Composer configuration for vendored dependencies
composer.json
Adds a PHP >=7.4 constraint, moves appsero/client and wedevs/wp-kit to require-dev, and adds wedevs/wp-kit to extra.mozart.packages.
Core service and API controller import updates
includes/Dispatcher.php, includes/Install.php, texty.php, includes/Api/Logs.php, includes/Api/Metrics.php, includes/Api/SettingsController.php
Updates DataLayerFactory and BaseSettingsRESTController imports from WeDevs\WPKit\* to Texty\Dependencies\WeDevs\WPKit\*.
Migration classes import updates
includes/Migrations.php, includes/Migrations/NoticeProvider.php, includes/Migrations/TextyMigration.php
Updates Migration and AdminNotification class imports to the Texty\Dependencies namespace.
Model and notice manager import updates
includes/Models/SmsStat.php, includes/Models/SmsStatStore.php, includes/Notices.php
Updates BaseModel, DataLayerFactory, BaseDataStore, and notice-related class imports to the Texty\Dependencies namespace.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • getdokan/texty#48: Adds the composer.json autoload namespace mapping for Texty\Dependencies\ via Mozart that this PR's namespace import changes rely on.

Suggested labels: Dev Review Done

Suggested reviewers: mrabbani

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: scoping wedevs/wp-kit with Mozart.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/scope-wp-kit-mozart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Vendor wedevs/wp-kit under the Texty\Dependencies\ namespace through Mozart,
matching how Appsero is already scoped, so Texty no longer collides with
another plugin that ships its own unscoped copy of wp-kit.

- Add wedevs/wp-kit to extra.mozart.packages
- Rewrite every `use WeDevs\WPKit\...` import to
  `use Texty\Dependencies\WeDevs\WPKit\...` across includes/ and texty.php
- Move appsero/client and wedevs/wp-kit from require to require-dev so a
  production `composer install --no-dev` no longer pulls unscoped copies into
  vendor/; runtime resolves them from the generated dependencies/ directory
@kzamanbd
kzamanbd force-pushed the refactor/scope-wp-kit-mozart branch from 3cde152 to 3f657d2 Compare July 1, 2026 09:55
@kzamanbd
kzamanbd merged commit 60273ad into develop Jul 1, 2026
3 checks passed
@kzamanbd
kzamanbd deleted the refactor/scope-wp-kit-mozart branch July 1, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant