68% traffic-jammer

Code Review | Traffic Jammer

WordPress plugin Traffic Jammer scored68%from 54 tests.

About plugin

  • Plugin page: traffic-jammer
  • Plugin version: 1.2.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2022
  • Latest release: Nov 10, 2023
  • Number of updates: 48
  • Update frequency: every 8.3 days
  • Top authors: slick2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /660 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by Traffic Jammer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1143.42 ▲5.55
Dashboard /wp-admin3.42 ▲0.0854.42 ▼6.46
Posts /wp-admin/edit.php3.54 ▲0.1850.84 ▲2.97
Add New Post /wp-admin/post-new.php6.00 ▲0.1288.08 ▼12.53
Media Library /wp-admin/upload.php3.35 ▲0.1239.54 ▲6.42
Dashboard /wp-admin/admin.php?page=wp_traffic_jammer3.3334.93
Reports /wp-admin/admin.php?page=trafficjammer_traffic_logs3.3335.41

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: 1 new table, 8 new options
New tables
wp_trafficjammer_traffic
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
trafficjammer_db_version
wp_traffic_jammer_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Traffic Jammer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5714.14 ▼0.181.78 ▲0.0143.09 ▲2.66
Dashboard /wp-admin2,221 ▲475.64 ▲0.1294.47 ▲3.8044.30 ▲3.07
Posts /wp-admin/edit.php2,129 ▲292.05 ▲0.1037.22 ▼1.4533.53 ▼0.12
Add New Post /wp-admin/post-new.php1,550 ▲2423.53 ▲0.35633.77 ▼36.8953.46 ▼10.90
Media Library /wp-admin/upload.php1,426 ▲234.18 ▼0.01101.11 ▲0.1242.49 ▲0.97
Dashboard /wp-admin/admin.php?page=wp_traffic_jammer9251.8524.5030.19
Reports /wp-admin/admin.php?page=trafficjammer_traffic_logs8601.7029.6526.48

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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 plugin did not uninstall successfully, leaving 1 table in the database
    • wp_trafficjammer_traffic
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • trafficjammer_db_version
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • wp_traffic_jammer_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=trafficjammer_traffic_logs
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

SRP 50% 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
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/traffic-jammer/partials/traffic-logs.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/traffic-jammer/includes/class-wp-traffic-jammer-cli.php:95
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/traffic-jammer/traffic-jammer.php:677
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/traffic-jammer/partials/options-page.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: block, malicious ip, security, ip, block bots...

traffic-jammer/traffic-jammer.php Passed 13 tests

The primary PHP file in "Traffic Jammer" version 1.2.4 is used by WordPress to initiate all plugin functionality
68 characters long description:
WordPress plugin to block IP and bots that causes malicious traffic.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected912 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5107293878
Markdown114034

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin