diff --git a/classes/class-pmpro-admin-activity-email.php b/classes/class-pmpro-admin-activity-email.php index 969bf849d5..026d737a8b 100644 --- a/classes/class-pmpro-admin-activity-email.php +++ b/classes/class-pmpro-admin-activity-email.php @@ -233,7 +233,7 @@ public function sendAdminActivity( $frequency = '', $recipient = null ) { __( 'No Discount Codes were used %2$s.', 'paid-memberships-pro' ), 'style="color:#1A688B;" target="_blank" href="' . esc_url( admin_url( 'admin.php?page=pmpro-discountcodes' ) ) . '"', esc_html( $term ) - ), + ) ); ?>

diff --git a/css/frontend/base.css b/css/frontend/base.css index 3482fc922f..e1728944e5 100644 --- a/css/frontend/base.css +++ b/css/frontend/base.css @@ -88,6 +88,15 @@ color: var(--pmpro--color--alert-link); } +.pmpro_message p { + margin: 0 0 var(--pmpro--base--spacing--small); + padding: 0; +} + +.pmpro_message p:last-of-type { + margin-bottom: 0; +} + /** * Form Elements */ diff --git a/images/add-ons/pmpro-limit-logins.png b/images/add-ons/pmpro-limit-logins.png new file mode 100644 index 0000000000..f50303b3f2 Binary files /dev/null and b/images/add-ons/pmpro-limit-logins.png differ diff --git a/images/add-ons/wp-bouncer.png b/images/add-ons/wp-bouncer.png deleted file mode 100644 index 03e54e59d3..0000000000 Binary files a/images/add-ons/wp-bouncer.png and /dev/null differ diff --git a/includes/addons.php b/includes/addons.php index cee5140d70..c5ff16f3bd 100644 --- a/includes/addons.php +++ b/includes/addons.php @@ -50,11 +50,19 @@ function pmpro_getAddons() { // error pmpro_setMessage( 'Could not connect to the PMPro License Server to update addon information. Try again later.', 'error' ); } elseif ( ! empty( $remote_addons ) && $remote_addons['response']['code'] == 200 ) { - // update addons in cache + // Update addons in cache. $addons = json_decode( wp_remote_retrieve_body( $remote_addons ), true ); + + // If we don't have any addons, bail. + if ( empty( $addons ) ) { + return array(); + } + + // Create a short name for each Add On. foreach ( $addons as $key => $value ) { $addons[$key]['ShortName'] = trim( str_replace( array( 'Add On', 'Paid Memberships Pro - ' ), '', $addons[$key]['Title'] ) ); } + // Alphabetize the list by ShortName. $short_names = array_column( $addons, 'ShortName' ); array_multisort( $short_names, SORT_ASC, SORT_STRING | SORT_FLAG_CASE, $addons ); diff --git a/includes/adminpages.php b/includes/adminpages.php index dd9cd130e4..328723875f 100644 --- a/includes/adminpages.php +++ b/includes/adminpages.php @@ -704,6 +704,10 @@ function pmpro_add_action_links( $links ) { } } + if ( empty( $top_menu_page ) ) { + return $links; + } + $new_links = array( 'Settings', ); diff --git a/includes/login.php b/includes/login.php index f6b0a83ba4..507c738cc2 100644 --- a/includes/login.php +++ b/includes/login.php @@ -525,8 +525,8 @@ function pmpro_login_forms_handler( $show_menu = true, $show_logout_link = true,
0) { - var activateButton = primaryButtons[0]; - var activateButtonHref = activateButton.getAttribute('href'); - if (activateButtonHref) { + + // Loop through the buttons to find the activate button. + for (var i = 0; i < primaryButtons.length; i++) { + // If there is a href element beginning with plugins.php?action=activate&plugin=[plugin_slug], then it is very likely the activate button. + if ( primaryButtons[i].getAttribute('href') && primaryButtons[i].getAttribute('href').indexOf('plugins.php?action=activate&plugin=') > -1 ) { // Wait 1 second before showing the activate button. setTimeout(function () { button.siblings('input[name="pmproAddOnAdminAction"]').val('activate'); - button.siblings('input[name="pmproAddOnAdminActionUrl"]').val(activateButtonHref); + button.siblings('input[name="pmproAddOnAdminActionUrl"]').val( primaryButtons[i].getAttribute('href') ); button.html('Activate'); button.removeClass('disabled'); }, 1000); + break; } } }