[WMTech] TAC - Stop Country Spam

[WMTech] TAC - Stop Country Spam [Paid] 3.0.0

No permission to buy ($19.00)
Hi, this looks like a great product, but I'm very confused on how to configure it. You pick the countries above, ok looks good... you get here and you start scratching your head.

1531197391047.webp

Do you have to get one from somewhere else? Where does the API come into play? Do you have a demo... this just needs some more explanation :D
 
Hi, this looks like a great product, but I'm very confused on how to configure it. You pick the countries above, ok looks good... you get here and you start scratching your head.

Just put
http://freegeoip.net/json/ANYIP (change ANYIP to your IP address)
into your browser and look what happens. :)

I would also try to use a service that works with https for security reasons. :)

FYI: freegeoip.net is dead since July 1. You will need to select another geoid provider:
If you request your API key at ipstack (still free), you need to call it this way in the future:
https://api.ipstack.com/{ip}?access_key=YOUR_ACCESS_KEY&output=json&legacy=1
 
Last edited:
The above has been failing since Monday using the new suggested settings...

Code:
[LIST]
[*]GuzzleHttp\Exception\ClientException: Client error response [url] https://freegeoip.app/json/%7Bip%7D [status code] 404 [reason phrase] Not Found
[*]src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:89
[*]Generated by: Unknown account
[*]Jul 26, 2018 at 1:26 PM
[/LIST]
Stack trace
#0 src/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php(32): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Message\Request), Object(GuzzleHttp\Message\Response))
#1 src/vendor/guzzlehttp/guzzle/src/Event/Emitter.php(108): GuzzleHttp\Subscriber\HttpError->onComplete(Object(GuzzleHttp\Event\CompleteEvent), 'complete')
#2 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(91): GuzzleHttp\Event\Emitter->emit('complete', Object(GuzzleHttp\Event\CompleteEvent))
#3 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(132): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
#4 src/vendor/react/promise/src/FulfilledPromise.php(25): GuzzleHttp\RequestFsm->GuzzleHttp\{closure}(Array)
#5 src/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
#6 src/vendor/guzzlehttp/guzzle/src/Message/FutureResponse.php(43): GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
#7 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(134): GuzzleHttp\Message\FutureResponse::proxy(Object(GuzzleHttp\Ring\Future\CompletedFutureArray), Object(Closure))
#8 src/vendor/guzzlehttp/guzzle/src/Client.php(165): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
#9 src/vendor/guzzlehttp/guzzle/src/Client.php(125): GuzzleHttp\Client->send(Object(GuzzleHttp\Message\Request))
#10 src/addons/Yugensoft/TacStopCountrySpam/XF/Service/User/Registration.php(47): GuzzleHttp\Client->get('https://freegeo...')
#11 src/addons/Yugensoft/TacStopCountrySpam/XF/Service/User/Registration.php(23): Yugensoft\TacStopCountrySpam\XF\Service\User\Registration->checkForBlockedCountry(Array)
#12 src/XF/Pub/Controller/Register.php(386): Yugensoft\TacStopCountrySpam\XF\Service\User\Registration->checkForSpam()
#13 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#14 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'Register', 'json', Object(XF\Mvc\ParameterBag), '', Object(XF\Pub\Controller\Register), NULL)
#15 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#17 src/XF.php(328): XF\App->run()
#18 index.php(13): XF::runApp('XF\\Pub\\App')
#19 {main}
 
I think a good option for this, would be have a third option where you let the registration go through, but you add the user to a user group where you can control that users interaction across the entire site that way, instead of just reject or moderate the registration.

That way a user from high risk countries can continue on, but their content is moderated via user group permissions and restricted from other site areas by them too.

It takes country blocking to a whole new level IMO.
 
Getting errors with this after activating yesterday on live site:

