84% block-data-attribute

Code Review | Block Data Attribute

WordPress plugin Block Data Attribute scored84%from 54 tests.

About plugin

  • Plugin page: block-data-attribute
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.1
  • WordPress version: 6.3.1
  • First release: Feb 10, 2020
  • Latest release: Nov 7, 2022
  • Number of updates: 20
  • Update frequency: every 50.1 days
  • Top authors: mahdiyazdani (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /3,524 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▲1.86ms] Passed 4 tests

A check of server-side resources used by Block Data Attribute
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.34 ▲1.40
Dashboard /wp-admin3.31 ▲0.0145.63 ▼3.33
Posts /wp-admin/edit.php3.36 ▲0.0051.35 ▲6.02
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.13 ▲6.13
Media Library /wp-admin/upload.php3.23 ▲0.0034.59 ▲3.34

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Block Data Attribute
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.60 ▼0.711.78 ▼0.6240.36 ▼7.30
Dashboard /wp-admin2,206 ▲184.83 ▼1.14109.24 ▼7.5538.29 ▼7.17
Posts /wp-admin/edit.php2,086 ▼02.01 ▼0.0340.11 ▲2.5234.20 ▲0.30
Add New Post /wp-admin/post-new.php1,539 ▲1918.70 ▼4.45605.36 ▼30.6946.79 ▼4.55
Media Library /wp-admin/upload.php1,385 ▼34.17 ▼0.0597.13 ▲2.3242.10 ▼0.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Block_Data_Attribute\\plugin_basename() in wp-content/plugins/block-data-attribute/block-data-attribute.php:42

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: data, attribute, blocks, gutenberg blocks, gutenberg...

block-data-attribute/block-data-attribute.php 92% from 13 tests

The entry point to "Block Data Attribute" version 2.0.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 150 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected43 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP496642
JavaScript1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 files were detected