Repository navigation
feat(seo): fix VideoObject schema and add video sitemap #2186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ebd5050
feat(seo): fix VideoObject schema and add video sitemap (#1622 v1)
rudrakshi-gupta d7368b1
Resolve feedback
rudrakshi-gupta 7f1b1c5
Resolve feedbacks and regenrate POT file
rudrakshi-gupta 4aab4f3
Revert the POT file
rudrakshi-gupta 27ad1bc
Resolve feedbacks and regenrate POT file
rudrakshi-gupta 854cb2d
Resolve Privacy Issue
rudrakshi-gupta 9b953b5
feat(seo): add key moments to video schema from chapters (#1597) (#2194)
rudrakshi-gupta 3bc3818
Match WPBakery SEO Settings to Gutenberg Model (#2209)
rudrakshi-gupta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { getFileNameFromUrl, isFilenameLikeTitle } from './index'; | ||
|
|
||
| describe( 'isFilenameLikeTitle', () => { | ||
| it.each( [ | ||
| [ 'product-demo_v2', '' ], | ||
| [ 'my-video-final', '' ], | ||
| [ 'final_cut_FINAL', '' ], | ||
| [ 'Mike-was-impressed-by-Harvey_s-influence', '' ], | ||
| [ 'IMG_2041', '' ], | ||
| [ 'DSC-0001', '' ], | ||
| [ 'VID_20240115', '' ], | ||
| [ 'IMG2041.mp4', '' ], | ||
| [ 'clip.MOV', '' ], | ||
| ] )( 'flags "%s" (2+ separators, camera-style name or file extension, no spaces)', ( title, fileName ) => { | ||
| expect( isFilenameLikeTitle( title, fileName ) ).toBe( true ); | ||
| } ); | ||
|
|
||
| it.each( [ | ||
| 'Spider-Man', | ||
| 'COVID-19', | ||
| 'e-commerce', | ||
| 'Add-ons', | ||
| 'Q3_review', | ||
| 'Self-hosting', | ||
| ] )( 'does not flag the real one-separator title "%s"', ( title ) => { | ||
| expect( isFilenameLikeTitle( title ) ).toBe( false ); | ||
| } ); | ||
|
|
||
| it( 'flags a one-separator title when it is the file name', () => { | ||
| expect( isFilenameLikeTitle( 'my-video', 'https://example.test/uploads/my-video.mp4' ) ).toBe( true ); | ||
| } ); | ||
|
|
||
| it( 'flags a title that matches the file name, with or without extension', () => { | ||
| expect( isFilenameLikeTitle( 'Intro', 'https://example.test/wp-content/uploads/2026/10/intro.mp4' ) ).toBe( true ); | ||
| expect( isFilenameLikeTitle( 'intro.mp4', 'intro.mp4' ) ).toBe( true ); | ||
| expect( isFilenameLikeTitle( 'My Clip', 'https://example.test/uploads/My%20Clip.mov?ver=2' ) ).toBe( true ); | ||
| } ); | ||
|
|
||
| it.each( [ | ||
| 'How to set up GoDAM', | ||
| 'Product demo - part 2', | ||
| 'Q3_results review', | ||
| 'Intro', | ||
| '', | ||
| ' ', | ||
| ] )( 'does not flag "%s"', ( title ) => { | ||
| expect( isFilenameLikeTitle( title, 'https://example.test/uploads/other-file.mp4' ) ).toBe( false ); | ||
| } ); | ||
|
|
||
| it( 'handles missing values', () => { | ||
| expect( isFilenameLikeTitle( undefined ) ).toBe( false ); | ||
| expect( isFilenameLikeTitle( null, null ) ).toBe( false ); | ||
| } ); | ||
| } ); | ||
|
|
||
| describe( 'getFileNameFromUrl', () => { | ||
| it( 'returns the decoded file name without folders or query string', () => { | ||
| expect( getFileNameFromUrl( 'https://cdn.example.test/a/b/My%20Video.mp4?x=1#t=3' ) ).toBe( 'My Video.mp4' ); | ||
| expect( getFileNameFromUrl( 'clip.mov' ) ).toBe( 'clip.mov' ); | ||
| } ); | ||
|
|
||
| it( 'returns an empty string for empty input', () => { | ||
| expect( getFileNameFromUrl( '' ) ).toBe( '' ); | ||
| expect( getFileNameFromUrl( undefined ) ).toBe( '' ); | ||
| } ); | ||
| } ); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.