Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…hips-pro into v3.4
  • Loading branch information
dparker1005 committed Jan 21, 2025
2 parents 96a0aae + e931022 commit 78236a3
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion classes/class-pmpro-admin-activity-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function sendAdminActivity( $frequency = '', $recipient = null ) {
__( 'No <a %1$s>Discount Codes</a> 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 )
),
)
);
?>
</p>
Expand Down
9 changes: 9 additions & 0 deletions css/frontend/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Binary file added images/add-ons/pmpro-limit-logins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/add-ons/wp-bouncer.png
Binary file not shown.
10 changes: 9 additions & 1 deletion includes/addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
4 changes: 4 additions & 0 deletions includes/adminpages.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,10 @@ function pmpro_add_action_links( $links ) {
}
}

if ( empty( $top_menu_page ) ) {
return $links;
}

$new_links = array(
'<a href="' . admin_url( 'admin.php?page=' . $top_menu_page ) . '">Settings</a>',
);
Expand Down
4 changes: 2 additions & 2 deletions includes/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ function pmpro_login_forms_handler( $show_menu = true, $show_logout_link = true,

<?php
}
} elseif ( $location !== 'widget' && ( $action === 'reset_pass' || ( $action === 'rp' && in_array( $_REQUEST['login'], array( 'invalidkey', 'expiredkey' ) ) ) ) ) {
// Reset password form.
} elseif ( $location !== 'widget' && ( $action === 'reset_pass' || ( $action === 'rp' && isset( $_REQUEST['error'] ) && in_array( $_REQUEST['error'], array( 'invalidkey', 'expiredkey' ) ) ) ) ) {
// Reset password form.
?>
<div class="<?php echo esc_attr( pmpro_get_element_class( 'pmpro_card pmpro_lost_password_wrap', 'pmpro_lost_password_wrap' ) ); ?>">
<?php
Expand Down
13 changes: 8 additions & 5 deletions js/pmpro-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,18 +837,21 @@ jQuery(document).ready(function () {
// If user just installed, give them the option to activate.
// TODO: Also give option to activate after update, but this is harder.
if ('install' === action) {
// Find the buttons that could be the activate button.
var primaryButtons = responseElement.find('.button-primary');
if (primaryButtons.length > 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;
}
}
}
Expand Down

0 comments on commit 78236a3

Please sign in to comment.