• Resolved willemb2

    (@willemb2)


    I can deactivate the plugin, but when I try to delete it I get this line above the plugins page:

    Deletion failed: There has been a critical error on this website.Learn more about troubleshooting WordPress.

    The site keeps working though and I don’t see anything in the logs related to this plugin. WP 6.4.3, PHP 8.1 on Litespeed and Plesk.

    Can I just delete sg-security folder in wp-content/plugins/ ? Or does it leave entries in the database or other modifications?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Plamen M

    (@plamenm)

    Hello @willemb2,

    The plugin also adds entries to the database. The issue is most probably caused by some local security policy in your site, which prevents the deletion. Check if you have any rules, related to file writing in your wp-config.php file, like:

    define( 'DISALLOW_FILE_EDIT', true );
    define( 'DISALLOW_FILE_MODS', true )

    Also, if you have any other security plugin, its settings might be preventing the deletion process. Try disabling the other plugin temporarily.

    If the issue persists, open the debug console in your browser and monitor for any errors or warnings there while recreating the issue.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Thread Starter willemb2

    (@willemb2)

    Hello @plamenm,

    I have no problem deleting other plugins. In fact there were 2 others by Siteground: Speed Optimizer and ….. This site was moved from Siteground to another hosting about a month ago.

    Those rules are not present in wp-config.php. But I noticed something else. Could this be related:

    /** Sets up WordPress vars and included files. */
    @include_once('/var/lib/sec/wp-settings-pre.php'); // Added by SiteGround WordPress management system
    require_once ABSPATH . 'wp-settings.php';
    @include_once('/var/lib/sec/wp-settings.php'); // Added by SiteGround WordPress management system

    In all my other 6 sites wp-settings.php is in the same folder as wp-config.php and none of them has a wp-settings-pre.php

    Thread Starter willemb2

    (@willemb2)

    Hello @plamenm,

    Here’s the wp-debug.log:

    [22-Feb-2024 21:52:23 UTC] PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #1 ($key) must be a valid array offset type in /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/vendor/siteground/siteground-data/src/Settings.php:352
    Stack trace: 0 /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/vendor/siteground/siteground-data/src/Settings.php(352): array_key_exists(Array, Array) 1 /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/vendor/siteground/siteground-data/src/Settings.php(292): SiteGround_Data\Settings->get_hosting_provider() 2 /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/vendor/siteground/siteground-data/src/Settings.php(213): SiteGround_Data\Settings->get_main_data() 3 /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/vendor/siteground/siteground-data/src/Settings.php(139): SiteGround_Data\Settings->prepare_data() 4 /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/vendor/siteground/siteground-data/src/Settings.php(126): SiteGround_Data\Settings->send_data() 5 /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/uninstall.php(49): SiteGround_Data\Settings->stop_collecting_data() 6 /var/www/vhosts/domain.tld/httpdocs/wp-admin/includes/plugin.php(1245): include_once('/var/www/vhosts…') 7 /var/www/vhosts/domain.tld/httpdocs/wp-admin/includes/plugin.php(960): uninstall_plugin('sg-security/sg-…') 8 /var/www/vhosts/domain.tld/httpdocs/wp-admin/includes/ajax-actions.php(4748): delete_plugins(Array) 9 /var/www/vhosts/domain.tld/httpdocs/wp-includes/class-wp-hook.php(324): wp_ajax_delete_plugin('') 10 /var/www/vhosts/domain.tld/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) 11 /var/www/vhosts/domain.tld/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) 12 /var/www/vhosts/domain.tld/httpdocs/wp-admin/admin-ajax.php(188): do_action('wp_ajax_delete-…') 13 {main}
    thrown in /var/www/vhosts/domain.tld/httpdocs/wp-content/plugins/sg-security/vendor/siteground/siteground-data/src/Settings.php on line 352

    • This reply was modified 9 months ago by willemb2.
    Plugin Support Plamen M

    (@plamenm)

    Since your site is on a different host, you should remove the includes commented as “Added by SiteGround WordPress management system”.

    The debug results show that something is preventing our plugin from executing the Ajax Delete action. What I could suggest here is:

    1. Deactivate the plugin
    2. rename the plugin’s folder : wp-content/plugins/sg-security
    3. Clear the cache in your site and check if everything is functioning properly. Then you can delete the plugin’s folder also.

    Regards,
    Plamen.M
    Tech Support Team
    SiteGround.com

    Thread Starter willemb2

    (@willemb2)

    Thank you, @plamenm. That worked.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘cannot delete plugin’ is closed to new replies.