Using Delicious Brains Offload Media (https://wordpress.org/plugins/amazon-s3-and-cloudfront/) currently breaks Sensei Certificates. The following error is given: "FPDF error: Missing or incorrect image file: /home/mywebsite/public_html/wp-content/uploads/s3://files.mywebsite.com/wp-content/uploads/2020/01/Certificate.jpg"
I have filed a support request with Delicious Brains. However, this is actually a bug in the Sensei Certificates plugin, which manually grabs the WordPress absolute upload path instead of retrieving using the WordPress get_attached_file() function intended for that purpose (https://developer.wordpress.org/reference/functions/get_attached_file/).
In the "/sensei-certificates/classes/class-woothemes-sensei-certificate-templates.php" file on line 449 we see the following code to create the image's absolute path:
$fpdf->Image( $upload_dir['basedir'] . '/' . $image['file'], 0, 0, $image['width'], $image['height'] );
If we re-write this line to use get_attached_file(), this plugin should work nicely with Offload Media or any other plugin that would allow WordPress media library to be stored in the cloud:
$fpdf->Image( get_attached_file( $this->get_image_id() ), 0, 0, $image['width'], $image['height'] );
Using Delicious Brains Offload Media (https://wordpress.org/plugins/amazon-s3-and-cloudfront/) currently breaks Sensei Certificates. The following error is given: "FPDF error: Missing or incorrect image file: /home/mywebsite/public_html/wp-content/uploads/s3://files.mywebsite.com/wp-content/uploads/2020/01/Certificate.jpg"
I have filed a support request with Delicious Brains. However, this is actually a bug in the Sensei Certificates plugin, which manually grabs the WordPress absolute upload path instead of retrieving using the WordPress get_attached_file() function intended for that purpose (https://developer.wordpress.org/reference/functions/get_attached_file/).
In the "/sensei-certificates/classes/class-woothemes-sensei-certificate-templates.php" file on line 449 we see the following code to create the image's absolute path:
$fpdf->Image( $upload_dir['basedir'] . '/' . $image['file'], 0, 0, $image['width'], $image['height'] );
If we re-write this line to use get_attached_file(), this plugin should work nicely with Offload Media or any other plugin that would allow WordPress media library to be stored in the cloud:
$fpdf->Image( get_attached_file( $this->get_image_id() ), 0, 0, $image['width'], $image['height'] );