Skip to content

Commit

Permalink
Merge pull request #30 from mailchimp/feat/removes-monkeyrewards
Browse files Browse the repository at this point in the history
Removes Monkey Rewards
  • Loading branch information
dkotter authored Jun 17, 2024
2 parents 11a4124 + e170584 commit 1abf779
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 45 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ This section describes how to install the plugin and get started using it.
3. Navigate to **Settings** click **Mailchimp Setup**.
4. Enter your Mailchimp API Key and let the plugin verify it.
5. Select the list where you want to send new Mailchimp subscribers.
6. Optional: turn **MonkeyRewards** on or off.
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.
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.

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

Expand Down
15 changes: 4 additions & 11 deletions mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/

// Version constant for easy CSS refreshes
define( 'MCSF_VER', '1.5.8' );
define( 'MCSF_VER', '1.6.0' );

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

// Upgrade routines.
require_once 'mailchimp_upgrade.php';

/**
* Do the following plugin setup steps here
*
Expand Down Expand Up @@ -421,7 +424,6 @@ function mailchimp_sf_delete_setup() {
'mc_sopresto_user',
'mc_sopresto_public_key',
'mc_sopresto_secret_key',
'mc_rewards',
'mc_use_javascript',
'mc_use_datepicker',
'mc_use_unsub_link',
Expand Down Expand Up @@ -508,15 +510,6 @@ function mailchimp_sf_set_form_defaults( $list_name = '' ) {
function mailchimp_sf_save_general_form_settings() {

// IF NOT DEV MODE
if ( isset( $_POST['mc_rewards'] ) ) {
update_option( 'mc_rewards', 'on' );
$msg = '<p class="success_msg">' . __( 'Monkey Rewards turned On!', 'mailchimp_i18n' ) . '</p>';
mailchimp_sf_global_msg( $msg );
} elseif ( get_option( 'mc_rewards' ) !== 'off' ) {
update_option( 'mc_rewards', 'off' );
$msg = '<p class="success_msg">' . __( 'Monkey Rewards turned Off!', 'mailchimp_i18n' ) . '</p>';
mailchimp_sf_global_msg( $msg );
}
if ( isset( $_POST['mc_use_javascript'] ) ) {
update_option( 'mc_use_javascript', 'on' );
$msg = '<p class="success_msg">' . __( 'Fancy Javascript submission turned On!', 'mailchimp_i18n' ) . '</p>';
Expand Down
38 changes: 38 additions & 0 deletions mailchimp_upgrade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Upgrade routines.
*
* @package Mailchimp
*/

/**
* Check plugin version.
*
* @since 1.6.0
* @return void
*/
function mailchimp_version_check() {
$db_option = get_option( 'mc_version' );

if ( MCSF_VER === $db_option ) {
return;
}

if ( false === $db_option || version_compare( '1.6.0', $db_option, '>' ) ) {
mailchimp_update_1_6_0();
}

update_option( 'mc_version', MCSF_VER );
}

add_action( 'plugins_loaded', 'mailchimp_version_check' );

/**
* Version 1.6.0 update routine
* - Remove MonkeyRewards checkbox option
*
* @return void
*/
function mailchimp_update_1_6_0() {
delete_option( 'mc_rewards' );
}
8 changes: 0 additions & 8 deletions mailchimp_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,6 @@ function mailchimp_sf_signup_form( $args = array() ) {
</div><!-- /mc_unsub_link -->
<?php
}
if ( $user && get_option( 'mc_rewards' ) === 'on' ) {
?>
<br/>
<div id="mc_display_rewards" align="center">
<?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>!
</div><!-- /mc_display_rewards -->
<?php
}
?>

</div><!-- /mc_form_inside -->
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ This section describes how to install the plugin and get started using it.
3. Navigate to **Settings** click **Mailchimp Setup**.
4. Enter your Mailchimp API Key and let the plugin verify it.
5. Select the list where you want to send new Mailchimp subscribers.
6. Optional: turn **MonkeyRewards** on or off.
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.
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.

= Advanced =

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

= 1.5.8 =
* Fix PHP warning for merge tags.
Expand Down
1 change: 0 additions & 1 deletion views/css/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#mc-indicates-required {
width:100%;
}
#mc_display_rewards {}
.mc_interests_header {
font-weight:bold;
}
Expand Down
21 changes: 0 additions & 21 deletions views/setup_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,6 @@

<table class="widefat mc-widefat">
<tr><th colspan="2">List Options</th></tr>
<tr valign="top">
<th scope="row"><?php esc_html_e( 'MonkeyRewards', 'mailchimp_i18n' ); ?>?</th>
<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" />
<em><label for="mc_rewards">
<?php
echo wp_kses(
__(
'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.',
'mailchimp_i18n'
),
[
'a' => [
'href',
'target',
],
]
);
?>
</label></em>
</td>
</tr>

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

0 comments on commit 1abf779

Please sign in to comment.