Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/hostinge.../includes/Admin
File: Hooks.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Hostinger\Admin;
[2] Fix | Delete
[3] Fix | Delete
use Hostinger\Helper;
[4] Fix | Delete
use Hostinger\WpHelper\Utils;
[5] Fix | Delete
[6] Fix | Delete
defined( 'ABSPATH' ) || exit;
[7] Fix | Delete
[8] Fix | Delete
class Hooks {
[9] Fix | Delete
/**
[10] Fix | Delete
* @var Helper
[11] Fix | Delete
*/
[12] Fix | Delete
private Helper $helper;
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* @var Utils
[16] Fix | Delete
*/
[17] Fix | Delete
private Utils $utils;
[18] Fix | Delete
[19] Fix | Delete
public function __construct( $utils ) {
[20] Fix | Delete
$this->helper = new Helper();
[21] Fix | Delete
$this->utils = $utils ?? new Utils();
[22] Fix | Delete
add_action( 'admin_footer', array( $this, 'rate_plugin' ) );
[23] Fix | Delete
add_action( 'admin_init', array( $this, 'message_about_plugin_split' ) );
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* @return void
[28] Fix | Delete
*/
[29] Fix | Delete
public function rate_plugin(): void {
[30] Fix | Delete
if ( ! $this->utils->isThisPage( 'wp-admin/admin.php?page=' . Menu::MENU_SLUG ) ) {
[31] Fix | Delete
return;
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
require_once HOSTINGER_ABSPATH . 'includes/Admin/Views/Partials/RateUs.php';
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function message_about_plugin_split(): void {
[38] Fix | Delete
if ( $this->helper->should_plugin_split_notice_shown() ) {
[39] Fix | Delete
add_action( 'admin_notices', array( $this, 'custom_admin_notice' ) );
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
public function custom_admin_notice() {
[44] Fix | Delete
?>
[45] Fix | Delete
<div id="hostinger-plugin-split-notice" class="hts-plugin-split notice is-dismissible">
[46] Fix | Delete
<h2><?php echo esc_html__( 'Hostinger plugin updates', 'hostinger' ); ?></h2>
[47] Fix | Delete
<p><?php echo esc_html__( 'The Hostinger plugin has been split into two different plugins:', 'hostinger' ); ?></p>
[48] Fix | Delete
<ul>
[49] Fix | Delete
<li><strong><?php echo esc_html__( 'Hostinger Tools', 'hostinger' ); ?></strong> <?php echo esc_html__( 'offers a toolkit for easier site maintenance.', 'hostinger' ); ?></li>
[50] Fix | Delete
<li><strong><?php echo esc_html__( 'Hostinger Easy Onboarding', 'hostinger' ); ?></strong> <?php echo esc_html__( 'provides guidance and learning resources for beginners to get started with building a site using WordPress.', 'hostinger' ); ?></li>
[51] Fix | Delete
</ul>
[52] Fix | Delete
<button id="plugin-split-close" type="button" class="plugin-split-close notice-dismiss"><?php echo esc_html__( 'Got it', 'hostinger' ); ?></button>
[53] Fix | Delete
</div>
[54] Fix | Delete
<?php
[55] Fix | Delete
wp_nonce_field( 'hts_close_plugin_split', 'hts_close_plugin_split_nonce', true );
[56] Fix | Delete
}
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function