Skip to content

Samuel Aguilera Posts

Validar un NIF con Gravity Forms

Cuando pedimos a un usuario que introduzca su NIF en un campo de un formulario, tan importante como guardar ese dato es validar el dato antes de guardarlo, pues no tiene ningún sentido guardar un dato que no es válido y por tanto no vamos a poder usar para cualquiera que sea el cometido para el que le hemos pedido al usuario que nos lo proporcione.

Aunque Gravity Forms no trae de serie un tipo de campo específico para validar el NIF, afortunadamente, pone a nuestra disposición filtros con los que podemos validar cualquier dato introducido en un campo del formulario con nuestra propia función de validación. De esta manera no sólo podemos validar un NIF sino cualquier otro tipo de dato que necesitemos validar.

cURL error 28 in WordPress

So you’re trying to use your favorite WordPress plugin but an ugly cURL error 28 is being displayed in your screen or error log… Something like

cURL error 28: Connection timed out after X milliseconds

or

cURL error 28: Operation timed out after X milliseconds with 0 out of 0 bytes received

What’s going on? If you search in Google you will find that in fact it’s a very common issue and it’s not tied to any plugin or WordPress itself, it’s something directly related with a server component, the cURL library, so it can affect to any web software using cURL.

In this article I’m going to explain you a few things that hopefully will help you to understand what’s the issue and things that you may check in order to fix it.

But what the hell is cURL?

cURL LogoWhen talking about WordPress, cURL is a PHP library that helps WordPress to communicate with other sites. Being a PHP library means that if you’re using an obsolete PHP version (anything older than PHP 7.0) you’re for sure also using an obsolete cURL version. So the first thing you need to do if you’re having issues with cURL is to upgrade your PHP version to at least 7.0.x or the latest PHP 7.x stable release.

Note that on some server setups (e.g. cheap shared hosting) selecting a newer PHP version to run your site doesn’t necessarily means that you’re going to use a recent cURL version.

Taller de “Seguridad en WordPress” en Congreso Web

El próximo viernes 2 de junio de 16:10 a 18:10 en la “Sala WordPress” estaré dando un taller sobre seguridad en WordPress en el Congreso Web (CW17).

Seguridad en WordPress, CW17Según tengo entendido este congreso está orientado principalmente a profesionales del marketing, por lo que doy por hecho que el nivel técnico de los asistentes no es muy alto, así que el taller irá orientado a dicho perfil de usuario, tratando que la gente que no tiene grandes conocimientos técnicos sea capaz de entender la importancia de la seguridad en WordPress y como sentar las bases para tener un WordPress protegido ante los ataques más habituales.

Use Stripe coupons with Gravity Forms

Gravity Forms has a Stripe add-on that allows you to charge your users at form submission using your Stripe.com account, but this add-on doesn’t support (currently) coupons created at your Stripe account.

Gravity Forms has a also its own Coupons add-on. Using this add-on you can create a workaround for the mentioned limitation of the Stripe add-on.

Basically we’re going to use the coupon at Stripe.com, a coupon created in the Gravity Forms Coupons add-on with the same name and discount, and a little snippet of code. Simply follow the steps below.

Gravity Forms merge tags as Default Value for form fields

If you’re new to Gravity Forms merge tags you may think, what the hell is a merge tag? Well they’re placeholders that are replaced dynamically by the value associated to them when used in some places like notifications or confirmations content and the default value setting for fields that supports it.

By default Gravity Forms provides a bunch of useful merge tags to insert values like the first name or the email of the currently logged user, the IP of the user, the title or ID of the page from where the user is submitting the form, or even the value of a custom post meta, and many other interesting data, I would recommend you to take a look to the Gravity Forms merge tags doc page to check them all.

I’m going to show you some real use case examples of how you can use the merge tags based on commonly asked questions that we see in support.