94% besan-block

Code Review | Besan Block

WordPress plugin Besan Block scored 94% from 54 tests.

About plugin

  • Plugin page: besan-block
  • Plugin version: 1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.8.1
  • First release: Aug 14, 2019
  • Latest release: Jul 20, 2021
  • Number of updates: 10
  • Update frequency: every 70.7 days
  • Top authors: thatdevgirl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 692 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.08MB] [CPU: ▼139.57ms] Passed 4 tests

A check of server-side resources used by Besan Block
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1841.97 ▲21.03
Dashboard /wp-admin3.13 ▲0.0847.18 ▲4.61
Posts /wp-admin/edit.php3.24 ▲0.1347.69 ▲1.39
Add New Post /wp-admin/post-new.php5.48 ▲0.0594.32 ▼564.32
Media Library /wp-admin/upload.php3.07 ▲0.0732.74 ▲0.06
Besan Block /wp-admin/options-general.php?page=besan_options3.0427.97

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Besan Block: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,710 ▲11415.82 ▼0.1810.92 ▲0.3343.56 ▼1.45
Dashboard /wp-admin2,980 ▲435.97 ▼0.03151.01 ▼7.33107.39 ▼1.92
Posts /wp-admin/edit.php2,746 ▲72.72 ▲0.0165.49 ▼2.9086.90 ▲3.35
Add New Post /wp-admin/post-new.php1,886 ▲28219.26 ▲0.75394.99 ▲7.18117.89 ▲7.95
Media Library /wp-admin/upload.php1,814 ▲45.04 ▼0.01158.93 ▲7.86115.44 ▲2.92
Besan Block /wp-admin/options-general.php?page=besan_options1,1282.0959.2173.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\BesanBlock\\is_admin() in wp-content/plugins/besan-block/inc/plugins-page.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\BesanBlock\\is_admin() in wp-content/plugins/besan-block/inc/assets.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\BesanBlock\\Chart\\add_action() in wp-content/plugins/besan-block/source/blocks/chart/register.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/besan-block/inc/template-options-page.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ThreePM\\BesanBlock\\is_admin() in wp-content/plugins/besan-block/inc/options-page.php:67

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: graph, data, chart

besan-block/besan-block.php Passed 13 tests

The main PHP file in "Besan Block" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
63 characters long description:
This WordPress plugin adds a charting block to the post editor.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected602 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP9142287339
JavaScript44419169
Sass625493
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.43
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods1661.54%
▷ Protected methods00.00%
▷ Private methods1038.46%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants00.00%
▷ Class constants16100.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin