Skip to content

Frontend Templates and Conditional Asset Loading#32

Open
NishilHoogar wants to merge 2 commits intofossasia:mainfrom
NishilHoogar:feature/frontend-templates
Open

Frontend Templates and Conditional Asset Loading#32
NishilHoogar wants to merge 2 commits intofossasia:mainfrom
NishilHoogar:feature/frontend-templates

Conversation

@NishilHoogar
Copy link
Collaborator

This PR introduces modular frontend templates for the WPFAevent plugin, completing the transition to a fully decoupled, performant, and theme-compatible frontend architecture.

This PR introduces modular frontend templates for the WPFAevent plugin, completing the transition to a fully decoupled, performant, and theme-compatible frontend architecture.
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:13
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 introduces modular frontend templates for the WPFAevent plugin, completing the transition to a fully decoupled, performant, and theme-compatible frontend architecture. The changes include removal of the main plugin bootstrap file, enhanced uninstaller with proper cleanup, and new page templates for speakers, schedules, events listing, past events, and code of conduct. Additionally, new public-facing classes enable conditional asset loading and shortcode-based rendering.

Reviewed Changes

Copilot reviewed 48 out of 57 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
wpfaevent.php Removed the main plugin bootstrap file
uninstall.php Enhanced with proper cleanup of CPTs, options, and data files
templates/speakers-page.php Added comprehensive speakers page template with search/filter functionality
templates/schedule-page.php Added schedule page template with event calendar
templates/past-events-page.php Added past events archive template
templates/minimal.json Added minimal template structure example
templates/fossasia-landing-template.php Added main event landing page template
templates/events-listing-page.php Added events listing page with admin dashboard
templates/code-of-conduct-page.php Added code of conduct page template
public/wpfa-public.css Added public-facing styles
public/template-speakers.php Added speaker template part
public/template-events.php Added event template part
public/class-wpfa-public.php Added public class with conditional asset loading
public/class-wpfa-admin.php Added admin functionality class
includes/class-wpfa-settings.php Added settings management class
includes/class-wpfa-rest.php Added REST API endpoints
includes/class-wpfa-loader.php Added plugin loader class
includes/class-wpfa-cpt.php Added custom post type registration

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

<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 path '../images/logo.png' appears inconsistent with other templates. Most templates use '../assets/images/logo.png'. This will likely 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 path '../images/logo.png' appears inconsistent with other templates. Most templates use '../assets/images/logo.png'. This will likely 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 path '../images/logo.png' is inconsistent with other templates. Most templates use '../assets/images/logo.png'. This will likely 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.
* 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 based on the diff, the file appears to be at 'public/settings-page.php'. This will result in a file not found error.

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.
require_once WPFA_PLUGIN_PATH . 'includes/class-wpfa-settings.php';
require_once WPFA_PLUGIN_PATH . 'public/class-wpfa-public.php';
require_once WPFA_PLUGIN_PATH . 'admin/class-wpfa-admin.php';
require_once WPFA_PLUGIN_PATH . 'admin/class-wpfa-import-export.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/class-wpfa-import-export.php' but there is also a file 'class-wpfa-import-export.php' in the root directory (from the diff). This may cause confusion or loading the wrong file.

Suggested change
require_once WPFA_PLUGIN_PATH . 'admin/class-wpfa-import-export.php';
require_once WPFA_PLUGIN_PATH . 'admin/class-wpfa-admin-import-export.php';

Copilot uses AI. Check for mistakes.
) ) {
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 CSS file path should be 'public/wpfa-public.css' based on the diff, not 'public/css/wpfa-public.css'. This will result in a 404 error when loading the stylesheet.

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

Copilot uses AI. Check for mistakes.
$photo_url = get_post_meta( $speaker->ID, 'wpfa_speaker_photo_url', true );
?>
<div class="wpfa-speaker-card">
<img src="<?php echo esc_url( $photo_url ?: WPFA_DEFAULT_SPEAKER_PHOTO ); ?>" alt="<?php echo esc_attr( $speaker->post_title ); ?>">
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 constant 'WPFA_DEFAULT_SPEAKER_PHOTO' is referenced but never defined in the provided diff. This will cause a PHP notice or error if no photo URL is provided.

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.

2 participants