Skip to content

Commit 00a9abc

Browse files
chore(ci): homeboy autofix — refactor (63 files, 60 fixes)
duplicatefunction: 56 BlueskyAuth.php, BlueskyDeleteAbility.php, BlueskyReadAbility.php, BlueskyUpdateAbility.php, ChartTemplate.php, DiagramTemplate.php, FacebookAuth.php, FacebookDeleteAbility.php, FacebookReadAbility.php, FacebookUpdateAbility.php, FetchRedditAbility.php, InstagramAuth.php, InstagramCommentReplyAbility.php, InstagramCommentReplyAbilityTest.php, InstagramDeleteAbility.php, InstagramPublishStoryTest.php, InstagramReadAbility.php, InstagramReadAbilityTest.php, InstagramUpdateAbility.php, LinkedInAuth.php, LinkedInDeleteAbility.php, LinkedInReadAbility.php, LinkedInUpdateAbility.php, PinterestAnalyticsAbility.php, PinterestAuth.php, PinterestDeleteAbility.php, PinterestReadAbility.php, PinterestUpdateAbility.php, RedditAuth.php, ReplyRedditAbility.php, SubmitRedditAbility.php, ThreadsAuth.php, ThreadsDeleteAbility.php, ThreadsReadAbility.php, ThreadsUpdateAbility.php, TwitterAuth.php, TwitterDeleteAbility.php, TwitterReadAbility.php, TwitterUpdateAbility.php, VoteRedditAbility.php phpcbf: 1 (multiple) short-ternary: 1 (multiple) wp-filesystem: 1 (single) yoda-condition: 1 (single)
1 parent 49587d1 commit 00a9abc

63 files changed

Lines changed: 2761 additions & 2008 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

homeboy.json

Lines changed: 646 additions & 0 deletions
Large diffs are not rendered by default.

inc/Abilities/Bluesky/BlueskyDeleteAbility.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use DataMachine\Abilities\PermissionHelper;
1515
use DataMachineSocials\Handlers\Bluesky\BlueskyAuth;
16+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
1617

1718
defined( 'ABSPATH' ) || exit;
1819

inc/Abilities/Bluesky/BlueskyReadAbility.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use DataMachine\Abilities\PermissionHelper;
1616
use DataMachine\Core\HttpClient;
1717
use DataMachineSocials\Handlers\Bluesky\BlueskyAuth;
18+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
1819

1920
defined( 'ABSPATH' ) || exit;
2021

inc/Abilities/Bluesky/BlueskyUpdateAbility.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
use DataMachine\Abilities\PermissionHelper;
1616
use DataMachineSocials\Handlers\Bluesky\BlueskyAuth;
17+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
18+
use DataMachineSocials\Abilities\Bluesky\BlueskyDeleteAbility;
1719

1820
defined( 'ABSPATH' ) || exit;
1921

inc/Abilities/Facebook/FacebookDeleteAbility.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use DataMachine\Abilities\PermissionHelper;
1515
use DataMachineSocials\Handlers\Facebook\FacebookAuth;
16+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
1617

1718
defined( 'ABSPATH' ) || exit;
1819

inc/Abilities/Facebook/FacebookReadAbility.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use DataMachine\Abilities\PermissionHelper;
1616
use DataMachine\Core\HttpClient;
1717
use DataMachineSocials\Handlers\Facebook\FacebookAuth;
18+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
1819

1920
defined( 'ABSPATH' ) || exit;
2021

inc/Abilities/Facebook/FacebookUpdateAbility.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
use DataMachine\Abilities\PermissionHelper;
1616
use DataMachineSocials\Handlers\Facebook\FacebookAuth;
17+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
18+
use DataMachineSocials\Abilities\Facebook\FacebookDeleteAbility;
1719

1820
defined( 'ABSPATH' ) || exit;
1921

inc/Abilities/Instagram/InstagramCommentReplyAbility.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
use DataMachine\Abilities\PermissionHelper;
1515
use DataMachineSocials\Handlers\Instagram\InstagramAuth;
16+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
17+
use DataMachineSocials\Abilities\Instagram\InstagramDeleteAbility;
1618

1719
defined( 'ABSPATH' ) || exit;
1820

inc/Abilities/Instagram/InstagramDeleteAbility.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use DataMachine\Abilities\PermissionHelper;
1515
use DataMachineSocials\Handlers\Instagram\InstagramAuth;
16+
use DataMachineSocials\Abilities\Traits\HasCheckPermission;
1617

1718
defined( 'ABSPATH' ) || exit;
1819

