🤖

BoostBot — נדרש שדרוג גרסת PHP

תוסף BoostBot דורש גרסת PHP ומעלה כדי לפעול.
השרת שלך מריץ כרגע גרסה , שאינה נתמכת.

🔧 מה צריך לעשות?

  1. פנה לספק האחסון שלך (חברת ה-Hosting) ובקש שדרוג ל-PHP ומעלה.
  2. אם יש לך גישה ל-cPanel, חפש את האפשרות "Select PHP Version" או "PHP Manager".
  3. לאחר השדרוג, הפעל מחדש את התוסף — והוא יעבוד מיד! ✨

💡 טיפ: מומלץ לעבור ל-PHP 8.1 או 8.2 לביצועים הטובים ביותר ולאבטחה מעודכנת.

' . '

🤖 BoostBot — לא ניתן להפעיל את התוסף

' . '

' . 'תוסף BoostBot דורש גרסת PHP 8.0 ומעלה.' . '
השרת שלך מריץ כרגע גרסה ' . esc_html( PHP_VERSION ) . '.' . '

' . '

🔧 מה צריך לעשות?

' . '
    ' . '
  1. פנה לספק האחסון שלך (חברת ה-Hosting) ובקש שדרוג ל-PHP 8.0 ומעלה.
  2. ' . '
  3. אם יש לך גישה ל-cPanel, חפש את האפשרות "Select PHP Version" או "PHP Manager".
  4. ' . '
  5. לאחר השדרוג, חזור לכאן והפעל מחדש את התוסף ✨
  6. ' . '
' . '

💡 טיפ: מומלץ לעבור ל-PHP 8.1 או 8.2 לביצועים הטובים ביותר ולאבטחה מעודכנת.

