WPBO_Provider_MailChimp   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A submit() 0 16 2
1
<?php
2
/**
3
 * BetterOptin Provider MailChimp
4
 *
5
 * @package   BetterOptin/Provider/MailChimp
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_MailChimp {
18
19
	/**
20
	 * Trigger form submission.
21
	 *
22
	 * @since  1.0.0
23
	 *
24
	 * @param array $data Sanitized form data
25
	 *
26
	 * @return null
27
	 */
28
	public static function submit( $data ) {
29
30
		$result = false;
31
32
		/* Subscribe the new user */
33
		$user = WPBO_MC()->submit( $data );
34
35
		/* Insertion is successful */
36
		if ( ! is_wp_error( $user ) ) {
37
			$result = true;
38
39
		}
40
41
		return $result;
42
43
	}
44
45
}