Activate SLP plugin on WP site.
The Store Locator Plus® menu is missing.
Research
Looks like current_user_can(‘manage_slp’) is not returning true in \SLP_Actions::init()
manage_slp cap is added by \SLP_Admin_Activation::update()
Looks like that method is not being called.
This logic is FUBAR… do not install main table or extended table or add roles and caps on a NEW install?!?!
/**
* Update the plugin.
*/
public function update() {
if ( $this->being_deactivated() ) {
return;
}
// -- Update prior installation data
if ( ! empty( $this->slplus->installed_version ?? '' ) ) {
// Not multisite
if ( ! is_multisite() ) {
$this->copyr( SLPLUS_UPLOADDIR . 'css', SLPLUS_PLUGINDIR . 'css' );
$Upgrade = SLP_Admin_Upgrade::get_instance();
$Upgrade->migrate_settings();
} else {
$this->multisite_upgrade_options();
}
// Update Tables, Setup Roles
$this->install_main_table();
$this->install_ExtendedDataTables();
$this->add_slplus_roles_and_caps();
if ( ! defined( 'MYSLP_VERSION' ) ) {
$this->check_for_addon_updates();
}
// -- Fresh install
} else {
/* @var SLP_WPOption_Manager $optionManager */
$optionManager = SLP_WPOption_Manager::get_instance();
$optionManager->update_wp_option( 'nojs' );
$optionManager->update_wp_option( 'js' );
}
update_option( SLPLUS_PREFIX . '-installed_base_version', SLPLUS_VERSION );
}
Development
Updated the update method noted above:
/**
* Update the plugin.
*/
public function update() {
if ( $this->being_deactivated() ) {
return;
}
// Update Tables, Setup Roles
$this->install_main_table();
$this->install_ExtendedDataTables();
$this->add_slplus_roles_and_caps();
// -- Update prior installation data
if ( ! empty( $this->slplus->installed_version ?? '' ) ) {
// Not multisite
if ( ! is_multisite() ) {
$this->copyr( SLPLUS_UPLOADDIR . 'css', SLPLUS_PLUGINDIR . 'css' );
$Upgrade = SLP_Admin_Upgrade::get_instance();
$Upgrade->migrate_settings();
} else {
$this->multisite_upgrade_options();
}
// -- Fresh install
} else {
/* @var SLP_WPOption_Manager $optionManager */
$optionManager = SLP_WPOption_Manager::get_instance();
$optionManager->update_wp_option( 'nojs' );
$optionManager->update_wp_option( 'js' );
}
update_option( SLPLUS_PREFIX . '-installed_base_version', SLPLUS_VERSION );
if ( ! defined( 'MYSLP_VERSION' ) ) {
$this->check_for_addon_updates();
}
}