Automattic / Automattic/jetpack

Shortcodes: PHP notices when using the Youtube Embed plugin

Open
#4,612 8 comments 0 reactions 0 assignees View on GitHub
[Feature] Shortcodes / Embeds [Pri] Low Bug
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Self-installed Wordpress 4.5.3 with the latest Jetpack, and the following plugin:
https://wordpress.org/plugins/youtube-embed/
#### Steps to reproduce the issue
1. Create a new post including a video, inserted following this format:
`youtube]HbWrJWWn9nU[/youtube]`
2. Load that post with `WP_DEBUG` set to `true`.
3. A long list of errors regarding undefined index is seen at the top of the page:
Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 78

Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 78

Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 78

Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 77

Notice: Undefined index: id in /var/www/kechlibar.net/wordpress/wp-content/plugins/jetpack/_inc/lib/class.media-summary.php on line 78
#### What I expected

I did not expect to see that for sure :-)
The older articles, which were written before installing Jetpack, do not suffer from this problém.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Youtube Embed shortcode with WordPress 4.5.3, Jetpack, and WP_DEBUG enabled, then inspect _inc/lib/class.media-summary.php around lines 77-78 where the undefined id notices are reported. Compare this behavior with older posts and confirm that the shortcode no longer produces undefined-index notices when the issue is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.