83% business-card-block

Code Review | Business Card Block - Show your business card on the web.

WordPress plugin Business Card Block - Show your business card on the web. scored83%from 54 tests.

About plugin

  • Plugin page: business-card-block
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 16, 2022
  • Latest release: Oct 3, 2023
  • Number of updates: 22
  • Update frequency: every 25.7 days
  • Top authors: charlescormier (81.82%)abuhayat (22.73%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,812 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.61ms] Passed 4 tests

An overview of server-side resources used by Business Card Block - Show your business card on the web.
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.63 ▼5.66
Dashboard /wp-admin3.34 ▲0.0346.72 ▼4.44
Posts /wp-admin/edit.php3.39 ▲0.0345.73 ▼1.99
Add New Post /wp-admin/post-new.php5.92 ▲0.0496.73 ▲1.67
Media Library /wp-admin/upload.php3.26 ▲0.0336.97 ▲3.91

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Business Card Block - Show your business card on the web.
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8513.83 ▼0.559.26 ▲7.0542.23 ▼6.93
Dashboard /wp-admin2,200 ▲125.85 ▲0.96114.15 ▼0.7341.25 ▼6.93
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0140.56 ▲3.5835.36 ▼1.73
Add New Post /wp-admin/post-new.php6,424 ▲4,87928.85 ▲5.60880.92 ▲230.0537.12 ▼24.05
Media Library /wp-admin/upload.php1,379 ▼94.19 ▼0.0196.08 ▼15.1843.16 ▼1.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant BCB_PLUGIN_VERSION - assumed 'BCB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/business-card-block/dist/script.asset.php on line 3
    • > PHP Warning
      Use of undefined constant BCB_PLUGIN_VERSION - assumed 'BCB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/business-card-block/dist/editor.asset.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Requires at least: Invalid version format
You can look at the official readme.txt

business-card-block/index.php 85% from 13 tests

"Business Card Block - Show your business card on the web." version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("business-card-block.php" instead of "index.php")

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 detected352 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JSON200189
PO File15094118
PHP3111340
CSS3063
JavaScript2022

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.15
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin