<!-- Top Update Notice -->

<?php delete_transient('newsletters_update_info'); ?>

<?php if ($this -> ci_serial_valid() ) : ?>
	<?php if (!empty($update_info) && $update_info['is_valid_key'] == "1") : ?>		
		<div class="update-nag newsletters-update-nag-wrapper">
			<span class="newsletters-update-nag"></span> <?php echo sprintf(__('%s plugin %s is available.', 'wp-mailinglist'), $this -> name, $update_info['version']); ?><br/>
			<?php _e('You can update automatically or download to install manually.', 'wp-mailinglist'); ?>
			<br/><br/>
			<a href="<?php echo $upgrade_url; ?>" title="" class="button-primary"><i class="fa-solid fa-wand-magic-sparkles"></i> <?php _e('Update Automatically', 'wp-mailinglist'); ?></a>
			<a target="_blank" href="<?php echo $update_info['url']; ?>" title="" class="button-secondary"><i class="fa-solid fa-download"></i> <?php _e('Download', 'wp-mailinglist'); ?></a>
			<a style="color:black; text-decoration:none;" href="<?php echo admin_url('admin.php'); ?>?page=<?php echo $this -> sections -> settings_updates; ?>&amp;method=check" class="button button-secondary"><i class="fa-solid fa-clock-rotate-left fa-fw"></i> <?php _e('Check Again', 'wp-mailinglist'); ?></a>
			<?php if (empty($_GET['page']) || (!empty($_GET['page']) && $_GET['page'] != $this -> sections -> settings_updates)) : ?>
				<a class="button" href="<?php echo admin_url('admin.php?page=' . $this -> sections -> settings_updates); ?>"><i class="fa-solid fa-list-ul"></i> <?php _e('Changelog', 'wp-mailinglist'); ?></a>
				<a href="?newsletters_method=hideupdate&version=<?php echo $update_info['version']; ?>" class="" style="position: absolute; top: 0; right: 0; margin: 10px 10px 0 0;"><i class="fa-solid fa-xmark"></i></a>
			<?php endif; ?>
		</div>
	<?php else : ?>
		<div class="update-nag newsletters-update-nag-wrapper">
			<span class="newsletters-update-nag"></span> <?php echo sprintf(__('%s plugin %s is available.', 'wp-mailinglist'), $this -> name, $update_info['version']); ?><br/>
			<?php _e('Unfortunately your download has expired, please renew to gain access.', 'wp-mailinglist'); ?>
			<br/><br/>
			<a style="color:white; text-decoration:none;" href="<?php echo $update_info['url']; ?>" target="_blank" title="" class="button button-primary"><?php _e('Renew Now', 'wp-mailinglist'); ?></a>
			<a style="color:black; text-decoration:none;" href="<?php echo admin_url('admin.php'); ?>?page=<?php echo $this -> sections -> settings_updates; ?>&amp;method=check" class="button button-secondary"><i class="fa-solid fa-clock-rotate-left fa-fw"></i> <?php _e('Check Again', 'wp-mailinglist'); ?></a>
			<?php if (empty($_GET['page']) || (!empty($_GET['page']) && $_GET['page'] != $this -> sections -> settings_updates)) : ?>
				<a class="button" href="<?php echo admin_url('admin.php?page=' . $this -> sections -> settings_updates); ?>"><i class="fa-solid fa-list-ul"></i> <?php _e('Changelog', 'wp-mailinglist'); ?></a>
				<a href="?newsletters_method=hideupdate&version=<?php echo $update_info['version']; ?>" class="" style="position: absolute; top: 0; right: 0; margin: 10px 10px 0 0;"><i class="fa-solid fa-xmark"></i></a>
			<?php endif; ?>
		</div>
	<?php endif; ?>
<?php else : ?>
	<div class="update-nag newsletters-update-nag-wrapper">
		<span class="newsletters-update-nag"></span> <?php echo sprintf(__('%s plugin %s is available.', 'wp-mailinglist'), $this -> name, $update_info['version']); ?><br/>
		<?php _e('You can update automatically or download to install manually.', 'wp-mailinglist'); ?>
		<br/><br/>
		<a href="<?php echo $upgrade_url; ?>" title="" class="button-primary"><i class="fa-solid fa-wand-magic-sparkles"></i> <?php _e('Update Automatically', 'wp-mailinglist'); ?></a>
		<a target="_blank" href="https://wordpress.org/plugins/newsletters-lite/" title="" class="button-secondary"><i class="fa-solid fa-download"></i> <?php _e('Download', 'wp-mailinglist'); ?></a>
		<a style="color:black; text-decoration:none;" href="<?php echo admin_url('admin.php'); ?>?page=<?php echo $this -> sections -> settings_updates; ?>&amp;method=check" class="button button-secondary"><i class="fa-solid fa-clock-rotate-left fa-fw"></i> <?php _e('Check Again', 'wp-mailinglist'); ?></a>
		<?php if (empty($_GET['page']) || (!empty($_GET['page']) && $_GET['page'] != $this -> sections -> settings_updates)) : ?>
			<a class="button" href="<?php echo admin_url('admin.php?page=' . $this -> sections -> settings_updates); ?>"><i class="fa-solid fa-list-ul"></i> <?php _e('Changelog', 'wp-mailinglist'); ?></a>
			<a href="?newsletters_method=hideupdate&version=<?php echo $update_info['version']; ?>" class="" style="position: absolute; top: 0; right: 0; margin: 10px 10px 0 0;"><i class="fa-solid fa-xmark"></i></a>
		<?php endif; ?>
	</div>
<?php endif; ?>