Skip to content

Commit 87388d7

Browse files
code style fixes
1 parent 5f7e9f4 commit 87388d7

File tree

13 files changed

+52
-46
lines changed

13 files changed

+52
-46
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
#### 4.9.15 - Dec 18, 2024
5+
6+
-
7+
8+
49
#### 4.9.19 - Nov 11, 2024
510

611
- Add integration with [Prosopo](https://prosopo.io/), a GDPR compliant anti-spam solution for protecting your sign-up forms against bot sign-ups. Thanks [Maxim Akimov](https://github.com/light-source)!

config/default-form-content.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
$email_label = esc_html__('Email address', 'mailchimp-for-wp');
3+
$email_label = esc_html__('Email address', 'mailchimp-for-wp');
44
$email_placeholder_attr = esc_attr__('Your email address', 'mailchimp-for-wp');
5-
$signup_button_value = esc_attr__('Sign up', 'mailchimp-for-wp');
5+
$signup_button_value = esc_attr__('Sign up', 'mailchimp-for-wp');
66

77
$content = "<p>\n\t<label for=\"email\">{$email_label}: \n";
88
$content .= "\t\t<input type=\"email\" id=\"email\" name=\"EMAIL\" placeholder=\"{$email_placeholder_attr}\" required>\n</label>\n</p>\n\n";

includes/admin/class-admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public function show_generals_setting_page()
432432
}
433433
}
434434

435-
$obfuscated_api_key = mc4wp_obfuscate_string($api_key);
435+
$obfuscated_api_key = mc4wp_obfuscate_string($api_key);
436436
$is_procaptcha_configured = MC4WP_Procaptcha::get_instance()->is_enabled();
437437

438438
require MC4WP_PLUGIN_DIR . '/includes/views/general-settings.php';

includes/forms/views/edit-form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<?php
7474
foreach ($tabs as $tab => $name) {
7575
$class = ( $active_tab === $tab ) ? 'nav-tab-active' : '';
76-
$href = esc_attr($this->tab_url($tab));
76+
$href = esc_attr($this->tab_url($tab));
7777
echo "<a class=\"nav-tab nav-tab-{$tab} {$class}\" data-tab=\"{$tab}\" href=\"{$href}\">{$name}</a>";
7878
}
7979
?>

