backwpup icon indicating copy to clipboard operation
backwpup copied to clipboard

Jobs options saving and UI inconsistencies

Open AndisGrossteins opened this issue 1 month ago • 3 comments

Note: I've posted WordPress.org plugin support forum Multiple issues with version 5.5 but haven't received any responses, probably because I didn't mark it as a support request.

Describe the bug When editing backup jobs, there are extra entries present in the backwpup_jobs option after deleting the two default and legacy jobs except for one. This is causing inconsistencies – in UI the job has database backup enabled but when running the job it doesn't backup database.

To Reproduce Steps to reproduce the behavior:

  1. Install BackWPup and complete initial setup
  2. Wait for first backup to finish
  3. Create new backup job
  4. Check output from wp option get backwpup_jobs --format=json > backwpup_jobs.json

Expected behavior Consistency between UI and saved data.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome 140.0.7339.208
  • WordPress version: 6.8.3
  • PHP version: 8.3.6

Additional context I went to inspect and exported the jobs as JSON using wp-cli command:

wp option get backwpup_jobs --format=json > backwpup_jobs.json

There were two extra entries with only some options present at the end of JSON object. One of them has a "jobid": 4 which matches with entry before it and overrides the "type": ["FILE", "WPPLUGIN"] option from actual job entry but only in UI.

A sample from the exported JSON:

{
  "3": {
    "jobid": 4,
    "type": ["FILE", "DBDUMP", "WPPLUGIN"],
    /* {snip} */
  },
  "4": { "type": ["DBDUMP"], "activetype": "wpcron", "cron": "0 3 * * *" },
  "5": { "jobid": 4, "type": ["FILE", "DBDUMP", "WPPLUGIN"] }
}

Today I was able to reproduce the issue with a fresh install of BackWPup locally. After initial setup and completion of default job, when I create a new job, the UI shows two jobs but the backwpup_jobs option contains three entries with different jobid properties (1,2,3).

Screenshot of UI after adding new job and reloading page: Image Note that "Job ID 1" is not visible but present in the backwpup_jobs.

I've posted the JSON output in a gist: https://gist.github.com/AndisGrossteins/2e44f0b31841c2bdbbaf89a8717dc83a

There's something funky in how the option is updated around here: https://github.com/wp-media/backwpup/blob/39d722a536f372f640579728e2261590e9298e7f/inc/class-option.php#L77-L91

AndisGrossteins avatar Oct 08 '25 23:10 AndisGrossteins

Our developer reviewed your report in detail. In your JSON file here: gist link, the inconsistency you observed comes from the first backup job, which includes the flag "tempjob": true (see line 22).

This entry represents an internal temporary job created during the initial setup, and its presence is expected behavior in the current version of the plugin. It doesn’t affect the actual execution of user-created jobs.

saranshj4 avatar Oct 16 '25 12:10 saranshj4

Ok, I see it the property being checked when reading the jobs array. So my comment about reproducing the issue can be discarded.

But what about my initial findings - the partial entries with duplicate jobid or no jobid property. I've updated the Gist with two complete JSON files from initial troubleshooting on production site. Both files have timestamps in filename.

First was generated at 2025-10-07 22:45 and contains the partial entries, including one without jobid: https://gist.github.com/AndisGrossteins/2e44f0b31841c2bdbbaf89a8717dc83a#file-backwpup_jobs_2025-10-07_2245-json-L195-L210

Second file was exported later at 2015-10-08 01:02. It contains two entries with jobid: 5, and first one has tempjob: false (so not a previous job) and activ: true: https://gist.github.com/AndisGrossteins/2e44f0b31841c2bdbbaf89a8717dc83a#file-backwpup_jobs_2025-10-08_0102-json-L350-L357 And also a stray entry – array element 1 – without jobid but with type, activetype, and cron properties present. https://gist.github.com/AndisGrossteins/2e44f0b31841c2bdbbaf89a8717dc83a#file-backwpup_jobs_2025-10-08_0102-json-L196-L202

AndisGrossteins avatar Oct 16 '25 23:10 AndisGrossteins

If devs need more data to work with, I can fetch the backwpup_jobs from older backups. I have backups from before BackWPup 5.0.2 and going as far back as version 4.1.7 in January 2025.

AndisGrossteins avatar Oct 17 '25 01:10 AndisGrossteins