Inspiration
My inspiration for this project came from personal experience and frustration with comment spam on WordPress blogs and websites. Anyone who publishes articles using WordPress are faced with a dilemma. Either force your readers to sign in using Google, WordPress, or some other third-party account, or leave the comments open to anyone and deal with the relentless barrage of bot spam and human spam farm comments that ensue.
When musing over what to build for this hackathon, it struck me that TypingDNA's API could be used quite handily to combat this problem and potentially provide a new option for WordPress site owners and managers all over the world. So I set out to build my first WordPress plugin!
Functionality
The basic theory of operation for this plugin is that every time a comment is added to a post on the website, the TypingDNA of that user is captured and logged. If the amount of content that is added exceeds anything humanly possible to have been typed that quickly (copy/paste), the comment is flagged as spam and quarantined. If the comment is allowed to go through, a timer begins as the plugin watches for more comments. If that same TypingDNA fingerprint starts to appear again and again within a short time, the comments are flagged as spam and quarantined. Additionally, that fingerprint is added to a registry of known spammers (anonymously of course) and if seen again at any point, immediately flagged.
There are numerous other ways which I have considered to improve upon this baseline, offering a full panel of configurable options to the site owner and incorporating more advanced logical algorithms into the code to more effectively combat comment spam. However, this is the fundamental functionality currently being created.
Construction
Using WordPress guide to writing plugins, lots of Google searches, and a considerable number of Stack Overflow posts, I decided to build the plugin using composer as a dependency manager. While some developers still maintain an aversion to an OOP style of WP plugin development, it made the boilerplate code easier to quantify in my mind, and ultimately I believe will make the plugin more versatile and easier to maintain. The TypingDNA API is obviously called using curl and the resulting metrics are parsed into values that can be used within the PHP and stored in the MySQL database that powers WP sites.
Challenges
(1) First time creating a WordPress plugin. (2) Lack of interest and/or commitment from teammates. (3) Making key decisions on the fly that could ultimately weigh very heavily on the popularity and usability of the plugin at scale. (4) Integrating an API that has never before been used in a WP plugin. (5) Staying awake.
Accomplishments
Potentially introducing a extremely innovative concept with software to back it up that has never been seen or thought of before. Working with a cutting-edge technology like TypingDNA and finding ways to make it compatible with much older and more difficult styles of programming like creating WP plugins, and with a very temperamental backend language like PHP.
Takeaways
Plan ahead. You can never think too far ahead, or too much about what lies ahead. Stay grounded with your core functionality. You can beef things out later when you have more time. Use assets like GitHub Projects and Slack to your advantage. However, be cautious of having your ideas and implementation spread out over too many platforms and resources.
Projections
I hope to have the plugin fully functional and deployed to the WP plugin registry for public download within the coming months. I see potential to even consider monetizing the plugin by introducing a Botmeister Pro version with exclusive paid features and customization. More to come!
Log in or sign up for Devpost to join the conversation.