Frontend Templates and Conditional Asset Loading#32
Frontend Templates and Conditional Asset Loading#32NishilHoogar wants to merge 2 commits intofossasia:mainfrom
Conversation
This PR introduces modular frontend templates for the WPFAevent plugin, completing the transition to a fully decoupled, performant, and theme-compatible frontend architecture.
There was a problem hiding this comment.
Sorry @NishilHoogar, your pull request is larger than the review limit of 150000 diff characters
There was a problem hiding this comment.
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.
templates/code-of-conduct-page.php
Outdated
| <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"> |
There was a problem hiding this comment.
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.
| <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"> |
| <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"> |
There was a problem hiding this comment.
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.
| <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"> |
templates/past-events-page.php
Outdated
| <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"> |
There was a problem hiding this comment.
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.
| <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"> |
| * Render the settings page. | ||
| */ | ||
| public function render_settings_page() { | ||
| require_once WPFA_PLUGIN_PATH . 'admin/views/settings-page.php'; |
There was a problem hiding this comment.
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.
| require_once WPFA_PLUGIN_PATH . 'admin/views/settings-page.php'; | |
| require_once WPFA_PLUGIN_PATH . 'public/settings-page.php'; |
includes/class-wpfa-loader.php
Outdated
| 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'; |
There was a problem hiding this comment.
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.
| require_once WPFA_PLUGIN_PATH . 'admin/class-wpfa-import-export.php'; | |
| require_once WPFA_PLUGIN_PATH . 'admin/class-wpfa-admin-import-export.php'; |
public/class-wpfa-public.php
Outdated
| ) ) { | ||
| wp_enqueue_style( | ||
| 'wpfa-public-css', | ||
| WPFA_PLUGIN_URL . 'public/css/wpfa-public.css', |
There was a problem hiding this comment.
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.
| WPFA_PLUGIN_URL . 'public/css/wpfa-public.css', | |
| WPFA_PLUGIN_URL . 'public/wpfa-public.css', |
| $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 ); ?>"> |
There was a problem hiding this comment.
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.
This PR introduces modular frontend templates for the WPFAevent plugin, completing the transition to a fully decoupled, performant, and theme-compatible frontend architecture.