Easy Fix Found For The Broken Flickr Module In Version 1.16
-
When ImageInject version 1.16 was rolled out approximately 10 months or so ago, I found that it broke the use of the Flickr module by preventing the checkbox next to “Flickr” from being selected when hovering the mouse over the “Search” button.
In the support thread linked above which I created to report this issue, a few other users reported that rolling back the plugin to version 1.15 solved this problem. While I do have an (awesome) plugin named WP Rollback installed which has saved my bacon on more than on occasion by reversing a plugin update which broke my website, I wasn’t interested in rolling back to version 1.15 since in THAT version, the Pixabay search had never worked for me, always returning zero results.
However, one fellow user of ImageInject by the name of Bob Weber (@robertjw) commented on my original support thread regarding this issue stating that he had managed to successfully fix this issue by diving into the code in wpinject.php and removing an “IF” statement at line 381.
While I am a relative noob at coding, I thought I’d follow Bob’s lead and see if I could fix this issue once and for all. However, I found that line 381 in wpinject.php was empty, and Bob hadn’t provided any specific steps regarding what he had done specifically within the code.
I therefore did my best to decipher what was happening within the code, and tried editing and removing a few statements which I thought held potential for solving the issue, unsuccessfully. I finally hit the jackpot, and found a quick and easy code update which after comprehensive testing results in a restoration of the Flickr module usage without interfering with the (working) Pixabay module availability in version 1.16. Here’s what I did:
1) Navigate to your cPanel File Manager and search for the file “wpinject.php”
2) Download and save a copy of the existing file to your PC as a backup.
3) Open wpinject.php and scroll down to line 382, which should read as follows:
if(empty($moduledata["options"]["appid"]["value"]) && $module != "pixabay" {
4) Change this to read as follows, instead:
if(empty($moduledata["options"]["appid"]["value"]) && $module != "pixabay" && $module !="flickr") {
5) Save Changes and Exit
6) Test ImageInject via the WordPress Editor
7) Voila!
Testing after applying the above fix indicated that this solution works when using ImageInject to search Flickr module only, the Pixabay module only, or both modules simultaneously.
Note that I am still using WordPress version 4.9.8, as I did not want to deal with the major Gutenberg update that was rolled out with WP version 5.0. I cannot speak to the effectiveness of this fix on any other WP version other than the one I am currently using.
As mentioned above, I am only a rookie at coding and there may be a far more elegant solution to this problem. All I know is that the steps outlined above worked at fixing this issue for me, and wanted to share.
I will contact the developer directly and request that this solution be reviewed and a plugin update be considered to fix this element of the code for all users.
I’ve been bailed out more than once in the past with website and plugin performance issues by the contributions of other WordPress support forum users, and wanted to repay that debt in some small way by providing the specific steps I took to solve this issue. I hope others find it as useful as I!
Credit to Bob Weber (@robertjw) for pointing me in the right direction.
- The topic ‘Easy Fix Found For The Broken Flickr Module In Version 1.16’ is closed to new replies.