humanmade / WPThumb

:warning: UNMAINTAINED :warning: On demand image resizing for WordPress
https://humanmade.co.uk/wpthumb/
170 stars 32 forks source link

Database Efficiency #42

Closed torrfura closed 11 years ago

torrfura commented 11 years ago

For each image that is run through wp_thumb, a bunch of rows with meta data is created. Since I always use default settings. Are these rows motivated?

If it's really needed, it should also be more efficient if you store the data in 1 row / image, using serialize(). I'd love to contribute, but are not really familiar working on other peoples code like this.

Using serialized data, could also reduce alot of "get_post_meta()" calls you have at the moment.

joehoyle commented 11 years ago

Hmm WP Thumb shouldn't create any rows in the database, it doesn't have any functionality built in that will do that. The only thing I can think is it is somehow triggering wp_generate_attachment_metadata

Can you paste the rows that are being inserted?

Using serialized data, could also reduce alot of "get_post_meta()" calls you have at the moment.

Again, not sure what rows this is for?

torrfura commented 11 years ago

Might it have something to do with Wordpress 3.5 perhaps?

I don't add any watermarks, no aftertouch what so ever, it seems like wp_thumb run wpthumb_media_form_watermark_save() anyway (#371, wpthumb.watermark.php)

These are added for every single image:

meta_id post_id meta_key    meta_value
3248    1051    wpthumb_wm_mask default
3247    1051    wpthumb_wm_pre_resize   0
3246    1051    wpthumb_wm_padding  0
3245    1051    wpthumb_wm_position top-right
joehoyle commented 11 years ago

Ok, if any of the above are not sure, they will be deleted from the database now