10% smartfilter

Code Review | SmartFilter Security

WordPress plugin SmartFilter Security scored 10% from 54 tests.

About plugin

  • Plugin page: smartfilter
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 5.9.2
  • First release: Jun 10, 2013
  • Latest release: Oct 18, 2013
  • Number of updates: 26
  • Update frequency: every 5.1 days
  • Top authors: prevoty (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 5,411 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Compile error in wp-content/plugins/smartfilter/lib/Requests.php+21
    Cannot declare class Requests, because the name is already in use

Server metrics [RAM: ▼0.02MB] [CPU: ▼292.88ms] Passed 4 tests

A check of server-side resources used by SmartFilter Security
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0155.98 ▲4.94
Dashboard /wp-admin3.41 ▲0.0039.00 ▲6.15
Posts /wp-admin/edit.php3.64 ▲0.0034.88 ▼1.75
Add New Post /wp-admin/post-new.php6.89 ▼0.0891.38 ▼1,170.41
Media Library /wp-admin/upload.php3.29 ▼0.0125.10 ▼4.29

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 53 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for SmartFilter Security
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4115.85 ▼0.145.76 ▼0.042.42 ▼0.87
Dashboard /wp-admin2,895 ▲346.10 ▼0.05114.53 ▼20.61156.02 ▼5.41
Posts /wp-admin/edit.php2,694 ▼03.24 ▼0.0160.73 ▼4.44136.49 ▼3.26
Add New Post /wp-admin/post-new.php1,773 ▲11221.45 ▲5.17433.21 ▲8.07158.01 ▲1.98
Media Library /wp-admin/upload.php1,695 ▼35.54 ▲0.04141.11 ▲5.63182.91 ▼4.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/smartfilter/templates/api_key_check.php
    • > /wp-content/plugins/smartfilter/templates/rule_key_check.php
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/504.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/408.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/413.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Auth' not found in wp-content/plugins/smartfilter/lib/Requests/Auth/Basic.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/428.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/407.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/416.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/417.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/400.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/smartfilter/lib/Requests/Exception/HTTP/415.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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 49 tag instead of maximum 10
The official readme.txt might help

smartfilter/smartfilter.php 92% from 13 tests

The principal PHP file in "SmartFilter Security" v. 1.8 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 484 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,775 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP504382,0262,775

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity10.37
▷ Minimum class complexity1.00
▷ Maximum class complexity193.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes50
▷ Abstract classes00.00%
▷ Concrete classes50100.00%
▷ Final classes00.00%
Methods132
▷ Static methods4231.82%
▷ Public methods9471.21%
▷ Protected methods1712.88%
▷ Private methods2115.91%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants00.00%
▷ Class constants15100.00%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/green.png82.43KB45.22KB▼ 45.14%
templates/red.png66.67KB28.04KB▼ 57.94%