84% wp-firewall

Code Review | WP Firewall

WordPress plugin WP Firewall scored84%from 54 tests.

About plugin

  • Plugin page: wp-firewall
  • Plugin version: 2.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Aug 30, 2019
  • Latest release: Apr 24, 2020
  • Number of updates: 15
  • Update frequency: every 15.9 days
  • Top authors: andreadegiovine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,602 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼4.09ms] Passed 4 tests

Analyzing server-side resources used by WP Firewall
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.34 ▼1.86
Dashboard /wp-admin3.42 ▲0.1151.27 ▲2.85
Posts /wp-admin/edit.php3.53 ▲0.1752.11 ▼7.87
Add New Post /wp-admin/post-new.php6.00 ▲0.1197.35 ▼9.46
Media Library /wp-admin/upload.php3.34 ▲0.1141.29 ▲7.46
Firewall /wp-admin/options-general.php?page=firewall3.3633.72

Server storage [IO: ▲0.07MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please try to fix the following items
  • The plugin illegally modified 1 file (0.51KB) outside of "wp-content/plugins/wp-firewall/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
wp_firewall_version
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP Firewall
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.27 ▼1.131.63 ▼0.6941.68 ▼2.82
Dashboard /wp-admin2,234 ▲465.90 ▲0.09103.78 ▼5.1739.11 ▼3.61
Posts /wp-admin/edit.php2,117 ▲252.04 ▲0.0140.10 ▲3.3135.40 ▲0.36
Add New Post /wp-admin/post-new.php1,552 ▲3823.33 ▼0.06664.18 ▼14.0759.23 ▲2.87
Media Library /wp-admin/upload.php1,413 ▲254.22 ▲0.06112.62 ▲12.3048.06 ▲4.24
Firewall /wp-admin/options-general.php?page=firewall1,0552.0322.6931.43

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • wp_firewall_version
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-firewall/inc/htaccess_rules_array.php
    • > /wp-content/plugins/wp-firewall/inc/disable_xmlrpc.php
    • > /wp-content/plugins/wp-firewall/inc/disable_rss.php
    • > /wp-content/plugins/wp-firewall/inc/disable_wlwmanifest.php
    • > /wp-content/plugins/wp-firewall/inc/enable_g_recaptcha.php
    • > /wp-content/plugins/wp-firewall/inc/disable_restapi.php
    • > /wp-content/plugins/wp-firewall/part/options_page.php
    • > /wp-content/plugins/wp-firewall/wp-firewall.php

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: antivirus, protection, spam, safety, firewall

wp-firewall/wp-firewall.php 92% from 13 tests

"WP Firewall" version 2.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin1,266 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP81851111,190
CSS113176

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity39.00
▷ Minimum class complexity39.00
▷ Maximum class complexity39.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected