Ipstenu / dreamobjects

DreamObjects Backup Plugin for WordPress
10 stars 5 forks source link

settings.php uses $this in static method #21

Open jasonmobley opened 4 years ago

jasonmobley commented 4 years ago

https://github.com/Ipstenu/dreamobjects/blob/master/lib/settings.php#L148

My Wordpress site suddenly started encoutering the following issue because of line 148 using $this in a static method:

Error Details
=============
An error of type E_ERROR was caused in line 148 of the file /home/.../wp-content/plugins/dreamobjects/lib/settings.php. Error message: Uncaught Error: Using $this when not in object context in /home/.../wp-content/plugins/dreamobjects/lib/settings.php:148
Stack trace:
#0 /home/.../wp-includes/class-wp-hook.php(288): DreamObjects_Settings::add_settings_page('')
#1 /home/.../wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)
#2 /home/.../wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 /home/.../wp-admin/includes/menu.php(155): do_action('admin_menu', '')
#4 /home/.../wp-admin/menu.php(326): require_once('/home/...')
#5 /home/.../wp-admin/admin.php(153): require('/home/...')
#6 /home/.../wp-admin/plugins.php(10): require_once('/home/...')
#7 {main}
  thrown

I had to use the admin recovery mode to disable the plugin. I'm not sure how it worked fine prior to today. The only thing I messed with around the time it started happening was toggling between PHP 7.2 and 7.4 on my web server.