<?php
namespace ILJ\Backend;
use ILJ\Core\Options;
use ILJ\Helper\Help;
/**
* Rating notifier
*
* Responsible for the rating notification on the backend
*
* @package ILJ\Backend
*
* @since 1.2.0
*/
class RatingNotifier
{
/**
* Initializes the rating notifier
*
* @return void
* @since 1.2.0
*/
public static function init()
{
$rating_notification_base = User::getRatingNotificationBaseDate();
if ($rating_notification_base > new \DateTime(‘now’) || !User::canShowRatingNotification()) {
return;
}
add_action(‘admin_notices’, array(‘\ILJ\Backend\RatingNotifier’, ‘registerNotifier’));
add_action(‘admin_enqueue_scripts’, array(‘\ILJ\Backend\RatingNotifier’, ‘registerAssets’));
}
/**
* Registers all assets for the frontend rating notification
*
* @return void
* @since 1.2.0
*/
public static function registerAssets()
{
\ILJ\Helper\Loader::enqueue_script(‘ilj_index_rating_notification’, ILJ_URL . ‘admin/js/ilj_rating_notification.js’, array(), ILJ_VERSION);
}
/**
* Responsible for the notifier screen in the admin dashboard
*
* @since 1.2.0
*
* @return void
*/
public static function registerNotifier()
{
?>
<div class=”notice notice-info is-dismissible”>
<p>
<strong><?php
esc_attr_e(”);
?></strong>
</p>
<p>
<?php
esc_html_e(”);
?>
<?php
esc_html_e(”);
?>
</p>
<p>
<?php
echo wp_kses(__(”), array(‘strong’ => array()));
?>
</p>
<p>
<?php
esc_html_e(”);
?>
</p>
<div style=”margin-bottom: 15px;”>
<a class=”button button-primary”
style=”margin-right: 15px;”
href=”<?php
echo esc_url(‘https://wordpress.org/support/plugin/internal-links/reviews/#new-post’);
?>” target=”_blank” rel=”noopener”>
<span class=”dashicons dashicons-thumbs-up” style=”line-height:28px;”></span> <?php
esc_html_e(”, ”);
?>
</a>
<a class=”ilj-rating-notification-add button”
style=”background:none;margin-right: 15px;”
href=”#”
data-add=”5″>
<span class=”dashicons dashicons-backup” style=”line-height:28px;”></span>
<?php
esc_html_e(”, ”);
?>
</a>
<a class=”ilj-rating-notification-add button”
style=”background:none;”
href=”#”
data-add=”-1″>
<?php
esc_html_e(”, ”);
?>
</a>
</div>
</div>
<?php
}
}