- 
                Notifications
    You must be signed in to change notification settings 
- Fork 84
Add Attachments processor class for handling ActivityPub media #2314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            77 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      27ce87b
              
                Add support for ActivityPub object post type
              
              
                pfefferle fd3661e
              
                Add ActivityPub content sanitizer and update usage
              
              
                pfefferle 5707420
              
                Add HTML to blocks conversion and refactor sanitization
              
              
                pfefferle 630aec6
              
                Remove get_node_attributes method and inline list attribute
              
              
                pfefferle ca3305e
              
                Rename html_to_blocks to convert_from_html in Blocks
              
              
                pfefferle 5ab729b
              
                Apply suggestion from @Copilot
              
              
                pfefferle e302e93
              
                Apply suggestion from @Copilot
              
              
                pfefferle 955921c
              
                Apply suggestion from @Copilot
              
              
                pfefferle d0fa8e1
              
                Add tests for content sanitization and block conversion
              
              
                pfefferle 7d6004e
              
                Add tests for Create handler object sanitization and edge cases
              
              
                pfefferle 7466883
              
                Add unit tests for Objects collection class
              
              
                pfefferle b61302e
              
                Add changelog
              
              
                matticbot a400925
              
                Refactor Update handler methods for clarity
              
              
                pfefferle 859b33b
              
                Update @covers annotation to handle_actor_update
              
              
                pfefferle 9f43130
              
                Update post type labels from 'Post' to 'Object'
              
              
                pfefferle 67932d8
              
                Add missing newline after use statements
              
              
                pfefferle 7f07d36
              
                Remove HTML to blocks conversion logic
              
              
                pfefferle 02528e1
              
                Rename Objects collection to Posts throughout codebase
              
              
                pfefferle f59a8f4
              
                Fix comments and return types
              
              
                obenland 64d92ce
              
                Rename create_object to create_post in Create handler
              
              
                pfefferle 94a9cc7
              
                Update @covers annotation in test for create_post
              
              
                pfefferle 406d34e
              
                Register post meta for remote actor ID
              
              
                pfefferle 3b345a0
              
                Add 'ap_object_type' taxonomy to post type
              
              
                pfefferle 5dbbd42
              
                Remove custom labels from taxonomy registration
              
              
                pfefferle b5adfa3
              
                Remove custom rewrite slugs from taxonomy registration
              
              
                pfefferle f6dd350
              
                Rename handle_actor_update to update_actor
              
              
                pfefferle f784eb1
              
                Rename test method and update covered function
              
              
                pfefferle f9fc961
              
                Refactor update handler result and docblock types
              
              
                pfefferle a367a97
              
                Improve error handling in Create and Update handlers
              
              
                pfefferle c86fb3c
              
                Refactor default error handling in handle_object_update
              
              
                pfefferle ea44b16
              
                Handle missing actor data in update handler
              
              
                pfefferle bd60160
              
                Add Attachments processor class with comprehensive tests
              
              
                obenland 737aafd
              
                Add filter for extensible attachment markup generation
              
              
                obenland ce7d197
              
                Refactor attachment processing calls
              
              
                obenland b76da8c
              
                Add unit tests for Posts collection attachment handling
              
              
                obenland 8502af9
              
                Update Classic Editor support comment
              
              
                obenland becb0b9
              
                Refactor test image copy logic in mock download functions
              
              
                obenland 15866dc
              
                Simplify array formatting in test attachments
              
              
                obenland 298f313
              
                Fix attachment author handling for different contexts
              
              
                obenland 2d949b5
              
                Simplify Attachments API by removing base_path parameter
              
              
                obenland 4ff81f7
              
                Fix array comparison in has_updated_attachments
              
              
                obenland a06dbc6
              
                Move WordPress function checks earlier in save_attachment
              
              
                pfefferle 6f0790b
              
                Merge branch 'trunk' into attachment-handling
              
              
                pfefferle c9c821b
              
                Merge branch 'trunk' into attachment-handling
              
              
                pfefferle b431811
              
                Fix incorrect post type registration in test setup
              
              
                pfefferle 0ee25a2
              
                Experiment with "manually" inherited post status
              
              
                obenland fafe402
              
                Merge trunk into attachment-handling branch
              
              
                obenland e59c0f1
              
                Add changelog
              
              
                matticbot 596bcfc
              
                Hide ActivityPub attachments from Media Library
              
              
                obenland 8c4469c
              
                Delete all attachments when ap_post is deleted
              
              
                obenland 3ae2d88
              
                Fix race condition in attachment processing
              
              
                obenland 2e0bb8a
              
                Fix get_attached_media() for ActivityPub posts
              
              
                obenland a0b5d0c
              
                Revert "Fix race condition in attachment processing"
              
              
                obenland a94646c
              
                Fix failing tests after merge with trunk
              
              
                obenland f640496
              
                Add inline image processing for ActivityPub imports
              
              
                obenland d66dd90
              
                Fix whitespace
              
              
                obenland 6692c5a
              
                Merge branch 'trunk' into attachment-handling
              
              
                obenland e8cebe8
              
                Rename Attachments::process() to Attachments::import()
              
              
                obenland cdc0c43
              
                Rename process_inline_images to import_inline_images
              
              
                obenland 3da9b0a
              
                Refactor meta_query retrieval in Attachments class
              
              
                obenland 972f57c
              
                Do not federate imports (#2372)
              
              
                pfefferle 6ee806e
              
                Use direct file storage for ActivityPub inbox attachments (#2375)
              
              
                obenland 669050b
              
                Merge branch 'trunk' into attachment-handling
              
              
                obenland cee8935
              
                Simplify attachment update logic and remove actor check
              
              
                obenland 09ca189
              
                Remove maybe_hide_from_media_library method
              
              
                obenland adf0eb8
              
                Call wp_mkdir_p unconditionally to ensure parent directories exist
              
              
                obenland 4bfb8e7
              
                Refactor file name variable naming in Attachments class
              
              
                obenland 1bca355
              
                Update includes/class-attachments.php
              
              
                obenland 138f2dc
              
                Remove stray comment
              
              
                obenland e8444d9
              
                Use wp_check_filetype_and_ext() for file validation
              
              
                obenland 0876ad0
              
                Refactor attachment deletion and media append methods
              
              
                obenland 7abd6ef
              
                Update cover annotation
              
              
                obenland 6820a9a
              
                Refactor Attachments class for better extensibility
              
              
                obenland e0d5e56
              
                Merge branch 'trunk' into attachment-handling
              
              
                obenland 8b50cf8
              
                Merge branch 'trunk' into attachment-handling
              
              
                obenland ad8249e
              
                Fix merge conflict resolution left over
              
              
                obenland 81812db
              
                Merge branch 'trunk' into attachment-handling
              
              
                obenland File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: minor | ||
| Type: added | ||
|         
                  obenland marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
|  | ||
| Add unified attachment processor for handling ActivityPub media imports from both remote URLs and local files, with automatic media block generation and Classic Editor support. | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.