[Development] Add destinations
-
Hello,
I’m developer for an agency and we use Pcloud to store our backups, but your plugin has no native Pcloud implementation.
So I’m trying to create an addon plugin to do this, I saw you had the “backwpup_register_destination” hook to add a destination, so I did this:function addPcloud() { if(is_plugin_active( 'backwpup/backwpup.php' )) { require_once 'inc/class-destination-pcloud.php'; function register_destination_pcloud($registered_destinations) { $registered_destinations["PCLOUD"] = [ 'class' => \BackWPup_Destination_Pcloud::class, 'info' => [ 'ID' => 'PCLOUD', 'name' => __('Pcloud', 'backwpup'), 'description' => __('Backup to Pcloud', 'backwpup'), ], 'can_sync' => false, 'needed' => [ 'php_version' => '', 'functions' => ['curl_exec'], 'classes' => [], ], ]; return $registered_destinations; } add_filter('backwpup_register_destination', "register_destination_pcloud"); } } add_action('admin_init', 'addPcloud');
I have copy the Dropbox Classes which have similar api connection to Pcloud and i have change all i need to change (for the moment I have just a connection to Pcloud API and all the others functions are same as Dropbox).
It work, i can configure my job and get my pcloud token but when i launch the job via action : “runnow” (i don’t expect it send file because i don’t modify the function to do this) it don’t find the destination although my jobs is configured… Bellow the log error :ERROR: No destination correctly defined for backup! Please correct job settings.
After some research, i found the function create (in class-job.php), and try many test, it seems that my destination don’t exist when BackWPup::get_registered_destinations() is call inside the function “create” but if i call BackWPup::get_registered_destinations() in the html of class-page-jobs.php my destination exist !
Therefore, the verification of the job’s destination don’t match with any listed destination. Can you help me to find the problem ?
- The topic ‘[Development] Add destinations’ is closed to new replies.