Completed
Pull Request — staging (#840)
by
unknown
15:43
created
src/Field/BaseInput.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace YIKES\EasyForms\Field;
11 11
 
12
-use YIKES\EasyForms\Exception\MustExtend;
13
-
14 12
 /**
15 13
  * Class BaseInput
16 14
  *
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 	}
104 104
 
105 105
 	public function get_id() {
106
-        return 'yikes-easy-mc-form-' . $this->form_id . '-' . $this->merge;
107
-    }
106
+		  return 'yikes-easy-mc-form-' . $this->form_id . '-' . $this->merge;
107
+	 }
108 108
 
109 109
 	public function get_value() {
110 110
 		return $this->value;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 		</p>
141 141
 
142 142
         <?php
143
-        endif;
143
+		  endif;
144 144
 		?>
145 145
 		<input type="<?= esc_attr( $this->get_type() ); ?>"
146 146
 			class="<?= esc_attr( implode( ' ' , $this->field_classes() ) ); ?>"
@@ -161,6 +161,6 @@  discard block
 block discarded – undo
161 161
 		?>
162 162
             <p class="form-field-description" id="form-field-description-<?= esc_attr( $this->merge ); ?>"><?=  esc_html( $desc_value ); ?></p>
163 163
         <?php
164
-        }
164
+		  }
165 165
 	}
166 166
 }
Please login to merge, or discard this patch.
src/Field/Hidden.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace YIKES\EasyForms\Field;
11 11
 
12
-use YIKES\EasyForms\Exception\InvalidField;
13
-
14 12
 /**
15 13
  * Class Hidden
16 14
  *
Please login to merge, or discard this patch.
src/Form/OptinForm.php 1 patch
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -14,14 +14,8 @@
 block discarded – undo
14 14
 use YIKES\EasyForms\Field\Field;
15 15
 use YIKES\EasyForms\Field\Hidden;
16 16
 use YIKES\EasyForms\Field\Types;
17
-use YIKES\EasyForms\Renderable;
18
-use YIKES\EasyForms\Assets\AssetsAware;
19
-use YIKES\EasyForms\Assets\AssetsAwareness;
20
-use YIKES\EasyForms\Assets\ScriptAsset;
21
-use YIKES\EasyForms\Service;
22 17
 use YIKES\EasyForms\Model\OptinForm as EasyFormsModel;
23 18
 use YIKES\EasyForms\Model\Recaptcha as RecaptchaModel;
24
-use YIKES\EasyForms\Model\OptinMeta as Meta;
25 19
 
26 20
 /**
27 21
  * Class OptinForm
Please login to merge, or discard this patch.
src/Recaptcha/Recaptcha.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use YIKES\EasyForms\Assets\AssetsAwareness;
14 14
 use YIKES\EasyForms\Assets\ScriptAsset;
15 15
 use YIKES\EasyForms\Service;
16
-use YIKES\EasyForms\View\View;
17 16
 use YIKES\EasyForms\Model\Recaptcha as RecaptchaModel;
18 17
 
19 18
 /**
Please login to merge, or discard this patch.
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -23,42 +23,42 @@  discard block
 block discarded – undo
23 23
  */
24 24
 final class Recaptcha implements Service, AssetsAware {
25 25
 
26
-    use AssetsAwareness;
26
+	 use AssetsAwareness;
27 27
 
28
-    const VIEW_URI        = 'views/recaptcha-box';
29
-    const JS_HANDLE       = 'google-recaptcha-js';
30
-    const JS_URI          = 'https://www.google.com/recaptcha/api.js';
31
-    const JS_DEPENDENCIES = [ 'jquery', 'form-submission-helpers' ];
32
-    const JS_VERSION      = '1.0.0';
28
+	 const VIEW_URI        = 'views/recaptcha-box';
29
+	 const JS_HANDLE       = 'google-recaptcha-js';
30
+	 const JS_URI          = 'https://www.google.com/recaptcha/api.js';
31
+	 const JS_DEPENDENCIES = [ 'jquery', 'form-submission-helpers' ];
32
+	 const JS_VERSION      = '1.0.0';
33 33
 
34
-    public function register() {
35
-        $this->register_assets();
34
+	 public function register() {
35
+		  $this->register_assets();
36 36
 
37
-        add_action( 'easy_forms_do_recaptcha_box', function( $view ) {
38
-            $this->enqueue_assets();
39
-            echo $view->render_partial( static::VIEW_URI ); // phpcs:ignore WordPress.Security.EscapeOutput
40
-        } );
41
-    }
37
+		  add_action( 'easy_forms_do_recaptcha_box', function( $view ) {
38
+				$this->enqueue_assets();
39
+				echo $view->render_partial( static::VIEW_URI ); // phpcs:ignore WordPress.Security.EscapeOutput
40
+		  } );
41
+	 }
42 42
 
43
-     /**
44
-	 * Get the context to pass onto the view.
45
-	 *
46
-	 * Override to provide data to the view.
47
-	 *
48
-	 * @since %VERSION%
49
-	 *
50
-	 * @return array Context to pass onto view.
51
-	 */
43
+	  /**
44
+	   * Get the context to pass onto the view.
45
+	   *
46
+	   * Override to provide data to the view.
47
+	   *
48
+	   * @since %VERSION%
49
+	   *
50
+	   * @return array Context to pass onto view.
51
+	   */
52 52
 	protected function get_context() {
53 53
 		return $this->recaptcha['recaptcha_options'];
54
-    }
54
+	 }
55 55
     
56
-    private function get_script_params() {
57
-        $recaptcha_options = ( new RecaptchaModel() )->setup();
58
-        return $recaptcha_options['script_params'];
59
-    }
56
+	 private function get_script_params() {
57
+		  $recaptcha_options = ( new RecaptchaModel() )->setup();
58
+		  return $recaptcha_options['script_params'];
59
+	 }
60 60
 
61
-    public function __get( $name ) {
61
+	 public function __get( $name ) {
62 62
 		switch ( $name ) {
63 63
 			case 'script_params':
64 64
 				return $this->get_script_params();
@@ -66,23 +66,23 @@  discard block
 block discarded – undo
66 66
 			default:
67 67
 				return null;
68 68
 		}
69
-    }
69
+	 }
70 70
 
71
-    /**
72
-	 * Load asset objects for use.
73
-	 *
74
-	 * @since %SINCE%
75
-	 */
71
+	 /**
72
+	  * Load asset objects for use.
73
+	  *
74
+	  * @since %SINCE%
75
+	  */
76 76
 	protected function load_assets() {  
77 77
 		$this->assets= [
78 78
 			new ScriptAsset(
79
-                self::JS_HANDLE,
80
-                self::JS_URI . $this->script_params,
81
-                self::JS_DEPENDENCIES,
82
-                self::JS_VERSION,
83
-                ScriptAsset::ENQUEUE_HEADER,
84
-                true
85
-            ),
79
+					 self::JS_HANDLE,
80
+					 self::JS_URI . $this->script_params,
81
+					 self::JS_DEPENDENCIES,
82
+					 self::JS_VERSION,
83
+					 ScriptAsset::ENQUEUE_HEADER,
84
+					 true
85
+				),
86 86
 		];
87
-    }
87
+	 }
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
src/Shortcode/EasyFormsShortcode.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 use YIKES\EasyForms\Model\Subscriber;
18 18
 use YIKES\EasyForms\Model\SubscriberRepository;
