Skip to content

Commit d9b5e36

Browse files
committed
Updated installation paths
1 parent f754f87 commit d9b5e36

File tree

2 files changed

+5
-33
lines changed

2 files changed

+5
-33
lines changed

ajax-load-more-for-users.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,15 @@
3232
* Installation hook.
3333
*/
3434
function alm_users_extension_install() {
35-
// Users add-on is installed.
35+
// Users "add-on" is installed, deactivate it.
3636
if ( is_plugin_active( 'ajax-load-more-users/ajax-load-more-users.php' ) ) {
37-
// Deactivate the add-on.
3837
deactivate_plugins( 'ajax-load-more-users/ajax-load-more-users.php' );
3938
}
4039

4140
// ALM Pro add-on is installed and Users is activated.
4241
if ( is_plugin_active( 'ajax-load-more-pro/ajax-load-more-pro.php' ) && class_exists( 'ALMUsers' ) ) {
4342
set_transient( 'alm_users_extension_pro_admin_notice', true, 5 );
4443
}
45-
46-
// Confirm core Ajax Load More is installed.
47-
if ( ! is_plugin_active( 'ajax-load-more/ajax-load-more.php' ) ) {
48-
set_transient( 'alm_users_extension_admin_notice', true, 5 );
49-
}
5044
}
5145
register_activation_hook( __FILE__, 'alm_users_extension_install' );
5246

functions/install.php

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,15 @@
99
* Display admin notice Users add-on is installed.
1010
*/
1111
function alm_users_extension_pro_admin_notice() {
12-
$slug = 'ajax-load-more';
13-
$plugin = $slug . '-for-users';
1412
// Ajax Load More Notice.
1513
if ( get_transient( 'alm_users_extension_pro_admin_notice' ) ) {
16-
$install_url = get_admin_url() . '/update.php?action=install-plugin&plugin=' . $slug . '&_wpnonce=' . wp_create_nonce( 'install-plugin_' . $slug );
17-
$message = '<div class="error">';
18-
$message .= '<p>You must deactivate the Users add-on in Ajax Load More Pro or update the Pro add-on before installing the Users extension.</p>';
19-
$message .= '<p><a href="./plugins.php">Back to Plugins</a></p>';
20-
$message .= '</div>';
14+
$message = '<div class="error">';
15+
$message .= '<p>You must deactivate the Users add-on in Ajax Load More Pro or update the Pro add-on before installing the Users extension.</p>';
16+
$message .= '<p><a href="./plugins.php">Back to Plugins</a></p>';
17+
$message .= '</div>';
2118
echo wp_kses_post( $message );
2219
delete_transient( 'alm_users_extension_pro_admin_notice' );
2320
wp_die();
2421
}
2522
}
2623
add_action( 'admin_notices', 'alm_users_extension_pro_admin_notice' );
27-
28-
/**
29-
* Display admin notice if plugin does not meet the requirements.
30-
*/
31-
function alm_users_extension_admin_notice() {
32-
$slug = 'ajax-load-more';
33-
$plugin = $slug . '-for-users';
34-
// Ajax Load More Notice.
35-
if ( get_transient( 'alm_users_extension_admin_notice' ) ) {
36-
$install_url = get_admin_url() . '/update.php?action=install-plugin&plugin=' . $slug . '&_wpnonce=' . wp_create_nonce( 'install-plugin_' . $slug );
37-
$message = '<div class="error">';
38-
$message .= '<p>You must install and activate the core Ajax Load More plugin before using the Ajax Load More Users extension.</p>';
39-
$message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, 'Install Ajax Load More Now' ) . '</p>';
40-
$message .= '</div>';
41-
echo wp_kses_post( $message );
42-
delete_transient( 'alm_users_extension_admin_notice' );
43-
}
44-
}
45-
add_action( 'admin_notices', 'alm_users_extension_admin_notice' );

0 commit comments

Comments
 (0)