78% security-antivirus-firewall

Code Review | Security, Antivirus, Firewall - S.A.F

WordPress plugin Security, Antivirus, Firewall - S.A.F scored78%from 54 tests.

About plugin

  • Plugin page: security-antiviru...
  • Plugin version: 2.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.0
  • WordPress version: 6.3.1
  • First release: Aug 13, 2016
  • Latest release: Dec 3, 2018
  • Number of updates: 53
  • Update frequency: every 15.9 days
  • Top authors: msoftplugins (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /40,420 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▼2.37ms] Passed 4 tests

This is a short check of server-side resources used by Security, Antivirus, Firewall - S.A.F
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2945.04 ▲6.96
Dashboard /wp-admin3.60 ▲0.2652.78 ▼5.05
Posts /wp-admin/edit.php3.62 ▲0.2649.31 ▲0.38
Add New Post /wp-admin/post-new.php6.09 ▲0.2083.24 ▼9.34
Media Library /wp-admin/upload.php3.43 ▲0.2037.75 ▲4.52
Security S.A.F. /wp-admin/admin.php?page=wptsaf_security_extensions3.5840.25
Settings /wp-admin/admin.php?page=wptsaf_security_settings3.4434.08

Server storage [IO: ▲2.54MB] [DB: ▲0.08MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 227 new files
Database: 10 new tables, 7 new options
New tables
wp_wptsaf_security_network_monitor_manager_ip_change_log
wp_wptsaf_security_google_captcha_blog_settings
wp_wptsaf_security_google_captcha_log
wp_wptsaf_security_login_brute_force_log
wp_wptsaf_security_system_log
wp_wptsaf_security_easy_password_log
wp_wptsaf_security_network_monitor_manager_ip
wp_wptsaf_security_extension_error_monitor_log
wp_wptsaf_security_network_monitor_log
wp_wptsaf_security_404_detection_log
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
wpsaf_install_version
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Security, Antivirus, Firewall - S.A.F
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,008 ▲24713.93 ▼0.422.71 ▲1.1531.63 ▼7.57
Dashboard /wp-admin2,388 ▲2085.86 ▲0.18111.88 ▲23.4341.11 ▼2.26
Posts /wp-admin/edit.php2,127 ▲302.02 ▲0.0333.80 ▼3.0533.48 ▼0.96
Add New Post /wp-admin/post-new.php1,547 ▲2023.77 ▲1.02699.27 ▲40.6559.88 ▲5.54
Media Library /wp-admin/upload.php1,424 ▲274.14 ▼0.1095.10 ▼5.9742.35 ▼3.67
Security S.A.F. /wp-admin/admin.php?page=wptsaf_security_extensions1,7042.8765.7058.56
Settings /wp-admin/admin.php?page=wptsaf_security_settings1,2832.7057.2342.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • wpsaf_install_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/security-antivirus-firewall/extensions/network-monitor/template/manager-ip-change-log.php
  • 24× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/security-antivirus-firewall/core/template/wizard1.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'wptsafAbstractExtensionWidget' not found in wp-content/plugins/security-antivirus-firewall/extensions/network-monitor/wptsafExtensionNetworkMonitorWidget.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'wptsafSettings' not found in wp-content/plugins/security-antivirus-firewall/extensions/network-monitor/wptsafExtensionNetworkMonitorSettings.php:13
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/security-antivirus-firewall/extensions/network-monitor/template/manager-ip-change-log.php on line 25
    • > PHP Notice
      Undefined variable: extensionTitle in wp-content/plugins/security-antivirus-firewall/extensions/network-monitor/template/log-row.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'wpToolsSAFHelperClass' not found in wp-content/plugins/security-antivirus-firewall/extensions/system-log/template/widget.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/security-antivirus-firewall/extensions/login-brute-force/template/email/ban-ip.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/security-antivirus-firewall/core/dialogs/wizardStart.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'wptsafExtensionCron' not found in wp-content/plugins/security-antivirus-firewall/extensions/login-brute-force/wptsafExtensionLoginBruteForceCron.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'wptsafAbstractExtensionAjaxHandle' not found in wp-content/plugins/security-antivirus-firewall/extensions/network-monitor/wptsafExtensionNetworkMonitorAjaxHandle.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
You can take inspiration from this readme.txt

security-antivirus-firewall/index.php 92% from 13 tests

The main PHP script in "Security, Antivirus, Firewall - S.A.F" version 2.3.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("security-antivirus-firewall.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected21,157 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
CSS572614910,021
PHP1461,4321,5197,960
JavaScript55356112,147
SVG200973
HTML12056

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity7.10
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes83
▷ Abstract classes67.23%
▷ Concrete classes7792.77%
▷ Final classes11.30%
Methods346
▷ Static methods226.36%
▷ Public methods31992.20%
▷ Protected methods277.80%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants40
▷ Global constants1845.00%
▷ Class constants2255.00%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.19MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/screenshot_5.png38.91KB20.29KB▼ 47.84%
assets/img/8bcLQqF.png2.36KB1.45KB▼ 38.65%
assets/img/screenshot_6.png34.27KB17.80KB▼ 48.07%
assets/img/screenshot_4.png32.79KB16.88KB▼ 48.52%
assets/dist/css/admin_icon32.png1.19KB1.42KB0.00%