Skip to content

Conversation

@up1512001
Copy link
Member

@up1512001 up1512001 commented Dec 26, 2025

What

  • Cleanup taxonomy & unwanted meta from all plugin files.
  • Fix missing governing site filter for sync/non-sync media.

Why

  • To remove dead code & unused functionality.

Part of https://github.com/rtCamp/OnePress/issues/62

Checklist

  • I have read the Contribution Guidelines.
  • I have read the Development Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint etc.).
  • My code has detailed inline documentation.
  • I have updated the project documentation as needed.
  • I have added a changeset for this PR using npm run changeset.

@up1512001 up1512001 self-assigned this Dec 26, 2025
Copilot AI review requested due to automatic review settings December 26, 2025 06:31
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 performs a significant cleanup of the codebase by removing taxonomy-based media classification and replacing it with a simpler meta-based approach. The changes remove dead code, unused functionality, and streamline the sync/non-sync media filtering mechanism.

  • Removed custom taxonomy implementation (onemedia_media_type) and related term restriction logic
  • Replaced taxonomy-based filtering with post meta-based filtering using the is_onemedia_sync meta key
  • Consolidated sync status tracking to use a single boolean meta field instead of both taxonomy terms and string-based meta values
  • Removed unused AJAX handler for sync media upload and associated frontend code
  • Simplified media library column display and filtering logic

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
inc/Utils.php Removed WPVIP wrapper function term_exists() that is no longer needed
inc/Modules/Taxonomies/Term_Restriction.php Deleted entire file - removed taxonomy term protection and restriction logic
inc/Modules/Taxonomies/Media.php Deleted entire file - removed custom taxonomy registration for media types
inc/Modules/Taxonomies/Abstract_Taxonomy.php Deleted entire file - removed abstract base class for taxonomy registration
inc/Modules/Rest/Media_Sharing_Controller.php Replaced taxonomy-based filtering with meta-based queries; updated method signatures to remove taxonomy term handling; simplified sync status management
inc/Modules/MediaSharing/UserInterface.php Renamed methods and updated column display to show sync status badge instead of term labels
inc/Modules/MediaSharing/MediaProtection.php Removed taxonomy term assignment logic, keeping only meta-based sync status updates
inc/Modules/MediaSharing/MediaActions.php Removed unused sync media upload AJAX handler and taxonomy term handling from update operations
inc/Modules/MediaSharing/Attachment.php Removed taxonomy-related methods (get_terms, get_post_terms, etc.); removed string-based SYNC_STATUS_POSTMETA_KEY in favor of boolean IS_SYNC_POSTMETA_KEY; renamed update_is_syncing to set_is_sync
inc/Modules/MediaLibrary/ConsumerAdmin.php Removed source column, sync filter UI, and filter query logic; simplified to use class constants for transient keys
inc/Modules/MediaLibrary/Admin.php Added sync filter functionality moved from ConsumerAdmin; updated meta queries to use IS_SYNC_POSTMETA_KEY with string values '1' and '0'
inc/Main.php Removed taxonomy class registrations from the main initialization
assets/src/css/admin.scss Added column width styling for sync status column
assets/src/components/api.js Removed unused isSyncMediaUpload parameter from uploadMedia function signature
assets/src/admin/media-sharing/index.js Updated uploadMedia call to remove the removed parameter
assets/src/admin/media-sharing/components/browser-uploader.js Removed sync media upload AJAX fallback logic; simplified to always use 'onemedia_replace_media' action

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

@up1512001 up1512001 changed the title Chore: taxonomy cleanup Chore: taxonomy cleanup [round 1] Dec 29, 2025
@up1512001 up1512001 requested a review from justlevine December 29, 2025 04:44
Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this 🤩 Two comments and we should be good to merge.

@up1512001 up1512001 merged commit 73cbb26 into develop Dec 31, 2025
9 checks passed
@up1512001 up1512001 deleted the chore/code-cleanup branch December 31, 2025 14:49
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.

3 participants