Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you are able to access the files in your plugins folder, edit the file ‘auto-block.php‘, found in ‘plugins/ip-blacklist-cloud/‘ and replace the line

    $auto_block=sanitize_text_field($_POST['autoblock']);

    with

    $auto_block=$_POST['autoblock'];

    This will fix your problem. Unfortunately, the wordpress code ‘sanitize_text_field’ strips out the line feeds, carriage returns, etc. which is what is causing the problem. It’s not entirely necessary in this instance providing you don’t do anything silly with the text you enter in your auto block list.

    Hope this helps.

    Sorry, I wasn’t very clear before, too much going on in my head! The values for visits and lastvisit are of type INT(50), the value I changed was for timestamp which was originally set to VARCHAR(500). I notice now that this is set to VARCHAR(50) which certainly doesn’t cause any issues.

    You may also wish to look at the create table code for the login_failed records as you are setting the useragent field to VARCHAR(500). I think that anything above VARCHAR(320) will generate an error as shown in earlier error log.

    Other than that I think you’re good to go. ??

    Thanks for the quick response. I ran the ‘Fix’ option straight away but they made no difference. I can confirm that I received your fixed file, have installed and run it, and it now works. There’s no error log to send.

    It is similar to my first fix except I used a ‘1’ for the ‘visits’ field and the same timestamp for the ‘lastvisit’ field. I changed the database create value from varchar(500) to INT(200).

    I then went a step further and inserted a few lines that read the login_failed table, listed the number of times that my selected IP address had attempted to login and took the timestamp from his last visit to enter into the missing fields. That worked too… unfortunately I never thought to back that up before overwriting with the version you’ve sent me. D’oh!

    Ah well, that’ll give you something to do before you release the new bug-fixed version. ??

    Many thanks for the very rapid response to my bug report and the opportunity to test it for you.

    Hi, I still get this error. You say you aren’t changing timestamp to varchar(500) from int but I beg to differ! I think you’ll find a problem in ip_blacklist_cloud.php. I’ve pulled these two error messages from my error log as I can’t get this plugin to work yet. Using V3.1 at the moment but even after changing the varchar(500) to varchar(300) I still get an error because a default value for visits doesn’t exist.

    01-Jan-2014 16:15:33 UTC] WordPress database error Specified key was too long; max key length is 1000 bytes for query ALTER TABLE wp_IPBLC_usernames CHANGE COLUMN timestamp timestamp VARCHAR(500) NOT NULL made by do_action(‘admin_init’), call_user_func_array, create_sql, dbDelta
    [01-Jan-2014 16:15:35 UTC] WordPress database error Field ‘visits’ doesn’t have a default value for query INSERT INTO wp_IPBLC_blacklist (IP,timestamp) VALUES(‘175.126.111.48′,’1388592935’) made by require(‘C:\inetpub\mushin-aikido\wp-blog-header.php’), require_once(‘C:\inetpub\mushin-aikido\wp-load.php’), require_once(‘C:\inetpub\mushin-aikido\wp-config.php’), require_once(‘C:\inetpub\mushin-aikido\wp-settings.php’), do_action(‘init’), call_user_func_array, IPBLC_blockip

    Hope this helps. The file I mentioned above has more than one instance of varchar(500) in it….

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