1

I'm setting up comment moderation tool on a client's website, and in order to do that I need to create an app through facebook developer tools and create a webhook in order to be able to moderate comments.

When I try to set up the webhook, this is the error I receive.

The URL couldn't be validated. Response does not match challenge, expected value="716205142", received=""

enter image description here

And here's the code within the fbwebhook.php file:

<?php
    $challenge = $_GET['hub_challenge'];
    $verify_token = $_GET['hub_verify_token'];
    if ($verify_token === 'TpQQFSkEJZbVlXZzCfEx') {
        echo $challenge;
    }

    file_put_contents(
       'log.txt',
       "\n" . file_get_contents('php://input'),
       FILE_APPEND
    );

What is really driving me crazy is that this same file works on the staging site, works on other servers, but not on the server where the live site is being hosted.


We are on WPengine,

createwhimsy.staging.wpengine.com == webhook works

createwhimsy.com == webhook doesn't work (error above)

Tried on a digital ocean server == webhook works.

Tried on a different site being hosted on WPengine == webhook doesn't work (same error as above)

If I move the file I get a 404 error, so I know that FB is hitting the file, but it seems like FB isn't sending the right data to be used to verify, or something, not sure. This leads me to believe it's a DNS issue, or something with WPengine's hosting environment.

Any direction or input is much appreciated!

A.A Noman
  • 5,244
  • 9
  • 24
  • 46
TannerHolm
  • 1,983
  • 1
  • 11
  • 10

1 Answers1

0

Discovered what is is.

WPengine has a redirect bot in place that will totally mess with facebooks validation post to your site. Just have to request them to disable the bot, and it worked just fine!

TannerHolm
  • 1,983
  • 1
  • 11
  • 10