10% banman

Code Review | BanMan

WordPress plugin BanMan scored10%from 54 tests.

About plugin

  • Plugin page: banman
  • Plugin version: 1.0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.5.2
  • WordPress version: 6.3.1
  • First release: Jul 4, 2016
  • Latest release: Jul 10, 2016
  • Number of updates: 8
  • Update frequency: every 0.8 days
  • Top authors: tushov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,415 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/banman/banman.php+20
    Undefined index: bman_click_id

Server metrics [RAM: ▼1.81MB] [CPU: ▼56.89ms] Passed 4 tests

Analyzing server-side resources used by BanMan
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.18 ▼1.285.23 ▼40.63
Dashboard /wp-admin2.20 ▼1.146.60 ▼57.31
Posts /wp-admin/edit.php2.21 ▼1.158.12 ▼42.26
Add New Post /wp-admin/post-new.php2.20 ▼3.686.71 ▼87.35
Media Library /wp-admin/upload.php2.21 ▼1.026.26 ▼30.14

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

Input-output and database impact of this plugin
Please fix the following
  • There were 1 file (4.00KB) illegally modified outside of "wp-content/plugins/banman/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 16 new files
Database: 1 new table, 7 new options
New tables
wp_banman
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_banman
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for BanMan
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,083 ▲29715.58 ▲1.205.55 ▲3.7837.52 ▼2.69
Dashboard /wp-admin2,385 ▲1796.51 ▲0.60132.90 ▲26.8844.54 ▲0.80
Posts /wp-admin/edit.php2,287 ▲1873.44 ▲1.4055.05 ▲14.2634.10 ▼6.18
Add New Post /wp-admin/post-new.php1,567 ▲3423.26 ▲0.17597.25 ▼17.1734.67 ▼17.38
Media Library /wp-admin/upload.php1,421 ▲214.03 ▼0.2387.94 ▼22.5542.96 ▲0.11
Add new /wp-admin/banman.php?page=edit260.440.1016.34
List of banners /wp-admin/banman.php260.440.148.07

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
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/banman/banman.php+20
    Undefined index: bman_click_id
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_banman
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/banman/includes/banman.widget.php:3
    • > PHP Notice
      Undefined variable: isNew in wp-content/plugins/banman/tmpl/edit.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/banman/banman.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/banman/includes/admin.list_table.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/banman/tmpl/admin.php on line 1
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/banman/tmpl/admin.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/banman/tmpl/edit.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/banman/tmpl/admin.php on line 1

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/banman.php?page=edit
    • > Network (severe)
    wp-admin/banman.php?page=edit - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/banman.php
    • > Network (severe)
    wp-admin/banman.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
  • Screenshots: These screenshots require images: #1 (Страница создания нового баннера), #2 (Page to create a new banner), #3 (Страница управления баннерами (Список баннеров)), #4 (List of banners), #5 (Виджет для создании новой позиции вывода баннера), #6 (Widget for creating a new position of the output banner), #7 (Пример Pop-up баннера), #8 (Example Pop-up banner)
  • Tags: You are using too many tags: 21 tag instead of maximum 10
The official readme.txt might help

banman/banman.php Passed 13 tests

The primary PHP file in "BanMan" version 1.0.1.0 is used by WordPress to initiate all plugin functionality
139 characters long description:
Простой и удобный плагин для управления баннерами на сайте. Managing banners on your site

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected1,411 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP89516819
CSS13965385
PO File17476164
JavaScript30743

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity26.00
▷ Minimum class complexity9.00
▷ Maximum class complexity49.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants3
▷ Global constants3100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/close.png0.66KB0.60KB▼ 8.04%