!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache. PHP/5.6.40-67+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux hosting1.erectacloud.it 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC
2024 x86_64
 

uid=5229(web473) gid=5117(client172) groups=5117(client172),5002(sshusers) 

Safe-mode: OFF (not secure)

/var/www/clients/client172/web473/web/OLD_WP/wp-content/plugins/wordpress-seo/admin/   drwxr-xr-x
Free 180.05 GB of 490.84 GB (36.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     class-import.php (4.88 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * @package WPSEO\Admin\Import
 */

/**
 * Class WPSEO_Import
 *
 * Class with functionality to import the Yoast SEO settings
 */
class WPSEO_Import {

    
/**
     * Message about the import
     *
     * @var string
     */
    
public $msg '';

    
/** @var bool $success If import was a success flag. */
    
public $success false;

    
/**
     * @var array
     */
    
private $file;

    
/**
     * @var string
     */
    
private $filename;

    
/**
     * @var string
     */
    
private $old_wpseo_version null;

    
/**
     * @var string
     */
    
private $path;

    
/**
     * @var array
     */
    
private $upload_dir;

    
/**
     * Class constructor
     */
    
public function __construct() {
        if ( ! 
$this->handle_upload() ) {
            return;
        }

        
$this->determine_path();

        if ( ! 
$this->unzip_file() ) {
            
$this->clean_up();

            return;
        }

        
$this->parse_options();

        
$this->clean_up();
    }

    
/**
     * Handle the file upload
     *
     * @return boolean
     */
    
private function handle_upload() {
        
$overrides  = array( 'mimes' => array( 'zip' => 'application/zip' ) ); // Explicitly allow zip in multisite.
        
$this->file wp_handle_upload$_FILES['settings_import_file'], $overrides );

        if ( 
is_wp_error$this->file ) ) {
            
$this->msg __'Settings could not be imported:''wordpress-seo' ) . ' ' $this->file->get_error_message();

            return 
false;
        }

        if ( 
is_array$this->file ) && isset( $this->file['error'] ) ) {
            
$this->msg __'Settings could not be imported:''wordpress-seo' ) . ' ' $this->file['error'];

            return 
false;
        }

        if ( ! isset( 
$this->file['file'] ) ) {
            
$this->msg __'Settings could not be imported:''wordpress-seo' ) . ' ' __'Upload failed.''wordpress-seo' );

            return 
false;
        }

        return 
true;
    }

    
/**
     * Determine the path to the import file
     */
    
private function determine_path() {
        
$this->upload_dir wp_upload_dir();

        if ( ! 
defined'DIRECTORY_SEPARATOR' ) ) {
            
define'DIRECTORY_SEPARATOR''/' );
        }
        
$this->path $this->upload_dir['basedir'] . DIRECTORY_SEPARATOR 'wpseo-import' DIRECTORY_SEPARATOR;

        if ( ! isset( 
$GLOBALS['wp_filesystem'] ) || ! is_object$GLOBALS['wp_filesystem'] ) ) {
            
WP_Filesystem();
        }
    }

    
/**
     * Unzip the file
     *
     * @return boolean
     */
    
private function unzip_file() {
        
$unzipped unzip_file$this->file['file'], $this->path );
        if ( 
is_wp_error$unzipped ) ) {
            
$this->msg __'Settings could not be imported:''wordpress-seo' ) . ' ' sprintf__'Unzipping failed with error "%s".''wordpress-seo' ), $unzipped->get_error_message() );

            return 
false;
        }

        
$this->filename $this->path 'settings.ini';
        if ( ! 
is_file$this->filename ) || ! is_readable$this->filename ) ) {
            
$this->msg __'Settings could not be imported:''wordpress-seo' ) . ' ' __'Unzipping failed - file settings.ini not found.''wordpress-seo' );

            return 
false;
        }

        return 
true;
    }

    
/**
     * Parse the option file
     */
    
private function parse_options() {
        
$options parse_ini_file$this->filenametrue );

        if ( 
is_array$options ) && $options !== array() ) {
            if ( isset( 
$options['wpseo']['version'] ) && $options['wpseo']['version'] !== '' ) {
                
$this->old_wpseo_version $options['wpseo']['version'];
            }
            foreach ( 
$options as $name => $opt_group ) {
                
$this->parse_option_group$name$opt_group$options );
            }
            
$this->msg     __'Settings successfully imported.''wordpress-seo' );
            
$this->success true;
        }
        else {
            
$this->msg __'Settings could not be imported:''wordpress-seo' ) . ' ' __'No settings found in file.''wordpress-seo' );
        }
    }

    
/**
     * Parse the option group and import it
     *
     * @param string $name      Name string.
     * @param array  $opt_group Option group data.
     * @param array  $options   Options data.
     */
    
private function parse_option_group$name$opt_group$options ) {
        if ( 
$name === 'wpseo_taxonomy_meta' ) {
            
$opt_group json_decodeurldecode$opt_group['wpseo_taxonomy_meta'] ), true );
        }

        
// Make sure that the imported options are cleaned/converted on import.
        
$option_instance WPSEO_Options::get_option_instance$name );
        if ( 
is_object$option_instance ) && method_exists$option_instance'import' ) ) {
            
$option_instance->import$opt_group$this->old_wpseo_version$options );
        }
        elseif ( 
WP_DEBUG === true || ( defined'WPSEO_DEBUG' ) && WPSEO_DEBUG === true ) ) {
            
$this->msg sprintf__'Setting "%s" is no longer used and has been discarded.''wordpress-seo' ), $name );
        }
    }

    
/**
     * Remove the files
     */
    
private function clean_up() {
        if ( 
file_exists$this->filename ) && is_writable$this->filename ) ) {
            
unlink$this->filename );
        }
        if ( ! empty( 
$this->file['file'] ) && file_exists$this->file['file'] ) && is_writable$this->file['file'] ) ) {
            
unlink$this->file['file'] );
        }
        if ( 
file_exists$this->path ) && is_writable$this->path ) ) {
            
$wp_file = new WP_Filesystem_Direct$this->path );
            
$wp_file->rmdir$this->pathtrue );
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.006 ]--