Unyson
Unyson copied to clipboard
Unyson install content demo error with exclamation mark
My problem that is "Unyson" I can't install demo content by bellow. Pls, how to fix it?
I had the same issue and I had to look through the debug.log
file to find out what's wrong. And the problem apparently is related to PHP version (my WP instance uses 8.0.9
) because there are literally dozens of these error messages, pointing out exact places of occurrence which are scattered across many different files:
PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /var/www/html/wp-content/plugins/unyson/framework/extensions/backups/includes/module/tasks/type/class-fw-ext-backups-task-type-db-export.php on line 180
So this basically says that it'd be sufficient to simply replace the curly braces {} with square brackets []. It would be possible to manually edit the source code of the plugin, located on the server, to temporarily suppress the error messages, but this is an extremely cumbersome task and not a proper solution.
Hello! I solved the problem by doing what @morteify said and also making the same changes on all files in the /wp-content/plugins/unyson/framework/extensions/backups/includes/module/tasks
directory.
After that I still wasn't unable to install the demo content because I was receiving an error on /wp-content/plugins/unyson/framework/extensions/backups/includes/module/tasks/type/class-fw-ext-backups-task-type-image-sizes-remove.php
file on line 54.
Simply change the implode()
function arguments order:
From this:
$sql = implode( array(
"SELECT * FROM {$wpdb->posts}",
"WHERE post_type = 'attachment' AND post_mime_type LIKE %s AND ID > %d",
"ORDER BY ID",
"LIMIT 7"
), " \n" );
To this:
$sql = implode(" \n", array(
"SELECT * FROM {$wpdb->posts}",
"WHERE post_type = 'attachment' AND post_mime_type LIKE %s AND ID > %d",
"ORDER BY ID",
"LIMIT 7"
));
After that, simply try to install the demo content again.
This solved my problem.
Not the best solution, but considering that I only needed to install it once, I changed the plugin files.
I hope this helps you.