| Server IP : 64.225.102.56 / Your IP : 216.73.216.220 Web Server : Apache/2.4.68 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 System : Linux smtp.zejefoy.com 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 User : auto ( 1002) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/auto/web/cifisoa.com/public_html/wp-content/plugins/the-post-grid/app/Helpers/ |
Upload File : |
<?php
/**
* Install Helper class.
*
* @package RT_TPG
*/
namespace RT\ThePostGrid\Helpers;
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
exit( 'This script cannot be accessed directly.' );
}
/**
* Install Helper class.
*/
class Install {
public static function activate() {
self::insertDefaultData();
self::create_cron_jobs();
add_option( 'rttpg_activation_redirect', true );
}
public static function deactivate() {
update_option( 'tpg_flush_rewrite_rules', 0 );
self::clean_cron_jobs();
}
/**
* Inset default data
*
* @return void
*/
public static function insertDefaultData() {
update_option( rtTPG()->options['installed_version'], RT_THE_POST_GRID_VERSION );
if ( ! get_option( rtTPG()->options['settings'] ) ) {
update_option( rtTPG()->options['settings'], rtTPG()->defaultSettings );
}
if ( get_option( 'elementor_experiment-e_optimized_assets_loading' ) ) {
update_option( 'elementor_experiment-e_optimized_assets_loading', 'default' );
}
if ( get_option( 'elementor_experiment-e_optimized_css_loading' ) ) {
update_option( 'elementor_experiment-e_optimized_css_loading', 'default' );
}
}
public static function clean_cron_jobs() {
// Un-schedules all previously-scheduled cron jobs
wp_clear_scheduled_hook( 'rttpg_daily_scheduled_events' );
}
/**
* Create cron jobs (clear them first)
*
* @return void
*/
private static function create_cron_jobs() {
self::clean_cron_jobs();
if ( ! wp_next_scheduled( 'rttpg_daily_scheduled_events' ) ) {
$ve = get_option( 'gmt_offset' ) > 0 ? '-' : '+';
$expire_time = strtotime( '00:00 tomorrow ' . $ve . absint( get_option( 'gmt_offset' ) ) . ' HOURS' ); //00:00 tomorrow -6 HOURS
wp_schedule_event( $expire_time, 'daily', 'rttpg_daily_scheduled_events' );
}
}
}