inc/Abilities/Instagram/InstagramPublishAbility.php

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -82,79 +82,79 @@ private function registerAbilities(): void {
8282
'datamachine/instagram-publish',
8383
array(
8484
'label' => __( 'Publish to Instagram', 'data-machine-socials' ),
85-
'description' => __( 'Post content to Instagram — supports single image, carousel (up to 10 images), Reel (video), and Story (image or video)', 'data-machine-socials' ),
86-
'category' => 'datamachine',
87-
'input_schema' => array(
88-
'type' => 'object',
89-
'required' => array( 'content' ),
90-
'properties' => array(
91-
'content' => array(
92-
'type' => 'string',
93-
'description' => 'Post caption text (max 2200 characters)',
94-
'maxLength' => 2200,
95-
),
96-
'media_kind' => array(
97-
'type' => 'string',
98-
'description' => 'Type of media to publish: image (default), carousel, reel, or story',
99-
'enum' => array( 'image', 'carousel', 'reel', 'story' ),
100-
'default' => 'image',
85+
'description' => __( 'Post content to Instagram — supports single image, carousel (up to 10 images), Reel (video), and Story (image or video)', 'data-machine-socials' ),
86+
'category' => 'datamachine',
87+
'input_schema' => array(
88+
'type' => 'object',
89+
'required' => array( 'content' ),
90+
'properties' => array(
91+
'content' => array(
92+
'type' => 'string',
93+
'description' => 'Post caption text (max 2200 characters)',
94+
'maxLength' => 2200,
95+
),
96+
'media_kind' => array(
97+
'type' => 'string',
98+
'description' => 'Type of media to publish: image (default), carousel, reel, or story',
99+
'enum' => array( 'image', 'carousel', 'reel', 'story' ),
100+
'default' => 'image',
101+
),
102+
'image_urls' => array(
103+
'type' => 'array',
104+
'description' => 'Array of image URLs to post (1-10 for carousel, 1 for single image)',
105+
'items' => array(
106+
'type' => 'string',
107+
'format' => 'uri',
108+
),
109+
'maxItems' => 10,
110+
),
111+
'video_url' => array(
112+
'type' => 'string',
113+
'description' => 'Public video URL for Reel or Story publishing',
114+
'format' => 'uri',
115+
),
116+
'cover_url' => array(
117+
'type' => 'string',
118+
'description' => 'Optional cover image URL for Reel',
119+
'format' => 'uri',
120+
),
121+
'share_to_feed' => array(
122+
'type' => 'boolean',
123+
'description' => 'Whether to share the Reel to the main feed (default true)',
124+
'default' => true,
125+
),
126+
'story_image_url' => array(
127+
'type' => 'string',
128+
'description' => 'Image URL for Story publishing (use this or video_url for stories)',
129+
'format' => 'uri',
130+
),
131+
'aspect_ratio' => array(
132+
'type' => 'string',
133+
'description' => 'Aspect ratio for images: 1:1, 4:5, 3:4, or 1.91:1',
134+
'enum' => array( '1:1', '4:5', '3:4', '1.91:1' ),
135+
'default' => '4:5',
136+
),
137+
'source_url' => array(
138+
'type' => 'string',
139+
'description' => 'Source URL to include in caption',
140+
'format' => 'uri',
141+
),
101142
),
102-
'image_urls' => array(
103-
'type' => 'array',
104-
'description' => 'Array of image URLs to post (1-10 for carousel, 1 for single image)',
105-
'items' => array(
143+
),
144+
'output_schema' => array(
145+
'type' => 'object',
146+
'properties' => array(
147+
'success' => array( 'type' => 'boolean' ),
148+
'media_id' => array( 'type' => 'string' ),
149+
'media_kind' => array( 'type' => 'string' ),
150+
'permalink' => array(
106151
'type' => 'string',
107152
'format' => 'uri',
108153
),
109-
'maxItems' => 10,
110-
),
111-
'video_url' => array(
112-
'type' => 'string',
113-
'description' => 'Public video URL for Reel or Story publishing',
114-
'format' => 'uri',
115-
),
116-
'cover_url' => array(
117-
'type' => 'string',
118-
'description' => 'Optional cover image URL for Reel',
119-
'format' => 'uri',
120-
),
121-
'share_to_feed' => array(
122-
'type' => 'boolean',
123-
'description' => 'Whether to share the Reel to the main feed (default true)',
124-
'default' => true,
125-
),
126-
'story_image_url' => array(
127-
'type' => 'string',
128-
'description' => 'Image URL for Story publishing (use this or video_url for stories)',
129-
'format' => 'uri',
130-
),
131-
'aspect_ratio' => array(
132-
'type' => 'string',
133-
'description' => 'Aspect ratio for images: 1:1, 4:5, 3:4, or 1.91:1',
134-
'enum' => array( '1:1', '4:5', '3:4', '1.91:1' ),
135-
'default' => '4:5',
136-
),
137-
'source_url' => array(
138-
'type' => 'string',
139-
'description' => 'Source URL to include in caption',
140-
'format' => 'uri',
154+
'error' => array( 'type' => 'string' ),
141155
),
142156
),
143-
),
144-
'output_schema' => array(
145-
'type' => 'object',
146-
'properties' => array(
147-
'success' => array( 'type' => 'boolean' ),
148-
'media_id' => array( 'type' => 'string' ),
149-
'media_kind' => array( 'type' => 'string' ),
150-
'permalink' => array(
151-
'type' => 'string',
152-
'format' => 'uri',
153-
),
154-
'error' => array( 'type' => 'string' ),
155-
),
156-
),
157-
'execute_callback' => array( self::class, 'execute_publish' ),
157+
'execute_callback' => array( self::class, 'execute_publish' ),
158158
'permission_callback' => fn() => PermissionHelper::can_manage(),
159159
'meta' => array( 'show_in_rest' => true ),
160160
)

0 commit comments

Comments
 (0)