'.esc_html($softaculous_pro_error).'

'; } if(!empty($softaculous_pro_msg)){ echo '

'.esc_html($softaculous_pro_msg).'

'; } echo '
'.__('Tours', 'softaculous-pro').'
   '.__('Assistant', 'softaculous-pro').'
   '.__('WordPress Sidebar', 'softaculous-pro').'
   '.__('WordPress admin Dashboard', 'softaculous-pro').'
   '.__('Plugins Management', 'softaculous-pro').'
   '.__('Themes Management', 'softaculous-pro').'
   '.__('Pages Management', 'softaculous-pro').'
   '.__('Posts Management', 'softaculous-pro').'
   '.__('Users Management', 'softaculous-pro').'
'.__('Recommended Features', 'softaculous-pro').'
'.__('Show More', 'softaculous-pro').'
'; foreach($spro_features as $feature => $info){ foreach($info['plugin'] as $data){ if(empty($data['featured'])) continue; $i_pending = $a_pending = 0; if(!empty($data['plugin_init'])){ if(empty($installed_plugins[$data['plugin_init']])){ $i_pending = 1; }elseif(!is_plugin_active($data['plugin_init'])){ $a_pending = 1; } } if(!empty($data['plugin_init_pro'])){ if(empty($installed_plugins[$data['plugin_init_pro']])){ $i_pending = 1; }elseif(!is_plugin_active($data['plugin_init_pro'])){ $a_pending = 1; } } echo '
'.$info['name'].'
'.$info['info'].'
'; if(!empty($i_pending)){ echo ''; }elseif(!empty($a_pending)){ echo ''; }else{ echo ' '.__('Active', 'softaculous-pro').''; } echo '
'; } } echo '
'.__('Settings', 'softaculous-pro').'
'.__('AI', 'softaculous-pro'). (!empty($ai_tokens) ? ' '.($ai_tokens['remaining_tokens'] < 0 ? 0 : esc_html(number_format((int)$ai_tokens['remaining_tokens']))).' tokens remaining' : ''). ''.__('Buy AI Tokens', 'softaculous-pro').'
'; softaculous_pro_footer(); } function softaculous_pro_header($is_home = 1){ global $softaculous_pro; echo '
'; softaculous_pro_license_notice(); } function softaculous_pro_footer(){ global $softaculous_pro; echo '
'; if(!empty($softaculous_pro['branding']['default_hf_bg'])){ echo ' '; } if(!empty($softaculous_pro['branding']['default_hf_text'])){ echo ' '; } } function softaculous_pro_assistant(){ global $softaculous_pro_error, $softaculous_pro_msg, $spro_tour_status, $spro_tours, $spro_tour_content, $spro_load_tour; $spro_load_tour = softaculous_pro_can_enqueue_assets(); if(empty($spro_load_tour)){ return true; } include_once(SOFTACULOUS_PRO_PLUGIN_PATH.'main/intros.php'); if(empty($spro_tour_content[$spro_load_tour])){ return true; } return softaculous_pro_assistant_theme(); } function softaculous_pro_assistant_theme(){ global $softaculous_pro_error, $softaculous_pro_msg, $spro_tour_status, $spro_tours, $spro_tour_content, $spro_load_tour; echo ' '; } function softaculous_pro_wp_ajax(){ global $spro_tours, $spro_manage_features; if(!current_user_can('manage_options') || !isset($_POST['softaculous_pro_security']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['softaculous_pro_security'])), 'softaculous_pro_js_nonce')){ wp_send_json_error('Security Check Failed!'); } if(isset($_REQUEST['tour_done'])){ $user_id = get_current_user_id(); $meta_key = 'spro_tour_status'; $spro_tour_status = get_user_meta($user_id, $meta_key, true); if(empty($spro_tour_status)){ $spro_tour_status = array(); } $tour_done = softaculous_pro_optREQ('tour_done'); if(!empty($spro_tours[$tour_done])){ $spro_tour_status[$tour_done]['done'] = 1; update_user_meta($user_id, $meta_key, $spro_tour_status); } } if(isset($_REQUEST['softaculous_pro_update_option'])){ $softaculous_pro_settings = get_option('softaculous_pro_settings', array()); $option_name = softaculous_pro_optREQ('option_name'); $option_value = softaculous_pro_optREQ('option_value'); // Setting up the trainsiet to delete the history if($option_name === 'ai_history_duration' && $option_value > 1){ wp_schedule_event(time(), 'daily', 'softaculous_pro_ai_history_cron'); } else if(($option_name === 'disable_ai' && empty($option_value)) || ($option_name === 'ai_history_duration')){ wp_clear_scheduled_hook('softaculous_pro_ai_history_cron'); } $softaculous_pro_settings[$option_name] = $option_value; update_option('softaculous_pro_settings', $softaculous_pro_settings); } if(isset($_REQUEST['softaculous_pro_onboarding_notice_dismiss'])){ update_option('softaculous_pro_onboarding_notice_dismiss', time()); } if(isset($_REQUEST['softaculous_pro_ai_notice_dismiss'])){ update_option('softaculous_pro_ai_notice_dismiss', time()); } if(isset($_REQUEST['softaculous_pro_ai_token_notice_dismiss'])){ update_option('softaculous_pro_ai_token_notice_dismiss', time()); } if(isset($_REQUEST['softaculous_pro_install_plugin']) && current_user_can('install_plugins')){ include_once(SOFTACULOUS_PRO_PLUGIN_PATH.'main/onboarding.php'); $spro_manage_features = spro_get_features_list(); $ftp_form_url = wp_nonce_url(admin_url('admin-ajax.php'), 'filesystem-ajax-nonce'); ob_start(); // Check if FTP is required $have_credentials = request_filesystem_credentials($ftp_form_url); if(false === $have_credentials){ $form_html = ob_get_clean(); $ftp_modal = '
'; wp_send_json_error(['form' => $ftp_modal]); } ob_end_clean(); // Just in case there was any output till now it will be cleaned. $install_plugin = softaculous_pro_optREQ('plugin'); foreach($spro_manage_features as $feature => $info){ if(!empty($info['plugin'][$install_plugin])){ spro_install_required_plugin($install_plugin, $info['plugin'][$install_plugin]); break; } } } } // Ajax to dismiss the expiry notice function softaculous_pro_dismiss_expiry_notice(){ check_admin_referer('softaculous_pro_expiry_notice', 'security'); if(!current_user_can('activate_plugins')){ wp_send_json_error(__('You do not have required access to do this action', 'backuply')); } update_option('softaculous_expired_licenses', time()); wp_send_json_success(); } function softaculous_pro_update_notice_filter($plugins = []){ $plugins['softaculous-pro/softaculous-pro.php'] = 'SoftWP'; return $plugins; } function softaculous_pro_update_plugin_notice(){ if(defined('SOFTACULOUS_PLUGIN_UPDATE_NOTICE')){ return; } $to_update_plugins = apply_filters('softaculous_plugin_update_notice', []); if(empty($to_update_plugins)){ return; } /* translators: %1$s is replaced with a "string" of name of plugins, and %2$s is replaced with "string" which can be "is" or "are" based on the count of the plugin */ $msg = sprintf(__('New versions of %1$s %2$s available. Updating ensures better performance, security, and access to the latest features.', 'softaculous-pro'), ''.esc_html(implode(', ', $to_update_plugins)).'', (count($to_update_plugins) > 1 ? 'are' : 'is')) . ' Update Now'; define('SOFTACULOUS_PLUGIN_UPDATE_NOTICE', true); // To make sure other plugins don't return a Notice echo '

