Plugin Directory

Changeset 892993


Ignore:
Timestamp:
04/14/2014 04:00:14 PM (12 years ago)
Author:
michitzky
Message:

tagging version 0.6

Location:
mk-simple-backups
Files:
9 deleted
12 edited
6 copied

Legend:

Unmodified
Added
Removed
  • mk-simple-backups/tags/0.6/assets/css/general.css

    r892855 r892993  
    1 
    2 
    3 /*
    4  *      icons for create backup links
    5  */
    6 .actions a {
     1/* icons for creating backups/file */
     2.actions a, .options strong {
    73    padding-left: 20px;
    84}
    95
    10 .actions .db a{ background: url("../images/database_add.png") left center no-repeat; }
    11 .actions .uploads a{ background: url("../images/camera_add.png") left center no-repeat; }
    12 .actions .theme a{ background: url("../images/layout_add.png") left center no-repeat; }
     6.options .db strong { background: url("../images/database.png") left center no-repeat; }
     7.options .uploads strong { background: url("../images/pictures.png") left center no-repeat; }
     8.options .theme strong { background: url("../images/layout.png") left center no-repeat; }
     9
    1310.actions .test a{ background: url("../images/page_white_add.png") left center no-repeat; }
    14 .actions .allinone a{ background: url("../images/add.png") left center no-repeat; }
    1511
    1612
    17 /*
    18  *      icons for file list
    19  */
     13/* remove text selection marker for backup options */
     14.options label {
     15    -webkit-touch-callout: none;
     16    -webkit-user-select: none;
     17    -khtml-user-select: none;
     18    -moz-user-select: none;
     19    -ms-user-select: none;
     20    user-select: none;
     21}
     22
     23.options li, .filelist li {
     24    margin-top: 0.4em;
     25    line-height: 2em;
     26}
     27
     28
     29/* icons for file list */
    2030.filelist li {
    2131    padding-left: 20px;
    2232}
    2333
    24 .filelist .uploads { background: url("../images/camera.png") left center no-repeat; }
    25 .filelist .theme { background: url("../images/layout.png") left center no-repeat; }
    26 .filelist .db { background: url("../images/database.png") left center no-repeat; }
    27 .filelist .empty { background: url("../images/page_white.png") left center no-repeat; }
    28 .filelist .archive { background: url("../images/compress.png") left center no-repeat; }
     34.filelist .default { background: url("../images/page_white.png") left center no-repeat; }
     35.filelist .archive { background: url("../images/page_white_zip.png") left center no-repeat; }
    2936
    3037
    31 /*
    32  *      basic error class
    33  */
     38/* basic error class */
    3439.error { color: crimson; }
    3540
    36 /*
    37  *      class for multiline text, to decrease text-line width
    38  */
     41
     42/* class for multiline text, to decrease text-line width */
    3943.readable {
    4044    max-width: 50em;
    4145}
     46
     47/* small footer */
     48.small {
     49    font-size: 90%;
     50    opacity: 0.8;
     51}
     52
     53.small a {
     54    color: inherit;
     55}
  • mk-simple-backups/tags/0.6/class.backuphandler.php

    r892855 r892993  
    1717    public $backup_dir_weburl = "";
    1818    public $upload_dir = "";
    19     private $sep = "-";
     19    public $sep = "-";
    2020   
    2121    function __construct() {
     
    148148        }
    149149       
    150         foreach($files_to_add as $file) {
    151             $zip->addFile($file,$file);
    152         }
     150        if(count($files_to_add) > 0) {
     151            foreach($files_to_add as $file) {
     152                $zip->addFile($file,$file);
     153            }
     154        } else return false;
     155       
    153156        //debug
    154157        //echo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status;
  • mk-simple-backups/tags/0.6/languages/mk-simple-backups-de_DE.po

    r892855 r892993  
    22msgstr ""
    33"Project-Id-Version: mk-simple-backups\n"
    4 "POT-Creation-Date: 2014-04-14 13:47+0100\n"
    5 "PO-Revision-Date: 2014-04-14 13:47+0100\n"
     4"POT-Creation-Date: 2014-04-14 17:57+0100\n"
     5"PO-Revision-Date: 2014-04-14 17:57+0100\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    1616"X-Poedit-SearchPath-0: ..\n"
    1717
    18 #: ../mk-simple-backups.php:71
     18#: ../mk-simple-backups.php:72
    1919msgid "Backup"
    2020msgstr "Backup"
    2121
    22 #: ../mk-simple-backups.php:85
     22#: ../mk-simple-backups.php:86
    2323#, php-format
    2424msgid "Blank File %s created"
    2525msgstr "Leere Datei %s erstellt"
    2626
    27 #: ../mk-simple-backups.php:86
     27#: ../mk-simple-backups.php:87
    2828msgid "Blank File could not be created"
    2929msgstr "Leere Datei konnte nicht erstellt werden"
    3030
    31 #: ../mk-simple-backups.php:91
    32 #, php-format
    33 msgid "DB Backup %s created"
    34 msgstr "DB Backup %s erstellt"
    35 
    3631#: ../mk-simple-backups.php:92
    37 msgid "DB Backup could not be created"
    38 msgstr "DB Backup konnte nicht erstellt werden"
    39 
    40 #: ../mk-simple-backups.php:97
    41 #, php-format
    42 msgid "Theme Backup %s created"
    43 msgstr "Theme Backup %s erstellt"
    44 
    45 #: ../mk-simple-backups.php:98
    46 msgid "Theme Backup could not be created"
    47 msgstr "Theme Backup konnte nicht erstellt werden"
    48 
    49 #: ../mk-simple-backups.php:103
    50 #, php-format
    51 msgid "Upload Backup %s created"
    52 msgstr "Upload Backup %s erstellt"
    53 
    54 #: ../mk-simple-backups.php:104
    55 msgid "Upload Backup could not be created"
    56 msgstr "Upload Backup konnte nicht erstellt werden"
    57 
    58 #: ../mk-simple-backups.php:109
    59 msgid "DB Backup failed, complete backup aborted"
    60 msgstr "DB Backup gescheitert, Komplettes Backup abgebrochen"
    61 
    62 #: ../mk-simple-backups.php:111
    63 msgid "Theme Backup failed, complete backup aborted"
    64 msgstr "Theme Backup gescheitert, Komplettes Backup abgebrochen"
    65 
    66 #: ../mk-simple-backups.php:113
    67 msgid "Media Backup failed, complete backup aborted"
    68 msgstr "Media Backup gescheitert, Komplettes Backup abgebrochen"
    69 
    70 #: ../mk-simple-backups.php:132
    71 msgid "Complete Backup successfully created"
    72 msgstr "Komplettes Backup wurde erstellt"
    73 
    74 #: ../mk-simple-backups.php:134
    75 msgid "Complete Backup could not be created"
    76 msgstr "Komplettes Backup konnte nicht erstellt werden"
    77 
    78 #: ../mk-simple-backups.php:144
    79 #, php-format
    80 msgid "Backup %s created"
    81 msgstr "Backup %s erstellt"
    82 
    83 #: ../mk-simple-backups.php:145
    84 msgid "Media Backup by DB could not be created"
    85 msgstr "Upload Backup (anhand DB) konnte nicht erstellt werden"
    86 
    87 #: ../mk-simple-backups.php:150
    8832msgid "Files in the backup directory were deleted"
    8933msgstr "Dateien im Backup Verzeichnis gelöscht"
    9034
    91 #: ../mk-simple-backups.php:151
     35#: ../mk-simple-backups.php:93
    9236msgid ""
    9337"Some files could not be removed by the script. Check File-Permissions or "
     
    9741"prüfen und allenfalls manuell entfernen."
    9842
    99 #: ../mk-simple-backups.php:187
     43#: ../mk-simple-backups.php:109 ../mk-simple-backups.php:241
     44msgid "Database"
     45msgstr "Datenbank"
     46
     47#: ../mk-simple-backups.php:113
     48msgid "Theme"
     49msgstr "Theme"
     50
     51#: ../mk-simple-backups.php:118
     52msgid "Uploads (file based)"
     53msgstr "Uploads (Verzeichnis-basierend)"
     54
     55#: ../mk-simple-backups.php:122
     56msgid "Uploads (db based)"
     57msgstr "Uploads (DB-basierend)"
     58
     59#: ../mk-simple-backups.php:131
     60#, php-format
     61msgid "Complete Backup failed upon attempting to backup %s"
     62msgstr "Backup gescheitert bei %s"
     63
     64#: ../mk-simple-backups.php:144
     65#, php-format
     66msgid "Backup %s created (containing %s)"
     67msgstr "Backup %s erstellt (enthält %s)"
     68
     69#: ../mk-simple-backups.php:148
     70#, php-format
     71msgid "ZIP Archive %s failed, partial Backups exist"
     72msgstr ""
     73"ZIP Archiv %s konnte nicht erstellt werden, einzelne Backups sind erstellt"
     74
     75#: ../mk-simple-backups.php:188
    10076msgid "One file"
    10177msgstr "Eine Datei"
    10278
    103 #: ../mk-simple-backups.php:188
     79#: ../mk-simple-backups.php:189
    10480#, php-format
    10581msgid "%s files"
    10682msgstr "%s Dateien"
    10783
    108 #: ../mk-simple-backups.php:241
     84#: ../mk-simple-backups.php:219
    10985msgid "Important"
    11086msgstr "Wichtig"
    11187
    112 #: ../mk-simple-backups.php:241
     88#: ../mk-simple-backups.php:219
    11389msgid ""
    11490"Since the sql-dump-file will include usernames for your wp-installation, "
     
    11894"Download gelöscht werden."
    11995
    120 #: ../mk-simple-backups.php:242
     96#: ../mk-simple-backups.php:220
    12197msgid "Delete files in Backup directory."
    12298msgstr "Dateien im Backup Verzeichnis löschen."
    12399
    124 #: ../mk-simple-backups.php:246
     100#: ../mk-simple-backups.php:224
    125101msgid "Currently no backups stored on the server"
    126102msgstr "Momentan keine Backups auf dem Server"
    127103
    128 #: ../mk-simple-backups.php:259
     104#: ../mk-simple-backups.php:237
    129105msgid "Create Backup"
    130106msgstr "Backup erstellen"
    131107
    132 #: ../mk-simple-backups.php:261
     108#: ../mk-simple-backups.php:240
    133109msgid "Active Theme"
    134110msgstr "Aktives Theme"
    135111
    136 #: ../mk-simple-backups.php:262
    137 msgid "create Theme Backup"
    138 msgstr "Theme Backup erstellen"
    139 
    140 #: ../mk-simple-backups.php:263
    141 #, php-format
    142 msgid "All uploads within %s"
    143 msgstr "Alle Uploads in %s"
    144 
    145 #: ../mk-simple-backups.php:264 ../mk-simple-backups.php:266
    146 msgid "create Upload Backup"
    147 msgstr "Upload Backup erstellen"
    148 
    149 #: ../mk-simple-backups.php:265
    150 msgid "Backup Attachments from DB (post_type: attachment)"
    151 msgstr "Backup Attachments aus der DB (post_type: attachment)"
    152 
    153 #: ../mk-simple-backups.php:267
     112#: ../mk-simple-backups.php:241
    154113msgid "SQL-Dump"
    155114msgstr "SQL-Dump"
    156115
    157 #: ../mk-simple-backups.php:267
    158 msgid "Database"
    159 msgstr "Datenbank"
    160 
    161 #: ../mk-simple-backups.php:268
    162 msgid "create DB Backup"
    163 msgstr "DB Backup erstellen"
    164 
    165 #: ../mk-simple-backups.php:269
     116#: ../mk-simple-backups.php:244
     117#, fuzzy, php-format
     118msgid "All files within %s"
     119msgstr "Alle Uploads in %s"
     120
     121#: ../mk-simple-backups.php:245
     122#, fuzzy
     123msgid "Attachments from DB (post_type: attachment)"
     124msgstr "Backup Attachments aus der DB (post_type: attachment)"
     125
     126#: ../mk-simple-backups.php:250
     127#, fuzzy
     128msgid "create Backup"
     129msgstr "Backup erstellen"
     130
     131#: ../mk-simple-backups.php:253
     132msgid "Backup directory"
     133msgstr "Backup Verzeichnis"
     134
     135#: ../mk-simple-backups.php:256
     136msgid "Info"
     137msgstr "Info"
     138
     139#: ../mk-simple-backups.php:258
    166140msgid "Blank File"
    167141msgstr "Leere Datei"
    168142
    169 #: ../mk-simple-backups.php:269
     143#: ../mk-simple-backups.php:258
    170144msgid "test writing permissions"
    171145msgstr "Schreibberechtigungen prüfen"
    172146
    173 #: ../mk-simple-backups.php:270
     147#: ../mk-simple-backups.php:259
    174148msgid "create Blank File"
    175149msgstr "Leere Datei erstellen"
    176150
    177 #: ../mk-simple-backups.php:272
    178 msgid "All-in-One"
    179 msgstr "Alles-in-Einem"
    180 
    181 #: ../mk-simple-backups.php:272
    182 msgid "attempt to create all Backup-Types at once"
    183 msgstr "Alle Einzelbackups auf einmal erstellen"
    184 
    185 #: ../mk-simple-backups.php:273
    186 msgid "script might time out"
    187 msgstr "Script kann maximale Ausführzeit überschreiten"
    188 
    189 #: ../mk-simple-backups.php:274
    190 msgid "create DB, Media & Theme Backup"
    191 msgstr "DB, Upload und Theme Backup erstellen"
    192 
    193 #: ../mk-simple-backups.php:278
    194 msgid "Backup directory"
    195 msgstr "Backup Verzeichnis"
    196 
    197 #: ../mk-simple-backups.php:281
     151#: ../mk-simple-backups.php:261
    198152msgid "What's going on?"
    199153msgstr "Was passiert im Hintergrund?"
    200154
    201 #: ../mk-simple-backups.php:282
     155#: ../mk-simple-backups.php:262
    202156msgid "Theme Backup"
    203157msgstr "Theme Backup"
    204158
    205 #: ../mk-simple-backups.php:282
     159#: ../mk-simple-backups.php:262
    206160msgid ""
    207161"The Theme Backup will create a ZIP Archive containing all files within the "
     
    215169"Themes zum ZIP hinzugefügt."
    216170
    217 #: ../mk-simple-backups.php:284
     171#: ../mk-simple-backups.php:264
    218172msgid "DB Backup"
    219173msgstr "Datenbank Backup"
    220174
    221 #: ../mk-simple-backups.php:284
     175#: ../mk-simple-backups.php:264
    222176msgid ""
    223177"The DB Backup creates an SQL Dump that can be used to restore your Database "
     
    237191"Zusatztabellen im Backup eingeschlossen."
    238192
    239 #: ../mk-simple-backups.php:286
     193#: ../mk-simple-backups.php:266
    240194msgid "Upload Backups"
    241195msgstr "Upload Backup"
    242196
    243 #: ../mk-simple-backups.php:286
     197#: ../mk-simple-backups.php:266
    244198msgid ""
    245199"The file-based Upload Backup will scan the whole Upload Directory (including "
     
    267221"so speichern."
    268222
    269 #: ../mk-simple-backups.php:288
    270 msgid "Complete Backup"
    271 msgstr "Komplettes Backup"
    272 
    273 #: ../mk-simple-backups.php:288
    274 msgid ""
    275 "The complete Backup will automatically perform all single Backup Tasks and "
    276 "create a ZIP Archive containing the three resulting files. This can take "
    277 "some time, if performed within a big Wordpress installation. The complete "
    278 "includes the DB approach for Uploads."
    279 msgstr ""
    280 "Das komplette Backup erstellt automatisch alle einzelnen Backups und kreiert "
    281 "daraus ein ZIP Archiv mit den drei resultierenden Dateien. In einer grossen "
    282 "Wordpress Installation kann dies einige Zeit in Anspruch nehmen. Das "
    283 "komplette Backup verwendet den Datenbank-basierten Upload Backup."
    284 
    285 #: ../mk-simple-backups.php:290
     223#: ../mk-simple-backups.php:268
    286224msgid "How long does it take?"
    287225msgstr "Wie lange dauert es?"
    288226
    289 #: ../mk-simple-backups.php:291
     227#: ../mk-simple-backups.php:269
     228#, fuzzy
    290229msgid ""
    291230"Depending on the amount of files and data, Backups can widely vary in size "
     
    294233"is being created, don't close your tab/browser and don't navigate to another "
    295234"page as that would cancel unfinished backups and may leave temporary files "
    296 "in the backup directory."
     235"in the backup directory. If a complete Backup fails, you may want to try "
     236"creating partial backups."
    297237msgstr ""
    298238"Je nach der Anzahl an Dateien und Informationen, kann die Grösse und "
     
    304244"zurückbleiben."
    305245
    306 #: ../mk-simple-backups.php:293
     246#: ../mk-simple-backups.php:271
    307247msgid "My Backup has failed, why?"
    308248msgstr "Das Backup ist gescheitert, wieso?"
    309249
    310 #: ../mk-simple-backups.php:294
     250#: ../mk-simple-backups.php:272
    311251msgid ""
    312252"Usually file-permissions are at fault if the plugins fails to create "
     
    322262"Verzeichnis von Wordpress. "
    323263
    324 #: ../mk-simple-backups.php:299
     264#: ../mk-simple-backups.php:281
    325265#, php-format
    326266msgid "Backup directory could not be created: %s"
    327267msgstr "Backup Verzeichnis konnte nicht erstellt werden: %s"
     268
     269#~ msgid "DB Backup %s created"
     270#~ msgstr "DB Backup %s erstellt"
     271
     272#~ msgid "DB Backup could not be created"
     273#~ msgstr "DB Backup konnte nicht erstellt werden"
     274
     275#~ msgid "Theme Backup %s created"
     276#~ msgstr "Theme Backup %s erstellt"
     277
     278#~ msgid "Theme Backup could not be created"
     279#~ msgstr "Theme Backup konnte nicht erstellt werden"
     280
     281#~ msgid "Upload Backup %s created"
     282#~ msgstr "Upload Backup %s erstellt"
     283
     284#~ msgid "Upload Backup could not be created"
     285#~ msgstr "Upload Backup konnte nicht erstellt werden"
     286
     287#~ msgid "DB Backup failed, complete backup aborted"
     288#~ msgstr "DB Backup gescheitert, Komplettes Backup abgebrochen"
     289
     290#~ msgid "Media Backup failed, complete backup aborted"
     291#~ msgstr "Media Backup gescheitert, Komplettes Backup abgebrochen"
     292
     293#~ msgid "Complete Backup successfully created"
     294#~ msgstr "Komplettes Backup wurde erstellt"
     295
     296#~ msgid "Complete Backup could not be created"
     297#~ msgstr "Komplettes Backup konnte nicht erstellt werden"
     298
     299#~ msgid "Media Backup by DB could not be created"
     300#~ msgstr "Upload Backup (anhand DB) konnte nicht erstellt werden"
     301
     302#~ msgid "create Theme Backup"
     303#~ msgstr "Theme Backup erstellen"
     304
     305#~ msgid "create Upload Backup"
     306#~ msgstr "Upload Backup erstellen"
     307
     308#~ msgid "create DB Backup"
     309#~ msgstr "DB Backup erstellen"
     310
     311#~ msgid "All-in-One"
     312#~ msgstr "Alles-in-Einem"
     313
     314#~ msgid "attempt to create all Backup-Types at once"
     315#~ msgstr "Alle Einzelbackups auf einmal erstellen"
     316
     317#~ msgid "script might time out"
     318#~ msgstr "Script kann maximale Ausführzeit überschreiten"
     319
     320#~ msgid "create DB, Media & Theme Backup"
     321#~ msgstr "DB, Upload und Theme Backup erstellen"
     322
     323#~ msgid "Complete Backup"
     324#~ msgstr "Komplettes Backup"
     325
     326#~ msgid ""
     327#~ "The complete Backup will automatically perform all single Backup Tasks "
     328#~ "and create a ZIP Archive containing the three resulting files. This can "
     329#~ "take some time, if performed within a big Wordpress installation. The "
     330#~ "complete includes the DB approach for Uploads."
     331#~ msgstr ""
     332#~ "Das komplette Backup erstellt automatisch alle einzelnen Backups und "
     333#~ "kreiert daraus ein ZIP Archiv mit den drei resultierenden Dateien. In "
     334#~ "einer grossen Wordpress Installation kann dies einige Zeit in Anspruch "
     335#~ "nehmen. Das komplette Backup verwendet den Datenbank-basierten Upload "
     336#~ "Backup."
  • mk-simple-backups/tags/0.6/mk-simple-backups.php

    r892855 r892993  
    55 * Plugin URI: http://wordpress.org/plugins/mk-simple-backups/
    66 * Description: Allows you to create simple backups on a dedicated page nested in the "Tools" Menu.
    7  * Version: 0.5
     7 * Version: 0.6
    88 * Author: Michael Kühni
    99 * Author URI: http://michaelkuehni.ch
     
    6464   
    6565        $msg = array();
     66        $this_plugin_data = get_plugin_data( __FILE__);
    6667   
    6768   
     
    8788                    break;
    8889               
    89                 case "createdbbkp":
    90                     $s = $bkp->createDBBackup();
    91                     if($s != false) $msg[] = array("txt"=>sprintf(__( 'DB Backup %s created', 'mk-simple-backups' ), $s ));
    92                     else $msg[] = array("txt"=>__( 'DB Backup could not be created', 'mk-simple-backups' ), "error"=>true);
    93                     break;
    94            
    95                 case "createthemebkp":
    96                     $s = $bkp->createThemeBackup();
    97                     if($s != false) $msg[] = array("txt"=>sprintf(__( 'Theme Backup %s created', 'mk-simple-backups' ), $s ));
    98                     else $msg[] = array("txt"=>__( 'Theme Backup could not be created', 'mk-simple-backups' ), "error"=>true);
    99                     break;
    100                
    101                 case "createuploadbkp":
    102                     $s = $bkp->createUploadBackup();
    103                     if($s != false) $msg[] = array("txt"=>sprintf(__( 'Upload Backup %s created', 'mk-simple-backups' ), $s ));
    104                     else $msg[] = array("txt"=>__( 'Upload Backup could not be created', 'mk-simple-backups' ), "error"=>true);
    105                     break;
    106                
    107                 case "createCompleteBackup":
    108                     $s1 = $bkp->createDBBackup();
    109                     if($s1 == false) $msg = array( "txt"=>__("DB Backup failed, complete backup aborted", "mk-simple-backups"), "error"=>true );
    110                     $s2 = $bkp->createThemeBackup();
    111                     if($s2 == false) $msg = array( "txt"=>__("Theme Backup failed, complete backup aborted", "mk-simple-backups"), "error"=>true );
    112                     $s3 = $bkp->createUploadBackupByDB();
    113                     if($s3 == false) $msg = array( "txt"=>__("Media Backup failed, complete backup aborted", "mk-simple-backups"), "error"=>true );
    114                    
    115                     // currently no zip will be done
    116                     if($s1 != false && $s2 != false && $s3 != false) {
    117                        
    118                         // create array with backups
    119                         $bkp_files = array(
    120                             $s1=>$bkp->backup_dir . "/" . $s1,
    121                             $s2=>$bkp->backup_dir . "/" . $s2,
    122                             $s3=>$bkp->backup_dir . "/" . $s3 );
    123                        
    124                         // create zip
    125                         $zip_path = $bkp->backup_dir . "/" . $bkp->getBackupName("complete", ".zip" );
    126                         $s = $bkp->createZip( $zip_path , $bkp_files );
    127                        
    128                         // check if zip was created successfully
    129                         if($s) {
    130                             $bkp->removeFiles( array($s1, $s2, $s3) );
    131                             $bkp->backups_exist = true;
    132                             $msg[] = array( "txt"=>__("Complete Backup successfully created", "mk-simple-backups"));
    133                         } else {
    134                             $msg[] = array( "txt"=>__("Complete Backup could not be created", "mk-simple-backups"));
    135                         }
    136                        
    137                        
    138                        
    139                     }
    140                     break;
    141                
    142                 case "createuploadbkpbydb":
    143                     $s = $bkp->createUploadBackupByDB();
    144                     if($s != false) $msg[] = array("txt"=> sprintf(__("Backup %s created", "mk-simple-backups"), $s));
    145                     else $msg[] = array("txt"=>__("Media Backup by DB could not be created", "mk-simple-backups"), "error"=>true);
    146                     break;
    147                
    14890                case "flush";
    14991                    $s = $bkp->flushBackupDir();
     
    15193                    else $msg[] = array("txt"=>__("Some files could not be removed by the script. Check File-Permissions or delete the files manually.", "mk-simple-backups"), "error" => true);
    15294                    break;
    153 
     95                   
     96                case "createBackup":
     97                   
     98                    $bkp_options = $_POST["options"];
     99                    $bkp_single_files_with_path = array();
     100                    $bkp_single_files = array();
     101
     102                   
     103                    if(count($bkp_options) > 0) {
     104                        foreach($bkp_options AS $o) {
     105                           
     106                            switch($o) {
     107                                case "db":
     108                                    $s = $bkp->createDBBackup();
     109                                    $desc = __("Database", "mk-simple-backups");
     110                                    break;
     111                                case "theme":
     112                                    $s = $bkp->createThemeBackup();
     113                                    $desc = __("Theme", "mk-simple-backups");
     114                                    break;
     115                                case "uploads":
     116                                    if($_POST["upload_options"] == "file") {
     117                                        $s = $bkp->createUploadBackupByDB();
     118                                        $desc = __("Uploads (file based)", "mk-simple-backups");
     119                                    }
     120                                    else {
     121                                        $s = $bkp->createUploadBackup();
     122                                        $desc = __("Uploads (db based)", "mk-simple-backups");
     123                                    }
     124                                    break;
     125                            }
     126                           
     127                            if($s != false) {
     128                                $bkp_single_files[] = $s;
     129                                $bkp_single_files_with_path[] = $bkp->backup_dir . "/" . $s;
     130                            } else {
     131                                $msg[] = array( "txt"=>sprintf(__("Complete Backup failed upon attempting to backup %s", "mk-simple-backups"), $desc), "error"=>true );
     132                                break;
     133                            }   
     134                        } // end foreach
     135                       
     136                        // create zip
     137                        $bkp_filename = $bkp->getBackupName( "bkp_" . sanitize_title(get_bloginfo("name"), "default"), "_" . implode($bkp->sep, $bkp_options)  . ".zip");
     138                        $s = $bkp->createZip( $bkp->backup_dir . "/" . $bkp_filename, $bkp_single_files_with_path);
     139                       
     140                        if($s != false) {
     141                           
     142                            $bkp->removeFiles($bkp_single_files);
     143                            $bkp->backups_exist = true;
     144                            $msg[] = array( "txt"=>sprintf(__("Backup %s created (containing %s)", "mk-simple-backups"), $bkp_filename, implode(", ", $bkp_options)) );
     145                           
     146                        } else {
     147                           
     148                            $msg[] = array( "txt"=>sprintf(__("ZIP Archive %s failed, partial Backups exist", "mk-simple-backups"), $bkp_filename), "error"=>true );
     149                           
     150                        }
     151
     152                    } // end if check for anything to backup
     153                   
     154                   
     155                    break;
    154156            }
    155        
    156157       
    157158            // echo msg's
     
    197198                   
    198199                    // determine type of file by the first 2 characters
    199                     $begin = substr($name, 0, 2);
    200                    
    201                     switch($begin)
    202                     {
    203                         default:
    204                             $fileclass = "";
    205                             break;
    206                         case "up":
    207                             $fileclass = "uploads";
    208                             break;
    209                        
    210                         case "db":
    211                             $fileclass = "db";
    212                             break;
    213                        
    214                         case "co":
    215                             $fileclass = "archive";
    216                             break;
    217                        
    218                         case "te":
    219                             $fileclass = "empty";
    220                             break;
    221                        
    222                         case "th":
    223                             $fileclass="theme";
    224                             break;
    225                     }
     200                    $suffix = substr($name, strlen($name)-3);
     201   
     202                    if($suffix == "zip") $fileclass = "archive";
     203                    else $fileclass = "default";
    226204                   
    227205                    // get filesize
     
    258236                ?>
    259237                <h3><? _e('Create Backup', 'mk-simple-backups'); ?></h3>
    260                 <ul class="actions">
    261                     <li class="theme"><strong><?=wp_get_theme();?></strong>, <? _e('Active Theme', 'mk-simple-backups'); ?><br />
    262                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createthemebkp"><? _e('create Theme Backup', 'mk-simple-backups'); ?></a></li>
    263                     <li class="uploads"><strong>/uploads</strong>, <? printf( __('All uploads within %s', 'mk-simple-backups'), $bkp->upload_dir["baseurl"]); ?><br />
    264                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createuploadbkp"><? _e('create Upload Backup', 'mk-simple-backups'); ?></a></li>
    265                     <li class="uploads"><strong>/uploads</strong>, <? _e('Backup Attachments from DB (post_type: attachment)', 'mk-simple-backups'); ?><br />
    266                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createuploadbkpbydb"><? _e('create Upload Backup', 'mk-simple-backups'); ?></a></li>
    267                     <li class="db"><strong><? _e('SQL-Dump', 'mk-simple-backups'); ?></strong>, <? _e('Database', 'mk-simple-backups'); ?><br />
    268                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createdbbkp"><? _e('create DB Backup', 'mk-simple-backups'); ?></a></li>
    269                     <li class="test"><strong><? _e('Blank File', 'mk-simple-backups'); ?></strong>, <? _e('test writing permissions', 'mk-simple-backups'); ?><br />
    270                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createtestfile"><? _e('create Blank File', 'mk-simple-backups'); ?></a></li>
    271                     <li class="allinone">
    272                         <strong><? _e("All-in-One", "mk-simple-backups") ?></strong>, <? _e("attempt to create all Backup-Types at once", "mk-simple-backups") ?><br />
    273                         <em><? _e("script might time out", "mk-simple-backups") ?></em><br />
    274                         <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createCompleteBackup"><? _e("create DB, Media & Theme Backup", "mk-simple-backups")?></a>
    275                     </li>
    276                 </ul>
     238                <form action="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createBackup" method="post">
     239                    <ul class="options">
     240                        <li class="theme"><label><input type="checkbox" name="options[]" value="theme" checked="checked"><strong><?=wp_get_theme();?></strong>, <? _e('Active Theme', 'mk-simple-backups'); ?></label></li>
     241                        <li class="db"><label><input type="checkbox" name="options[]" value="db" checked="checked"><strong><? _e('SQL-Dump', 'mk-simple-backups'); ?></strong>, <? _e('Database', 'mk-simple-backups'); ?></label></li>
     242                        <li class="uploads"><label><input type="checkbox" name="options[]" value="uploads" checked="checked"><strong>/uploads</strong>, Uploads</label>
     243                            <select name="upload_options">
     244                                <option value="file"><? printf( __('All files within %s', 'mk-simple-backups'), $bkp->upload_dir["baseurl"]); ?></option>
     245                                <option value="db" selected="selected"><? _e('Attachments from DB (post_type: attachment)', 'mk-simple-backups'); ?></option>
     246                            </select></li>
     247                       
     248                    </ul>
     249                   
     250                    <p><input type="submit" value="<? _e("create Backup", "mk-simple-backups");?>" class="button action"></p>
     251                </form>
    277252                <p><hr /></p>
    278253                <p><? _e('Backup directory', 'mk-simple-backups'); ?>: <br />
    279254                    <em><?=$bkp->backup_dir?></em></p>
    280255                <p><hr /></p>
     256                <h3><? _e("Info", "mk-simple-backups") ?></h3>
     257                <ul class="actions">
     258                    <li class="test"><strong><? _e('Blank File', 'mk-simple-backups'); ?></strong>, <? _e('test writing permissions', 'mk-simple-backups'); ?><br />
     259                    <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createtestfile"><? _e('create Blank File', 'mk-simple-backups'); ?></a></li>
     260                </ul>
    281261                <h4><? _e("What's going on?", "mk-simple-backups") ?></h4>
    282262                <p class="readable"><strong><? _e("Theme Backup", "mk-simple-backups");?></strong>: <? _e("The Theme Backup will create a ZIP Archive containing all files within the directory of your current active theme. If the active theme is a child-theme, the backup will detect this and include all files from the parent theme.", "mk-simple-backups")?></p>
     
    286266                <p class="readable"><strong><? _e("Upload Backups", "mk-simple-backups");?></strong>: <? _e("The file-based Upload Backup will scan the whole Upload Directory (including subfolders) and create a ZIP Archive containing all files found. If there are many files in the upload directory, the script might time out. The DB based Upload Backup will fetch Attachments from the DB and create a ZIP Archive with found files. In the DB approach, the thumbnails and scaled versions are not included, since they can be regenerated afterwards easily. By ommitting those files, the DB approach saves space and script execution time. The DB based approach can be incomplete when plugins create files in the upload directory that arent included in the DB as attachments. There are plugins that do this.", "mk-simple-backups")?></p>
    287267               
    288                 <p class="readable"><strong><? _e("Complete Backup", "mk-simple-backups");?></strong>: <? _e("The complete Backup will automatically perform all single Backup Tasks and create a ZIP Archive containing the three resulting files. This can take some time, if performed within a big Wordpress installation. The complete includes the DB approach for Uploads.", "mk-simple-backups")?></p>
    289                
    290268                <h4><? _e("How long does it take?", "mk-simple-backups") ?></h4>
    291                 <p class="readable"><? _e("Depending on the amount of files and data, Backups can widely vary in size and time taken to create. The script attempts to increase maximum execution time for php scripts to allow larger Backups to be created. While a backup is being created, don't close your tab/browser and don't navigate to another page as that would cancel unfinished backups and may leave temporary files in the backup directory.", "mk-simple-backups")?></p>
     269                <p class="readable"><? _e("Depending on the amount of files and data, Backups can widely vary in size and time taken to create. The script attempts to increase maximum execution time for php scripts to allow larger Backups to be created. While a backup is being created, don't close your tab/browser and don't navigate to another page as that would cancel unfinished backups and may leave temporary files in the backup directory. If a complete Backup fails, you may want to try creating partial backups.", "mk-simple-backups")?></p>
    292270               
    293271                <h4><? _e("My Backup has failed, why?", "mk-simple-backups") ?></h4>
    294272                <p class="readable"><? _e("Usually file-permissions are at fault if the plugins fails to create Backups. Use your FTP-Client to make sure writing permission on the Backup Directory (refer to the path displayed above) are set to writeable. If there's other problems, use the Plugin Page in the Plugin Repository to request support or patching.")?></p>
     273               
     274                <p><hr /></p>
     275                <p class="small">Plugin <a href="<?=$this_plugin_data["pluginURI"]?>" target="_blank"><?=$this_plugin_data["Name"] ?></a> v<?=$this_plugin_data["Version"]?></p>
     276               
    295277                <?
    296278           
  • mk-simple-backups/tags/0.6/readme.txt

    r892855 r892993  
    33Tags: backup, db, uploads
    44Requires at least: 3.8
    5 Stable tag: 0.5
     5Stable tag: 0.6
    66Tested up to: 3.9RC1
    77License: GPLv2 or later
     
    4545
    4646== Changelog ==
     47
     48= 0.6 =
     49* Simplified UI by shifting from single-action links to option-based form
     50* Backup Name uses Site Name
     51* Backup Name reflects contents
     52* Moved blank file link to info section
     53* Added plugin repository link to the footer
     54* Updated Language Files (german, english)
     55* Simplified Icons
     56* Updated Screenshot
     57* Updated Read-Me
    4758
    4859= 0.5 =
     
    94105== Upgrade Notice ==
    95106
     107= 0.6 =
     108Switching to form based Backup Creation
     109
    96110= 0.5 =
    97111Added features, check the changelog for detailed information
  • mk-simple-backups/trunk/assets/css/general.css

    r892855 r892993  
    1 
    2 
    3 /*
    4  *      icons for create backup links
    5  */
    6 .actions a {
     1/* icons for creating backups/file */
     2.actions a, .options strong {
    73    padding-left: 20px;
    84}
    95
    10 .actions .db a{ background: url("../images/database_add.png") left center no-repeat; }
    11 .actions .uploads a{ background: url("../images/camera_add.png") left center no-repeat; }
    12 .actions .theme a{ background: url("../images/layout_add.png") left center no-repeat; }
     6.options .db strong { background: url("../images/database.png") left center no-repeat; }
     7.options .uploads strong { background: url("../images/pictures.png") left center no-repeat; }
     8.options .theme strong { background: url("../images/layout.png") left center no-repeat; }
     9
    1310.actions .test a{ background: url("../images/page_white_add.png") left center no-repeat; }
    14 .actions .allinone a{ background: url("../images/add.png") left center no-repeat; }
    1511
    1612
    17 /*
    18  *      icons for file list
    19  */
     13/* remove text selection marker for backup options */
     14.options label {
     15    -webkit-touch-callout: none;
     16    -webkit-user-select: none;
     17    -khtml-user-select: none;
     18    -moz-user-select: none;
     19    -ms-user-select: none;
     20    user-select: none;
     21}
     22
     23.options li, .filelist li {
     24    margin-top: 0.4em;
     25    line-height: 2em;
     26}
     27
     28
     29/* icons for file list */
    2030.filelist li {
    2131    padding-left: 20px;
    2232}
    2333
    24 .filelist .uploads { background: url("../images/camera.png") left center no-repeat; }
    25 .filelist .theme { background: url("../images/layout.png") left center no-repeat; }
    26 .filelist .db { background: url("../images/database.png") left center no-repeat; }
    27 .filelist .empty { background: url("../images/page_white.png") left center no-repeat; }
    28 .filelist .archive { background: url("../images/compress.png") left center no-repeat; }
     34.filelist .default { background: url("../images/page_white.png") left center no-repeat; }
     35.filelist .archive { background: url("../images/page_white_zip.png") left center no-repeat; }
    2936
    3037
    31 /*
    32  *      basic error class
    33  */
     38/* basic error class */
    3439.error { color: crimson; }
    3540
    36 /*
    37  *      class for multiline text, to decrease text-line width
    38  */
     41
     42/* class for multiline text, to decrease text-line width */
    3943.readable {
    4044    max-width: 50em;
    4145}
     46
     47/* small footer */
     48.small {
     49    font-size: 90%;
     50    opacity: 0.8;
     51}
     52
     53.small a {
     54    color: inherit;
     55}
  • mk-simple-backups/trunk/class.backuphandler.php

    r892855 r892993  
    1717    public $backup_dir_weburl = "";
    1818    public $upload_dir = "";
    19     private $sep = "-";
     19    public $sep = "-";
    2020   
    2121    function __construct() {
     
    148148        }
    149149       
    150         foreach($files_to_add as $file) {
    151             $zip->addFile($file,$file);
    152         }
     150        if(count($files_to_add) > 0) {
     151            foreach($files_to_add as $file) {
     152                $zip->addFile($file,$file);
     153            }
     154        } else return false;
     155       
    153156        //debug
    154157        //echo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status;
  • mk-simple-backups/trunk/languages/mk-simple-backups-de_DE.po

    r892855 r892993  
    22msgstr ""
    33"Project-Id-Version: mk-simple-backups\n"
    4 "POT-Creation-Date: 2014-04-14 13:47+0100\n"
    5 "PO-Revision-Date: 2014-04-14 13:47+0100\n"
     4"POT-Creation-Date: 2014-04-14 17:57+0100\n"
     5"PO-Revision-Date: 2014-04-14 17:57+0100\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    1616"X-Poedit-SearchPath-0: ..\n"
    1717
    18 #: ../mk-simple-backups.php:71
     18#: ../mk-simple-backups.php:72
    1919msgid "Backup"
    2020msgstr "Backup"
    2121
    22 #: ../mk-simple-backups.php:85
     22#: ../mk-simple-backups.php:86
    2323#, php-format
    2424msgid "Blank File %s created"
    2525msgstr "Leere Datei %s erstellt"
    2626
    27 #: ../mk-simple-backups.php:86
     27#: ../mk-simple-backups.php:87
    2828msgid "Blank File could not be created"
    2929msgstr "Leere Datei konnte nicht erstellt werden"
    3030
    31 #: ../mk-simple-backups.php:91
    32 #, php-format
    33 msgid "DB Backup %s created"
    34 msgstr "DB Backup %s erstellt"
    35 
    3631#: ../mk-simple-backups.php:92
    37 msgid "DB Backup could not be created"
    38 msgstr "DB Backup konnte nicht erstellt werden"
    39 
    40 #: ../mk-simple-backups.php:97
    41 #, php-format
    42 msgid "Theme Backup %s created"
    43 msgstr "Theme Backup %s erstellt"
    44 
    45 #: ../mk-simple-backups.php:98
    46 msgid "Theme Backup could not be created"
    47 msgstr "Theme Backup konnte nicht erstellt werden"
    48 
    49 #: ../mk-simple-backups.php:103
    50 #, php-format
    51 msgid "Upload Backup %s created"
    52 msgstr "Upload Backup %s erstellt"
    53 
    54 #: ../mk-simple-backups.php:104
    55 msgid "Upload Backup could not be created"
    56 msgstr "Upload Backup konnte nicht erstellt werden"
    57 
    58 #: ../mk-simple-backups.php:109
    59 msgid "DB Backup failed, complete backup aborted"
    60 msgstr "DB Backup gescheitert, Komplettes Backup abgebrochen"
    61 
    62 #: ../mk-simple-backups.php:111
    63 msgid "Theme Backup failed, complete backup aborted"
    64 msgstr "Theme Backup gescheitert, Komplettes Backup abgebrochen"
    65 
    66 #: ../mk-simple-backups.php:113
    67 msgid "Media Backup failed, complete backup aborted"
    68 msgstr "Media Backup gescheitert, Komplettes Backup abgebrochen"
    69 
    70 #: ../mk-simple-backups.php:132
    71 msgid "Complete Backup successfully created"
    72 msgstr "Komplettes Backup wurde erstellt"
    73 
    74 #: ../mk-simple-backups.php:134
    75 msgid "Complete Backup could not be created"
    76 msgstr "Komplettes Backup konnte nicht erstellt werden"
    77 
    78 #: ../mk-simple-backups.php:144
    79 #, php-format
    80 msgid "Backup %s created"
    81 msgstr "Backup %s erstellt"
    82 
    83 #: ../mk-simple-backups.php:145
    84 msgid "Media Backup by DB could not be created"
    85 msgstr "Upload Backup (anhand DB) konnte nicht erstellt werden"
    86 
    87 #: ../mk-simple-backups.php:150
    8832msgid "Files in the backup directory were deleted"
    8933msgstr "Dateien im Backup Verzeichnis gelöscht"
    9034
    91 #: ../mk-simple-backups.php:151
     35#: ../mk-simple-backups.php:93
    9236msgid ""
    9337"Some files could not be removed by the script. Check File-Permissions or "
     
    9741"prüfen und allenfalls manuell entfernen."
    9842
    99 #: ../mk-simple-backups.php:187
     43#: ../mk-simple-backups.php:109 ../mk-simple-backups.php:241
     44msgid "Database"
     45msgstr "Datenbank"
     46
     47#: ../mk-simple-backups.php:113
     48msgid "Theme"
     49msgstr "Theme"
     50
     51#: ../mk-simple-backups.php:118
     52msgid "Uploads (file based)"
     53msgstr "Uploads (Verzeichnis-basierend)"
     54
     55#: ../mk-simple-backups.php:122
     56msgid "Uploads (db based)"
     57msgstr "Uploads (DB-basierend)"
     58
     59#: ../mk-simple-backups.php:131
     60#, php-format
     61msgid "Complete Backup failed upon attempting to backup %s"
     62msgstr "Backup gescheitert bei %s"
     63
     64#: ../mk-simple-backups.php:144
     65#, php-format
     66msgid "Backup %s created (containing %s)"
     67msgstr "Backup %s erstellt (enthält %s)"
     68
     69#: ../mk-simple-backups.php:148
     70#, php-format
     71msgid "ZIP Archive %s failed, partial Backups exist"
     72msgstr ""
     73"ZIP Archiv %s konnte nicht erstellt werden, einzelne Backups sind erstellt"
     74
     75#: ../mk-simple-backups.php:188
    10076msgid "One file"
    10177msgstr "Eine Datei"
    10278
    103 #: ../mk-simple-backups.php:188
     79#: ../mk-simple-backups.php:189
    10480#, php-format
    10581msgid "%s files"
    10682msgstr "%s Dateien"
    10783
    108 #: ../mk-simple-backups.php:241
     84#: ../mk-simple-backups.php:219
    10985msgid "Important"
    11086msgstr "Wichtig"
    11187
    112 #: ../mk-simple-backups.php:241
     88#: ../mk-simple-backups.php:219
    11389msgid ""
    11490"Since the sql-dump-file will include usernames for your wp-installation, "
     
    11894"Download gelöscht werden."
    11995
    120 #: ../mk-simple-backups.php:242
     96#: ../mk-simple-backups.php:220
    12197msgid "Delete files in Backup directory."
    12298msgstr "Dateien im Backup Verzeichnis löschen."
    12399
    124 #: ../mk-simple-backups.php:246
     100#: ../mk-simple-backups.php:224
    125101msgid "Currently no backups stored on the server"
    126102msgstr "Momentan keine Backups auf dem Server"
    127103
    128 #: ../mk-simple-backups.php:259
     104#: ../mk-simple-backups.php:237
    129105msgid "Create Backup"
    130106msgstr "Backup erstellen"
    131107
    132 #: ../mk-simple-backups.php:261
     108#: ../mk-simple-backups.php:240
    133109msgid "Active Theme"
    134110msgstr "Aktives Theme"
    135111
    136 #: ../mk-simple-backups.php:262
    137 msgid "create Theme Backup"
    138 msgstr "Theme Backup erstellen"
    139 
    140 #: ../mk-simple-backups.php:263
    141 #, php-format
    142 msgid "All uploads within %s"
    143 msgstr "Alle Uploads in %s"
    144 
    145 #: ../mk-simple-backups.php:264 ../mk-simple-backups.php:266
    146 msgid "create Upload Backup"
    147 msgstr "Upload Backup erstellen"
    148 
    149 #: ../mk-simple-backups.php:265
    150 msgid "Backup Attachments from DB (post_type: attachment)"
    151 msgstr "Backup Attachments aus der DB (post_type: attachment)"
    152 
    153 #: ../mk-simple-backups.php:267
     112#: ../mk-simple-backups.php:241
    154113msgid "SQL-Dump"
    155114msgstr "SQL-Dump"
    156115
    157 #: ../mk-simple-backups.php:267
    158 msgid "Database"
    159 msgstr "Datenbank"
    160 
    161 #: ../mk-simple-backups.php:268
    162 msgid "create DB Backup"
    163 msgstr "DB Backup erstellen"
    164 
    165 #: ../mk-simple-backups.php:269
     116#: ../mk-simple-backups.php:244
     117#, fuzzy, php-format
     118msgid "All files within %s"
     119msgstr "Alle Uploads in %s"
     120
     121#: ../mk-simple-backups.php:245
     122#, fuzzy
     123msgid "Attachments from DB (post_type: attachment)"
     124msgstr "Backup Attachments aus der DB (post_type: attachment)"
     125
     126#: ../mk-simple-backups.php:250
     127#, fuzzy
     128msgid "create Backup"
     129msgstr "Backup erstellen"
     130
     131#: ../mk-simple-backups.php:253
     132msgid "Backup directory"
     133msgstr "Backup Verzeichnis"
     134
     135#: ../mk-simple-backups.php:256
     136msgid "Info"
     137msgstr "Info"
     138
     139#: ../mk-simple-backups.php:258
    166140msgid "Blank File"
    167141msgstr "Leere Datei"
    168142
    169 #: ../mk-simple-backups.php:269
     143#: ../mk-simple-backups.php:258
    170144msgid "test writing permissions"
    171145msgstr "Schreibberechtigungen prüfen"
    172146
    173 #: ../mk-simple-backups.php:270
     147#: ../mk-simple-backups.php:259
    174148msgid "create Blank File"
    175149msgstr "Leere Datei erstellen"
    176150
    177 #: ../mk-simple-backups.php:272
    178 msgid "All-in-One"
    179 msgstr "Alles-in-Einem"
    180 
    181 #: ../mk-simple-backups.php:272
    182 msgid "attempt to create all Backup-Types at once"
    183 msgstr "Alle Einzelbackups auf einmal erstellen"
    184 
    185 #: ../mk-simple-backups.php:273
    186 msgid "script might time out"
    187 msgstr "Script kann maximale Ausführzeit überschreiten"
    188 
    189 #: ../mk-simple-backups.php:274
    190 msgid "create DB, Media & Theme Backup"
    191 msgstr "DB, Upload und Theme Backup erstellen"
    192 
    193 #: ../mk-simple-backups.php:278
    194 msgid "Backup directory"
    195 msgstr "Backup Verzeichnis"
    196 
    197 #: ../mk-simple-backups.php:281
     151#: ../mk-simple-backups.php:261
    198152msgid "What's going on?"
    199153msgstr "Was passiert im Hintergrund?"
    200154
    201 #: ../mk-simple-backups.php:282
     155#: ../mk-simple-backups.php:262
    202156msgid "Theme Backup"
    203157msgstr "Theme Backup"
    204158
    205 #: ../mk-simple-backups.php:282
     159#: ../mk-simple-backups.php:262
    206160msgid ""
    207161"The Theme Backup will create a ZIP Archive containing all files within the "
     
    215169"Themes zum ZIP hinzugefügt."
    216170
    217 #: ../mk-simple-backups.php:284
     171#: ../mk-simple-backups.php:264
    218172msgid "DB Backup"
    219173msgstr "Datenbank Backup"
    220174
    221 #: ../mk-simple-backups.php:284
     175#: ../mk-simple-backups.php:264
    222176msgid ""
    223177"The DB Backup creates an SQL Dump that can be used to restore your Database "
     
    237191"Zusatztabellen im Backup eingeschlossen."
    238192
    239 #: ../mk-simple-backups.php:286
     193#: ../mk-simple-backups.php:266
    240194msgid "Upload Backups"
    241195msgstr "Upload Backup"
    242196
    243 #: ../mk-simple-backups.php:286
     197#: ../mk-simple-backups.php:266
    244198msgid ""
    245199"The file-based Upload Backup will scan the whole Upload Directory (including "
     
    267221"so speichern."
    268222
    269 #: ../mk-simple-backups.php:288
    270 msgid "Complete Backup"
    271 msgstr "Komplettes Backup"
    272 
    273 #: ../mk-simple-backups.php:288
    274 msgid ""
    275 "The complete Backup will automatically perform all single Backup Tasks and "
    276 "create a ZIP Archive containing the three resulting files. This can take "
    277 "some time, if performed within a big Wordpress installation. The complete "
    278 "includes the DB approach for Uploads."
    279 msgstr ""
    280 "Das komplette Backup erstellt automatisch alle einzelnen Backups und kreiert "
    281 "daraus ein ZIP Archiv mit den drei resultierenden Dateien. In einer grossen "
    282 "Wordpress Installation kann dies einige Zeit in Anspruch nehmen. Das "
    283 "komplette Backup verwendet den Datenbank-basierten Upload Backup."
    284 
    285 #: ../mk-simple-backups.php:290
     223#: ../mk-simple-backups.php:268
    286224msgid "How long does it take?"
    287225msgstr "Wie lange dauert es?"
    288226
    289 #: ../mk-simple-backups.php:291
     227#: ../mk-simple-backups.php:269
     228#, fuzzy
    290229msgid ""
    291230"Depending on the amount of files and data, Backups can widely vary in size "
     
    294233"is being created, don't close your tab/browser and don't navigate to another "
    295234"page as that would cancel unfinished backups and may leave temporary files "
    296 "in the backup directory."
     235"in the backup directory. If a complete Backup fails, you may want to try "
     236"creating partial backups."
    297237msgstr ""
    298238"Je nach der Anzahl an Dateien und Informationen, kann die Grösse und "
     
    304244"zurückbleiben."
    305245
    306 #: ../mk-simple-backups.php:293
     246#: ../mk-simple-backups.php:271
    307247msgid "My Backup has failed, why?"
    308248msgstr "Das Backup ist gescheitert, wieso?"
    309249
    310 #: ../mk-simple-backups.php:294
     250#: ../mk-simple-backups.php:272
    311251msgid ""
    312252"Usually file-permissions are at fault if the plugins fails to create "
     
    322262"Verzeichnis von Wordpress. "
    323263
    324 #: ../mk-simple-backups.php:299
     264#: ../mk-simple-backups.php:281
    325265#, php-format
    326266msgid "Backup directory could not be created: %s"
    327267msgstr "Backup Verzeichnis konnte nicht erstellt werden: %s"
     268
     269#~ msgid "DB Backup %s created"
     270#~ msgstr "DB Backup %s erstellt"
     271
     272#~ msgid "DB Backup could not be created"
     273#~ msgstr "DB Backup konnte nicht erstellt werden"
     274
     275#~ msgid "Theme Backup %s created"
     276#~ msgstr "Theme Backup %s erstellt"
     277
     278#~ msgid "Theme Backup could not be created"
     279#~ msgstr "Theme Backup konnte nicht erstellt werden"
     280
     281#~ msgid "Upload Backup %s created"
     282#~ msgstr "Upload Backup %s erstellt"
     283
     284#~ msgid "Upload Backup could not be created"
     285#~ msgstr "Upload Backup konnte nicht erstellt werden"
     286
     287#~ msgid "DB Backup failed, complete backup aborted"
     288#~ msgstr "DB Backup gescheitert, Komplettes Backup abgebrochen"
     289
     290#~ msgid "Media Backup failed, complete backup aborted"
     291#~ msgstr "Media Backup gescheitert, Komplettes Backup abgebrochen"
     292
     293#~ msgid "Complete Backup successfully created"
     294#~ msgstr "Komplettes Backup wurde erstellt"
     295
     296#~ msgid "Complete Backup could not be created"
     297#~ msgstr "Komplettes Backup konnte nicht erstellt werden"
     298
     299#~ msgid "Media Backup by DB could not be created"
     300#~ msgstr "Upload Backup (anhand DB) konnte nicht erstellt werden"
     301
     302#~ msgid "create Theme Backup"
     303#~ msgstr "Theme Backup erstellen"
     304
     305#~ msgid "create Upload Backup"
     306#~ msgstr "Upload Backup erstellen"
     307
     308#~ msgid "create DB Backup"
     309#~ msgstr "DB Backup erstellen"
     310
     311#~ msgid "All-in-One"
     312#~ msgstr "Alles-in-Einem"
     313
     314#~ msgid "attempt to create all Backup-Types at once"
     315#~ msgstr "Alle Einzelbackups auf einmal erstellen"
     316
     317#~ msgid "script might time out"
     318#~ msgstr "Script kann maximale Ausführzeit überschreiten"
     319
     320#~ msgid "create DB, Media & Theme Backup"
     321#~ msgstr "DB, Upload und Theme Backup erstellen"
     322
     323#~ msgid "Complete Backup"
     324#~ msgstr "Komplettes Backup"
     325
     326#~ msgid ""
     327#~ "The complete Backup will automatically perform all single Backup Tasks "
     328#~ "and create a ZIP Archive containing the three resulting files. This can "
     329#~ "take some time, if performed within a big Wordpress installation. The "
     330#~ "complete includes the DB approach for Uploads."
     331#~ msgstr ""
     332#~ "Das komplette Backup erstellt automatisch alle einzelnen Backups und "
     333#~ "kreiert daraus ein ZIP Archiv mit den drei resultierenden Dateien. In "
     334#~ "einer grossen Wordpress Installation kann dies einige Zeit in Anspruch "
     335#~ "nehmen. Das komplette Backup verwendet den Datenbank-basierten Upload "
     336#~ "Backup."
  • mk-simple-backups/trunk/mk-simple-backups.php

    r892855 r892993  
    55 * Plugin URI: http://wordpress.org/plugins/mk-simple-backups/
    66 * Description: Allows you to create simple backups on a dedicated page nested in the "Tools" Menu.
    7  * Version: 0.5
     7 * Version: 0.6
    88 * Author: Michael Kühni
    99 * Author URI: http://michaelkuehni.ch
     
    6464   
    6565        $msg = array();
     66        $this_plugin_data = get_plugin_data( __FILE__);
    6667   
    6768   
     
    8788                    break;
    8889               
    89                 case "createdbbkp":
    90                     $s = $bkp->createDBBackup();
    91                     if($s != false) $msg[] = array("txt"=>sprintf(__( 'DB Backup %s created', 'mk-simple-backups' ), $s ));
    92                     else $msg[] = array("txt"=>__( 'DB Backup could not be created', 'mk-simple-backups' ), "error"=>true);
    93                     break;
    94            
    95                 case "createthemebkp":
    96                     $s = $bkp->createThemeBackup();
    97                     if($s != false) $msg[] = array("txt"=>sprintf(__( 'Theme Backup %s created', 'mk-simple-backups' ), $s ));
    98                     else $msg[] = array("txt"=>__( 'Theme Backup could not be created', 'mk-simple-backups' ), "error"=>true);
    99                     break;
    100                
    101                 case "createuploadbkp":
    102                     $s = $bkp->createUploadBackup();
    103                     if($s != false) $msg[] = array("txt"=>sprintf(__( 'Upload Backup %s created', 'mk-simple-backups' ), $s ));
    104                     else $msg[] = array("txt"=>__( 'Upload Backup could not be created', 'mk-simple-backups' ), "error"=>true);
    105                     break;
    106                
    107                 case "createCompleteBackup":
    108                     $s1 = $bkp->createDBBackup();
    109                     if($s1 == false) $msg = array( "txt"=>__("DB Backup failed, complete backup aborted", "mk-simple-backups"), "error"=>true );
    110                     $s2 = $bkp->createThemeBackup();
    111                     if($s2 == false) $msg = array( "txt"=>__("Theme Backup failed, complete backup aborted", "mk-simple-backups"), "error"=>true );
    112                     $s3 = $bkp->createUploadBackupByDB();
    113                     if($s3 == false) $msg = array( "txt"=>__("Media Backup failed, complete backup aborted", "mk-simple-backups"), "error"=>true );
    114                    
    115                     // currently no zip will be done
    116                     if($s1 != false && $s2 != false && $s3 != false) {
    117                        
    118                         // create array with backups
    119                         $bkp_files = array(
    120                             $s1=>$bkp->backup_dir . "/" . $s1,
    121                             $s2=>$bkp->backup_dir . "/" . $s2,
    122                             $s3=>$bkp->backup_dir . "/" . $s3 );
    123                        
    124                         // create zip
    125                         $zip_path = $bkp->backup_dir . "/" . $bkp->getBackupName("complete", ".zip" );
    126                         $s = $bkp->createZip( $zip_path , $bkp_files );
    127                        
    128                         // check if zip was created successfully
    129                         if($s) {
    130                             $bkp->removeFiles( array($s1, $s2, $s3) );
    131                             $bkp->backups_exist = true;
    132                             $msg[] = array( "txt"=>__("Complete Backup successfully created", "mk-simple-backups"));
    133                         } else {
    134                             $msg[] = array( "txt"=>__("Complete Backup could not be created", "mk-simple-backups"));
    135                         }
    136                        
    137                        
    138                        
    139                     }
    140                     break;
    141                
    142                 case "createuploadbkpbydb":
    143                     $s = $bkp->createUploadBackupByDB();
    144                     if($s != false) $msg[] = array("txt"=> sprintf(__("Backup %s created", "mk-simple-backups"), $s));
    145                     else $msg[] = array("txt"=>__("Media Backup by DB could not be created", "mk-simple-backups"), "error"=>true);
    146                     break;
    147                
    14890                case "flush";
    14991                    $s = $bkp->flushBackupDir();
     
    15193                    else $msg[] = array("txt"=>__("Some files could not be removed by the script. Check File-Permissions or delete the files manually.", "mk-simple-backups"), "error" => true);
    15294                    break;
    153 
     95                   
     96                case "createBackup":
     97                   
     98                    $bkp_options = $_POST["options"];
     99                    $bkp_single_files_with_path = array();
     100                    $bkp_single_files = array();
     101
     102                   
     103                    if(count($bkp_options) > 0) {
     104                        foreach($bkp_options AS $o) {
     105                           
     106                            switch($o) {
     107                                case "db":
     108                                    $s = $bkp->createDBBackup();
     109                                    $desc = __("Database", "mk-simple-backups");
     110                                    break;
     111                                case "theme":
     112                                    $s = $bkp->createThemeBackup();
     113                                    $desc = __("Theme", "mk-simple-backups");
     114                                    break;
     115                                case "uploads":
     116                                    if($_POST["upload_options"] == "file") {
     117                                        $s = $bkp->createUploadBackupByDB();
     118                                        $desc = __("Uploads (file based)", "mk-simple-backups");
     119                                    }
     120                                    else {
     121                                        $s = $bkp->createUploadBackup();
     122                                        $desc = __("Uploads (db based)", "mk-simple-backups");
     123                                    }
     124                                    break;
     125                            }
     126                           
     127                            if($s != false) {
     128                                $bkp_single_files[] = $s;
     129                                $bkp_single_files_with_path[] = $bkp->backup_dir . "/" . $s;
     130                            } else {
     131                                $msg[] = array( "txt"=>sprintf(__("Complete Backup failed upon attempting to backup %s", "mk-simple-backups"), $desc), "error"=>true );
     132                                break;
     133                            }   
     134                        } // end foreach
     135                       
     136                        // create zip
     137                        $bkp_filename = $bkp->getBackupName( "bkp_" . sanitize_title(get_bloginfo("name"), "default"), "_" . implode($bkp->sep, $bkp_options)  . ".zip");
     138                        $s = $bkp->createZip( $bkp->backup_dir . "/" . $bkp_filename, $bkp_single_files_with_path);
     139                       
     140                        if($s != false) {
     141                           
     142                            $bkp->removeFiles($bkp_single_files);
     143                            $bkp->backups_exist = true;
     144                            $msg[] = array( "txt"=>sprintf(__("Backup %s created (containing %s)", "mk-simple-backups"), $bkp_filename, implode(", ", $bkp_options)) );
     145                           
     146                        } else {
     147                           
     148                            $msg[] = array( "txt"=>sprintf(__("ZIP Archive %s failed, partial Backups exist", "mk-simple-backups"), $bkp_filename), "error"=>true );
     149                           
     150                        }
     151
     152                    } // end if check for anything to backup
     153                   
     154                   
     155                    break;
    154156            }
    155        
    156157       
    157158            // echo msg's
     
    197198                   
    198199                    // determine type of file by the first 2 characters
    199                     $begin = substr($name, 0, 2);
    200                    
    201                     switch($begin)
    202                     {
    203                         default:
    204                             $fileclass = "";
    205                             break;
    206                         case "up":
    207                             $fileclass = "uploads";
    208                             break;
    209                        
    210                         case "db":
    211                             $fileclass = "db";
    212                             break;
    213                        
    214                         case "co":
    215                             $fileclass = "archive";
    216                             break;
    217                        
    218                         case "te":
    219                             $fileclass = "empty";
    220                             break;
    221                        
    222                         case "th":
    223                             $fileclass="theme";
    224                             break;
    225                     }
     200                    $suffix = substr($name, strlen($name)-3);
     201   
     202                    if($suffix == "zip") $fileclass = "archive";
     203                    else $fileclass = "default";
    226204                   
    227205                    // get filesize
     
    258236                ?>
    259237                <h3><? _e('Create Backup', 'mk-simple-backups'); ?></h3>
    260                 <ul class="actions">
    261                     <li class="theme"><strong><?=wp_get_theme();?></strong>, <? _e('Active Theme', 'mk-simple-backups'); ?><br />
    262                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createthemebkp"><? _e('create Theme Backup', 'mk-simple-backups'); ?></a></li>
    263                     <li class="uploads"><strong>/uploads</strong>, <? printf( __('All uploads within %s', 'mk-simple-backups'), $bkp->upload_dir["baseurl"]); ?><br />
    264                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createuploadbkp"><? _e('create Upload Backup', 'mk-simple-backups'); ?></a></li>
    265                     <li class="uploads"><strong>/uploads</strong>, <? _e('Backup Attachments from DB (post_type: attachment)', 'mk-simple-backups'); ?><br />
    266                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createuploadbkpbydb"><? _e('create Upload Backup', 'mk-simple-backups'); ?></a></li>
    267                     <li class="db"><strong><? _e('SQL-Dump', 'mk-simple-backups'); ?></strong>, <? _e('Database', 'mk-simple-backups'); ?><br />
    268                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createdbbkp"><? _e('create DB Backup', 'mk-simple-backups'); ?></a></li>
    269                     <li class="test"><strong><? _e('Blank File', 'mk-simple-backups'); ?></strong>, <? _e('test writing permissions', 'mk-simple-backups'); ?><br />
    270                     <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createtestfile"><? _e('create Blank File', 'mk-simple-backups'); ?></a></li>
    271                     <li class="allinone">
    272                         <strong><? _e("All-in-One", "mk-simple-backups") ?></strong>, <? _e("attempt to create all Backup-Types at once", "mk-simple-backups") ?><br />
    273                         <em><? _e("script might time out", "mk-simple-backups") ?></em><br />
    274                         <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createCompleteBackup"><? _e("create DB, Media & Theme Backup", "mk-simple-backups")?></a>
    275                     </li>
    276                 </ul>
     238                <form action="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createBackup" method="post">
     239                    <ul class="options">
     240                        <li class="theme"><label><input type="checkbox" name="options[]" value="theme" checked="checked"><strong><?=wp_get_theme();?></strong>, <? _e('Active Theme', 'mk-simple-backups'); ?></label></li>
     241                        <li class="db"><label><input type="checkbox" name="options[]" value="db" checked="checked"><strong><? _e('SQL-Dump', 'mk-simple-backups'); ?></strong>, <? _e('Database', 'mk-simple-backups'); ?></label></li>
     242                        <li class="uploads"><label><input type="checkbox" name="options[]" value="uploads" checked="checked"><strong>/uploads</strong>, Uploads</label>
     243                            <select name="upload_options">
     244                                <option value="file"><? printf( __('All files within %s', 'mk-simple-backups'), $bkp->upload_dir["baseurl"]); ?></option>
     245                                <option value="db" selected="selected"><? _e('Attachments from DB (post_type: attachment)', 'mk-simple-backups'); ?></option>
     246                            </select></li>
     247                       
     248                    </ul>
     249                   
     250                    <p><input type="submit" value="<? _e("create Backup", "mk-simple-backups");?>" class="button action"></p>
     251                </form>
    277252                <p><hr /></p>
    278253                <p><? _e('Backup directory', 'mk-simple-backups'); ?>: <br />
    279254                    <em><?=$bkp->backup_dir?></em></p>
    280255                <p><hr /></p>
     256                <h3><? _e("Info", "mk-simple-backups") ?></h3>
     257                <ul class="actions">
     258                    <li class="test"><strong><? _e('Blank File', 'mk-simple-backups'); ?></strong>, <? _e('test writing permissions', 'mk-simple-backups'); ?><br />
     259                    <a href="<? bloginfo("siteurl"); ?>/wp-admin/tools.php?page=mk-simple-backups&amp;action=createtestfile"><? _e('create Blank File', 'mk-simple-backups'); ?></a></li>
     260                </ul>
    281261                <h4><? _e("What's going on?", "mk-simple-backups") ?></h4>
    282262                <p class="readable"><strong><? _e("Theme Backup", "mk-simple-backups");?></strong>: <? _e("The Theme Backup will create a ZIP Archive containing all files within the directory of your current active theme. If the active theme is a child-theme, the backup will detect this and include all files from the parent theme.", "mk-simple-backups")?></p>
     
    286266                <p class="readable"><strong><? _e("Upload Backups", "mk-simple-backups");?></strong>: <? _e("The file-based Upload Backup will scan the whole Upload Directory (including subfolders) and create a ZIP Archive containing all files found. If there are many files in the upload directory, the script might time out. The DB based Upload Backup will fetch Attachments from the DB and create a ZIP Archive with found files. In the DB approach, the thumbnails and scaled versions are not included, since they can be regenerated afterwards easily. By ommitting those files, the DB approach saves space and script execution time. The DB based approach can be incomplete when plugins create files in the upload directory that arent included in the DB as attachments. There are plugins that do this.", "mk-simple-backups")?></p>
    287267               
    288                 <p class="readable"><strong><? _e("Complete Backup", "mk-simple-backups");?></strong>: <? _e("The complete Backup will automatically perform all single Backup Tasks and create a ZIP Archive containing the three resulting files. This can take some time, if performed within a big Wordpress installation. The complete includes the DB approach for Uploads.", "mk-simple-backups")?></p>
    289                
    290268                <h4><? _e("How long does it take?", "mk-simple-backups") ?></h4>
    291                 <p class="readable"><? _e("Depending on the amount of files and data, Backups can widely vary in size and time taken to create. The script attempts to increase maximum execution time for php scripts to allow larger Backups to be created. While a backup is being created, don't close your tab/browser and don't navigate to another page as that would cancel unfinished backups and may leave temporary files in the backup directory.", "mk-simple-backups")?></p>
     269                <p class="readable"><? _e("Depending on the amount of files and data, Backups can widely vary in size and time taken to create. The script attempts to increase maximum execution time for php scripts to allow larger Backups to be created. While a backup is being created, don't close your tab/browser and don't navigate to another page as that would cancel unfinished backups and may leave temporary files in the backup directory. If a complete Backup fails, you may want to try creating partial backups.", "mk-simple-backups")?></p>
    292270               
    293271                <h4><? _e("My Backup has failed, why?", "mk-simple-backups") ?></h4>
    294272                <p class="readable"><? _e("Usually file-permissions are at fault if the plugins fails to create Backups. Use your FTP-Client to make sure writing permission on the Backup Directory (refer to the path displayed above) are set to writeable. If there's other problems, use the Plugin Page in the Plugin Repository to request support or patching.")?></p>
     273               
     274                <p><hr /></p>
     275                <p class="small">Plugin <a href="<?=$this_plugin_data["pluginURI"]?>" target="_blank"><?=$this_plugin_data["Name"] ?></a> v<?=$this_plugin_data["Version"]?></p>
     276               
    295277                <?
    296278           
  • mk-simple-backups/trunk/readme.txt

    r892855 r892993  
    33Tags: backup, db, uploads
    44Requires at least: 3.8
    5 Stable tag: 0.5
     5Stable tag: 0.6
    66Tested up to: 3.9RC1
    77License: GPLv2 or later
     
    4545
    4646== Changelog ==
     47
     48= 0.6 =
     49* Simplified UI by shifting from single-action links to option-based form
     50* Backup Name uses Site Name
     51* Backup Name reflects contents
     52* Moved blank file link to info section
     53* Added plugin repository link to the footer
     54* Updated Language Files (german, english)
     55* Simplified Icons
     56* Updated Screenshot
     57* Updated Read-Me
    4758
    4859= 0.5 =
     
    94105== Upgrade Notice ==
    95106
     107= 0.6 =
     108Switching to form based Backup Creation
     109
    96110= 0.5 =
    97111Added features, check the changelog for detailed information
Note: See TracChangeset for help on using the changeset viewer.