84% counter-widget

Code Review | Counter Widget

WordPress plugin Counter Widget scored84%from 54 tests.

About plugin

  • Plugin page: counter-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Dec 22, 2015
  • Latest release: Dec 22, 2015
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: devmatte (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /6,590 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

This is a short check of server-side resources used by Counter Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.31 ▲0.65
Dashboard /wp-admin3.34 ▲0.0344.81 ▼2.32
Posts /wp-admin/edit.php3.39 ▲0.0344.25 ▼5.46
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.32 ▼16.69
Media Library /wp-admin/upload.php3.26 ▲0.0332.33 ▼1.15

Server storage [IO: ▲0.01MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
widget_cw_counts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Counter Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.25 ▼0.161.90 ▲0.2844.60 ▲3.89
Dashboard /wp-admin2,198 ▲185.60 ▼0.0684.09 ▼6.4041.32 ▼4.30
Posts /wp-admin/edit.php2,097 ▼02.01 ▲0.0133.36 ▼1.1135.16 ▼2.16
Add New Post /wp-admin/post-new.php1,526 ▼222.89 ▼0.37670.43 ▲64.7550.27 ▼3.16
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.0094.32 ▲0.2142.11 ▼3.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_cw_counts

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)
Even though everything seems fine, this is not 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 items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/counter-widget/counter_widget.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: category count, user count, comment count, counter widget, post count...

counter-widget/counter_widget.php 92% from 13 tests

"Counter Widget" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("counter-widget.php" instead of "counter_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected186 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12819150
CSS16036

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected