I'm building a small photography site and looking to protect the images the best I can.
(I know, I know - you can't protect the images once they're on the internet)
So - to do this, instead of using an annoying disable-right-click-using-javascript method, I'm loading the watermarked thumbnail images using base64 to obfuscate the filepath.
Code I'm using, if anyone's interested. Feel free to suggest improvements/criticise:
$image = wp_get_attachment_image_src( get_post_thumbnail_id(), 'shop_catalog' ); ?>
<img src="data:image/gif;base64,<?php echo base64_encode(file_get_contents($image[0])); ?>">
This works great on content-single-product.php
, but does anyone know what code is loading the images in the [best_selling_products]
and [recent_products]
shortcodes? I'm in class-wc-shortcodes.php
, but the query doesn't seem to be loading the images from here...
So why don't I just load small thumbnail images? Good question. Because we're planning to sell photos through the site, the high-res image has to be loaded as the featured image (to be sent though to the printing API) - and anyone with half a brain can look at the thumbnail url and get the full high-res image url.
Any suggestions on how to achieve this, or am I just best off scrapping the shortcodes and building my own query?