Support » Plugin: Newsletter Sign-Up for CleverReach » Form says “success” although no api connection

  • Resolved zopocecito

    (@zopocecito)


    I just update to version 2.3.0 – thank you for the recent update and adding the long missed “refresh_token”.

    After updating I reloaded my subscription form and put my Email address in it, and the form said “success” – while it should have said “address already registered”.

    Then I saw in the backend that the Api connection was reset after the update, it now tells me to reconnect with CleverReach.

    It says:

    “Stellen Sie eine erneute Verbindung mit der neuen CleverReach API her. CleverReach hat die API geändert. Bitte verbinden Sie Ihren Account hier erneut mit der neuen REST API und überprüfen Sie alle Ihre Einstellungen.”

    So the situation is:

    – I have no Api connection
    – but the form validates to “1”

    I think the problem lies in “class-form.php”, maybe there should be some kind of check wether there is an active connection to the API in the function process_form() ?

    There is this line:

    if ( $validation->valid && $this->auth_service->get_access_token() ) {

    but if there is no access_token available then nothing happens.

    Maybe that case is a rare situation, but in times of WordPress auto updating itself (and plugins) it’s not unlikely that you get an update and nobody is there to check it immediately.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter zopocecito

    (@zopocecito)

    Nachtrag: Maybe it’s a more simple solution not to set $validation->valid = true; by default but to false?

    Why assume that the form is valid and everything goes well by default and have the “Success” message displayed?

    Plugin Author CleverReach®

    (@cleverreach43)

    Hello zopocecito and thanks for the inquiry,

    the refresh token usually works very well. Only when the token was not saved at all for some reason or got lost it might cause it to not be available at all. Or when during the refreshperiod of 30 days no new token was created automatically.

    To reconnect you would usually just need to click on the button and enter your CleverReach access information once again. If this does not solve the connection please consider uninstalling and reinstalling the plugin.

    The question if a form creates an error when a recipient is already present depends on the configuration of the form and Plugin. Can you send me more information in which account which form is used, which plugin version is used etc? You can send it via https://support.cleverreach.de/hc

    Thanks!

    Dennis Welz

    Thread Starter zopocecito

    (@zopocecito)

    Hi Dennis,

    thank you for your reply but I think you didn’t understand the problem.

    • old version 2.2. was installed, this version was managing “access_token” and such totally different
    • Plugin was updated to 2.3.0, “everything” (under the hood) was changed
    • as one result connection to Api was lost
    • but still the form in the frontend rendered “Success” – no matter the user was already signed up or not – and although nothing actually “happened”, because there was no connection to CleverReach / the api

    This I consider as a bug or flaw, because this is bad when you are on “Auto update”.

    As I wrote above, I think the reason lies in class-form.php in function process_form().

    It sets “$validation->valid” to true by default, and when there is something wrong with the Api connection or when there is no access_token “$validation->valid” remains true … and the form shows “success”.

    In line 108 the validation has this statement:

    if ( $validation->valid && $this->auth_service->get_access_token() ) {
    ...
    }

    $this->auth_service->get_access_token() just reads the access_token from the database – which was not there.

    And when $validation->valid is true, but $this->auth_service->get_access_token() is false, then the code in the if-statement is not executed (which is ok), but $validation->valid remains true.

    Maybe you can forward this to your developer(s), they might have a better understanding?

    Viele Grüße!

    • This reply was modified 11 months ago by zopocecito.
    Plugin Author CleverReach®

    (@cleverreach43)

    Hey @zopocecito,

    I am indeed not aware of this change of the handling. That seems strange. I will check this behavior with the plugin programmers it and come back to you when i have more details! Thanks a lot for sending me all those details.

    Liebe Grüße!

    Dennis Welz

    Plugin Author CleverReach®

    (@cleverreach43)

    Hey @zopocecito,

    we found what you where referring to and have added an error message so it does not give a success message anymore when that is not true. We still need to translate it which sometimes takes time to take effect in WordPress Translation project but ist should soon be available.

    Thanks for pointing it out!
    Dennis Welz

    Plugin Author CleverReach®

    (@cleverreach43)

    Hey @zopocecito,

    the translation is live and the new plugin version 2.3.1 is released on the marketplace – this should fix it. Again thanks a lot for your input – its appreciated!

    Best Regards

    Dennis Welz

    Thread Starter zopocecito

    (@zopocecito)

    Vielen Dank auch von meiner Seite! 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Form says “success” although no api connection’ is closed to new replies.