'.$msg. '

'; wp_register_script('softaculous-pro-update-notice', '', ['jquery'], '', true); wp_enqueue_script('softaculous-pro-update-notice'); wp_add_inline_script('softaculous-pro-update-notice', 'jQuery("#softaculous-pro-plugin-update-notice").on("click", function(e){ let target = jQuery(e.target); if(!target.hasClass("notice-dismiss")){ return; } var data; // Hide it jQuery("#softaculous-pro-plugin-update-notice").hide(); // Save this preference jQuery.post("'.admin_url('admin-ajax.php?action=softaculous_pro_close_update_notice').'&security='.wp_create_nonce('softaculous_pro_promo_nonce').'", data, function(response) { //alert(response); }); });'); } function softaculous_pro_close_update_notice(){ check_admin_referer('softaculous_pro_promo_nonce', 'security'); if(!current_user_can('manage_options')){ wp_send_json_error('You don\'t have privilege to close this notice!'); } $plugin_update_notice = get_option('softaculous_plugin_update_notice', []); $available_update_list = get_site_transient('update_plugins'); $to_update_plugins = apply_filters('softaculous_plugin_update_notice', []); if(empty($available_update_list) || empty($available_update_list->response)){ return; } foreach($to_update_plugins as $plugin_path => $plugin_name){ if(isset($available_update_list->response[$plugin_path])){ $plugin_update_notice[$plugin_path] = $available_update_list->response[$plugin_path]->new_version; } } update_option('softaculous_plugin_update_notice', $plugin_update_notice); }