-
Notifications
You must be signed in to change notification settings - Fork 2
feat: refactor plugin structure and add public UI components #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: refactor plugin structure and add public UI components #30
Conversation
NishilHoogar
commented
Oct 24, 2025
- Implement modular plugin architecture following WordPress Plugin Boilerplate
- Add core loader and CPT registration for Events and Speakers
- Integrate WP-CLI seeder for minimal demo data
- Add [wpfa_speakers] shortcode to render speaker cards with styling
- Enqueue public CSS and ensure clean activation/uninstallation
- Prepare base for upcoming admin and import/export modules
- Implement modular plugin architecture following WordPress Plugin Boilerplate - Add core loader and CPT registration for Events and Speakers - Integrate WP-CLI seeder for minimal demo data - Add [wpfa_speakers] shortcode to render speaker cards with styling - Enqueue public CSS and ensure clean activation/uninstallation - Prepare base for upcoming admin and import/export modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @NishilHoogar, your pull request is larger than the review limit of 150000 diff characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a modular plugin architecture refactor for the FOSSASIA Event Plugin, introducing custom post types (CPTs) for events and speakers, a public-facing shortcode for rendering speaker cards, and a WP-CLI seeder for minimal demo data. The refactor removes the previous boilerplate structure and establishes a cleaner foundation for upcoming admin and import/export modules.
Key Changes:
- Introduced CPT registration for
wpfa_eventandwpfa_speakerwith associated meta fields - Added
[wpfa_speakers]shortcode with grid-based styling in public CSS - Integrated WP-CLI command (
wp wpfa seed --minimal) for seeding 2 speakers and 1 event - Established modular loader pattern and reorganized class structure
- Added uninstall handler to clean up CPT posts, options, and data directory
Reviewed Changes
Copilot reviewed 45 out of 51 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| fossasia-landing.php | New main plugin bootstrap file establishing constants, singleton pattern, and activation/deactivation hooks |
| includes/class-wpfa-loader.php | Core loader initializing plugin dependencies and component classes |
| includes/class-wpfa-cpt.php | CPT registration for events and speakers with REST API support |
| includes/class-wpfa-cli.php | WP-CLI seeder command for minimal demo data |
| public/class-wpfa-public.php | Public-facing class with shortcode registration and style enqueuing |
| public/wpfa-public.css | Grid-based styling for speaker cards rendered via shortcode |
| uninstall.php | Enhanced uninstaller with CPT cleanup and filesystem-based data removal |
| wpfaevent.php | Removed old bootstrap file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
public/class-wpfa-public.php
Outdated
| public function enqueue_styles() { | ||
| wp_enqueue_style( | ||
| 'wpfa-public-css', | ||
| WPFA_PLUGIN_URL . 'public/css/wpfa-public.css', |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enqueued stylesheet path references 'wpfa-public.css', but the actual file is named 'wpfa-public.css' in the diff. Ensure the file exists at public/css/wpfa-public.css or correct the path to match public/wpfa-public.css based on the diff location.
| WPFA_PLUGIN_URL . 'public/css/wpfa-public.css', | |
| WPFA_PLUGIN_URL . 'public/wpfa-public.css', |
public/settings-page.php
Outdated
| <div class="wrap"> | ||
| <h1><?php echo esc_html( get_admin_page_title() ); ?></h1> | ||
| <form action="options.php" method="post"> | ||
| <?php | ||
| // output security fields for the registered setting "wpfa_settings" | ||
| settings_fields( 'wpfa_settings_group' ); | ||
| // output setting sections and fields | ||
| do_settings_sections( 'wpfa_settings' ); | ||
| // output save settings button | ||
| submit_button( 'Save Settings' ); | ||
| ?> | ||
| </form> | ||
| </div> No newline at end of file |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file appears to be orphaned and not referenced in the new admin class structure. Consider removing it or integrating it into the proper admin views directory if it's intended for future use.
| <div class="wrap"> | |
| <h1><?php echo esc_html( get_admin_page_title() ); ?></h1> | |
| <form action="options.php" method="post"> | |
| <?php | |
| // output security fields for the registered setting "wpfa_settings" | |
| settings_fields( 'wpfa_settings_group' ); | |
| // output setting sections and fields | |
| do_settings_sections( 'wpfa_settings' ); | |
| // output save settings button | |
| submit_button( 'Save Settings' ); | |
| ?> | |
| </form> | |
| </div> |
| * Render the settings page. | ||
| */ | ||
| public function render_settings_page() { | ||
| require_once WPFA_PLUGIN_PATH . 'admin/views/settings-page.php'; |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path references 'admin/views/settings-page.php', but the file exists at 'public/settings-page.php' based on the diff. Update the path to match the actual file location or move the file to the correct directory.
| require_once WPFA_PLUGIN_PATH . 'admin/views/settings-page.php'; | |
| require_once WPFA_PLUGIN_PATH . 'public/settings-page.php'; |
includes/class-wpfa-cli.php
Outdated
| * Minimal hardcoded seed (2 speakers, 1 event). | ||
| */ | ||
| private static function seed_minimal() { | ||
| $placeholder = 'https://via.placeholder.com/300x300.png?text=Speaker'; |
Copilot
AI
Oct 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The hardcoded placeholder URL relies on an external service. Consider using a local fallback image bundled with the plugin to avoid dependency on third-party availability.
| $placeholder = 'https://via.placeholder.com/300x300.png?text=Speaker'; | |
| $placeholder = plugins_url( 'assets/placeholder-speaker.png', dirname( __FILE__ ) ); |