Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
da4eff5
Use temporary environment variable for Magic Embed
galbus Jul 11, 2025
3cd534f
Replace BEYONDWORDS_MAGIC_EMBED constant with plugin setting
galbus Jul 18, 2025
f7e88a0
POST not PUT for /regenerate endpoint
galbus Jul 18, 2025
c84fc78
Integration method option fixes and Site Health
galbus Jul 18, 2025
1961bee
Settings fix, more checks for setting/custom field
galbus Jul 28, 2025
67f73fd
Temporary workflow pull_request update
galbus Jul 28, 2025
1027d7c
Use a single Player class with target:this param
galbus Aug 1, 2025
791ce39
Update tests for target:this player
galbus Aug 1, 2025
4a6babb
Replace the legacy custom player div with the shortcode
galbus Aug 1, 2025
5b61afc
Remove loadPluginTextdomain
galbus Aug 1, 2025
77be2c7
ignore/disable WordPress.WP.EnqueuedResources.NonEnqueuedScript sniff
galbus Aug 1, 2025
02284f3
Use sourceId in REST API call and player config object
galbus Aug 8, 2025
30f0a8f
Magic Embed WIP
galbus Aug 8, 2025
838cb2a
Update hasContent method
galbus Aug 8, 2025
b632d63
Fix BeyondWords column by updating has/has not audio checks
galbus Aug 14, 2025
2b135fa
Use by_source_id endpoint with headers to import content
galbus Aug 14, 2025
74fe796
sourceId for block editor player
galbus Aug 15, 2025
c3c7ac3
Remove console.log
galbus Aug 15, 2025
e970f4e
Update Player PHPUnit tests
galbus Aug 15, 2025
404e485
Merge branch 's-7155-plugin-v600' into s-7095-scope-out-integrating-t…
galbus Aug 15, 2025
7813ef9
Replace Cypress getEnqueuedPlayerScriptTag with getPlayerScriptTag
galbus Aug 15, 2025
56a4025
Update getPlayerScriptTag selector
galbus Aug 15, 2025
a6fd881
Update e2e tests to work with inline/client-side player
galbus Aug 15, 2025
80fcfe5
Add fallbacks to sourceId only when relevant
galbus Aug 15, 2025
ab20c0b
Pass params to Cypress hasPlayerInstances command (wip)
galbus Aug 15, 2025
f328518
Cypress fixes for site health
galbus Aug 15, 2025
782c018
Update player UI cypress tests
galbus Aug 15, 2025
37d966c
Variable rename
galbus Aug 17, 2025
b41bdaa
Set target in JSON first
galbus Aug 17, 2025
5f8eb88
Update e2e tests for sourceId
galbus Aug 17, 2025
749295f
Player Content tests updated
galbus Aug 17, 2025
ead6816
Update player assertions
galbus Sep 5, 2025
ad222e6
Output player script for Headless
galbus Sep 5, 2025
a4beedc
Use PlayerUI::OPTION_NAME
galbus Sep 5, 2025
0795fdd
Check for script tag in hasCustomPlayer
galbus Sep 5, 2025
1f8d733
Set waits for slower CI running times
galbus Sep 5, 2025
2f3770d
contenteditable may be first
galbus Sep 5, 2025
cc15970
Update Cypress
galbus Sep 5, 2025
977dcd8
Update Pending test
galbus Sep 5, 2025
3f2250a
Update AMP check
galbus Sep 5, 2025
677708d
Request class refactoring
galbus Sep 5, 2025
9494762
Fix Request TypeError
galbus Sep 9, 2025
1e886d0
Remove regenerateContent
galbus Sep 9, 2025
797568e
Update Request headers
galbus Sep 9, 2025
b1412c6
Update Mock API to remove Content-Type for GET
galbus Sep 9, 2025
4c19c3c
Remove debugging
galbus Sep 9, 2025
09c8317
Rename Integration Method label and values
galbus Sep 11, 2025
0ff96b7
Remove custom branch from workflow
galbus Sep 12, 2025
fef84d2
Tidy WPGraphQL class
galbus Sep 12, 2025
a17d985
Minor tidying up bits
galbus Sep 12, 2025
c409880
Update release notes
galbus Sep 12, 2025
5048237
Update Renderer tests
galbus Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions .mockoon/beyondwords-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,6 @@
"filePath": "",
"sendFileAsBody": false,
"rules": [
{
"target": "header",
"modifier": "Content-Type",
"value": "application/json",
"operator": "equals",
"invert": false
},
{
"target": "header",
"modifier": "X-Api-Key",
Expand Down Expand Up @@ -276,7 +269,7 @@
},
{
"uuid": "ecdb7657-8a38-4380-937e-54204529d2e5",
"body": "{\n \"id\": \"9279c9e0-e0b5-4789-9040-f44478ed3e9e\",\n \"title\": \"{{body 'title' 'Title'}}\",\n \"type\": \"auto_segment\",\n \"source_id\": \"{{body 'source_id' '90e4cbff-6382-4a88-adc5-1eb3ffa16c6d'}}\",\n \"source_url\": \"{{body 'source_url' 'https://example.com'}}\",\n \"author\": \"{{body 'author' 'Jane Smith'}}\",\n \"image_url\": \"{{body 'image' 'https://example.com/image.jpg'}}\",\n \"audio\": [\n {\n \"id\": 12192819,\n \"content_type\": \"application/x-mpegURL\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/e8219ee2f3465d6834984f9ae607a81e.m3u8\",\n \"duration\": 2685,\n \"base64_file\": null,\n \"variant\": \"article\"\n },\n {\n \"id\": 12192811,\n \"content_type\": \"audio/mpeg\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/fd7108e13a7c7fee6820a1b07bb676e0_compiled.mp3\",\n \"duration\": 2712,\n \"base64_file\": null,\n \"variant\": \"article\"\n }\n ],\n \"video\": [],\n \"ads_enabled\": true,\n \"is_copy\": false,\n \"title_voice_id\": 2517,\n \"summary_voice_id\": 2517,\n \"body_voice_id\": 2517,\n \"title_enabled\": true,\n \"body_enabled\": true,\n \"summary_enabled\": true,\n \"summary_title_enabled\": false,\n \"summarization\": {\n \"audio\": [],\n \"video\": []\n },\n \"background_track\": null,\n \"language\": \"{{body 'language' 'en_US'}}\",\n \"preview_token\": \"d9ce36ea-ddc4-4611-b60c-4f90ed0fc082\",\n \"status\": \"processed\",\n \"metadata\": {\n \"categories\": [\n \"News\", \n \"Audio\"\n ]\n },\n \"created\": \"2022-01-02T23:59:59Z\",\n \"updated\": \"2022-03-04T00:00:00Z\",\n \"published\": true,\n \"publish_date\": \"2099-12-31T23:59:59Z\",\n \"auto_segment_updates_enabled\": false,\n \"ai_summary_updates_enabled\": true,\n \"summary\": \"{{body 'summary' 'Summary'}}\",\n \"body\": \"<p>Test.</p>\",\n \"summarization_settings\": null,\n \"video_settings\": null\n}",
"body": "{\n \"id\": \"9279c9e0-e0b5-4789-9040-f44478ed3e9e\",\n \"title\": \"{{body 'title' 'Title'}}\",\n \"type\": \"auto_segment\",\n \"source_id\": \"{{body 'source_id' '90e4cbff-6382-4a88-adc5-1eb3ffa16c6d'}}\",\n \"source_url\": \"{{body 'source_url' 'https://example.com'}}\",\n \"author\": \"{{body 'author' 'Jane Smith'}}\",\n \"image_url\": \"{{body 'image' 'https://example.com/image.jpg'}}\",\n \"audio\": [\n {\n \"id\": 12192819,\n \"content_type\": \"application/x-mpegURL\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/e8219ee2f3465d6834984f9ae607a81e.m3u8\",\n \"duration\": 2685,\n \"base64_file\": null,\n \"variant\": \"article\"\n },\n {\n \"id\": 12192811,\n \"content_type\": \"audio/mpeg\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/fd7108e13a7c7fee6820a1b07bb676e0_compiled.mp3\",\n \"duration\": 2712,\n \"base64_file\": null,\n \"variant\": \"article\"\n }\n ],\n \"video\": [],\n \"ads_enabled\": true,\n \"is_copy\": false,\n \"title_voice_id\": 2517,\n \"summary_voice_id\": 2517,\n \"body_voice_id\": 2517,\n \"title_enabled\": true,\n \"body_enabled\": true,\n \"summary_enabled\": true,\n \"summary_title_enabled\": false,\n \"summarization\": {\n \"audio\": [],\n \"video\": []\n },\n \"background_track\": null,\n \"language\": \"{{body 'language' 'en_US'}}\",\n \"preview_token\": \"d9ce36ea-ddc4-4611-b60c-4f90ed0fc082\",\n \"status\": \"processed\",\n \"metadata\": {\n \"categories\": [\n \"News\", \n \"Audio\"\n ]\n },\n \"created\": \"2022-01-02T23:59:59Z\",\n \"updated\": \"2022-03-04T00:00:00Z\",\n \"published\": true,\n \"publish_date\": \"2099-12-31T23:59:59Z\",\n \"auto_segment_updates_enabled\": true,\n \"ai_summary_updates_enabled\": true,\n \"summary\": \"{{body 'summary' 'Summary'}}\",\n \"body\": \"<p>Test.</p>\",\n \"summarization_settings\": null,\n \"video_settings\": null\n}",
"latency": 0,
"statusCode": 200,
"label": "OK",
Expand Down Expand Up @@ -414,7 +407,7 @@
},
{
"uuid": "52762211-f2da-4e53-a68f-74883e69e862",
"body": "{\n \"id\": \"9279c9e0-e0b5-4789-9040-f44478ed3e9e\",\n \"title\": \"{{body 'title' 'Title'}}\",\n \"type\": \"auto_segment\",\n \"source_id\": \"{{body 'source_id' '90e4cbff-6382-4a88-adc5-1eb3ffa16c6d'}}\",\n \"source_url\": \"{{body 'source_url' 'https://example.com'}}\",\n \"author\": \"{{body 'author' 'Jane Smith'}}\",\n \"image_url\": \"{{body 'image' 'https://example.com/image.jpg'}}\",\n \"audio\": [\n {\n \"id\": 12192819,\n \"content_type\": \"application/x-mpegURL\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/e8219ee2f3465d6834984f9ae607a81e.m3u8\",\n \"duration\": 2685,\n \"base64_file\": null,\n \"variant\": \"article\"\n },\n {\n \"id\": 12192811,\n \"content_type\": \"audio/mpeg\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/fd7108e13a7c7fee6820a1b07bb676e0_compiled.mp3\",\n \"duration\": 2712,\n \"base64_file\": null,\n \"variant\": \"article\"\n }\n ],\n \"video\": [],\n \"ads_enabled\": true,\n \"is_copy\": false,\n \"title_voice_id\": 2517,\n \"summary_voice_id\": 2517,\n \"body_voice_id\": 2517,\n \"title_enabled\": true,\n \"body_enabled\": true,\n \"summary_enabled\": true,\n \"summary_title_enabled\": false,\n \"summarization\": {\n \"audio\": [],\n \"video\": []\n },\n \"background_track\": null,\n \"language\": \"{{body 'language' 'en_US'}}\",\n \"preview_token\": \"d9ce36ea-ddc4-4611-b60c-4f90ed0fc082\",\n \"status\": \"processed\",\n \"metadata\": {\n \"categories\": [\n \"News\", \n \"Audio\"\n ]\n },\n \"created\": \"2022-01-02T23:59:59Z\",\n \"updated\": \"2022-03-04T00:00:00Z\",\n \"published\": true,\n \"publish_date\": \"2099-12-31T23:59:59Z\",\n \"auto_segment_updates_enabled\": false,\n \"ai_summary_updates_enabled\": true,\n \"summary\": \"{{body 'summary' 'Summary'}}\",\n \"body\": \"<p>Test.</p>\",\n \"summarization_settings\": null,\n \"video_settings\": null\n}",
"body": "{\n \"id\": \"9279c9e0-e0b5-4789-9040-f44478ed3e9e\",\n \"title\": \"{{body 'title' 'Title'}}\",\n \"type\": \"auto_segment\",\n \"source_id\": \"{{body 'source_id' '90e4cbff-6382-4a88-adc5-1eb3ffa16c6d'}}\",\n \"source_url\": \"{{body 'source_url' 'https://example.com'}}\",\n \"author\": \"{{body 'author' 'Jane Smith'}}\",\n \"image_url\": \"{{body 'image' 'https://example.com/image.jpg'}}\",\n \"audio\": [\n {\n \"id\": 12192819,\n \"content_type\": \"application/x-mpegURL\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/e8219ee2f3465d6834984f9ae607a81e.m3u8\",\n \"duration\": 2685,\n \"base64_file\": null,\n \"variant\": \"article\"\n },\n {\n \"id\": 12192811,\n \"content_type\": \"audio/mpeg\",\n \"url\": \"https://beyondwords-cdn-b7fyckdeejejb6dj.a03.azurefd.net/audio/projects/9969/podcasts/3161419/media/fd7108e13a7c7fee6820a1b07bb676e0_compiled.mp3\",\n \"duration\": 2712,\n \"base64_file\": null,\n \"variant\": \"article\"\n }\n ],\n \"video\": [],\n \"ads_enabled\": true,\n \"is_copy\": false,\n \"title_voice_id\": 2517,\n \"summary_voice_id\": 2517,\n \"body_voice_id\": 2517,\n \"title_enabled\": true,\n \"body_enabled\": true,\n \"summary_enabled\": true,\n \"summary_title_enabled\": false,\n \"summarization\": {\n \"audio\": [],\n \"video\": []\n },\n \"background_track\": null,\n \"language\": \"{{body 'language' 'en_US'}}\",\n \"preview_token\": \"d9ce36ea-ddc4-4611-b60c-4f90ed0fc082\",\n \"status\": \"processed\",\n \"metadata\": {\n \"categories\": [\n \"News\", \n \"Audio\"\n ]\n },\n \"created\": \"2022-01-02T23:59:59Z\",\n \"updated\": \"2022-03-04T00:00:00Z\",\n \"published\": true,\n \"publish_date\": \"2099-12-31T23:59:59Z\",\n \"auto_segment_updates_enabled\": true,\n \"ai_summary_updates_enabled\": true,\n \"summary\": \"{{body 'summary' 'Summary'}}\",\n \"body\": \"<p>Test.</p>\",\n \"summarization_settings\": null,\n \"video_settings\": null\n}",
"latency": 0,
"statusCode": 200,
"label": "OK",
Expand Down Expand Up @@ -720,13 +713,6 @@
"filePath": "",
"sendFileAsBody": false,
"rules": [
{
"target": "header",
"modifier": "Content-Type",
"value": "application/json",
"operator": "equals",
"invert": false
},
{
"target": "header",
"modifier": "X-Api-Key",
Expand Down Expand Up @@ -962,13 +948,6 @@
"filePath": "",
"sendFileAsBody": false,
"rules": [
{
"target": "header",
"modifier": "Content-Type",
"value": "application/json",
"operator": "equals",
"invert": false
},
{
"target": "header",
"modifier": "X-Api-Key",
Expand Down
10 changes: 0 additions & 10 deletions doc/wp-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,3 @@ Defaults to `true`.
```php
define('BEYONDWORDS_AUTOREGENERATE', false);
```

## BEYONDWORDS_PLAYER_INLINE_SCRIPT_TAG

Use the recommended BeyondWords inline player script.
Defaults to `false`.
From plugin version `6.0` this will default to `true`.

```php
define('BEYONDWORDS_PLAYER_INLINE_SCRIPT_TAG', true);
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@wordpress/eslint-plugin": "^22.5.1",
"@wordpress/scripts": "^30.12.1",
"badge-maker": "^4.1.0",
"cypress": "14.3.3",
"cypress": "15.1.0",
"cypress-fail-fast": "^7.1.1",
"cypress-map": "^1.45.0",
"cypress-multi-reporters": "^2.0.5",
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ Release date: TBC

**Enhancements and Features:**

* Make PHP methods static.
* [#449](https://github.com/beyondwords-io/wordpress-plugin/pull/449) Magic Embed for WordPress.
* An **Integration method** plugin setting has been added in the *Content* tab.
* The default is **REST API**. This method will continue to send post content and metadata to BeyondWords using REST API calls.
* If **Magic Embed** is selected then [Client-Side Integration](https://github.com/beyondwords-io/player/blob/main/doc/client-side-integration.md) will be enabed for new posts. With this method BeyondWords handles the extraction and delivery of audio content using the rendered HTML for the post.
* [#447](https://github.com/beyondwords-io/wordpress-plugin/pull/447) Make PHP methods static.

= 5.5.0 =

Expand Down
26 changes: 16 additions & 10 deletions src/Compatibility/WPGraphQL/WPGraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ public static function init()
* @since 3.6.0
* @since 4.0.0 Register contentId field, and contentId/podcastId are now String, not Int
* @since 4.7.0 Moved graphqlRegisterTypes() from Beyondwords\Wordpress\Core to here.
* @since 6.0.0 Make static.
* @since 6.0.0 Make static, add sourceId field.
*/
public static function graphqlRegisterTypes()
{
register_graphql_object_type('Beyondwords', [
'description' => __('BeyondWords audio details. Use this data to embed an audio player using the BeyondWords JavaScript SDK.', 'speechkit'), // phpcs:ignore Generic.Files.LineLength.TooLong
'fields' => [
'sourceId' => [
'description' => __('BeyondWords source ID', 'speechkit'),
'type' => 'String'
],
'projectId' => [
'description' => __('BeyondWords project ID', 'speechkit'),
'type' => 'Int'
Expand Down Expand Up @@ -70,22 +74,24 @@ public static function graphqlRegisterTypes()
'type' => 'Beyondwords',
'description' => __('BeyondWords audio details', 'speechkit'),
'resolve' => function (WPGraphQLPlugin\Model\Post $post) {
$beyondwords = [];
$fields = [
'sourceId' => (string) $post->ID,
];

$contentId = PostMetaUtils::getContentId($post->ID);
$projectId = PostMetaUtils::getProjectId($post->ID);

if (! empty($contentId)) {
$beyondwords['contentId'] = $contentId;
$beyondwords['podcastId'] = $contentId; // legacy
if (! empty($projectId)) {
$fields['projectId'] = $projectId;
}

$projectId = PostMetaUtils::getProjectId($post->ID);
$contentId = PostMetaUtils::getContentId($post->ID);

if (! empty($projectId)) {
$beyondwords['projectId'] = $projectId;
if (! empty($contentId)) {
$fields['contentId'] = $contentId;
$fields['podcastId'] = $contentId; // legacy
}

return ! empty($beyondwords) ? $beyondwords : null;
return $fields;
}
]);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Component/Post/BlockAttributes/BlockAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function registerMarkerAttribute($args)
*
* @since 4.0.0
* @since 4.2.2 Rename method to renderBlock.
* @since 6.0.0 Make static.
* @since 6.0.0 Make static and update for Magic Embed.
*
* @param string $blockContent The block content (HTML).
* @param string $block The full block, including name and attributes.
Expand All @@ -100,12 +100,12 @@ public static function registerMarkerAttribute($args)
public static function renderBlock($blockContent, $block)
{
// Skip adding marker if player UI is disabled
if (get_option('beyondwords_player_ui', PlayerUI::ENABLED) === PlayerUI::DISABLED) {
if (get_option(PlayerUI::OPTION_NAME) === PlayerUI::DISABLED) {
return $blockContent;
}

// Skip adding marker if no content ID exists
if (! PostMetaUtils::getContentId(get_the_ID())) {
// Skip adding marker if no content exists
if (! PostMetaUtils::hasContent(get_the_ID())) {
return $blockContent;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Component/Post/DisplayPlayer/DisplayPlayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static function save($postId)
*
* @since 6.0.0 Make static.
*
* @param WP_Post $post The post object.
* @param \WP_Post $post The post object.
*/
public static function element($post)
{
Expand Down
13 changes: 3 additions & 10 deletions src/Component/Post/GenerateAudio/GenerateAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public static function init()
/**
* Check whether the post type should preselect the "Generate audio" checkbox.
*
* @param \WP_Post|int $post The post object or ID.
*
* @todo move this function to somewhere reusable for the Block editor.
*
* @since 6.0.0 Make static.
Expand Down Expand Up @@ -73,22 +75,13 @@ public static function shouldPreselectGenerateAudio($post)
/**
* Render the element.
*
* @since 6.0.0 Make static.
* @since 6.0.0 Make static and refactor generate audio check.
*/
public static function element($post)
{
wp_nonce_field('beyondwords_generate_audio', 'beyondwords_generate_audio_nonce');

$generateAudio = PostMetaUtils::hasGenerateAudio($post->ID);

if (! $generateAudio) {
// Check whether "0" has explicitly been saved
$generateAudioMeta = PostMetaUtils::getRenamedPostMeta($post->ID, 'generate_audio', true);

if ($generateAudioMeta !== '0' && self::shouldPreselectGenerateAudio($post)) {
$generateAudio = true;
}
}
?>
<!-- checkbox -->
<p id="beyondwords-metabox-generate-audio">
Expand Down
10 changes: 2 additions & 8 deletions src/Component/Post/GenerateAudio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,13 @@ export default compose( [
beyondwords_generate_audio,
/* eslint-disable-next-line camelcase */
speechkit_generate_audio,
/* eslint-disable-next-line camelcase */
publish_post_to_speechkit,
} = getCurrentPostAttribute( 'meta' );

if (
/* eslint-disable-next-line camelcase */
beyondwords_generate_audio === '1' ||
/* eslint-disable-next-line camelcase */
speechkit_generate_audio === '1' ||
/* eslint-disable-next-line camelcase */
publish_post_to_speechkit === '1'
speechkit_generate_audio === '1'
) {
return true;
}
Expand All @@ -92,9 +88,7 @@ export default compose( [
/* eslint-disable-next-line camelcase */
beyondwords_generate_audio === '0' ||
/* eslint-disable-next-line camelcase */
speechkit_generate_audio === '0' ||
/* eslint-disable-next-line camelcase */
publish_post_to_speechkit === '0'
speechkit_generate_audio === '0'
) {
return false;
}
Expand Down
Loading