ImageKit widget can break with certain template

i am testing imagekit and it seems like via the widget when searching for all sites some of the templates can easily break the widget very easily. is there some way to exclude certain pages from being accessed by the widget?

There is currently no setting for that, but ImageKit send a custom HTTP header with every scanning request. So alternatively, you could prevent your templates from being evaluated by adding the following at the very start of your template file.

<?php if(isset($_SERVER['HTTP_X_IMAGEKIT_INDEXING'])) return; ?>

Maybe you can tell me, what exactly breaks ImageKit’s crawler? I always try to build the plugin in a way, that requires the least amount of manual adaptions of existing code wherever possible. E.g. the crawler is able to detect 404 pages or redirect templates by their HTTP status code and treats them accordingly without resulting in errors.

My PayPal IPN endpoint for example returned it’s “no post data” error directly in the widget. And it seems that it would go past that.

Okay, this needs to be addressed!

I opened a bug on GitHub: https://github.com/fabianmichael/kirby-imagekit/issues/16

widget shows

DOMDocument::loadHTML(): Empty string supplied as input

that’s what i get with the code above … might be another template/controller which i can’t find right now though. pasted it into each of the controller i thought might break the widget. it would be nice to see which template/site actually is getting generated instead of just having 13/44 so it can be identified a little bit better.

i am trying to see if imagekit is helping me on generating like a few hundreds to thousands thumbnails which are getting watermarked after uploading via ftp at once.

so either way to include only certain template, or exclude every template you specify would be a nice addition.

I created an issue for that: https://github.com/fabianmichael/kirby-imagekit/issues/18