Extract CampTix Admin Setup and Tools into dedicated classes#1645
Open
dd32 wants to merge 7 commits intoproductionfrom
Open
Extract CampTix Admin Setup and Tools into dedicated classes#1645dd32 wants to merge 7 commits intoproductionfrom
dd32 wants to merge 7 commits intoproductionfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors CampTix’s wp-admin UI by extracting the Tickets → Setup and Tickets → Tools screens out of the monolithic CampTix_Plugin class into dedicated admin classes, while keeping data/utility methods in the main plugin.
Changes:
- Added
CampTix_Admin_Setupto own Setup-page settings registration, validation, and UI. - Added
CampTix_Admin_Toolsto own Tools-page tab UIs (Summarize/Revenue/Export/Notify/Refund) and related request handlers. - Updated
camptix.phpto instantiate the new classes and route admin hooks/menu callbacks through them.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
public_html/wp-content/plugins/camptix/inc/class-camptix-admin-tools.php |
New class that renders the Tools admin page and handles export/notify/refund flows. |
public_html/wp-content/plugins/camptix/inc/class-camptix-admin-setup.php |
New class that registers Setup settings/sections/fields, validates options, and renders Setup UI. |
public_html/wp-content/plugins/camptix/camptix.php |
Wires the new admin classes into plugin init and admin menu/hook registration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
public_html/wp-content/plugins/camptix/inc/class-camptix-admin-tools.php
Show resolved
Hide resolved
public_html/wp-content/plugins/camptix/inc/class-camptix-admin-tools.php
Show resolved
Hide resolved
public_html/wp-content/plugins/camptix/inc/class-camptix-admin-tools.php
Show resolved
Hide resolved
public_html/wp-content/plugins/camptix/inc/class-camptix-admin-setup.php
Show resolved
Hide resolved
public_html/wp-content/plugins/camptix/inc/class-camptix-admin-setup.php
Show resolved
Hide resolved
…etup Move the Tickets > Setup page rendering, settings registration, field renderers, options validation, and related admin UI methods into a dedicated CampTix_Admin_Setup class at inc/class-camptix-admin-setup.php. Settings getters (get_options, get_default_options, get_currencies, get_beta_features) remain in CampTix_Plugin. A validate_options proxy is kept on CampTix_Plugin for backwards compatibility. This reduces camptix.php by ~420 lines and is the first step toward splitting the monolithic class into focused admin modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The code in class-camptix-admin-setup.php was moved verbatim from camptix.php which also uses phpcs:ignoreFile. Fixing 95 legacy lint errors in moved code is a separate refactoring task. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the Tickets > Tools page UI methods (Summarize, Revenue, Export, Notify, Refund tabs) into a dedicated inc/class-camptix-admin-tools.php file. Data/utility methods (get_summary, generate_revenue_report_data, get_segment, etc.) remain in CampTix_Plugin. camptix.php: 8,445 -> 7,587 lines (-858) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Dion Hulse <dd32@dd32.id.au>
After extracting field_* methods to CampTix_Admin_Setup, callers like payment methods and addons still call them on the CampTix_Plugin instance. Add a __call method that forwards these calls to admin_setup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
62a4639 to
864870a
Compare
…ml_mail_enabled public External addons (camptix-attendance, camptix-mailchimp, camptix-invoices, camptix-admin-flags) call $camptix->add_settings_field_helper() which was moved to CampTix_Admin_Setup. Add it to the __call proxy. Also change html_mail_enabled() from protected to public since it is called statically from both extracted classes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
CampTix_PluginintoCampTix_Admin_Setup(inc/class-camptix-admin-setup.php)CampTix_Admin_Tools(inc/class-camptix-admin-tools.php)get_summary,generate_revenue_report_data,get_segment, etc.) remain inCampTix_Pluginget_options,get_default_options,get_currencies) remain inCampTix_PluginCampTix_Pluginreference and delegate to itcamptix.phpreduced from ~8,867 to ~7,587 lines (-1,280 lines)Test plan