Fix for errors on the sign up form
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 19 Jun 2018 17:17:36 +0000 (13:17 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 19 Jun 2018 17:18:37 +0000 (13:18 -0400)
fixing recaptcha issue
fixing processing error issue with creating user.

index.php
models/front/billing/becomeMember.php
views/front/billing/becomeMember.html

index 9095d56..df0cabb 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Billing
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: This is glmAssociate Billing Module
- * Version: 1.0.0
+ * Version: 1.0.1
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -19,7 +19,7 @@
  * @package glmMembersBillingAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.0
+ * @version 1.0.1
  */
 
 /*
@@ -37,7 +37,7 @@
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.0');
+define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.1');
 define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.25');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index 1982df1..0a8390f 100644 (file)
@@ -124,7 +124,7 @@ class GlmMembersFront_billing_becomeMember // extends GlmDataBilling
                 'blocking' => true,
                 'headers' => array(),
                 'body' => array(
-                    'secret'   => '6LfEilYUAAAAAIcRJthzVTjLxiznY4DiYP3zDqIw',
+                    'secret'   => $this->config['settings']['recaptcha_secret_key'],
                     'response' => $_REQUEST['g-recaptcha-response'],
                     'remoteip' => $_SERVER['REMOTE_ADDR']
                 ),
@@ -442,9 +442,7 @@ class GlmMembersFront_billing_becomeMember // extends GlmDataBilling
             }
             // Save or rollback
             if ( $error ) {
-                $this->wpdb->query('ROLLBACK');
             } else {
-                $this->wpdb->query('COMMIT');
                 // $this->wpdb->query('ROLLBACK');
 
                 // Fetch the invoice type chosen by the member.
@@ -487,7 +485,9 @@ class GlmMembersFront_billing_becomeMember // extends GlmDataBilling
                 }
 
                 if ( $error ) {
+                    $this->wpdb->query('ROLLBACK');
                 } else {
+                    $this->wpdb->query('COMMIT');
                     $invoiceHtml = $BillingSupport->viewInvoice( $invoice_id );
                     $view = 'thankyou';
                     // Send admin user email notification of new member
@@ -516,13 +516,14 @@ class GlmMembersFront_billing_becomeMember // extends GlmDataBilling
             break;
 
         default:
-            wp_register_script( 'recaptcha', 'https://www.google.com/recaptcha/api.js' );
-            wp_enqueue_script( 'recaptcha' );
             $payable_types = $BillingSupport->getAllPayableInvoiceTypes();
             break;
 
         }
 
+        wp_register_script( 'recaptcha', 'https://www.google.com/recaptcha/api.js' );
+        wp_enqueue_script( 'recaptcha' );
+
         // Load DataClass for Management.
         require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataManagement.php';
         $Management = new GlmDataBillingManagement( $this->wpdb, $this->config );
index e6c8446..3141cb7 100644 (file)
 
         </fieldset>
 
-        <div class="g-recaptcha" data-sitekey="6LfEilYUAAAAAPGNgjG1_fby7IypmFlu2EjdLMu2"></div>
+        {if $settings.recaptcha_site_key}
+        <div class="g-recaptcha" data-sitekey="{$settings.recaptcha_site_key}"></div>
+        {/if}
 
         <input class="button button-primary" type="submit" value="Sign Up For Membership">