Skip to content

Commit

Permalink
Merge branch 'v2.8' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed May 5, 2022
2 parents ead3fc2 + 2058558 commit 99089e9
Show file tree
Hide file tree
Showing 126 changed files with 73,389 additions and 4,170 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
== Changelog ==
= 2.8 - 2022-05-05 =
* FEATURE: Added refunds buttons for Stripe and Paypal Express orders. #1948 (@JarrydLong)
* FEATURE: Released Beta version of Stripe Checkout. Add `define('PMPRO_STRIPE_CHECKOUT_BETA_ENABLED', true);` to your wp-config.php to enable this gateway during the beta. #1923 (@dlparker1005)
* ENHANCEMENT: Introduced a new set of functions that handle cron-related tasks including: `pmpro_get_crons()` to get the list of PMPro registered crons. #1999 (@sc0ttkclark)
* ENHANCEMENT: New filter `pmpro_registered_crons` which you can register new crons to be handled by PMPro. They show up in the PMPro Site Health info and are automatically scheduled when they need to be. #1999 (@sc0ttkclark)
* ENHANCEMENT: Added an opt-in stats collection so we can get better insight on how people use Paid Memberships Pro. (@sc0ttkclark, @ideadude)
* ENHANCEMENT: Added Formal German translation files. #1926
* ENHANCEMENT: Tracking library conflicts in Site Health, e.g. when other plugins are loading gateway libraries at the same time as PMPro. (@dparker1005)
* ENHANCEMENT: UI/UX improvements to the Orders admin area for list and single edit view. #2017 (@kimcoleman)
* ENHANCEMENT: Improved the UI for email template variables reference on the Settings > Email Templates admin page. #2018 (@kimcoleman)
* ENHANCEMENT: Various other UI improvements to the admin area. #2019 (@kimcoleman)
* ENHANCEMENT: Improved block names, descriptions, keywords, and organization for discover and usability. #2011 (@kimcoleman)
* ENHANCEMENT: Added "show_noaccess" as a setting on the Membership Required block for swapping in the appropriate content message. #2011 (@kimcoleman)
* ENHANCEMENT: Added filter 'pmpro_braintree_transaction_sale_array' to allow adding or adjusting of the sale transaction method. #2006 (@andrewlimaza)
* ENHANCEMENT: Moved the TOS input inside the label to support multiline i18n. #2002 (#mircobabini)
* ENHANCEMENT: Added new action `pmpro_checkout_after_tos` to output content after the TOS. #2003 (@mircobabini)
* ENHANCEMENT: Added filters to change gateway ipn/webhook logfile. #1996 (@mircobabini)
* ENHANCEMENT: Added filter to perform actions during PPHttpPost() method of the PayPal gateways. #1992 (@mircobabini)
* ENHANCEMENT: Added untranslated gateway identifiers to Site Health info. #1989 (@JarrydLong)
* BUG FIX/ENHANCEMENT: Fixed escaping and localization for many strings across the codebase. #1976 (@mircobabini)
* BUG FIX/ENHANCEMENT: Resolve admin area conflicts with other plugins using similar class names. #1991 (@sc0ttkclark)
* BUG FIX: Crons are now automatically rescheduled if they disappear form the cron schedule. #1999 (@sc0ttkclark, @mircobabini)
* BUG FIX: Resolved problems with PHP float precision and prevent passing along faulty floats to the gateway APIs. #1929 (@sc0ttkclark)
* BUG FIX: Fixed issue where TOS setting was not saving when using the PayFast gateway. #1990 (@andrewlimaza)
* BUG FIX: Fixed issue where the is_renewal() method didn't work during the pmpro_added_order hook. (@andrewlimaza)

= 2.7.5 - 2022-03-01 =
* ENHANCEMENT: Now sending "name" separate from the "description" when creating customers for Stripe checkouts. (@ideadude)
* ENHANCEMENT: You can now search the members list on specific user table columns or user meta fields by using a colon in your search term. These queries are faster than the default queries. The format is meta_key:meta_value (no backticks). You can also use login, nicename, email, url, or display_name as the meta_key and the users table will be searched against the related column. (@ideadude)
Expand Down
19 changes: 19 additions & 0 deletions adminpages/admin_footer.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
<div class="clear"></div>
<?php
echo sprintf(
wp_kses(
/* translators: $1$s - Paid Memberships Pro plugin name; $2$s - WP.org review link. */
__( '<p>Please <a href="%1$s" target="_blank" rel="noopener noreferrer">rate us &#9733;&#9733;&#9733;&#9733;&#9733; on WordPress.org</a> to help others find %2$s. Thank you from the %3$s team!</p>', 'paid-memberships-pro' ),
[
'a' => [
'href' => [],
'target' => [],
'rel' => [],
],
'p' => [],
]
),
'https://wordpress.org/support/plugin/paid-memberships-pro/reviews/?filter=5#new-post',
'Paid Memberships Pro',
'PMPro',
);
?>
</div>
78 changes: 55 additions & 23 deletions adminpages/advancedsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,54 @@
$msg = -1;
$msgt = __("Are you sure you want to do that? Try again.", 'paid-memberships-pro' );
unset($_REQUEST['savesettings']);
}
}

