diff --git a/.wordpress-org/screenshot-1.png b/.wordpress-org/screenshot-1.png index 8ae728f4..e512ca9a 100644 Binary files a/.wordpress-org/screenshot-1.png and b/.wordpress-org/screenshot-1.png differ diff --git a/.wordpress-org/screenshot-2.png b/.wordpress-org/screenshot-2.png index 2e8b2b6f..f894d0c0 100644 Binary files a/.wordpress-org/screenshot-2.png and b/.wordpress-org/screenshot-2.png differ diff --git a/.wordpress-org/screenshot-4.png b/.wordpress-org/screenshot-4.png index bd3d4309..858c7742 100644 Binary files a/.wordpress-org/screenshot-4.png and b/.wordpress-org/screenshot-4.png differ diff --git a/CHANGELOG.md b/CHANGELOG.md index e6531d8c..9873930f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/). +## [Unreleased] - TBD + +## [1.2.4] - 2022-07-27 +### Added +- Season number, episode number and episode type attributes can now be stored with a Podcast (props [@zamanq](https://github.com/zamanq), [@dchucks](https://github.com/dchucks), [@cadic](https://github.com/cadic) via [#175](https://github.com/10up/simple-podcasting/pull/175)). + +### Changed +- Bump WordPress version "tested up to" 6.0 (props [@cadic](https://github.com/cadic) via [#171](https://github.com/10up/simple-podcasting/issues/171)). + +### Fixed +- Incorrect Language value in the Feed (props [@zamanq](https://github.com/zamanq), [@dchucks](https://github.com/dchucks), [@cadic](https://github.com/cadic) via [#176](https://github.com/10up/simple-podcasting/pull/176)). + +### Security +- Bump `terser` from 5.12.1 to 5.14.2 (props [@dependabot](https://github.com/apps/dependabot) via [#180](https://github.com/10up/simple-podcasting/pull/180)). + ## [1.2.3] - 2022-04-28 ### Added - Compatibility tests against PHP 7 and 8 (props [@cadic](https://github.com/cadic), [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#150](https://github.com/10up/simple-podcasting/pull/150)). @@ -110,6 +125,7 @@ All notable changes to this project will be documented in this file, per [the Ke - Initial plugin release. [Unreleased]: https://github.com/10up/simple-podcasting/compare/trunk...develop +[1.2.4]: https://github.com/10up/simple-podcasting/compare/1.2.3-deploy...1.2.4 [1.2.3]: https://github.com/10up/simple-podcasting/compare/1.2.2...1.2.3-deploy [1.2.2]: https://github.com/10up/simple-podcasting/compare/1.2.1...1.2.2 [1.2.1]: https://github.com/10up/simple-podcasting/compare/1.2.0...1.2.1 diff --git a/CREDITS.md b/CREDITS.md index af265349..bb461bdc 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc. -[Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [David Chandra Purnama (@turtlepod)](https://github.com/turtlepod), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Jon Christensen (@Firestorm980)](https://github.com/Firestorm980), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Noah Halstead (@nhalstead)](https://github.com/nhalstead), [Matthew Haines-Young (@mattheu)](https://github.com/mattheu), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [David Chabbi](https://www.linkedin.com/in/david-chabbi-985719b4/), [Pablo Amato (@pabamato)](https://github.com/pabamato), [(@monomo111)](https://github.com/monomo111), [Jake Goldman (@jakemgold)](https://github.com/jakemgold), [Mark Jaquith (@markjaquith)](https://github.com/markjaquith), [Riad Benguella (@youknowriad)](https://github.com/youknowriad), [Mészáros Róbert (@meszarosrob)](https://github.com/meszarosrob), [Max Lyuchin (@cadic)](https://github.com/cadic), [@iamdharmesh](https://github.com/iamdharmesh), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Tom J Nowell (@tomjn)](https://github.com/tomjn), [@davexpression](https://github.com/davexpression). +[Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [David Chandra Purnama (@turtlepod)](https://github.com/turtlepod), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Jon Christensen (@Firestorm980)](https://github.com/Firestorm980), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Noah Halstead (@nhalstead)](https://github.com/nhalstead), [Matthew Haines-Young (@mattheu)](https://github.com/mattheu), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [David Chabbi](https://www.linkedin.com/in/david-chabbi-985719b4/), [Pablo Amato (@pabamato)](https://github.com/pabamato), [(@monomo111)](https://github.com/monomo111), [Jake Goldman (@jakemgold)](https://github.com/jakemgold), [Mark Jaquith (@markjaquith)](https://github.com/markjaquith), [Riad Benguella (@youknowriad)](https://github.com/youknowriad), [Mészáros Róbert (@meszarosrob)](https://github.com/meszarosrob), [Max Lyuchin (@cadic)](https://github.com/cadic), [@iamdharmesh](https://github.com/iamdharmesh), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Tom J Nowell (@tomjn)](https://github.com/tomjn), [@davexpression](https://github.com/davexpression), [Zaman.Q (@zamanq)](https://github.com/zamanq), [Debashish (@dchucks)](https://github.com/dchucks). ## Libraries diff --git a/README.md b/README.md index 53a2fba3..8347fe47 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Repeat for each podcast you would like to create. * Create a new post and assign it to one or more Podcasts using the panel labeled Podcasts. * Upload or embed an audio file into this post using any of the usual WordPress methods. If using the new block-based WordPress editor (sometimes referred to as Gutenberg), insert a Podcast block. Only one Podcast block can be inserted per post. - * For more advanced settings, use the Podcasting meta box to mark explicit content or closed captioning available and to optionally specify one media item if the post if you have more than one in your post. In the block-based editor, these are the block settings that appear in the sidebar when the podcast block is selected. + * For more advanced settings, use the Podcasting meta box to mark explicit content or closed captioning available, season number, episode number, episode type and to optionally specify one media item in the post if you have more than one in your post. In the block-based editor, these are the block settings that appear in the sidebar when the podcast block is selected. ## Submit your podcast feed to Apple Podcasts diff --git a/assets/css/podcasting-editor-screen.css b/assets/css/podcasting-editor-screen.css new file mode 100644 index 00000000..fefe73ba --- /dev/null +++ b/assets/css/podcasting-editor-screen.css @@ -0,0 +1,4 @@ +.components-input-control, +.components-base-control { + width: 100%; +} diff --git a/assets/js/blocks.js b/assets/js/blocks.js index e6b9395a..c6aafe8a 100755 --- a/assets/js/blocks.js +++ b/assets/js/blocks.js @@ -7,6 +7,7 @@ import { registerBlockType } from '@wordpress/blocks'; // Split the Edit component out. import Edit from './edit'; import transforms from './transforms'; +import '../css/podcasting-editor-screen.css'; /** * Register example block @@ -73,6 +74,21 @@ export default registerBlockType( source: 'meta', meta: 'enclosure', }, + seasonNumber: { + type: 'string', + source: 'meta', + meta: 'podcast_season_number', + }, + episodeNumber: { + type: 'string', + source: 'meta', + meta: 'podcast_episode_number', + }, + episodeType: { + type: 'string', + source: 'meta', + meta: 'podcast_episode_type', + } }, transforms, diff --git a/assets/js/edit.js b/assets/js/edit.js index 61f0e27f..e5f5a29b 100644 --- a/assets/js/edit.js +++ b/assets/js/edit.js @@ -13,6 +13,7 @@ const { PanelRow, SelectControl, TextControl, + RadioControl, } = wp.components; const { Fragment } = wp.element; @@ -43,6 +44,9 @@ class Edit extends Component { const { caption, explicit } = attributes; const duration = attributes.duration || ''; const captioned = attributes.captioned || ''; + const seasonNumber = attributes.seasonNumber || ''; + const episodeNumber = attributes.episodeNumber || ''; + const episodeType = attributes.episodeType || ''; const { className, src } = this.state; const onSelectAttachment = ( attachment ) => { @@ -161,6 +165,33 @@ class Edit extends Component { onChange={ duration => setAttributes( { duration } ) } /> + + setAttributes( { seasonNumber } ) } + /> + + + setAttributes( { episodeNumber } ) } + /> + + + setAttributes( { episodeType } ) } + /> +
diff --git a/composer.json b/composer.json index 54e18827..404152b9 100755 --- a/composer.json +++ b/composer.json @@ -21,5 +21,10 @@ "10up/wp_mock": "^0.4.2", "phpunit/phpunit": "^9.5", "phpcompatibility/phpcompatibility-wp": "*" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/includes/blocks.php b/includes/blocks.php index 01c9d019..8e523973 100644 --- a/includes/blocks.php +++ b/includes/blocks.php @@ -20,10 +20,19 @@ function init() { true ); + wp_register_style( + 'podcasting-block-editor', + PODCASTING_URL . 'dist/blocks.css', + array(), + $block_asset['version'], + 'all' + ); + register_block_type( 'podcasting/podcast', array( 'editor_script' => 'podcasting-block-editor', + 'editor_style' => 'podcasting-block-editor', ) ); } @@ -41,6 +50,9 @@ function register_js_strings() { __( 'Podcast Settings', 'simple-podcasting' ); __( 'Length (MM:SS)', 'simple-podcasting' ); __( 'a podcast episode', 'simple-podcasting' ); + __( 'Season Number', 'simple-podcasting' ); + __( 'Episode Number', 'simple-podcasting' ); + __( 'Episode Type', 'simple-podcasting' ); } add_action( 'init', __NAMESPACE__ . '\register_js_strings' ); diff --git a/includes/customize-feed.php b/includes/customize-feed.php index b59d2d36..2bc1823f 100644 --- a/includes/customize-feed.php +++ b/includes/customize-feed.php @@ -73,6 +73,7 @@ function bloginfo_rss_lang( $output, $requested ) { if ( 'language' === $requested ) { $lang = get_term_meta( $term->term_id, 'podcasting_language', true ); if ( $lang ) { + $lang = str_replace( '_', '-', $lang ); $output = $lang; } } @@ -172,14 +173,17 @@ function feed_item() { } $feed_item = array( - 'author' => get_option( 'podcasting_talent_name' ), - 'explicit' => get_post_meta( $post->ID, 'podcast_explicit', true ), - 'captioned' => get_post_meta( $post->ID, 'podcast_captioned', true ), - 'keywords' => '', - 'image' => '', - 'summary' => '', - 'subtitle' => '', - 'duration' => get_post_meta( $post->ID, 'podcast_duration', true ), + 'author' => get_option( 'podcasting_talent_name' ), + 'explicit' => get_post_meta( $post->ID, 'podcast_explicit', true ), + 'captioned' => get_post_meta( $post->ID, 'podcast_captioned', true ), + 'keywords' => '', + 'image' => '', + 'summary' => '', + 'subtitle' => '', + 'duration' => get_post_meta( $post->ID, 'podcast_duration', true ), + 'season' => get_post_meta( $post->ID, 'podcast_season_number', true ), + 'episode' => get_post_meta( $post->ID, 'podcast_episode_number', true ), + 'episodeType' => get_post_meta( $post->ID, 'podcast_episode_type', true ), ); if ( empty( $feed_item['author'] ) ) { @@ -221,14 +225,17 @@ function feed_item() { * @param array $feed_item { * Item data to filter. * - * @type string $author Podcast author. - * @type string $explicit Explicit content (yes|no|clean). - * @type string $captioned Closed Captioned ("1"|"0"). Optional. - * @type string $keywords Episode keywords. Optional. - * @type string $image Episode image. Optional. - * @type string $summary Episode summary. - * @type string $subtitle Episode subtitle. - * @type string $duration Episode duration (HH:MM). Optional. + * @type string $author Podcast author. + * @type string $explicit Explicit content (yes|no|clean). + * @type string $captioned Closed Captioned ("1"|"0"). Optional. + * @type string $keywords Episode keywords. Optional. + * @type string $image Episode image. Optional. + * @type string $summary Episode summary. + * @type string $subtitle Episode subtitle. + * @type string $duration Episode duration (HH:MM). Optional. + * @type string $season Season number Optional. + * @type string $episode Episode number Optional. + * @type string $episodeType Episode type Optional. * } * @param int $post->ID Podcast episode post ID. * @param int $term->term_id Podcast term ID. @@ -258,6 +265,15 @@ function feed_item() { if ( ! empty( $feed_item['duration'] ) ) { echo '' . esc_html( $feed_item['duration'] ) . "\n"; } + if ( ! empty( $feed_item['season'] ) ) { + echo '' . esc_html( $feed_item['season'] ) . "\n"; + } + if ( ! empty( $feed_item['episode'] ) ) { + echo '' . esc_html( $feed_item['episode'] ) . "\n"; + } + if ( ! empty( $feed_item['episodeType'] ) && 'none' !== $feed_item['episodeType'] ) { + echo '' . esc_html( $feed_item['episodeType'] ) . "\n"; + } } add_action( 'rss2_item', __NAMESPACE__ . '\feed_item' ); diff --git a/includes/datatypes.php b/includes/datatypes.php index dcd42ad7..02e1ef84 100644 --- a/includes/datatypes.php +++ b/includes/datatypes.php @@ -80,6 +80,36 @@ function register_meta() { 'single' => true, ) ); + + \register_meta( + 'post', + 'podcast_season_number', + array( + 'show_in_rest' => true, + 'type' => 'string', + 'single' => true, + ) + ); + + \register_meta( + 'post', + 'podcast_episode_number', + array( + 'show_in_rest' => true, + 'type' => 'string', + 'single' => true, + ) + ); + + \register_meta( + 'post', + 'podcast_episode_type', + array( + 'show_in_rest' => true, + 'type' => 'string', + 'single' => true, + ) + ); } add_action( 'init', __NAMESPACE__ . '\register_meta' ); diff --git a/includes/helpers.php b/includes/helpers.php index d9f0569f..611fe319 100644 --- a/includes/helpers.php +++ b/includes/helpers.php @@ -77,5 +77,8 @@ function delete_all_podcast_meta( $post_id ) { delete_post_meta( $post_id, 'podcast_captioned' ); delete_post_meta( $post_id, 'podcast_explicit' ); delete_post_meta( $post_id, 'enclosure' ); + delete_post_meta( $post_id, 'podcast_season_number' ); + delete_post_meta( $post_id, 'podcast_episode_number' ); + delete_post_meta( $post_id, 'podcast_episode_type' ); } } diff --git a/includes/post-meta-box.php b/includes/post-meta-box.php index d1c68b98..92575503 100644 --- a/includes/post-meta-box.php +++ b/includes/post-meta-box.php @@ -34,6 +34,9 @@ function meta_box_html( $post ) { $podcast_url = get_post_meta( $post->ID, 'podcast_url', true ); $podcast_explicit = get_post_meta( $post->ID, 'podcast_explicit', true ); $podcast_captioned = get_post_meta( $post->ID, 'podcast_captioned', true ); + $season_number = get_post_meta( $post->ID, 'podcast_season_number', true ); + $episode_number = get_post_meta( $post->ID, 'podcast_episode_number', true ); + $episode_type = get_post_meta( $post->ID, 'podcast_episode_type', true ); wp_nonce_field( plugin_basename( __FILE__ ), 'simple-podcasting' ); ?> @@ -54,7 +57,31 @@ function meta_box_html( $post ) {

- +

+ +

+

+ +

+
+

+

+ > +
+ > +
+ > +
+ > + +

+

@@ -90,6 +117,9 @@ function save_meta_box( $post_id ) { $url = false; $podcast_captioned = 0; $podcast_explicit = 'no'; + $season_number = isset( $_post['podcast_season_number'] ) ? sanitize_text_field( $_post['podcast_season_number'] ) : ''; + $episode_number = isset( $_post['podcast_episode_number'] ) ? sanitize_text_field( $_post['podcast_episode_number'] ) : ''; + $episode_type = isset( $_post['podcast_episode_type'] ) && in_array( $_post['podcast_episode_type'], array( 'none', 'full', 'trailer', 'bonus' ), true ) ? sanitize_text_field( $_post['podcast_episode_type'] ) : ''; if ( isset( $_post['podcast_closed_captioned'] ) && 'on' === $_post['podcast_closed_captioned'] ) { $podcast_captioned = 1; @@ -141,6 +171,9 @@ function save_meta_box( $post_id ) { update_post_meta( $post_id, 'podcast_explicit', $podcast_explicit ); update_post_meta( $post_id, 'podcast_captioned', $podcast_captioned ); + update_post_meta( $post_id, 'podcast_season_number', $season_number ); + update_post_meta( $post_id, 'podcast_episode_number', $episode_number ); + update_post_meta( $post_id, 'podcast_episode_type', $episode_type ); } add_action( 'save_post_post', __NAMESPACE__ . '\save_meta_box' ); diff --git a/package-lock.json b/package-lock.json index bea45b2f..0b2db50a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@10up/simple-podcasting", - "version": "1.2.3", + "version": "1.2.4", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1858,12 +1858,63 @@ "chalk": "^4.0.0" } }, + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, "@jridgewell/resolve-uri": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", "dev": true }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, "@jridgewell/sourcemap-codec": { "version": "1.4.11", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", @@ -12927,14 +12978,14 @@ } }, "terser": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz", - "integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { @@ -12943,12 +12994,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true } } }, diff --git a/package.json b/package.json index 70ecdc94..088272eb 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@10up/simple-podcasting", - "version": "1.2.3", + "version": "1.2.4", "description": "A simple podcasting solution for WordPress. ", "homepage": "https://github.com/10up/simple-podcasting", "bugs": { diff --git a/readme.txt b/readme.txt index e271a5e4..3c8a2cf2 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: 10up, helen, adamsilverstein, jakemgold Tags: simple podcasting, podcasting, podcast, apple podcasts, episode, gutenberg, blocks, block Requires at least: 4.6 -Tested up to: 5.9 +Tested up to: 6.0 Requires PHP: 7.0 -Stable tag: 1.2.3 +Stable tag: 1.2.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -40,7 +40,7 @@ Repeat for each podcast you would like to create. * Create a new post and assign it to one or more Podcasts using the panel labeled Podcasts. * Upload or embed an audio file into this post using any of the usual WordPress methods. If using the new block-based WordPress editor (sometimes referred to as Gutenberg), insert a Podcast block. Only one Podcast block can be inserted per post. - * For more advanced settings, use the Podcasting meta box to mark explicit content or closed captioning available and to optionally specify one media item if the post if you have more than one in your post. In the block-based editor, these are the block settings that appear in the sidebar when the podcast block is selected. + * For more advanced settings, use the Podcasting meta box to mark explicit content or closed captioning available, season number, episode number, episode type and to optionally specify one media item in the post if you have more than one in your post. In the block-based editor, these are the block settings that appear in the sidebar when the podcast block is selected. === Submit your podcast feed to Apple Podcasts === @@ -102,6 +102,12 @@ add_filter( 'simple_podcasting_feed_item', 'podcasting_feed_item_filter', 10, 3 == Changelog == += 1.2.4 - 2022-07-27 = +* **Added:** Season number, episode number and episode type attributes can now be stored with a Podcast (props [@zamanq](https://github.com/zamanq), [@dchucks](https://github.com/dchucks), [@cadic](https://github.com/cadic) via [#175](https://github.com/10up/simple-podcasting/pull/175)). +* **Changed:** Bump WordPress version "tested up to" 6.0 (props [@cadic](https://github.com/cadic) via [#171](https://github.com/10up/simple-podcasting/issues/171)). +* **Fixed:** Incorrect Language value in the Feed (props [@zamanq](https://github.com/zamanq), [@dchucks](https://github.com/dchucks), [@cadic](https://github.com/cadic) via [#176](https://github.com/10up/simple-podcasting/pull/176)). +* **Security:** Bump `terser` from 5.12.1 to 5.14.2 (props [@dependabot](https://github.com/apps/dependabot) via [#180](https://github.com/10up/simple-podcasting/pull/180)). + = 1.2.3 - 2022-04-28 = * **Added** Compatibility tests against PHP 7 and 8 (props [@cadic](https://profiles.wordpress.org/cadic), [@dkotter](https://profiles.wordpress.org/dkotter), [@jeffpaul](https://profiles.wordpress.org/jeffpaul)). * **Added** Default Pull Request Reviewers via CODEOWNERS file (props [@jeffpaul](https://profiles.wordpress.org/jeffpaul), [@cadic](https://profiles.wordpress.org/cadic)). diff --git a/simple-podcasting.php b/simple-podcasting.php index 067100cd..37a535ad 100644 --- a/simple-podcasting.php +++ b/simple-podcasting.php @@ -3,7 +3,7 @@ * Plugin Name: Simple Podcasting * Plugin URI: https://github.com/10up/simple-podcasting * Description: Easily set up multiple podcast feeds using built-in WordPress posts. Includes a podcast block for the new WordPress editor. - * Version: 1.2.3 + * Version: 1.2.4 * Author: 10up * Author URI: http://10up.com/ * License: GPL v2 or later @@ -15,7 +15,7 @@ namespace tenup_podcasting; -define( 'PODCASTING_VERSION', '1.2.3' ); +define( 'PODCASTING_VERSION', '1.2.4' ); define( 'PODCASTING_PATH', dirname( __FILE__ ) . '/' ); define( 'PODCASTING_URL', plugin_dir_url( __FILE__ ) ); define( 'TAXONOMY_NAME', 'podcasting_podcasts' ); diff --git a/tests/unit/test-blocks.php b/tests/unit/test-blocks.php index 247e3034..d0eaa918 100644 --- a/tests/unit/test-blocks.php +++ b/tests/unit/test-blocks.php @@ -40,6 +40,20 @@ public function test_init() { ) ); + \WP_Mock::userFunction( + 'wp_register_style', + array( + 'times' => 1, + 'args' => array( + 'podcasting-block-editor', + PODCASTING_URL . 'dist/blocks.css', + array(), + $block_asset['version'], + 'all', + ), + ) + ); + \WP_Mock::userFunction( 'register_block_type', array( @@ -48,6 +62,7 @@ public function test_init() { 'podcasting/podcast', array( 'editor_script' => 'podcasting-block-editor', + 'editor_style' => 'podcasting-block-editor', ), ), ) @@ -59,7 +74,7 @@ public function test_init() { } public function test_register_js_strings() { - \WP_Mock::userFunction( '__', array( 'times' => 4 ) ); + \WP_Mock::userFunction( '__', array( 'times' => 7 ) ); $result = tenup_podcasting\block\register_js_strings(); $this->assertNull( $result ); @@ -109,11 +124,11 @@ public function data_provider_for_test_block_editor_meta_cleanup() { 'metadata_exists' => false, 'expected' => null, ), - 'Delete 6 metas' => array( + 'Delete 10 metas' => array( 'creating' => false, 'has_block' => false, 'metadata_exists' => true, - 'expected' => array( 'podcast_url', 'podcast_filesize', 'podcast_duration', 'podcast_mime', 'podcast_captioned', 'podcast_explicit', 'enclosure' ), + 'expected' => array( 'podcast_url', 'podcast_filesize', 'podcast_duration', 'podcast_mime', 'podcast_captioned', 'podcast_explicit', 'enclosure', 'podcast_season_number', 'podcast_episode_number', 'podcast_episode_type' ), ), ); } diff --git a/tests/unit/test-customize-feed.php b/tests/unit/test-customize-feed.php index 1f02058a..8d9d7725 100644 --- a/tests/unit/test-customize-feed.php +++ b/tests/unit/test-customize-feed.php @@ -198,9 +198,12 @@ public function data_provider_for_test_feed_item() { 'term' => (object) array( 'term_id' => 2 ), 'post_author' => 'Post Author', 'post_meta' => array( - 'podcast_explicit' => '', - 'podcast_captioned' => '', - 'podcast_duration' => '', + 'podcast_explicit' => '', + 'podcast_captioned' => '', + 'podcast_duration' => '', + 'podcast_season_number' => '', + 'podcast_episode_number' => '', + 'podcast_episode_type' => '', ), 'term_meta' => array( 'podcasting_explicit' => '', @@ -215,6 +218,9 @@ public function data_provider_for_test_feed_item() { 'Post excerpt as summary' => '/Post Excerpt<\/itunes:summary>/', 'Post excerpt as subtitle' => '/Post Excerpt<\/itunes:subtitle>/', 'Duration is empty' => '/^((?!).)*$/s', + 'Doesnt contain season' => '/^((?!season).)*$/s', + 'Doesnt contain episode' => '/^((?!episode).)*$/s', + 'Doesnt contain episode type' => '/^((?!episodeType).)*$/s', ), ), 'Mixed Test 2' => array( @@ -226,9 +232,12 @@ public function data_provider_for_test_feed_item() { 'term' => (object) array( 'term_id' => 2 ), 'post_author' => 'Post Author', 'post_meta' => array( - 'podcast_explicit' => 'yes', - 'podcast_captioned' => '1', - 'podcast_duration' => '1:23', + 'podcast_explicit' => 'yes', + 'podcast_captioned' => '1', + 'podcast_duration' => '1:23', + 'podcast_season_number' => '2', + 'podcast_episode_number' => '4', + 'podcast_episode_type' => 'full', ), 'term_meta' => array( 'podcasting_explicit' => '', @@ -243,6 +252,9 @@ public function data_provider_for_test_feed_item() { 'Long Summary' => '/Very Long Post Excerpt Very Long Post Excerpt Very Long Post Excerpt Very Long Post Excerpt<\/itunes:summary>/', 'Short Subtitle' => '/Short Excerpt<\/itunes:subtitle>/', 'Duration' => '/1:23<\/itunes:duration>/', + 'Season' => '/2<\/itunes:season>/', + 'Episode' => '/4<\/itunes:episode>/', + 'Episode type' => '/full<\/itunes:episodeType>/', ), ), 'Mixed Test 3' => array( diff --git a/tests/unit/test-helpers.php b/tests/unit/test-helpers.php index 166fa7d7..fa6b62ac 100644 --- a/tests/unit/test-helpers.php +++ b/tests/unit/test-helpers.php @@ -30,7 +30,7 @@ public function test_delete_all_podcast_meta() { $this->assertNull(tenup_podcasting\helpers\delete_all_podcast_meta( 42 )); - $meta_keys = array('podcast_url', 'podcast_filesize', 'podcast_duration', 'podcast_mime', 'podcast_captioned', 'podcast_explicit', 'enclosure'); + $meta_keys = array( 'podcast_url', 'podcast_filesize', 'podcast_duration', 'podcast_mime', 'podcast_captioned', 'podcast_explicit', 'enclosure', 'podcast_season_number', 'podcast_episode_number', 'podcast_episode_type' ); foreach ( $meta_keys as $meta_key ) { \WP_Mock::userFunction( 'delete_post_meta' )->with( 42, $meta_key ); }