!C99Shell v. 1.0 pre-release build #13!

Software: Apache. PHP/5.5.15 

uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 

SYSTEM 

Safe-mode: OFF (not secure)

C:\cumbreclima\wp-content\plugins\wordpress-seo\admin\   drwxrwxrwx
Free 4.11 GB of 39.52 GB (10.39%)
Detected drives: [ a ] [ c ] [ d ] [ e ] [ f ]
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/**
 * class WPSEO_Export
 *
 * Class with functionality to export the WP SEO settings
 */
class WPSEO_Export {

    
/**
     * @var string
     */
    
private $export '';

    
/**
     * @var string
     */
    
private $error '';

    
/**
     * @var string
     */
    
public $export_zip_url '';

    
/**
     * @var boolean
     */
    
public $success;

    
/**
     * Whether or not the export will include taxonomy metadata
     *
     * @var boolean
     */
    
private $include_taxonomy;

    
/**
     * @var array
     */
    
private $dir = array();


    
/**
     * Class constructor
     *
     * @param boolean $include_taxonomy Whether to include the taxonomy metadata the plugin creates.
     */
    
public function __construct$include_taxonomy false ) {
        
$this->include_taxonomy $include_taxonomy;
        
$this->dir              wp_upload_dir();
        
$this->success          $this->export_settings();
    }

    
/**
     * Returns an array with status and output message.
     *
     * @return array $results
     */
    
public function get_results() {
        
$results = array();
        if ( 
$this->success ) {
            
$results['status'] = 'success';
            
$results['msg']    = sprintf__'Export created: %1$sdownload your export file here%2$s.''wordpress-seo' ), '<a href="' $this->export_zip_url '">''</a>' );
        }
        else {
            
$results['status'] = 'failure';
            
$results['msg']    = __'Error creating WordPress SEO export: ''wordpress-seo' ) . $this->error;
        }

        return 
$results;
    }

    
/**
     * Exports the current site's WP SEO settings.
     *
     * @return boolean|string $return true when success, error when failed.
     */
    
private function export_settings() {

        
$this->export_header();

        foreach ( 
WPSEO_Options::get_option_names() as $opt_group ) {
            
$this->write_opt_group$opt_group$this->export );
        }

        
$this->taxonomy_metadata();

        if ( 
$this->write_file() ) {
            if ( 
$this->zip_file() ) {
                return 
true;
            }
            else {
                
$this->error __'Could not zip settings-file.''wordpress-seo' );

                return 
false;
            }
        }
        
$this->error __'Could not write settings to file.''wordpress-seo' );

        return 
false;
    }

    
/**
     * Writes the header of the export file.
     */
    
private function export_header() {
        
$this->write_line'; ' __'This is a settings export file for the WordPress SEO plugin by Yoast.com''wordpress-seo' ) . ' - https://yoast.com/wordpress/plugins/seo/' );
        if ( 
$this->include_taxonomy ) {
            
$this->write_line'; ' __'This export includes taxonomy metadata''wordpress-seo' ) );
        }
    }

    
/**
     * Writes a line to the export
     *
     * @param string  $line
     * @param boolean $newline_first
     */
    
private function write_line$line$newline_first false ) {
        if ( 
$newline_first ) {
            
$this->export .= PHP_EOL;
        }
        
$this->export .= $line PHP_EOL;
    }

    
/**
     * Writes an entire option group to the export
     *
     * @param string $opt_group
     */
    
private function write_opt_group$opt_group ) {
        
$this->write_line'[' $opt_group ']'true );

        
$options get_option$opt_group );

        if ( ! 
is_array$options ) ) {
            return;
        }

        foreach ( 
$options as $key => $elem ) {
            if ( 
is_array$elem ) ) {
                for ( 
$i 0$i count$elem ); $i ++ ) {
                    
$this->write_setting$key '[]'$elem$i ] );
                }
            }
            else {
                
$this->write_setting$key$elem );
            }
        }
    }

    
/**
     * Writes a settings line to the export
     *
     * @param string $key
     * @param string $val
     */
    
private function write_setting$key$val ) {
        if ( 
is_string$val ) ) {
            
$val '"' $val '"';
        }
        
$this->write_line$key ' = ' $val );
    }

    
/**
     * Adds the taxonomy meta data if there is any
     */
    
private function taxonomy_metadata() {
        if ( 
$this->include_taxonomy ) {
            
$taxonomy_meta get_option'wpseo_taxonomy_meta' );
            if ( 
is_array$taxonomy_meta ) ) {
                
$this->write_line'[wpseo_taxonomy_meta]'true );
                
$this->write_setting'wpseo_taxonomy_meta'urlencodejson_encode$taxonomy_meta ) ) );
            }
            else {
                
$this->write_line'; ' __'No taxonomy metadata found''wordpress-seo' ), true );
            }
        }
    }

    
/**
     * Writes the settings to our temporary settings.ini file
     *
     * @return boolean unsigned
     */
    
private function write_file() {
        
$handle fopen$this->dir['path'] . '/settings.ini''w' );
        if ( ! 
$handle ) {
            return 
false;
        }

        
$res fwrite$handle$this->export );
        if ( ! 
$res ) {
            return 
false;
        }

        
fclose$handle );

        return 
true;
    }

    
/**
     * Zips the settings ini file
     *
     * @return boolean unsigned
     */
    
private function zip_file() {
        
chdir$this->dir['path'] );
        
$zip = new PclZip'./settings.zip' );
        if ( 
=== $zip->create'./settings.ini' ) ) {
            return 
false;
        }

        
$this->export_zip_url $this->dir['url'] . '/settings.zip';

        return 
true;
    }

}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

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

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

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0156 ]--