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: Updates.php
$theme_request = wp_remote_post( 'https://www.elegantthemes.com/api/api.php', $options );
[500] Fix | Delete
[501] Fix | Delete
if ( is_wp_error( $theme_request ) ) {
[502] Fix | Delete
$options['body']['failed_request'] = 'true';
[503] Fix | Delete
$theme_request = wp_remote_post( 'https://cdn.elegantthemes.com/api/api.php', $options );
[504] Fix | Delete
}
[505] Fix | Delete
[506] Fix | Delete
if ( ! is_wp_error( $theme_request ) && wp_remote_retrieve_response_code( $theme_request ) === 200 ){
[507] Fix | Delete
$theme_response = unserialize( wp_remote_retrieve_body( $theme_request ) );
[508] Fix | Delete
[509] Fix | Delete
if ( ! empty( $theme_response ) ) {
[510] Fix | Delete
$theme_response = $this->process_additional_response_settings( $theme_response );
[511] Fix | Delete
[512] Fix | Delete
$last_update->checked = $themes;
[513] Fix | Delete
$last_update->response = $theme_response;
[514] Fix | Delete
}
[515] Fix | Delete
}
[516] Fix | Delete
[517] Fix | Delete
$last_update->last_checked = time();
[518] Fix | Delete
[519] Fix | Delete
$update_transient = $this->merge_et_products_response( $update_transient, $last_update );
[520] Fix | Delete
[521] Fix | Delete
set_site_transient( 'et_update_themes', $last_update );
[522] Fix | Delete
[523] Fix | Delete
$this->update_product_domains();
[524] Fix | Delete
[525] Fix | Delete
return $update_transient;
[526] Fix | Delete
}
[527] Fix | Delete
[528] Fix | Delete
function maybe_show_account_notice() {
[529] Fix | Delete
if ( empty( $this->options['username'] ) || empty( $this->options['api_key'] ) ) {
[530] Fix | Delete
return;
[531] Fix | Delete
}
[532] Fix | Delete
[533] Fix | Delete
$output = '';
[534] Fix | Delete
[535] Fix | Delete
$messages = array();
[536] Fix | Delete
[537] Fix | Delete
$account_api_key_status = get_site_option( 'et_account_api_key_status' );
[538] Fix | Delete
[539] Fix | Delete
$is_expired_account = 'expired' === $this->account_status;
[540] Fix | Delete
[541] Fix | Delete
$is_invalid_account = 'not_found' === $this->account_status;
[542] Fix | Delete
[543] Fix | Delete
if (
[544] Fix | Delete
! $is_expired_account
[545] Fix | Delete
&& ! $is_invalid_account
[546] Fix | Delete
&& empty( $account_api_key_status )
[547] Fix | Delete
) {
[548] Fix | Delete
return;
[549] Fix | Delete
}
[550] Fix | Delete
[551] Fix | Delete
if ( $is_expired_account ) {
[552] Fix | Delete
$messages[] = et_get_safe_localization( __( 'Your Elegant Themes subscription has expired. You must <a href="https://www.elegantthemes.com/members-area/" target="_blank">renew your account</a> to regain access to product updates and support. To ensure compatibility and security, it is important to always keep your themes and plugins updated.', 'et-core' ) );
[553] Fix | Delete
} else if ( $is_invalid_account ) {
[554] Fix | Delete
$messages[] = et_get_safe_localization( __( 'The Elegant Themes username you entered is invalid. Please enter a valid username to receive product updates. If you forgot your username you can <a href="https://www.elegantthemes.com/members-area/retrieve-username/" target="_blank">request it here</a>.', 'et-core' ) );
[555] Fix | Delete
}
[556] Fix | Delete
[557] Fix | Delete
if ( ! empty( $account_api_key_status ) ) {
[558] Fix | Delete
switch ( $account_api_key_status ) {
[559] Fix | Delete
case 'deactivated':
[560] Fix | Delete
$status = 'not active';
[561] Fix | Delete
[562] Fix | Delete
break;
[563] Fix | Delete
default:
[564] Fix | Delete
$status = 'invalid';
[565] Fix | Delete
[566] Fix | Delete
break;
[567] Fix | Delete
}
[568] Fix | Delete
[569] Fix | Delete
$messages[] = et_get_safe_localization( __(
[570] Fix | Delete
sprintf( 'The Elegant Themes API key you entered is %1$s. Please make sure that your API has been entered correctly and that it is <a href="https://www.elegantthemes.com/members-area/api/" target="_blank">enabled</a> in your account.', $status ),
[571] Fix | Delete
'et-core'
[572] Fix | Delete
) );
[573] Fix | Delete
}
[574] Fix | Delete
[575] Fix | Delete
foreach ( $messages as $message ) {
[576] Fix | Delete
$output .= sprintf( '<p>%1$s</p>', $message );
[577] Fix | Delete
}
[578] Fix | Delete
[579] Fix | Delete
if ( empty( $output ) ) {
[580] Fix | Delete
return;
[581] Fix | Delete
}
[582] Fix | Delete
[583] Fix | Delete
$dashboard_url = add_query_arg( 'et_action', 'update_account_details', admin_url( 'update-core.php' ) );
[584] Fix | Delete
[585] Fix | Delete
printf(
[586] Fix | Delete
'<div class="notice notice-warning">
[587] Fix | Delete
%1$s
[588] Fix | Delete
<p><a href="%2$s">%3$s</a></p>
[589] Fix | Delete
</div>',
[590] Fix | Delete
$output,
[591] Fix | Delete
esc_url( wp_nonce_url( $dashboard_url, 'et_update_account_details', 'et_update_account_details_nonce' ) ),
[592] Fix | Delete
esc_html__( 'Check Again', 'et-core' )
[593] Fix | Delete
);
[594] Fix | Delete
}
[595] Fix | Delete
[596] Fix | Delete
function change_plugin_changelog_url( $url, $path ) {
[597] Fix | Delete
if ( 0 !== strpos( $path, 'plugin-install.php?tab=plugin-information&plugin=' ) ) {
[598] Fix | Delete
return $url;
[599] Fix | Delete
}
[600] Fix | Delete
[601] Fix | Delete
$matches = array();
[602] Fix | Delete
[603] Fix | Delete
$update_transient = get_site_transient( 'et_update_all_plugins' );
[604] Fix | Delete
[605] Fix | Delete
if ( ! is_object( $update_transient ) || empty( $update_transient->response ) ) {
[606] Fix | Delete
return $url;
[607] Fix | Delete
}
[608] Fix | Delete
[609] Fix | Delete
$et_updated_plugins_data = get_transient( 'et_updated_plugins_data' );
[610] Fix | Delete
$has_last_checked = ! empty( $update_transient->last_checked ) && ! empty( $et_updated_plugins_data->last_checked );
[611] Fix | Delete
[612] Fix | Delete
/*
[613] Fix | Delete
* Attempt to use a cached list of updated plugins.
[614] Fix | Delete
* Re-save the list, whenever the update transient last checked time changes.
[615] Fix | Delete
*/
[616] Fix | Delete
if ( false === $et_updated_plugins_data || ( $has_last_checked && $update_transient->last_checked !== $et_updated_plugins_data->last_checked ) ) {
[617] Fix | Delete
$et_updated_plugins_data = new stdClass();
[618] Fix | Delete
[619] Fix | Delete
if ( ! empty( $update_transient->last_checked ) ) {
[620] Fix | Delete
$et_updated_plugins_data->last_checked = $update_transient->last_checked;
[621] Fix | Delete
}
[622] Fix | Delete
[623] Fix | Delete
foreach ( $update_transient->response as $response_plugin_settings ) {
[624] Fix | Delete
$slug = sanitize_text_field( $response_plugin_settings->slug );
[625] Fix | Delete
[626] Fix | Delete
$et_updated_plugins_data->changelogs[ $slug ] = $response_plugin_settings->url . '?TB_iframe=true&width=1024&height=800';
[627] Fix | Delete
}
[628] Fix | Delete
[629] Fix | Delete
set_transient( 'et_updated_plugins_data', $et_updated_plugins_data );
[630] Fix | Delete
}
[631] Fix | Delete
[632] Fix | Delete
if ( empty( $et_updated_plugins_data->changelogs ) ) {
[633] Fix | Delete
return $url;
[634] Fix | Delete
}
[635] Fix | Delete
[636] Fix | Delete
preg_match( '/plugin=([^&]*)/', $path, $matches );
[637] Fix | Delete
[638] Fix | Delete
$current_plugin_slug = $matches[1];
[639] Fix | Delete
[640] Fix | Delete
// Check if we're dealing with a product that has a custom changelog URL
[641] Fix | Delete
if ( ! empty( $et_updated_plugins_data->changelogs[ $current_plugin_slug ] ) ) {
[642] Fix | Delete
$url = esc_url_raw( $et_updated_plugins_data->changelogs[ $current_plugin_slug ] );
[643] Fix | Delete
}
[644] Fix | Delete
[645] Fix | Delete
return $url;
[646] Fix | Delete
}
[647] Fix | Delete
[648] Fix | Delete
function force_update_requests() {
[649] Fix | Delete
$update_transients = array(
[650] Fix | Delete
'update_themes',
[651] Fix | Delete
'update_plugins',
[652] Fix | Delete
'et_update_themes',
[653] Fix | Delete
'et_update_all_plugins',
[654] Fix | Delete
);
[655] Fix | Delete
[656] Fix | Delete
foreach ( $update_transients as $update_transient ) {
[657] Fix | Delete
if ( get_site_transient( $update_transient ) ) {
[658] Fix | Delete
delete_site_transient( $update_transient );
[659] Fix | Delete
}
[660] Fix | Delete
}
[661] Fix | Delete
}
[662] Fix | Delete
[663] Fix | Delete
function update_product_domains() {
[664] Fix | Delete
$this->all_et_products_domains = $this->get_all_et_products();
[665] Fix | Delete
[666] Fix | Delete
$append_notification_action_name = 'maybe_append_custom_notification';
[667] Fix | Delete
[668] Fix | Delete
// update notifications for ET products if needed
[669] Fix | Delete
foreach ( array( 'theme', 'plugin' ) as $product_type ) {
[670] Fix | Delete
if ( empty( $this->all_et_products_domains[ $product_type] ) ) {
[671] Fix | Delete
continue;
[672] Fix | Delete
}
[673] Fix | Delete
[674] Fix | Delete
foreach ( $this->all_et_products_domains[ $product_type ] as $product_key ) {
[675] Fix | Delete
$action_name = sanitize_text_field( sprintf(
[676] Fix | Delete
'in_%1$s_update_message-%2$s',
[677] Fix | Delete
$product_type,
[678] Fix | Delete
$product_key
[679] Fix | Delete
) );
[680] Fix | Delete
[681] Fix | Delete
if ( has_action( $action_name, array( $this, $append_notification_action_name ) ) ) {
[682] Fix | Delete
continue;
[683] Fix | Delete
}
[684] Fix | Delete
[685] Fix | Delete
add_action( $action_name, array( $this, $append_notification_action_name ), 10, 2 );
[686] Fix | Delete
}
[687] Fix | Delete
}
[688] Fix | Delete
}
[689] Fix | Delete
[690] Fix | Delete
/**
[691] Fix | Delete
* Delete Elegant Themes update products transient, whenever default WordPress update transient gets removed
[692] Fix | Delete
*/
[693] Fix | Delete
function maybe_reset_et_products_update_transient( $transient_name ) {
[694] Fix | Delete
$update_transients_names = array(
[695] Fix | Delete
'update_themes' => 'et_update_themes',
[696] Fix | Delete
'update_plugins' => 'et_update_all_plugins',
[697] Fix | Delete
);
[698] Fix | Delete
[699] Fix | Delete
if ( empty( $update_transients_names[ $transient_name ] ) ) {
[700] Fix | Delete
return;
[701] Fix | Delete
}
[702] Fix | Delete
[703] Fix | Delete
delete_site_transient( $update_transients_names[ $transient_name ] );
[704] Fix | Delete
}
[705] Fix | Delete
}
[706] Fix | Delete
endif;
[707] Fix | Delete
[708] Fix | Delete
if ( ! function_exists( 'et_core_enable_automatic_updates' ) ) :
[709] Fix | Delete
function et_core_enable_automatic_updates( $deprecated, $version ) {
[710] Fix | Delete
if ( ! is_admin() ) {
[711] Fix | Delete
return;
[712] Fix | Delete
}
[713] Fix | Delete
[714] Fix | Delete
if ( isset( $GLOBALS['et_core_updates'] ) ) {
[715] Fix | Delete
return;
[716] Fix | Delete
}
[717] Fix | Delete
[718] Fix | Delete
if ( defined( 'ET_CORE_URL' ) ) {
[719] Fix | Delete
$url = ET_CORE_URL;
[720] Fix | Delete
} else {
[721] Fix | Delete
$url = trailingslashit( $deprecated ) . 'core/';
[722] Fix | Delete
}
[723] Fix | Delete
[724] Fix | Delete
$GLOBALS['et_core_updates'] = new ET_Core_Updates( $url, $version );
[725] Fix | Delete
[726] Fix | Delete
}
[727] Fix | Delete
endif;
[728] Fix | Delete
[729] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function