Pregunta sobre Smart Forms - when you need more than just a contact form de Wordpress:

Captcha no funciona

Un usuario preguntó 👇

Hola,

Actualicé previamente el nuevo captcha de Google sin ningún problema. Pero, de repente, ayer, el cuadro de captcha no se mostró en el formulario de contacto del sitio.

Agregué las claves necesarias y guardé. El cuadro de captcha aparece cuando veo el formulario de contacto a través del panel de mi sitio web. Pero tan pronto como abro la página a través de otro navegador o cuando salgo, el cuadro de captcha ya no está disponible.

(@edgarrojas)

Hace 2 años, 9 meses

¡Hola!

Es probable que su formulario todavía esté usando el captcha v1, el captcha v1 ya no se puede usar (ha sido eliminado por Google). Para solucionar este problema, actualice su plugin a la última versión, elimine su antiguo campo captcha y use el nuevo (v2).

¡Sobre él!

(@edgarrojas)

Hace 2 años, 9 meses

¡Hola!

Su formulario probablemente todavía esté usando el captcha v1, el captcha v1 ya no se puede usar (ha sido eliminado por Google). Para solucionar este problema, actualice su plugin a la última versión, elimine su antiguo campo captcha y use el nuevo (v2).

¡Sobre él!

Lanzador de hilos

(@ aingeal718)

Hace 2 años, 9 meses

Tengo la última versión del plugin. Todavía no funciona.

Lanzador de hilos

(@ aingeal718)

Hace 2 años, 9 meses

Tengo la versión 2.6.6

(@edgarrojas)

Hace 2 años, 9 meses

¿Ya reemplazó el dominio recaptcha por el nuevo?

Lanzador de hilos

(@ aingeal718)

Hace 2 años, 9 meses

Si. Los reemplacé de nuevo. Lo hice anoche y lo hice de nuevo ahora mismo. Aún nada. Puedo ver que el cuadro de captcha aparece en formas inteligentes después de contar las claves. Y luego puedo ver el cuadro de captcha cuando miro el formulario de contacto a través de mi panel. Pero tan pronto como me desconecto … no está allí.

(@edgarrojas)

Hace 2 años, 9 meses

Está bien, encontré el problema. Por alguna razón (podría ser un tema o un conflicto de plugins), recaptcha está tratando de cargarse antes de estar listo, razón por la cual se desconecta en tiempo de ejecución.

Para solucionar esto, abra el archivo js / formbuilder / extrafields / rednaorecaptcha2.js y reemplácelo con su contenido:

