window.adminInstallActivate = {
    activatePlugin: function (element) {
         let request= {
            action: 'activate_w2pshop_plugin',
            pluginName: jQuery(element).data('plugin-name'),
             security: w2pshop_data[1]
        };
         W2PShopCommon.send_ajax_request(w2pshop_data[0], request, '',
            function (response) {
                if (response.success && response.data.redirect) {
                    window.location.href = response.data.redirect;
                } else {
                    console.error('AJAX failed or no redirect');
                }
            }
        );
    },
};
jQuery(document).ready(function (){
    jQuery(document).on('click', '.w2pshop-activate-button', function () {
        adminInstallActivate.activatePlugin(this);
    });
})