diff --git a/homeboy.json b/homeboy.json index cf25dc176..1ada53a0a 100644 --- a/homeboy.json +++ b/homeboy.json @@ -1,5 +1,721 @@ { "auto_cleanup": false, + "baselines": { + "audit": { + "context_id": "data-machine-socials", + "created_at": "2026-04-11T13:23:29Z", + "item_count": 677, + "known_fingerprints": [ + "Bluesky::inc/Abilities/Bluesky/BlueskyPublishAbility.php::MissingImport", + "Bluesky::inc/Abilities/Bluesky/BlueskyPublishAbility.php::MissingInterface", + "Bluesky::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::MissingMethod", + "Facebook::inc/Abilities/Facebook/FacebookPublishAbility.php::MissingImport", + "Facebook::inc/Abilities/Facebook/FacebookPublishAbility.php::MissingInterface", + "Facebook::inc/Abilities/Facebook/FacebookUpdateAbility.php::MissingMethod", + "LinkedIn::inc/Abilities/LinkedIn/LinkedInPublishAbility.php::MissingInterface", + "Templates::inc/ImageGeneration/Templates/QuoteCard.php::NamingMismatch", + "Threads::inc/Abilities/Threads/ThreadsPublishAbility.php::MissingImport", + "Threads::inc/Abilities/Threads/ThreadsPublishAbility.php::MissingInterface", + "Threads::inc/Abilities/Threads/ThreadsUpdateAbility.php::MissingMethod", + "Threads::inc/Handlers/Threads/ThreadsSettings.php::SignatureMismatch", + "Twitter::inc/Abilities/Twitter/TwitterPublishAbility.php::MissingImport", + "Twitter::inc/Abilities/Twitter/TwitterPublishAbility.php::MissingInterface", + "Twitter::inc/Abilities/Twitter/TwitterUpdateAbility.php::MissingMethod", + "dead_code::data-machine-socials.php::UnreferencedExport", + "dead_code::data-machine-socials.php::UnreferencedExport", + "dead_code::data-machine-socials.php::UnreferencedExport", + "dead_code::inc/Chat/Tools/DeleteBluesky.php::UnusedParameter", + "dead_code::inc/Chat/Tools/DeleteFacebook.php::UnusedParameter", + "dead_code::inc/Chat/Tools/DeleteInstagram.php::UnusedParameter", + "dead_code::inc/Chat/Tools/DeleteLinkedIn.php::UnusedParameter", + "dead_code::inc/Chat/Tools/DeletePinterest.php::UnusedParameter", + "dead_code::inc/Chat/Tools/DeleteThreads.php::UnusedParameter", + "dead_code::inc/Chat/Tools/DeleteTwitter.php::UnusedParameter", + "dead_code::inc/Chat/Tools/FetchReddit.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishBluesky.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishFacebook.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishInstagram.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishLinkedIn.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishPinterest.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishReelInstagram.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishStoryInstagram.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishThreads.php::UnusedParameter", + "dead_code::inc/Chat/Tools/PublishTwitter.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReadBluesky.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReadFacebook.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReadInstagram.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReadLinkedIn.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReadPinterest.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReadThreads.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReadTwitter.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReplyInstagramComment.php::UnusedParameter", + "dead_code::inc/Chat/Tools/ReplyReddit.php::UnusedParameter", + "dead_code::inc/Chat/Tools/SubmitReddit.php::UnusedParameter", + "dead_code::inc/Chat/Tools/UpdateBluesky.php::UnusedParameter", + "dead_code::inc/Chat/Tools/UpdateFacebook.php::UnusedParameter", + "dead_code::inc/Chat/Tools/UpdateInstagram.php::UnusedParameter", + "dead_code::inc/Chat/Tools/UpdateLinkedIn.php::UnusedParameter", + "dead_code::inc/Chat/Tools/UpdatePinterest.php::UnusedParameter", + "dead_code::inc/Chat/Tools/UpdateThreads.php::UnusedParameter", + "dead_code::inc/Chat/Tools/UpdateTwitter.php::UnusedParameter", + "dead_code::inc/Chat/Tools/VoteReddit.php::UnusedParameter", + "dead_code::inc/Cleanup.php::UnreferencedExport", + "dead_code::inc/Cleanup.php::UnreferencedExport", + "dead_code::inc/Cleanup.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/BlueskyCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/BlueskyCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/BlueskyCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/FacebookCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/InstagramCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/InstagramCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/InstagramCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/LinkedInCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/PinterestCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/PinterestCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/PinterestCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/PinterestCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/RedditCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/RedditCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/RedditCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/RedditCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/RedditCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/RedditCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/SharesCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/SharesCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/SharesCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/ThreadsCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/TwitterCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/TwitterCommand.php::UnreferencedExport", + "dead_code::inc/Cli/Commands/TwitterCommand.php::UnusedParameter", + "dead_code::inc/Cli/Commands/TwitterCommand.php::UnusedParameter", + "dead_code::inc/Handlers/LinkedIn/LinkedInAuth.php::UnusedParameter", + "dead_code::inc/Handlers/Pinterest/PinterestAuth.php::UnusedParameter", + "dead_code::inc/Handlers/Reddit/RedditAuth.php::UnusedParameter", + "dead_code::inc/Handlers/Reddit/RedditSettings.php::UnreferencedExport", + "dead_code::inc/ImageGeneration/Templates/DiagramTemplate.php::UnusedParameter", + "dead_code::inc/ImageGeneration/Templates/DiagramTemplate.php::UnusedParameter", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::inc/RestApi.php::UnreferencedExport", + "dead_code::src/components/CaptionInput.tsx::UnreferencedExport", + "dead_code::src/components/CaptionInput.tsx::UnusedParameter", + "dead_code::src/components/ImageSelector.tsx::UnreferencedExport", + "dead_code::src/components/ImageSelector.tsx::UnusedParameter", + "dead_code::src/components/PlatformSelector.tsx::UnreferencedExport", + "dead_code::src/components/PlatformSelector.tsx::UnusedParameter", + "dead_code::src/components/SocialEditor.tsx::UnreferencedExport", + "dead_code::src/components/SocialEditor.tsx::UnusedParameter", + "dead_code::src/utils/PlatformRegistry.ts::UnreferencedExport", + "dead_code::src/utils/PlatformRegistry.ts::UnreferencedExport", + "dead_code::src/utils/PlatformRegistry.ts::UnreferencedExport", + "dead_code::src/utils/PlatformRegistry.ts::UnreferencedExport", + "dead_code::src/utils/PlatformRegistry.ts::UnreferencedExport", + "dead_code::src/utils/PlatformRegistry.ts::UnreferencedExport", + "dead_code::src/utils/PlatformRegistry.ts::UnreferencedExport", + "dead_code::src/utils/api.ts::UnreferencedExport", + "dead_code::src/utils/api.ts::UnreferencedExport", + "dead_code::src/utils/api.ts::UnreferencedExport", + "dead_code::src/utils/cropImage.ts::UnreferencedExport", + "dead_code::src/utils/cropImage.ts::UnreferencedExport", + "dead_code::src/utils/cropImage.ts::UnreferencedExport", + "dead_code::src/utils/imageExtractor.ts::UnreferencedExport", + "dead_code::src/utils/imageExtractor.ts::UnreferencedExport", + "field_patterns::inc/Cli/Commands/BlueskyCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/BlueskyCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/FacebookCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/FacebookCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/FacebookCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/InstagramCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/InstagramCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/InstagramCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/InstagramCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/LinkedInCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/LinkedInCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/RedditCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/ThreadsCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/ThreadsCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Cli/Commands/TwitterCommand.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Bluesky/Bluesky.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Facebook/Facebook.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Instagram/Instagram.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Instagram/InstagramSettings.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/LinkedIn/LinkedIn.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/LinkedIn/LinkedInSettings.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Pinterest/Pinterest.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Reddit/Reddit.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Reddit/RedditSettings.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Threads/Threads.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Twitter/Twitter.php::RepeatedFieldPattern", + "field_patterns::inc/Handlers/Twitter/TwitterSettings.php::RepeatedFieldPattern", + "field_patterns::src/types/index.ts::RepeatedFieldPattern", + "field_patterns::src/utils/cropImage.ts::RepeatedFieldPattern", + "intra-method-duplication::inc/Abilities/Bluesky/BlueskyPublishAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/Facebook/FacebookPublishAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/Instagram/InstagramPublishAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/Instagram/InstagramReadAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/LinkedIn/LinkedInPublishAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/Pinterest/PinterestBoardsAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/Reddit/FetchRedditAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/Threads/ThreadsPublishAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Abilities/Twitter/TwitterPublishAbility.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Chat/Tools/ReadInstagram.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Handlers/Bluesky/BlueskyAuth.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Handlers/Facebook/FacebookAuth.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Handlers/Threads/ThreadsAuth.php::IntraMethodDuplicate", + "intra-method-duplication::inc/Handlers/Twitter/TwitterAuth.php::IntraMethodDuplicate", + "intra-method-duplication::inc/RestApi.php::IntraMethodDuplicate", + "intra-method-duplication::tests/Unit/Abilities/Instagram/InstagramPublishStoryTest.php::IntraMethodDuplicate", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Facebook/FacebookUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Instagram/InstagramUpdateAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/FetchRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Reddit/ReplyRedditAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Abilities/Threads/ThreadsPublishAbility.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/BlueskyCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/CommentsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/FacebookCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/InstagramCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/PinterestCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/RedditCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/ThreadsCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "parallel-implementation::inc/Cli/Commands/TwitterCommand.php::ParallelImplementation", + "structural::inc/Chat/Tools::DirectorySprawl", + "structural::inc/Cli/Commands/RedditCommand.php::GodFile", + "structural::inc/RestApi.php::GodFile", + "test_coverage::inc/Abilities/Bluesky/BlueskyDeleteAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Bluesky/BlueskyPublishAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Bluesky/BlueskyReadAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Bluesky/BlueskyUpdateAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Facebook/FacebookDeleteAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Facebook/FacebookPublishAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Facebook/FacebookReadAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Facebook/FacebookUpdateAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Instagram/InstagramCommentReplyAbility.php::MissingTestMethod", + "test_coverage::inc/Abilities/Instagram/InstagramDeleteAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Instagram/InstagramPublishAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Instagram/InstagramReadAbility.php::MissingTestMethod", + "test_coverage::inc/Abilities/Instagram/InstagramReadAbility.php::MissingTestMethod", + "test_coverage::inc/Abilities/Instagram/InstagramUpdateAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/LinkedIn/LinkedInDeleteAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/LinkedIn/LinkedInPublishAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/LinkedIn/LinkedInReadAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/LinkedIn/LinkedInUpdateAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Pinterest/PinterestAnalyticsAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Pinterest/PinterestBoardsAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Pinterest/PinterestDeleteAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Pinterest/PinterestPublishAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Pinterest/PinterestReadAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Pinterest/PinterestUpdateAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Reddit/FetchRedditAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Reddit/ReplyRedditAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Reddit/SubmitRedditAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Reddit/VoteRedditAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Threads/ThreadsDeleteAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Threads/ThreadsPublishAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Threads/ThreadsReadAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Threads/ThreadsUpdateAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Twitter/TwitterDeleteAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Twitter/TwitterPublishAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Twitter/TwitterReadAbility.php::MissingTestFile", + "test_coverage::inc/Abilities/Twitter/TwitterUpdateAbility.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/DeleteBluesky.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/DeleteFacebook.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/DeleteInstagram.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/DeleteLinkedIn.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/DeletePinterest.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/DeleteThreads.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/DeleteTwitter.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/FetchReddit.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishBluesky.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishFacebook.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishInstagram.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishLinkedIn.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishPinterest.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishReelInstagram.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishStoryInstagram.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishThreads.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/PublishTwitter.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReadBluesky.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReadFacebook.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReadInstagram.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReadLinkedIn.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReadPinterest.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReadThreads.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReadTwitter.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReplyInstagramComment.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/ReplyReddit.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/SubmitReddit.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/UpdateBluesky.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/UpdateFacebook.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/UpdateInstagram.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/UpdateLinkedIn.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/UpdatePinterest.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/UpdateThreads.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/UpdateTwitter.php::MissingTestFile", + "test_coverage::inc/Chat/Tools/VoteReddit.php::MissingTestFile", + "test_coverage::inc/Cleanup.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/BlueskyCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/CommentsCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/FacebookCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/InstagramCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/LinkedInCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/PinterestCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/RedditCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/SharesCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/ThreadsCommand.php::MissingTestFile", + "test_coverage::inc/Cli/Commands/TwitterCommand.php::MissingTestFile", + "test_coverage::inc/Handlers/Bluesky/Bluesky.php::MissingTestFile", + "test_coverage::inc/Handlers/Bluesky/BlueskyAuth.php::MissingTestFile", + "test_coverage::inc/Handlers/Bluesky/BlueskySettings.php::MissingTestFile", + "test_coverage::inc/Handlers/Facebook/Facebook.php::MissingTestFile", + "test_coverage::inc/Handlers/Facebook/FacebookAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Facebook/FacebookAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Facebook/FacebookAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Facebook/FacebookSettings.php::MissingTestFile", + "test_coverage::inc/Handlers/Instagram/Instagram.php::MissingTestFile", + "test_coverage::inc/Handlers/Instagram/InstagramAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Instagram/InstagramAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Instagram/InstagramSettings.php::MissingTestFile", + "test_coverage::inc/Handlers/LinkedIn/LinkedIn.php::MissingTestFile", + "test_coverage::inc/Handlers/LinkedIn/LinkedInAuth.php::MissingTestFile", + "test_coverage::inc/Handlers/LinkedIn/LinkedInSettings.php::MissingTestFile", + "test_coverage::inc/Handlers/Pinterest/Pinterest.php::MissingTestFile", + "test_coverage::inc/Handlers/Pinterest/PinterestAuth.php::MissingTestFile", + "test_coverage::inc/Handlers/Pinterest/PinterestSettings.php::MissingTestFile", + "test_coverage::inc/Handlers/Reddit/Reddit.php::MissingTestFile", + "test_coverage::inc/Handlers/Reddit/RedditAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Reddit/RedditAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Reddit/RedditSettings.php::MissingTestFile", + "test_coverage::inc/Handlers/Threads/Threads.php::MissingTestFile", + "test_coverage::inc/Handlers/Threads/ThreadsAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Threads/ThreadsAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Threads/ThreadsAuth.php::MissingTestMethod", + "test_coverage::inc/Handlers/Threads/ThreadsSettings.php::MissingTestFile", + "test_coverage::inc/Handlers/Traits/HasGetAccountDetails.php::MissingTestFile", + "test_coverage::inc/Handlers/Traits/HasRemoveAccount.php::MissingTestFile", + "test_coverage::inc/Handlers/Twitter/Twitter.php::MissingTestFile", + "test_coverage::inc/Handlers/Twitter/TwitterAuth.php::MissingTestFile", + "test_coverage::inc/Handlers/Twitter/TwitterSettings.php::MissingTestFile", + "test_coverage::inc/ImageGeneration/Templates/ChartTemplate.php::MissingTestFile", + "test_coverage::inc/ImageGeneration/Templates/DiagramTemplate.php::MissingTestFile", + "test_coverage::inc/ImageGeneration/Templates/QuoteCard.php::MissingTestFile", + "test_coverage::inc/RestApi.php::MissingTestFile", + "test_coverage::tests/Unit/Abilities/Instagram/InstagramPublishReelTest.php::OrphanedTest", + "test_coverage::tests/Unit/Abilities/Instagram/InstagramPublishStoryTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Instagram/InstagramAuthTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Instagram/InstagramAuthTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Instagram/InstagramAuthTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Instagram/InstagramAuthTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Reddit/RedditAuthTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Reddit/RedditAuthTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Threads/ThreadsAuthTest.php::OrphanedTest", + "test_coverage::tests/Unit/Handlers/Threads/ThreadsAuthTest.php::OrphanedTest" + ], + "metadata": { + "alignment_score": 0.7876105904579163, + "known_outliers": [ + "inc/Abilities/Bluesky/BlueskyPublishAbility.php", + "inc/Abilities/Bluesky/BlueskyUpdateAbility.php", + "inc/Cli/Commands/SharesCommand.php", + "inc/Cli/Commands/LinkedInCommand.php", + "inc/Cli/Commands/TwitterCommand.php", + "inc/Cli/Commands/PinterestCommand.php", + "inc/Cli/Commands/CommentsCommand.php", + "inc/Cli/Commands/RedditCommand.php", + "inc/Abilities/Facebook/FacebookPublishAbility.php", + "inc/Abilities/Facebook/FacebookUpdateAbility.php", + "inc/Abilities/Instagram/InstagramCommentReplyAbility.php", + "inc/Abilities/Instagram/InstagramUpdateAbility.php", + "inc/Abilities/Instagram/InstagramPublishAbility.php", + "inc/Abilities/LinkedIn/LinkedInPublishAbility.php", + "inc/Abilities/Pinterest/PinterestAnalyticsAbility.php", + "inc/Abilities/Pinterest/PinterestUpdateAbility.php", + "inc/Abilities/Pinterest/PinterestBoardsAbility.php", + "inc/Abilities/Pinterest/PinterestPublishAbility.php", + "inc/ImageGeneration/Templates/QuoteCard.php", + "inc/Handlers/Threads/ThreadsSettings.php", + "inc/Abilities/Threads/ThreadsUpdateAbility.php", + "inc/Abilities/Threads/ThreadsPublishAbility.php", + "inc/Abilities/Twitter/TwitterPublishAbility.php", + "inc/Abilities/Twitter/TwitterUpdateAbility.php" + ], + "outliers_count": 24 + } + } + }, "changelog_target": "docs/CHANGELOG.md", "extensions": { "wordpress": {} diff --git a/inc/Abilities/Bluesky/BlueskyDeleteAbility.php b/inc/Abilities/Bluesky/BlueskyDeleteAbility.php index e86615c11..66157fbbd 100644 --- a/inc/Abilities/Bluesky/BlueskyDeleteAbility.php +++ b/inc/Abilities/Bluesky/BlueskyDeleteAbility.php @@ -13,10 +13,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Bluesky\BlueskyAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class BlueskyDeleteAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -73,10 +76,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $auth = $this->getAuthProvider(); if ( ! $auth ) { diff --git a/inc/Abilities/Bluesky/BlueskyPublishAbility.php b/inc/Abilities/Bluesky/BlueskyPublishAbility.php index da4f8922c..0b10e8ff7 100644 --- a/inc/Abilities/Bluesky/BlueskyPublishAbility.php +++ b/inc/Abilities/Bluesky/BlueskyPublishAbility.php @@ -434,4 +434,59 @@ private static function fetch_og_tags( string $url ): array|\WP_Error { return $og; } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } + + private function getAuthProvider(): ?BlueskyAuth { + $auth_abilities = new \DataMachine\Abilities\AuthAbilities(); + $provider = $auth_abilities->getProvider( 'bluesky' ); + + if ( $provider instanceof BlueskyAuth ) { + return $provider; + } + + return null; + } + + public function execute( array $input ): array|\WP_Error { + $action = $input['action'] ?? 'list'; + + $auth = $this->getAuthProvider(); + if ( ! $auth ) { + return new \WP_Error( 'missing_auth', 'Bluesky auth provider not available', array( 'status' => 401 ) ); + } + + $session = $auth->get_session(); + if ( is_wp_error( $session ) ) { + return new \WP_Error( 'api_error', 'Bluesky session creation failed: ' . $session->get_error_message(), array( 'status' => 500 ) ); + } + + if ( empty( $session['accessJwt'] ) ) { + return new \WP_Error( 'missing_auth', 'Bluesky authentication failed (no access token in session)', array( 'status' => 401 ) ); + } + + $pds_url = $session['pds_url'] ?? 'https://bsky.social'; + $access_token = $session['accessJwt']; + $did = $session['did'] ?? ''; + $handle = $session['handle'] ?? ''; + + switch ( $action ) { + case 'list': + return $this->listPosts( $pds_url, $access_token, $did ? $did : $handle, $input ); + + case 'get': + if ( empty( $input['post_uri'] ) ) { + return new \WP_Error( 'missing_param', 'post_uri is required for the get action', array( 'status' => 400 ) ); + } + return $this->getPostThread( $pds_url, $access_token, $input['post_uri'] ); + + case 'profile': + return $this->getProfile( $pds_url, $access_token, $did ? $did : $handle ); + + default: + return new \WP_Error( 'api_error', "Unknown action: {$action}. Use list, get, or profile.", array( 'status' => 500 ) ); + } + } } diff --git a/inc/Abilities/Bluesky/BlueskyReadAbility.php b/inc/Abilities/Bluesky/BlueskyReadAbility.php index e366454a7..56734fd3a 100644 --- a/inc/Abilities/Bluesky/BlueskyReadAbility.php +++ b/inc/Abilities/Bluesky/BlueskyReadAbility.php @@ -15,10 +15,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachine\Core\HttpClient; use DataMachineSocials\Handlers\Bluesky\BlueskyAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class BlueskyReadAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -89,10 +92,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? 'list'; diff --git a/inc/Abilities/Bluesky/BlueskyUpdateAbility.php b/inc/Abilities/Bluesky/BlueskyUpdateAbility.php index f8ad235ef..611e5e2da 100644 --- a/inc/Abilities/Bluesky/BlueskyUpdateAbility.php +++ b/inc/Abilities/Bluesky/BlueskyUpdateAbility.php @@ -14,10 +14,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Bluesky\BlueskyAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Bluesky\BlueskyDeleteAbility; defined( 'ABSPATH' ) || exit; class BlueskyUpdateAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -79,10 +83,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? ''; @@ -117,21 +117,6 @@ public function execute( array $input ): array|\WP_Error { } } - private function getAuthProvider(): ?BlueskyAuth { - if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { - return null; - } - - $auth = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth->getProvider( 'bluesky' ); - - if ( ! $provider instanceof BlueskyAuth ) { - return null; - } - - return $provider; - } - private function deletePost( array $session, string $post_uri ): array|\WP_Error { $pds_url = $session['pds_url']; $did = $session['did']; diff --git a/inc/Abilities/Facebook/FacebookDeleteAbility.php b/inc/Abilities/Facebook/FacebookDeleteAbility.php index 3157c2711..821475625 100644 --- a/inc/Abilities/Facebook/FacebookDeleteAbility.php +++ b/inc/Abilities/Facebook/FacebookDeleteAbility.php @@ -13,10 +13,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Facebook\FacebookAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class FacebookDeleteAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -75,10 +78,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $auth = $this->getAuthProvider(); if ( ! $auth ) { diff --git a/inc/Abilities/Facebook/FacebookPublishAbility.php b/inc/Abilities/Facebook/FacebookPublishAbility.php index 087c8e036..5a30554b8 100644 --- a/inc/Abilities/Facebook/FacebookPublishAbility.php +++ b/inc/Abilities/Facebook/FacebookPublishAbility.php @@ -358,4 +358,71 @@ private static function post_comment( string $post_id, string $message, string $ private static function build_graph_url( string $path ): string { return 'https://graph.facebook.com/v23.0/' . ltrim( $path, '/' ); } + + private function getAuthProvider(): ?FacebookAuth { + if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { + return null; + } + + $auth = new \DataMachine\Abilities\AuthAbilities(); + $provider = $auth->getProvider( 'facebook' ); + + if ( ! $provider instanceof FacebookAuth ) { + return null; + } + + return $provider; + } + + public function execute( array $input ): array|\WP_Error { + $auth = $this->getAuthProvider(); + if ( ! $auth ) { + return new \WP_Error( 'missing_auth', 'Facebook auth provider not available', array( 'status' => 401 ) ); + } + + $access_token = $auth->get_page_access_token(); + if ( empty( $access_token ) ) { + return new \WP_Error( 'missing_auth', 'Facebook page access token unavailable', array( 'status' => 401 ) ); + } + + if ( empty( $input['post_id'] ) ) { + return new \WP_Error( 'missing_param', 'post_id is required', array( 'status' => 400 ) ); + } + + $url = self::GRAPH_API_URL . '/' . rawurlencode( $input['post_id'] ); + + $response = wp_remote_post( + $url, + array( + 'timeout' => 30, + 'body' => array( + 'access_token' => $access_token, + 'method' => 'DELETE', + ), + ) + ); + + if ( is_wp_error( $response ) ) { + return new \WP_Error( 'api_error', $response->get_error_message(), array( 'status' => 500 ) ); + } + + $status_code = wp_remote_retrieve_response_code( $response ); + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + + if ( 200 === $status_code || ( isset( $body['success'] ) && $body['success'] ) ) { + return array( + 'success' => true, + 'data' => array( + 'post_id' => $input['post_id'], + 'deleted' => true, + ), + ); + } + + return new \WP_Error( 'api_error', $body['error']['message'] ?? 'Failed to delete post', array( 'status' => 500 ) ); + } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } } diff --git a/inc/Abilities/Facebook/FacebookReadAbility.php b/inc/Abilities/Facebook/FacebookReadAbility.php index 2e54a4dbf..663dcb38d 100644 --- a/inc/Abilities/Facebook/FacebookReadAbility.php +++ b/inc/Abilities/Facebook/FacebookReadAbility.php @@ -15,10 +15,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachine\Core\HttpClient; use DataMachineSocials\Handlers\Facebook\FacebookAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class FacebookReadAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -93,10 +96,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? 'list'; diff --git a/inc/Abilities/Facebook/FacebookUpdateAbility.php b/inc/Abilities/Facebook/FacebookUpdateAbility.php index b4b4c9115..2679dfb6d 100644 --- a/inc/Abilities/Facebook/FacebookUpdateAbility.php +++ b/inc/Abilities/Facebook/FacebookUpdateAbility.php @@ -14,10 +14,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Facebook\FacebookAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Facebook\FacebookDeleteAbility; defined( 'ABSPATH' ) || exit; class FacebookUpdateAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -85,15 +89,6 @@ private function registerAbilities(): void { } } - /** - * Permission callback. - * - * @return bool - */ - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute the update ability. * @@ -141,26 +136,6 @@ public function execute( array $input ): array|\WP_Error { } } - /** - * Get auth provider. - * - * @return FacebookAuth|null - */ - private function getAuthProvider(): ?FacebookAuth { - if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { - return null; - } - - $auth = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth->getProvider( 'facebook' ); - - if ( ! $provider instanceof FacebookAuth ) { - return null; - } - - return $provider; - } - /** * Edit a post's message. * diff --git a/inc/Abilities/Instagram/InstagramCommentReplyAbility.php b/inc/Abilities/Instagram/InstagramCommentReplyAbility.php index fa72524b6..492ea2880 100644 --- a/inc/Abilities/Instagram/InstagramCommentReplyAbility.php +++ b/inc/Abilities/Instagram/InstagramCommentReplyAbility.php @@ -13,10 +13,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Instagram\InstagramAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Instagram\InstagramDeleteAbility; defined( 'ABSPATH' ) || exit; class InstagramCommentReplyAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -82,10 +86,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $auth = $this->getAuthProvider(); if ( ! $auth ) { @@ -115,21 +115,6 @@ public function execute( array $input ): array|\WP_Error { return $this->replyToComment( $access_token, $comment_id, $message ); } - private function getAuthProvider(): ?InstagramAuth { - if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { - return null; - } - - $auth = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth->getProvider( 'instagram' ); - - if ( ! $provider instanceof InstagramAuth ) { - return null; - } - - return $provider; - } - private function replyToComment( string $access_token, string $comment_id, string $message ): array|\WP_Error { $url = self::GRAPH_API_URL . '/' . rawurlencode( $comment_id ) . '/replies'; diff --git a/inc/Abilities/Instagram/InstagramDeleteAbility.php b/inc/Abilities/Instagram/InstagramDeleteAbility.php index 5231c6d57..d9922cac2 100644 --- a/inc/Abilities/Instagram/InstagramDeleteAbility.php +++ b/inc/Abilities/Instagram/InstagramDeleteAbility.php @@ -13,10 +13,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Instagram\InstagramAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class InstagramDeleteAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -75,10 +78,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $auth = $this->getAuthProvider(); if ( ! $auth ) { diff --git a/inc/Abilities/Instagram/InstagramPublishAbility.php b/inc/Abilities/Instagram/InstagramPublishAbility.php index 784b1c093..778f8bb50 100644 --- a/inc/Abilities/Instagram/InstagramPublishAbility.php +++ b/inc/Abilities/Instagram/InstagramPublishAbility.php @@ -685,4 +685,52 @@ public static function get_account( array $input ): array|\WP_Error { 'username' => $provider->get_username() ?? '', ); } + + private function getAuthProvider(): ?InstagramAuth { + if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { + return null; + } + + $auth = new \DataMachine\Abilities\AuthAbilities(); + $provider = $auth->getProvider( 'instagram' ); + + if ( ! $provider instanceof InstagramAuth ) { + return null; + } + + return $provider; + } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } + + public function execute( array $input ): array|\WP_Error { + $auth = $this->getAuthProvider(); + if ( ! $auth ) { + return new \WP_Error( 'missing_auth', 'Instagram auth provider not available', array( 'status' => 401 ) ); + } + + $access_token = $auth->get_valid_access_token(); + if ( empty( $access_token ) ) { + return new \WP_Error( 'missing_auth', 'Instagram access token unavailable (expired or refresh failed)', array( 'status' => 401 ) ); + } + + $comment_id = sanitize_text_field( $input['comment_id'] ?? '' ); + $message = trim( sanitize_textarea_field( $input['message'] ?? '' ) ); + + if ( '' === $comment_id ) { + return new \WP_Error( 'missing_param', 'comment_id is required', array( 'status' => 400 ) ); + } + + if ( '' === $message ) { + return new \WP_Error( 'missing_param', 'message is required', array( 'status' => 400 ) ); + } + + if ( mb_strlen( $message ) > self::MAX_REPLY_LENGTH ) { + $message = mb_substr( $message, 0, self::MAX_REPLY_LENGTH ); + } + + return $this->replyToComment( $access_token, $comment_id, $message ); + } } diff --git a/inc/Abilities/Instagram/InstagramReadAbility.php b/inc/Abilities/Instagram/InstagramReadAbility.php index 8e4c8e5ea..6e4df65b0 100644 --- a/inc/Abilities/Instagram/InstagramReadAbility.php +++ b/inc/Abilities/Instagram/InstagramReadAbility.php @@ -15,10 +15,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachine\Core\HttpClient; use DataMachineSocials\Handlers\Instagram\InstagramAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class InstagramReadAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -107,15 +110,6 @@ private function registerAbilities(): void { } } - /** - * Permission callback. - * - * @return bool - */ - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute the read ability. * diff --git a/inc/Abilities/Instagram/InstagramUpdateAbility.php b/inc/Abilities/Instagram/InstagramUpdateAbility.php index 15aaa5157..389e9c021 100644 --- a/inc/Abilities/Instagram/InstagramUpdateAbility.php +++ b/inc/Abilities/Instagram/InstagramUpdateAbility.php @@ -14,10 +14,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Instagram\InstagramAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Instagram\InstagramDeleteAbility; defined( 'ABSPATH' ) || exit; class InstagramUpdateAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -91,15 +95,6 @@ private function registerAbilities(): void { } } - /** - * Permission callback. - * - * @return bool - */ - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute the update ability. * @@ -144,26 +139,6 @@ public function execute( array $input ): array|\WP_Error { } } - /** - * Get auth provider. - * - * @return InstagramAuth|null - */ - private function getAuthProvider(): ?InstagramAuth { - if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { - return null; - } - - $auth = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth->getProvider( 'instagram' ); - - if ( ! $provider instanceof InstagramAuth ) { - return null; - } - - return $provider; - } - /** * Edit caption of a media item. * diff --git a/inc/Abilities/LinkedIn/LinkedInDeleteAbility.php b/inc/Abilities/LinkedIn/LinkedInDeleteAbility.php index ef2799694..1a2c38305 100644 --- a/inc/Abilities/LinkedIn/LinkedInDeleteAbility.php +++ b/inc/Abilities/LinkedIn/LinkedInDeleteAbility.php @@ -15,10 +15,14 @@ use DataMachine\Abilities\AuthAbilities; use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\LinkedIn\LinkedInAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\LinkedIn\LinkedInReadAbility; defined( 'ABSPATH' ) || exit; class LinkedInDeleteAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -75,10 +79,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $post_id = $input['post_id'] ?? ''; @@ -118,14 +118,4 @@ public function execute( array $input ): array|\WP_Error { return new \WP_Error( 'api_error', $result['error'] ?? 'Failed to delete LinkedIn post', array( 'status' => 500 ) ); } - private function getAuthProvider(): ?LinkedInAuth { - $auth_abilities = new AuthAbilities(); - $provider = $auth_abilities->getProvider( 'linkedin' ); - - if ( $provider instanceof LinkedInAuth ) { - return $provider; - } - - return null; - } } diff --git a/inc/Abilities/LinkedIn/LinkedInPublishAbility.php b/inc/Abilities/LinkedIn/LinkedInPublishAbility.php index 351961468..fc4b49669 100644 --- a/inc/Abilities/LinkedIn/LinkedInPublishAbility.php +++ b/inc/Abilities/LinkedIn/LinkedInPublishAbility.php @@ -395,4 +395,72 @@ private static function build_post_url( string $post_id ): string { // LinkedIn post URLs follow: https://www.linkedin.com/feed/update/{urn} return 'https://www.linkedin.com/feed/update/' . $post_id; } + + public function execute( array $input ): array|\WP_Error { + $post_id = $input['post_id'] ?? ''; + $commentary = $input['commentary'] ?? ''; + + if ( empty( $post_id ) ) { + return new \WP_Error( 'missing_param', 'post_id is required', array( 'status' => 400 ) ); + } + + if ( empty( $commentary ) ) { + return new \WP_Error( 'missing_param', 'commentary is required', array( 'status' => 400 ) ); + } + + $provider = $this->getAuthProvider(); + if ( ! $provider ) { + return new \WP_Error( 'missing_auth', 'LinkedIn auth provider not available', array( 'status' => 401 ) ); + } + + if ( ! $provider->is_authenticated() ) { + return new \WP_Error( 'missing_auth', 'LinkedIn not authenticated', array( 'status' => 401 ) ); + } + + $encoded_id = rawurlencode( $post_id ); + $url = LinkedInAuth::API_BASE . "/rest/posts/{$encoded_id}"; + + $payload = array( + 'patch' => array( + '$set' => array( + 'commentary' => $commentary, + ), + ), + ); + + $result = $provider->api_request( + 'POST', + $url, + array( + 'headers' => array( 'X-RestLi-Method' => 'PARTIAL_UPDATE' ), + 'body' => wp_json_encode( $payload ), + 'context' => 'LinkedIn Update Post', + ) + ); + + // LinkedIn returns 204 on successful update. + if ( $result['success'] ) { + return array( + 'success' => true, + 'post_id' => $post_id, + ); + } + + return new \WP_Error( 'api_error', $result['error'] ?? 'Failed to update LinkedIn post', array( 'status' => 500 ) ); + } + + private function getAuthProvider(): ?LinkedInAuth { + $auth_abilities = new AuthAbilities(); + $provider = $auth_abilities->getProvider( 'linkedin' ); + + if ( $provider instanceof LinkedInAuth ) { + return $provider; + } + + return null; + } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } } diff --git a/inc/Abilities/LinkedIn/LinkedInReadAbility.php b/inc/Abilities/LinkedIn/LinkedInReadAbility.php index 5d497822e..28874fdc7 100644 --- a/inc/Abilities/LinkedIn/LinkedInReadAbility.php +++ b/inc/Abilities/LinkedIn/LinkedInReadAbility.php @@ -15,10 +15,13 @@ use DataMachine\Abilities\AuthAbilities; use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\LinkedIn\LinkedInAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class LinkedInReadAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -90,10 +93,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? 'list'; diff --git a/inc/Abilities/LinkedIn/LinkedInUpdateAbility.php b/inc/Abilities/LinkedIn/LinkedInUpdateAbility.php index 7b35fab9f..8f7577d36 100644 --- a/inc/Abilities/LinkedIn/LinkedInUpdateAbility.php +++ b/inc/Abilities/LinkedIn/LinkedInUpdateAbility.php @@ -15,10 +15,14 @@ use DataMachine\Abilities\AuthAbilities; use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\LinkedIn\LinkedInAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\LinkedIn\LinkedInReadAbility; defined( 'ABSPATH' ) || exit; class LinkedInUpdateAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -79,10 +83,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $post_id = $input['post_id'] ?? ''; $commentary = $input['commentary'] ?? ''; @@ -136,14 +136,4 @@ public function execute( array $input ): array|\WP_Error { return new \WP_Error( 'api_error', $result['error'] ?? 'Failed to update LinkedIn post', array( 'status' => 500 ) ); } - private function getAuthProvider(): ?LinkedInAuth { - $auth_abilities = new AuthAbilities(); - $provider = $auth_abilities->getProvider( 'linkedin' ); - - if ( $provider instanceof LinkedInAuth ) { - return $provider; - } - - return null; - } } diff --git a/inc/Abilities/Pinterest/PinterestAnalyticsAbility.php b/inc/Abilities/Pinterest/PinterestAnalyticsAbility.php index 1ac1b8925..441a590c1 100644 --- a/inc/Abilities/Pinterest/PinterestAnalyticsAbility.php +++ b/inc/Abilities/Pinterest/PinterestAnalyticsAbility.php @@ -15,10 +15,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachine\Core\HttpClient; use DataMachineSocials\Handlers\Pinterest\PinterestAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Pinterest\PinterestReadAbility; defined( 'ABSPATH' ) || exit; class PinterestAnalyticsAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -121,10 +125,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? 'user'; @@ -366,14 +366,4 @@ private function buildSummary( array $data ): array|\WP_Error { return $summary; } - private function getAuthProvider(): ?PinterestAuth { - $auth_abilities = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth_abilities->getProvider( 'pinterest' ); - - if ( $provider instanceof PinterestAuth ) { - return $provider; - } - - return null; - } } diff --git a/inc/Abilities/Pinterest/PinterestBoardsAbility.php b/inc/Abilities/Pinterest/PinterestBoardsAbility.php index 63519b575..7e5c3e2cf 100644 --- a/inc/Abilities/Pinterest/PinterestBoardsAbility.php +++ b/inc/Abilities/Pinterest/PinterestBoardsAbility.php @@ -314,4 +314,72 @@ public static function is_configured(): bool { $provider = $auth->getProvider( 'pinterest' ); return $provider && $provider->is_authenticated(); } + + public function execute( array $input ): array|\WP_Error { + $auth = $this->getAuthProvider(); + if ( ! $auth ) { + return new \WP_Error( 'missing_auth', 'Pinterest auth provider not available', array( 'status' => 401 ) ); + } + + $access_token = $auth->get_valid_access_token(); + + if ( empty( $access_token ) ) { + return new \WP_Error( 'missing_auth', 'Pinterest access token is missing or expired — re-authorize in WP Admin > Data Machine > Settings', array( 'status' => 401 ) ); + } + + if ( empty( $input['pin_id'] ) ) { + return new \WP_Error( 'missing_param', 'pin_id is required', array( 'status' => 400 ) ); + } + + $url = self::API_URL . '/pins/' . rawurlencode( $input['pin_id'] ); + + $response = wp_remote_request( + $url, + array( + 'method' => 'DELETE', + 'timeout' => 30, + 'headers' => array( + 'Authorization' => 'Bearer ' . $access_token, + ), + ) + ); + + if ( is_wp_error( $response ) ) { + return new \WP_Error( 'api_error', $response->get_error_message(), array( 'status' => 500 ) ); + } + + $status_code = wp_remote_retrieve_response_code( $response ); + + if ( 204 === $status_code || 200 === $status_code ) { + return array( + 'success' => true, + 'data' => array( + 'pin_id' => $input['pin_id'], + 'deleted' => true, + ), + ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + return new \WP_Error( 'api_error', $body['message'] ?? 'Failed to delete pin', array( 'status' => 500 ) ); + } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } + + private function getAuthProvider(): ?PinterestAuth { + if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { + return null; + } + + $auth = new \DataMachine\Abilities\AuthAbilities(); + $provider = $auth->getProvider( 'pinterest' ); + + if ( ! $provider instanceof PinterestAuth ) { + return null; + } + + return $provider; + } } diff --git a/inc/Abilities/Pinterest/PinterestDeleteAbility.php b/inc/Abilities/Pinterest/PinterestDeleteAbility.php index e61acf740..d83705d8c 100644 --- a/inc/Abilities/Pinterest/PinterestDeleteAbility.php +++ b/inc/Abilities/Pinterest/PinterestDeleteAbility.php @@ -13,10 +13,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Pinterest\PinterestAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class PinterestDeleteAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -75,10 +78,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $auth = $this->getAuthProvider(); if ( ! $auth ) { diff --git a/inc/Abilities/Pinterest/PinterestPublishAbility.php b/inc/Abilities/Pinterest/PinterestPublishAbility.php index 95c235729..c5931fa10 100644 --- a/inc/Abilities/Pinterest/PinterestPublishAbility.php +++ b/inc/Abilities/Pinterest/PinterestPublishAbility.php @@ -191,4 +191,72 @@ public static function execute_publish( array $input ): array|\WP_Error { 'pin_url' => $pin_url, ); } + + public function execute( array $input ): array|\WP_Error { + $auth = $this->getAuthProvider(); + if ( ! $auth ) { + return new \WP_Error( 'missing_auth', 'Pinterest auth provider not available', array( 'status' => 401 ) ); + } + + $access_token = $auth->get_valid_access_token(); + + if ( empty( $access_token ) ) { + return new \WP_Error( 'missing_auth', 'Pinterest access token is missing or expired — re-authorize in WP Admin > Data Machine > Settings', array( 'status' => 401 ) ); + } + + if ( empty( $input['pin_id'] ) ) { + return new \WP_Error( 'missing_param', 'pin_id is required', array( 'status' => 400 ) ); + } + + $url = self::API_URL . '/pins/' . rawurlencode( $input['pin_id'] ); + + $response = wp_remote_request( + $url, + array( + 'method' => 'DELETE', + 'timeout' => 30, + 'headers' => array( + 'Authorization' => 'Bearer ' . $access_token, + ), + ) + ); + + if ( is_wp_error( $response ) ) { + return new \WP_Error( 'api_error', $response->get_error_message(), array( 'status' => 500 ) ); + } + + $status_code = wp_remote_retrieve_response_code( $response ); + + if ( 204 === $status_code || 200 === $status_code ) { + return array( + 'success' => true, + 'data' => array( + 'pin_id' => $input['pin_id'], + 'deleted' => true, + ), + ); + } + + $body = json_decode( wp_remote_retrieve_body( $response ), true ); + return new \WP_Error( 'api_error', $body['message'] ?? 'Failed to delete pin', array( 'status' => 500 ) ); + } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } + + private function getAuthProvider(): ?PinterestAuth { + if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { + return null; + } + + $auth = new \DataMachine\Abilities\AuthAbilities(); + $provider = $auth->getProvider( 'pinterest' ); + + if ( ! $provider instanceof PinterestAuth ) { + return null; + } + + return $provider; + } } diff --git a/inc/Abilities/Pinterest/PinterestReadAbility.php b/inc/Abilities/Pinterest/PinterestReadAbility.php index 947e799e0..20929b7f9 100644 --- a/inc/Abilities/Pinterest/PinterestReadAbility.php +++ b/inc/Abilities/Pinterest/PinterestReadAbility.php @@ -15,10 +15,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachine\Core\HttpClient; use DataMachineSocials\Handlers\Pinterest\PinterestAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class PinterestReadAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -95,10 +98,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? 'pins'; diff --git a/inc/Abilities/Pinterest/PinterestUpdateAbility.php b/inc/Abilities/Pinterest/PinterestUpdateAbility.php index 2aacbd1f9..1afe5ec13 100644 --- a/inc/Abilities/Pinterest/PinterestUpdateAbility.php +++ b/inc/Abilities/Pinterest/PinterestUpdateAbility.php @@ -14,10 +14,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Pinterest\PinterestAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Pinterest\PinterestDeleteAbility; defined( 'ABSPATH' ) || exit; class PinterestUpdateAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -81,10 +85,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? ''; @@ -114,21 +114,6 @@ public function execute( array $input ): array|\WP_Error { } } - private function getAuthProvider(): ?PinterestAuth { - if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { - return null; - } - - $auth = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth->getProvider( 'pinterest' ); - - if ( ! $provider instanceof PinterestAuth ) { - return null; - } - - return $provider; - } - private function deletePin( string $access_token, string $pin_id ): array|\WP_Error { $url = self::API_URL . '/pins/' . rawurlencode( $pin_id ); diff --git a/inc/Abilities/Reddit/FetchRedditAbility.php b/inc/Abilities/Reddit/FetchRedditAbility.php index 8453eede7..7c0499198 100644 --- a/inc/Abilities/Reddit/FetchRedditAbility.php +++ b/inc/Abilities/Reddit/FetchRedditAbility.php @@ -15,10 +15,13 @@ namespace DataMachineSocials\Abilities\Reddit; use DataMachine\Abilities\PermissionHelper; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class FetchRedditAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -137,15 +140,6 @@ private function registerAbilities(): void { } } - /** - * Permission callback for ability. - * - * @return bool True if user has permission. - */ - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute Reddit fetch ability. * diff --git a/inc/Abilities/Reddit/ReplyRedditAbility.php b/inc/Abilities/Reddit/ReplyRedditAbility.php index 2b0f0aaf5..2f61a55f3 100644 --- a/inc/Abilities/Reddit/ReplyRedditAbility.php +++ b/inc/Abilities/Reddit/ReplyRedditAbility.php @@ -13,10 +13,13 @@ namespace DataMachineSocials\Abilities\Reddit; use DataMachine\Abilities\PermissionHelper; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class ReplyRedditAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -92,10 +95,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute Reddit reply. * diff --git a/inc/Abilities/Reddit/SubmitRedditAbility.php b/inc/Abilities/Reddit/SubmitRedditAbility.php index cf1ba32c4..6944b51d4 100644 --- a/inc/Abilities/Reddit/SubmitRedditAbility.php +++ b/inc/Abilities/Reddit/SubmitRedditAbility.php @@ -13,10 +13,13 @@ namespace DataMachineSocials\Abilities\Reddit; use DataMachine\Abilities\PermissionHelper; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class SubmitRedditAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -128,10 +131,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute Reddit submit. * diff --git a/inc/Abilities/Reddit/VoteRedditAbility.php b/inc/Abilities/Reddit/VoteRedditAbility.php index 774c150d3..4f41f79ba 100644 --- a/inc/Abilities/Reddit/VoteRedditAbility.php +++ b/inc/Abilities/Reddit/VoteRedditAbility.php @@ -12,10 +12,13 @@ namespace DataMachineSocials\Abilities\Reddit; use DataMachine\Abilities\PermissionHelper; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class VoteRedditAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -86,10 +89,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute Reddit vote. * diff --git a/inc/Abilities/Threads/ThreadsDeleteAbility.php b/inc/Abilities/Threads/ThreadsDeleteAbility.php index e1bbe0fbd..fd4214b9e 100644 --- a/inc/Abilities/Threads/ThreadsDeleteAbility.php +++ b/inc/Abilities/Threads/ThreadsDeleteAbility.php @@ -13,10 +13,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Threads\ThreadsAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class ThreadsDeleteAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -75,10 +78,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $auth = $this->getAuthProvider(); if ( ! $auth ) { diff --git a/inc/Abilities/Threads/ThreadsPublishAbility.php b/inc/Abilities/Threads/ThreadsPublishAbility.php index bfa0d77cf..20d28f041 100644 --- a/inc/Abilities/Threads/ThreadsPublishAbility.php +++ b/inc/Abilities/Threads/ThreadsPublishAbility.php @@ -371,4 +371,51 @@ private static function publish_thread( string $access_token, string $creation_i $data['error']['message'] ?? 'Failed to publish thread' ); } + + public function execute( array $input ): array|\WP_Error { + $action = $input['action'] ?? ''; + + $auth = $this->getAuthProvider(); + if ( ! $auth ) { + return new \WP_Error( 'missing_auth', 'Threads auth provider not available', array( 'status' => 401 ) ); + } + + $access_token = $auth->get_valid_access_token(); + if ( empty( $access_token ) ) { + return new \WP_Error( 'missing_auth', 'Threads access token unavailable', array( 'status' => 401 ) ); + } + + if ( empty( $input['thread_id'] ) ) { + return new \WP_Error( 'missing_param', 'thread_id is required', array( 'status' => 400 ) ); + } + + $thread_id = $input['thread_id']; + + switch ( $action ) { + case 'delete': + return $this->deleteThread( $access_token, $thread_id ); + + default: + return new \WP_Error( 'api_error', "Unknown action: {$action}. Use delete.", array( 'status' => 500 ) ); + } + } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } + + private function getAuthProvider(): ?ThreadsAuth { + if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { + return null; + } + + $auth = new \DataMachine\Abilities\AuthAbilities(); + $provider = $auth->getProvider( 'threads' ); + + if ( ! $provider instanceof ThreadsAuth ) { + return null; + } + + return $provider; + } } diff --git a/inc/Abilities/Threads/ThreadsReadAbility.php b/inc/Abilities/Threads/ThreadsReadAbility.php index 14c77e018..309cd285d 100644 --- a/inc/Abilities/Threads/ThreadsReadAbility.php +++ b/inc/Abilities/Threads/ThreadsReadAbility.php @@ -15,10 +15,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachine\Core\HttpClient; use DataMachineSocials\Handlers\Threads\ThreadsAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class ThreadsReadAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -95,10 +98,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? 'list'; diff --git a/inc/Abilities/Threads/ThreadsUpdateAbility.php b/inc/Abilities/Threads/ThreadsUpdateAbility.php index 9883c87b0..3a5e6c2c2 100644 --- a/inc/Abilities/Threads/ThreadsUpdateAbility.php +++ b/inc/Abilities/Threads/ThreadsUpdateAbility.php @@ -14,10 +14,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Threads\ThreadsAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Threads\ThreadsDeleteAbility; defined( 'ABSPATH' ) || exit; class ThreadsUpdateAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -81,10 +85,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? ''; @@ -113,21 +113,6 @@ public function execute( array $input ): array|\WP_Error { } } - private function getAuthProvider(): ?ThreadsAuth { - if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { - return null; - } - - $auth = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth->getProvider( 'threads' ); - - if ( ! $provider instanceof ThreadsAuth ) { - return null; - } - - return $provider; - } - private function deleteThread( string $access_token, string $thread_id ): array|\WP_Error { $url = self::GRAPH_API_URL . '/' . rawurlencode( $thread_id ); diff --git a/inc/Abilities/Traits/HasCheckPermission.php b/inc/Abilities/Traits/HasCheckPermission.php new file mode 100644 index 000000000..694ca33bb --- /dev/null +++ b/inc/Abilities/Traits/HasCheckPermission.php @@ -0,0 +1,16 @@ +getAuthProvider(); if ( ! $auth ) { diff --git a/inc/Abilities/Twitter/TwitterPublishAbility.php b/inc/Abilities/Twitter/TwitterPublishAbility.php index 2245cda39..e7502522c 100644 --- a/inc/Abilities/Twitter/TwitterPublishAbility.php +++ b/inc/Abilities/Twitter/TwitterPublishAbility.php @@ -427,4 +427,57 @@ private static function post_reply( $connection, string $original_tweet_id, stri return new \WP_Error( 'api_error', $e->getMessage(), array( 'status' => 500 ) ); } } + + private function getAuthProvider(): ?TwitterAuth { + if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { + return null; + } + + $auth = new \DataMachine\Abilities\AuthAbilities(); + $provider = $auth->getProvider( 'twitter' ); + + if ( ! $provider instanceof TwitterAuth ) { + return null; + } + + return $provider; + } + + public function checkPermission(): bool { + return PermissionHelper::can_manage(); + } + + public function execute( array $input ): array|\WP_Error { + $auth = $this->getAuthProvider(); + if ( ! $auth ) { + return new \WP_Error( 'missing_auth', 'Twitter auth provider not available', array( 'status' => 401 ) ); + } + + $connection = $auth->get_connection(); + if ( ! $connection ) { + return new \WP_Error( 'missing_auth', 'Twitter connection not available', array( 'status' => 401 ) ); + } + + if ( empty( $input['tweet_id'] ) ) { + return new \WP_Error( 'missing_param', 'tweet_id is required', array( 'status' => 400 ) ); + } + + $connection->setApiVersion( '2' ); + $result = $connection->delete( 'tweets/' . $input['tweet_id'], array() ); + + $http_code = $connection->getLastHttpCode(); + + if ( 200 === $http_code ) { + return array( + 'success' => true, + 'data' => array( + 'tweet_id' => $input['tweet_id'], + 'deleted' => true, + ), + ); + } + + $error = $result['detail'] ?? $result['title'] ?? 'Failed to delete tweet'; + return new \WP_Error( 'api_error', $error, array( 'status' => 500 ) ); + } } diff --git a/inc/Abilities/Twitter/TwitterReadAbility.php b/inc/Abilities/Twitter/TwitterReadAbility.php index 9e8ee5fb8..92f725a1f 100644 --- a/inc/Abilities/Twitter/TwitterReadAbility.php +++ b/inc/Abilities/Twitter/TwitterReadAbility.php @@ -14,10 +14,13 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Twitter\TwitterAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; defined( 'ABSPATH' ) || exit; class TwitterReadAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -92,10 +95,6 @@ private function registerAbilities(): void { } } - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - public function execute( array $input ): array|\WP_Error { $action = $input['action'] ?? 'list'; diff --git a/inc/Abilities/Twitter/TwitterUpdateAbility.php b/inc/Abilities/Twitter/TwitterUpdateAbility.php index 3e4ea7d00..c0f934b13 100644 --- a/inc/Abilities/Twitter/TwitterUpdateAbility.php +++ b/inc/Abilities/Twitter/TwitterUpdateAbility.php @@ -14,10 +14,14 @@ use DataMachine\Abilities\PermissionHelper; use DataMachineSocials\Handlers\Twitter\TwitterAuth; +use DataMachineSocials\Abilities\Traits\HasCheckPermission; +use DataMachineSocials\Abilities\Twitter\TwitterDeleteAbility; defined( 'ABSPATH' ) || exit; class TwitterUpdateAbility { + use HasCheckPermission; + private static bool $registered = false; @@ -79,15 +83,6 @@ private function registerAbilities(): void { } } - /** - * Permission callback. - * - * @return bool - */ - public function checkPermission(): bool { - return PermissionHelper::can_manage(); - } - /** * Execute the update ability. * @@ -135,26 +130,6 @@ public function execute( array $input ): array|\WP_Error { } } - /** - * Get auth provider. - * - * @return TwitterAuth|null - */ - private function getAuthProvider(): ?TwitterAuth { - if ( ! class_exists( '\DataMachine\Abilities\AuthAbilities' ) ) { - return null; - } - - $auth = new \DataMachine\Abilities\AuthAbilities(); - $provider = $auth->getProvider( 'twitter' ); - - if ( ! $provider instanceof TwitterAuth ) { - return null; - } - - return $provider; - } - /** * Delete a tweet. * diff --git a/inc/Chat/Tools/UpdateInstagram.php b/inc/Chat/Tools/UpdateInstagram.php index dd8689b57..36c4ca880 100644 --- a/inc/Chat/Tools/UpdateInstagram.php +++ b/inc/Chat/Tools/UpdateInstagram.php @@ -126,11 +126,6 @@ public function handle_tool_call( array $parameters, array $tool_def = array() ) if ( ! empty( $parameters['caption'] ) ) { $input['caption'] = sanitize_text_field( $parameters['caption'] ); - } - - // Execute via ability (which handles token retrieval internally). - $ability = wp_get_ability( 'datamachine/instagram-update' ); - if ( ! $ability ) { return $this->buildErrorResponse( 'datamachine/instagram-update ability not registered', $tool_name ); } $ability_instance = $ability; diff --git a/inc/Handlers/Bluesky/BlueskyAuth.php b/inc/Handlers/Bluesky/BlueskyAuth.php index f603cee76..ef1d7bb96 100644 --- a/inc/Handlers/Bluesky/BlueskyAuth.php +++ b/inc/Handlers/Bluesky/BlueskyAuth.php @@ -15,12 +15,15 @@ use DataMachine\Core\OAuth\BaseAuthProvider; use DataMachine\Core\HttpClient; +use DataMachineSocials\Handlers\Traits\HasRemoveAccount; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } class BlueskyAuth extends BaseAuthProvider { + use HasRemoveAccount; + public function __construct() { parent::__construct( 'bluesky' ); @@ -277,7 +280,4 @@ public function get_account_details(): ?array { ); } - public function remove_account(): bool { - return $this->clear_account(); - } } diff --git a/inc/Handlers/Bluesky/BlueskySettings.php b/inc/Handlers/Bluesky/BlueskySettings.php index ea273f751..ecbf6d199 100644 --- a/inc/Handlers/Bluesky/BlueskySettings.php +++ b/inc/Handlers/Bluesky/BlueskySettings.php @@ -41,4 +41,8 @@ public static function get_fields(): array { ) ); } + + public function __construct() { + parent::__construct( 'bluesky' ); + } } diff --git a/inc/Handlers/Facebook/FacebookAuth.php b/inc/Handlers/Facebook/FacebookAuth.php index 9dfe2c22d..99c277ebd 100644 --- a/inc/Handlers/Facebook/FacebookAuth.php +++ b/inc/Handlers/Facebook/FacebookAuth.php @@ -13,12 +13,15 @@ namespace DataMachineSocials\Handlers\Facebook; use DataMachine\Core\HttpClient; +use DataMachineSocials\Handlers\Traits\HasGetAccountDetails; if ( ! defined( 'ABSPATH' ) ) { exit; } class FacebookAuth extends \DataMachine\Core\OAuth\BaseOAuth2Provider { + use HasGetAccountDetails; + public const GRAPH_API_VERSION = 'v23.0'; public const AUTH_URL = 'https://www.facebook.com/' . self::GRAPH_API_VERSION . '/dialog/oauth'; @@ -542,19 +545,6 @@ public function has_comment_permission(): bool { return false; } - /** - * Get stored Facebook account details - * - * @return array|null Account details or null - */ - public function get_account_details(): ?array { - $account = $this->get_account(); - if ( empty( $account ) || ! is_array( $account ) ) { - return null; - } - return $account; - } - /** * Remove stored Facebook account details * diff --git a/inc/Handlers/Facebook/FacebookSettings.php b/inc/Handlers/Facebook/FacebookSettings.php index 7036fe3e1..789134d6b 100644 --- a/inc/Handlers/Facebook/FacebookSettings.php +++ b/inc/Handlers/Facebook/FacebookSettings.php @@ -43,4 +43,8 @@ public static function get_fields(): array { ) ); } + + public function __construct() { + parent::__construct( 'facebook' ); + } } diff --git a/inc/Handlers/Instagram/InstagramAuth.php b/inc/Handlers/Instagram/InstagramAuth.php index 5151f88ca..ef10bb7c5 100644 --- a/inc/Handlers/Instagram/InstagramAuth.php +++ b/inc/Handlers/Instagram/InstagramAuth.php @@ -13,12 +13,17 @@ namespace DataMachineSocials\Handlers\Instagram; use DataMachine\Core\HttpClient; +use DataMachineSocials\Handlers\Traits\HasGetAccountDetails; +use DataMachineSocials\Handlers\Traits\HasRemoveAccount; if ( ! defined( 'ABSPATH' ) ) { exit; } class InstagramAuth extends \DataMachine\Core\OAuth\BaseOAuth2Provider { + use HasGetAccountDetails; + use HasRemoveAccount; + const AUTH_URL = 'https://www.instagram.com/oauth/authorize'; const TOKEN_URL = 'https://api.instagram.com/oauth/access_token'; @@ -282,25 +287,4 @@ private function get_username_from_token( string $access_token, string $user_id return $data['username'] ?? ''; } - /** - * Get stored Instagram account details - * - * @return array|null Account details or null - */ - public function get_account_details(): ?array { - $account = $this->get_account(); - if ( empty( $account ) || ! is_array( $account ) ) { - return null; - } - return $account; - } - - /** - * Remove stored Instagram account details - * - * @return bool Success status - */ - public function remove_account(): bool { - return $this->clear_account(); - } } diff --git a/inc/Handlers/Instagram/InstagramSettings.php b/inc/Handlers/Instagram/InstagramSettings.php index 4167927b1..79946b41e 100644 --- a/inc/Handlers/Instagram/InstagramSettings.php +++ b/inc/Handlers/Instagram/InstagramSettings.php @@ -49,4 +49,71 @@ public static function get_fields(): array { return array_merge( $fields, parent::get_common_fields() ); } + + public function __construct() { + parent::__construct( 'instagram' ); + + // Self-register with filters + self::registerHandler( + 'instagram_publish', + 'publish', + self::class, + 'Instagram', + 'Post content to Instagram with support for single images and carousels (up to 10 images)', + true, + InstagramAuth::class, + InstagramSettings::class, + function ( $tools, $handler_slug, $handler_config ) { + $handler_config; + if ( 'instagram_publish' === $handler_slug ) { + $tools['instagram_publish'] = array( + 'class' => self::class, + 'method' => 'handle_tool_call', + 'handler' => 'instagram_publish', + 'description' => 'Post content to Instagram. Supports single images and carousels (up to 10 images). Images are processed async.', + 'parameters' => array( + 'type' => 'object', + 'properties' => array( + 'content' => array( + 'type' => 'string', + 'description' => 'The caption text to post to Instagram (max 2200 characters)', + ), + 'image_urls' => array( + 'type' => 'array', + 'description' => 'Array of image URLs (1-10 for carousel)', + 'items' => array( + 'type' => 'string', + 'format' => 'uri', + ), + ), + 'aspect_ratio' => array( + 'type' => 'string', + 'description' => 'Aspect ratio for images: 1:1, 4:5, 3:4, or 1.91:1', + 'enum' => array( '1:1', '4:5', '3:4', '1.91:1' ), + 'default' => '4:5', + ), + ), + 'required' => array( 'content' ), + ), + ); + } + return $tools; + }, + 'instagram', + array( + 'charLimit' => 2200, + 'maxImages' => 10, + 'aspectRatios' => array( '1:1', '4:5', '3:4', '1.91:1' ), + 'defaultAspectRatio' => '4:5', + 'supportsCarousel' => true, + 'supportsVideo' => true, + 'supportedMediaKinds' => array( 'image', 'carousel', 'reel', 'story' ), + 'capabilities' => array( + array( 'slug' => 'publish', 'label' => 'Publish' ), + array( 'slug' => 'comments', 'label' => 'Comments' ), + array( 'slug' => 'giveaway', 'label' => 'Giveaway' ), + ), + ) + ); + } } diff --git a/inc/Handlers/LinkedIn/LinkedInAuth.php b/inc/Handlers/LinkedIn/LinkedInAuth.php index 9eb6c9b42..4b31559e6 100644 --- a/inc/Handlers/LinkedIn/LinkedInAuth.php +++ b/inc/Handlers/LinkedIn/LinkedInAuth.php @@ -13,12 +13,17 @@ namespace DataMachineSocials\Handlers\LinkedIn; use DataMachine\Core\HttpClient; +use DataMachineSocials\Handlers\Traits\HasGetAccountDetails; +use DataMachineSocials\Handlers\Traits\HasRemoveAccount; if ( ! defined( 'ABSPATH' ) ) { exit; } class LinkedInAuth extends \DataMachine\Core\OAuth\BaseOAuth2Provider { + use HasGetAccountDetails; + use HasRemoveAccount; + public const AUTH_URL = 'https://www.linkedin.com/oauth/v2/authorization'; public const TOKEN_URL = 'https://www.linkedin.com/oauth/v2/accessToken'; @@ -296,25 +301,4 @@ public function api_request( string $method, string $url, array $options = array return HttpClient::request( $method, $url, $options ); } - /** - * Get stored LinkedIn account details. - * - * @return array|null Account details or null. - */ - public function get_account_details(): ?array { - $account = $this->get_account(); - if ( empty( $account ) || ! is_array( $account ) ) { - return null; - } - return $account; - } - - /** - * Remove stored LinkedIn account details. - * - * @return bool Success status. - */ - public function remove_account(): bool { - return $this->clear_account(); - } } diff --git a/inc/Handlers/LinkedIn/LinkedInSettings.php b/inc/Handlers/LinkedIn/LinkedInSettings.php index f36c7b055..18fb2a768 100644 --- a/inc/Handlers/LinkedIn/LinkedInSettings.php +++ b/inc/Handlers/LinkedIn/LinkedInSettings.php @@ -39,4 +39,53 @@ public static function get_fields(): array { ) ); } + + public function __construct() { + parent::__construct( 'linkedin' ); + + // Self-register with filters. + self::registerHandler( + 'linkedin_publish', + 'publish', + self::class, + 'LinkedIn', + 'Post content to LinkedIn with media and article support', + true, + LinkedInAuth::class, + LinkedInSettings::class, + function ( $tools, $handler_slug, $handler_config ) { + $handler_config; + if ( 'linkedin_publish' === $handler_slug ) { + $tools['linkedin_publish'] = array( + 'class' => self::class, + 'method' => 'handle_tool_call', + 'handler' => 'linkedin_publish', + 'description' => 'Post content to LinkedIn. Supports text (up to 3000 chars), images, and article sharing.', + 'parameters' => array( + 'type' => 'object', + 'properties' => array( + 'content' => array( + 'type' => 'string', + 'description' => 'The text content to post to LinkedIn', + ), + ), + 'required' => array( 'content' ), + ), + ); + } + return $tools; + }, + 'linkedin', + array( + 'charLimit' => 3000, + 'maxImages' => 9, + 'aspectRatios' => array( 'any' ), + 'defaultAspectRatio' => 'any', + 'supportsCarousel' => false, + 'capabilities' => array( + array( 'slug' => 'publish', 'label' => 'Publish' ), + ), + ) + ); + } } diff --git a/inc/Handlers/Pinterest/PinterestAuth.php b/inc/Handlers/Pinterest/PinterestAuth.php index 56c1120eb..43d0bbaa1 100644 --- a/inc/Handlers/Pinterest/PinterestAuth.php +++ b/inc/Handlers/Pinterest/PinterestAuth.php @@ -17,6 +17,7 @@ namespace DataMachineSocials\Handlers\Pinterest; use DataMachine\Core\HttpClient; +use DataMachineSocials\Handlers\Traits\HasRemoveAccount; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -28,6 +29,8 @@ * Manages Pinterest API v5 OAuth2 authentication with auto-refresh. */ class PinterestAuth extends \DataMachine\Core\OAuth\BaseOAuth2Provider { + use HasRemoveAccount; + const AUTH_URL = 'https://www.pinterest.com/oauth/'; const TOKEN_URL = 'https://api.pinterest.com/v5/oauth/token'; @@ -305,12 +308,4 @@ public function get_account_details(): ?array { return $account; } - /** - * Remove Pinterest account credentials. - * - * @return bool True on success. - */ - public function remove_account(): bool { - return $this->clear_account(); - } } diff --git a/inc/Handlers/Pinterest/PinterestSettings.php b/inc/Handlers/Pinterest/PinterestSettings.php index 2bfa4defb..309ce457a 100644 --- a/inc/Handlers/Pinterest/PinterestSettings.php +++ b/inc/Handlers/Pinterest/PinterestSettings.php @@ -58,4 +58,8 @@ public static function get_fields(): array { ) ); } + + public function __construct() { + parent::__construct( 'pinterest' ); + } } diff --git a/inc/Handlers/Reddit/RedditAuth.php b/inc/Handlers/Reddit/RedditAuth.php index 4df57ee16..caf1bd069 100644 --- a/inc/Handlers/Reddit/RedditAuth.php +++ b/inc/Handlers/Reddit/RedditAuth.php @@ -18,12 +18,15 @@ namespace DataMachineSocials\Handlers\Reddit; use DataMachine\Core\HttpClient; +use DataMachineSocials\Handlers\Traits\HasRemoveAccount; if ( ! defined( 'ABSPATH' ) ) { exit; } class RedditAuth extends \DataMachine\Core\OAuth\BaseOAuth2Provider { + use HasRemoveAccount; + public function __construct() { parent::__construct( 'reddit' ); @@ -322,12 +325,4 @@ public function get_account_details(): ?array { return $account; } - /** - * Remove stored Reddit account details - * - * @return bool Success status - */ - public function remove_account(): bool { - return $this->clear_account(); - } } diff --git a/inc/Handlers/Reddit/RedditSettings.php b/inc/Handlers/Reddit/RedditSettings.php index d847f4a15..67ca2ee17 100644 --- a/inc/Handlers/Reddit/RedditSettings.php +++ b/inc/Handlers/Reddit/RedditSettings.php @@ -91,4 +91,26 @@ public static function sanitize( array $raw_settings ): array { return $sanitized; } + + public function __construct() { + parent::__construct( 'reddit' ); + + // Self-register with filters + self::registerHandler( + 'reddit', + 'fetch', + self::class, + 'Reddit', + 'Fetch posts from Reddit subreddits', + true, + RedditAuth::class, + RedditSettings::class, + null, + null, + array( + 'charLimit' => 40000, + 'scopes' => 'identity read', + ) + ); + } } diff --git a/inc/Handlers/Threads/ThreadsAuth.php b/inc/Handlers/Threads/ThreadsAuth.php index 948e78bdf..08d7e03df 100644 --- a/inc/Handlers/Threads/ThreadsAuth.php +++ b/inc/Handlers/Threads/ThreadsAuth.php @@ -13,12 +13,15 @@ namespace DataMachineSocials\Handlers\Threads; use DataMachine\Core\HttpClient; +use DataMachineSocials\Handlers\Traits\HasGetAccountDetails; if ( ! defined( 'ABSPATH' ) ) { exit; } class ThreadsAuth extends \DataMachine\Core\OAuth\BaseOAuth2Provider { + use HasGetAccountDetails; + const AUTH_URL = 'https://graph.facebook.com/oauth/authorize'; const TOKEN_URL = 'https://graph.threads.net/oauth/access_token'; @@ -302,19 +305,6 @@ private function get_user_profile( string $access_token ): array|\WP_Error { return $data; } - /** - * Get stored Threads account details - * - * @return array|null Account details or null - */ - public function get_account_details(): ?array { - $account = $this->get_account(); - if ( empty( $account ) || ! is_array( $account ) ) { - return null; - } - return $account; - } - /** * Remove stored Threads account details * diff --git a/inc/Handlers/Traits/HasGetAccountDetails.php b/inc/Handlers/Traits/HasGetAccountDetails.php new file mode 100644 index 000000000..40e9245c6 --- /dev/null +++ b/inc/Handlers/Traits/HasGetAccountDetails.php @@ -0,0 +1,23 @@ +get_account(); + if ( empty( $account ) || ! is_array( $account ) ) { + return null; + } + return $account; + } +} diff --git a/inc/Handlers/Traits/HasRemoveAccount.php b/inc/Handlers/Traits/HasRemoveAccount.php new file mode 100644 index 000000000..cd4d20959 --- /dev/null +++ b/inc/Handlers/Traits/HasRemoveAccount.php @@ -0,0 +1,19 @@ +clear_account(); + } +} diff --git a/inc/Handlers/Twitter/TwitterAuth.php b/inc/Handlers/Twitter/TwitterAuth.php index 805e272c7..799e11e84 100644 --- a/inc/Handlers/Twitter/TwitterAuth.php +++ b/inc/Handlers/Twitter/TwitterAuth.php @@ -12,12 +12,15 @@ namespace DataMachineSocials\Handlers\Twitter; use Abraham\TwitterOAuth\TwitterOAuth; +use DataMachineSocials\Handlers\Traits\HasRemoveAccount; if ( ! defined( 'ABSPATH' ) ) { exit; } class TwitterAuth extends \DataMachine\Core\OAuth\BaseOAuth1Provider { + use HasRemoveAccount; + public function __construct() { parent::__construct( 'twitter' ); @@ -203,12 +206,4 @@ public function get_account_details(): ?array { return $account; } - /** - * Remove stored Twitter account details. - * - * @return bool Success status - */ - public function remove_account(): bool { - return $this->clear_account(); - } } diff --git a/inc/Handlers/Twitter/TwitterSettings.php b/inc/Handlers/Twitter/TwitterSettings.php index 0a52e2e64..9b9bf3c0d 100644 --- a/inc/Handlers/Twitter/TwitterSettings.php +++ b/inc/Handlers/Twitter/TwitterSettings.php @@ -40,4 +40,53 @@ public static function get_fields(): array { ) ); } + + public function __construct() { + parent::__construct( 'twitter' ); + + // Self-register with filters + self::registerHandler( + 'twitter_publish', + 'publish', + self::class, + 'Twitter', + 'Post content to Twitter with media support', + true, + TwitterAuth::class, + TwitterSettings::class, + function ( $tools, $handler_slug, $handler_config ) { + $handler_config; + if ( 'twitter_publish' === $handler_slug ) { + $tools['twitter_publish'] = array( + 'class' => self::class, + 'method' => 'handle_tool_call', + 'handler' => 'twitter_publish', + 'description' => 'Post content to Twitter. Supports text (280 chars), images, and URL handling.', + 'parameters' => array( + 'type' => 'object', + 'properties' => array( + 'content' => array( + 'type' => 'string', + 'description' => 'The text content to post to Twitter', + ), + ), + 'required' => array( 'content' ), + ), + ); + } + return $tools; + }, + 'twitter', + array( + 'charLimit' => 280, + 'maxImages' => 4, + 'aspectRatios' => array( 'any' ), + 'defaultAspectRatio' => 'any', + 'supportsCarousel' => false, + 'capabilities' => array( + array( 'slug' => 'publish', 'label' => 'Publish' ), + ), + ) + ); + } }