Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Aug 4, 2025

This PR adds support for handling Starter Kit collections through the ActivityPub Interaction API by introducing new case handlers for collection-type objects and modifying existing logic for better consistency.

For more context see:

Proposed changes:

  • Adds handling for Collection, CollectionPage, OrderedCollection, and OrderedCollectionPage object types
  • Updates existing code to use consistent function calling patterns
  • Introduces a new filter hook for customizing Starter Kit import URLs

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to '..'

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Adds support for Starter Kit collections in the ActivityPub API.

Introduces a UI for selecting which accounts to follow during the Starter Kit import process. Refactors import logic to process only selected actors, adds error handling for file reading and JSON parsing, and improves feedback for follow actions.
Changed the heading text to clarify that the author selection is for the imported Starter Kit, improving user guidance during the import process.
Modularizes the import options method by splitting UI rendering and filter setup/cleanup into dedicated private methods. Improves error handling, form structure, and actor validation for better maintainability and clarity.
Added @param annotations to the render_error and render_import_form methods in Starter_Kit to improve code documentation and clarify expected argument types.
Introduces the ability to import Starter Kits from a remote URL in addition to file uploads. Adds a new form for URL input, handles validation, fetches and saves JSON data, and updates the import step logic to support this workflow.
pfefferle and others added 9 commits August 4, 2025 13:32
Replaces null coalescing with an explicit isset check for the 'url' GET parameter to prevent undefined index notices. Also prefixes all printf calls with a backslash for consistency.
Introduces a dedicated static property for the blog user filter callback and updates its assignment. Adds missing global namespace prefixes to WordPress and PHP functions for consistency. Improves code readability and maintainability.
@pfefferle pfefferle requested a review from Copilot August 4, 2025 12:19

This comment was marked as outdated.

pfefferle and others added 7 commits August 4, 2025 14:22
Added a PHPCS ignore comment to suppress missing nonce verification warning in the handle_url_import method. This change is intended to bypass the WordPress.Security.NonceVerification.Missing rule for this specific line.
Prefixed is_wp_error with a backslash to ensure the global function is called, preventing potential issues with namespacing in attachment insertion error handling.
@pfefferle pfefferle requested a review from Copilot August 4, 2025 12:30

This comment was marked as outdated.

@pfefferle pfefferle marked this pull request as ready for review August 5, 2025 10:13
@pfefferle pfefferle requested a review from Copilot August 5, 2025 10: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 adds support for handling Starter Kit collections through the ActivityPub Interaction API by introducing new case handlers for collection-type objects and improving code consistency.

  • Adds handling for Collection, CollectionPage, OrderedCollection, and OrderedCollectionPage object types
  • Updates existing code to use consistent function calling patterns by removing unnecessary boolval() wrapper
  • Introduces a new filter hook for customizing Starter Kit import URLs
Comments suppressed due to low confidence (1)

Base automatically changed from add/import-starter-pack-from-url to trunk August 5, 2025 10:24
@pfefferle pfefferle merged commit d18688e into trunk Aug 5, 2025
12 checks passed
@pfefferle pfefferle deleted the add/import-from-url branch August 5, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants