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
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/advanced.../classes
File: upgrades.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Upgrade logic from older data to new one
[3] Fix | Delete
*
[4] Fix | Delete
* the version number itself is changed in /admin/includes/class-notices.php::register_version_notices()
[5] Fix | Delete
*
[6] Fix | Delete
* @since 1.7
[7] Fix | Delete
* @todo we need internal markers to check if the update ran on a normal request and not AJAX, where it happened to break sometimes
[8] Fix | Delete
*/
[9] Fix | Delete
class Advanced_Ads_Upgrades {
[10] Fix | Delete
[11] Fix | Delete
public function __construct(){
[12] Fix | Delete
[13] Fix | Delete
$internal_options = Advanced_Ads_Plugin::get_instance()->internal_options();
[14] Fix | Delete
[15] Fix | Delete
// the 'advanced_ads_edit_ads' capability was added to Entities::POST_TYPE_AD post type in this version
[16] Fix | Delete
if ( ! isset( $internal_options['version'] ) || version_compare( $internal_options['version'], '1.7.2', '<' ) ) {
[17] Fix | Delete
Advanced_Ads_Plugin::get_instance()->create_capabilities();
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
// suppress version update?
[21] Fix | Delete
$suppress_version_number_update = false;
[22] Fix | Delete
[23] Fix | Delete
// don’t upgrade if no previous version existed
[24] Fix | Delete
if( ! empty( $internal_options['version'] ) ) {
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* Example of how to use an update
[28] Fix | Delete
* this is no longer valid
[29] Fix | Delete
*/
[30] Fix | Delete
/*
[31] Fix | Delete
if ( version_compare( $internal_options['version'], '1.7' ) == -1 ) {
[32] Fix | Delete
// run with wp_loaded action, because WP_Query is needed and some plugins inject data that is not yet initialized
[33] Fix | Delete
add_action( 'wp_loaded', array( $this, 'upgrade_1_7') );
[34] Fix | Delete
}*/
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
// update version notices – if this doesn’t happen here, the upgrade might run multiple times and destroy updated data
[38] Fix | Delete
if( ! $suppress_version_number_update ){
[39] Fix | Delete
Advanced_Ads_Admin_Notices::get_instance()->update_version_number();
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function