includes/integrations/views/integration-settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
echo '<ul style="margin-bottom: 20px; max-height: 300px; overflow-y: auto;">';
123123
foreach ($lists as $list) {
124124
$checked = checked(in_array($list->id, $opts['lists'], true), true, false);
125-
$value = esc_attr($list->id);
125+
$value = esc_attr($list->id);
126126
echo '<li><label>';
127127
echo "<input type=\"checkbox\" name=\"mc4wp_integrations[{$integration->slug}][lists][]\" value=\"{$value}\" class=\"mc4wp-list-input\" {$checked}> ";
128128
echo esc_html($list->name);

includes/integrations/views/integrations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function _mc4wp_integrations_table_row($integration)
1111
<td>
1212
<?php
1313
if ($integration->is_installed()) {
14-
$href = esc_attr(add_query_arg(array( 'integration' => $integration->slug )));
14+
$href = esc_attr(add_query_arg(array( 'integration' => $integration->slug )));
1515
$title = esc_attr__('Configure this integration', 'mailchimp-for-wp');
1616
echo "<strong><a href=\"{$href}\" title=\"{$title}\">{$integration->name}</a></strong>";
1717
} else {

includes/views/parts/lists-overview.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
foreach ($lists as $list) {
3939
$attr_data_list_id = esc_attr($list->id);
40-
$list_name = esc_html($list->name);
40+
$list_name = esc_html($list->name);
4141
echo '<tr>';
4242
echo '<td><a href="#" class="mc4wp-mailchimp-list" data-list-id="', $attr_data_list_id, '">', $list_name, '</a><span class="row-actions alignright"></span></td>';
4343
echo '<td><code>', esc_html($list->id), '</code></td>';

integrations/gravity-forms/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
mc4wp_register_integration('gravity-forms', 'MC4WP_Gravity_Forms_Integration', true);
66

7-
add_action('plugins_loaded', function() {
7+
add_action('plugins_loaded', function () {
88
if (class_exists('GF_Fields')) {
99
GF_Fields::register(new MC4WP_Gravity_Forms_Field());
1010
}

integrations/ninja-forms/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
mc4wp_register_integration('ninja-forms', 'MC4WP_Ninja_Forms_Integration', true);
44

5-
add_filter('ninja_forms_register_fields', function($fields) {
5+
add_filter('ninja_forms_register_fields', function ($fields) {
66
$fields['mc4wp_optin'] = new MC4WP_Ninja_Forms_Field();
77
return $fields;
88
});
99

10-
add_filter('ninja_forms_register_actions', function($actions) {
10+
add_filter('ninja_forms_register_actions', function ($actions) {
1111
$actions['mc4wp_subscribe'] = new MC4WP_Ninja_Forms_Action();
1212
return $actions;
1313
});

integrations/ninja-forms/class-action.php

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
*/
1010
class MC4WP_Ninja_Forms_Action extends NF_Abstracts_Action
1111
{
12-
protected $_name = 'mc4wp_subscribe';
13-
protected $_nicename = 'Mailchimp';
14-
protected $_tags = array( 'newsletter' );
15-
protected $_timing = 'normal';
16-
protected $_priority = '10';
17-
protected $_settings = array();
12+
protected $_name = 'mc4wp_subscribe';
13+
protected $_nicename = 'Mailchimp';
14+
protected $_tags = array( 'newsletter' );
15+
protected $_timing = 'normal';
16+
protected $_priority = '10';
17+
protected $_settings = array();
1818
protected $_setting_labels = array(
1919
'list' => 'List',
2020
'fields' => 'List Field Mapping',
@@ -24,7 +24,7 @@ public function __construct()
2424
{
2525
parent::__construct();
2626

27-
$this->_settings['double_optin'] = array(
27+
$this->_settings['double_optin'] = array(
2828
'name' => 'double_optin',
2929
'type' => 'select',
3030
'label' => 'Use double opt-in?',
@@ -61,15 +61,15 @@ public function __construct()
6161
),
6262
);
6363

64-
add_action( 'wp_ajax_nf_' . $this->_name . '_get_lists', array($this, '_get_lists'));
64+
add_action('wp_ajax_nf_' . $this->_name . '_get_lists', array($this, '_get_lists'));
6565
add_action('init', array($this, 'translate_props'));
6666

6767
$this->get_list_settings();
6868
}
6969

7070
public function translate_props()
7171
{
72-
$this->_settings['double_optin']['label'] = __('Use double opt-in?', 'mailchimp-for-wp');
72+
$this->_settings['double_optin']['label'] = __('Use double opt-in?', 'mailchimp-for-wp');
7373
$this->_settings['update_existing']['label'] = __('Update existing subscribers?', 'mailchimp-for-wp');
7474

7575
$this->_settings[ $this->get_name() . 'newsletter_list_fields' ]['label'] = __('List Field Mapping', 'mailchimp-for-wp');
@@ -116,10 +116,10 @@ public function process($action_settings, $form_id, $data)
116116

117117
public function ajax_get_lists_handler()
118118
{
119-
check_ajax_referer( 'ninja_forms_builder_nonce', 'security' );
119+
check_ajax_referer('ninja_forms_builder_nonce', 'security');
120120
$lists = $this->get_lists();
121-
array_unshift( $return, array( 'value' => 0, 'label' => '-', 'fields' => array(), 'groups' => array() ) );
122-
echo wp_json_encode( array( 'lists' => $return ) );
121+
array_unshift($return, array( 'value' => 0, 'label' => '-', 'fields' => array(), 'groups' => array() ));
122+
echo wp_json_encode(array( 'lists' => $return ));
123123
wp_die();
124124
}
125125

@@ -158,11 +158,13 @@ private function get_list_settings()
158158
'list' => 'List',
159159
'fields' => 'List Field Mapping',
160160
);
161-
$labels = array_merge( $label_defaults, $this->_setting_labels );
162-
$prefix = $this->get_name();
163-
$lists = $this->get_lists();
161+
$labels = array_merge($label_defaults, $this->_setting_labels);
162+
$prefix = $this->get_name();
163+
$lists = $this->get_lists();
164164

165-
if( empty( $lists ) ) return;
165+
if (empty($lists)) {
166+
return;
167+
}
166168

167169
$this->_settings[ $prefix . 'newsletter_list' ] = array(
168170
'name' => 'newsletter_list',
@@ -175,24 +177,23 @@ private function get_list_settings()
175177
);
176178

177179
$fields = array();
178-
foreach( $lists as $list ) {
180+
foreach ($lists as $list) {
179181
$this->_settings[ $prefix . 'newsletter_list' ][ 'options' ][] = $list;
180182

181183
//Check to see if list has fields array set.
182-
if ( isset( $list[ 'fields' ] ) ) {
183-
184-
foreach ( $list[ 'fields' ] as $field ) {
185-
$name = $list[ 'value' ] . '_' . $field[ 'value' ];
184+
if (isset($list[ 'fields' ])) {
185+
foreach ($list[ 'fields' ] as $field) {
186+
$name = $list[ 'value' ] . '_' . $field[ 'value' ];
186187
$fields[] = array(
187188
'name' => $name,
188189
'type' => 'textbox',
189190
'label' => $field[ 'label' ],
190191
'width' => 'full',
191192
'use_merge_tags' => array(
192193
'exclude' => array(
193-
'user', 'post', 'system', 'querystrings'
194-
)
195-
)
194+
'user', 'post', 'system', 'querystrings',
195+
),
196+
),
196197
);
197198
}
198199
}
@@ -203,7 +204,7 @@ private function get_list_settings()
203204
'label' => 'List Field Mapping',
204205
'type' => 'fieldset',
205206
'group' => 'primary',
206-
'settings' => array()
207+
'settings' => array(),
207208
);
208209
}
209210
}

0 commit comments

Comments
 (0)