• Resolved aiden123

    (@aiden123)


    Hey,

    I have contacted the Benchmark Email company directly and they pointed me to resources within this community, I tried adding this PHP script to my website, but it returned no value for some reason

    <?php
    // Settings
    $service = ‘https://api.benchmarkemail.com/1.0/&#8217;;
    $api_key = ‘0518dfcd-a8bb-4018-af1e-32f4120d81bd’;
    $timeout = 30;
    ini_set( ‘default_socket_timeout’, $timeout );

    // Load WP
    require( ‘wp-load.php’ );
    require( ‘wp-includes/class-IXR.php’ );

    // Try Connection
    $client = new IXR_Client( $service, false, 443, $timeout );
    $args = array( ‘listGet’, $api_key, ”, 1, 100, ‘name’, ‘asc’ );
    call_user_func_array( array( $client, ‘query’ ), $args );

    // Output
    print_r( $client->getResponse() );

    ?>

    My API Key is 0518dfcd-a8bb-4018-af1e-32f4120d81bd and I keep getting a red cross next to it when I enter it into my plugin – there is no error message displayed.

    Cheers for your time
    Aiden

    https://wordpress.org/plugins/benchmark-email-lite/

Viewing 15 replies - 1 through 15 (of 29 total)
  • Plugin Author Randy Sandberg

    (@randywsandberg)

    Hi Aiden,

    Sorry to hear about your troubles! I just installed a fresh copy of WordPress 4.3.1 on my Mac using MAMP 3.4. Then I installed Benchmark Email Lite 2.5 and applied your API key and got a green checkmark meaning my system accepted your API. Thus I would, if you haven’t done so already, deactivate all other plugins as well as temporarily switch back to the default theme (e.g., Twenty Fifteen) and try again. Then report back your findings here.

    Sincerely,

    Randy Sandberg

    Plugin Author Randy Sandberg

    (@randywsandberg)

    P.S., As for the PHP coding question, I’ll let Sean answer that. 🙂

    Plugin Author Sean Conklin

    (@seanconklin)

    Hi Aiden,

    I tested your API key on my local sandbox machine and it worked just fine running the Benchmark Email Lite plugin on the latest WordPress.org version and a MAMP server environment. So we know your API key is good.

    The unit test code you provided should output something, but that depends on where they had you put it within WordPress. It appears it’s meant to go as a separate file in your WordPress root folder that you navigate to directly, such as http://mysite.com/test-benchmark.php

    Now, as to your server, there could be a number of possible culprits. Could you start by telling me more about your site?:

    – Who you use for hosting, or your website URL we can check on
    – What versions of things like WP and PHP you run
    – If there is a history of any security workarounds you had to do to get other plugins or WP core features to work, particularly areas which communicate outbound from the site.

    Thread Starter aiden123

    (@aiden123)

    Hey Randy,

    Appreciate the reply, tried that and it didn’t work for me, I used the default Twenty Thirteen theme though not Twenty Fifteen.

    Plugin Author Randy Sandberg

    (@randywsandberg)

    Hi Aiden,

    Okay, hmm, so your WordPress site is up to date and you have no active plugins other than ours and your theme is the default Twenty Thirteen (???) theme and you still cannot get your API key to be accepted, right?

    If so, please be as detailed as possible about your hosting environment as well as WordPress, Benchmark Email Lite, your browser, etcetera with versions and anything you can think of to give us. Plus, of course, your exact Steps to reproduce the issue so I can hopefully reproduce it as well. Once I can, then I can get Sean to fix it.

    P.S., Just in case the issue has to do with a slow connection, try bumping up your Connection Timeout (go to BenchmarkEmail > Settings) to 60 or at least something higher than 10 seconds and see if that allows your API key to be accepted. By the way, I am a Software Test Engineer — not a coder! — so I have no idea what your code references are above but, for our purposes here, please remove it for now so we can focus on getting your API key working.

    Thanks in advance and once again sorry for your troubles.

    Plugin Author Randy Sandberg

    (@randywsandberg)

    Oh, and of course, once your API key is working and that part of our testing is done you’ll want to get a new API key so no one else can use it!!!

    Thread Starter aiden123

    (@aiden123)

    Hey Randy,

    So my website is hosted with a website called Wealthy Affiliate – unsure as to their exact server address but I’ve had very few problems with it, my website has only been down once in the nearly 7 months I have been with them and that was only for about 5 minutes.

    I did disable all plugins and revert my theme to the default theme and still the API didn’t work.

    When I first installed the Becnhmark email, I went to my account page and got an API key (after a bit of googling how to) then I went and inserted it into the settings page, and turned the timeout setting to 30 seconds (not knowing why) then no green tick or red X displayed next to the box so I proceeded to click “save changes” then a red X appeared next to it.

    That’s about it. The browser I am using is the latest version of Google chrome Version 46.0.2490.86 (64-bit) on a Macbook pro, the version of WP I am using is the latest V 4.3.1.

    ANy other info you need?

    Thread Starter aiden123

    (@aiden123)

    ALso how do I get a new API key? I was told to do that by the Benchmark support email crew, but when I click “generate new API key” it just gives me the same one every time.

    Plugin Author Randy Sandberg

    (@randywsandberg)

    Hi Aiden,

    Hmm, I think Sean is going to have to look into this. I am not quite sure what’s going on. My only guess would be, for some reason, your host is blocking Benchmark Email Lite’s ability to talk to Benchmark Email’s API server. But that is a total guess!

    As for finding your API key, on our Settings page, right above the API key fields, there a link titled “log in to Benchmark Email to get your API key”, that when clicked, will take to in a new window to Benchmark Email’s API key generator. Where, as you stated, all one usually has to do is click “generate your API key” and a new key will be generated. If not, which is very odd, you most certainly will want to talk again with Benchmark Email support.

    Thread Starter aiden123

    (@aiden123)

    Hey Randy,

    Thanks I’ll email them now and let them know I cannot generate a new API key, perhaps this is the problem?

    Plugin Author Randy Sandberg

    (@randywsandberg)

    P.S., Do me a favor if you can, do what I did to setup a WordPress site on your Mac using MAMP and see if you can get your API key working there. At least then we’ll have a delta between your Mac and your host to consider. 😉

    Find MAMP here https://www.mamp.info/en/downloads/.

    Thread Starter aiden123

    (@aiden123)

    Downloading it now, what is MAMP? Is it like a PHP server but for wordpress sites?

    Plugin Author Randy Sandberg

    (@randywsandberg)

    MAMP (My Apache – MySQL – PHP) is a really cool self-contained and free way to run WordPress, or any other PHP powered app, on one’s computer (they have both a Mac and a Windows version). Go here https://www.mamp.info/en/ and click on Learn More to learn more! 🙂

    Thread Starter aiden123

    (@aiden123)

    Thanks Randy, I’ll get back to you once I have done this!

    Plugin Author Randy Sandberg

    (@randywsandberg)

    Perfect! 🙂

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘API Key not accepted’ is closed to new replies.