• Resolved imarkdesigns

    (@imarkdesigns)


    I download this plugin before, but never experience this kind of issue. whenever I try to activate different version it return this error:

    PHP message: PHP Fatal error: Uncaught Error: Undefined constant “NONCE_KEY” in /www/262/public/wp-content/plugins/ip-location-block/classes/class-ip-location-block-logs.php:152

    Stack trace:

    #0 /www/262/public/wp-content/plugins/ip-location-block/classes/class-ip-location-block-logs.php(1383): IP_Location_Block_Logs::cipher_mode_key()

    #1 /www/262/public/wp-content/plugins/ip-location-block/classes/class-ip-location-block-actv.php(36): IP_Location_Block_Logs::delete_cache_entry()

    #2 /www/262/public/wp-content/plugins/ip-location-block/classes/class-ip-location-block-actv.php(54): IP_Location_Block_Activate::activate_blog()

    #3 /www/262/public/wp-content/plugins/ip-location-block/ip-location-block.php(57): IP_Location_Block_Activate::activate(false)

    #4 /www/262/public/wp-includes/class-wp-hook.php(324): ip_location_block_activate(false)

    #5 /www/262/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array)

    #6 /ww” while reading response header from upstream, client: 136.158.11.35, server: domain.com, request: “GET /wp-admin/plugins.php?action=activate&plugin=ip-location-block%2Fip-location-block.php&plugin_status=all&paged=1&s&_wpnonce=db55be6efc HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php8.2-fpm-domain.sock:”, host: “domain.com:58243”, referrer: “https://domain.com/wp-admin/plugins.php”

    • This topic was modified 9 months, 3 weeks ago by imarkdesigns.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Darko G.

    (@darkog)

    Hey @imarkdesigns,

    You most likely don’t have NONCE_KEY defined in your wp-config.php file.

    Can you please confirm this? Open your wp-config.php file and check if you see the following lines. Notice the NONCE_KEY line in the middle.

    define('AUTH_KEY',        '...');
    define('SECURE_AUTH_KEY',  '...');
    define('LOGGED_IN_KEY',    '...');
    define('NONCE_KEY',        '...');
    define('AUTH_SALT',        '...');
    define('SECURE_AUTH_SALT', '...');
    define('LOGGED_IN_SALT',   '...');
    define('NONCE_SALT',       '...');

    It’s important for your site’s security to have those keys all set up there. If you are missing any of those please re-generate them here and add those to your wp-config.php

    https://api.www.ads-software.com/secret-key/1.1/salt/

    Best Regards,
    Darko

    Thread Starter imarkdesigns

    (@imarkdesigns)

    I see… It looks like Sucuri is the one who’s handling the secret keys. Ok, thanks for the hint and I have the idea where to begin. Thanks for this!

    @darkog

    Same issue here, getting the fatal error when trying to access the WordPress login page:

    Fatal error: Uncaught Error: Undefined constant “NONCE_KEY” in /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block-logs.php:152

    Stack trace:

    #0 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block-logs.php(1252): IP_Location_Block_Logs::cipher_mode_key()

    #1 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block-apis.php(703): IP_Location_Block_Logs::search_cache(‘xxx.xxx.xxx.xx’)

    #2 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block-apis.php(716): IP_Location_Block_API_Cache::get_cache(‘xxx.xxx.xxx.xx’)

    #3 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block.php(498): IP_Location_Block_API_Cache->get_location(‘xxx.xxx.xxx.xx’, Array)

    #4 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block.php(809): IP_Location_Block::_get_geolocation(‘xxx.xxx.xxx.xx’, Array, Array, Array)

    #5 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block.php(938): IP_Location_Block->validate_ip(‘login’, Array, true)

    #6 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block-load.php(159): IP_Location_Block->validate_login(1)

    #7 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block.php(48): IP_Location_Block_Loader->run()

    #8 /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block.php(212): IP_Location_Block->__construct()

    #9 /home/httpd/vhosts/domain.tld/httpdocs/wp-includes/class-wp-hook.php(324): IP_Location_Block::get_instance(”)

    #10 /home/httpd/vhosts/domain.tld/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)

    #11 /home/httpd/vhosts/domain.tld/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #12 /home/httpd/vhosts/domain.tld/httpdocs/wp-settings.php(550): do_action(‘plugins_loaded’)

    #13 /home/httpd/vhosts/domain.tld/httpdocs/wp-config.php(118): require_once(‘/home/httpd/vho…’)

    #14 /home/httpd/vhosts/domain.tld/httpdocs/wp-load.php(50): require_once(‘/home/httpd/vho…’)

    #15 /home/httpd/vhosts/domain.tld/httpdocs/wp-login.php(12): require(‘/home/httpd/vho…’)

    #16 {main} thrown in /home/httpd/vhosts/domain.tld/httpdocs/wp-content/plugins/ip-location-block/classes/class-ip-location-block-logs.php on line 152

    The keys exist in wp-config.php. Generating new keys through the API didn’t help.

    The link sent by email to access WordPress in recovery mode throws the same error with almost the stack trace details.

    There are no errors in the server log.

    How can I solve this?

    Plugin Author Darko G.

    (@darkog)

    Hey @sankari ,

    If the above didn’t helped, it may be a conflict with a security plugin. Do you use any security plugin?

    Thanks.

    Hello @darkog ,

    Thank you for your fast response.

    Yes, the website uses the Wordfence plugin.

    By deactivating it, the login page became accessible in recovery mode but after entering the credentials and hitting the log-in button the page just refreshed without any notice. By accessing it in regular mode in a private browser window it still showed the same PHP error.

    It turned out that the cause was somewhere else: The WordPress Address (URL) and Site Address (URL) where missing in wp-config.php!

    define('WP_HOME','https://www.domain.tld');
    define('WP_SITEURL','https://www.domain.tld');

    Adding them solved the issue.

    Thanks again for your support.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin could not be activated because it triggered a fatal error’ is closed to new replies.