refactor(admin): split 1089-line admin class into 7 focused files
Addresses excessive line count in Peptide_News_Admin (1089 lines) by extracting responsibilities into single-purpose classes: - class-pn-admin-assets.php (88 lines): CSS/JS enqueuing - class-pn-admin-menu.php (98 lines): Menu & submenu registration - class-pn-admin-field-renderers.php (325 lines): 25+ field renderers (static) - class-pn-admin-settings.php (289 lines): Settings registration & sanitization - class-pn-admin-log-viewer.php (155 lines): Plugin log viewer UI & AJAX - class-pn-admin-settings-page.php (214 lines): Settings page + manual buttons - class-pn-admin-dashboard-pages.php (109 lines): Dashboard/articles/cost pages - class-peptide-news-admin.php (143 lines): Thin orchestrator (delegator) All files under 300 lines. Original public interface preserved exactly so no consumer code or tests break. Updated ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,12 @@ peptide-news-plugin/
|
||||
│ └── class-peptide-news-logger.php # Structured DB logging with auto-prune
|
||||
│
|
||||
├── admin/
|
||||
│ ├── class-peptide-news-admin.php # Settings page, analytics dashboard, admin assets
|
||||
│ ├── class-peptide-news-admin.php # Main orchestrator (delegator): preserves public interface
|
||||
│ ├── class-pn-admin-assets.php # CSS/JS enqueuing for admin pages
|
||||
│ ├── class-pn-admin-menu.php # Admin menu & submenu registration
|
||||
│ ├── class-pn-admin-settings.php # Settings registration & field renderers (7 sections, 25+ fields)
|
||||
│ ├── class-pn-admin-settings-page.php # Settings page render + plugin log viewer + AJAX handlers
|
||||
│ ├── class-pn-admin-dashboard-pages.php # Dashboard, articles, cost dashboard pages
|
||||
│ ├── css/admin-style.css # Admin dashboard styles
|
||||
│ ├── js/admin-script.js # Analytics charts (Chart.js), AJAX handlers
|
||||
│ ├── partials/
|
||||
|
||||
Reference in New Issue
Block a user