Skip to content

Conversation

@NishilHoogar
Copy link
Collaborator

PR 2: Add Data Model (CPTs, Taxonomies, Meta Fields)

Summary
This pull request implements the backend data model for the WPFAevent plugin as requested in PR Task 2. The changes are strictly backend-only and build on the existing PR-1 boilerplate.

Scope

  • Backend functionality only (CPTs, taxonomies, meta fields, and tests).
  • Built on top of the existing pr-1-boilerplate branch.
  • No UI, template, or admin/public page changes.
  • No modifications to JS/CSS assets or LICENSE files.
  • Plugin identity and existing architecture preserved.

Included:

  • Custom Post Types
  • wpfaevent_event (Event CPT)
  • wpfaevent_speaker (Speaker CPT)
  • REST-enabled, supports title, editor, thumbnail, excerpt, and revisions
  • Custom capability mappings and map_meta_cap enabled

Taxonomies

  • wpfaevent_track (hierarchical)
  • wpfaevent_tag (non-hierarchical)
  • REST-enabled, with clean labels and rewrite rules

Meta Fields

  • Speaker meta: position, organization, bio, headshot_url
  • Event meta: talk_title, schedule_reference
  • Registered via register_post_meta() with:
  • type = string
  • single = true
  • show_in_rest = true
  • Appropriate sanitization callbacks (e.g., sanitize_text_field, esc_url_raw, wp_kses_post)

Integration

  • All hooks registered via the existing loader class (class-wpfa-event-loader.php) on init.
  • No hooks added directly in constructors.
  • Unit tests included:
  • tests/test-cpt-registration.php
  • tests/test-tax-registration.php
    -tests/test-meta-registration.php

Not included

  • Any changes to admin or public-facing templates or pages.
  • Any modifications, removals, or renames of existing files.
  • Any changes to JS/CSS assets or LICENSE.md.
  • Any structural refactors of the existing plugin architecture.

Notes

This PR focuses solely on the backend data model and follows existing naming conventions and coding standards in the project.
All additions are intentionally minimal and scoped to avoid conflicts and maintain the plugin identity.

NishilHoogar and others added 16 commits October 17, 2025 19:30
PR-1 introduces a minimal, activatable WordPress plugin skeleton for FOSSASIA Landing.

Includes:
- Main plugin file with WP header and security check
- Loader class for modular future expansion
- Minimal README

Feature logic, CLI, uninstaller, and templates are excluded to keep this PR reviewable.
- Moved run_fossasia_landing() from global scope to FOSSASIA_Landing_Loader::run_plugin()
- Hooked initialization to plugins_loaded for proper WordPress lifecycle
- Aligns PR-1 with WordPress and modern PHP best practices
made the requested changes
- Added wpfaevent.php bootstrap and loader/core classes
- Introduced admin/public stubs and partials
- Moved templates into partial proxies
- Added uninstall script and PHPCS workflow
- Preserved legacy logic for compatibility
…public, includes, languages), reorganized assets, and cleaned redundant files

Refactored plugin layout to align with WordPress Plugin Boilerplate; added standard directories and removed redundant files
- Reviewed and restored the original boilerplate structure as per feedback.
- Moved loader file to the includes/ directory following WordPress plugin conventions.
- Renamed includes/class-fossasia-uninstaller.php to includes/class-wpfaevent-uninstaller.php for consistency.
- Verified and aligned overall directory and class structure with the standard WordPress plugin layout.
- Integrated fossasia-landing.php logic into the main plugin flow:
  - Added an initialize_fossasia_landing() method inside the loader.
  - Safely included fossasia-landing.php within wpfaevent.php without disrupting existing bootstrap or comments.
  - Ensured all original comments and metadata remain intact.
…ent consistency

This update removes direct inclusion of the old fossasia-landing.php file from the main plugin bootstrap and aligns all references to the standardized wpfaevent naming convention. The landing page logic has been modularized into a dedicated class file (includes/class-wpfaevent-landing.php) and is now initialized properly through WordPress hooks for better structure and maintainability.

Key Changes:

Removed direct fossasia-landing references and renamed related files, templates, and class mentions to use the wpfaevent prefix.

Added initialize_wpfaevent_landing() method inside the loader to handle landing setup via the plugins_loaded hook.

Updated require_once statements to use plugin_dir_path( __FILE__ ) for proper modular path resolution.

Verified that no root-level files are directly included from /includes/ or /public/.

Ensured plugin initialization logic runs through WordPress hooks instead of executing on file load.

Checked structure integrity after restoring the boilerplate and ensuring class closures were correctly placed.
Removed remaining fossasia-landing references and renamed related files.

Eliminated duplicate templates from /templates/ and kept consistent copies under /public/partials/.

Retained only root-level uninstall.php file.

Moved CSS/JS files to appropriate directories (public/css/, admin/css/).

Relocated misplaced PHP files to /includes/.

Verified proper plugin bootstrap through loader hooks (plugins_loaded).
- Renamed or removed remaining fossasia-landing-* templates to wpfaevent-* for consistency.
- Consolidated duplicate templates under public/partials/ and removed redundant ones from templates/.
- Retained only root uninstall.php (removed templates/uninstall.php).
- Moved stylesheet files to correct directories:
  • wpfaevent-admin.css → admin/css/
  • wpfaevent-public.css → public/css/
  Updated corresponding enqueue paths.
- Verified that plugin initialization is fully hook-based via plugins_loaded with no direct execution at file load.
- Preserved all original comments and documentation blocks unchanged.

This update completes all pending checklist items for review and aligns the plugin structure with WordPress best practices.
-Moved PHP classes to includes/

-Removed duplicate templates, kept canonical in public/partials/

-Verified template includes, require_once paths, and text domain

-Confirmed .github/workflows/ has only YAML files

-Checked enqueue paths for CSS/JS

-All comments preserved, no functional changes beyond restructuring
Moved remaining template files to their canonical locations and updated
include paths accordingly. Retained the existing approach for
speakers-page-content.php as it is intended for internal plugin use only.
Co-authored-by: Copilot <[email protected]>
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

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