84% simple-stopwatch

Code Review | Simple Stopwatch

WordPress plugin Simple Stopwatch scored84%from 54 tests.

About plugin

  • Plugin page: simple-stopwatch
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.8+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Feb 27, 2020
  • Latest release: Jan 31, 2022
  • Number of updates: 5
  • Update frequency: every 140.8 days
  • Top authors: ravisinghit (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /2,469 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.88ms] Passed 4 tests

A check of server-side resources used by Simple Stopwatch
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.81 ▲6.17
Dashboard /wp-admin3.31 ▲0.0144.85 ▼1.25
Posts /wp-admin/edit.php3.36 ▲0.0147.04 ▲2.55
Add New Post /wp-admin/post-new.php5.91 ▲0.0381.83 ▼13.19
Media Library /wp-admin/upload.php3.24 ▲0.0134.56 ▼3.63

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Stopwatch
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲16613.62 ▼0.765.16 ▲3.4635.42 ▼3.34
Dashboard /wp-admin2,207 ▲184.82 ▼1.23105.54 ▲1.9738.53 ▼0.87
Posts /wp-admin/edit.php2,093 ▲12.00 ▼0.0539.33 ▼1.6333.82 ▲1.80
Add New Post /wp-admin/post-new.php1,396 ▼12318.43 ▼4.71616.59 ▼50.1257.39 ▲8.61
Media Library /wp-admin/upload.php1,395 ▲74.19 ▼0.0496.06 ▼11.1444.72 ▲0.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/simple-stopwatch/public/partials/simple-stopwatch-public-display.php
    • > /wp-content/plugins/simple-stopwatch/admin/partials/simple-stopwatch-admin-display.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Simple Stopwatch === )
You can look at the official readme.txt

simple-stopwatch/simple-stopwatch.php Passed 13 tests

This is the main PHP file of "Simple Stopwatch" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
84 characters long description:
Simple Stopwatch with start, pause and reset button. Use shortcode [simplestopwatch]

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected214 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12117535174
JavaScript232740
CSS2080

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin