WordPress.org

Ready to get started?Download WordPress

Forums

WordPress.com Stats
Keeps asking for API key even though I have entered it (2 posts)

  1. huyz
    Member
    Posted 3 years ago #

    After entering my API key, the plugins page keeps saying:

    WordPress.com Stats needs attention: please enter an API key or disable the plugin.

    When I go to the stats setting page, there is no way to re-enter the key

  2. huyz
    Member
    Posted 3 years ago #

    I hacked my way out of this damn thing.

    Here's what my 'stats_options' field had in mysql:
    a:12:{s:4:"host";s:12:"mysite.com";s:4:"path";s:1:"/";s:7:"blog_id";i:24155805;s:9:"admin_bar";b:1;s:5:"wp_me";b:1;s:5:"roles";a:3:{i:0;s:13:"administrator";i:1;s:6:"editor";i:2;s:6:"author";}s:9:"reg_users";b:0;s:6:"footer";b:1;s:7:"version";s:1:"7";s:5:"error";b:0;s:9:"key_check";b:0;s:7:"api_key";N;}

    Note that the 'api_key' is null.

    I had to manually hack the plugin to reallow me to enter the API key:

    I temporarily changed:
    <?php if ( empty($options['blog_id']) && !empty($options['key_check']) ) : ?>
    to
    <?php if ( true || empty($options['blog_id']) && !empty($options['key_check']) ) : ?>

    After re-entering my key, I now have this in mysql:
    a:12:{s:4:"host";s:12:"mysite.com";s:4:"path";s:1:"/";s:7:"blog_id";i:24155805;s:9:"admin_bar";b:1;s:5:"wp_me";b:1;s:5:"roles";a:3:{i:0;s:13:"administrator";i:1;s:6:"editor";i:2;s:6:"author";}s:9:"reg_users";b:0;s:6:"footer";b:0;s:7:"version";s:1:"7";s:5:"error";b:0;s:9:"key_check";b:0;s:7:"api_key";s:12:"c3d043ab9d2c";}
    Note how the api_key now has a value.

    Looks like the wordpress.com server had given back some sort of error when it did the API check the first time, and this plugin didn't handle it properly and was stuck in an undefined state.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags