Guti
Forum Replies Created
-
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyI replaced initialization event by only DOMContentLoaded, which simplifies code a lot, since it is only firing once (no need to check if already was initialized).
This fixed also the year textfield not filling properly according to my tests.
Also moved the length out of the loop scopes in order to increase performance.
As for the ajaxSuccess replacement, there is not a raw pure Javascript substitute. In fact this ajax event, is only taking care of AJAX requests managed by jquery, so if a plugin does an ajax request, it will not be captured. So not very reliable IMHO.
Take a look at the updated version at https://www.javiergutierrezchamorro.com/_temp/anti-spam-4.0.js.zip and let me know if any concerns.
Cheers.
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyMaybe we can use only DOMContentLoaded since most browsers already support it:
https://caniuse.com/#feat=domcontentloadedWhat do you think about this simplification?
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyThanks for the testing and the beta.
I think that the problem is on the initialization, being called before the whole document is loaded. To that extent, I guess that removing the initialization control and allowing it to initialize more than one time, will be the workarround:
if (anti_spam_initialized)
{
return;
}I think that the problem are on different events launched for initialization, they are there because DOMContentLoaded is not supported in all browsers, but in that case when DOMContentLoaded is supported, onload has already fired.
Will take a look at some events improvements to just initialize once.
Looking at your updated code, I would suggest precalculating items lenght before the loop, just to avoid counting the lenght of the elements on each iteration.
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyForum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyI have updated the JS with some minor tweaks. Find it on same URL:
https://www.javiergutierrezchamorro.com/_temp/anti-spam-3.5.js.zipForum: Plugins
In reply to: [Titan Anti-spam & Security] Improve ideasGood!
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyThat’s good.
I could expect some minor glitches after the conversion, so let me know, and I will take care of them.
Regards.
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Improve ideasFeriman, it is not using any custom table.
As for 1) it makes sense to use an invisible field that is populated by PHP with current timestamp. When comment are summited, we check how much time it took. If was less that 3 seconds, or more than 3600, we refuse it.
Important thing of that is not only for spam-bots, but for spam humans that simply copy&paste comments in web sites.
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyI have been running the plugin with my Javascript conversion, and during 4 hours, it detected about 25 spam comments, so I guess modifications are working properly.
Also, I tested it using user comments with Opera, Internet Explorer, and Chrome and they were posted fine.
Then I tried with Lynx (without Javascript), and manually entering the year, worked too.
So I guess, my code is OK. If it is fine to you, I would suggest releasing a public beta, so we can asure it will work in different blog configurations. Makes sense?
For?a Bar?a!
Forum: Plugins
In reply to: [Titan Anti-spam & Security] Remove jQuery dependencyNice. I have performed a quick conversion, that I am now testing on my site.
In the meantime, you can get it at: https://www.javiergutierrezchamorro.com/_temp/anti-spam-3.5.js.zip
Would be very nice if you can do a code review to it in the meantime.
Regards.