solution : edit file cookie-script.php and replace : line 418 to 449 .
replace that :
public function cookie_script_deactivation() {
wp_dequeue_script("cookie_script");
}
// Clean up DB after uninstalling plugin
public function cookie_script_uninstall() {
if (!current_user_can("activate_plugins")) {
return null;
}
delete_option("cookie_script_item_id");
delete_option("cookie_script_item_src");
delete_option("cookie_script_item_connection_type");
delete_option("cookie_script_location");
delete_option("cookie_script_location_in_element");
wp_dequeue_script("cookie_script");
wp_deregister_script("cookie_script");
}
}
new CookieScript();
// Make sure there is no cookie script in document while plugin is deactivated
register_deactivation_hook( __FILE__, array("CookieScript", "cookie_script_deactivation") );
// Clean up DB after uninstalling plugin
register_uninstall_hook( __FILE__, array("CookieScript", "cookie_script_uninstall") );
………………………………………………………………………
per that
public static function cookie_script_deactivation() {
wp_dequeue_script("cookie_script");
}
// Clean up DB after uninstalling plugin
public static function cookie_script_uninstall() {
if (!current_user_can("activate_plugins")) {
return null;
}
delete_option("cookie_script_item_id");
delete_option("cookie_script_item_src");
delete_option("cookie_script_item_connection_type");
delete_option("cookie_script_location");
delete_option("cookie_script_location_in_element");
wp_dequeue_script("cookie_script");
wp_deregister_script("cookie_script");
}
}
$new_instance = new CookieScript();
// Make sure there is no cookie script in document while plugin is deactivated
register_deactivation_hook( __FILE__, array($new_instance, "cookie_script_deactivation") );
// Clean up DB after uninstalling plugin
register_uninstall_hook( __FILE__, array($new_instance, "cookie_script_uninstall") );
and if you got a lot of php warning message like this : [29-Sep-2023 18:58:51 UTC] PHP Warning: Undefined variable $conn in /home/intellis/xxxxxxx.com/wp-content/plugins/cookie-script-com/cookie-script.php on line 395
edit file cookie-script.php line 378 to 394
and replace this
public function cookie_script_generate_url() {
$url = null;
switch ($this->item_connection_type) {
case 1:
$conn = "//cdn.";
break;
case 2:
$conn = "//eu.";
break;
case 3:
$conn = "//ca.";
break;
case 4:
$conn = "//ca-eu.";
break;
}
whit this
public function cookie_script_generate_url() {
$url = null;
$conn = "";
switch ($this->item_connection_type) {
case 1:
$conn = "//cdn.";
break;
case 2:
$conn = "//eu.";
break;
case 3:
$conn = "//ca.";
break;
case 4:
$conn = "//ca-eu.";
break;
default:
$conn = "";
break;
}
Thank you!! Thanks to the first code, I managed to deactivate the plugin, and thanks to the second one, I was able to delete it.