PluginProbe
Hostinger Tools / 2.2.4
Hostinger Tools v2.2.4
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 2.0.4 All 108 releases
hostinger / includes / Hooks.php

Hooks.php in Hostinger Tools 2.2.4, at includes/Hooks.php

41 lines 865 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Hostinger;
4
5 defined( 'ABSPATH' ) || exit;
6
7 class Hooks {
8
9 public function __construct() {
10 add_action( 'init', array( $this, 'check_url_and_flush_rules' ) );
11 }
12
13 public function check_url_and_flush_rules() {
14 if ( defined( 'DOING_AJAX' ) && \DOING_AJAX ) {
15 return false;
16 }
17
18 $current_url = home_url( add_query_arg( null, null ) );
19 $url_components = wp_parse_url( $current_url );
20
21 if ( isset( $url_components['query'] ) ) {
22 parse_str( $url_components['query'], $params );
23
24 if ( isset( $params['app_name'] ) ) {
25 $app_name = sanitize_text_field( $params['app_name'] );
26
27 if ( $app_name === 'Omnisend App' ) {
28 if ( function_exists( 'flush_rewrite_rules' ) ) {
29 flush_rewrite_rules();
30 }
31
32 if ( has_action( 'litespeed_purge_all' ) ) {
33 do_action( 'litespeed_purge_all' );
34 }
35 }
36 }
37 }
38 }
39
40 }
41