84% counters-block

Code Review | Counters Block - Display Number as an animated counter.

WordPress plugin Counters Block - Display Number as an animated counter. scored84%from 54 tests.

About plugin

  • Plugin page: counters-block
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 16, 2021
  • Latest release: Oct 3, 2023
  • Number of updates: 29
  • Update frequency: every 23.7 days
  • Top authors: charlescormier (93.1%)abuhayat (10.34%)

Code review

54 tests

User reviews

3 reviews

Install metrics

900+ active /7,370 total downloads

Benchmarks

Plugin footprint 83% from 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.03MB] [CPU: ▼10.14ms] Passed 4 tests

An overview of server-side resources used by Counters Block - Display Number as an animated counter.
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0537.64 ▲0.17
Dashboard /wp-admin3.35 ▲0.0045.74 ▼18.73
Posts /wp-admin/edit.php3.40 ▲0.0444.62 ▼5.10
Add New Post /wp-admin/post-new.php5.93 ▲0.0579.11 ▼15.26
Media Library /wp-admin/upload.php3.27 ▲0.0432.64 ▼1.46

Server storage [IO: ▲1.43MB] [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: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Counters Block - Display Number as an animated counter.
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.59 ▲0.061.77 ▼0.1643.99 ▲6.73
Dashboard /wp-admin2,195 ▲175.48 ▼0.2681.94 ▼16.3536.92 ▼6.14
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0133.74 ▼6.9431.13 ▼5.92
Add New Post /wp-admin/post-new.php6,200 ▲4,67119.75 ▼3.26828.05 ▲185.4070.61 ▲19.37
Media Library /wp-admin/upload.php1,397 ▼34.20 ▼0.0896.95 ▲0.1759.94 ▲17.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 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 50% from 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant CTRB_VERSION - assumed 'CTRB_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/counters-block/dist/editor.asset.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/counters-block/inc/block.php:4

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 93% from 29 tests

readme.txt 94% 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:
  • 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 - Display Number as an animated counter." ver. 1.1.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 detected375 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JSON200207
PO File15199120
PHP4121343
CSS3063
JavaScript2022

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.13
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%
Constants3
▷ Global constants3100.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