| @@ -8,8 +8,12 @@ | ||
| 8 | 8 | * |
| 9 | 9 | * @package automattic/jetpack |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | + exit( 0 ); | |
| 14 | +} | |
| 15 | + | |
| 12 | 16 | wp_oembed_add_provider( 'https://me.sh/*', 'https://me.sh/oembed?format=json' ); |
| 13 | 17 | wp_oembed_add_provider( '#https?://(www\.)?gfycat\.com/.*#i', 'https://api.gfycat.com/v1/oembed', true ); |
| 14 | 18 | wp_oembed_add_provider( '#https?://[^.]+\.(wistia\.com|wi\.st)/(medias|embed)/.*#', 'https://fast.wistia.com/oembed', true ); |
| 15 | 19 | wp_oembed_add_provider( '#https?://sketchfab\.com/.*#i', 'https://sketchfab.com/oembed', true ); |
| @@ -25,10 +29,13 @@ | ||
| 25 | 29 | * @param string $url The URL to fetch. |
| 26 | 30 | * |
| 27 | 31 | * @return int The timeout value in seconds. |
| 28 | 32 | */ |
| 29 | -function jetpack_oembed_timeout_override( $timeout, $url ) { | |
| 30 | - if ( false !== strpos( $url, 'iwmb.icloud.com' ) ) { | |
| 33 | +function jetpack_oembed_timeout_override( $timeout, $url = '' ) { | |
| 34 | + if ( | |
| 35 | + is_string( $url ) | |
| 36 | + && str_contains( $url, 'iwmb.icloud.com' ) | |
| 37 | + ) { | |
| 31 | 38 | return 10; |
| 32 | 39 | } |
| 33 | 40 | return $timeout; |
| 34 | 41 | } |