WordPress.org

Plugin Directory

Changeset 595352


Ignore:
Timestamp:
09/06/12 12:08:53 (20 months ago)
Author:
joehoyle
Message:

Fixed themes in 3.4+, use latest HM_Backup

Location:
wpremote/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wpremote/trunk/plugin.php

    r582596 r595352  
    44Plugin Name: WP Remote 
    55Description: Manage your WordPress site with <a href="https://wpremote.com/">WP Remote</a>. Deactivate to clear your API Key. 
    6 Version: 2.2.1 
     6Version: 2.2.2 
    77Author: Human Made Limited 
    88Author URI: http://hmn.md/ 
  • wpremote/trunk/readme.txt

    r582596 r595352  
    44Requires at least: 2.9 
    55Tested up to: 3.4.1 
    6 Stable tag: 2.2.1 
     6Stable tag: 2.2.2 
    77 
    88WP Remote is a free web app that enables you to easily manage all of your WordPress powered sites from one place. 
  • wpremote/trunk/wprp.api.php

    r577602 r595352  
    8888        case 'get_site_info' : 
    8989         
    90             $actions[$action] = array( 'site_url' => get_site_url(), 'home_url' => get_home_url(), 'admin_url' => get_admin_url(),  ); 
     90            $actions[$action] = array(  
     91                'site_url' => get_site_url(),  
     92                'home_url' => get_home_url(),  
     93                'admin_url' => get_admin_url(), 
     94                'backups' => _wprp_get_backups_info()  
     95            ); 
    9196         
    9297        break; 
  • wpremote/trunk/wprp.backups.php

    r521280 r595352  
    2626             
    2727            // Store the backup file in the uploads dir 
    28             $backup->path = $upload_dir['basedir'] . '/_wpremote_backups'; 
     28            $backup->set_path( $upload_dir['basedir'] . '/_wpremote_backups' ); 
    2929             
    30             $running_file = $backup->path() . '/.backup_running'; 
    31             $index_php = $backup->path() . '/index.php'; 
     30            $running_file = $backup->get_path() . '/.backup_running'; 
     31            $index_php = $backup->get_path() . '/index.php'; 
    3232             
    3333            // Set a random backup filename 
    34             $backup->archive_filename = md5( time() ) . '.zip'; 
     34            $backup->set_archive_filename( md5( time() ) . '.zip' ); 
    3535             
    3636            // delete the backups folder to cleanup old backups 
    37             _wprp_backups_rmdirtree( $backup->path() ); 
     37            _wprp_backups_rmdirtree( $backup->get_path() ); 
    3838             
    39             if ( ! @mkdir( $backup->path() ) ) 
     39            if ( ! @mkdir( $backup->get_path() ) ) 
    4040                return new WP_Error( 'unable-to-create-backups-directory', 'Unable to write the .backup_running file - check your permissions on wp-content/uploads' ); 
    4141                 
     
    5656                return new WP_Error( 'unable-to-write-backup-running-file' ); 
    5757     
    58             fwrite( $handle, $backup->archive_filename() ); 
     58            fwrite( $handle, $backup->get_archive_filename() ); 
    5959     
    6060            fclose( $handle ); 
     
    6767             
    6868                $excludes = array_map( 'urldecode', (array) $_REQUEST['backup_excludes'] ); 
    69                 $backup->excludes = $excludes; 
     69                $backup->set_excludes( $excludes ); 
    7070            } 
    7171             
    7272            $backup->backup(); 
    7373             
    74             unlink( $backup->path() . '/.backup_completed' ); 
    75             unlink( $backup->path() . '/.backup_running' ); 
     74            unlink( $backup->get_path() . '/.backup_completed' ); 
     75            unlink( $backup->get_path() . '/.backup_running' ); 
    7676             
    7777            // Write the backup runing file for tracking... 
    78             $completed_file = $backup->path() . '/.backup_completed'; 
     78            $completed_file = $backup->get_path() . '/.backup_completed'; 
    7979 
    8080            if ( ! $handle = @fopen( $completed_file, 'w' ) ) 
    8181                return new WP_Error( 'unable-to-write-backup-completed-file' ); 
    8282             
    83             if ( $backup->errors() || ( $backup->warnings() && ! file_exists( $backup->archive_filepath() ) ) ) { 
     83            if ( $backup->get_errors() || ( $backup->get_warnings() && ! file_exists( $backup->get_archive_filepath() ) ) ) { 
    8484                 
    85                 $errors = array_merge( $backup->errors(), $backup->warnings() ); 
     85                $errors = array_merge( $backup->get_errors(), $backup->get_warnings() ); 
    8686                fwrite( $handle, json_encode( $errors ) ); 
    8787                 
    8888            } else { 
    8989             
    90                 fwrite( $handle, 'file:' . $backup->archive_filename() ); 
     90                fwrite( $handle, 'file:' . $backup->get_archive_filename() ); 
    9191            } 
    9292             
     
    155155 
    156156} 
     157 
     158function _wprp_get_backups_info() { 
     159    if ( ! class_exists( 'hm_backup' ) ) 
     160        return; 
     161 
     162    $hm_backup = new HM_Backup(); 
     163    $info = array( 
     164        'mysqldump_path' => $hm_backup->get_mysqldump_command_path(), 
     165        'zip_path' => $hm_backup->get_zip_command_path() 
     166    ); 
     167 
     168    return $info; 
     169} 
  • wpremote/trunk/wprp.themes.php

    r489366 r595352  
    3232    foreach ( (array) $themes as $theme ) { 
    3333 
    34         $new_version = isset( $current->response[$theme['Template']] ) ? $current->response[$theme['Template']]['new_version'] : null; 
     34        // WordPress 3.4+ 
     35        if ( is_object( $theme ) && is_a( $theme, 'WP_Theme' ) ) { 
    3536 
    36         if ( $active == $theme['Name'] ) 
    37             $themes[$theme['Name']]['active'] = true; 
     37            $new_version = isset( $current->response[$theme['Template']] ) ? $current->response[$theme['Template']]['new_version'] : null; 
    3838 
    39         else 
    40             $themes[$theme['Name']]['active'] = false; 
     39            $theme_array = array( 
     40                'Name'      => $theme->get( 'Name' ), 
     41                'Template'  => $theme->get( 'Template' ), 
     42                'active'    => $active == $theme->get( 'Name' ), 
     43                'Stylesheet' => $theme->get( 'Stylesheet' ), 
     44                'Template'  => $theme->get_template(), 
     45                'Stylesheet'=> $theme->get_stylesheet(), 
     46                'Screenshot'=> $theme->get_screenshot(), 
     47                'AuthorURI'=> $theme->get( 'AuthorURI' ), 
     48                'Author'    => $theme->get( 'Author' ), 
     49                'latest_version' => $new_version ? $new_version : $theme->get( 'Version' ), 
     50                'Version'   => $theme->get( 'Version' ), 
     51                'ThemeURI'  => $theme->get( 'ThemeURI' ) 
     52            ); 
    4153 
    42         if ( $new_version ) { 
     54            $themes[$theme['Name']] = $theme_array; 
    4355 
    44             $themes[$theme['Name']]['latest_version'] = $new_version; 
    45             $themes[$theme['Name']]['latest_package'] = $current->response[$theme['Template']]['package']; 
     56        } else { 
    4657 
    47         } else { 
     58            $new_version = isset( $current->response[$theme['Template']] ) ? $current->response[$theme['Template']]['new_version'] : null; 
    4859 
    49             $themes[$theme['Name']]['latest_version'] = $theme['Version']; 
     60            if ( $active == $theme['Name'] ) 
     61                $themes[$theme['Name']]['active'] = true; 
    5062 
    51         } 
     63            else 
     64                $themes[$theme['Name']]['active'] = false; 
    5265 
     66            if ( $new_version ) { 
     67 
     68                $themes[$theme['Name']]['latest_version'] = $new_version; 
     69                $themes[$theme['Name']]['latest_package'] = $current->response[$theme['Template']]['package']; 
     70 
     71            } else { 
     72 
     73                $themes[$theme['Name']]['latest_version'] = $theme['Version']; 
     74 
     75            } 
     76        } 
    5377    } 
    5478 
Note: See TracChangeset for help on using the changeset viewer.