var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var SmartFormsFields;
(function (SmartFormsFields) {
    var rednaorecaptcha2 = /** @class */ (function (_super) {
        __extends(rednaorecaptcha2, _super);
        function rednaorecaptcha2(options, serverOptions) {
            var _this = _super.call(this, options, serverOptions) || this;
            _this.IsDynamicField = true;
            sfFormElementBase.call(_this, options, serverOptions);
            _this.Title = "Title";
            _this.paper = null;
            _this.captchaId = "";
            if (_this.IsNew) {
                _this.Options.ClassName = "rednaorecaptcha2";
                _this.Options.Label = "Captcha";
                _this.Options.SiteKey = "";
                _this.ServerOptions.SecretKey = "";
            }
            _this.Options.Id = "captcha2";
            _this.Id = "captcha2";
            _this.RecaptchaAlreadyLoaded = false;
            return _this;
        }
        rednaorecaptcha2.prototype.SetData = function (data) {
        };
        rednaorecaptcha2.prototype.CreateProperties = function () {
            this.Properties.push(new SimpleTextProperty(this, this.Options, "Label", "Label", { ManipulatorType: 'basic' }));
            this.Properties.push(new SimpleTextProperty(this, this.Options, "SiteKey", "Site Key", {
                ManipulatorType: 'basic',
                'Tooltip': {
                    Text: 'Please check tutorial to know how to generate these keys: <a target="_blank" href="https://smartforms.rednao.com/configuring-recaptcha-2">https://smartforms.rednao.com/configuring-recaptcha-2</a>',
                    HideDelay: 3000
                }
            }));
            this.Properties.push(new SimpleTextProperty(this, this.ServerOptions, "SecretKey", "Secret Key", {
                ManipulatorType: 'basic',
                Tooltip: {
                    Text: 'Please check tutorial to know how to generate these keys: <a target="_blank" href="https://smartforms.rednao.com/configuring-recaptcha-2">https://smartforms.rednao.com/configuring-recaptcha-2</a>',
                    HideDelay: 3000
                }
            }));
        };
        ;
        rednaorecaptcha2.prototype.GenerateInlineElement = function () {
            var html = '';
            if (this.Options.SiteKey == '') {
                html = '<div class="rednao_label_container col-sm-3"><label class="rednao_control_label" >' + this.Options.Label + '</label></div>
            <div class="redNaoControls col-sm-9 smartFormsSlider">To use captcha you need to configure a site key and secret key <a target="_blank" href="https://smartforms.rednao.com/?p=3822&preview=true">Learn how to get them here (its free and you can get them in less than 1 minute)</a></div>';
            }
            else {
                html = '<div class="rednao_label_container col-sm-3"><label class="rednao_control_label" >' + this.Options.Label + '</label></div>
            <div class="redNaoControls col-sm-9 smartFormsSlider"></div>';
            }
            return html;
        };
        ;
        //used in smart forms
        //noinspection JSUnusedGlobalSymbols
        rednaorecaptcha2.prototype.GenerationCompleted = function (jQueryElement) {
            if (jQueryElement.parent().hasClass('component')) {
                jQueryElement.find('.redNaoControls').empty();
                jQueryElement.find('.redNaoControls').append('<img src="' + smartFormsRootPath + 'images/recaptcha2.png"></img>');
                return;
            }
            if (this.Options.SiteKey == '')
                return;
            var self = this;
            this.RecaptchaAlreadyLoaded = false;
            var siteKey = self.Options.SiteKey;
            if (siteKey == "")
                siteKey = "asdfdsaf";
            var callBack = function () {
                debugger;
                var timeOut = setInterval(function () {
                    if (typeof grecaptcha != 'undefined' && typeof grecaptcha.render != 'undefined' ) {
                        jQueryElement = self.JQueryElement; //this is needed because the jqueryelement parameter my not be the one that is shown in the form when the library finished loading
                        if (self.RecaptchaAlreadyLoaded) {
                            clearInterval(timeOut);
                            return;
                        }
                        jQueryElement.find('#rc2' + self.Id).remove();
                        var $recaptchaControl = rnJQuery('<div id="rc2' + self.Id + '"></div>');
                        if (smartFormsDesignMode)
                            $recaptchaControl.css('pointer-events', 'none');
                        jQueryElement.find('.redNaoControls').append($recaptchaControl);
                        self.RecaptchaAlreadyLoaded = true;
                        clearInterval(timeOut);
                        self.captchaId = grecaptcha.render($recaptchaControl[0], { sitekey: siteKey });
                    }
                }, 10);
            };
            callBack = callBack.bind(this);
            var count = 1;
            while (typeof (window['sfRecatchaCallBack' + count]) != 'undefined')
                count++;
            window['sfRecatchaCallBack' + count] = callBack;
            rnJQuery.RNLoadLibrary(['https://www.google.com/recaptcha/api.js?onload=sfRecatchaCallBack' + count], [], callBack);
        };
        rednaorecaptcha2.prototype.interpolate = function (start, end, smilePercentage) {
            return (start + ((end - start) * smilePercentage)).toString();
        };
        //used in smart forms
        //noinspection JSUnusedGlobalSymbols
        rednaorecaptcha2.prototype.GetValueString = function () {
            if (this.IsIgnored())
                return { value: '' };
            return { value: this.JQueryElement.find('.sfSlider').slider('option', 'value') };
        };
        ;
        //used in smart forms
        //noinspection JSUnusedGlobalSymbols
        rednaorecaptcha2.prototype.IsValid = function () {
            var response = grecaptcha.getResponse(this.captchaId) != '';
            if (response == "")
                this.AddError('root', this.InvalidInputMessage);
            else
                this.RemoveError('root');
            return this.InternalIsValid();
        };
        ;
        //used in smart forms
        //noinspection JSUnusedGlobalSymbols
        rednaorecaptcha2.prototype.StoresInformation = function () {
            return false;
        };
        ;
        rednaorecaptcha2.prototype.GetValuePath = function () {
            return 'formData.' + this.Id + '.value';
        };
        ;
        return rednaorecaptcha2;
    }(sfFormElementBase));
    SmartFormsFields.rednaorecaptcha2 = rednaorecaptcha2;
})(SmartFormsFields || (SmartFormsFields = {}));
//# sourceMappingURL=rednaorecaptcha2.js.map

Incluiré este trabajo en la próxima actualización del plugin.

¡Sobre él!

Lanzador de hilos

(@ aingeal718)

Hace 2 años, 9 meses

Abrí el archivo … Cuando reemplacé el contenido con lo que dijiste. la última línea dice “// usado en formularios inteligentes” “fin de entrada inesperado” y no hay diferencia. El captcha aún no se muestra.

Esta respuesta fue modificada hace 2 años, 9 meses por.

(@edgarrojas)

Hace 2 años, 9 meses

Desafortunadamente, no puedo decirte eso, ya que depende mucho de la configuración de tu servidor = S. ¿Podrías preguntarle a tu proveedor de alojamiento cómo puedes modificar un archivo?

Lanzador de hilos

(@ aingeal718)

Hace 2 años, 9 meses

Abrí el archivo … Cuando reemplacé el contenido con lo que dijiste. la última línea dice “// usado en formularios inteligentes” “fin de entrada inesperado” y no hay diferencia. El captcha aún no se muestra.

Lanzador de hilos

(@ aingeal718)

Hace 2 años, 9 meses

Lo siento. Lancé parte del último texto … Lo modifiqué ahora … Pero el captcha aún no se muestra.

(@edgarrojas)

Hace 2 años, 9 meses

Funciona para mi ahora. Es posible que solo necesite limpiar los archivos temporales del navegador e intentarlo de nuevo. ¿Podrías hacer eso?

Lanzador de hilos

(@ aingeal718)

Hace 2 años, 9 meses

Sí, eso funciona ahora. Gracias

¿Solucionó tu problema??

0 / 0

Deja una respuesta 0

Tu dirección de correo electrónico no será publicada.