WordPress.org

Support

Support » Plugins and Hacks » Subscribe2 » [Resolved] Subscribe2 not installed correctly on WP 3.5

[Resolved] Subscribe2 not installed correctly on WP 3.5

  • Hi!

    It seems that the upgrade method in class-s2-core.php fails to execute the calls to maybe_add_column, which makes the subscribe2 database table incomplete. This breaks (at least) the public subscription feature.

    The visible effect is that a user that tries to subscribe by entering an email address receives a “Sorry, there seems to be an error on the server. Please try again later.”.

    Is this a compatibility issue with WP 3.5 or do I have an error in my configuration?

    Cheers

    http://wordpress.org/extend/plugins/subscribe2/

Viewing 13 replies - 1 through 13 (of 13 total)
  • @niclaslockner,

    Is this a fresh install of Subscribe2 or was it an upgrade? I have not seen this error arise on any of my testing.

    It is a fresh install of subscribe2, but the WordPress install was updated from 3.4.2 to 3.5 prior to installing subscribe2.

    I tried to reproduce the error by installing and updating WP, and later installing subscribe on a test server (not the same conf as the other server), but it worked.

    I will try to investigate this further.

    @niclaslockner,

    Thanks for the extra information, from what you’ve said I’ve figure out the issue and will get this fixed in future versions.

    No, 5 users was registered when I installed subscribe2

    @niclaslockner,

    Too quick for me 🙂 I edited my reply as I’ve worked out the bug and fixed it. Thanks for the information.

    I see 🙂 Great work!

    @niclaslockner,

    To fix this on your main site look at the wp-content/plugins/subscribe2.php file and fine this line:

    define( 'S2VERSION', '8.6' );

    Change it to:

    define( 'S2VERSION', '8.5' );

    And then load the home page of your site in a browser twice. You should fine the upgrade code is then called and you can revert the change.

    Hi again, this didn’t have any effect for me.
    Based on your comment, it looks like you misunderstood me.
    The problem is not that the update code never ran during the install (or maybe it didn’t? You said you found an error). The problem is that when it does run, the calls to maybe_add_column return false and the columns are not created. I forgot to mention before that I forced the update code to run by simply add a call to it. The function runs, but the maybe_add_column fails.

    @niclaslockner,

    I found an issue that would affect a new install as the upgrade() function isn’t called on a new install. The code that initially creates the database (rather than updating it by adding new columns) was incomplete, that’s the fix I made.

    Can you check using something like PHPMyAdmin that the Subscribe2 table has the following columns:
    id, email, active, date, time, ip, conf_date, conf_time, conf_ip

    If these are all present then the install is correct and your failed message is probably down to blocked emails.

    The only columns that exist are id, email, active, date and ip, i.e. the ones that are created by the install method. All columns that should have been created by update are missing, even though I’ve run the update code. With some prints I can confirm that the maybe_add_column in update method is being called, and that it returns false, leaving the table unchanged.

    When I try to subscribe a new email, the send_confirm (class-s2-core.php) fails because the get_id didn’t find an id.

    @niclaslockner,

    Okay, so you have fallen victim to the incomplete install table creation, but your testing of maybe_add_column() is strange. That function is unchanged when I’ve compared WordPress 3.4 to 3.5.

    That function returns true on success or if the column already existed. If neither of those are true you get a failure. Have you checked for plugin and theme conflicts that might stop the function working or even SQL database user permissions.

    “..or even SQL database user permissions.”
    Thanks for the tip. It turned out that the MySQL user didn’t have permissions to alter existing tables. I created the table manually and it now works fine.
    Thanks for the help.

    @niclaslockner,

    I’m glad I could help and that the issue was found.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Resolved] Subscribe2 not installed correctly on WP 3.5’ is closed to new replies.
Skip to toolbar