Code:
Server error log
XF\Db\Exception: MySQL statement prepare error [1146]: Table 'myptsd.xf_tac_scs_cache' doesn't exist src/XF/Db/AbstractStatement.php:212
Generated by: Unknown account Aug 15, 2018 at 2:48 AM
Stack trace
            SELECT `xf_tac_scs_cache`.*
            FROM `xf_tac_scs_cache`
           
            WHERE (`xf_tac_scs_cache`.`ip` = '64.52.26.40')
           
       
LIMIT 1
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1146, '42S02')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1146, '42S02')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(79): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Mvc/Entity/Finder.php(1130): XF\Db\AbstractAdapter->query('\r\n\t\t\tSELECT `xf...')
#5 src/addons/Yugensoft/TacStopCountrySpam/Entity/GeoIpCache.php(32): XF\Mvc\Entity\Finder->fetchOne()
#6 src/addons/Yugensoft/TacStopCountrySpam/XF/Service/User/Registration.php(39): Yugensoft\TacStopCountrySpam\Entity\GeoIpCache::getCache('64.52.26.40')
#7 src/addons/Yugensoft/TacStopCountrySpam/XF/Service/User/Registration.php(23): Yugensoft\TacStopCountrySpam\XF\Service\User\Registration->checkForBlockedCountry(Array)
#8 src/XF/Pub/Controller/Register.php(386): Yugensoft\TacStopCountrySpam\XF\Service\User\Registration->checkForSpam()
#9 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'Register', 'json', Object(XF\Mvc\ParameterBag), '', Object(XF\Pub\Controller\Register), NULL)
#11 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#13 src/XF.php(328): XF\App->run()
#14 index.php(13): XF::runApp('XF\\Pub\\App')
#15 {main}
Request state
array(4) {
  ["url"] => string(18) "/register/register"
  ["referrer"] => string(96) "https://www.myptsd.com/threads/what-did-you-do-today-to-work-towards-emotional-regulation.79371/"
  ["_GET"] => array(1) {
    ["/register/register"] => string(0) ""
  }
  ["_POST"] => array(15) {
    ["username"] => string(0) ""
    ["347f472aaab79346ce20df897c946fa9ce8d8ea5"] => string(4) "Kiki"
    ["5b0c9fddee21b95cf333b84c546d31590bd8947b"] => string(17) "******"
    ["email"] => string(0) ""
    ["b36997d118ff5cffa99c2e774b342652992c27f6"] => string(8) "********"
    ["dob_month"] => string(1) "6"
    ["dob_day"] => string(2) "15"
    ["dob_year"] => string(4) "1984"
    ["accept"] => string(1) "1"
    ["reg_key"] => string(16) "TUb_QOgeMK2FizsN"
    ["d7cf3ac9f3469a437adb4a3c9eebd635c23cf5e0"] => string(16) "America/New_York"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(74) "/threads/what-did-you-do-today-to-work-towards-emotional-regulation.79371/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Last edited:
Not working when you use Cache GeoIP data, blocks all registrations. Disable that, registrations are allowed, BUT, no countries are being blocked either reject or moderation option...

This add-on does not work at all, at the present time. I tested this via VPN from blocked countries selected.
 
Last edited:
The error code associated with not blocking any country at all:

Code:
Server error log
GuzzleHttp\Exception\ClientException: Client error response [url] http://freegeoip.net/shutdown [status code] 403 [reason phrase] Forbidden src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:89
Generated by: Unknown account Aug 15, 2018 at 11:56 AM
Stack trace
#0 src/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php(32): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Message\Request), Object(GuzzleHttp\Message\Response))
#1 src/vendor/guzzlehttp/guzzle/src/Event/Emitter.php(108): GuzzleHttp\Subscriber\HttpError->onComplete(Object(GuzzleHttp\Event\CompleteEvent), 'complete')
#2 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(91): GuzzleHttp\Event\Emitter->emit('complete', Object(GuzzleHttp\Event\CompleteEvent))
#3 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(132): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
#4 src/vendor/react/promise/src/FulfilledPromise.php(25): GuzzleHttp\RequestFsm->GuzzleHttp\{closure}(Array)
#5 src/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
#6 src/vendor/guzzlehttp/guzzle/src/Message/FutureResponse.php(43): GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
#7 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(134): GuzzleHttp\Message\FutureResponse::proxy(Object(GuzzleHttp\Ring\Future\CompletedFutureArray), Object(Closure))
#8 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(132): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
#9 src/vendor/react/promise/src/FulfilledPromise.php(25): GuzzleHttp\RequestFsm->GuzzleHttp\{closure}(Array)
#10 src/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
#11 src/vendor/guzzlehttp/guzzle/src/Message/FutureResponse.php(43): GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
#12 src/vendor/guzzlehttp/guzzle/src/RequestFsm.php(134): GuzzleHttp\Message\FutureResponse::proxy(Object(GuzzleHttp\Ring\Future\CompletedFutureArray), Object(Closure))
#13 src/vendor/guzzlehttp/guzzle/src/Client.php(165): GuzzleHttp\RequestFsm->__invoke(Object(GuzzleHttp\Transaction))
#14 src/vendor/guzzlehttp/guzzle/src/Client.php(125): GuzzleHttp\Client->send(Object(GuzzleHttp\Message\Request))
#15 src/addons/Yugensoft/TacStopCountrySpam/XF/Service/User/Registration.php(47): GuzzleHttp\Client->get('http://freegeoi...')
#16 src/addons/Yugensoft/TacStopCountrySpam/XF/Service/User/Registration.php(23): Yugensoft\TacStopCountrySpam\XF\Service\User\Registration->checkForBlockedCountry(Array)
#17 src/XF/Pub/Controller/Register.php(386): Yugensoft\TacStopCountrySpam\XF\Service\User\Registration->checkForSpam()
#18 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#19 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'Register', 'json', Object(XF\Mvc\ParameterBag), '', Object(XF\Pub\Controller\Register), NULL)
#20 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#22 src/XF.php(328): XF\App->run()
#23 index.php(13): XF::runApp('XF\\Pub\\App')
#24 {main}
Request state
array(4) {
  ["url"] => string(18) "/register/register"
  ["referrer"] => string(30) "https://www.myptsd.com/forums/"
  ["_GET"] => array(1) {
    ["/register/register"] => string(0) ""
  }
  ["_POST"] => array(17) {
    ["username"] => string(0) ""
    ["b2fc85409f69ae197105ebb02f01b018804e2f25"] => string(11) "anthony reg"
    ["efcc35dbef7745fbfb8005542cb7ca2f76cfb911"] => string(0) ""
    ["8f05758cc6a65784cd976af0c88e5838d1398d24"] => string(18) "***********"
    ["email"] => string(0) ""
    ["password"] => string(8) "********"
    ["e0ec371219d06d0c0795f5e89c042260e06d3acb"] => string(8) "********"
    ["dob_month"] => string(2) "11"
    ["dob_day"] => string(2) "11"
    ["dob_year"] => string(4) "1971"
    ["accept"] => string(1) "1"
    ["reg_key"] => string(16) "3mkIJbPDpqTI757U"
    ["54bd43f1dc1d9a027cd25673a5a297093ceb28fd"] => string(16) "Australia/Sydney"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(8) "/forums/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Yugensoft updated [TAC] Stop Country Spam with a new update entry:

v4.0.3

Fix: missing cache table
Change: new default GeoIP service

Existing users who are using a defunct GeoIP service (like freegeoip.net) should change the "GeoIp service request URL" option to: https://freegeoip.app/json/{$ip}

This one will also no doubt eventually shut down or become a subscription service in the future. This seems to be a rolling pattern. Users can protect against this by choosing a paid GeoIP subscription service (like ipdata.co) instead.

Read the rest of this update entry...
 
Top Bottom