99% counters-block

Code Review | Counters Block - Gutenberg Counters Block

WordPress plugin Counters Block - Gutenberg Counters Block scored 99% from 54 tests.

About plugin

  • Plugin page: counters-block
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Nov 16, 2021
  • Latest release: Nov 16, 2021
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: charlescormier (66.67%)abuhayat (66.67%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 22 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼149.03ms] Passed 4 tests

An overview of server-side resources used by Counters Block - Gutenberg Counters Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0637.98 ▲1.93
Dashboard /wp-admin3.11 ▲0.0652.95 ▲2.52
Posts /wp-admin/edit.php3.16 ▲0.0549.94 ▼0.08
Add New Post /wp-admin/post-new.php5.47 ▲0.0389.98 ▼600.50
Media Library /wp-admin/upload.php3.05 ▲0.0534.65 ▲4.50

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Counters Block - Gutenberg Counters Block
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,721 ▲12516.03 ▲0.3013.49 ▲3.2348.61 ▼1.35
Dashboard /wp-admin2,992 ▲585.94 ▲0.00158.16 ▲9.18103.39 ▼11.40
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0071.58 ▲4.6390.02 ▼3.98
Add New Post /wp-admin/post-new.php1,706 ▲2319.20 ▲0.33456.38 ▲59.32134.16 ▲22.60
Media Library /wp-admin/upload.php1,807 ▲595.02 ▲0.00158.17 ▼3.37124.36 ▲4.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Default Counters), #2 (Theme 1), #3 (Theme 2), #4 (Theme 3)
  • Requires at least: Invalid plugin version format
Please take inspiration from this readme.txt

counters-block/plugin.php 92% from 13 tests

The main PHP file in "Counters Block - Gutenberg Counters Block" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("counters-block.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected353 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JSON100199
PHP11915149
JavaScript3033
CSS2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.50
▷ Minimum class complexity5.00
▷ Maximum class complexity16.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods342.86%
▷ Public methods7100.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