• Resolved Lena1204

    (@lena1204)


    Yesterday, only a few Mac users were not able to submit signatures. Today, no one can. I see on the plugin page, a new version is out today.

    It seems my plugin files were auto updated, versus getting a WP messaging saying an update is available as in the cPanel, all of the SpeakOut plugin files have an update date of today. Good thing we had no custom code or it would have been overwritten.

    Nothing happens when you click on the Sign Now button.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 16 through 25 (of 25 total)
  • @123host, I think I speak for many when I say we appreciate your efforts. Will help as much as I can.

    • This reply was modified 5 years, 2 months ago by dougjoseph.

    @lena1204 : Re: “Wondering why we are not getting alerts from WP that there is an update available for the SpeakOut plugin.”

    WordPress gives a heads up (in the form of a numbered badge in the top admin menu, when you’re logged in) regarding updates available for plugins, themes, and WordPress core files. I’m not aware of any notifications other than that, such as an email notice or a text, etc, unless there is such a service provided by a third party or some plugin.

    @123host

    Re: “Can you please have a look in your version of /wpcontent/plugins/speakout/install.php and see if that is in there at all?”

    I downloaded the latest version, and I did find an install.php file, although it was nested one subfolder further down than your question above (was in the “includes” folder).

    When I look at it, my eyes are drawn to the “if” statement starting on line 139 (first line of the code snippet below). What I notice there are two things:

    (1) the phrase “updating if 1.20.2” shows as an error_log entry, which is significant because that matches exactly what was shown directly above the error notices in the post I made quoting the WP debug log, and

    (2) that one “if” statement is quite unlike the two below it (also shown in the code snippet) because it seems to be missing this: “$sql_update = ”
    … which is present in the “if” statements following after, and also notable from the one in focus is the line that is remarked out, “//$wpdb->query( $sql_update );”

    I tend to think the text wrapped in quotes at line 141 is what I would call an incomplete sentence. It looks like the last half of a php instruction, with the first part missing, making it only a fly in the ointment.

    This leads me to wonder if that may be why an error was thrown.

    Hope this helps!!! Thank you again for all you do!! We appreciate you!!

    if ( version_compare( $installed_version, '1.20.0', '>' ) == 1 && version_compare( $installed_version, '1.20.2', '<' ) == 1 ) {
    	error_log( 'updating if 1.20.2' );
    	"ALTER TABLE  $db_signatures  DROP <code>address_required</code>,  DROP <code>street_required</code>,  DROP <code>city_required</code>,  DROP <code>state_required</code>,  DROP <code>postcode_required</code>,  DROP <code>country_required</code>;";
    	//$wpdb->query( $sql_update );
    }	
      
    if ( version_compare( $installed_version, '1.20.0', '<' ) == 1 ) {
        error_log( 'updating if 1.20.0' );
    	$sql_update = "ALTER TABLE $db_petitions ADD <code>street_required</code> CHAR(1) NULL DEFAULT '0' AFTER <code>address_required</code>, ADD <code>city_required</code> CHAR(1) NULL DEFAULT '0' AFTER <code>street_required</code>, ADD <code>state_required</code> CHAR(1) NULL DEFAULT '0' AFTER <code>city_required</code>, ADD <code>postcode_required</code> CHAR(1) NULL DEFAULT '0' AFTER <code>state_required</code>, ADD <code>country_required</code> CHAR(1) NULL DEFAULT '0' AFTER <code>postcode_required</code>;";
    	$wpdb->query( $sql_update );
    }
    
    if ( version_compare( $installed_version, '1.19.2', '<' ) == 1 ) {
        error_log( 'updating if 1.19.2' );
    	$sql_update = "ALTER TABLE $db_petitions CHANGE <code>redirect_url</code> <code>redirect_url</code> VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;";
    	$wpdb->query( $sql_update );
    }

    @123host : One other thing I meant to mention, is that another correlation is seen in the words “ALTER TABLE” being present in both the code snippet and the debug log entries I pasted for you previously.

    @123host :

    Finally, my above observations essentially mean I wonder if the “if” statement in focus should have been like this instead:

    if ( version_compare( $installed_version, '1.20.0', '>' ) == 1 && version_compare( $installed_version, '1.20.2', '<' ) == 1 ) {
    	error_log( 'updating if 1.20.2' );
    	$sql_update = "ALTER TABLE  $db_signatures  DROP <code>address_required</code>,  DROP <code>street_required</code>,  DROP <code>city_required</code>,  DROP <code>state_required</code>,  DROP <code>postcode_required</code>,  DROP <code>country_required</code>;";
    	$wpdb->query( $sql_update );
    }

    i.e. with the “$sql_update = ” added as it seems likely needed, and with the remarked line put back into circulation.

    Plugin Author SpeakOut!

    (@123host)

    @dougjoseph nicely spotted.

    Somehow on my development site I ended up with the new database fields in the signature table instead of the petition table. I only realised when a couple of people posted that they couldn’t create petitions. The next update created them in the correct table. That code was intended to remove the extra fields – not that they were a problem, just being tidy.

    But even so, you are right, it should have had the $sql_update = at the beginning. Because I had commented out the actual update function I didn’t pay attention to the SQL statement. I am actually surprised (and pleased) that the whole thing didn’t cause a fatal error.

    @123host Cool. I’m thankful to have been a help!

    Yes, it works now (despite the “fly in the ointment” :-)). Thanks indeed.

    I’m only finding an issue left in our test petition and it is that the address fields are not showing despite being marked in the configuration. Specifically, the CP field.

    https://www.oplothink.org/index.php/gracias/solicita-la-dimision-de-la-rectora-balluerka/

    Plugin Author SpeakOut!

    (@123host)

    @macuarium thanks for the feedback.

    Can you contact me via https://speakout.123host.net.au/contact

    Thread Starter Lena1204

    (@lena1204)

    @dougjoseph I still have not figured out why the plugin is automatically updating as there are no odd plugins with such a setting as far as I can tell

    Also, I want to add placeholder text in the Country input field but from what I am reading this is not something you can do using WordPress Customization >Additional CSS. Does that sound accurate? I don’t want to create a copy of the plugin for sure.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Version 1.20.0 Broke Petition’ is closed to new replies.