WPBO_Provider_Aweber   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A submit() 0 11 2
1
<?php
2
/**
3
 * BetterOptin Provider AWeber
4
 *
5
 * @package   BetterOptin/Provider/AWeber
6
 * @author    ThemeAvenue <[email protected]>
7
 * @license   GPL-2.0+
8
 * @link      http://themeavenue.net
9
 * @copyright 2015 ThemeAvenue
10
 */
11
12
// If this file is called directly, abort.
13
if ( ! defined( 'WPINC' ) ) {
14
	die;
15
}
16
17
class WPBO_Provider_Aweber {
18
19
	/**
20
	 * Trigger form submission.
21
	 *
22
	 * Add a last couple of checks, set the redirects and
23
	 * finally subscribe the visitor to the Aweber list.
24
	 *
25
	 * @since  1.0.0
26
	 *
27
	 * @param array $data Form post data
28
	 *
29
	 * @return bool
30
	 */
31
	public static function submit( $data ) {
32
33
		if ( ! wpbo_is_aweber_ready() ) {
34
			return false;
35
		}
36
37
		$aweber = new WPBO_Aweber();
38
39
		return $aweber->subscribe( $data );
40
41
	}
42
43
}