I have the same error:
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected ‘[‘ in …/wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php on line 700
Hi @jfan2006 – please try downloading the latest version (1.17) that I have just released to fix this issue.
@vladurash – thanks for the report. I cannot see why you are getting this error but I will look into it and see what I can find.
@vladurash I have deployed version 1.18 which should fix your activation issue – it was because PHP 5.2.17 doesn’t support anonymous functions within uasort.
Please let me know how you get on!
Chris.
@chrispage1 activation is ok.
But now I can’t see anything in Settings>Cronjob Scheduler. No info about wp-config or anything else. Please check
@vladurash – would you be able to get a screenshot of the whole section for me please?
Thanks,
Chris.
@vladurash sorry about that. It seems version 1.18 refactoring introduced a bug which has since been resolved in version 1.19 – please download and update and let me know how you get on.
Chris.
I made some test playing with PHP versions on my test website (dev, not prod).
So, on PHP ver 5.2.17, my dashboard looks like this: https://onedrive.live.com/redir?resid=15AD985AD8F96418!100735&authkey=!AM_sjTawQ21Bj2I&v=3&ithint=photo%2cpng
Using higer version for PHP (eg 5.3), it works (https://onedrive.live.com/redir?resid=15AD985AD8F96418!100736&authkey=!ABtHcdRutjWGcfg&v=3&ithint=photo%2cpng)
Unfortunatelly, on prod website I don’t have access to cPanel to change PHP version (owner won’t make this change).
I have also updated plugin to version 1.19 as you instructed. No changes for PHP ver 5.2.17
Please can you enable WordPress WP_DEBUG (https://codex.wordpress.org/WP_DEBUG)
Also, is there anything in your error_log files?
Unfortunately I am unable to replicate the issue at the minute so need all the information I can get.
I don’t have any error_log on server.
With DEBUB enabled I have following lines in Setting>Cronjob Scheduler
`Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID ” is invalid in /home/serpante/public_html/wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php on line 15
Notice: Use of undefined constant __DIR__ – assumed ‘__DIR__’ in /home/serpante/public_html/wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php on line 328
Notice: Use of undefined constant __DIR__ – assumed ‘__DIR__’ in /home/serpante/public_html/wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php on line 181
Notice: Use of undefined constant __DIR__ – assumed ‘__DIR__’ in /home/serpante/public_html/wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php on line 188
Warning: require_once(__DIR__/views/admin_page.php) [function.require-once]: failed to open stream: No such file or directory in /home/serpante/public_html/wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php on line 188
Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/views/admin_page.php’ (include_path=’.:/opt/alt/php52/usr/share/pear:/opt/alt/php52/usr/share/php’) in /home/serpante/public_html/wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php on line 188`
Okay thank you that helps me a lot. Of course it is the __DIR__ magic constant which doesn’t exist in PHP 5.2! Please could you update your file under wp-content/plugins/cronjob-scheduler/cronjob-scheduler.php with the contents from the following pastebin – http://pastebin.com/XX03wwjn
This will update you to version 1.20. If everything runs smoothly then I will roll out support for PHP 5.2
All the best,
Chris.
Well, googleing these errors, i found some fix
You have to replace __DIR__ with dirname(__FILE__) on lines 328, 188 and 181 in file cronjob-scheduler.php
Please check this and confirm it π
Later edit: we had same opinion π
WORKS Perfect! Thanks alot!
Great, pleased we got it sorted in the end! I have deployed this now as an official version. If you have any other issues, please create a new support request – I will mark this one as resolved! If you like the plugin and support provided, please review it π Reviews and donations help to keep the project going!
@jfan2006 it should be all working for you now although if you still have issues then please create a new support thread I’ll be happy to help!