84% besan-block

Code Review | Besan Block

WordPress plugin Besan Block scored84%from 54 tests.

About plugin

  • Plugin page: besan-block
  • Plugin version: 1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 14, 2019
  • Latest release: Jul 25, 2023
  • Number of updates: 15
  • Update frequency: every 96.1 days
  • Top authors: thatdevgirl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,518 total downloads

Benchmarks

Plugin footprint 83% 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.06MB] [CPU: ▼4.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 /3.53 ▲0.0740.65 ▲2.90
Dashboard /wp-admin3.38 ▲0.0347.13 ▼11.61
Posts /wp-admin/edit.php3.49 ▲0.1448.55 ▼0.27
Add New Post /wp-admin/post-new.php5.96 ▲0.08101.16 ▼9.29
Media Library /wp-admin/upload.php3.30 ▲0.0738.91 ▲5.28
Besan Block /wp-admin/options-general.php?page=besan_options3.2729.03

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: 22 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

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 /2,795 ▲3414.10 ▼0.461.72 ▲0.0943.63 ▲3.91
Dashboard /wp-admin2,198 ▲185.55 ▼0.1282.84 ▼1.4136.63 ▼8.62
Posts /wp-admin/edit.php2,106 ▲61.98 ▼0.0338.45 ▼0.3035.53 ▲1.43
Add New Post /wp-admin/post-new.php6,370 ▲4,84427.66 ▲4.43863.56 ▲265.2559.62 ▲10.26
Media Library /wp-admin/upload.php1,400 ▼34.19 ▼0.0097.16 ▲0.5342.09 ▼2.21
Besan Block /wp-admin/options-general.php?page=besan_options8652.0021.8227.11

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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 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/assets.php:71
    • > 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\\Chart\\add_action() in wp-content/plugins/besan-block/source/blocks/chart/register.php:21
    • > 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: chart, data, graph

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

The main PHP file in "Besan Block" ver. 1.3 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 detected627 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP9141285331
JavaScript44419166
Sass625493
JSON13036
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