78% shieldfy

Code Review | Shieldfy Security Firewall and Anti Virus

WordPress plugin Shieldfy Security Firewall and Anti Virus scored78%from 54 tests.

About plugin

  • Plugin page: shieldfy
  • Plugin version: 3.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9
  • WordPress version: 6.3.1
  • First release: Nov 14, 2015
  • Latest release: Nov 12, 2018
  • Number of updates: 56
  • Update frequency: every 19.6 days
  • Top authors: eslamsalem (94.64%)komicho1996 (7.14%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /6,397 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.43ms] Passed 4 tests

This is a short check of server-side resources used by Shieldfy Security Firewall and Anti Virus
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0841.02 ▼8.28
Dashboard /wp-admin3.42 ▲0.0371.38 ▲3.97
Posts /wp-admin/edit.php3.53 ▲0.1349.70 ▼3.43
Add New Post /wp-admin/post-new.php6.00 ▲0.0785.44 ▼5.63
Media Library /wp-admin/upload.php3.34 ▲0.0740.99 ▲3.62

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 162 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Shieldfy Security Firewall and Anti Virus
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲8014.25 ▼0.401.77 ▲0.0241.91 ▼5.61
Dashboard /wp-admin2,212 ▲355.52 ▼0.1599.63 ▲1.3881.66 ▲32.86
Posts /wp-admin/edit.php2,132 ▲291.97 ▼0.0238.84 ▼2.5135.19 ▼5.26
Add New Post /wp-admin/post-new.php1,709 ▲18122.33 ▼0.39721.95 ▲114.7452.48 ▼7.40
Media Library /wp-admin/upload.php1,432 ▲354.14 ▲0.0296.70 ▼8.1168.14 ▲24.65

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/shieldfy/vendor/shieldfy/shieldfy-php-client/src/Extensions/Laravel/views/block.blade.php
  • 66× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Shieldfy\ormalizer\ormalizeInterface' not found in wp-content/plugins/shieldfy/vendor/shieldfy/normalizer/src/Normalizers/NormalizeJson.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Shieldfy\\Collectors\\Collectable' not found in wp-content/plugins/shieldfy/vendor/shieldfy/shieldfy-php-client/src/Collectors/ExceptionsCollector.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Shieldfy\ormalizer\ormalizeInterface' not found in wp-content/plugins/shieldfy/vendor/shieldfy/normalizer/src/Normalizers/NormalizeSerialize.php:22
    • > PHP Notice
      Undefined variable: API_SERVER_ENDPOINT in wp-content/plugins/shieldfy/shieldfy.client.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/shieldfy/vendor/shieldfy/shieldfy-php-client/tests/UserCollectorTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Shieldfy\\Collectors\\Collectable' not found in wp-content/plugins/shieldfy/vendor/shieldfy/shieldfy-php-client/src/Collectors/RequestCollector.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Shieldfy\ormalizer\ormalizeInterface' not found in wp-content/plugins/shieldfy/vendor/shieldfy/normalizer/src/Normalizers/NormalizeSQLKeywords.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Shieldfy\\Sniffer\\TypeInterface' not found in wp-content/plugins/shieldfy/vendor/shieldfy/sniffer/src/Types/JsonType.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Shieldfy\ormalizer\ormalizeInterface' not found in wp-content/plugins/shieldfy/vendor/shieldfy/normalizer/src/Normalizers/NormalizeUTF7.php:21
    • > PHP Warning
      file_get_contents(wp-content/plugins/shieldfy/shieldfy/data/general.json): failed to open stream: No such file or directory in /var/www/wordpress/wp-content/plugins/shieldfy/shieldfy.client.php on line 914

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 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #6 (Setting pages allows you to control nearly everything (firewall , ban , scanner and notifications settings))
  • Tags: There are too many tags (30 tag instead of maximum 10)
The official readme.txt is a good inspiration

shieldfy/shieldfy.php 92% from 13 tests

The main PHP script in "Shieldfy Security Firewall and Anti Virus" version 3.6.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Git Repository: An alternative Git repository was detected

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected14,009 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
Blade11,17406,711
PHP1021,1361,9305,560
SVG100640
YAML103613377
JSON400310
Markdown111770304
XML30066
CSS121126
HTML10010
JavaScript1175

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.88
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces23
Interfaces4
Traits4
Classes91
▷ Abstract classes22.20%
▷ Concrete classes8997.80%
▷ Final classes00.00%
Methods379
▷ Static methods4110.82%
▷ Public methods29978.89%
▷ Protected methods92.37%
▷ Private methods7118.73%
Functions37
▷ Named functions1232.43%
▷ Anonymous functions2567.57%
Constants20
▷ Global constants20100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
favicon-32x32.png1.59KB1.67KB0.00%
shieldfy.png0.96KB1.25KB0.00%