Skip to content

Commit 1abf779

Browse files
authored
Merge pull request #30 from mailchimp/feat/removes-monkeyrewards
Removes Monkey Rewards
2 parents 11a4124 + e170584 commit 1abf779

File tree

7 files changed

+45
-45
lines changed

7 files changed

+45
-45
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ This section describes how to install the plugin and get started using it.
2929
3. Navigate to **Settings** click **Mailchimp Setup**.
3030
4. Enter your Mailchimp API Key and let the plugin verify it.
3131
5. Select the list where you want to send new Mailchimp subscribers.
32-
6. Optional: turn **MonkeyRewards** on or off.
33-
7. Optional: Turn **Merge Fields** and **Groups** on or off. Navigate to **Appearance**, and click **Widgets**. Drag the Mailchimp Widget into one of your Widget Areas.
32+
6. Optional: Turn **Merge Fields** and **Groups** on or off. Navigate to **Appearance**, and click **Widgets**. Drag the Mailchimp Widget into one of your Widget Areas.
3433

3534
![Selecting your Mailchimp list](https://github.com/mailchimp/wordpress/blob/develop/.wordpress-org/screenshot-2.jpg?raw=true)
3635

mailchimp.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535

3636
// Version constant for easy CSS refreshes
37-
define( 'MCSF_VER', '1.5.8' );
37+
define( 'MCSF_VER', '1.6.0' );
3838

3939
// What's our permission (capability) threshold
4040
define( 'MCSF_CAP_THRESHOLD', 'manage_options' );
@@ -54,6 +54,9 @@
5454
// includes the backwards compatibility functions
5555
require_once 'mailchimp_compat.php';
5656

57+
// Upgrade routines.
58+
require_once 'mailchimp_upgrade.php';
59+
5760
/**
5861
* Do the following plugin setup steps here
5962
*
@@ -421,7 +424,6 @@ function mailchimp_sf_delete_setup() {
421424
'mc_sopresto_user',
422425
'mc_sopresto_public_key',
423426
'mc_sopresto_secret_key',
424-
'mc_rewards',
425427
'mc_use_javascript',
426428
'mc_use_datepicker',
427429
'mc_use_unsub_link',
@@ -508,15 +510,6 @@ function mailchimp_sf_set_form_defaults( $list_name = '' ) {
508510
function mailchimp_sf_save_general_form_settings() {
509511

510512
// IF NOT DEV MODE
511-
if ( isset( $_POST['mc_rewards'] ) ) {
512-
update_option( 'mc_rewards', 'on' );
513-
$msg = '<p class="success_msg">' . __( 'Monkey Rewards turned On!', 'mailchimp_i18n' ) . '</p>';
514-
mailchimp_sf_global_msg( $msg );
515-
} elseif ( get_option( 'mc_rewards' ) !== 'off' ) {
516-
update_option( 'mc_rewards', 'off' );
517-
$msg = '<p class="success_msg">' . __( 'Monkey Rewards turned Off!', 'mailchimp_i18n' ) . '</p>';
518-
mailchimp_sf_global_msg( $msg );
519-
}
520513
if ( isset( $_POST['mc_use_javascript'] ) ) {
521514
update_option( 'mc_use_javascript', 'on' );
522515
$msg = '<p class="success_msg">' . __( 'Fancy Javascript submission turned On!', 'mailchimp_i18n' ) . '</p>';

mailchimp_upgrade.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* Upgrade routines.
4+
*
5+
* @package Mailchimp
6+
*/
7+
8+
/**
9+
* Check plugin version.
10+
*
11+
* @since 1.6.0
12+
* @return void
13+
*/
14+
function mailchimp_version_check() {
15+
$db_option = get_option( 'mc_version' );
16+
17+
if ( MCSF_VER === $db_option ) {
18+
return;
19+
}
20+
21+
if ( false === $db_option || version_compare( '1.6.0', $db_option, '>' ) ) {
22+
mailchimp_update_1_6_0();
23+
}
24+
25+
update_option( 'mc_version', MCSF_VER );
26+
}
27+
28+
add_action( 'plugins_loaded', 'mailchimp_version_check' );
29+
30+
/**
31+
* Version 1.6.0 update routine
32+
* - Remove MonkeyRewards checkbox option
33+
*
34+
* @return void
35+
*/
36+
function mailchimp_update_1_6_0() {
37+
delete_option( 'mc_rewards' );
38+
}

mailchimp_widget.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,6 @@ function mailchimp_sf_signup_form( $args = array() ) {
262262
</div><!-- /mc_unsub_link -->
263263
<?php
264264
}
265-
if ( $user && get_option( 'mc_rewards' ) === 'on' ) {
266-
?>
267-
<br/>
268-
<div id="mc_display_rewards" align="center">
269-
<?php esc_html_e( 'powered by', 'mailchimp_i18n' ); ?> <a href="<?php echo esc_url( 'http://www.mailchimp.com/affiliates/?aid=' . $user['account_id'] . '&amp;afl=1' ); ?>">Mailchimp</a>!
270-
</div><!-- /mc_display_rewards -->
271-
<?php
272-
}
273265
?>
274266

275267
</div><!-- /mc_form_inside -->

readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ This section describes how to install the plugin and get started using it.
2727
3. Navigate to **Settings** click **Mailchimp Setup**.
2828
4. Enter your Mailchimp API Key and let the plugin verify it.
2929
5. Select the list where you want to send new Mailchimp subscribers.
30-
6. Optional: turn **MonkeyRewards** on or off.
31-
7. Optional: Turn **Merge Fields** and **Groups** on or off. Navigate to **Appearance**, and click **Widgets**. Drag the Mailchimp Widget into one of your Widget Areas.
30+
6. Optional: Turn **Merge Fields** and **Groups** on or off. Navigate to **Appearance**, and click **Widgets**. Drag the Mailchimp Widget into one of your Widget Areas.
3231

3332
= Advanced =
3433

@@ -101,6 +100,7 @@ If your language is not listed above, feel free to create a translation. Here ar
101100
= 1.6.0 =
102101
* Deprecated function `mailchimpSF_signup_form`. Function `mailchimp_sf_signup_form` should be used instead.
103102
* Bumps minimum PHP version to 7.0
103+
* Removes MonkeyRewards feature.
104104

105105
= 1.5.8 =
106106
* Fix PHP warning for merge tags.

views/css/frontend.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#mc-indicates-required {
5656
width:100%;
5757
}
58-
#mc_display_rewards {}
5958
.mc_interests_header {
6059
font-weight:bold;
6160
}

views/setup_page.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -260,27 +260,6 @@
260260

261261
<table class="widefat mc-widefat">
262262
<tr><th colspan="2">List Options</th></tr>
263-
<tr valign="top">
264-
<th scope="row"><?php esc_html_e( 'MonkeyRewards', 'mailchimp_i18n' ); ?>?</th>
265-
<td><input name="mc_rewards" type="checkbox"<?php if ( get_option( 'mc_rewards' ) === 'on' || get_option( 'mc_rewards' ) === '' ) { echo ' checked="checked"'; } ?> id="mc_rewards" class="code" />
266-
<em><label for="mc_rewards">
267-
<?php
268-
echo wp_kses(
269-
__(
270-
'We\'ll add a "powered by Mailchimp" link to your form that will help you earn <a href="http://kb.mailchimp.com/accounts/account-setup/monkeyrewards-credits" target="_blank">MonkeyRewards</a>. You can turn it off at any time.',
271-
'mailchimp_i18n'
272-
),
273-
[
274-
'a' => [
275-
'href',
276-
'target',
277-
],
278-
]
279-
);
280-
?>
281-
</label></em>
282-
</td>
283-
</tr>
284263

285264
<tr valign="top">
286265
<th scope="row"><?php esc_html_e( 'Use JavaScript Support?', 'mailchimp_i18n' ); ?></th>

0 commit comments

Comments
 (0)