PluginProbe
Hostinger Tools / trunk
Hostinger Tools vtrunk
3.0.78 3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 All 109 releases
hostinger / includes / Admin / Hooks.php

Hooks.php in Hostinger Tools trunk, at includes/Admin/Hooks.php

61 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Hostinger\Admin;
4
5 use Hostinger\Helper;
6 use Hostinger\WpHelper\Utils;
7
8 defined( 'ABSPATH' ) || exit;
9
10 class Hooks {
11 /**
12 * @var Helper
13 */
14 private Helper $helper;
15
16 /**
17 * @var Utils
18 */
19 private Utils $utils;
20
21 public function __construct( $utils ) {
22 $this->helper = new Helper();
23 $this->utils = $utils ?? new Utils();
24 add_action( 'admin_footer', array( $this, 'rate_plugin' ) );
25 add_filter( 'wp_kses_allowed_html', array( $this, 'custom_kses_allowed_html' ), 10, 1 );
26 }
27
28 /**
29 * @return void
30 */
31 public function rate_plugin(): void {
32 $admin_path = parse_url( admin_url(), PHP_URL_PATH );
33
34 if ( ! $this->utils->isThisPage( $admin_path . 'admin.php?page=' . Menu::MENU_SLUG ) ) {
35 return;
36 }
37
38 require_once HOSTINGER_ABSPATH . 'includes/Admin/Views/Partials/RateUs.php';
39 }
40
41
42
43 public function custom_kses_allowed_html( $allowed ) {
44 $allowed['svg'] = array(
45 'xmlns' => true,
46 'width' => true,
47 'height' => true,
48 'viewBox' => true,
49 'fill' => true,
50 'style' => true,
51 'class' => true,
52 );
53 $allowed['path'] = array(
54 'd' => true,
55 'fill' => true,
56 );
57
58 return $allowed;
59 }
60 }
61