wp-starter/support
Lightweight support utilities for WP Starter projects. Includes helpful helpers, common abstractions, and shared tooling to speed up WordPress development and keep starter-based apps consistent, clean, and easier to maintain.
WP_* classes, hooks, and filters), making it a poor fit for Laravel’s Eloquent, Blade, and service container architecture. Direct integration would require rewriting core logic, defeating the purpose of using a package.Str, Arr, or Collection helpers. However, this would require significant refactoring.wp-starter/collections (likely a custom collection class), which conflicts with Laravel’s native Illuminate\Support\Collection. Replacement would be necessary for compatibility.Str::) but add minimal value if the rest of the package is discarded.WP_User_Query vs. Laravel’s Eloquent User.add_action, add_filter) vs. Laravel events.Str::, Collection::macro()) for most helper functionality.| Risk | Severity | Mitigation |
|---|---|---|
| WordPress Dependency Leakage | Critical | Audit and replace all WP_* calls with Laravel equivalents (e.g., User model). |
| Undefined Package Purpose | High | Investigate wp-starter/collections and wp-starter/contracts for reusable logic. |
| Laravel Ecosystem Conflicts | High | Avoid integrating WordPress hooks; use Laravel events instead. |
| No Active Maintenance | Medium | Fork the package if critical fixes are needed. |
| PHP Version Constraints | Low | Laravel 8+ supports PHP 8.0; ensure no breaking changes in extracted code. |
What is the actual functionality of this package?
tests/ or examples/).Are there Laravel-compatible components?
function or class definitions unrelated to WP_*.How does it handle data persistence?
WP_DB or Eloquent? If the former, it’s incompatible with Laravel.What is the relationship with wp-starter/macroable?
Collection, it could be replaced with native Collection::macro().Is there any documentation or examples?
// Original (WordPress)
wp_starter()->format_phone($number);
// Extracted (Laravel)
Support::formatPhone($number);
beberlei/laravel-support or build custom Eloquent models instead.Audit the Codebase (1-2 Weeks)
WP_User, get_post()).StringHelper, ArrayUtils).grep -r "WP_" src/, composer why-not wp-starter/support.Extract Reusable Logic (2-3 Weeks)
WP_* calls with Laravel equivalents:
WP_User_Query → Eloquent User::where().get_post() → Post::find().// Before (WordPress)
add_action('wp_starter_support_ticket_created', 'handleTicket');
// After (Laravel)
Event::listen('ticket.created', 'handleTicket');
wp-starter/collections with Illuminate\Support\Collection.Publish as a Laravel Package (1 Week)
composer.json:
{
"replace": {
"wp-starter/support": "automattic/php-wordpress-shims" // Hypothetical shim
}
}
Test in Isolation (1 Week)
Deprecate WordPress Logic (Optional)
WP_* references with Laravel-native solutions.| Component | WordPress Implementation | Laravel Equivalent | Compatibility Risk |
|---|---|---|---|
| User Management | WP_User_Query |
Eloquent User::where() |
High |
| Post Handling | WP_Query, get_post() |
Eloquent Post::find() |
High |
| Collections | wp-starter/collections |
Illuminate\Support\Collection |
Medium |
| Localization | __(), gettext() |
Laravel’s trans() |
Medium |
| Hooks/Filters | add_action(), add_filter() |
Laravel Events | High |
| Macros | wp-starter/macroable |
Collection::macro() |
Low |
Phase 1: Discovery (1-2 Weeks)
src/ for core logic.tests/ for usage examples.composer.json for dependencies.Phase 2: Extraction (2-3 Weeks)
StringHelper, ArrayUtils).// Before
function wp_starter_snake_case($string) { ... }
// After
class Support {
public static function snake($string) { ... }
}
Phase 3: Laravel Adaptation (1-2 Weeks)
// config/app.php
'aliases' => [
'Support' => WpStarter\Support\Facades\Support::class,
],
Phase 4: Validation (1 Week)
Phase 5: Deprecation (Optional)
WP_* references with Laravel-native solutions (e.g., WP_DB → Eloquent).WP_* or hook-based code will require ongoing synchronization with Laravel updates.wp-starter/collections and wp-starter/contracts may evolve independently.How can I help you explore Laravel packages today?