Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes Monkey Rewards #30

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -414,7 +417,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 @@ -501,15 +503,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
Loading