Plugin update needed for PHP compatibility

I have this simple WordPress plugin called “Posts Expire” that isn’t compatible with PHP 7.3 that I need updated. It says these are the errors that need fixing:
14 | WARNING | Use of deprecated PHP4 style class constructor is not supported since PHP 7.
76 | ERROR | Assigning the return value of new by reference is deprecated in PHP 5.3 and has been removed in PHP 7.0
Its a simple plugin so hopefully a quick project. Here’s the plugin code:

query("ALTER TABLE `$wpdb->posts` ADD `post_end_date` DATE AFTER `post_date`");
update_option('posts_have_end_date', 1);
}

add_filter(‘posts_where’, array(&$this, ‘add_where_clause’));
add_filter(‘posts_orderby’, array(&$this, ‘add_orderby’)); //bypass orderby safety check
add_action(‘simple_edit_form’, array(&$this, ‘add_end_date_input’));
add_action(‘edit_form_advanced’, array(&$this, ‘add_end_date_input’));
add_action(‘edit_page_form’, array(&$this, ‘add_end_date_input’));
add_action(‘save_post’, array(&$this, ‘add_update_statement’));
}

function add_where_clause($where)
{
if(get_settings(‘show_expired_posts’) || is_admin() || is_single())
return $where;

//exclude nulls when getting a list of posts that expire soon
$include_nulls = !($_GET[‘orderby’] == ‘post_end_date’);

$now = date(‘Y-m-d’) . ‘ 23:59:59’; //timezone not taken into consideration…

$where = $where . ” AND (post_end_date >= ‘$now'”;
if($include_nulls)
$where = $where . ‘ OR post_end_date IS NULL’;
$where = $where . ‘)’;

return $where;
}

function add_orderby($orderby)
{
if($_GET[‘orderby’] == ‘post_end_date’)
return ‘`post_end_date` ASC’;
else
return $orderby;
}

function add_end_date_input()
{
$end_date = get_end_date();
echo “Enter a end date (yyyy-mm-dd): “;
}

function add_update_statement($post_ID)
{
global $wpdb;

$end_date = $_POST[‘end_date’];

if($end_date)
$wpdb->query(“UPDATE `$wpdb->posts` SET `post_end_date` = ‘$end_date’ WHERE `ID` =$post_ID LIMIT 1 ;”);
else //remove existing end date if user blanks field
$wpdb->query(“UPDATE `$wpdb->posts` SET `post_end_date` = NULL WHERE `ID` =$post_ID LIMIT 1 ;”);
}
}

$posts_expire =& new posts_expire();

function the_end_date($prefix = ”)
{
$end_date = mysql2date(get_settings(‘date_format’),get_end_date());

if(!$prefix)
$prefix = __(‘Expires ‘);

if(function_exists(‘get_begin_date’) && get_begin_date())
$prefix = ‘, ‘ . $prefix;

if($end_date)
echo $prefix . $end_date;
else
echo __(‘Expiration Unknown’);
}

function get_end_date()
{
global $post;
return $post->post_end_date;
}
?>

Company
fst
Job Type
Project
Location
N/A
How to Apply
Via email