How to add a new thumbnail size only to a certain custom post type?

You cant without editing core files but you can name it any way you want so you can call it
from you plugin:

if ( function_exists( 'add_image_size' ) ) { 
    add_image_size( 'my-plugin-thumb', 220, 180, true );
}

and call it

if ( has_post_thumbnail() ) { 
    the_post_thumbnail( 'my-plugin-thumb' );
}

it’s not perfect but its something.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)