Duplicate coupons
I you use a service like icodes or any other to feed the database the script needs to create a coupon unique identifier to avoid duplicates coupons, sometimes 10 times the same in the same page.
In this case this script is useless for automatic feeding.
I believe the best would be to create an unique id with the url of the site the title.
The unique id should be created on the fly when the coupon is created with the crc32 or md5 of urlsite+title.
Duplicates won't be inserted in the db.
I see you use
$clpr_item_id = uniqid(rand(10,1000), false);
the id is unique but for the same coupon, it will have another id, so posted again.
I believe this is the most important feature for coupons, otherwise I just cannot use it.