42% sabres-security-website-protection

Code Review | Sabres Security Website Protection

WordPress plugin Sabres Security Website Protection scored42%from 54 tests.

About plugin

  • Plugin page: sabres-security-w...
  • Plugin version: 0.4.44
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.2.2
  • WordPress version: 6.3.1
  • First release: Sep 10, 2017
  • Latest release: Jun 19, 2019
  • Number of updates: 41
  • Update frequency: every 16.3 days
  • Top authors: sabres (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,151 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼35.35ms] Passed 4 tests

Server-side resources used by Sabres Security Website Protection
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8420.67 ▼17.54
Dashboard /wp-admin4.32 ▲1.0240.00 ▼13.31
Posts /wp-admin/edit.php4.32 ▲0.9625.16 ▼24.85
Add New Post /wp-admin/post-new.php4.32 ▼1.5724.19 ▼85.69
Media Library /wp-admin/upload.php4.32 ▲1.0931.55 ▼5.35
Sabres /wp-admin/options-general.php?page=sabres4.3226.32

Server storage [IO: ▲7.32MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 263 new files
Database: 6 new tables, 7 new options
New tables
wp_sbs_scan_items
wp_sbs_log
wp_sbs_firewall_custom
wp_sbs_firewall_cookies
wp_sbs_scans
wp_sbs_firewall_countries
New WordPress options
theysaidso_admin_options
sabres-settings
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Sabres Security Website Protection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.14 ▼0.511.92 ▲0.0934.76 ▼12.50
Dashboard /wp-admin2,202 ▲255.54 ▼0.1184.70 ▼2.9772.78 ▲27.94
Posts /wp-admin/edit.php2,119 ▲162.01 ▼0.0035.41 ▼4.1140.43 ▲5.59
Add New Post /wp-admin/post-new.php1,695 ▲15521.81 ▼1.38692.62 ▲23.7353.16 ▼8.80
Media Library /wp-admin/upload.php1,413 ▲134.21 ▲0.0695.44 ▼20.1869.19 ▲22.23
Sabres /wp-admin/options-general.php?page=sabres8522.0628.6629.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/sabres-security-website-protection/classes/helpers/ip2location/IP2Location.php+351
    Array and string offset access syntax with curly braces is deprecated
  • Zombie tables detected upon uninstall: 6 tables
    • wp_sbs_scan_items
    • wp_sbs_firewall_custom
    • wp_sbs_firewall_countries
    • wp_sbs_scans
    • wp_sbs_log
    • wp_sbs_firewall_cookies
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • sabres-settings
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sabres
    • > Deprecated in wp-content/plugins/sabres-security-website-protection/classes/helpers/ip2location/IP2Location.php+354
    Array and string offset access syntax with curly braces is deprecated

SRP 0% from 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
Please fix the following
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/demo/index.php
    • > /wp-content/plugins/sabres-security-website-protection/views/terms.php
    • > /wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/demo/output.php
    • > /wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/demo/ocr.php
    • > /wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/demo/fingerprint.php
  • 1365× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sabres-security-website-protection/vendor/gregwar/captcha/CaptchaBuilder.php on line 333

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt is a good inspiration

sabres-security-website-protection/sabres-security-website-protection.php 85% from 13 tests

The main PHP script in "Sabres Security Website Protection" version 0.4.44 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 300 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .bin - Binary Executable in Windows, macOS, Linux
      • wp-content/plugins/sabres-security-website-protection/classes/helpers/ip2location/databases/IP-COUNTRY.BIN
24,879 lines of code in 185 files:
LanguageFilesBlank linesComment linesLines of code
PHP1573,9136,55415,430
SVG4004,216
CSS3327222,866
JavaScript153931542,011
Markdown2970246
JSON30099
YAML12011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity12.30
▷ Minimum class complexity1.00
▷ Maximum class complexity135.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces4
Interfaces4
Traits0
Classes131
▷ Abstract classes1813.74%
▷ Concrete classes11386.26%
▷ Final classes76.19%
Methods983
▷ Static methods11111.29%
▷ Public methods76077.31%
▷ Protected methods424.27%
▷ Private methods18118.41%
Functions30
▷ Named functions13.33%
▷ Anonymous functions2996.67%
Constants141
▷ Global constants128.51%
▷ Class constants12991.49%
▷ Public constants129100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
42 PNG files occupy 0.40MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/traffic.png1.51KB0.83KB▼ 44.90%
images/arrow-right.png0.64KB0.85KB0.00%
images/panel_sprites.png4.97KB2.93KB▼ 41.17%
images/arrow-left.png0.67KB0.85KB0.00%
images/tour-arrows/page5-features.png2.12KB2.15KB0.00%