dashed-slug.net › Forums › General discussion › Cannot enter fixer.io API key due to form validation
- This topic has 9 replies, 2 voices, and was last updated 2 years, 3 months ago by alexg.
-
AuthorPosts
-
August 22, 2022 at 8:34 pm #12041AnonymousInactive
Hello,
I have tried adding fixer.io API to my site, but it says error ‘Please match the format requested’. It seems like fixer.io moved to APILayer, so the only way to get an API is through them, I can’t register to fixer.io directly.
See photos attached.
Attachments:
You must be logged in to view attached files.August 22, 2022 at 8:41 pm #12045AnonymousInactiveMaybe it is something to do with the Free Plan no longer being enough?
Attachments:
You must be logged in to view attached files.August 23, 2022 at 7:50 am #12047alexgKeymasterHello,
Thank you for letting me know. The free plan should be sufficient.
The API keys, including the one I currently have, used to be 32 hexadecimal digits. It seems that with their switch to API layer, they now use the entire alphabet.
There is a regex validation on the API key, but it’s only applied on the frontend. The value you entered as an admin is not validated on the backend (except for SQL injections, of course).
I will patch the plugin. In the mean time, you can delete the following three lines from your code, and you will be able to enter your key:
https://github.com/dashed-slug/wallets/blob/6.0.0-RC1/admin/settings.php#L794-L796
You can find this file at
wp-content/plugins/wallets/admin/settings.php
.Thank you for providing screenshots. I have deleted the screenshot displaying your personal key from this public forum.
with regards
August 23, 2022 at 4:34 pm #12052AnonymousInactiveThank you for the fast response. I have managed to delete the code, managed to fill in the API form, however nothing happened after 5 hours. Maybe because they have migrated to APILayer, something else needs to be done code-wise?
Attachments:
You must be logged in to view attached files.August 24, 2022 at 4:47 am #12058alexgKeymasterHello,
I have also deleted the form validation in version
6.0.0-RC2
. Thanks for the feedback, I’m really interested in your first impressions, and pitfalls.You mentioned that nothing happened after 5 hours. Normally, there should be fiat currencies being created.
1. Go to Currencies. Are there any fiat currencies there?
2. Were you using your site at all during those 5 hours? If your site doesn’t get traffic, the cron jobs won’t run. Ideally you should be triggering cron externally, as explained in Settings → Bitcoin and Altcoin Wallets → Cron tasks.
3. Ultimately the way to know what happened is to look at the logs. Can you enable verbose logging? This is in: Settings → Bitcoin and Altcoin Wallets → Verbose logging. This requires editing wp-config, as explained on-screen. Add
define( 'WP_DEBUG', true );
anddefine( 'WP_DEBUG_LOG', true );
to yourwp-config.php
, then enable verbose logging and check the logfile.If you collect the logs from a single cron run, it will be obvious what is going on.
Again thank you very much for testing. Let me know what the logs say.
August 24, 2022 at 2:00 pm #12061AnonymousInactiveHello there, thanks for the fast response. I am attaching below the debug.log screenshot especially for the fixer.io part. It seems like no matter if I managed to enter the API key, it still comes up as ‘????????????????’.
Attachments:
You must be logged in to view attached files.August 24, 2022 at 2:28 pm #12063AnonymousInactiveI have tried finding the API key in DB, but could not find it.
Attachments:
You must be logged in to view attached files.August 24, 2022 at 2:38 pm #12065AnonymousInactiveSorry for the multiple replies, I have found it in DB and everything seems to be good, not sure why the cron_task cannot retrieve it.
Attachments:
You must be logged in to view attached files.August 25, 2022 at 8:18 am #12067alexgKeymasterHello,
Thanks for providing a view of your logs. Your API key is masked in the logs with
?
characters intentionally. This is so that if the logs get stolen, any sensitive information is not in there.You can view your api key with wp-cli:
wp option get wallets_fiat_fixerio_key
I have signed up for a new apilayer key and I gοt the same result as you. Turns out that the old fixer.io keys are handled differently to the new apilayer keys.
I will upload a fix shortly.
Thank you for finding this issue, I never would have found it because I was using my old key and hadn’t realized that things have changed since then.
August 25, 2022 at 8:44 am #12070alexgKeymasterI have uploaded a fix for this with version
6.0.0-RC3
.Before the free plan would allow 750 calls per month, so it was ok to contact the API every hour.
Now the free plan allows 100 requests per month, so I’ve set the fiat rates to update every 8 hours.
This should be ok, since fiat currencies have low volatility, compared to cryptos.
Again thank you for your help. Let me know if you encounter more difficulties.
with regards
-
AuthorPosts
- You must be logged in to reply to this topic.