68% counter-box

Code Review | Counter Box - WordPress plugin for countdown, timer, counter

WordPress plugin Counter Box - WordPress plugin for countdown, timer, counter scored68%from 54 tests.

About plugin

  • Plugin page: counter-box
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 24, 2020
  • Latest release: Oct 31, 2023
  • Number of updates: 27
  • Update frequency: every 45.4 days
  • Top authors: Wpcalc (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /18,191 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.93ms] Passed 4 tests

This is a short check of server-side resources used by Counter Box - WordPress plugin for countdown, timer, counter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.45 ▲1.57
Dashboard /wp-admin3.41 ▲0.1045.36 ▼6.20
Posts /wp-admin/edit.php3.52 ▲0.1649.02 ▼2.34
Add New Post /wp-admin/post-new.php5.99 ▲0.1084.31 ▼4.28
Media Library /wp-admin/upload.php3.33 ▲0.1036.23 ▲1.11
All Counters /wp-admin/admin.php?page=counter-box3.4334.89

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 81 new files
Database: 1 new table, 6 new options
New tables
wp_counter_box
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Counter Box - WordPress plugin for countdown, timer, counter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲3414.38 ▼0.181.87 ▲0.1543.28 ▲2.91
Dashboard /wp-admin2,229 ▲555.63 ▲0.0983.61 ▼18.7038.88 ▼4.04
Posts /wp-admin/edit.php2,131 ▲312.02 ▼0.0040.22 ▼0.5935.48 ▼2.04
Add New Post /wp-admin/post-new.php1,551 ▲1423.61 ▲5.37662.71 ▲20.7350.83 ▼18.56
Media Library /wp-admin/upload.php1,434 ▲344.21 ▲0.0696.17 ▼8.4043.42 ▲0.09
All Counters /wp-admin/admin.php?page=counter-box1,0982.0940.1927.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_counter_box
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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 take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr__() in wp-content/plugins/counter-box/admin/settings/options/style.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr__() in wp-content/plugins/counter-box/admin/settings/options/settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr__() in wp-content/plugins/counter-box/admin/settings/options/content.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=counter-box
    • > Javascript (severe) in unknown
    /wp-content/plugins/counter-box/admin/assets/js/script.min.js?ver=1.2.3 0:1993 Uncaught TypeError: Cannot read properties of undefined (reading 'toString')
    • > GET request to /wp-admin/admin.php?page=counter-box
    • > Javascript (severe) in unknown
    /wp-content/plugins/counter-box/admin/assets/js/preview.min.js?ver=1.2.3 0:53 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Example), #2 (Backend), #3 (Backend), #4 (Frontend), #5 (Frontend)
The official readme.txt might help

counter-box/counter-box.php 92% from 13 tests

The principal PHP file in "Counter Box - WordPress plugin for countdown, timer, counter" v. 1.2.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin11,740 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,741237,587
PHP324815263,180
JavaScript12192178973

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity20.75
▷ Minimum class complexity3.00
▷ Maximum class complexity38.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods51
▷ Static methods1121.57%
▷ Public methods4078.43%
▷ Protected methods11.96%
▷ Private methods1019.61%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
15 PNG files occupy 0.49MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png83.63KB27.05KB▼ 67.65%
admin/assets/img/code-solid.png27.79KB9.27KB▼ 66.63%
screenshot-2.png35.43KB9.78KB▼ 72.41%
admin/assets/img/palette-solid.png22.60KB6.90KB▼ 69.47%
screenshot-5.png84.55KB26.82KB▼ 68.28%