
File Transfer Rotate WordPress Plugin
Description
Simplify WordPress File Transfers and Rotations with FTR
FTR (File Transfer and Rotate) is your ultimate WordPress plugin for seamless file transfer. Whether it’s backups, exports, logs, or full folder transfers, FTR ensures secure, automated, and efficient operations with minimal setup. Perfect for developers and admins, FTR integrates easily with wordpress through the Admin UI, WP-CLI, WP-CRON or direct PHP calls for full flexibility.
Key Features:
- WP-CLI Power: Extensive commands for complete control.
- WP-CRON Automation: Schedule transfers and rotations effortlessly.
- Secure Transfers: Built on phpseclib, using SFTP with no SSH2 dependency.
- Smart Rotation: Auto-manage remote backups with custom intervals.
With FTR, file transfers continue uninterrupted even during timeouts, resuming reliably. Setup is straightforward via hooks, admin menus, or CLI, and all sensitive data is encrypted for robust security. Say goodbye to file management headaches and let FTR handle the heavy lifting!
FTR – File Transfer and Rotate
Transfer backups, exports, logs, files or folders from or to remote locations and/or rotate files to specific date intervals.
FTR transfers or rotations can be invoked from WP-CLI, PHP functions or through scheduled Actions WP-CRON.
- Extensive WP-CLI commands
- Automatic WP-CRON schedules
- Direct PHP transfers
- Transfer seperate file(s) or complete folders
- Recursive folders will NOT be supported
- Build using phpseclib
- use SFTP for transfers
- no dependency on SSH2 extension
- PHP timeouts will not break transfer in WP-CRON
- Transfer resume rescheduled on timeout
- Transfers run continuesly in WP-CLI
Configuration
A base configuration can be set up through the configuration action hook.
When transfers are invoked the following configuration steps are executed.
- Default configuration is used
- Configuration action hook is fired
- Action configuration is loaded (if requested)
- Third any direct configuration is applied
- Command line (WP-CLI)
- Configuration vars (PHP functions)
FTR Actions can be configured seperately through the administration menu (FTR > Actions). These Actions can be automatically scheduled or used as a base configuration which can be called from WP-CLI or PHP functions. The FTR Action menu is only shown to Administrators.
Settings
In the WordPress Settings menu an option FTR is added. In the menu you can configure the following options.
Options | Description |
---|---|
Log File | Folder and file of log file |
Log Level | Which events should be logged |
Sheduler | Run scheduler for automatic transfers through WP-CRON |
Automatic transfers will run Actions which have valid schedule options (days/monthts) and are published. Drafts are ignored.
Actions
Configuration fields with sensitive information like host
, username
, source
, target
, pass
and secret
will be encrypted upon saving. No plaintext information is stored in the database.
Options | Description |
---|---|
Host | Host |
Port | Port |
Timeout | PHP timeout |
Username | Username |
Connection Type | Connection Type |
Password | Password |
Private Key | Private Key |
Transfer Type | Upload or Download Transfer |
Source | Source file or folder |
Target | Target folder |
Timestamp | Add timestamp to file |
Date Format | Date format for timestamp |
Cron Expression | Schedule Cron expression |
Rotation Interval | Rotation Interval |
File Exist | Transfer Logic for Existing Files |
Interval
Examples
0d:* 1d:7 1w:4 1m:12 1y:1
0d:* 1d:2 1w:1 1m:1 6m:1 1y:1
Syntax
Syntax | Interval | Versions |
---|---|---|
0d:* | 0 day (today) | Unlimited |
1d:7 | 1 day | 7 |
1w:4 | 1 week | 4 |
1m:12 | 1 month | 12 |
2m:6 | 2 months | 6 |
1y:2 | 1 year | 2 |
- Each
[interval]
will keep a number of set[versions]
- Overlapping ranges will be replaced
..1d:7
will have the last day replaced by1w:1
) - Ranges will touch irregardless of set interval configuration
Action hook
Configuration field values can be added by using the below hook. Values set through the action hook will be the initial values before loading Actions or direct configuration values through WP-CLI or PHP functions.
Note that the host
, username
, secret
have to saved encrypted. FTR does NOT accept decrypted sensitive information stored in plaintext.
You are able to encrypt these values by invoking the wp ftr encrypt [data-to-encrypt]
in WP-CLI.
add_filter('FTR_config_filter', 'FTR_config', 10, 1);
function FTR_config( $cfg )
{
$cfg['log_path'] = ''; // defaults to plugin folder
$cfg['transfer_type'] = ''; // get or put
$cfg['source'] = '';
$cfg['target'] = '';
$cfg['source_date_format'] = 'Y-m-d-His';
$cfg['transfer_timeout'] = ''; // defaults to php timeout
$cfg['host'] = ''; // use --encrypt in cli to generate string
$cfg['username'] = ''; // use --encrypt in cli to generate string
$cfg['connection_type'] = ''; // key, pass or passkey
$cfg['secret'] = ''; // use --encrypt in cli to generate string
$cfg['private_key'] = ''; // use --encrypt in cli to generate string
$cfg['port'] = 22;
$cfg['schedule'] = true;
$cfg['cron_expression'] = '* * * * *';
$cfg['rotate'] = true;
$cfg['interval_config'] = '0d:* 1d:7 1w:4 1m:12 1y:2';
$cfg['timestamp'] = true;
$cfg['file_exist'] = 'skip';
$cfg['file_exist_smaller'] = 'append';
$cfg['file_exist_larger'] = 'overwrite';
return $cfg;
}
WP_CLI – command line interface
All functionality of FTR can be accomplished through the WordPress CLI.
By default --tranfer
and --rotate
commands execute as dry-run. Use --run
for a no-dry-run execution after making sure the arguments are correct.
Transfer
When not using the FTR scheduler (see Settings configuration) you are able to run FTR configurations in the shell through wp ftr transfer --action
commands. To schedule the transfers instead of direct run, use the --cron
argument.
An direct or cron scheduled transfer can be initiated by providing all configuration options on the command line.
The action hook configuration could be used as a base configuration. One could keep the remote location host, username and secret stored. While providing the source and target on the command line. Make sure to use --encrypt
on the command line to generate salted, hashed, encrypted strings for the settings in the action hook! This will avoid storing plaintext in your configuration hook.
Predefined Actions can be executed directly or scheduled through WP-CRON by using the --action
argument. Any configuration field can be overruled by defining them as a argument on the command line.
wp FTR transfer --action=101 --cron [override arguments]
Arguments
Arguments | Description |
---|---|
–action= | set action id to load |
–upload | only start transfer if explicitly set |
–transfer-type | transfer type |
–source= | local file or folder |
–target= | remote destination folder |
–run | no-dry-run, initiate transfers |
–timestamp | append timestamp to remote file |
–cron-expression | cron expression |
–cron | schedule WP-CRON job |
–host | host |
–username | host username |
–secret | host secret |
–private-key | private key |
–connection-type | connection type |
–port | host port |
–overwrite | overwrite all files |
–skip | skip all files |
–append | append all files |
Rotate
Rotate your remote backups based on predefined intervals.
Set the Action id to use predefined settings. If only one action has been defined it will be loaded automatically.
The config action hook will be preloaded and will be overruled by the selected Action. Any argument can be overruled on the command line too.
wp FTR rotate [arguments]
Rotate your remote backups based on intervals.
- Checks correct remote paths
- Retrieves remote backup list
- Applies rotate logic based on interval configuration
- Removes remote files
- Non-destructice by default
Arguments
Arguments | Description |
---|---|
–action= | set action id to load |
–run | no-dry-run, delete rotated remote backups |
–target= | remote destination folder to rotate |
–interval | rotation interval |
–cron | schedule through cron |
Encrypt
To store sensitive information in the configuration hook the data needs to be encrypted first. This can be achieved by usings the wp ftr encrypt [data-to-encrypt]
command.
FTR does not allow decrypted data to be stored in plaintext.
Test-Rotate
wp FTR rotate-test [--days=<days>] [--date=<date>] [--verbose]
Run a test rotation with an generated array in memory.
Arguments
Arguments | Description |
---|---|
–days= | number of days to simulate |
–date= | which starting date to use |
–verbose | verbose output |
Screenshots
Transfer overview

(S)FTP with username and password

(S)FTP with username and ssh key

(S)FTP with username and password protected ssh key

Schedule options

WP-CLI transfer overview

WP-CLI run transfer

WP-CLI dry-run rotation

Data configuration

Reviews
There are no reviews yet.