//get/set settings
if(!empty($_REQUEST['savesettings']))
{
// Dashboard settings.
pmpro_setOption( 'hide_toolbar' );
pmpro_setOption( 'block_dashboard' );

// Message settings.
// These use wp_kses for better security handling.
$nonmembertext = wp_kses(wp_unslash($_POST['nonmembertext']), $allowedposttags);
update_option('pmpro_nonmembertext', $nonmembertext);

$notloggedintext = wp_kses(wp_unslash($_POST['notloggedintext']), $allowedposttags);
update_option('pmpro_notloggedintext', $notloggedintext);

$rsstext = wp_kses(wp_unslash($_POST['rsstext']), $allowedposttags);
update_option('pmpro_rsstext', $rsstext);
update_option('pmpro_rsstext', $rsstext);

// Content settings.
pmpro_setOption("filterqueries");
pmpro_setOption("showexcerpts");
pmpro_setOption("showexcerpts");

// Checkout settings.
pmpro_setOption("tospage");
pmpro_setOption("spamprotection");
pmpro_setOption("recaptcha");
pmpro_setOption("recaptcha_version");
pmpro_setOption("recaptcha_publickey");
pmpro_setOption("recaptcha_privatekey");
pmpro_setOption("recaptcha_privatekey");

// Communication settings.
pmpro_setOption("maxnotificationpriority");
pmpro_setOption("activity_email_frequency");

// Other settings.
pmpro_setOption("hideads");
pmpro_setOption("wisdom_opt_out");
pmpro_setOption("hideadslevels");
pmpro_setOption("redirecttosubscription");
pmpro_setOption("uninstall");
pmpro_setOption("uninstall");

// Set up Wisdom tracking cron if needed.
if ( (int)pmpro_getOption("wisdom_opt_out") === 0 ) {
$wisdom_integration = PMPro_Wisdom_Integration::instance();
$wisdom_integration->wisdom_tracker->schedule_tracking();
}

/**
* Filter to add custom settings to the advanced settings page.
Expand All @@ -63,7 +70,7 @@
if(!empty($setting['field_name']))
pmpro_setOption($setting['field_name']);
}

// Assume success.
$msg = true;
$msgt = __("Your advanced settings have been updated.", 'paid-memberships-pro' );
Expand All @@ -72,15 +79,15 @@
// Dashboard settings.
$hide_toolbar = pmpro_getOption( 'hide_toolbar' );
$block_dashboard = pmpro_getOption( 'block_dashboard' );

// Message settings.
$nonmembertext = pmpro_getOption("nonmembertext");
$notloggedintext = pmpro_getOption("notloggedintext");
$rsstext = pmpro_getOption("rsstext");

// Content settings.
$filterqueries = pmpro_getOption('filterqueries');
$showexcerpts = pmpro_getOption("showexcerpts");
$showexcerpts = pmpro_getOption("showexcerpts");

// Checkout settings.
$tospage = pmpro_getOption("tospage");
Expand All @@ -96,6 +103,7 @@

// Other settings.
$hideads = pmpro_getOption("hideads");
$wisdom_opt_out = (int)pmpro_getOption("wisdom_opt_out");
$hideadslevels = pmpro_getOption("hideadslevels");
if( is_multisite() ) {
$redirecttosubscription = pmpro_getOption("redirecttosubscription");
Expand Down Expand Up @@ -130,9 +138,8 @@

<form action="" method="post" enctype="multipart/form-data">
<?php wp_nonce_field('savesettings', 'pmpro_advancedsettings_nonce');?>

<h1 class="wp-heading-inline"><?php esc_html_e( 'Advanced Settings', 'paid-memberships-pro' ); ?></h1>
<hr class="wp-header-end">
<h1 class="wp-heading-inline"><?php esc_html_e( 'Advanced Settings', 'paid-memberships-pro' ); ?></h1>
<div class="pmpro_admin_section pmpro_admin_section-restrict-dashboard">
<h2 class="title"><?php esc_html_e( 'Restrict Dashboard Access', 'paid-memberships-pro' ); ?></h2>
<table class="form-table">
Expand Down Expand Up @@ -261,7 +268,7 @@
<!-- For reference, removed the Yes - Free memberships only. option -->
<option value="2" <?php if( $recaptcha > 0 ) { ?>selected="selected"<?php } ?>><?php esc_html_e('Yes - All memberships.', 'paid-memberships-pro' );?></option>
</select>
<p class="description"><?php esc_html_e('A free reCAPTCHA key is required.', 'paid-memberships-pro' );?> <a href="https://www.google.com/recaptcha/admin/create"><?php esc_html_e('Click here to signup for reCAPTCHA', 'paid-memberships-pro' );?></a>.</p>
<p class="description"><?php esc_html_e('A free reCAPTCHA key is required.', 'paid-memberships-pro' );?> <a href="https://www.google.com/recaptcha/admin/create" target="_blank" rel="nofollow noopener"><?php esc_html_e('Click here to signup for reCAPTCHA', 'paid-memberships-pro' );?></a>.</p>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -364,7 +371,7 @@
//insert ad code here
}</pre>
</td>
</tr>
</tr>
<tr id="hideadslevels_tr" <?php if($hideads != 2) { ?>style="display: none;"<?php } ?>>
<th scope="row" valign="top">
<label for="hideadslevels"><?php esc_html_e('Choose Levels to Hide Ads From', 'paid-memberships-pro' );?>:</label>
Expand Down Expand Up @@ -413,7 +420,7 @@
</select>
</td>
</tr>
<?php } ?>
<?php } ?>
<?php
// Filter to Add More Advanced Settings for Misc Plugin Options, etc.
if (has_action('pmpro_custom_advanced_settings')) {
Expand All @@ -432,7 +439,7 @@
?>
<select id="<?php echo esc_attr( $field['field_name'] ); ?>"
name="<?php echo esc_attr( $field['field_name'] ); ?>">
<?php
<?php
//For associative arrays, we use the array keys as values. For numerically indexed arrays, we use the array values.
$is_associative = (bool)count(array_filter(array_keys($field['options']), 'is_string'));
foreach ($field['options'] as $key => $option) {
Expand All @@ -442,7 +449,7 @@
<?php echo esc_textarea($option); ?>
</option>
<?php
}
}
?>
</select>
<?php
Expand Down Expand Up @@ -483,8 +490,33 @@ class="large-text">
</tr>
<?php
}
}
}
?>
<tr>
<th scope="row" valign="top">
<label for="wisdom_opt_out">
<?php esc_html_e( 'Enable Tracking', 'paid-memberships-pro' ); ?>
</label>
</th>
<td>
<p>
<label>
<input name="wisdom_opt_out" type="radio" value="0"<?php checked( 0, $wisdom_opt_out ); ?> />
<?php esc_html_e( 'Allow usage of Paid Memberships Pro to be tracked.', 'paid-memberships-pro' );?>
</label>
</p>
<p>
<label>
<input name="wisdom_opt_out" type="radio" value="1"<?php checked( 1, $wisdom_opt_out ); ?> />
<?php esc_html_e( 'Do not track usage of Paid Memberships Pro on my site.', 'paid-memberships-pro' );?>
</label>
</p>
<p class="description">
<?php esc_html_e( 'Sharing non-sensitive membership site data helps us analyze how our plugin is meeting your needs and identify opportunities to improve. Read about what usage data is tracked:', 'paid-memberships-pro' ); ?>
<a href="https://www.paidmembershipspro.com/privacy-policy/usage-tracking/" title="<?php esc_attr_e( 'PaidMembershipsPro.com Usage Tracking', 'paid-memberships-pro' ); ?>" target="_blank" rel="nofollow noopener"><?php esc_html_e( 'Paid Memberships Pro Usage Tracking', 'paid-memberships-pro' ); ?></a>.
</p>
</td>
</tr>
<tr>
<th scope="row" valign="top">
<label for="uninstall"><?php esc_html_e('Uninstall PMPro on deletion?', 'paid-memberships-pro' );?></label>
Expand Down Expand Up @@ -537,7 +569,7 @@ function pmpro_updateRecaptchaTRs()
}
pmpro_updateRecaptchaTRs();
</script>
</div> <!-- end pmpro_admin_section-other-settings -->
</div> <!-- end pmpro_admin_section-other-settings -->
<p class="submit">
<input name="savesettings" type="submit" class="button button-primary" value="<?php esc_attr_e('Save Settings', 'paid-memberships-pro' );?>" />
</p>
Expand Down
Loading

0 comments on commit 99089e9

Please sign in to comment.