Easiest way to integrate captcha's into Symfony2 FOSUserBundle registration? - symfony

I'm using Symfony2 and the FOSUserBundle to manage registration and logins. I'd like to add a captcha system. Is there are pre-existing bundle or tutorial on this?
Of course, I could try to roll my own using Google re-captcha. In that case, is Google reCaptcha a good choice, or should I use some other API?

There are indeed a bundles for that, take a look at:
CaptchaBundle
Or
EWZRecaptchaBundle
Both got (most likely) all the documentation you need added in the README.md file or extended documentation.

I just wrote a tiny bundle called caitcha-bundle.
According to this part of the fos user bundle documenation implementation should be quite easy because you only have to activate the caitcha bundle and add $builder->add('caitcha', 'caitcha'); to the form type.
Because captcha images and any other approaches that require some user interaction which is not related to the form itself are very annoying in my optinion, I tried to implement an invisible bot protection by using the honeypot method and a check for the time it took to fill in the form. It works well for my use cases but still has to be extended by more checks I suppose. I would appreciate any suggestions to improve this bundle.

Related

Display products from Woocommerce in external application

I have a question about integration e.g. Woocommerce with external app.
What is the best and safe method to accomplish this goal?
Woocommerce has REST API but it might be quite vulnerable and will not show anything (products etc.) to non logged user(which is understandable).
Only safe idea that's comes to my mind is creating scripts inside WordPress and access them via AJAX but I'm worrying about performance of this method.
Maybe there is a right way that I'm not familiar with?
For that purpose, you should create an API from scratch of the wordpress database. wordpress databse has all of you need in a good way and only some php codes needed to create and execute the API. then in you app with AJAX you should access that.
this link may help you:
https://developer.okta.com/blog/2019/03/08/simple-rest-api-php
The right way is likely creating your own API if you don't want to use Woocommence's one. That means you make a plan of what you need to expose, all the routes and start building the API. I warmly recommend the book by Phil Sturgeon - Build APIs you won't hate. The author is also a co-founder of https://phptherightway.com/ so it's quite reputable.

WP-API - How get post resource by name instead ID?

I'm developing a system integration java webapp - wordpress CMS. I adopted the WP-API plugin.
In my case i have some codes in JSPs like.. for example using JSTL:
<c:import url="[[host-wordpress]]/wp-api/post/44888">
However, if a wordpress user recreate the post consequently broken my integration.
Also would be intuitive for java frontend programmer find a code like :
<c:import url="[[host-wordpress]]/wp-api/post/news-about-something">
I saw in wp-api documentation that is possible by WP-QUERY, however i would like to implement a less invasive method.
Anybody knows how to do that ?
I forked wp-api and I added a new method :
https://github.com/dufabricio/WP-API/commit/3c3399c9a613143590d38df06a8f4c4848b21627
I don't know if it is the better way, but this method solves my issue by now :)

Plugin System for symfony2

Is there a known tutorial that shows how to create a plugin system for symfony2?
Something like the big cms' have, a folder in the root directory where you can place your plugins.
Google just made a fool with me because the symfony1 bundles were called "plugins".
I imagine plugins to be just bundles, but not in the src but in the new plugins one.
They should be registered at runtime.
I believe you can use Event Dispatcher from Symfony to achive want you want. The below link might help you.
http://symfony.com/doc/master/components/event_dispatcher/introduction.html
I don't have any guide to explain how to use this for plugin system as I am personally looking for it.

WordPress: Plugin Development overriding guide

I have been developing plugins for WordPress. Most plugin I have developed with two three classes and not so huge like Buddypress, WooCommerce or etc.
I am planning to make two open source plugins to deliver some sort of complex system (detail can't share you at the moment but later during the development) where other developers can customize functions and system for them need same as Buddypress and WooCommerce.
As I check those plugins files and realize they have register them own action and filters which developers can modify as per them need. But my problem is unable to understand completely how I should write the plugin where other developer have flexibility to override plugin function as well as they can add them own.
I know it is difficult to give definite answer but I need some sort of start-up guide so I can go into right direction. Do I need to register my action and filters? If yes how to do? if not than how can I do?
Your hint will help me a lot... Thanks a lot
You can check WordPress-Plugin-Boilerplate, it should get you started on the right path.
It may be useful to use wp-cli for generate plugin like so:
wp scaffold plugin my-plugin
Or using "WordPress Plugin Boilerplate" for more complex works: https://wpbp.github.io/wiki.html

The appropriate way to build a registration form in Drupal?

I just started studying Drupal 7 and learned how powerful CCK and Views are. But it still confuses me a bit because it behaves so differently compared to Wordpress. Now I want to build registration form, is it appropriate to build it using CCK? If so, how do I make it so it would make the login system aware that a new user has registered? Or would it be better and easier to modify the built-in registration system to my liking?
A registration form for... what exactly? The site? An event? RSVP? If this is just to register and post comments or blog articles, then use the core login system- thats what it's there for. You can add fields to this form by enabling Profile module and adding fields to capture more data about the user.

Resources