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
add_filter( 'wp_kses_allowed_html', array( $this, 'custom_kses_allowed_html' ), 10, 1 );
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* @return void
[29] Fix | Delete
*/
[30] Fix | Delete
public function rate_plugin(): void {
[31] Fix | Delete
$admin_path = parse_url( admin_url(), PHP_URL_PATH );
[32] Fix | Delete
[33] Fix | Delete
if ( ! $this->utils->isThisPage( $admin_path . 'admin.php?page=' . Menu::MENU_SLUG ) ) {
[34] Fix | Delete
return;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
require_once HOSTINGER_ABSPATH . 'includes/Admin/Views/Partials/RateUs.php';
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
public function message_about_plugin_split(): void {
[41] Fix | Delete
if ( $this->helper->should_plugin_split_notice_shown() ) {
[42] Fix | Delete
add_action( 'admin_notices', array( $this, 'custom_admin_notice' ) );
[43] Fix | Delete
}
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
public function custom_admin_notice() {
[47] Fix | Delete
?>
[48] Fix | Delete
<div id="hostinger-plugin-split-notice" class="hts-plugin-split notice is-dismissible">
[49] Fix | Delete
<h2><?php echo esc_html__( 'Hostinger plugin updates', 'hostinger' ); ?></h2>
[50] Fix | Delete
<p><?php echo esc_html__( 'The Hostinger plugin has been split into two different plugins:', 'hostinger' ); ?></p>
[51] Fix | Delete
<ul>
[52] 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>
[53] 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>
[54] Fix | Delete
</ul>
[55] Fix | Delete
<button id="plugin-split-close" type="button" class="plugin-split-close notice-dismiss"><?php echo esc_html__( 'Got it', 'hostinger' ); ?></button>
[56] Fix | Delete
</div>
[57] Fix | Delete
<?php
[58] Fix | Delete
wp_nonce_field( 'hts_close_plugin_split', 'hts_close_plugin_split_nonce', true );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
public function custom_kses_allowed_html( $allowed ) {
[62] Fix | Delete
$allowed['svg'] = array(
[63] Fix | Delete
'xmlns' => true,
[64] Fix | Delete
'width' => true,
[65] Fix | Delete
'height' => true,
[66] Fix | Delete
'viewBox' => true,
[67] Fix | Delete
'fill' => true,
[68] Fix | Delete
'style' => true,
[69] Fix | Delete
'class' => true,
[70] Fix | Delete
);
[71] Fix | Delete
$allowed['path'] = array(
[72] Fix | Delete
'd' => true,
[73] Fix | Delete
'fill' => true,
[74] Fix | Delete
);
[75] Fix | Delete
[76] Fix | Delete
return $allowed;
[77] Fix | Delete
}
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function