| 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
/**
* Utils class.
*
* @package SureRank\Inc\Modules\Nudges
* @since 1.5.0
*/
namespace SureRank\Inc\Modules\Nudges;
use SureRank\Inc\Traits\Get_Instance;
use WP_Error;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* The Utils class.
*
* @package SureRank\Inc\Modules\Nudges
* @since 1.5.0
*/
class Utils {
use Get_Instance;
/**
* Check if Pro version is active.
*
* @return bool True if pro is active, false otherwise.
*/
public function is_pro_active() {
return defined( 'SURERANK_PRO_VERSION' );
}
/**
* Get Pro Nudges.
*
* @return array<string, array<string, mixed>>
*/
public function get_nudges() {
$nudges = get_option( SURERANK_NUDGES, [] );
if ( empty( $nudges ) ) {
return [];
}
foreach ( $nudges as $key => $nudge ) {
if ( isset( $nudge['display'] ) && $nudge['display'] === false ) {
continue;
}
if ( isset( $nudge['next_time_to_display'] ) && time() < $nudge['next_time_to_display'] ) {
$nudges[ $key ]['display'] = false;
}
}
return $nudges;
}
}