10% sucuri-scanner

Code Review | Sucuri Security - Auditing, Malware Scanner and Security Hardening

WordPress plugin Sucuri Security - Auditing, Malware Scanner and Security Hardening scored 10% from 54 tests.

About plugin

  • Plugin page: sucuri-scanner
  • Plugin version: 1.8.39
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.2
  • WordPress version: 6.3.1
  • First release: Nov 18, 2011
  • Latest release: Apr 13, 2023
  • Number of updates: 640
  • Update frequency: every 6.5 days
  • Top authors: yorman (71.88%)dd@sucuri.net (13.44%)dremeda (5.47%)akresic (3.28%)unifiedexp (2.34%)

Code review

54 tests

User reviews

382 reviews

Install metrics

900,000+ active / 15,774,881 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/sucuri-scanner/src/option.lib.php+225
    file_put_contents(wp-content/uploads/sucuri/sucuri-settings.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲1.14MB] [CPU: ▼10.80ms] 75% from 4 tests

This is a short check of server-side resources used by Sucuri Security - Auditing, Malware Scanner and Security Hardening
Please fix the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,054.88ms on /wp-admin/admin.php?page=sucuriscan_lastlogins)
PageMemory (MB)CPU Time (ms)
Home /5.32 ▲1.8648.81 ▲9.46
Dashboard /wp-admin5.16 ▲1.8653.00 ▲3.60
Posts /wp-admin/edit.php5.21 ▲1.8554.40 ▲3.06
Add New Post /wp-admin/post-new.php4.95 ▼0.9447.80 ▼59.31
Media Library /wp-admin/upload.php5.02 ▲1.7949.59 ▲13.10
Firewall (WAF) /wp-admin/admin.php?page=sucuriscan_firewall5.0946.87
Dashboard /wp-admin/admin.php?page=sucuriscan5.0646.29
Settings /wp-admin/admin.php?page=sucuriscan_settings5.98123.79
Last Logins /wp-admin/admin.php?page=sucuriscan_lastlogins5.111,054.88

Server storage [IO: ▲2.34MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 173 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Sucuri Security - Auditing, Malware Scanner and Security Hardening: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11813.19 ▼1.212.33 ▲0.3438.70 ▼2.28
Dashboard /wp-admin2,258 ▲705.87 ▲0.9899.50 ▼4.8539.86 ▼3.79
Posts /wp-admin/edit.php2,144 ▲522.04 ▼0.0035.77 ▼4.0734.03 ▼1.72
Add New Post /wp-admin/post-new.php1,546 ▲3223.45 ▲5.95590.16 ▼104.3648.20 ▼9.26
Media Library /wp-admin/upload.php1,441 ▲534.23 ▼0.06102.25 ▼13.9044.45 ▼4.07
Firewall (WAF) /wp-admin/admin.php?page=sucuriscan_firewall1,6982.1344.35109.46
Dashboard /wp-admin/admin.php?page=sucuriscan2,0022.0040.7652.73
Settings /wp-admin/admin.php?page=sucuriscan_settings7,3952.0354.4893.56
Last Logins /wp-admin/admin.php?page=sucuriscan_lastlogins1,4121.8328.9254.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/sucuri-scanner/src/fileinfo.lib.php+383
    rmdir(wp-content/uploads/sucuri): Directory not empty
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

sucuri-scanner/sucuri.php 85% from 13 tests

The main PHP file in "Sucuri Security - Auditing, Malware Scanner and Security Hardening" ver. 1.8.39 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 387 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("sucuri-scanner.php" instead of "sucuri.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin10,587 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP392,0804,8379,104
CSS21511,363
JavaScript1345120
HTML1010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity39.07
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes00.00%
▷ Concrete classes29100.00%
▷ Final classes00.00%
Methods323
▷ Static methods29190.09%
▷ Public methods27685.45%
▷ Protected methods00.00%
▷ Private methods4714.55%
Functions55
▷ Named functions55100.00%
▷ Anonymous functions00.00%
Constants20
▷ Global constants20100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/images/checkwarn.png1.73KB1.82KB0.00%
inc/images/checkcross.png1.56KB1.64KB0.00%
inc/images/flags.sprite.png73.56KB25.70KB▼ 65.06%
inc/images/checknotice.png1.72KB1.81KB0.00%
inc/images/mainlogo.png8.18KB7.57KB▼ 7.49%