Skip to content

Commit 3c4f649

Browse files
author
Olaf Lederer
committed
Information about the new release
Check the readme file for more information.
1 parent aa43e9e commit 3c4f649

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

README.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If your web host is based on Apache, the is an option to protect the directory u
1818

1919
## Features
2020
* Super fast, a backup from a 500MB website takes only seconds!
21-
* NEW (optional)! Download your backups and use the ZIP file for the site import in Local (by Flywheel)
21+
* Optional: Download your backups and use the ZIP file for the site import in Local (by Flywheel)
2222
* Quick setup, using email credentials from existing plugins like Easy SMTP, WP Mail SMTP or Sendgrid
2323
* Apache user can authenticate via login/password or IP address
2424
* Backup with a single mouse click (full or partly backups)
@@ -29,8 +29,19 @@ If your web host is based on Apache, the is an option to protect the directory u
2929

3030
## Installation
3131

32-
Download the files as a zip or via the GIT tools on your server. Place/upload the files into a directory named "mybackup" and place it into the website's public folder. Access the tool and enter your email address and enter your Sendgrid API key or your SMTP credentials. Confirm your email address via the link you get in your mailbox.
33-
If you like to use the authorization feature provided by Apache, than continue to "Apache authentication" and enter your details on that page. If you need the "Download" opttion for your backups, you need to change the variable ENABLE_DOWNLOADS to "true" inside the file *libs > func.php*.
32+
Using Composer, just run the following code within the public HTML directory from your WordPress website:
33+
34+
```
35+
composer create-project finalwebsites/backup4wp mybackup
36+
```
37+
38+
Replace the directory name "mybackup" with something else, if you like.
39+
40+
### Manual installation
41+
42+
Download the the zip file here. Extract and upload the files into a directory named "mybackup" (or some other name) right into the website's public folder. Accesss the tool and enter your email address and enter your Sendgrid API key or your SMTP credentials. Confirm your email address via the link you get in your mailbox.
43+
44+
If you like to use the authorization feature provided by Apache, than continue to "Apache authentication" and enter your details on that page. If you need the "Download" option for your backups, you need to change the variable ENABLE_DOWNLOADS to "true" inside the file *libs > func.php*.
3445

3546
### Installation snippet for ManageWP users
3647

@@ -39,29 +50,23 @@ Use this snippet if you use ManageWP. Just run the code and access the tool and
3950
<?php
4051
$dir = dirname(dirname(dirname(__DIR__))).'/mybackup';
4152
if (file_exists($dir)) {
42-
echo 'A mybackup directory already exists!';
53+
echo 'A "mybackup" directory already exists!';
4354
} else {
44-
$url = 'https://github.com/finalwebsites/backup4wp/archive/master.zip';
45-
$ch = curl_init($url);
46-
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
47-
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
48-
$result = curl_exec ($ch);
49-
if (curl_errno($ch)) {
50-
die('Curl error: ' . curl_error($ch));
51-
}
52-
curl_close ($ch);
53-
if ($success = file_put_contents('master.zip', $result)) {
54-
exec('unzip master.zip && mv backup4wp-master mybackup');
55-
unlink('master.zip');
56-
echo 'Downloaded and extracted zip file ('.$success.' bytes)';
55+
exec('composer -V', $output);
56+
if (substr($output[0], 0, 8) == 'Composer') {
57+
exec('composer create-project finalwebsites/backup4wp mybackup'); // you can use a different directory name (instead of "mybackup")
58+
echo 'Downloaded and installed Backup4WP using Composer';
5759
} else {
58-
echo 'Error while downloading zip file';
60+
echo 'Composer isn't supported by your web host.';
5961
}
6062
}
6163

6264

6365
## Update notes
6466

67+
*1st May 2022*
68+
First release v1.0.0, from today on we're using release tags. Do you like to use Composer? Than is this update for you. We packaged Backup4WP and you're able to install the tool using Composer. The PHPMailer, Sendgrid and Mysqldump library are not included in our distribution anymore. Don't worry for the manual installation, we offer a ZIP file with all the library files included. During the installation, you can choose the directory name. Instead of "mybackup", you can use your own name. This makes it a bit more safe if you choose a random name. From our prospective it's safe to update the application for installations from the last year.
69+
6570
*17th April 2022*
6671
If your WordPress website is using the **Easy SMTP plugin**, Backup4WP will recognize these settings too. Plus, if you use an API key from Sendgrid as a password for this SMTP plugin, the API key is also pre-filled inside the "Sendgrid" section. We changed also the order on how the obtained settings are used: 1. Easy SMTP, 2. WP Mail SMTP and 3. the old Sendgrid plugin.
6772

libs/func.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
define('ABSPATH', dirname(MYBACKUPDIR).'/');
99
define('DATAPATH', dirname(dirname(MYBACKUPDIR)).'/backups/');
10-
define('MBDIRNAME', dirname($_SERVER['PHP_SELF'])); // for example /mybackup
10+
define('MBDIRNAME', '/'.basename(MYBACKUPDIR)); // for example /mybackup
1111
define('BASE_URL', '//'.$_SERVER['HTTP_HOST'].MBDIRNAME.'/');
1212

1313
define('ENABLE_DOWNLOADS', false); // set to "true" to enable backup downnloads
@@ -167,7 +167,7 @@ function get_authorized() {
167167
header('Location: '.$home.'login.php?msg=invalidsession');
168168
exit;
169169
} else {
170-
setcookie("mybackup_access", $matches[0], time()+(3600*4), .MBDIRNAME."/", $_SERVER['HTTP_HOST']);
170+
setcookie("mybackup_access", $matches[0], time()+(3600*4), MBDIRNAME."/", $_SERVER['HTTP_HOST']);
171171
$confirmed = $db->querySingle("SELECT confirmed FROM backupsettings WHERE id = 1");
172172
if ($confirmed == 'no') {
173173
$db->exec("UPDATE backupsettings SET confirmed = 'yes' WHERE id = 1");

0 commit comments

Comments
 (0)