Site WordPress crash due to error in Plugin.php

QuestionsCategory: PDF Light ViewerSite WordPress crash due to error in Plugin.php
Fiorenzo asked 2 weeks ago

I got scared to death in seeing my site crash after the last update of WordPress and the plugins installed.
In the home page instead of the site appeared a string with reference to a fatal error in the code of the file Plugin.php contained in the folder wp-contents/plugins/pdf-light-viewer/controllers/
I tried to download the file indicted and check the first of the errors in line 428. I noticed missing apex in line closing. I added it and reloaded the file but other errors came out, for example the message said to be present an error at line 432 and at this point I gave up. I took the same file from my backup a few days before the upgrade, I replaced it and luckily everything was back in place. My site is visible again and everything seems to be working properly.
I point out the problem so that you can remedy this serious incident and prevent others from being like me with the site unusable.

1 Answers
supportsupport answered 2 weeks ago

Hello Fiorenzo,
The error caused by the incompatibility between new code practice and old PHP versions (prior to 5.5). The error occured for PHP versions 5.3 (unmaintained by the PHP dev team since 14 Aug 2014) and 5.4 (unmaintained by the PHP dev team since 3 Sep 2015).
We’ve pushed a fix for this error in the plugin version 1.3.22