load.php ➔ wpbo_provider_register_aweber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 6
rs 9.4285
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 View Code Duplication
if ( 'aweber' === wpbo_get_option( 'mailing_provider', '' ) ) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
19
	if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
20
21
		// Load provider files
22
		if ( is_admin() ) {
23
			require( WPBO_PATH . 'includes/providers/aweber/settings.php' );
24
			require( WPBO_PATH . 'includes/providers/aweber/functions-metabox.php' );
25
			require( WPBO_PATH . 'includes/providers/aweber/functions-admin.php' );
26
		}
27
28
		require( WPBO_PATH . 'includes/providers/aweber/functions-aweber.php' );
29
		require( WPBO_PATH . 'includes/providers/aweber/class-aweber.php' );
30
		require( WPBO_PATH . 'includes/providers/aweber/class-provider-aweber.php' );
31
32
	}
33
34
}
35
36
add_filter( 'wpbo_mailing_providers', 'wpbo_provider_register_aweber' );
37
/**
38
 * Register the WordPress provider
39
 *
40
 * @since 2.0
41
 *
42
 * @param array $providers Existing providers
43
 *
44
 * @return array
45
 */
46
function wpbo_provider_register_aweber( $providers ) {
47
48
	$providers['aweber'] = 'Aweber';
49
50
	return $providers;
51
}