tinify-php
tinify-php copied to clipboard
Compression count not return
I am trying to get a compressed count with this line!
\Tinify\setKey('YOUR_API_KEY');
$compressionsThisMonth = \Tinify\compressionCount();
But it returns an empty value!
Hi @arirah!
Thanks for reaching out!
You can get the compression count after you have validated your API key or after you have made at least one compression request. So you can try this for example.
\Tinify\setKey('YOUR_API_KEY');
\Tinify\validate();
$count = \Tinify\compressionCount();
echo "Compressions this month: $count\n";
I hope this solves your issues. Have a nice day.
Thanks @PabloPerezDeCiriza! It is working!