84% day-counter

Code Review | Day Counter

WordPress plugin Day Counter scored84%from 54 tests.

About plugin

  • Plugin page: day-counter
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Jan 6, 2022
  • Latest release: Mar 22, 2022
  • Number of updates: 7
  • Update frequency: every 10.7 days
  • Top authors: charlestsmith (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /757 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Day Counter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0541.90 ▼0.34
Dashboard /wp-admin3.39 ▲0.0552.17 ▼5.84
Posts /wp-admin/edit.php3.50 ▲0.1148.49 ▼3.40
Add New Post /wp-admin/post-new.php5.97 ▲0.0487.38 ▼15.03
Media Library /wp-admin/upload.php3.31 ▲0.0436.04 ▼7.73
Day counter /wp-admin/tools.php?page=DC_add_menu_page3.2833.78

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Day Counter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.38 ▼0.151.78 ▼0.2845.39 ▼6.26
Dashboard /wp-admin2,198 ▲245.48 ▼0.0599.14 ▲1.9238.61 ▼7.98
Posts /wp-admin/edit.php2,106 ▲62.02 ▲0.0232.48 ▼5.4031.56 ▼2.13
Add New Post /wp-admin/post-new.php1,531 ▲323.69 ▲0.53726.94 ▲54.2366.35 ▲1.78
Media Library /wp-admin/upload.php1,409 ▲124.18 ▲0.0898.22 ▼12.4343.82 ▼4.23
Day counter /wp-admin/tools.php?page=DC_add_menu_page8511.9822.3121.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/day-counter/day-counter.php:19

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, but this is not an exhaustive test

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
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #2 (Set Shortcode in page or post), #3 (Show result)
The official readme.txt is a good inspiration

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

The main file in "Day Counter" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.5" instead of "5.0")

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
Everything looks great! No dangerous files found in this plugin344 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP86817255
CSS17089

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.38
Average class complexity5.17
▷ Minimum class complexity2.00
▷ Maximum class complexity12.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods13
▷ Static methods215.38%
▷ Public methods1184.62%
▷ Protected methods215.38%
▷ 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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin