Certain actions failing when run through cron

Ok, so it turns out the solution is slightly embarrassing on my part and I couldn’t see the forest for the trees.

The code that was executed by the cron job was trying to check the contents of a variable that is set via a radio button on the admin / plugin activation page.

Thus, the part of the code to save the image (inside an if statement) was not being accessed.

It just goes to show how much of an issue a small error can become when there’s no access to any error logs or outputs.

error code: 523