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/wp-conte.../plugins/wpforms-.../src/Helpers
File: PluginSilentUpgrader.php
[500] Fix | Delete
if ( is_array( $wp_theme_directories ) ) {
[501] Fix | Delete
$protected_directories = array_merge( $protected_directories, $wp_theme_directories );
[502] Fix | Delete
}
[503] Fix | Delete
[504] Fix | Delete
if ( in_array( $destination, $protected_directories ) ) {
[505] Fix | Delete
$remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );
[506] Fix | Delete
$destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) );
[507] Fix | Delete
}
[508] Fix | Delete
[509] Fix | Delete
if ( $clear_destination ) {
[510] Fix | Delete
// We're going to clear the destination if there's something there.
[511] Fix | Delete
$removed = $this->clear_destination( $remote_destination );
[512] Fix | Delete
[513] Fix | Delete
/**
[514] Fix | Delete
* Filter whether the upgrader cleared the destination.
[515] Fix | Delete
*
[516] Fix | Delete
* @since 2.8.0
[517] Fix | Delete
*
[518] Fix | Delete
* @param mixed $removed Whether the destination was cleared. true on success, WP_Error on failure.
[519] Fix | Delete
* @param string $local_destination The local package destination.
[520] Fix | Delete
* @param string $remote_destination The remote package destination.
[521] Fix | Delete
* @param array $hook_extra Extra arguments passed to hooked filters.
[522] Fix | Delete
*/
[523] Fix | Delete
$removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
[524] Fix | Delete
[525] Fix | Delete
if ( is_wp_error( $removed ) ) {
[526] Fix | Delete
return $removed;
[527] Fix | Delete
}
[528] Fix | Delete
} elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists( $remote_destination ) ) {
[529] Fix | Delete
// If we're not clearing the destination folder and something exists there already, Bail.
[530] Fix | Delete
// But first check to see if there are actually any files in the folder.
[531] Fix | Delete
$_files = $wp_filesystem->dirlist( $remote_destination );
[532] Fix | Delete
[533] Fix | Delete
if ( ! empty( $_files ) ) {
[534] Fix | Delete
$wp_filesystem->delete( $remote_source, true ); // Clear out the source files.
[535] Fix | Delete
[536] Fix | Delete
return new WP_Error( 'folder_exists', $this->strings['folder_exists'], $remote_destination );
[537] Fix | Delete
}
[538] Fix | Delete
}
[539] Fix | Delete
[540] Fix | Delete
// Create destination if needed.
[541] Fix | Delete
if ( ! $wp_filesystem->exists( $remote_destination ) ) {
[542] Fix | Delete
if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) {
[543] Fix | Delete
return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination );
[544] Fix | Delete
}
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
// Copy new version of item into place.
[548] Fix | Delete
$result = copy_dir( $source, $remote_destination );
[549] Fix | Delete
[550] Fix | Delete
if ( is_wp_error( $result ) ) {
[551] Fix | Delete
if ( $args['clear_working'] ) {
[552] Fix | Delete
$wp_filesystem->delete( $remote_source, true );
[553] Fix | Delete
}
[554] Fix | Delete
[555] Fix | Delete
return $result;
[556] Fix | Delete
}
[557] Fix | Delete
[558] Fix | Delete
// Clear the Working folder?
[559] Fix | Delete
if ( $args['clear_working'] ) {
[560] Fix | Delete
$wp_filesystem->delete( $remote_source, true );
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
$destination_name = basename( str_replace( $local_destination, '', $destination ) );
[564] Fix | Delete
[565] Fix | Delete
if ( $destination_name === '.' ) {
[566] Fix | Delete
$destination_name = '';
[567] Fix | Delete
}
[568] Fix | Delete
[569] Fix | Delete
$this->result = compact( 'source', 'source_files', 'destination', 'destination_name', 'local_destination', 'remote_destination', 'clear_destination' );
[570] Fix | Delete
[571] Fix | Delete
/**
[572] Fix | Delete
* Filter the installation response after the installation has finished.
[573] Fix | Delete
*
[574] Fix | Delete
* @since 2.8.0
[575] Fix | Delete
*
[576] Fix | Delete
* @param bool $response Installation response.
[577] Fix | Delete
* @param array $hook_extra Extra arguments passed to hooked filters.
[578] Fix | Delete
* @param array $result Installation result data.
[579] Fix | Delete
*/
[580] Fix | Delete
$res = apply_filters( 'upgrader_post_install', true, $args['hook_extra'], $this->result );
[581] Fix | Delete
[582] Fix | Delete
if ( is_wp_error( $res ) ) {
[583] Fix | Delete
$this->result = $res;
[584] Fix | Delete
[585] Fix | Delete
return $res;
[586] Fix | Delete
}
[587] Fix | Delete
[588] Fix | Delete
// Bombard the calling function will all the info which we've just used.
[589] Fix | Delete
return $this->result;
[590] Fix | Delete
}
[591] Fix | Delete
[592] Fix | Delete
/**
[593] Fix | Delete
* Install a plugin package.
[594] Fix | Delete
*
[595] Fix | Delete
* @since 1.6.3
[596] Fix | Delete
*
[597] Fix | Delete
* @param string $package The full local path or URI of the package.
[598] Fix | Delete
* @param array $args Optional. Other arguments for installing a plugin package. Default empty array.
[599] Fix | Delete
*
[600] Fix | Delete
* @return bool|\WP_Error True if the installation was successful, false or a WP_Error otherwise.
[601] Fix | Delete
*/
[602] Fix | Delete
public function install( $package, $args = [] ) {
[603] Fix | Delete
[604] Fix | Delete
$result = parent::install( $package, $args );
[605] Fix | Delete
if ( true === $result ) {
[606] Fix | Delete
do_action( 'wpforms_plugin_installed', $package );
[607] Fix | Delete
}
[608] Fix | Delete
[609] Fix | Delete
return $result;
[610] Fix | Delete
}
[611] Fix | Delete
}
[612] Fix | Delete
[613] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function