I’ve been preparing to move some of my ZENPRESS-based sites off of a host that permits running the old PHP 5.3 to a modern, managed host that requires a modern PHP implementation. Unfortunately, ZENPRESS dies horribly on PHP 5.4, because PHP removed call-time pass by reference, a capability used heavily throughout ZENPRESS.
Speaking personally, I consider removing a critical calling feature like this idiocy, and it’s one of the nasty side-effects of open source software. Open source has a lot of benefits, but a lack of professional project management allows implementors to make decisions that can simply nuke their existing users. Microsoft would never have done this.
In any case, I removed the &$ references in the Smart Objects parsing code (at the bottom of library/parse.php), which effectively nerfed run-time link parsing (code that converted inline URL text to actual HREF tags). Given that this was used almost exclusively for legacy code in the ZATZ archive, back when we didn’t use links, but used the actual URLS (can you say 1990s?), there’s no great loss — although I would someday like to get back into that code and make it work.
The fact is, I haven’t worked on the ZENPRESS code for more than five years (see my WordCamp talk) since its purpose was to support moving the ZATZ articles from Frontier to WordPress. Once that migration was complete, I went on to other things.
Unfortunately, as I moved the sites dependent on PHP 5.3 to hosts running 5.6 (yes, the PHP folks killed a major language architectural capability in a point release), we found that most of the ZENPRESS plugin dashboard capabilities were also dependent on call-time pass-by-reference.
Rewriting that code will be non-trivial — it might actually be better to simply remove that entire dashboard admin code completely and start over. But since this isn’t the time for a complete rewrite of code that exists primarily for an archive site, my plan is to simply disable or comment out the calls to the code that fails, effectively removing the dashboard options controls from ZENPRESS.
The following files were modified with return ""
:
- form-display.php
- form-process.php
- table-display.php
- zenpress-gov-pagebuilder.php
Also, disabled the following lines in zenpress-gov-pagebuilder.php
//zenpress_wp_zenpress_menu_init(); // **** We'll later see if we need to this or if its done // other filters and actions are added here and will be reflected in functions below //add_action('admin_menu', 'zenpress_wp_plugin_gov_page_builder_add_menu_items'); //add_action('admin_menu', 'zenpress_wp_plugin_health_page_builder_add_menu_items');
This is okay on the archive sites because those settings have been set and have remained unchanged for half a decade. But if I ever use ZENPRESS for more than the ZATZ archive, that code will need to be rewritten.
UPDATE: Oh, it gets better, by which I mean worse. PHP doesn’t just allow the code to be blocked off. It can’t even EXIST in the files, unless commented out. So even though I routed flow completely away from the offending (and previously valid lines), that’s not good enough. PHP is an interpreted language (at least logically) so it should allow previously valid but not offending code to exist, if it’s not asked to run it. But no. You must comment it out or the entire program dies. Who lets this stuff happen?
Because it may not be possible to display the ZENPRESS settings pages until I rewrite that code, here are screenshots for each of the main pages: