@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return void |
44 | 44 | */ |
45 | 45 | if ( ! defined( 'YIKES_MC_PATH' ) ) { |
46 | - define( 'YIKES_MC_PATH' , plugin_dir_path( __FILE__ ) ); |
|
46 | + define( 'YIKES_MC_PATH', plugin_dir_path( __FILE__ ) ); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @return void |
54 | 54 | */ |
55 | 55 | if ( ! defined( 'YIKES_MC_URL' ) ) { |
56 | - define( 'YIKES_MC_URL' , plugin_dir_url( __FILE__ ) ); |
|
56 | + define( 'YIKES_MC_URL', plugin_dir_url( __FILE__ ) ); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | - * Create the function to output our list stats dashboard widget |
|
58 | - */ |
|
57 | + * Create the function to output our list stats dashboard widget |
|
58 | + */ |
|
59 | 59 | function list_stats_dashboard_widget() { |
60 | 60 | // Get our list data! |
61 | 61 | // Check for a transient, if not - set one up for one hour |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
118 | - * Create the function to output our account activity dashboard widget |
|
119 | - */ |
|
118 | + * Create the function to output our account activity dashboard widget |
|
119 | + */ |
|
120 | 120 | function account_activity_dashboard_widget() { |
121 | 121 | // Get our list data! |
122 | 122 | // Check for a transient, if not - set one up for one hour |
@@ -7,23 +7,23 @@ discard block |
||
7 | 7 | |
8 | 8 | // Construction |
9 | 9 | public function __construct() { |
10 | - if( yikes_get_mc_api_key() != '' && get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'valid_api_key' ) { |
|
10 | + if ( yikes_get_mc_api_key() != '' && get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'valid_api_key' ) { |
|
11 | 11 | // hook in and display our list stats dashboard widget |
12 | - add_action( 'wp_dashboard_setup', array( $this , 'yks_mc_add_chimp_chatter_dashboard_widget' ) , 10 ); |
|
12 | + add_action( 'wp_dashboard_setup', array( $this, 'yks_mc_add_chimp_chatter_dashboard_widget' ), 10 ); |
|
13 | 13 | } |
14 | - add_action( 'admin_enqueue_scripts' , array( $this, 'enqueue_dashboard_widget_script' ) ); |
|
14 | + add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_dashboard_widget_script' ) ); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | // enqueue our JS file on the main dashboard page |
18 | 18 | function enqueue_dashboard_widget_script( $hook ) { |
19 | - if( 'index.php' == $hook ) { // default 'dashboard' page |
|
20 | - wp_register_script( 'yikes-easy-mc-dashboard-widget-script' , YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js' , array( 'jquery' ) , 'all' , false ); |
|
19 | + if ( 'index.php' == $hook ) { // default 'dashboard' page |
|
20 | + wp_register_script( 'yikes-easy-mc-dashboard-widget-script', YIKES_MC_URL . 'admin/js/min/yikes-inc-easy-mailchimp-dashboard-widget.min.js', array( 'jquery' ), 'all', false ); |
|
21 | 21 | $data_array = array( |
22 | 22 | 'ajax_url' => esc_url_raw( admin_url( 'admin-ajax.php' ) ), |
23 | - 'preloader' => '<img src="' . esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) . '" title="' . __( 'Preloader' , 'yikes-inc-easy-mailchimp-extender' ) . '" alt="' . __( 'Preloader' , 'yikes-inc-easy-mailchimp-extender' ) . '" class="yikes-easy-mc-widget-preloader">' |
|
23 | + 'preloader' => '<img src="' . esc_url_raw( admin_url( 'images/wpspin_light.gif' ) ) . '" title="' . __( 'Preloader', 'yikes-inc-easy-mailchimp-extender' ) . '" alt="' . __( 'Preloader', 'yikes-inc-easy-mailchimp-extender' ) . '" class="yikes-easy-mc-widget-preloader">' |
|
24 | 24 | ); |
25 | 25 | // localize our data, to pass along to JS file |
26 | - wp_localize_script( 'yikes-easy-mc-dashboard-widget-script' , 'object' , $data_array ); |
|
26 | + wp_localize_script( 'yikes-easy-mc-dashboard-widget-script', 'object', $data_array ); |
|
27 | 27 | wp_enqueue_script( 'yikes-easy-mc-dashboard-widget-script' ); |
28 | 28 | } |
29 | 29 | } |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | if ( current_user_can( apply_filters( 'yikes-mailchimp-admin-widget-capability', apply_filters( 'yikes-mailchimp-user-role-access', 'manage_options' ) ) ) ) { |
42 | 42 | /* List Stats Dashboard Widget */ |
43 | 43 | wp_add_dashboard_widget( |
44 | - 'yikes_easy_mc_list_stats_widget', // Widget slug. |
|
45 | - __( 'MailChimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
46 | - array( $this , 'list_stats_dashboard_widget' ) // Display function. |
|
44 | + 'yikes_easy_mc_list_stats_widget', // Widget slug. |
|
45 | + __( 'MailChimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
46 | + array( $this, 'list_stats_dashboard_widget' ) // Display function. |
|
47 | 47 | ); |
48 | 48 | /* Chimp Chatter Dashboard Widget */ |
49 | 49 | wp_add_dashboard_widget( |
50 | - 'yikes_easy_mc_account_activity_widget', // Widget slug. |
|
51 | - __( 'MailChimp Account Activity', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
52 | - array( $this , 'account_activity_dashboard_widget' ) // Display function. |
|
50 | + 'yikes_easy_mc_account_activity_widget', // Widget slug. |
|
51 | + __( 'MailChimp Account Activity', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
52 | + array( $this, 'account_activity_dashboard_widget' ) // Display function. |
|
53 | 53 | ); |
54 | 54 | } |
55 | 55 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if ( false === ( $list_data = get_transient( 'yikes-easy-mailchimp-list-data' ) ) ) { |
64 | 64 | $api_key = yikes_get_mc_api_key(); |
65 | 65 | $dash_position = strpos( $api_key, '-' ); |
66 | - if( $dash_position !== false ) { |
|
66 | + if ( $dash_position !== false ) { |
|
67 | 67 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json'; |
68 | 68 | } |
69 | 69 | $list_data = wp_remote_post( $api_endpoint, array( |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
76 | 76 | ) ); |
77 | 77 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
78 | - if( isset( $list_data['error'] ) ) { |
|
79 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
78 | + if ( isset( $list_data[ 'error' ] ) ) { |
|
79 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
80 | 80 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
81 | 81 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
82 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" ); |
|
82 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" ); |
|
83 | 83 | } |
84 | 84 | } else { |
85 | 85 | // set our transient |
@@ -88,29 +88,29 @@ discard block |
||
88 | 88 | } |
89 | 89 | ?> |
90 | 90 | <!-- Dropdown to Change the list --> |
91 | - <?php if( ! empty( $list_data['data'] ) ) { |
|
91 | + <?php if ( ! empty( $list_data[ 'data' ] ) ) { |
|
92 | 92 | ?><section class="inside-widget yikes-dashboard-widget-section"> |
93 | - <strong class="select-list-title"><?php _e( 'Select a list' , 'yikes-inc-easy-mailchimp-extender' ) ?>:</strong> |
|
93 | + <strong class="select-list-title"><?php _e( 'Select a list', 'yikes-inc-easy-mailchimp-extender' ) ?>:</strong> |
|
94 | 94 | <select id="yikes-easy-mc-dashboard-change-list" class="widefat"> |
95 | 95 | <?php |
96 | - foreach( $list_data['data'] as $list ) { |
|
97 | - ?><option val="<?php echo $list['id']; ?>"><?php echo $list['name']; ?></option><?php |
|
96 | + foreach ( $list_data[ 'data' ] as $list ) { |
|
97 | + ?><option val="<?php echo $list[ 'id' ]; ?>"><?php echo $list[ 'name' ]; ?></option><?php |
|
98 | 98 | } |
99 | 99 | ?> |
100 | 100 | </select> |
101 | - <p class="description"><?php _e( 'Select a list from the dropdown above. View statistics related to this list below.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
101 | + <p class="description"><?php _e( 'Select a list from the dropdown above. View statistics related to this list below.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
102 | 102 | </section> |
103 | 103 | <!-- display stats here! --> |
104 | 104 | <section id="yikes-easy-mc-dashboard-widget-stats"> |
105 | 105 | <?php |
106 | - if( !empty( $list_data['data'] ) ) { |
|
106 | + if ( ! empty( $list_data[ 'data' ] ) ) { |
|
107 | 107 | include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' ); |
108 | 108 | } |
109 | 109 | ?> |
110 | 110 | </section> |
111 | 111 | <?php } else { ?> |
112 | 112 | <section id="yikes-easy-mc-dashboard-widget-stats"> |
113 | - <p class="no-lists-error"><?php _e( "Whoops, you don't have any lists set up. Head over to MailChimp to set up lists." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
113 | + <p class="no-lists-error"><?php _e( "Whoops, you don't have any lists set up. Head over to MailChimp to set up lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
114 | 114 | </section> |
115 | 115 | <?php } |
116 | 116 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | if ( false === ( $account_activity = get_transient( 'yikes-easy-mailchimp-account-activity' ) ) ) { |
125 | 125 | $api_key = yikes_get_mc_api_key(); |
126 | 126 | $dash_position = strpos( $api_key, '-' ); |
127 | - if( $dash_position !== false ) { |
|
127 | + if ( $dash_position !== false ) { |
|
128 | 128 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/helper/chimp-chatter.json'; |
129 | 129 | } |
130 | 130 | $account_activity = wp_remote_post( $api_endpoint, array( |
@@ -135,18 +135,18 @@ discard block |
||
135 | 135 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
136 | 136 | ) ); |
137 | 137 | $account_activity = json_decode( wp_remote_retrieve_body( $account_activity ), true ); |
138 | - if( isset( $account_activity['error'] ) ) { |
|
139 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
138 | + if ( isset( $account_activity[ 'error' ] ) ) { |
|
139 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
140 | 140 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
141 | 141 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
142 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $account_activity['error'], __( "Get Account Activity" , 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" ); |
|
142 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $account_activity[ 'error' ], __( "Get Account Activity", 'yikes-inc-easy-mailchimp-extender' ), "Dashboard Activity Widget" ); |
|
143 | 143 | } |
144 | 144 | } else { |
145 | 145 | // set our transient for one hour |
146 | 146 | set_transient( 'yikes-easy-mailchimp-account-activity', $account_activity, 1 * HOUR_IN_SECONDS ); |
147 | 147 | } |
148 | 148 | } |
149 | - if( ! empty( $account_activity ) ) { |
|
149 | + if ( ! empty( $account_activity ) ) { |
|
150 | 150 | include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/account-activity-template.php' ); |
151 | 151 | } |
152 | 152 | } |
@@ -2,36 +2,36 @@ |
||
2 | 2 | /* The template file for displaying our stats in the Admin dashboard widget */ |
3 | 3 | ?> |
4 | 4 | <section id="yikes-easy-mc-widget-stat-holder"> |
5 | - <h3><?php echo $list_data['data'][0]['name']; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_data['data'][0]['id'] . '' ) ); ?>" title="<?php _e( 'view List' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'view list' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></h3> |
|
5 | + <h3><?php echo $list_data[ 'data' ][ 0 ][ 'name' ]; ?> <small><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $list_data[ 'data' ][ 0 ][ 'id' ] . '' ) ); ?>" title="<?php _e( 'view List', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'view list', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></h3> |
|
6 | 6 | |
7 | 7 | <table class="yikes-easy-mc-stats-table"> |
8 | 8 | <thead class="yikes-easy-mc-hidden"> |
9 | 9 | <tr> |
10 | - <th><?php _e( 'Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
11 | - <th><?php _e( 'Unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
12 | - <th><?php _e( 'New Since Send' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
13 | - <th><?php _e( 'Avg. Sub. Rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
10 | + <th><?php _e( 'Subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
11 | + <th><?php _e( 'Unsubscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
12 | + <th><?php _e( 'New Since Send', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
13 | + <th><?php _e( 'Avg. Sub. Rate', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
14 | 14 | </tr> |
15 | 15 | </thead> |
16 | 16 | <tbody> |
17 | 17 | <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-first"> |
18 | - <td title="<?php _e( 'Number of active subscribers.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
19 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['member_count']; ?></p> |
|
20 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
18 | + <td title="<?php _e( 'Number of active subscribers.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
19 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data[ 'data' ][ 0 ][ 'stats' ][ 'member_count' ]; ?></p> |
|
20 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
21 | 21 | </td> |
22 | - <td title="<?php _e( 'Number of users who have unsusbscribed.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
23 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['unsubscribe_count']; ?></p> |
|
24 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
22 | + <td title="<?php _e( 'Number of users who have unsusbscribed.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
23 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data[ 'data' ][ 0 ][ 'stats' ][ 'unsubscribe_count' ]; ?></p> |
|
24 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'unsubscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
25 | 25 | </td> |
26 | 26 | </tr> |
27 | 27 | <tr class="yikes-easy-mc-table-stats-tr yikes-easy-mc-table-stats-tr-second"> |
28 | - <td title="<?php _e( 'Number of new subscribers since the last campaign was sent.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
29 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['member_count_since_send']; ?></p> |
|
30 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'new since send' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
28 | + <td title="<?php _e( 'Number of new subscribers since the last campaign was sent.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
29 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data[ 'data' ][ 0 ][ 'stats' ][ 'member_count_since_send' ]; ?></p> |
|
30 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'new since send', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
31 | 31 | </td> |
32 | - <td title="<?php _e( 'Average number of subscribers per month.' , 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
33 | - <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data['data'][0]['stats']['avg_sub_rate']; ?></p> |
|
34 | - <p class="yikes-easy-mc-stat-list-label"><?php _e( 'avg. sub. rate' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
32 | + <td title="<?php _e( 'Average number of subscribers per month.', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
33 | + <p class="yikes-easy-mc-dashboard-stat"><?php echo $list_data[ 'data' ][ 0 ][ 'stats' ][ 'avg_sub_rate' ]; ?></p> |
|
34 | + <p class="yikes-easy-mc-stat-list-label"><?php _e( 'avg. sub. rate', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
35 | 35 | </td> |
36 | 36 | </tr> |
37 | 37 | </tbody> |
@@ -8,23 +8,23 @@ |
||
8 | 8 | </tr> |
9 | 9 | <?php |
10 | 10 | $i = 1; |
11 | - foreach( $account_activity as $activity ) { |
|
12 | - if( $i <= 8 ) { |
|
13 | - $message = $activity['message']; |
|
14 | - $split_message = explode( ' - ' , $activity['message'] ); |
|
15 | - $split_list = explode( '"' , $split_message[0] ); |
|
16 | - if( isset( $split_list[1] ) ) { |
|
17 | - if( isset( $activity['list_id'] ) ) { |
|
18 | - $message = $split_list[0] . ' <a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $activity['list_id'] ) ) . '"><strong>' . $split_list[1] . '</strong></a>'; |
|
11 | + foreach ( $account_activity as $activity ) { |
|
12 | + if ( $i <= 8 ) { |
|
13 | + $message = $activity[ 'message' ]; |
|
14 | + $split_message = explode( ' - ', $activity[ 'message' ] ); |
|
15 | + $split_list = explode( '"', $split_message[ 0 ] ); |
|
16 | + if ( isset( $split_list[ 1 ] ) ) { |
|
17 | + if ( isset( $activity[ 'list_id' ] ) ) { |
|
18 | + $message = $split_list[ 0 ] . ' <a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $activity[ 'list_id' ] ) ) . '"><strong>' . $split_list[ 1 ] . '</strong></a>'; |
|
19 | 19 | } else { |
20 | - $message = $split_list[0] . ' <strong>' . $split_list[1] . '</strong>'; |
|
20 | + $message = $split_list[ 0 ] . ' <strong>' . $split_list[ 1 ] . '</strong>'; |
|
21 | 21 | } |
22 | 22 | } else { |
23 | - $message = $split_list[0]; |
|
23 | + $message = $split_list[ 0 ]; |
|
24 | 24 | } |
25 | 25 | ?> |
26 | 26 | <tr valign="top"> |
27 | - <td><label for="tablecell"><?php echo ucwords( str_replace( '-' , ' ' , str_replace( 'lists:' , '' , $activity['type'] ) ) ); ?></label></td> |
|
27 | + <td><label for="tablecell"><?php echo ucwords( str_replace( '-', ' ', str_replace( 'lists:', '', $activity[ 'type' ] ) ) ); ?></label></td> |
|
28 | 28 | <td><?php echo $message; ?></td> |
29 | 29 | </tr> |
30 | 30 | <?php |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | <div class="feature-section"> |
4 | 4 | |
5 | - <h2><?php _e( 'All New Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
5 | + <h2><?php _e( 'All New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
6 | 6 | |
7 | 7 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/form-layout-option.jpg'; ?>" alt="<?php _e( 'New Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
8 | 8 | |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | |
27 | 27 | <div class="feature-section"> |
28 | 28 | |
29 | - <h2><?php _e( 'Translated & Localized' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
29 | + <h2><?php _e( 'Translated & Localized', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
30 | 30 | |
31 | - <p style="float:left;width:55%;max-width:55%;"><?php _e( "YIKES Easy Forms for MailChimp was developed with our international users in mind. Not only will you find the plugin to be i18n ready, but you'll also find our datepickers to be localized for mm/dd/yyyy or dd/mm/yyyy formats. Everything is automatic and gets localized based on the language of your site. It's like magic!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
31 | + <p style="float:left;width:55%;max-width:55%;"><?php _e( "YIKES Easy Forms for MailChimp was developed with our international users in mind. Not only will you find the plugin to be i18n ready, but you'll also find our datepickers to be localized for mm/dd/yyyy or dd/mm/yyyy formats. Everything is automatic and gets localized based on the language of your site. It's like magic!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
32 | 32 | |
33 | 33 | <img style="width:40%;max-width:400px;display:block;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/arabic-calendar.png'; ?>" alt="<?php _e( 'Localized Arabic Calendar', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
34 | 34 | |
@@ -38,19 +38,19 @@ discard block |
||
38 | 38 | |
39 | 39 | <div class="feature-section"> |
40 | 40 | |
41 | - <h2><?php _e( 'Knowledge Base & GlotPress Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
41 | + <h2><?php _e( 'Knowledge Base & GlotPress Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
42 | 42 | |
43 | 43 | <img style="float:left;max-width:300px;margin-right:20px;margin-left:0 !important;" src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/glotpress-translation-percentage.png'; ?>" alt="<?php _e( 'GlotPress Localized Precentage', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
44 | 44 | |
45 | - <p><?php _e( "Since the initial release of this Easy Forms for MailChimp by YIKES we've been tirelessly working on putting together a collection of help articles ranging from troubleshooting tips to customization options. We've also included a collection of code snippets from some of our most widely asked questions. Now you can access some of our most popular articles right from within the plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
45 | + <p><?php _e( "Since the initial release of this Easy Forms for MailChimp by YIKES we've been tirelessly working on putting together a collection of help articles ranging from troubleshooting tips to customization options. We've also included a collection of code snippets from some of our most widely asked questions. Now you can access some of our most popular articles right from within the plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
46 | 46 | |
47 | - <p><h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#knowledge-base-articles' ) ); ?>" title="<?php _e( 'Support | Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Support → Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
47 | + <p><h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-support#knowledge-base-articles' ) ); ?>" title="<?php _e( 'Support | Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Support → Knowledge Base Articles', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
48 | 48 | |
49 | 49 | <p> </p> |
50 | 50 | |
51 | 51 | <p><?php _e( "With a ton of help from the WordPress community, we've been able to support 7 international languages. We're always looking for additional translators, so if you are multi-lingual and can help translate things - hop into glotpress and help contribute to future development of this plugin.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
52 | 52 | |
53 | - <p><h4><a href="<?php echo esc_url_raw( 'https://translate.wordpress.org/projects/wp-plugins/yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"title="<?php _e( 'Easy Forms for MailChimp | GlotPress' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
53 | + <p><h4><a href="<?php echo esc_url_raw( 'https://translate.wordpress.org/projects/wp-plugins/yikes-inc-easy-mailchimp-extender' ); ?>" target="_blank"title="<?php _e( 'Easy Forms for MailChimp | GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GlotPress', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4></p> |
|
54 | 54 | |
55 | 55 | |
56 | 56 | </div> |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | |
60 | 60 | <div class="feature-section"> |
61 | 61 | |
62 | - <h2><?php _e( 'Intuitive Settings Page' , 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
62 | + <h2><?php _e( 'Intuitive Settings Page', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
|
63 | 63 | |
64 | 64 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/settings-page.png'; ?>" alt="<?php _e( 'Settings Page', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-whats-new-section-image"> |
65 | 65 | |
66 | - <p style="float:left; padding-left:15px;margin-top:5px;"><?php _e( "We've re-laid out the settings page to allow for a more intuitive workflow. All of your settings are neatly tucked away in their respective setting tab.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
66 | + <p style="float:left; padding-left:15px;margin-top:5px;"><?php _e( "We've re-laid out the settings page to allow for a more intuitive workflow. All of your settings are neatly tucked away in their respective setting tab.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
67 | 67 | |
68 | 68 | </div> |
69 | 69 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | if ( false === ( $contributors = get_transient( 'yikes-mailchimp-contributor-transient' ) ) ) { |
4 | 4 | // It wasn't there, so regenerate the data and save the transient |
5 | 5 | $contributors = wp_remote_get( 'https://api.github.com/repos/yikesinc/yikes-inc-easy-mailchimp-extender/contributors?per_page=100', array( 'timeout' => 120 ) ); |
6 | - $contributors = json_decode( $contributors['body'] , true ); |
|
7 | - set_transient( 'yikes-mailchimp-contributor-transient', $contributors, 60*60*12 ); |
|
6 | + $contributors = json_decode( $contributors[ 'body' ], true ); |
|
7 | + set_transient( 'yikes-mailchimp-contributor-transient', $contributors, 60 * 60 * 12 ); |
|
8 | 8 | } |
9 | 9 | // get the YIKES Inc. MailChimp translators via the Github API |
10 | 10 | if ( false === ( $translators = get_transient( 'yikes-mailchimp-translators-transient' ) ) ) { |
@@ -19,20 +19,20 @@ discard block |
||
19 | 19 | ); |
20 | 20 | // create an empty array to store with translator data to loop over |
21 | 21 | $translators = array(); |
22 | - foreach( $translator_usernames as $username => $language ) { |
|
22 | + foreach ( $translator_usernames as $username => $language ) { |
|
23 | 23 | $translator_data = wp_remote_get( 'https://api.github.com/users/' . $username, array( 'timeout' => 120 ) ); |
24 | 24 | // if( $translator_data['status'] == 200 ) { |
25 | - $translators_data_decoded = json_decode( $translator_data['body'] , true ); |
|
26 | - $translators[] = array( |
|
27 | - 'login' => $translators_data_decoded['login'], |
|
28 | - 'avatar_url' => $translators_data_decoded['avatar_url'], |
|
29 | - 'html_url' => $translators_data_decoded['html_url'], |
|
30 | - 'name' => $translators_data_decoded['name'], |
|
25 | + $translators_data_decoded = json_decode( $translator_data[ 'body' ], true ); |
|
26 | + $translators[ ] = array( |
|
27 | + 'login' => $translators_data_decoded[ 'login' ], |
|
28 | + 'avatar_url' => $translators_data_decoded[ 'avatar_url' ], |
|
29 | + 'html_url' => $translators_data_decoded[ 'html_url' ], |
|
30 | + 'name' => $translators_data_decoded[ 'name' ], |
|
31 | 31 | 'translation_language' => $language, |
32 | 32 | ); |
33 | 33 | // } |
34 | 34 | } |
35 | - set_transient( 'yikes-mailchimp-translators-transient', $translators, 60*60*12 ); |
|
35 | + set_transient( 'yikes-mailchimp-translators-transient', $translators, 60 * 60 * 12 ); |
|
36 | 36 | } |
37 | 37 | ?> |
38 | 38 | <div class="wrap about-wrap"> |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | <div id="credit-container"> |
47 | 47 | <h2><?php _e( 'Developers', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
48 | 48 | <?php |
49 | - if( ! empty( $contributors ) ) { |
|
50 | - $old_contributors = array( 'seriouslysean' , 'Apfelbiss', 'hiwhatsup', 'mialevesque' ); |
|
51 | - foreach( $contributors as $contributor ) { |
|
49 | + if ( ! empty( $contributors ) ) { |
|
50 | + $old_contributors = array( 'seriouslysean', 'Apfelbiss', 'hiwhatsup', 'mialevesque' ); |
|
51 | + foreach ( $contributors as $contributor ) { |
|
52 | 52 | // skip contributors from our old plugin (this is a new re-write) |
53 | - if( ! in_array( $contributor['login'] , $old_contributors ) ) { |
|
53 | + if ( ! in_array( $contributor[ 'login' ], $old_contributors ) ) { |
|
54 | 54 | ?> |
55 | - <a href="<?php echo esc_url_raw( $contributor['html_url'] ); ?>" title="<?php echo $contributor['login']; ?>" target="_blank" class="github-avatar-url"> |
|
55 | + <a href="<?php echo esc_url_raw( $contributor[ 'html_url' ] ); ?>" title="<?php echo $contributor[ 'login' ]; ?>" target="_blank" class="github-avatar-url"> |
|
56 | 56 | <div class="team-member"> |
57 | - <img src="<?php echo esc_url_raw( $contributor['avatar_url'] ); ?>" class="github-avatar-image"> |
|
57 | + <img src="<?php echo esc_url_raw( $contributor[ 'avatar_url' ] ); ?>" class="github-avatar-image"> |
|
58 | 58 | <p class="member-blurb"> |
59 | - <p><strong><?php echo $contributor['login']; ?></strong></p> |
|
59 | + <p><strong><?php echo $contributor[ 'login' ]; ?></strong></p> |
|
60 | 60 | </p> |
61 | 61 | </div> |
62 | 62 | </a> |
@@ -65,24 +65,24 @@ discard block |
||
65 | 65 | } |
66 | 66 | } else { |
67 | 67 | ?> |
68 | - <h4><?php _e( 'There was an error retrieving the contributors list. Please try again later.' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
68 | + <h4><?php _e( 'There was an error retrieving the contributors list. Please try again later.', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
69 | 69 | <?php |
70 | 70 | } |
71 | 71 | ?> |
72 | 72 | </div> |
73 | 73 | |
74 | - <?php if( ! empty( $translators ) ) { ?> |
|
74 | + <?php if ( ! empty( $translators ) ) { ?> |
|
75 | 75 | <div id="translators-container"> |
76 | 76 | <h2><?php _e( 'Translators', 'yikes-inc-easy-mailchimp-extender' ); ?></h2> |
77 | 77 | <?php |
78 | - foreach( $translators as $translator ) { |
|
78 | + foreach ( $translators as $translator ) { |
|
79 | 79 | ?> |
80 | - <a href="<?php echo esc_url_raw( $translator['html_url'] ); ?>" title="<?php echo $translator['name']; ?>" target="_blank" class="github-avatar-url"> |
|
80 | + <a href="<?php echo esc_url_raw( $translator[ 'html_url' ] ); ?>" title="<?php echo $translator[ 'name' ]; ?>" target="_blank" class="github-avatar-url"> |
|
81 | 81 | <div class="translator"> |
82 | - <img src="<?php echo esc_url_raw( $translator['avatar_url'] ); ?>" class="github-avatar-image"> |
|
82 | + <img src="<?php echo esc_url_raw( $translator[ 'avatar_url' ] ); ?>" class="github-avatar-image"> |
|
83 | 83 | <p class="member-blurb"> |
84 | - <p><strong><?php echo $translator['login']; ?></strong></p> |
|
85 | - <em class="translation-language"><?php echo $translator['translation_language']; ?></em> |
|
84 | + <p><strong><?php echo $translator[ 'login' ]; ?></strong></p> |
|
85 | + <em class="translation-language"><?php echo $translator[ 'translation_language' ]; ?></em> |
|
86 | 86 | </p> |
87 | 87 | </div> |
88 | 88 | </a> |
@@ -1,24 +1,24 @@ discard block |
||
1 | -<?php if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { ?> |
|
1 | +<?php if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) { ?> |
|
2 | 2 | <div class="about-description"> |
3 | - <?php printf( __( "Before you can create any opt-in forms, you'll first need to enter your MailChimp API key into the <a href='%s' title='Yikes Easy MailChimp Settings'>settings page</a>" , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) ); ?> |
|
3 | + <?php printf( __( "Before you can create any opt-in forms, you'll first need to enter your MailChimp API key into the <a href='%s' title='Yikes Easy MailChimp Settings'>settings page</a>", 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) ); ?> |
|
4 | 4 | </div> |
5 | 5 | <?php } ?> |
6 | 6 | |
7 | 7 | <div class="changelog"> |
8 | 8 | |
9 | - <h3><?php _e( 'Creating Your First Opt-In Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
9 | + <h3><?php _e( 'Creating Your First Opt-In Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
10 | 10 | |
11 | 11 | <div class="feature-section"> |
12 | 12 | |
13 | 13 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/create-first-optin-form.jpg'; ?>" alt="<?php _e( 'Create first optin form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image"> |
14 | 14 | |
15 | - <h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4> |
|
16 | - <p><?php _e( "Before you can start collecting users email addresses and building your mailing list, you'll need to create your first form. You can create as many forms as you'd like and assign each form to the same or different mailing lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
15 | + <h4><a href="<?php echo esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ); ?>" title="<?php _e( 'Manage Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>">Easy MailChimp → <?php _e( 'Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a></h4> |
|
16 | + <p><?php _e( "Before you can start collecting users email addresses and building your mailing list, you'll need to create your first form. You can create as many forms as you'd like and assign each form to the same or different mailing lists.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
17 | 17 | |
18 | 18 | <p> </p> |
19 | 19 | |
20 | - <h4><?php _e( 'Additional Options' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
21 | - <p><?php _e( "Once you create a form, you can choose which fields you want to add to it and customize the success and error messages returned by MailChimp.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
20 | + <h4><?php _e( 'Additional Options', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
21 | + <p><?php _e( "Once you create a form, you can choose which fields you want to add to it and customize the success and error messages returned by MailChimp.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
22 | 22 | |
23 | 23 | </div> |
24 | 24 | |
@@ -26,41 +26,41 @@ discard block |
||
26 | 26 | |
27 | 27 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/optin-settings.png'; ?>" alt="<?php _e( 'Optin settings screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image yikes-easy-mc-feature-image-left"> |
28 | 28 | |
29 | - <h4><?php _e( 'Customize the Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
30 | - <p><?php _e( "Once created, you can customize the form. This includes editing the success and error messages displayed to the user, choosing which fields or interest groups are displayed, adding CSS classes to fields, assigning default values amp; placeholders and tons more!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
29 | + <h4><?php _e( 'Customize the Form', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
30 | + <p><?php _e( "Once created, you can customize the form. This includes editing the success and error messages displayed to the user, choosing which fields or interest groups are displayed, adding CSS classes to fields, assigning default values amp; placeholders and tons more!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
31 | 31 | |
32 | 32 | <p> </p> |
33 | 33 | |
34 | - <p><?php _e( "Quickly and easily switch which list the form is associated with, toggle single or double optin, whether the welcome email should be sent, toggle AJAX form submissions and more. Get customizing!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
34 | + <p><?php _e( "Quickly and easily switch which list the form is associated with, toggle single or double optin, whether the welcome email should be sent, toggle AJAX form submissions and more. Get customizing!", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
35 | 35 | </div> |
36 | 36 | <div class="feature-section"> |
37 | 37 | |
38 | 38 | <img src="<?php echo YIKES_MC_URL . 'includes/images/Welcome_Page/add-field-to-page.png'; ?>" alt="<?php _e( 'Add field to form screenshot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-easy-mc-feature-image"> |
39 | 39 | |
40 | - <h4><?php _e( 'Add Form to Page/Post' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
41 | - <p><?php _e( "When you're ready to add your MailChimp opt-in form to a page or post, you can click on the small MailChimp button in the content editor toolbar.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
40 | + <h4><?php _e( 'Add Form to Page/Post', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
41 | + <p><?php _e( "When you're ready to add your MailChimp opt-in form to a page or post, you can click on the small MailChimp button in the content editor toolbar.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
42 | 42 | |
43 | 43 | <p> </p> |
44 | 44 | |
45 | - <h4><?php _e( 'Add Form to Widget' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
46 | - <p><?php _e( "We've created a MailChimp widget to easily add forms to any sidebar or widgetized area on your site. The widget allows you to select from any created forms.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
45 | + <h4><?php _e( 'Add Form to Widget', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
46 | + <p><?php _e( "We've created a MailChimp widget to easily add forms to any sidebar or widgetized area on your site. The widget allows you to select from any created forms.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
47 | 47 | </div> |
48 | 48 | |
49 | 49 | <div class="feature-section"> |
50 | - <h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?" , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
50 | + <h3><span class="dashicons dashicons-format-status need-support-icon"></span> <?php _e( "Need Support?", 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
51 | 51 | |
52 | - <h4><?php _e( 'Free Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
53 | - <p><?php _e( "If you need help using the free version of the plugin, you can post support inquiries to one of two locations.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
52 | + <h4><?php _e( 'Free Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
53 | + <p><?php _e( "If you need help using the free version of the plugin, you can post support inquiries to one of two locations.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
54 | 54 | <ul class="support-option-list"> |
55 | - <li class="support-option support-option-first"><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" title="<?php esc_attr_e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'WordPress Plugin Directory' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
56 | - <li class="support-option support-option-second"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" title="<?php esc_attr_e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GitHub Issue Tracker' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
55 | + <li class="support-option support-option-first"><a href="https://wordpress.org/plugins/yikes-inc-easy-mailchimp-extender/" title="<?php esc_attr_e( 'WordPress Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'WordPress Plugin Directory', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
56 | + <li class="support-option support-option-second"><a href="https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/issues" target="_blank" title="<?php esc_attr_e( 'GitHub Issue Tracker', 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'GitHub Issue Tracker', 'yikes-inc-easy-mailchimp-extender' ); ?></a></li> |
|
57 | 57 | </ul> |
58 | 58 | |
59 | - <h4><?php _e( 'Priority Support' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
60 | - <p><?php _e( "If you want immediate support, please consider purchasing an add-on or developer License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy the tons of features packed into our add-ons that are not available in the free version." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
59 | + <h4><?php _e( 'Priority Support', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
60 | + <p><?php _e( "If you want immediate support, please consider purchasing an add-on or developer License. Not only will you get 1 full year of automatic updates and priority support, you will enjoy the tons of features packed into our add-ons that are not available in the free version.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
61 | 61 | |
62 | - <h4><?php _e( 'Knowledge Base' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
63 | - <p><?php printf( __( 'For plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">knowledge base</a>.' , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?> |
|
62 | + <h4><?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
63 | + <p><?php printf( __( 'For plugin documentation, visit our <a href="%s" title="Knowledge Base" target="_blank">knowledge base</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( 'https://yikesplugins.com/support/knowledge-base/product/easy-forms-for-mailchimp/' ) ); ?> |
|
64 | 64 | |
65 | 65 | </div> |
66 | 66 |
@@ -7,22 +7,22 @@ discard block |
||
7 | 7 | * @return void |
8 | 8 | */ |
9 | 9 | function yikes_easy_mc_welcome_tabs() { |
10 | - $section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started'; |
|
10 | + $section = isset( $_GET[ 'section' ] ) ? $_GET[ 'section' ] : 'getting-started'; |
|
11 | 11 | ?> |
12 | 12 | <h2 class="nav-tab-wrapper welcome-page-tabs"> |
13 | - <a class="nav-tab <?php echo $section == 'getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'getting-started' ), 'admin.php' ) ) ); ?>"> |
|
13 | + <a class="nav-tab <?php echo $section == 'getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'getting-started' ), 'admin.php' ) ) ); ?>"> |
|
14 | 14 | <span class="dashicons dashicons-admin-home"></span> <?php _e( 'Getting Started', 'yikes-inc-easy-mailchimp-extender' ); ?> |
15 | 15 | </a> |
16 | - <a class="nav-tab <?php echo $section == 'whats-new' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'whats-new' ), 'admin.php' ) ) ); ?>"> |
|
16 | + <a class="nav-tab <?php echo $section == 'whats-new' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'whats-new' ), 'admin.php' ) ) ); ?>"> |
|
17 | 17 | <span class="dashicons dashicons-warning"></span> <?php _e( "What's New", 'yikes-inc-easy-mailchimp-extender' ); ?> |
18 | 18 | </a> |
19 | - <a class="nav-tab <?php echo $section == 'add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'add-ons' ), 'admin.php' ) ) ); ?>"> |
|
19 | + <a class="nav-tab <?php echo $section == 'add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'add-ons' ), 'admin.php' ) ) ); ?>"> |
|
20 | 20 | <span class="dashicons dashicons-admin-plugins"></span> <?php _e( "Add-Ons", 'yikes-inc-easy-mailchimp-extender' ); ?> |
21 | 21 | </a> |
22 | - <a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>"> |
|
22 | + <a class="nav-tab <?php echo $section == 'knowledge-base' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'knowledge-base' ), 'admin.php' ) ) ); ?>"> |
|
23 | 23 | <span class="dashicons dashicons-welcome-learn-more"></span> <?php _e( 'Knowledge Base', 'yikes-inc-easy-mailchimp-extender' ); ?> |
24 | 24 | </a> |
25 | - <a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome' , 'section' => 'credits' ), 'admin.php' ) ) ); ?>"> |
|
25 | + <a class="nav-tab <?php echo $section == 'credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url_raw( admin_url( add_query_arg( array( 'page' => 'yikes-mailchimp-welcome', 'section' => 'credits' ), 'admin.php' ) ) ); ?>"> |
|
26 | 26 | <span class="dashicons dashicons-arrow-left-alt2"></span><?php _e( 'Credits', 'yikes-inc-easy-mailchimp-extender' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span> |
27 | 27 | </a> |
28 | 28 | </h2> |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | function yikes_easy_mc_welcome_body() { |
33 | - $section = isset( $_GET['section'] ) ? $_GET['section'] : 'getting-started'; |
|
34 | - if( isset( $section ) ) { |
|
33 | + $section = isset( $_GET[ 'section' ] ) ? $_GET[ 'section' ] : 'getting-started'; |
|
34 | + if ( isset( $section ) ) { |
|
35 | 35 | include_once( plugin_dir_path( dirname( __FILE__ ) ) . '/welcome-page/welcome-sections/' . $section . '-section.php' ); |
36 | 36 | } |
37 | 37 | } |
@@ -44,17 +44,17 @@ discard block |
||
44 | 44 | <div id="yikes-mailchimp-logo"></div> |
45 | 45 | |
46 | 46 | <h2 class="welcome-title"> |
47 | - Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
47 | + Easy Forms for MailChimp by YIKES | <?php echo __( 'MailChimp Done Right', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
48 | 48 | </h2> |
49 | 49 | |
50 | 50 | <p class="about-text"> |
51 | 51 | <?php |
52 | 52 | // check if this is a fresh install |
53 | - if( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
|
54 | - echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); |
|
53 | + if ( get_option( 'yikes_easy_mailchimp_activation_date', strtotime( 'now' ) ) == strtotime( 'now' ) ) { |
|
54 | + echo sprintf( __( 'Welcome to the most powerful MailChimp integration for WordPress. Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!', 'yikes-inc-easy-mailchimp-extender' ), $this->version ); |
|
55 | 55 | } else { |
56 | 56 | // else thank you for updating :) |
57 | - echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!' , 'yikes-inc-easy-mailchimp-extender' ) , $this->version ); |
|
57 | + echo sprintf( __( 'Thank you for updating to the latest version! Easy Forms for MailChimp by YIKES v%s is ready to help take your mailing lists to the next level!', 'yikes-inc-easy-mailchimp-extender' ), $this->version ); |
|
58 | 58 | } |
59 | 59 | ?> |
60 | 60 | </p> |
@@ -154,17 +154,17 @@ |
||
154 | 154 | public function findMCListIndex( $id, $array, $tag ) { |
155 | 155 | if( $tag == 'tag' ) { |
156 | 156 | foreach( $array as $key => $val ) { |
157 | - if ( $val['tag'] === $id ) { |
|
158 | - return $key; |
|
159 | - } |
|
160 | - } |
|
161 | - return null; |
|
157 | + if ( $val['tag'] === $id ) { |
|
158 | + return $key; |
|
159 | + } |
|
160 | + } |
|
161 | + return null; |
|
162 | 162 | } else { |
163 | 163 | foreach ( $array as $key => $val ) { |
164 | - if ( $val['id'] == $id ) { |
|
165 | - return $key; |
|
166 | - } |
|
167 | - } |
|
164 | + if ( $val['id'] == $id ) { |
|
165 | + return $key; |
|
166 | + } |
|
167 | + } |
|
168 | 168 | return null; |
169 | 169 | } |
170 | 170 | } // end |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | |
13 | 13 | public function __construct() { |
14 | 14 | // ajax send merge variable to form builder |
15 | - add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 ); |
|
15 | + add_action( 'wp_ajax_add_field_to_form', array( $this, 'send_field_to_form' ), 10 ); |
|
16 | 16 | // ajax send interest group to form builder |
17 | - add_action( 'wp_ajax_add_interest_group_to_form', array( $this , 'send_interest_group_to_form' ), 10 ); |
|
17 | + add_action( 'wp_ajax_add_interest_group_to_form', array( $this, 'send_interest_group_to_form' ), 10 ); |
|
18 | 18 | // return new list data + activity (for dashboard widget ) |
19 | - add_action( 'wp_ajax_get_new_list_data', array( $this , 'get_new_list_data' ), 10 ); |
|
19 | + add_action( 'wp_ajax_get_new_list_data', array( $this, 'get_new_list_data' ), 10 ); |
|
20 | 20 | // return new list data + activity (for dashboard widget ) |
21 | - add_action( 'wp_ajax_check_list_for_interest_groups', array( $this , 'check_list_for_interest_groups' ), 10 ); |
|
21 | + add_action( 'wp_ajax_check_list_for_interest_groups', array( $this, 'check_list_for_interest_groups' ), 10 ); |
|
22 | 22 | // Add a new notification to a form |
23 | - add_action( 'wp_ajax_add_notification_to_form', array( $this , 'add_notification_to_form' ), 10 , 1 ); |
|
23 | + add_action( 'wp_ajax_add_notification_to_form', array( $this, 'add_notification_to_form' ), 10, 1 ); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /* |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * - return a single container |
29 | 29 | */ |
30 | 30 | public function add_notification_to_form() { |
31 | - if( $_POST['notification_name'] ) { |
|
31 | + if ( $_POST[ 'notification_name' ] ) { |
|
32 | 32 | include_once( YIKES_MC_PATH . 'admin/partials/ajax/add_notification_to_form.php' ); |
33 | 33 | } |
34 | 34 | exit(); |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | // when the user wants to switch which form data |
40 | 40 | // is displayed on the dashboard |
41 | 41 | public function get_new_list_data() { |
42 | - $list_id = $_POST['list_id']; |
|
42 | + $list_id = $_POST[ 'list_id' ]; |
|
43 | 43 | $api_key = yikes_get_mc_api_key(); |
44 | 44 | $dash_position = strpos( $api_key, '-' ); |
45 | - if( $dash_position !== false ) { |
|
45 | + if ( $dash_position !== false ) { |
|
46 | 46 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/list.json'; |
47 | 47 | } |
48 | 48 | $list_data = wp_remote_post( $api_endpoint, array( |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
55 | 55 | ) ); |
56 | 56 | $list_data = json_decode( wp_remote_retrieve_body( $list_data ), true ); |
57 | - if( isset( $list_data['error'] ) ) { |
|
58 | - if( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
57 | + if ( isset( $list_data[ 'error' ] ) ) { |
|
58 | + if ( WP_DEBUG || get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
59 | 59 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
60 | 60 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
61 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data['error'], __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ) , __( "MailChimp Widget" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
61 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $list_data[ 'error' ], __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), __( "MailChimp Widget", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
62 | 62 | } |
63 | 63 | } |
64 | - if( ! empty( $list_data['data'][0] ) ) { |
|
64 | + if ( ! empty( $list_data[ 'data' ][ 0 ] ) ) { |
|
65 | 65 | include_once( YIKES_MC_PATH . 'admin/partials/dashboard-widgets/templates/stats-list-template.php' ); |
66 | 66 | } |
67 | 67 | exit(); |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | // we want to return the interest groups associated with this list, |
74 | 74 | // to allow users to pre-check anything they want to assign users appropriately |
75 | 75 | /* note: this function is called statically from the integration settings page */ |
76 | - public static function check_list_for_interest_groups( $list_id='', $integration_type='', $load=false ) { |
|
77 | - if( ! $list_id ) { |
|
78 | - $list_id = $_POST['list_id']; |
|
76 | + public static function check_list_for_interest_groups( $list_id = '', $integration_type = '', $load = false ) { |
|
77 | + if ( ! $list_id ) { |
|
78 | + $list_id = $_POST[ 'list_id' ]; |
|
79 | 79 | } |
80 | - if( ! $integration_type ) { |
|
81 | - $integration_type = $_POST['integration']; |
|
80 | + if ( ! $integration_type ) { |
|
81 | + $integration_type = $_POST[ 'integration' ]; |
|
82 | 82 | } |
83 | 83 | $api_key = yikes_get_mc_api_key(); |
84 | 84 | // setup/check our transients |
85 | - if ( WP_DEBUG || false === ( $interest_groupings = get_transient( $list_id . '_interest_group' ) ) ) { |
|
85 | + if ( WP_DEBUG || false === ( $interest_groupings = get_transient( $list_id . '_interest_group' ) ) ) { |
|
86 | 86 | // It wasn't there, so regenerate the data and save the transient |
87 | 87 | $dash_position = strpos( $api_key, '-' ); |
88 | - if( $dash_position !== false ) { |
|
88 | + if ( $dash_position !== false ) { |
|
89 | 89 | $api_endpoint = 'https://' . substr( $api_key, $dash_position + 1 ) . '.api.mailchimp.com/2.0/lists/interest-groupings.json'; |
90 | 90 | } |
91 | 91 | $interest_groupings = wp_remote_post( $api_endpoint, array( |
@@ -98,22 +98,22 @@ discard block |
||
98 | 98 | 'sslverify' => apply_filters( 'yikes-mailchimp-sslverify', true ) |
99 | 99 | ) ); |
100 | 100 | $interest_groupings = json_decode( wp_remote_retrieve_body( $interest_groupings ), true ); |
101 | - if( isset( $interest_groupings['error'] ) ) { |
|
102 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
101 | + if ( isset( $interest_groupings[ 'error' ] ) ) { |
|
102 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
103 | 103 | require_once YIKES_MC_PATH . 'includes/error_log/class-yikes-inc-easy-mailchimp-error-logging.php'; |
104 | 104 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
105 | - $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" ); |
|
105 | + $error_logging->yikes_easy_mailchimp_write_to_error_log( $interest_groupings[ 'error' ], __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" ); |
|
106 | 106 | } |
107 | 107 | } else { |
108 | 108 | // set the transient for 2 hours |
109 | 109 | set_transient( $list_id . '_interest_group', $interest_groupings, 2 * HOUR_IN_SECONDS ); |
110 | 110 | } |
111 | 111 | } |
112 | - if( isset( $interest_groupings ) && ! empty( $interest_groupings ) ) { |
|
112 | + if ( isset( $interest_groupings ) && ! empty( $interest_groupings ) ) { |
|
113 | 113 | require( YIKES_MC_PATH . 'admin/partials/menu/options-sections/templates/integration-interest-groups.php' ); |
114 | 114 | } |
115 | 115 | // do not kill off execution on load, only on an ajax request |
116 | - if( ! $load ) { |
|
116 | + if ( ! $load ) { |
|
117 | 117 | exit(); |
118 | 118 | wp_die(); |
119 | 119 | } |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | // send a field to our form |
124 | 124 | public function send_field_to_form() { |
125 | 125 | $form_data_array = array( |
126 | - 'field_name' => $_POST['field_name'], |
|
127 | - 'merge_tag' => $_POST['merge_tag'], |
|
128 | - 'field_type' => $_POST['field_type'], |
|
129 | - 'list_id' => $_POST['list_id'], |
|
126 | + 'field_name' => $_POST[ 'field_name' ], |
|
127 | + 'merge_tag' => $_POST[ 'merge_tag' ], |
|
128 | + 'field_type' => $_POST[ 'field_type' ], |
|
129 | + 'list_id' => $_POST[ 'list_id' ], |
|
130 | 130 | ); |
131 | 131 | include YIKES_MC_PATH . 'admin/partials/ajax/add_field_to_form.php'; |
132 | 132 | exit(); |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | // send interest group to our form |
137 | 137 | public function send_interest_group_to_form() { |
138 | 138 | $form_data_array = array( |
139 | - 'field_name' => $_POST['field_name'], |
|
140 | - 'group_id' => $_POST['group_id'], |
|
141 | - 'field_type' => $_POST['field_type'], |
|
142 | - 'list_id' => $_POST['list_id'], |
|
139 | + 'field_name' => $_POST[ 'field_name' ], |
|
140 | + 'group_id' => $_POST[ 'group_id' ], |
|
141 | + 'field_type' => $_POST[ 'field_type' ], |
|
142 | + 'list_id' => $_POST[ 'list_id' ], |
|
143 | 143 | ); |
144 | 144 | include YIKES_MC_PATH . 'admin/partials/ajax/add_interest_group_to_form.php'; |
145 | 145 | exit(); |
@@ -152,16 +152,16 @@ discard block |
||
152 | 152 | * - http://stackoverflow.com/questions/6661530/php-multi-dimensional-array-search |
153 | 153 | */ |
154 | 154 | public function findMCListIndex( $id, $array, $tag ) { |
155 | - if( $tag == 'tag' ) { |
|
156 | - foreach( $array as $key => $val ) { |
|
157 | - if ( $val['tag'] === $id ) { |
|
155 | + if ( $tag == 'tag' ) { |
|
156 | + foreach ( $array as $key => $val ) { |
|
157 | + if ( $val[ 'tag' ] === $id ) { |
|
158 | 158 | return $key; |
159 | 159 | } |
160 | 160 | } |
161 | 161 | return null; |
162 | 162 | } else { |
163 | 163 | foreach ( $array as $key => $val ) { |
164 | - if ( $val['id'] == $id ) { |
|
164 | + if ( $val[ 'id' ] == $id ) { |
|
165 | 165 | return $key; |
166 | 166 | } |
167 | 167 | } |