Skip to content

Conversation

@NishilHoogar
Copy link
Collaborator

  • 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
Copy link

@sourcery-ai sourcery-ai bot left a 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

@mariobehling mariobehling requested a review from Copilot October 26, 2025 18:14
Copy link

Copilot AI left a 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_event and wpfa_speaker with 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 function enqueue_styles() {
wp_enqueue_style(
'wpfa-public-css',
WPFA_PLUGIN_URL . 'public/css/wpfa-public.css',
Copy link

Copilot AI Oct 26, 2025

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.

Suggested change
WPFA_PLUGIN_URL . 'public/css/wpfa-public.css',
WPFA_PLUGIN_URL . 'public/wpfa-public.css',

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 13
<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
Copy link

Copilot AI Oct 26, 2025

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.

Suggested change
<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>

Copilot uses AI. Check for mistakes.
* Render the settings page.
*/
public function render_settings_page() {
require_once WPFA_PLUGIN_PATH . 'admin/views/settings-page.php';
Copy link

Copilot AI Oct 26, 2025

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.

Suggested change
require_once WPFA_PLUGIN_PATH . 'admin/views/settings-page.php';
require_once WPFA_PLUGIN_PATH . 'public/settings-page.php';

Copilot uses AI. Check for mistakes.
* Minimal hardcoded seed (2 speakers, 1 event).
*/
private static function seed_minimal() {
$placeholder = 'https://via.placeholder.com/300x300.png?text=Speaker';
Copy link

Copilot AI Oct 26, 2025

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.

Suggested change
$placeholder = 'https://via.placeholder.com/300x300.png?text=Speaker';
$placeholder = plugins_url( 'assets/placeholder-speaker.png', dirname( __FILE__ ) );

Copilot uses AI. Check for mistakes.
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