Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/core/componen...
File: SupportCenter.php
if ( $this->current_user_can( 'et_support_center_safe_mode' ) ) {
[3000] Fix | Delete
[3001] Fix | Delete
$card_title = esc_html__( 'Safe Mode', 'et-core' );
[3002] Fix | Delete
$card_content = __( '<p>Enabling <strong>Safe Mode</strong> will temporarily disable features and plugins that may be causing problems with your Elegant Themes product. This includes all Plugins, Child Themes, and Custom Code added to your integration areas. These items are only disabled for your current user session so your visitors will not be disrupted. Enabling Safe Mode makes it easy to figure out what is causing problems on your website by identifying or eliminating third party plugins and code as potential causes.</p>', 'et-core' );
[3003] Fix | Delete
$error_message = '';
[3004] Fix | Delete
$safe_mode_active = ( et_core_is_safe_mode_active() ) ? ' et_pb_on_state' : ' et_pb_off_state';
[3005] Fix | Delete
$plugins_list = array();
[3006] Fix | Delete
$plugins_output = '';
[3007] Fix | Delete
[3008] Fix | Delete
$has_mu_plugins_dir = wp_mkdir_p( WPMU_PLUGIN_DIR ) && wp_is_writable( WPMU_PLUGIN_DIR );
[3009] Fix | Delete
$can_create_mu_plugins_dir = wp_is_writable( WP_CONTENT_DIR ) && ! wp_mkdir_p( WPMU_PLUGIN_DIR );
[3010] Fix | Delete
[3011] Fix | Delete
if ( $has_mu_plugins_dir || $can_create_mu_plugins_dir ) {
[3012] Fix | Delete
// Gather list of plugins that will be temporarily deactivated in Safe Mode
[3013] Fix | Delete
$all_plugins = get_plugins();
[3014] Fix | Delete
$active_plugins = get_option( 'active_plugins' );
[3015] Fix | Delete
[3016] Fix | Delete
foreach ( $active_plugins as $plugin ) {
[3017] Fix | Delete
// Verify this 'active' plugin actually exists in the plugins directory
[3018] Fix | Delete
if ( ! in_array( $plugin, array_keys( $all_plugins ) ) ) {
[3019] Fix | Delete
continue;
[3020] Fix | Delete
}
[3021] Fix | Delete
[3022] Fix | Delete
// If it's not in our allowlist, add it to the list of plugins we'll disable
[3023] Fix | Delete
if ( ! in_array( $plugin, $this->safe_mode_plugins_allowlist ) ) {
[3024] Fix | Delete
$plugins_list[] = '<li>' . esc_html( $all_plugins[ $plugin ]['Name'] ) . '</li>';
[3025] Fix | Delete
}
[3026] Fix | Delete
}
[3027] Fix | Delete
[3028] Fix | Delete
} else {
[3029] Fix | Delete
$error_message = et_get_safe_localization( sprintf( __( '<p class="et-safe-mode-error">Plugins cannot be disabled because your <code>wp-content</code> directory has inconsistent file permissions. <a href="%1$s" target="_blank">Click here</a> for more information.</p>', 'et-core' ), 'https://wordpress.org/support/article/changing-file-permissions/' ) );
[3030] Fix | Delete
}
[3031] Fix | Delete
[3032] Fix | Delete
if ( count( $plugins_list ) > 0 ) {
[3033] Fix | Delete
$plugins_output = sprintf( '<p>%1$s</p><ul>%2$s</ul>',
[3034] Fix | Delete
esc_html__( 'The following plugins will be temporarily disabled for you only:', 'et-core' ),
[3035] Fix | Delete
et_core_intentionally_unescaped( implode( ' ', $plugins_list ), 'html' )
[3036] Fix | Delete
);
[3037] Fix | Delete
}
[3038] Fix | Delete
[3039] Fix | Delete
// Toggle Safe Mode activation
[3040] Fix | Delete
$card_content .= sprintf( '<div id="et_card_safe_mode" class="et-safe-mode" data-et-product="%8$s">'
[3041] Fix | Delete
. '<div class="et_safe_mode_toggle">'
[3042] Fix | Delete
. '<div class="%5$s_wrapper"><div class="%5$s %1$s">'
[3043] Fix | Delete
. '<span class="%6$s et_pb_on_value">%2$s</span>'
[3044] Fix | Delete
. '<span class="et_pb_button_slider"></span>'
[3045] Fix | Delete
. '<span class="%6$s et_pb_off_value">%3$s</span>'
[3046] Fix | Delete
. '</div></div>'
[3047] Fix | Delete
. '%4$s'
[3048] Fix | Delete
. '%7$s'
[3049] Fix | Delete
. '</div>'
[3050] Fix | Delete
. '</div>',
[3051] Fix | Delete
esc_attr( $safe_mode_active ),
[3052] Fix | Delete
esc_html__( 'Enabled', 'et-core' ),
[3053] Fix | Delete
esc_html__( 'Disabled', 'et-core' ),
[3054] Fix | Delete
$plugins_output,
[3055] Fix | Delete
'et_pb_yes_no_button',
[3056] Fix | Delete
'et_pb_value_text',
[3057] Fix | Delete
$error_message,
[3058] Fix | Delete
esc_attr( $this->parent )
[3059] Fix | Delete
);
[3060] Fix | Delete
[3061] Fix | Delete
print $this->add_support_center_card( array(
[3062] Fix | Delete
'title' => $card_title,
[3063] Fix | Delete
'content' => $card_content,
[3064] Fix | Delete
'additional_classes' => array(
[3065] Fix | Delete
'et_safe_mode',
[3066] Fix | Delete
'et-epanel-box',
[3067] Fix | Delete
),
[3068] Fix | Delete
) );
[3069] Fix | Delete
}
[3070] Fix | Delete
[3071] Fix | Delete
/**
[3072] Fix | Delete
* Run code after the 4th Support Center card has been output
[3073] Fix | Delete
*
[3074] Fix | Delete
* @since 3.20
[3075] Fix | Delete
*/
[3076] Fix | Delete
do_action( 'et_support_center_below_position_4' );
[3077] Fix | Delete
[3078] Fix | Delete
// Build Card :: Logs
[3079] Fix | Delete
if ( $this->current_user_can( 'et_support_center_logs' ) ) {
[3080] Fix | Delete
$debug_log_lines = apply_filters( 'et_debug_log_lines', 200 );
[3081] Fix | Delete
$wp_debug_log = $this->get_wp_debug_log( $debug_log_lines );
[3082] Fix | Delete
$card_title = esc_html__( 'Logs', 'et-core' );
[3083] Fix | Delete
[3084] Fix | Delete
$card_content = '<p>If you have <a href="https://codex.wordpress.org/Debugging_in_WordPress" target=_blank" >WP_DEBUG_LOG</a> enabled, WordPress related errors will be archived in a log file. For your convenience, we have aggregated the contents of this log file so that you and the Elegant Themes support team can view it easily. The file cannot be edited here.</p>';
[3085] Fix | Delete
[3086] Fix | Delete
if ( isset( $wp_debug_log['error'] ) ) {
[3087] Fix | Delete
$card_content .= '<div class="et_system_status_log_preview">'
[3088] Fix | Delete
. '<textarea>' . $wp_debug_log['error'] . '</textarea>'
[3089] Fix | Delete
. '</div>';
[3090] Fix | Delete
} else {
[3091] Fix | Delete
$card_content .= '<div class="et_system_status_log_preview">'
[3092] Fix | Delete
. '<textarea id="et_logs_display">' . $wp_debug_log['entries'] . '</textarea>'
[3093] Fix | Delete
. '<textarea id="et_logs_recent">' . $wp_debug_log['entries'] . '</textarea>'
[3094] Fix | Delete
. '</div>'
[3095] Fix | Delete
. '<div class="et_card_cta">'
[3096] Fix | Delete
. '<a href="' . content_url( 'debug.log' ) . '" class="download_debug_log" download>'
[3097] Fix | Delete
. esc_html__( 'Download Full Debug Log', 'et-core' )
[3098] Fix | Delete
. ' (' . $wp_debug_log['size'] . ')'
[3099] Fix | Delete
. '</a>'
[3100] Fix | Delete
. '<a class="copy_debug_log">'
[3101] Fix | Delete
. esc_html__( 'Copy Recent Log Entries', 'et-core' )
[3102] Fix | Delete
. '</a>'
[3103] Fix | Delete
. '</div>';
[3104] Fix | Delete
}
[3105] Fix | Delete
[3106] Fix | Delete
print $this->add_support_center_card( array(
[3107] Fix | Delete
'title' => $card_title,
[3108] Fix | Delete
'content' => $card_content,
[3109] Fix | Delete
'additional_classes' => array(
[3110] Fix | Delete
'et_system_logs',
[3111] Fix | Delete
'et-epanel-box',
[3112] Fix | Delete
),
[3113] Fix | Delete
) );
[3114] Fix | Delete
}
[3115] Fix | Delete
[3116] Fix | Delete
/**
[3117] Fix | Delete
* Run code after all of the Support Center cards have been output
[3118] Fix | Delete
*
[3119] Fix | Delete
* @since 3.20
[3120] Fix | Delete
*/
[3121] Fix | Delete
do_action( 'et_support_center_below_cards' );
[3122] Fix | Delete
[3123] Fix | Delete
?>
[3124] Fix | Delete
</div>
[3125] Fix | Delete
</div>
[3126] Fix | Delete
</div>
[3127] Fix | Delete
<div id="et-ajax-saving">
[3128] Fix | Delete
<img src="<?php echo esc_url( $this->local_path . 'admin/images/ajax-loader.gif' ); ?>" alt="loading" id="loading" />
[3129] Fix | Delete
</div>
[3130] Fix | Delete
<?php
[3131] Fix | Delete
[3132] Fix | Delete
}
[3133] Fix | Delete
[3134] Fix | Delete
/**
[3135] Fix | Delete
* SUPPORT CENTER :: DIVI HOSTING CARD
[3136] Fix | Delete
*/
[3137] Fix | Delete
[3138] Fix | Delete
/**
[3139] Fix | Delete
* Conditionally display Divi Hosting Card in the Support Center
[3140] Fix | Delete
*
[3141] Fix | Delete
* @since 4.4.7
[3142] Fix | Delete
*/
[3143] Fix | Delete
public function maybe_display_divi_hosting_card() {
[3144] Fix | Delete
// Sanity Check: Exit early if the user does not have permission
[3145] Fix | Delete
if ( ! $this->current_user_can( 'et_support_center_system' ) ) {
[3146] Fix | Delete
return;
[3147] Fix | Delete
}
[3148] Fix | Delete
[3149] Fix | Delete
// Exit if Admin dismissed the Divi Hosting Card
[3150] Fix | Delete
if ( get_option( 'et_hosting_card_dismissed', false ) ) {
[3151] Fix | Delete
return;
[3152] Fix | Delete
}
[3153] Fix | Delete
[3154] Fix | Delete
// Show the Divi Hosting Card
[3155] Fix | Delete
add_action( 'et_support_center_below_position_1', array( $this, 'print_divi_hosting_card' ) );
[3156] Fix | Delete
}
[3157] Fix | Delete
[3158] Fix | Delete
/**
[3159] Fix | Delete
* Prepare Settings for ET API request
[3160] Fix | Delete
* Returns false when ET username/api_key is not found, and ET subscription is not active
[3161] Fix | Delete
*
[3162] Fix | Delete
* @since 4.4.7
[3163] Fix | Delete
* @param string $action
[3164] Fix | Delete
*
[3165] Fix | Delete
* @return bool|array
[3166] Fix | Delete
*/
[3167] Fix | Delete
protected function get_et_api_request_settings( $action ) {
[3168] Fix | Delete
$et_account = et_core_get_et_account();
[3169] Fix | Delete
$et_username = et_()->array_get( $et_account, 'et_username', '' );
[3170] Fix | Delete
$et_api_key = et_()->array_get( $et_account, 'et_api_key', '' );
[3171] Fix | Delete
[3172] Fix | Delete
// Only when ET Username and ET API Key is found
[3173] Fix | Delete
if ( '' !== $et_username && '' !== $et_api_key ) {
[3174] Fix | Delete
global $wp_version;
[3175] Fix | Delete
[3176] Fix | Delete
// Prepare settings for API request
[3177] Fix | Delete
return array(
[3178] Fix | Delete
'timeout' => 30,
[3179] Fix | Delete
'body' => array(
[3180] Fix | Delete
'action' => $action,
[3181] Fix | Delete
'username' => $et_username,
[3182] Fix | Delete
'api_key' => $et_api_key,
[3183] Fix | Delete
),
[3184] Fix | Delete
'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ),
[3185] Fix | Delete
);
[3186] Fix | Delete
}
[3187] Fix | Delete
[3188] Fix | Delete
return false;
[3189] Fix | Delete
}
[3190] Fix | Delete
[3191] Fix | Delete
/**
[3192] Fix | Delete
* Check ET API whether ET User has disabled Divi Hosting Card
[3193] Fix | Delete
*
[3194] Fix | Delete
* @since 4.4.7
[3195] Fix | Delete
*
[3196] Fix | Delete
* @return bool
[3197] Fix | Delete
*/
[3198] Fix | Delete
protected function maybe_api_has_hosting_card_disabled() {
[3199] Fix | Delete
// Get API settings
[3200] Fix | Delete
$api_settings = $this->get_et_api_request_settings( 'check_hosting_card_status' );
[3201] Fix | Delete
[3202] Fix | Delete
// Check API only when ET Username, ET API Key is found and Account is active
[3203] Fix | Delete
if ( is_array( $api_settings ) ) {
[3204] Fix | Delete
$request = wp_remote_post( 'https://www.elegantthemes.com/api/api.php', $api_settings );
[3205] Fix | Delete
$request_response_code = wp_remote_retrieve_response_code( $request );
[3206] Fix | Delete
[3207] Fix | Delete
// Do not show the Hosting Card when API Request, or, API Response has any error
[3208] Fix | Delete
if ( is_wp_error( $request ) || 200 !== $request_response_code ) {
[3209] Fix | Delete
return true;
[3210] Fix | Delete
}
[3211] Fix | Delete
[3212] Fix | Delete
$response_body = wp_remote_retrieve_body( $request );
[3213] Fix | Delete
$response = (array) json_decode( $response_body );
[3214] Fix | Delete
[3215] Fix | Delete
// Check whether the User has disabled the card
[3216] Fix | Delete
if ( et_()->array_get( $response, 'success' ) && et_()->array_get( $response, 'status' ) === 'disabled' ) {
[3217] Fix | Delete
// Mark it dismissed, so it won't be displayed anymore on this website
[3218] Fix | Delete
update_option( 'et_hosting_card_dismissed', true );
[3219] Fix | Delete
[3220] Fix | Delete
// Do not show the Hosting Card
[3221] Fix | Delete
return true;
[3222] Fix | Delete
}
[3223] Fix | Delete
}
[3224] Fix | Delete
[3225] Fix | Delete
// Show the Hosting Card
[3226] Fix | Delete
return false;
[3227] Fix | Delete
}
[3228] Fix | Delete
[3229] Fix | Delete
/**
[3230] Fix | Delete
* Return Data for Divi Hosting Card
[3231] Fix | Delete
*
[3232] Fix | Delete
* @since 4.4.7
[3233] Fix | Delete
*
[3234] Fix | Delete
* @return array
[3235] Fix | Delete
*/
[3236] Fix | Delete
protected function get_divi_hosting_features() {
[3237] Fix | Delete
[3238] Fix | Delete
return array(
[3239] Fix | Delete
'title' => esc_html__( 'Get Recommended Divi Hosting', 'et-core' ),
[3240] Fix | Delete
'summary' => esc_html__( 'Upgrade your hosting to the most reliable, Divi-compatible hosting. Enjoy perfectly configured hosting environments pre-installed with the tools you need to be successful with Divi.', 'et-core' ),
[3241] Fix | Delete
'url' => 'https://www.elegantthemes.com/hosting/',
[3242] Fix | Delete
'learn_more' => esc_html__( 'Learn About Divi Hosting', 'et-core' ),
[3243] Fix | Delete
'dismiss_tooltip' => esc_html__( 'Remove This Recommendation On All Of Your Websites And Your Client\'s Websites Forever', 'et-core' ),
[3244] Fix | Delete
'features' => array(
[3245] Fix | Delete
'server' => array(
[3246] Fix | Delete
'title' => esc_html__( 'Divi-Optimized Servers', 'et-core' ),
[3247] Fix | Delete
'tooltip' => esc_html__( "We worked with our parters to make sure that their hosting solutions meet all of Divi's requirements out of the box. No hosting headaches on Divi Hosting.", 'et-core' ),
[3248] Fix | Delete
),
[3249] Fix | Delete
'speed' => array(
[3250] Fix | Delete
'title' => esc_html__( 'Blazing Fast Speed', 'et-core' ),
[3251] Fix | Delete
'tooltip' => esc_html__( 'Divi Hosting is powered by fast networks, modern hosting infrastructures and the latest server software. Plus you will enjoy automatic caching and a free CDN.', 'et-core' ),
[3252] Fix | Delete
),
[3253] Fix | Delete
'security' => array(
[3254] Fix | Delete
'title' => esc_html__( 'A Focus On Security', 'et-core' ),
[3255] Fix | Delete
'tooltip' => esc_html__( 'All of our hosting partners are dedicated to security. That means up-to-date server software and secure hosting practices.', 'et-core' ),
[3256] Fix | Delete
),
[3257] Fix | Delete
'backups' => array(
[3258] Fix | Delete
'title' => esc_html__( 'Automatic Backups', 'et-core' ),
[3259] Fix | Delete
'tooltip' => esc_html__( 'Every website needs backups! Each of our hosting partners provide automatic daily backups. If disaster strikes, these hosting companies have your back.', 'et-core' ),
[3260] Fix | Delete
),
[3261] Fix | Delete
'migrate' => array(
[3262] Fix | Delete
'title' => esc_html__( 'Free Site Migration', 'et-core' ),
[3263] Fix | Delete
'tooltip' => esc_html__( "Already have a Divi website hosted somewhere else? All of our hosting partners provide free assisted migration. It's easy to switch to Divi Hosting.", 'et-core' ),
[3264] Fix | Delete
),
[3265] Fix | Delete
'staging' => array(
[3266] Fix | Delete
'title' => esc_html__( 'Easy Staging Sites', 'et-core' ),
[3267] Fix | Delete
'tooltip' => esc_html__( 'Automatic staging sites make it easy to develop new designs for your clients without disrupting visitors. Finish your work and push it live all at once.', 'et-core' ),
[3268] Fix | Delete
),
[3269] Fix | Delete
),
[3270] Fix | Delete
);
[3271] Fix | Delete
}
[3272] Fix | Delete
[3273] Fix | Delete
/**
[3274] Fix | Delete
* Build and display Divi Hosting Card
[3275] Fix | Delete
*
[3276] Fix | Delete
* @since 4.4.7
[3277] Fix | Delete
*/
[3278] Fix | Delete
public function print_divi_hosting_card() {
[3279] Fix | Delete
// Gather System status data
[3280] Fix | Delete
$report = $this->system_diagnostics_generate_report( false );
[3281] Fix | Delete
$result = array();
[3282] Fix | Delete
[3283] Fix | Delete
// Prepare the report data to check against when to show the Divi Hosting Card
[3284] Fix | Delete
foreach ( $report as $status ) {
[3285] Fix | Delete
$result[] = et_()->array_get( $status, 'pass_fail' );
[3286] Fix | Delete
}
[3287] Fix | Delete
[3288] Fix | Delete
// Exit if any system status item is not in a warning state (red dot indicator)
[3289] Fix | Delete
if ( ! in_array( 'fail', array_values( $result ), true ) ) {
[3290] Fix | Delete
return;
[3291] Fix | Delete
}
[3292] Fix | Delete
[3293] Fix | Delete
// Exit if ET User has disabled the Divi Hosting card
[3294] Fix | Delete
if ( $this->maybe_api_has_hosting_card_disabled() ) {
[3295] Fix | Delete
return;
[3296] Fix | Delete
}
[3297] Fix | Delete
[3298] Fix | Delete
// JS dependency for Tooltips
[3299] Fix | Delete
wp_enqueue_script( 'popper', $this->local_path . 'admin/js/popper.min.js', array( 'jquery' ), ET_CORE_VERSION );
[3300] Fix | Delete
wp_enqueue_script( 'tippy', $this->local_path . 'admin/js/tippy.min.js', array( 'jquery', 'popper' ), ET_CORE_VERSION );
[3301] Fix | Delete
[3302] Fix | Delete
$card = $this->get_divi_hosting_features();
[3303] Fix | Delete
$features = '';
[3304] Fix | Delete
[3305] Fix | Delete
// HTML Template for Features of the Divi Hosting Card
[3306] Fix | Delete
foreach ( $card['features'] as $name => $feature ) {
[3307] Fix | Delete
$features .= sprintf(
[3308] Fix | Delete
'<div class="et_hosting_card--feature" data-tippy-content="%1$s">%2$s <h4>%3$s</h4></div>',
[3309] Fix | Delete
esc_html( $feature['tooltip'] ),
[3310] Fix | Delete
sprintf(
[3311] Fix | Delete
'<object type="image/svg+xml" className="fitvidsignore" data="%1$s" width="32" height="32"></object>',
[3312] Fix | Delete
esc_url( "{$this->local_path}admin/images/svg/{$name}.svg" )
[3313] Fix | Delete
),
[3314] Fix | Delete
esc_html( $feature['title'] )
[3315] Fix | Delete
);
[3316] Fix | Delete
}
[3317] Fix | Delete
[3318] Fix | Delete
// HTML Template for the Divi Hosting Card
[3319] Fix | Delete
$card_content = sprintf(
[3320] Fix | Delete
'<p class="et_card_summary">%1$s</p>
[3321] Fix | Delete
<div class="et_card_content et_hosting_card--features">%2$s</div>
[3322] Fix | Delete
<div class="et_card_cta et_hosting_card--cta">%3$s</div>',
[3323] Fix | Delete
esc_html( $card['summary'] ),
[3324] Fix | Delete
et_core_esc_previously( $features ),
[3325] Fix | Delete
sprintf(
[3326] Fix | Delete
'<a class="et_hosting_card--link" target="_blank" href="%1$s" title="%2$s">%3$s</a>',
[3327] Fix | Delete
esc_url( $card['url'] ),
[3328] Fix | Delete
esc_attr( $card['learn_more'] ),
[3329] Fix | Delete
esc_html( $card['learn_more'] )
[3330] Fix | Delete
)
[3331] Fix | Delete
);
[3332] Fix | Delete
[3333] Fix | Delete
// Display the Divi Hosting Card
[3334] Fix | Delete
print $this->add_support_center_card( array(
[3335] Fix | Delete
'title' => $card['title'],
[3336] Fix | Delete
'content' => $card_content,
[3337] Fix | Delete
'additional_classes' => array(
[3338] Fix | Delete
'et_hosting_card',
[3339] Fix | Delete
),
[3340] Fix | Delete
'dismiss_button' => array(
[3341] Fix | Delete
'card_key' => 'et_hosting_card',
[3342] Fix | Delete
'tooltip' => $card['dismiss_tooltip'],
[3343] Fix | Delete
'additional_classes' => array(
[3344] Fix | Delete
'et_hosting_card--dismiss',
[3345] Fix | Delete
),
[3346] Fix | Delete
),
[3347] Fix | Delete
) );
[3348] Fix | Delete
}
[3349] Fix | Delete
}
[3350] Fix | Delete
[3351] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function