Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter dapster105

    (@dapster105)

    Fair enough, and yes I do. πŸ˜‰

    Thanks @catboulin for the link to the Asset CleanUp plugin (https://ww.wp.xz.cn/plugins/wp-asset-clean-up/).

    A big +1 from me for this plugin for countering the inefficiencies of CF7 or any other plugin!

    Tim

    Thread Starter dapster105

    (@dapster105)

    Thanks for that. MD5 was a good idea!

    I have to make a couple of tweaks to get everything working properly:

    1. updated the table creation on activation to create IP column as VARCHAR(32) NOT NULL as you suggested.

    2. fixed single quotes around $user2long in the SELECT statements within match_adress().

    Thanks for all your help – it’s now working beautifully.

    Thread Starter dapster105

    (@dapster105)

    Hi,

    Thanks for your help. Unfortunately the code is still generating errors as it tries to store numbers which are too large for the database field.

    My understanding is that MySQL Int is always 32-bit regardless of O/S architecture and so will not be able to store many of these numbers over the unsigned 32-bit max of 4294967295:

    WordPress database error Duplicate entry '4294967295' for key 'PRIMARY' for query INSERT INTO *****_blocker (ip) VALUES ('99206155169'), ('7718117174'), ...

    Need to use BIGINT datatype in the DB?

    Thread Starter dapster105

    (@dapster105)

    Yes it’s a production machine and no likelihood of shifting to 64-bit any time soon unfortunately.

    Any tips gratefully received. I could probably figure it out with some trial, error and pain but if you could help that would be great!

    Will you find a way to support 32bit and 64bit together ‘officially’ in the future do you think?

    Thread Starter dapster105

    (@dapster105)

    Yes. Win Server 2008 x86.
    The old integer overflow classic?

    Thread Starter dapster105

    (@dapster105)

    Hi,

    I tried de-reactivating and observed the tables being destroyed and re-created but the errors persist.

    The table is created and populated but it seems this error happens 30 times (with different sets of IPs) in a row every 30 minutes as part of the background updating.

    WP is latest 4.3.1

    The problem appears to be that the ip column of the table is an unsigned int but the script is trying to insert negative integer values (see error log in previous message).

    Not sure if the table is incorrectly created or the data being inserted is nonsense. Could you describe the ip address format you’re storing in the database?

    Thanks!

    Thread Starter dapster105

    (@dapster105)

    Hi,

    Thanks for your advice.

    1. I can confirm table creation rights – [prefix]_blocker and [prefix]_blocker_log tables are created on activation.

    2. There is no outbound blocking – your script worked as expected from my server.

    The PHP error log is recording multiple entries similar to the following:

    WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO [prefix]_blocker (ip) VALUES ('1303448555'), ('1418741701'), ('1480831727'), ('-1324170897'), ('-656768086'), ('712191995'), ('1211732547'), ('1575522146'), ('1339546917'), ('-638017168'), ('-1324791596'), ('1412303152'), ('1174425841'), ('1297101117'), ('-1247654584'), ('1511699809'), ('-1402846385'), ('-1771371294'), ('1481340212'), ('1340443261'), ('-1237024155'), ('1344260415'), ('1312149932'), ('521318213'), ('1340558040'), ('838951587'), ('-1336532205'), ('1417797295'), ('-1308557375'), ('-754282514'), ('1481354492'), ('-725251623'), ('1409262531'), ('1342703824'), ('1314658929'), ('696958351'), ('783898219'), ('-1336525565'), ('1446514776'), ('1338013739'), ('1340720392'), ('1294550370'), ('-1308290222'), ('-666683253'), ('1568932450'), ('1500528814'), ('-1139347486'), ('99561475'), ('787883427'), ('1344260655'), ('1266192694'), ('1568746744'), ('1755856591'), ('1593670385'), ('-1032434637'), ('1591667836'), ('-1062940224'), ('1470761199'), ('-1295325164'), ('1839847760'), ('1574600965'), ('1471769128'), ('1351503148'), ('1292054088'), ('-2042800905'), ('411468369'), ('1457151043'), ('-735664397'), ('1308553570'), ('1339817350'), ('786411783'), ('1350596274'), ('-1185508163'), ('-541737086'), ('1529660697'), ('1548479696'), ('873786366'), ('1469910237'), ('787883421'), ('1573406935'), ('697209966'), ('1406728738'), ('1418876349'), ('1530040410'), ('94698190'), ('-1336521418'), ('49430665'), ('627816503'), ('1573406893'), ('-735052151'), ('1609161742'), ('1574882376'), ('-613929941'), ('1471326109'), ('523035810'), ('1527940164'), ('1310903214'), ('-610158810'), ('703995591'), ('-1376435830'), ('1477807736'), ('-1308400217'), ('-1138740313'), ('1471342081'), ('96970703'), ('-1125444786'), ('92648255'), ('1527157999'), ('1361111911'), ('-1336527513'), ('1592182439'), ('1421296788'), ('1471078133'), ('1464771930'), ('-1336519719'), ('1573373661'), ('-1054706670'), ('85738061'), ('-705662479'), ('1312031655'), ('-1307013657'), ('1530316559'), ('1586037306'), ('-639053925'), ('1295211824'), ('1335314972'), ('1312151050'), ('-1303496499'), ('1492414829'), ('1043303122') made by require_once('C:\inetpub\wwwroot\[webdir]\wp-admin\admin.php'), require_once('C:\inetpub\wwwroot\[webdir]\wp-load.php'), require_once('C:\inetpub\wwwroot\[webdir]\wp-config.php'), require_once('C:\inetpub\wwwroot\[webdir]\wp-settings.php'), do_action('init'), call_user_func_array, tor_table_update_check, tor_fill_table

    This seems odd since there doesn’t look to be any attempt to insert ‘0’ into the primary key id field.

    I wonder if this might be something to do with the MySQL setup? I’m not an expert in this!

    The table structure in the database is as follows:

    delimiter $$
    
    CREATE TABLE <code>redbrick_blocker</code> (
      <code>ip</code> int(10) unsigned NOT NULL,
      PRIMARY KEY (<code>ip</code>)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1$$

    Any clues here?

    Thanks!

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