Troubleshooting Common Sucuri Security Plugin Connection and API Errors
Content
Many WordPress administrators rely on the Sucuri Security – Auditing, Malware Scanner and Security Hardening plugin for its robust security features. However, a frequent category of issues users encounter involves connectivity problems and API communication errors. These often manifest as cryptic messages in the WordPress dashboard, such as "Failed to connect," "SSL certificate problem," or "Something went wrong with an API call." This guide will help you understand why these errors occur and walk you through the most common solutions.
Why Do These Connection Errors Happen?
These errors typically stem from a failure in the communication channel between your WordPress website and Sucuri's external API servers (wordpress.sucuri.net). The plugin uses this connection to send security event logs, perform remote malware scans, and check for updates. Several factors can disrupt this link:
- Server Configuration: Your web host's PHP configuration or firewall might be blocking outgoing connections to Sucuri's servers.
- SSL Certificate Verification: The plugin, by default, verifies the SSL certificates of the servers it talks to. Occasionally, an expired certificate on Sucuri's end (as seen in Threads 8 and 14) or a misconfiguration on your server's end can cause a handshake failure.
- DNS Issues: Temporary DNS problems, either on your server or during updates on Sucuri's infrastructure (Thread 18), can prevent your site from resolving the hostname
wordpress.sucuri.net. - Timeouts: If your server is slow to respond, the Sucuri scanner might timeout before it can complete a scan, reporting a failure (Thread 1).
Common Solutions to Try
1. Change the API Request Handler and SSL Settings
This is often the most effective fix. Within your WordPress dashboard, navigate to Sucuri Security → Settings → API Service. Here, you can modify two key options:
- API Request Handler: Switch from the default value to "socket". This changes how the plugin makes its external connections and can bypass certain configuration issues.
- API Request with SSL: If you are seeing SSL-related errors (e.g., "SSL certificate problem" or "SSL3_READ_BYTES"), try changing this option to "Stop peer's cert verification". This instructs the plugin to connect even if it encounters an SSL certificate verification error. Note: This is generally safe for the purposes of this plugin's communication.
These changes have resolved connection issues for many users, as indicated in Threads 9 and 17.
2. Check for a Missing API Constant
After an update, some users received a critical error: Uncaught Error: Undefined constant “SUCURISCAN_API_URL”. This error suggests a necessary configuration value is missing. The solution is to manually define this constant in your wp-config.php file.
Add the following line to your wp-config.php file, above the line that says /* That's all, stop editing! Happy publishing. */:
define('SUCURISCAN_API_URL','https://waf.sucuri.net/api?k=[APIkey]&s=[domain_secret]');
You can find your unique API key and domain secret key on the Sucuri Security plugin's dashboard page in WordPress. This solution was confirmed by users in Thread 3.
3. Temporarily Disable for Troubleshooting
If you are performing a specific task like importing a large XML file (Thread 19) and suspect the plugin might be interfering, the simplest solution is to temporarily deactivate it. This will help you rule out the plugin as the source of the problem. Remember to reactivate it once your task is complete to maintain your site's security.
4. Understand What the Plugin Does Not Control
It's important to distinguish between errors from the free Sucuri WordPress plugin and actions taken by the separate, paid Sucuri Firewall service. For example:
- Cache Clearing: The "Clear Cache" button in the free plugin only works if you have a paid Sucuri Firewall plan and have connected your API key. The free plugin itself does not cache your site (Thread 7).
- Firewall Blocks: If you see a block message referencing a specific Block ID (e.g.,
BAK024from Thread 11), this is an action performed by the Sucuri Firewall (a WAF). You would need to adjust your block/allow lists within your Sucuri Firewall account settings; uninstalling the WordPress plugin will not resolve this.
When All Else Fails
If none of the above solutions work, the issue might be related to your hosting environment. Contact your hosting provider and ask them to check for:
- Firewall rules blocking outgoing connections to
wordpress.sucuri.neton ports 80 and 443. - Any restrictions on the PHP functions
fsockopen()orcurl_init(). - General server connectivity issues or DNS problems.
By methodically working through these potential causes and solutions, you can likely resolve the connection errors and restore full functionality to your Sucuri Security plugin.
Related Support Threads Support
-
Security Scans not workinghttps://wordpress.org/support/topic/security-scans-not-working/
-
SSL certificate problem: certificate has expiredhttps://wordpress.org/support/topic/ssl-certificate-problem-certificate-has-expired/
-
Is Sucuri blocking importing of xml backuphttps://wordpress.org/support/topic/is-sucuri-blocking-importing-of-xml-backup/
-
Eror conflict with media libraryhttps://wordpress.org/support/topic/eror-conflict-with-media-library/
-
folder uploads/*protectedhttps://wordpress.org/support/topic/folder-uploadsprotected/
-
Sucuri Error Message vs Upload Issueshttps://wordpress.org/support/topic/sucuri-error-message-vs-upload-issues/
-
Photo's Forbiddenhttps://wordpress.org/support/topic/photos-forbidden/
-
Sucuri Website Firewall – Not Configuredhttps://wordpress.org/support/topic/sucuri-website-firewall-not-configured-2/
-
edited styles are applyhttps://wordpress.org/support/topic/edited-styles-are-apply/
-
Sucuri Tokens Break WooCommerce Square Connectionhttps://wordpress.org/support/topic/sucuri-tokens-break-woocommerce-square-connection/
-
Can't update or cancell other pluginshttps://wordpress.org/support/topic/cant-update-or-cancell-other-plugins/
-
Sucuri Acting like CDNhttps://wordpress.org/support/topic/sucuri-acting-like-cdn/
-
redirect errorhttps://wordpress.org/support/topic/redirect-error-17/
-
Couldn't resolve host wordpress.sucuri.nethttps://wordpress.org/support/topic/couldnt-resolve-host-wordpresssucurinet/
-
Sucuri Security Failedhttps://wordpress.org/support/topic/sucuri-security-failed/
-
Sucuri interferes with OneSignal pluginhttps://wordpress.org/support/topic/sucuri-interferes-with-onesignal-plugin/
-
"The certificate of the site is not trusted"https://wordpress.org/support/topic/the-certificate-of-the-site-is-not-trusted/
-
returns bluehost instead of hostgatorhttps://wordpress.org/support/topic/returns-bluehost-instead-of-hostgator/
-
Is Sucuri compatible with WooCommercehttps://wordpress.org/support/topic/is-sucuri-compatible-with-woocommerce/
-
Sucuri Website Firewall – Not Configuredhttps://wordpress.org/support/topic/sucuri-website-firewall-not-configured/
-
SUCURI: Only 1 out of 21 files were processed.https://wordpress.org/support/topic/sucuri-only-1-out-of-21-files-were-processed/
-
Sucuri Securityhttps://wordpress.org/support/topic/sucuri-security/
-
Problem with RSS after installing Sucurihttps://wordpress.org/support/topic/problem-with-rss-after-installing-sucuri/
-
Sucuri preventing BackupGuard downloadshttps://wordpress.org/support/topic/sucuri-preventing-backupguard-downloads/
-
Unable to save Avada theme webpage due to sucuri plugin errorshttps://wordpress.org/support/topic/unable-to-save-avada-theme-webpage-due-to-sucuri-plugin-errors/
-
Sucuri: Something went wrong with an API callhttps://wordpress.org/support/topic/sucuri-something-went-wrong-with-an-api-call-1/
-
You do not have sufficient permissions to access this admin pagehttps://wordpress.org/support/topic/you-do-not-have-sufficient-permissions-to-access-this-admin-page-5/
-
WordPress Nonce verification failedhttps://wordpress.org/support/topic/wordpress-nonce-verification-failed/
-
HTTPS content loadhttps://wordpress.org/support/topic/https-content-load/
-
How to Clear Cache on free version of Sucurihttps://wordpress.org/support/topic/how-to-clear-cache-on-free-version-of-sucuri/
-
Conflict With GoDaddy “Hi Jetpack, All Ready To Go!”https://wordpress.org/support/topic/conflict-with-godaddy-hi-jetpack-all-ready-to-go/
-
Sucuri not working properly on CloudAccess.nethttps://wordpress.org/support/topic/sucuri-not-working-properly-on-cloudaccessnet/
-
Image Upload fails after Sucuri Installhttps://wordpress.org/support/topic/image-upload-fails-after-sucuri-install/
-
Cron Job Stopped Workinghttps://wordpress.org/support/topic/cron-job-stopped-working-2/
-
Live Braodcasting plugin stopped workinghttps://wordpress.org/support/topic/live-braodcasting-plugin-stopped-working/
-
SUCURI plugin NOT closed – fix imminenthttps://wordpress.org/support/topic/sucuri-plugin-closed-as-of-20-march-2024/
-
An error occurred while updating Sucuri Security… Could not create directory.https://wordpress.org/support/topic/an-error-occurred-while-updating-sucuri-security-could-not-create-directory/
-
error Sucuri Securityhttps://wordpress.org/support/topic/error-sucuri-security/
-
Abandoned plugin? Has not been updated in more than 6 monthshttps://wordpress.org/support/topic/abandoned-plugin-has-not-been-updated-in-more-than-6-months-2/
-
Uncaught Error: Undefined constant “SUCURISCAN_API_URL”https://wordpress.org/support/topic/uncaught-error-undefined-constant-sucuriscan_api_url/
-
admin-ajax 403https://wordpress.org/support/topic/admin-ajax-403/
-
Sucuri Securityhttps://wordpress.org/support/topic/sucuri-security-1/
-
The plugin has been abandoned?https://wordpress.org/support/topic/the-plugin-has-been-abandoned/
-
Sucuri error message when I save pagehttps://wordpress.org/support/topic/sucuri-error-message-when-i-save-page/
-
Sucuri: (1456953427) Send_log: couldn't connect to hosthttps://wordpress.org/support/topic/sucuri-1456953427-send_log-couldnt-connect-to-host/
-
Plugin not updatinghttps://wordpress.org/support/topic/plugin-not-updating-4/
-
Upload SVG files – http errorhttps://wordpress.org/support/topic/upload-svg-files-http-error/
-
Sucuri, Wordfence & GOTMLS Compatibility Issues: Scan 503 Errorhttps://wordpress.org/support/topic/sucuri-wordfence-gotmls-compatibility-issues-scan-503-error/
-
Godaddy SSL Certificatehttps://wordpress.org/support/topic/godaddy-ssl-certificate/
-
Cannot Remove The Notice To Update APIhttps://wordpress.org/support/topic/cannot-remove-the-notice-to-update-api/
-
Failed to connect to wordpress.sucuri.net porthttps://wordpress.org/support/topic/failed-to-connect-to-wordpresssucurinet-port/
-
Sucuri stops posts updatinghttps://wordpress.org/support/topic/sucuri-stops-posts-updating/