Resource icon

Registration Form Timer 2.0

No permission to download
That implies the StopBotter API took longer than 30 seconds to respond... It shouldn't be throwing this even so (if the server is down, it's caught and ignored, and the API is skipped)

I use this API on 4 of my board (some hit by bots regularly), and I haven't seen this oO

It's a warning (not an error), which I didn't catch...

All you need to do to prevent getting this warning is edit this file
library/RegFormTimer/Model/StopBotters.php

at line 146, where you see:
Code:
$jsonResponse = file_get_contents($jsonRequest);

put an @ in front of the file_get_contents, like this:
Code:
$jsonResponse = @file_get_contents($jsonRequest);

That will prevent the warning propagating (and the API will be skipped when it's slow)

- Why the API is running slow is another matter... (I did move it do a different box about 3 weeks ago, but it should have been faster, I can look at improving performance of the API)

Got another half dozen of these errors early this morning.
 
make sure any mention of "file_get_contents" has an @ in front. The actual connection attempt is within a try/catch, so it's the only place a warning will propagate from. If it's easier, I can update the file and add it as an attachment here (but I don't have access to very much to test it, since I'm away for another 5 days)
 
make sure any mention of "file_get_contents" has an @ in front. The actual connection attempt is within a try/catch, so it's the only place a warning will propagate from. If it's easier, I can update the file and add it as an attachment here (but I don't have access to very much to test it, since I'm away for another 5 days)

Hmm - all of the recent errors are still on line 146 which has already been modified.
 
Give this file a go

I cant test it since I'm away for a few more days, but it suppresses the warning and handles no response

replace library\RegFormTimer\Model\StopBotters.php with this:
 

Attachments

Getting these now:
Code:
Error Info
 
ErrorException: Fatal Error: syntax error, unexpected '{' - library/RegFormTimer/Model/StopBotters.php:148
Generated By: Unknown Account, 58 minutes ago
 
Stack Trace
 
#0 [internal function]: XenForo_Application::handleFatalError('RegFormTimer_Mo...')
#1 {main}
 
Request State
 
array(3) {
  ["url"] => string(39) "http://adminextra.com/register/register"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(17) {
    ["username"] => string(9) "AshleighO"
    ["email"] => string(29) "abortivesnails101@hotmail.com"
    ["password"] => string(8) "********"
    ["password_confirm"] => string(8) "********"
    ["dob_month"] => string(1) "4"
    ["dob_day"] => string(2) "16"
    ["dob_year"] => string(4) "1978"
    ["gender"] => string(6) "female"
    ["custom_fields"] => array(2) {
      ["interested"] => string(0) ""
      ["whatdoyouwant"] => string(0) ""
    }
    ["custom_fields_shown"] => array(3) {
      [0] => string(10) "interested"
      [1] => string(13) "software_used"
      [2] => string(13) "whatdoyouwant"
    }
    ["timezone"] => string(16) "America/New_York"
    ["captcha_question_answer"] => string(1) "9"
    ["captcha_question_hash"] => string(40) "bf0a354bb854a0d5ef85e76230a5d32e1734f5e9"
    ["agree"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["reg_key"] => string(32) "91ad54e86a0a49836550e84ded3ef2a8"
    ["time"] => string(10) "1379965607"
  }
}
 
This is the correct fix:

PHP:
            (!$jsonResponse || $jsonResponse == NULL)
            {
                return false;
            }

Should be:

PHP:
            if(!$jsonResponse || $jsonResponse == NULL)
            {
                return false;
            }
 
Can you send me the stack trace (including the line number) via IM/Conversation. It shouldn't be possible to throw an error regardless of the API now o_O
 
Okay, I think I know why this still might be timing out. It's not just the api, but your server... so by the time it is caught, it's already timed out.

I've updated the StopBotters model to use a method similar to core (uses sockets/CURL)

replace library\RegFormTimer\Model\StopBotters.php
 

Attachments

Last edited:
This one is for @Chris Deeming

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Data too long for column 'email' at row 1

#3 /home4/*******/public_html/****/library/RegFormTimer/ControllerPublic/Register.php(108): Zend_Db_Adapter_Abstract->insert('xf_reg_form_tim...', Array)

$db->insert('xf_reg_form_timer_log', $data);

possibly need to create a data writer for xf_reg_form_timer_log and sanitise each field
 
This one is for @Chris Deeming

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Data too long for column 'email' at row 1

#3 /home4/*******/public_html/****/library/RegFormTimer/ControllerPublic/Register.php(108): Zend_Db_Adapter_Abstract->insert('xf_reg_form_tim...', Array)

$db->insert('xf_reg_form_timer_log', $data);

possibly need to create a data writer for xf_reg_form_timer_log and sanitise each field

Jake sent me here as well for the same error. Any fix in the works? :)
 
Not currently as it's quite low priority in the grand scheme of things.

No one likes errors, but this one actually only affects bots or people trying to do something generally out of the ordinary (e.g. an email address over 255 characters). Your normal users or people registering will not see this error.

But it will be fixed.

The next incarnation of this add-on will use the default XenForo timer, but it will still include all of the logging and StopBotters which really is the only thing that makes this stand out now.
 
@Chris Deeming , to give you a heads up; when upgrading using the addon-installer it uses the xml inside the library folder which has an outdated version string so it is shown as updated in the list. However the one in the root is up to date and and installing manually works fine.
 
any clue how to get a timer such as this?
8m4GE.png


i thought this add one would have it :(

see the timer on bottom? not my site though + it counts down...
 
Top Bottom