get_ocean_extra_status();
$actions_html = '';
if ( $status['status'] == 'installed' ) {
$actions_html = '
';
} elseif ( $status['status'] == 'uninstalled' ) {
$actions_html = '
';
}
wp_send_json_success(
$actions_html
);
}
);
add_action(
'wp_ajax_oceanwp_notice_button_click',
function () {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
$manager = new Oceanwp_Plugin_Manager();
$status = $manager->get_ocean_extra_status();
if ( $status['status'] === 'active' ) {
wp_send_json_success(
array(
'status' => 'active',
'pluginUrl' => admin_url( 'admin.php?page=oceanwp' ),
)
);
}
if ( $status['status'] === 'uninstalled' ) {
$manager->download_and_install( $status['slug'] );
$manager->plugin_activation( $status['slug'] );
wp_send_json_success(
array(
'status' => 'active',
'pluginUrl' => admin_url( 'admin.php?page=oceanwp' ),
)
);
}
if ( $status['status'] === 'installed' ) {
$manager->plugin_activation( $status['slug'] );
wp_send_json_success(
array(
'status' => 'active',
'pluginUrl' => admin_url( 'admin.php?page=oceanwp' ),
)
);
}
wp_die();
}
);