I recently installed the Youtube With Fancy Zoom WordPress plugin on one of my personal web sites so I could upload and display videos of my daughters. This plugin allows you to upload videos to the YouTube, reference them in your WordPress admin, and then display them in a nice pop up window on your website. This way they are streamed from YouTube but the person visiting your site doesn’t have to leave your site to view the video.
About a week ago I decided to implement the FORCE_SSL_ADMIN configuration setting in the wp-config.php file for all sites that I manage using WordPress. It appears that doing this broke a bunch of WordPress plugins because a lot of them are using an old variable that is no longer valid. While this variable will work with HTTP it does not reference HTTPS properly and so while you will visit the HTTPS version of your WordPress admin if you attempt to POST data back to the server it is likely to attempt to POST to HTTP and not HTTPS. Below is a brief description of how to resolve the issue with the Youtube With Fancy Zoom plugin and FORCE_SSL_ADMIN being set in your WordPress configuration file.
Get Youtube With Fancy Zoom Working With FORCE_SSL_ADMIN:
All you need to do is modify one line in a file located in the Youtube With Fancy Zoom plugin directory which is wp-root/wp-content/plugins/youtube-with-fancy-zoom. The file that needs to be modified is youtube-with-fancy-zoom.php but make sure to backup this file before you edit it in case something goes wrong. Below is the default line 80 of this file.
Default Line 80 Of youtube-with-fancy-zoom.php:
- $mainurl = get_option('siteurl')."/wp-admin/options-general.php?page=youtube-with-fancy-zoom/youtube-with-fancy-zoom.php";
New Line 80 Of youtube-with-fancy-zoom.php:
- $mainurl = admin_url("options-general.php?page=youtube-with-fancy-zoom/youtube-with-fancy-zoom.php");
Simply replace the original line 80 with the new line 80 to resolve the problem with using Youtube With Fancy Zoom over HTTPS. The new mainurl variable will reference the WordPress admin as a relative link thus making it SSL when FORCE_SSL_ADMIN is set. After making this modification test configuring a new YouTube video and editing a current one to make sure the change resolved the issue.