Skip to content

Conversation

@NishilHoogar
Copy link
Collaborator

  • Replaced JSON file system with WordPress Custom Post Types (events, speakers)
  • Added CPT registration in includes/class-wpfa-cpt.php
  • Implemented [wpfa_speakers] shortcode via WP_Query
  • Added default stylesheet in public/css/wpfa-public.css
  • Updated WP-CLI seeder for CPT data
  • Removed legacy JSON-based templates and logic
  • Simplified uninstaller and standardized structure

- Replaced JSON file system with WordPress Custom Post Types (events, speakers)
- Added CPT registration in includes/class-wpfa-cpt.php
- Implemented [wpfa_speakers] shortcode via WP_Query
- Added default stylesheet in public/css/wpfa-public.css
- Updated WP-CLI seeder for CPT data
- Removed legacy JSON-based templates and logic
- Simplified uninstaller and standardized structure
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 refactors the plugin from a JSON file-based system to a WordPress Custom Post Type (CPT) architecture for managing events and speakers. The major changes include adding CPT registration for events and speakers, implementing a [wpfa_speakers] shortcode, adding a WP-CLI seeder for development data, including default public styles, and updating the uninstaller to handle CPT cleanup.

Reviewed Changes

Copilot reviewed 17 out of 21 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
uninstall.php Contains merge conflict markers that need resolution
templates/*.php Legacy template files still rely on JSON file system; not yet migrated to CPT queries
public/wpfa-public.css Adds new default styles for speaker archive display
public/class-wpfa-public.php Implements shortcode rendering with WP_Query for speakers CPT
includes/class-wpfa-cpt.php Registers wpfa_event and wpfa_speaker CPTs with meta fields
includes/class-wpfa-cli.php Provides WP-CLI seeder for CPT data from JSON or minimal fixtures
includes/class-fossasia-uninstaller.php New uninstaller class for CPT cleanup
fossasia-landing.php Main plugin file updated to initialize CPT and public handlers
templates/minimal.json Sample JSON fixture for seeding test data
README.md Contains merge conflict markers that need resolution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

uninstall.php Outdated
Comment on lines 2 to 5
<<<<<<< Updated upstream

/**
* Fired when the plugin is uninstalled.
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.

Merge conflict markers are present in the file. These must be resolved before merging. Remove the conflict markers (<<<<<<< Updated upstream, =======, >>>>>>> Stashed changes) and retain only the correct code.

Copilot uses AI. Check for mistakes.
@@ -1,3 +1,4 @@
<<<<<<< Updated upstream
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.

Merge conflict markers are present in the file. These must be resolved before merging. Remove the conflict markers and consolidate both versions of the README into a single coherent document.

Suggested change
<<<<<<< Updated upstream

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,96 @@
n<?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.

There is an extraneous 'n' character before the PHP opening tag. This will cause a PHP parse error. Remove the 'n' character so the file starts with '<?php'.

Suggested change
n<?php
<?php

Copilot uses AI. Check for mistakes.
* Register the stylesheets for the public-facing side of the site.
*/
public function enqueue_styles() {
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpfa-public.css', array(), $this->version, 'all' );
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 CSS path uses 'css/wpfa-public.css' but the actual file is at 'wpfa-public.css' (no 'css/' subdirectory based on the diff). This will result in a 404 error. Correct the path to 'wpfa-public.css'.

Suggested change
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wpfa-public.css', array(), $this->version, 'all' );
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'wpfa-public.css', array(), $this->version, 'all' );

Copilot uses AI. Check for mistakes.
foreach ( $speakers as $s ) {
$speaker_ids[] = self::upsert_post_by_slug(
'wpfa_speaker',
sanitize_title($s['slug']),
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] Function calls should be followed by a space before the opening parenthesis for consistency with WordPress coding standards. Change sanitize_title($s['slug']) to sanitize_title( $s['slug'] ).

Copilot uses AI. Check for mistakes.
<header class="nav" role="banner">
<div class="container nav-inner">
<a href="<?php echo esc_url( home_url( '/events/' ) ); ?>">
<img src="<?php echo plugins_url( '../images/logo.png', __FILE__ ); ?>" alt="Logo" class="site-logo">
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 image path uses '../images/logo.png' but based on other templates in the diff, the correct path should be '../assets/images/logo.png'. This will result in a broken image link.

Suggested change
<img src="<?php echo plugins_url( '../images/logo.png', __FILE__ ); ?>" alt="Logo" class="site-logo">
<img src="<?php echo plugins_url( '../assets/images/logo.png', __FILE__ ); ?>" alt="Logo" class="site-logo">

Copilot uses AI. Check for mistakes.
<header class="nav" role="banner">
<div class="container nav-inner">
<a href="<?php echo esc_url( home_url( '/events/' ) ); ?>">
<img src="<?php echo plugins_url( '../images/logo.png', __FILE__ ); ?>" alt="Logo" class="site-logo">
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 image path uses '../images/logo.png' but should be '../assets/images/logo.png' based on other template files. This will result in a broken image link.

Suggested change
<img src="<?php echo plugins_url( '../images/logo.png', __FILE__ ); ?>" alt="Logo" class="site-logo">
<img src="<?php echo plugins_url( '../assets/images/logo.png', __FILE__ ); ?>" alt="Logo" class="site-logo">

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