' . '', 'BoostBot — PHP Version Error', array( 'back_link' => true ) ); } register_activation_hook( __FILE__, 'boostbot_php_version_activation_check' ); // Stop loading the plugin entirely — do not proceed to PHP 8.0+ code. return; } /** * Plugin version. */ define( 'BOOSTBOT_VERSION', '2.2.23' ); /** * Plugin directory path. */ define( 'BOOSTBOT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /** * Plugin directory URL. */ define( 'BOOSTBOT_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /** * Plugin basename. */ define( 'BOOSTBOT_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /** * Minimum PHP version. */ define( 'BOOSTBOT_MIN_PHP_VERSION', '8.0' ); /** * Minimum WordPress version. */ define( 'BOOSTBOT_MIN_WP_VERSION', '6.2' ); /** * Database version for schema updates. */ // Multilingual: language column on entity tables. // 1.1.3: WooCommerce tables and bundles language column. // Bump DB version to trigger BoostBot_Activator::upgrade_db() on existing installs. define( 'BOOSTBOT_DB_VERSION', '1.2.0' ); /** * Self-hosted flag. * * When true, the plugin uses its own update server (boostbot.boostmedia.co.il). * When false (default), updates come from WordPress.org. * The release script sets this to true in self-hosted ZIP builds. */ if ( ! defined( 'BOOSTBOT_SELF_HOSTED' ) ) { define( 'BOOSTBOT_SELF_HOSTED', false ); } /** * Debug mode - set to false in production. */ if ( ! defined( 'BOOSTBOT_DEBUG' ) ) { define( 'BOOSTBOT_DEBUG', false ); } /** * Check system requirements before loading. * * @return bool */ function boostbot_check_requirements() { $errors = array(); // Check PHP version. if ( version_compare( PHP_VERSION, BOOSTBOT_MIN_PHP_VERSION, '<' ) ) { $errors[] = sprintf( /* translators: 1: Required PHP version, 2: Current PHP version */ __( 'BoostBot requires PHP version %1$s or higher. You are running version %2$s.', 'boostbot' ), BOOSTBOT_MIN_PHP_VERSION, PHP_VERSION ); } // Check WordPress version. global $wp_version; if ( version_compare( $wp_version, BOOSTBOT_MIN_WP_VERSION, '<' ) ) { $errors[] = sprintf( /* translators: 1: Required WordPress version, 2: Current WordPress version */ __( 'BoostBot requires WordPress version %1$s or higher. You are running version %2$s.', 'boostbot' ), BOOSTBOT_MIN_WP_VERSION, $wp_version ); } // Display errors if any. if ( ! empty( $errors ) ) { add_action( 'admin_notices', function() use ( $errors ) { foreach ( $errors as $error ) { printf( '

%s

', esc_html( $error ) ); } } ); return false; } return true; } /** * Load the autoloader. */ require_once BOOSTBOT_PLUGIN_DIR . 'includes/class-autoloader.php'; if ( defined( 'BOOSTBOT_SELF_HOSTED' ) && BOOSTBOT_SELF_HOSTED ) { if ( file_exists( BOOSTBOT_PLUGIN_DIR . 'boostaffiliate.php' ) ) { require_once BOOSTBOT_PLUGIN_DIR . 'boostaffiliate.php'; BoostAffiliate::init( __FILE__, BOOSTBOT_VERSION ); } } /** * Begin plugin execution. * * @since 1.0.0 */ function boostbot_run() { // Check requirements first. if ( ! boostbot_check_requirements() ) { return; } // Initialize autoloader. BoostBot_Autoloader::init(); // Load utilities first (needed by other classes). require_once BOOSTBOT_PLUGIN_DIR . 'includes/utilities/functions.php'; // DB upgrades (safe): run schema updates on version bump without requiring de/activation. // Wrapped in try/catch so a migration failure NEVER crashes the site. if ( class_exists( 'BoostBot_Activator' ) && BoostBot_Activator::needs_db_upgrade() ) { try { BoostBot_Activator::upgrade_db(); } catch ( \Throwable $e ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- boot-path catch block; Logger may not be loaded yet. error_log( '[BoostBot][DB Upgrade] Fatal during upgrade: ' . $e->getMessage() ); } } // JWT secret sync: runs once per plugin version upgrade (non-blocking). // Only runs when cloud calls are permitted (WP.org builds require opt-in), // mirroring the activation-path gate — the sync makes an external HTTP call // and writes wp-config.php, so it must respect the same cloud-consent gate. // Wrapped in try/catch so a sync failure NEVER crashes the site. $jwt_sync_version = get_option( 'boostbot_jwt_sync_version', '' ); if ( $jwt_sync_version !== BOOSTBOT_VERSION && class_exists( 'BoostBot_Activator' ) && BoostBot_Activator::is_cloud_service_allowed() ) { try { // Only mark this version as synced when the sync actually succeeds; // otherwise a transient failure would permanently skip future syncs. if ( true === BoostBot_Activator::sync_jwt_secret() ) { update_option( 'boostbot_jwt_sync_version', BOOSTBOT_VERSION ); } } catch ( \Throwable $e ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- boot-path catch block; Logger may not be loaded yet. error_log( '[BoostBot][JWT Sync] Fatal during sync: ' . $e->getMessage() ); } } // Get the main plugin instance (singleton — using new BoostBot() here would // create a second instance that re-registers hooks/cron). $plugin = BoostBot::get_instance(); $plugin->run(); } /** * Plugin activation hook. */ function boostbot_activate() { // Load autoloader for activation. require_once BOOSTBOT_PLUGIN_DIR . 'includes/class-autoloader.php'; BoostBot_Autoloader::init(); // Load utilities. require_once BOOSTBOT_PLUGIN_DIR . 'includes/utilities/functions.php'; // Run activation. Wrapped in try/catch so activation failures don't crash the site. try { BoostBot_Activator::activate(); } catch ( \Throwable $e ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- boot-path catch block; Logger may not be loaded yet. error_log( '[BoostBot][Activation] Fatal during activation: ' . $e->getMessage() ); } // Sync JWT secret from backend (non-fatal if it fails). // For WP.org builds, only sync if user has opted in to cloud service. if ( BoostBot_Activator::is_cloud_service_allowed() ) { try { BoostBot_Activator::sync_jwt_secret(); } catch ( \Throwable $e ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- boot-path catch block; Logger may not be loaded yet. error_log( '[BoostBot][JWT Sync] Fatal during activation sync: ' . $e->getMessage() ); } update_option( 'boostbot_jwt_sync_version', BOOSTBOT_VERSION ); } } register_activation_hook( __FILE__, 'boostbot_activate' ); /** * Plugin deactivation hook. */ function boostbot_deactivate() { // Load autoloader for deactivation. require_once BOOSTBOT_PLUGIN_DIR . 'includes/class-autoloader.php'; BoostBot_Autoloader::init(); // Run deactivation. BoostBot_Deactivator::deactivate(); } register_deactivation_hook( __FILE__, 'boostbot_deactivate' ); // Initialize the plugin after WordPress has loaded. add_action( 'plugins_loaded', 'boostbot_run' ); /** * Debug logging for development. * Outputs to browser console when BOOSTBOT_DEBUG is true. */ if ( BOOSTBOT_DEBUG ) { add_action( 'admin_footer', 'boostbot_debug_output' ); add_action( 'wp_footer', 'boostbot_debug_output' ); } /** * Output debug information to console. */ function boostbot_debug_output() { if ( ! BOOSTBOT_DEBUG ) { return; } // Only show to administrators. if ( ! current_user_can( 'manage_options' ) ) { return; } // License check debug $license_manager = class_exists( 'BoostBot_License_Manager' ) ? new BoostBot_License_Manager() : null; $debug_data = array( 'hooks_registered' => has_action( 'rest_api_init' ), 'version' => BOOSTBOT_VERSION, 'file_version' => 'v6.0-fix-license-check', // Change this to verify file is updated ); $widget_debug = array( 'is_admin' => is_admin(), 'is_front_page' => is_front_page(), 'is_home' => is_home(), 'page_id' => get_the_ID(), 'is_pro' => $license_manager ? $license_manager->is_pro() : 'NO_MANAGER', 'dev_mode' => $license_manager ? $license_manager->is_dev_mode() : 'NO_MANAGER', 'license_status' => $license_manager ? $license_manager->get_license_status() : 'NO_MANAGER', ); $js_parts = array(); $js_parts[] = 'console.log("%c\\ud83e\\udd16 BoostBot Debug Logs","background:#3BC2D0;color:white;padding:4px 8px;border-radius:4px;font-weight:bold;");'; if ( class_exists( 'BoostBot_Logger' ) && method_exists( 'BoostBot_Logger', 'get_console_logs' ) ) { foreach ( BoostBot_Logger::get_console_logs() as $log ) { $js_parts[] = sprintf( 'console.log("[%s] %s",%s);', esc_js( $log['time'] ), esc_js( $log['message'] ), wp_json_encode( $log['context'] ) ); } } $js_parts[] = sprintf( 'console.log("[%s] BoostBot plugin running",%s);', esc_js( gmdate( 'Y-m-d H:i:s' ) ), wp_json_encode( $debug_data ) ); $js_parts[] = sprintf( 'console.log("\\ud83d\\udd0d Widget Debug:",%s);', wp_json_encode( $widget_debug ) ); $handle = is_admin() ? 'boostbot-admin' : 'boostbot-widget'; wp_add_inline_script( $handle, implode( "\n", $js_parts ) ); }