Wordpress - Civicrm 5.16 upgrade to 5.30 issue - Notice: Undefined index query in /wp-content/plugins/civicrm/civicrm.php on line 483
Comment out line 391 of that file - so that it reads like this:
// add_filter( 'heartbeat_settings', array( $this, 'heartbeat' ), 1000, 1 );

Then try the upgrade again.