| Server IP : 146.59.209.152 / Your IP : 216.73.216.152 Web Server : Apache System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : monpetu ( 144298) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/monpetu/www/ipprint/wp-content/plugins/surerank/inc/modules/nudges/ |
Upload File : |
<?php
/**
* Nudges Init class
*
* Handles the initialization and hooks for our pro nudges functionality.
*
* @package SureRank\Inc\Modules\Nudges
* @since 1.5.0
*/
namespace SureRank\Inc\Modules\Nudges;
use SureRank\Inc\Traits\Get_Instance;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Init class
*
* Handles initialization and WordPress hooks for our pro nudges functionality.
*/
class Init {
use Get_Instance;
/**
* Constructor
*/
public function __construct() {
add_filter( 'surerank_api_controllers', [ $this, 'register_api_controller' ], 20 );
add_filter( 'surerank_globals_localization_vars', [ $this, 'add_localization_vars' ] );
}
/**
* Add localization variables for nudges.
*
* @param array<string,mixed> $vars Localization variables.
* @return array<string,mixed> Updated localization variables.
* @since 1.5.0
*/
public function add_localization_vars( array $vars ) {
return array_merge(
$vars,
[
'is_pro_active' => Utils::get_instance()->is_pro_active(),
]
);
}
/**
* Register API controller for this module.
*
* @param array<string> $controllers Existing controllers.
* @return array<string> Updated controllers.
* @since 1.5.0
*/
public function register_api_controller( $controllers ) {
$controllers[] = '\SureRank\Inc\Modules\Nudges\Api';
return $controllers;
}
}