diff --git a/composer.lock b/composer.lock index 477fda731..2e5631b06 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "codeinwp/themeisle-sdk", - "version": "3.3.51", + "version": "3.3.52", "source": { "type": "git", "url": "https://github.com/Codeinwp/themeisle-sdk.git", - "reference": "bb2a8414b0418b18c68c9ff1df3d7fb10467928d" + "reference": "d1ae68cbd4f84934b4d982e9eeff317b9f4c814a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/bb2a8414b0418b18c68c9ff1df3d7fb10467928d", - "reference": "bb2a8414b0418b18c68c9ff1df3d7fb10467928d", + "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/d1ae68cbd4f84934b4d982e9eeff317b9f4c814a", + "reference": "d1ae68cbd4f84934b4d982e9eeff317b9f4c814a", "shasum": "" }, "require-dev": { @@ -43,9 +43,9 @@ ], "support": { "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", - "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.51" + "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.52" }, - "time": "2026-03-30T07:58:49+00:00" + "time": "2026-05-14T19:43:56+00:00" }, { "name": "codeinwp/twitteroauth", diff --git a/includes/admin/helpers/class-rop-bluesky-api.php b/includes/admin/helpers/class-rop-bluesky-api.php index 34a1a3042..1806e698d 100644 --- a/includes/admin/helpers/class-rop-bluesky-api.php +++ b/includes/admin/helpers/class-rop-bluesky-api.php @@ -304,41 +304,29 @@ public function create_post( $did, $post, $post_type, $hashtags, $access_token = } if ( $post_type === 'link' && isset( $post['post_url'] ) && ! empty( $post['post_url'] ) ) { - $record['embed'] = array( - '$type' => 'app.bsky.embed.external', - 'external' => array( - 'uri' => $post['post_url'], - 'title' => isset( $post['title'] ) ? $post['title'] : '', - 'description' => isset( $post['content'] ) ? $post['content'] : '', - ), - ); - - if ( - isset( $post['post_image'], $post['mimetype'] ) && - ! empty( $post['post_image'] ) && - ! empty( $post['mimetype'] ) - ) { - $image_blob = $this->upload_blob( $access_token, $post['post_image'], $post['mimetype']['type'] ); - - if ( false !== $image_blob ) { - $record['embed']['external']['thumb'] = $image_blob; - } - } + $record['embed'] = $this->get_external_post_url( $post ); } - if ( $post_type === 'image' && isset( $post['post_image'], $post['mimetype'] ) && ! empty( $post['post_image'] ) && ! empty( $post['mimetype'] ) ) { - $image_blob = $this->upload_blob( $access_token, $post['post_image'], $post['mimetype']['type'] ); - - if ( false !== $image_blob ) { - $record['embed'] = array( - '$type' => 'app.bsky.embed.images', - 'images' => array( - array( - 'alt' => isset( $post['title'] ) ? $post['title'] : '', - 'image' => $image_blob, + if ( $post_type === 'image' ) { + $external_embed = $this->get_external_post_url( $post ); + if ( isset( $post['post_image'], $post['mimetype'] ) && ! empty( $post['post_image'] ) && ! empty( $post['mimetype'] ) ) { + $image_blob = $this->upload_blob( $access_token, $post['post_image'], $post['mimetype']['type'] ); + if ( ! empty( $external_embed ) ) { + $external_embed['external']['thumb'] = $image_blob; + $record['embed'] = $external_embed; + } else { + $record['embed'] = array( + '$type' => 'app.bsky.embed.images', + 'images' => array( + array( + 'alt' => isset( $post['title'] ) ? $post['title'] : '', + 'image' => $image_blob, + ), ), - ), - ); + ); + } + } elseif ( ! empty( $external_embed ) ) { + $record['embed'] = $external_embed; } } @@ -499,4 +487,25 @@ public function get_image_blob_from_url( $image_url ) { return $body; } + + /** + * Construct the embed object for an external post URL. + * + * @param array $post The post data. + * @return array The embed object for the external post URL. + */ + private function get_external_post_url( $post ) { + if ( empty( $post ) || ! isset( $post['post_url'] ) || empty( $post['post_url'] ) ) { + return array(); + } + + return array( + '$type' => 'app.bsky.embed.external', + 'external' => array( + 'uri' => $post['post_url'], + 'title' => isset( $post['title'] ) ? $post['title'] : '', + 'description' => isset( $post['content'] ) ? $post['content'] : '', + ), + ); + } } diff --git a/includes/admin/services/class-rop-linkedin-service.php b/includes/admin/services/class-rop-linkedin-service.php index bca351ba5..15b4feacf 100644 --- a/includes/admin/services/class-rop-linkedin-service.php +++ b/includes/admin/services/class-rop-linkedin-service.php @@ -23,9 +23,9 @@ class Rop_Linkedin_Service extends Rop_Services_Abstract { /** * The version of the Linkedin API. * - * @see https://learn.microsoft.com/en-us/linkedin/marketing/versioning?view=li-lms-2024-05 + * @see https://learn.microsoft.com/en-us/linkedin/marketing/versioning?view=li-lms-2026-04 */ - public const LINKEDIN_VERSION = 202505; + public const LINKEDIN_VERSION = 202604; /** * An instance of authenticated LinkedIn user.