19 19
 use YIKES\EasyForms\Model\OptinForm as EasyFormsModel;
20
-use YIKES\EasyForms\Model\Recaptcha as RecaptchaModel;
21 20
 
22 21
 /**
23 22
  * Class EasyFormsShortcode
Please login to merge, or discard this patch.
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 final class EasyFormsShortcode extends BaseShortcode {
30 30
 
31
-    const TAG           = 'yikes-mailchimp';
31
+	 const TAG           = 'yikes-mailchimp';
32 32
 	const VIEW_URI      = 'views/easy-forms-shortcode';
33 33
 	const SUBMITTED_URI = 'views/easy-forms-shortcode-completed';
34 34
 	
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 	 * @since %VERSION%
50 50
 	 * @var string
51 51
 	 */
52
-    private $view_uri = self::VIEW_URI;
52
+	 private $view_uri = self::VIEW_URI;
53 53
     
54
-    /**
55
-	 * Get the default array of attributes for the shortcode.
56
-	 *
57
-	 * @since %VERSION%
58
-	 * @return array
59
-	 */
54
+	 /**
55
+	  * Get the default array of attributes for the shortcode.
56
+	  *
57
+	  * @since %VERSION%
58
+	  * @return array
59
+	  */
60 60
 	public function get_default_atts() {
61 61
 		return [
62 62
 			'form'                       => '',
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		}
142 142
 	}
