The more I dive into the WordPress Media code, the more it seems interesting to extend it to improve the way WPMovieLibrary handles backdrops and posters. I’ve spent most of the last two weeks reading code from WordPress’ core in an effort to replicate some of its features and adapt them to WPMovieLibrary, and I’m pretty satisfied of the result so far.
One of the biggest weaknesses of the plugin on that part is the way version 1.x and 2.x images are loaded to the Media Modal and the limitations it causes, such as importing posters one at a time only, or not being able to set preexisting images as backdrops or posters. Remote images download also is quite archaic, passing images URLs to a PHP script handling the download, all this through Ajax queries… Such a mess. Good news is, all these troubles will be addressed in version 3.0, including the possibility to set any images as a backdrop or poster and setting it as featured no matter if preexisting or imported from the API.
All of this is made possible by the Media Modal custom extensions I managed to develop lately, and it was quite a struggle due to the partially undocumented code I had to explore; took me a while to piece everything together. I might blog about that part on my own site as I have a feeling it will be helpful to some devs out there looking desperately for documentation on how to pass remote images to the WordPress Media Uploaded (PlUpload).
I’ve not yet added to the metabox the possibility to unset a backdrop or poster, ie. removing the media from the list of backdrops/posters without completely deleting it, but it seems like a good idea so I’ll probably add it to the todo list.
I hope next week will see the end of that part of the development so we can move on to deeper parts like the API connection. Maybe I’ll take some time first to correctly set up the translation system and nonces implementation, those are two important parts that should be done before any serious work on the backend. To be continued!