Title: Latest version throwing errors
Last modified: October 17, 2020

---

# Latest version throwing errors

 *  Resolved [don_alejandro](https://wordpress.org/support/users/don_alejandro/)
 * (@don_alejandro)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/latest-version-throwing-errors/)
 * After updating SpeakOut to version 2.5.1 on a development server (on which WP_DEBUG
   is set to true) I started seeing the following error messages when viewing the
   WordPress dashboard.
 * WordPress database error: [Incorrect index name ”]
    ALTER TABLE wp_dk_speakout_petitions
   ADD UNIQUE KEY  (`id`)
 * WordPress database error: [Incorrect index name ”]
    ALTER TABLE wp_dk_speakout_signatures
   ADD UNIQUE KEY  (`id`)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [SpeakOut! Steve](https://wordpress.org/support/users/123host/)
 * (@123host)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/latest-version-throwing-errors/#post-13547510)
 * Is this happening ongoing or did it just happen once? Can you provide your site
   URL please?
 *  Plugin Author [SpeakOut! Steve](https://wordpress.org/support/users/123host/)
 * (@123host)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/latest-version-throwing-errors/#post-13547575)
 * Something weird is happening in your install. I have done a search of the source
   code and the string `ALTER TABLE wp_dk_speakout_petitions ADD UNIQUE KEY` doesn’t
   even exist.
 * The only script I can imagine it would be is in `wp-content/plugins/speakout/
   includes/install.php` which is where updates to the database are found. But it
   isn’t in that script. What is very odd is that old code is never removed from
   that script, if it was ever there it should still be there and I can’t find it
   at all.
 * If you have only just installed SpeakOut! I suggest removing it and re-installing.
   If it is an old install with many signatures, I the solution is making a backup
   of your site, then downloading the plugin from here [https://downloads.wordpress.org/plugin/speakout.zip](https://downloads.wordpress.org/plugin/speakout.zip)
   and replacing all the files in the `wp-content/plugins/speakout` directory.
 * I hope that helps a bit.
 *  Thread Starter [don_alejandro](https://wordpress.org/support/users/don_alejandro/)
 * (@don_alejandro)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/latest-version-throwing-errors/#post-13552993)
 * It’s line 80 of install.php: dbDelta( $sql_create_tables );
 * The UNIQUE KEY (id) part is in the CREATE TABLE sql specified in $sql_create_tables.
 * fwiw, the error message only shows up once, on the first page I load after updating
   from 2.5.0 to 2.5.1. When I look at the database table definition, it’s correct(
   I’ve had SpeakOut installed a few years and suspect the id field has always been
   defined as a UNIQUE KEY.
 * I think there may be a glitch with WordPress’s dbdelta function. I recall noticing
   a similar hiccup with dbdelta associated with defining a PRIMARY KEY a few years
   ago while working on a custom plugin – dedelta burped even when no changes were
   actually being made to the table structure.
 * I remember mucking about with syntax, ending up with
    PRIMARY KEY (term_id) and
   PRIMARY KEY (link_id,term_id)
 * in the CREATE TABLE sql instead of using the quote-like things that seemed to
   be correct from the docs
    PRIMARY KEY (`link_id`,`term_id’)
 * To be honest, I can’t recall for sure whether the syntax tweak fixed the dbdelta
   gitch or if I simply ignored the rare one-time after update error (since the 
   database appeared to be updated correctly)…
 *  Plugin Author [SpeakOut! Steve](https://wordpress.org/support/users/123host/)
 * (@123host)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/latest-version-throwing-errors/#post-13554474)
 * Correct, that SQL statement is part of the `CREATE` when initially installing
   the plugin. That doesn’t explain the error as part of an `ALTER` statement.
 * Given yours is the only report and it seems to have gone away, let’s put it down
   to “someone else’s fault” ;o)
 * Thanks for the report though

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Latest version throwing errors’ is closed to new replies.

 * ![](https://ps.w.org/speakout/assets/icon-256x256.png?rev=1649238)
 * [SpeakOut! Email Petitions](https://wordpress.org/plugins/speakout/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/speakout/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/speakout/)
 * [Active Topics](https://wordpress.org/support/plugin/speakout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/speakout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/speakout/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [SpeakOut! Steve](https://wordpress.org/support/users/123host/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/latest-version-throwing-errors/#post-13554474)
 * Status: resolved