Embed Plugin sync failed

I have a question about the Embed Plugin from Silvain Julé GitHub - sylvainjule/kirby-embed: Embed field for Kirby 3.
I’m trying to incorporate it but I have issues with uploading a link via the panel, I get a red sync failed notification and when I open the dev tools it says GET http://localhost:8000/api/kirby-embed/get-data?url=https://www.youtube.com/watch?v=BHvtkTeMia8 400 (Bad Request) which suggests that there may be an issue with the YouTube API key being used by the plugin. Also, I get the following error message {status: ‘error’, error: ‘Creation of dynamic property Embed\Adapters\Youtube::$url is deprecated’}
As I am relatively new to this I dont really have a good idea from where I should start. I tried deleting it and made sure to reinstall the newest version, and deleted the cache

Hm, I just installed the latest version of the plugin (1.0.8) via Composer into a Kirby 3.9.4 Starterkit, and your example YouTube Url works fine in the Panel with PHP 8.1.13. The error message makes me assume that you are on PHP 8.2, and indeed, I get the same error message when switching to PHP 8.2. As the error states, the url property is not declared in the class, which in PHP 8.2 is deprecated.

You can work around this issue by setting error reporting in your php.ini to ignore deprecation warnings.

Thank you so much for the answer, it works now!
I do have a question though, is the ignoring work-around something that could give me troubles later on?

The only downside is that you are not made aware of such deprecation which will throw an error once the deprecated code will fail in a future PHP version. So in general, it is good to know about such things to be able to take care of them in advance, but I wouldn’t worry about it.

Might be worth creating an issue in the plugin repo, though, so that the problem gets resolved.

1 Like