Hi Mihai,
I got the error while trying to update the plugin via wp-cli, then when trying to activate it.
All errors were in that same file:
includes/base/abstracts/abstract-class-migration.php
The problem was that the code used ::
with a variable. I ran into that years ago with one of my first plugins. The fix was to use call_user_func() instead. I just tried to replicate the issue on a dev server (different ISP) but couldn’t. I’m wondering if wp-cli in the affected server was using a PHP version that was too old, and not the one I got when running php -v.
Anyway, the fixes were as follows:
Original:
125 return in_array( $this->id, array_keys( slicewp()->services['migration_manager']::get_ran_migrations() ) );
New:
125 return in_array( $this->id, array_keys( call_user_func( [slicewp()->services['migration_manager'], 'get_ran_migrations'] ) ) );
Original:
136 slicewp()->services['migration_manager']::update( $this->id );
New:
136 call_user_func( [slicewp()->services['migration_manager'], 'update'], $this->id );
Original:
159 slicewp()->services['migration_manager']::update( $this->id, 'dismissed' );
New:
159 call_user_func([slicewp()->services['migration_manager'],'update'], $this->id, 'dismissed' );
Cheers,
Vinny