143 143
     
144
-   /**
144
+	/**
145 145
 	 * Get the View URI to use for rendering the shortcode.
146 146
 	 *
147 147
 	 * @since %VERSION%
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	protected function get_view_uri() {
152 152
 		return $this->view_uri;
153
-    }
153
+	 }
154 154
     
155
-    /**
156
-	 * Set the view URI.
157
-	 *
158
-	 * @since %VERSION%
159
-	 *
160
-	 * @param string $uri The URI to use.
161
-	 */
155
+	 /**
156
+	  * Set the view URI.
157
+	  *
158
+	  * @since %VERSION%
159
+	  *
160
+	  * @param string $uri The URI to use.
161
+	  */
162 162
 	private function set_view_uri( $uri ) {
163 163
 		$this->view_uri = $uri;
164 164
 	}
@@ -173,15 +173,15 @@  discard block
 block discarded – undo
173 173
 		return ! empty( $_POST );
174 174
 	}
175 175
     
176
-    /**
177
-	 * Render the current Renderable.
178
-	 *
179
-	 * @since %VERSION%
180
-	 *
181
-	 * @param array $context Context in which to render.
182
-	 *
183
-	 * @return string Rendered HTML.
184
-	 */
176
+	 /**
177
+	  * Render the current Renderable.
178
+	  *
179
+	  * @since %VERSION%
180
+	  *
181
+	  * @param array $context Context in which to render.
182
+	  *
183
+	  * @return string Rendered HTML.
184
+	  */
185 185
 	public function render( array $context = [] ) {
186 186
 		try {
187 187
 			$this->enqueue_assets();
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
 		return isset( $subscriber ) ? $subscriber : null;
233 233
 	}
234 234
     
235
-    /**
236
-	 * Convert an exception to a string.
237
-	 *
238
-	 * @since %VERSION%
239
-	 *
240
-	 * @param \Exception $e The exception object.
241
-	 *
242
-	 * @return string
243
-	 */
235
+	 /**
236
+	  * Convert an exception to a string.
237
+	  *
238
+	  * @since %VERSION%
239
+	  *
240
+	  * @param \Exception $e The exception object.
241
+	  *
242
+	  * @return string
243
+	  */
244 244
 	private function exception_to_string( \Exception $e ) {
245 245
 		return sprintf(
246 246
 			/* translators: %s refers to the error message */
@@ -251,14 +251,14 @@  discard block
 block discarded – undo
251 251
 
252 252
 	public function load_assets() {
253 253
 		$submission_helper = new ScriptAsset(
254
-            'form-submission-helpers',
255
-            'assets/js/dev/form-submission-helpers',
256
-            [ 'jquery' ],
257
-            '1.0.0',
258
-            ScriptAsset::ENQUEUE_HEADER
259
-        );
254
+				'form-submission-helpers',
255
+				'assets/js/dev/form-submission-helpers',
256
+				[ 'jquery' ],
257
+				'1.0.0',
258
+				ScriptAsset::ENQUEUE_HEADER
259
+		  );
260 260
 
261
-        $submission_helper->add_localization( 'form_submission_helpers', array(
261
+		  $submission_helper->add_localization( 'form_submission_helpers', array(
262 262
 			'ajax_url'           => esc_url( admin_url( 'admin-ajax.php' ) ),
263 263
 			'preloader_url'      => apply_filters( 'yikes-mailchimp-preloader', esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) ),
264 264
 			'countries_with_zip' => $this->countries_with_zip(),
@@ -271,19 +271,19 @@  discard block
 block discarded – undo
271 271
 	}
272 272
 
273 273
 	public function countries_with_zip() {
274
-        return [
275
-            'US' => 'US', 'GB' => 'GB', 'CA' => 'CA', 
276
-            'IE' => 'IE', 'CN' => 'CN', 'IN' => 'IN', 
277
-            'AU' => 'AU', 'BR' => 'BR', 'MX' => 'MX',
278
-            'IT' => 'IT', 'NZ' => 'NZ', 'JP' => 'JP',
279
-            'FR' => 'FR', 'GR' => 'GR', 'DE' => 'DE',
280
-            'NL' => 'NL', 'PT' => 'PT', 'ES' => 'ES'
281
-        ];
282
-    }
274
+		  return [
275
+				'US' => 'US', 'GB' => 'GB', 'CA' => 'CA', 
276
+				'IE' => 'IE', 'CN' => 'CN', 'IN' => 'IN', 
277
+				'AU' => 'AU', 'BR' => 'BR', 'MX' => 'MX',
278
+				'IT' => 'IT', 'NZ' => 'NZ', 'JP' => 'JP',
279
+				'FR' => 'FR', 'GR' => 'GR', 'DE' => 'DE',
280
+				'NL' => 'NL', 'PT' => 'PT', 'ES' => 'ES'
281
+		  ];
282
+	 }
283 283
 
284
-    public function page_data() {
285
-        global $post;
284
+	 public function page_data() {
285
+		  global $post;
286 286
 		$page_data = isset( $post->ID ) ? $post->ID : 0;
287 287
 		return apply_filters( 'yikes-mailchimp-page-data', $page_data );
288
-    }
288
+	 }
289 289
 }
Please login to merge, or discard this patch.
src/Exception/InvalidRecaptcha.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,25 +29,25 @@
 block discarded – undo
29 29
 	 */
30 30
 	public static function from_site_key() {
31 31
 		$message = sprintf(
32
-            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
32
+				__( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
33 33
 		);
34 34
 
35 35
 		return new static( $message );
36 36
 	}
37 37
 
38
-    /**
39
-	 * Create a new instance of the exception for a field class name that is
40
-	 * not recognized.
41
-	 *
42
-	 * @since %VERSION%
43
-	 *
44
-	 * @param string $field Class name of the service that was not recognized.
45
-	 *
46
-	 * @return static
47
-	 */
38
+	 /**
39
+	  * Create a new instance of the exception for a field class name that is
40
+	  * not recognized.
41
+	  *
42
+	  * @since %VERSION%
43
+	  *
44
+	  * @param string $field Class name of the service that was not recognized.
45
+	  *
46
+	  * @return static
47
+	  */
48 48
 	public static function from_secret_key() {
49 49
 		$message = sprintf(
50
-            __( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
50
+				__( 'Whoops! It looks like you enabled reCAPTCHA but forgot to enter the reCAPTCHA site key!' , 'yikes-inc-easy-mailchimp-extender' ) . '<span class="edit-link yikes-easy-mc-edit-link"><a class="post-edit-link" href="' . esc_url( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings&section=recaptcha-settings' ) ) . '" title="' . __( 'ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Edit ReCaptcha Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '</a></span>'
51 51
 		);
52 52
 
53 53
 		return new static( $message );
Please login to merge, or discard this patch.
src/Util/Debugger.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -6,32 +6,32 @@
 block discarded – undo
6 6
 
7 7
 class Debugger implements Service {
8 8
 
9
-    const LOG_NAME = 'freddie_log';
10
-
11
-    public function register() {
12
-        $this->register_log();
13
-    }
14
-
15
-    public function register_log() :void {
16
-        if ( ! get_option( self::LOG_NAME ) ) {
17
-            add_option( self::LOG_NAME, [] );
18
-        }
19
-    }
20
-
21
-    public function get_log() {
22
-        return get_option( self::LOG_NAME, [] );
23
-    }
24
-
25
-   public function pretty_log() {
26
-       $log = $this->get_log();
27
-       return $this->pretty_debug( 'Pretty Log', $log );
28
-   }
29
-
30
-    public function pretty_debug( $label, $value ) {
31
-            $res = "<strong>{$label}</strong>";
32
-            $res .= "<pre>";
33
-            $res .= esc_html( json_encode( $value, JSON_PRETTY_PRINT ) );
34
-            $res .= "</pre>";
35
-            echo $res;
36
-    }
9
+	 const LOG_NAME = 'freddie_log';
10
+
11
+	 public function register() {
12
+		  $this->register_log();
13
+	 }
14
+
15
+	 public function register_log() :void {
16
+		  if ( ! get_option( self::LOG_NAME ) ) {
17
+				add_option( self::LOG_NAME, [] );
18
+		  }
19
+	 }
20
+
21
+	 public function get_log() {
22
+		  return get_option( self::LOG_NAME, [] );
23
+	 }
24
+
25
+	public function pretty_log() {
26
+		 $log = $this->get_log();
27
+		 return $this->pretty_debug( 'Pretty Log', $log );
28
+	}
29
+
30
+	 public function pretty_debug( $label, $value ) {
31
+				$res = "<strong>{$label}</strong>";
32
+				$res .= "<pre>";
33
+				$res .= esc_html( json_encode( $value, JSON_PRETTY_PRINT ) );
34
+				$res .= "</pre>";
35
+				echo $res;
36
+	 }
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
src/Model/OptinMeta.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -13,31 +13,31 @@
 block discarded – undo
13 13
 
14 14
 interface OptinMeta {
15 15
 
16
-    const EMAIL     = 'email';
17
-    const TEXT      = 'text';
18
-    const NUMBER    = 'number';
19
-    const URL       = 'url';
20
-    const IMAGE_URL = 'imageurl';
21
-    const PHONE     = 'phone';
22
-    const ZIP       = 'zip';
23
-    const ADDRESS   = 'address';
24
-    const DATE      = 'date';
25
-    const BIRTHDAY  = 'birthday';
26
-    const DROPDOWN  = 'dropdown';
27
-    const RADIO     = 'radio';
28
-    const CHECKBOX  = 'checkbox';
16
+	 const EMAIL     = 'email';
17
+	 const TEXT      = 'text';
18
+	 const NUMBER    = 'number';
19
+	 const URL       = 'url';
20
+	 const IMAGE_URL = 'imageurl';
21
+	 const PHONE     = 'phone';
22
+	 const ZIP       = 'zip';
23
+	 const ADDRESS   = 'address';
24
+	 const DATE      = 'date';
25
+	 const BIRTHDAY  = 'birthday';
26
+	 const DROPDOWN  = 'dropdown';
27
+	 const RADIO     = 'radio';
28
+	 const CHECKBOX  = 'checkbox';
29 29
 
30
-    const FIELD_MAP = [
30
+	 const FIELD_MAP = [
31 31
 		self::EMAIL     => Types::EMAIL,
32 32
 		self::TEXT      => Types::TEXT,
33 33
 		self::NUMBER    => Types::NUMBER,
34 34
 		self::URL       => Types::URL,
35
-        self::IMAGE_URL => Types::IMAGE_URL,
36
-        self::PHONE     => Types::PHONE,
37
-        self::ZIP       => Types::ZIP,
38
-        self::ADDRESS   => Types::ADDRESS,
39
-        self::DATE      => Types::DATE,
40
-        self::BIRTHDAY  => Types::BIRTHDAY,
41
-        self::CHECKBOX  => Types::CHECKBOX,
35
+		  self::IMAGE_URL => Types::IMAGE_URL,
36
+		  self::PHONE     => Types::PHONE,
37
+		  self::ZIP       => Types::ZIP,
38
+		  self::ADDRESS   => Types::ADDRESS,
39
+		  self::DATE      => Types::DATE,
40
+		  self::BIRTHDAY  => Types::BIRTHDAY,
41
+		  self::CHECKBOX  => Types::CHECKBOX,
42 42
 	];
43 43
 }
Please login to merge, or discard this patch.
src/Model/Recaptcha.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -6,70 +6,70 @@
 block discarded – undo
6 6
 
7 7
 final class Recaptcha {
8 8
 
9
-    public $recaptcha_options;
10
-    public $site_key;
11
-    public $secret_key;
9
+	 public $recaptcha_options;
10
+	 public $site_key;
11
+	 public $secret_key;
12 12
 
13
-    const STATUS     = 'yikes-mc-recaptcha-status';
14
-    const SITE_KEY   = 'yikes-mc-recaptcha-site-key';
15
-    const SECRET_KEY = 'yikes-mc-recaptcha-secret-key';
13
+	 const STATUS     = 'yikes-mc-recaptcha-status';
14
+	 const SITE_KEY   = 'yikes-mc-recaptcha-site-key';
15
+	 const SECRET_KEY = 'yikes-mc-recaptcha-secret-key';
16 16
 
17
-    public function setup( $recaptcha_options = [] ) {
18
-        if ( ! $this->has_recaptcha() ) {
19
-            return false;
20
-        }
21
-        return $this->get_options( $recaptcha_options );
22
-    }
17
+	 public function setup( $recaptcha_options = [] ) {
18
+		  if ( ! $this->has_recaptcha() ) {
19
+				return false;
20
+		  }
21
+		  return $this->get_options( $recaptcha_options );
22
+	 }
23 23
 
24
-    private function has_recaptcha() {
25
-        if ( get_option( static::STATUS, '' ) == '1' ) {
26
-            return true;
27
-        }
28
-        return false;
29
-    }
24
+	 private function has_recaptcha() {
25
+		  if ( get_option( static::STATUS, '' ) == '1' ) {
26
+				return true;
27
+		  }
28
+		  return false;
29
+	 }
30 30
 
31
-    private function get_site_key() {
32
-        $site_key = get_option( 'yikes-mc-recaptcha-secret-key' , '' );
33
-        if ( ! $site_key ) {
34
-            throw InvalidRecaptcha::from_site_key();
35
-        }
36
-        return $site_key;
37
-    }
31
+	 private function get_site_key() {
32
+		  $site_key = get_option( 'yikes-mc-recaptcha-secret-key' , '' );
33
+		  if ( ! $site_key ) {
34
+				throw InvalidRecaptcha::from_site_key();
35
+		  }
36
+		  return $site_key;
37
+	 }
38 38
 
39
-    private function get_secret_key() {
40
-        $secret_key = get_option( 'yikes-mc-recaptcha-secret-key' , '' );
41
-        if ( ! $secret_key ) {
42
-            throw InvalidRecaptcha::from_secret_key();
43
-        }
44
-        return $secret_key;
45
-    }
39
+	 private function get_secret_key() {
40
+		  $secret_key = get_option( 'yikes-mc-recaptcha-secret-key' , '' );
41
+		  if ( ! $secret_key ) {
42
+				throw InvalidRecaptcha::from_secret_key();
43
+		  }
44
+		  return $secret_key;
45
+	 }
46 46
 
47
-    private function get_options( $defaults ) {
48
-        // Store the site language (to load recaptcha in a specific language).
49
-        $locale       = get_locale();
50
-        $locale_split = explode( '_', $locale );
47
+	 private function get_options( $defaults ) {
48
+		  // Store the site language (to load recaptcha in a specific language).
49
+		  $locale       = get_locale();
50
+		  $locale_split = explode( '_', $locale );
51 51
 
52
-        // Setup reCAPTCHA parameters.
53
-        $lang       = ! empty( $locale_split ) ? $locale_split[0] : $locale;
54
-        $lang       = ! empty( $defaults['recaptcha_lang'] ) ? $defaults['recaptcha_lang'] : $lang;
55
-        $type       = ! empty( $defaults['recaptcha_type'] ) ? strtolower( $defaults['recaptcha_type'] ) : 'image'; // setup recaptcha type
56
-        $theme      = ! empty( $defaults['recaptcha_theme'] ) ? strtolower( $defaults['recaptcha_theme'] ) : 'light'; // setup recaptcha theme
57
-        $size       = ! empty( $defaults['recaptcha_size'] ) ? strtolower( $defaults['recaptcha_size'] ) : 'normal'; // setup recaptcha size
58
-        $data_cb    = ! empty( $defaults['recaptcha_data_callback'] ) ? $defaults['recaptcha_data_callback'] : false; // setup recaptcha size
59
-        $expired_cb = ! empty( $defaults['recaptcha_expired_callback'] ) ? $defaults['recaptcha_expired_callback'] : false; // setup recaptcha size
52
+		  // Setup reCAPTCHA parameters.
53
+		  $lang       = ! empty( $locale_split ) ? $locale_split[0] : $locale;
54
+		  $lang       = ! empty( $defaults['recaptcha_lang'] ) ? $defaults['recaptcha_lang'] : $lang;
55
+		  $type       = ! empty( $defaults['recaptcha_type'] ) ? strtolower( $defaults['recaptcha_type'] ) : 'image'; // setup recaptcha type
56
+		  $theme      = ! empty( $defaults['recaptcha_theme'] ) ? strtolower( $defaults['recaptcha_theme'] ) : 'light'; // setup recaptcha theme
57
+		  $size       = ! empty( $defaults['recaptcha_size'] ) ? strtolower( $defaults['recaptcha_size'] ) : 'normal'; // setup recaptcha size
58
+		  $data_cb    = ! empty( $defaults['recaptcha_data_callback'] ) ? $defaults['recaptcha_data_callback'] : false; // setup recaptcha size
59
+		  $expired_cb = ! empty( $defaults['recaptcha_expired_callback'] ) ? $defaults['recaptcha_expired_callback'] : false; // setup recaptcha size
60 60
 
61
-        $script_params = '?hl=' . $lang . '&onload=renderReCaptchaCallback&render=explicit';
61
+		  $script_params = '?hl=' . $lang . '&onload=renderReCaptchaCallback&render=explicit';
62 62
 
63
-        return [
64
-            'language'         => $lang,
65
-            'theme'            => $theme,
66
-            'type'             => $type,
67
-            'size'             => $size,
68
-            'success_callback' => $data_cb,
69
-            'expired_callback' => $expired_cb,
70
-            'script_params'    => $script_params,
71
-            'site_key'         => $this->get_site_key(),
72
-            'secret_key'       => $this->get_secret_key(),
73
-        ];
74
-    }
63
+		  return [
64
+				'language'         => $lang,
65
+				'theme'            => $theme,
66
+				'type'             => $type,
67
+				'size'             => $size,
68
+				'success_callback' => $data_cb,
69
+				'expired_callback' => $expired_cb,
70
+				'script_params'    => $script_params,
71
+				'site_key'         => $this->get_site_key(),
72
+				'secret_key'       => $this->get_secret_key(),
73
+		  ];
74
+	 }
75 75
 }
76 76
\ No newline at end of file
Please login to merge, or discard this patch.