63% wp-shieldon

Code Review | WP Shieldon - WordPress Firewall

WordPress plugin WP Shieldon - WordPress Firewall scored63%from 54 tests.

About plugin

  • Plugin page: wp-shieldon
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 18, 2019
  • Latest release: Jun 21, 2023
  • Number of updates: 52
  • Update frequency: every 28.2 days
  • Top authors: terrylin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /3,404 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.39MB] [CPU: ▲11.14ms] Passed 4 tests

A check of server-side resources used by WP Shieldon - WordPress Firewall
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1139.05 ▼3.52
Dashboard /wp-admin5.13 ▲1.8372.16 ▲27.45
Posts /wp-admin/edit.php5.24 ▲1.8964.14 ▲15.06
Add New Post /wp-admin/post-new.php7.70 ▲1.82105.84 ▲14.62
Media Library /wp-admin/upload.php5.03 ▲1.8051.01 ▲18.40
Import / Export /wp-admin/admin.php?page=shieldon-import-export5.0449.73
XSS Protection /wp-admin/admin.php?page=shieldon-xss-protection5.0552.77
Rule Table /wp-admin/admin.php?page=shieldon-rule-table5.0555.94
Operation Status /wp-admin/admin.php?page=shieldon-operation-status5.0047.15
Overview /wp-admin/admin.php?page=shieldon-overview5.0047.76
Session Table /wp-admin/admin.php?page=shieldon-session-table5.0552.16
IP Manager /wp-admin/admin.php?page=shieldon-ip-manager5.0348.22
Settings /wp-admin/admin.php?page=shieldon-settings5.0352.44
Filter Log Table /wp-admin/admin.php?page=shieldon-filter-log-table5.0650.99
About /wp-admin/admin.php?page=shieldon-about5.0347.73

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 484 new files
Database: 3 new tables, 22 new options
New tables
1_shieldon_sessions
1_shieldon_rule_list
1_shieldon_filter_logs
New WordPress options
recovery_mode_email_last_sent
widget_recent-posts
shieldon_filter
shieldon_ip_signup
shieldon_ip_login
widget_theysaidso_widget
wpso_lang_code
shieldon_component
wpso_last_reset_time
wpso_version
...

Browser metrics Passed 4 tests

A check of browser resources used by WP Shieldon - WordPress Firewall
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,023 ▲27714.79 ▲0.411.84 ▲0.0345.60 ▼0.51
Dashboard /wp-admin2,426 ▲2386.66 ▲1.76117.65 ▲14.8637.14 ▼2.75
Posts /wp-admin/edit.php2,335 ▲2433.52 ▲1.5452.60 ▲15.0532.55 ▼2.30
Add New Post /wp-admin/post-new.php1,581 ▲6723.38 ▲5.83595.62 ▼55.0434.19 ▼16.78
Media Library /wp-admin/upload.php1,474 ▲864.44 ▲0.2285.64 ▼11.2442.75 ▲1.26
Import / Export /wp-admin/admin.php?page=shieldon-import-export1,1526.7276.64102.02
XSS Protection /wp-admin/admin.php?page=shieldon-xss-protection1,4277.01102.3384.00
Rule Table /wp-admin/admin.php?page=shieldon-rule-table1,3217.0388.6196.10
Operation Status /wp-admin/admin.php?page=shieldon-operation-status7642.0718.0622.20
Overview /wp-admin/admin.php?page=shieldon-overview7642.0718.5822.04
Session Table /wp-admin/admin.php?page=shieldon-session-table1,3846.3089.87105.15
IP Manager /wp-admin/admin.php?page=shieldon-ip-manager1,5165.9173.4597.06
Settings /wp-admin/admin.php?page=shieldon-settings2,3126.8387.8395.23
Filter Log Table /wp-admin/admin.php?page=shieldon-filter-log-table1,3606.0696.6580.10
About /wp-admin/admin.php?page=shieldon-about1,1606.6659.52125.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • 1_shieldon_filter_logs
    • 1_shieldon_rule_list
    • 1_shieldon_sessions
  • This plugin does not fully uninstall, leaving 10 options in the database
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_recent-comments
    • shieldon_exclusion
    • db_upgraded
    • wpso_last_reset_time
    • widget_theysaidso_widget
    • widget_recent-posts
    • wpso_version
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=shieldon-operation-status
    • > Error in wp-content/plugins/wp-shieldon/includes/class-wpso-admin-menu.php+896
    Uncaught ReflectionException: Cannot access non-public member Shieldon\Firewall\Kernel::$filterStatus in wp-content/plugins/wp-shieldon/includes/class-wpso-admin-menu.php:896
    Stack trace:
    #0 wp-content/plugins/wp-shieldon/includes/class-wpso-admin-menu.php(896): ReflectionProperty->getValue()
    #1 wp-includes/class-wp-hook.php(310): WPSO_Admin_Menu->operation_status()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=shieldon-overview
    • > Error in wp-content/plugins/wp-shieldon/includes/class-wpso-admin-menu.php+815
    Uncaught ReflectionException: Cannot access non-public member Shieldon\Firewall\Kernel::$filterStatus in wp-content/plugins/wp-shieldon/includes/class-wpso-admin-menu.php:815
    Stack trace:
    #0 wp-content/plugins/wp-shieldon/includes/class-wpso-admin-menu.php(815): ReflectionProperty->getValue()
    #1 wp-includes/class-wp-hook.php(310): WPSO_Admin_Menu->overview()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

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
  • 36× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/table_rules.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/setting/filters.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/messenger/tab.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/template.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/setting/admin_login.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/authentication.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/js/chart.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/action_log_yesterday.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/frontend/captcha.php
    • > /wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/panel/overview.php
  • 160× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\FirewallTest\\ShieldonTestCase' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/tests/Firewall/Firewall/Driver/ItemMysqlDriverTest.php:25
    • > PHP Fatal error
      Trait 'Shieldon\\Firewall\\Panel\\DemoModeTrait' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/src/Firewall/Panel.php on line 48
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriFactoryInterface' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/psr-http/src/Psr17/UriFactory.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/psr-http/tests/Psr17/UploadFileFactoryTest.php:21
    • > PHP Fatal error
      Trait 'WPSO_Singleton' not found in wp-content/plugins/wp-shieldon/includes/class-wpso-admin-menu.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/tests/Firewall/ShieldonTestCase.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/psr-http/tests/Psr7/MessageTest.php:22
    • > PHP Fatal error
      Trait 'Shieldon\\Firewall\\Kernel\\CaptchaTrait' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/src/Firewall/Kernel.php on line 59
    • > PHP Notice
      Undefined index: bg_color in wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/templates/frontend/css/default.php on line 22
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\Firewall\\Component\\ComponentProvider' not found in wp-content/plugins/wp-shieldon/vendor/shieldon/shieldon/src/Firewall/Component/Rdns.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: firewall, brute-force, security, anti-scriping, xss-protection

wp-shieldon/wp-shieldon.php Passed 13 tests

The entry point to "WP Shieldon - WordPress Firewall" version 2.0.2 is a PHP file that has certain tags in its header comment area
38 characters long description:
An anti-scraping plugin for WordPress.

Code Analysis Passed 3 tests

File types Passed 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
No dangerous file extensions were detected46,815 lines of code in 417 files:
LanguageFilesBlank linesComment linesLines of code
PHP3347,51816,00835,663
Sass217151493,807
JSON16301,966
PO File38618801,788
CSS336351,204
Markdown1243701,181
XML780376
JavaScript82763337
YAML8481215
Bourne Shell26566212
Dockerfile111047
Ruby2142919

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity8.04
▷ Minimum class complexity1.00
▷ Maximum class complexity110.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces45
Interfaces19
Traits23
Classes201
▷ Abstract classes52.49%
▷ Concrete classes19697.51%
▷ Final classes42.04%
Methods1,429
▷ Static methods765.32%
▷ Public methods1,13279.22%
▷ Protected methods20614.42%
▷ Private methods916.37%
Functions85
▷ Named functions6070.59%
▷ Anonymous functions2529.41%
Constants112
▷ Global constants2724.11%
▷ Class constants8575.89%
▷ Public constants85100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/shieldon/psr-http/tests/sample/shieldon_logo_bak.png14.81KB7.00KB▼ 52.72%
vendor/shieldon/shieldon/assets/src/images/logo.png7.32KB3.30KB▼ 54.87%
vendor/shieldon/psr-http/tests/sample/shieldon_logo.png14.81KB7.00KB▼ 52.72%
includes/assets/images/icon-clock_96x96.png8.09KB2.99KB▼ 63.06%
vendor/shieldon/shieldon/assets/src/images/icon-warning_96x96.png7.71KB2.95KB▼ 61.80%