84% pet-of-the-day-widget

Code Review | Pet of the Day Widget

WordPress plugin Pet of the Day Widget scored 84% from 54 tests.

About plugin

  • Plugin page: pet-of-the-day-wi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: Jan 15, 2018
  • Latest release: Jan 18, 2022
  • Number of updates: 29
  • Update frequency: every 50.5 days
  • Top authors: ChrisHardie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 898 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 gracefully, with no errors

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

This is a short check of server-side resources used by Pet of the Day Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.02 ▲4.63
Dashboard /wp-admin3.32 ▲0.0147.63 ▲3.55
Posts /wp-admin/edit.php3.37 ▲0.0142.75 ▼5.38
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.11 ▼9.57
Media Library /wp-admin/upload.php3.24 ▲0.0135.93 ▲2.64

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_pet_of_the_day_widget
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Pet of the Day Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1113.17 ▲0.001.76 ▲0.0943.38 ▼0.72
Dashboard /wp-admin2,203 ▼35.83 ▼0.0497.72 ▼7.4938.70 ▲1.80
Posts /wp-admin/edit.php2,089 ▼32.04 ▼0.1036.35 ▼4.6231.52 ▼2.42
Add New Post /wp-admin/post-new.php1,514 ▼1917.58 ▼5.23642.89 ▼5.7556.98 ▼5.18
Media Library /wp-admin/upload.php1,391 ▲34.23 ▲0.0595.06 ▼2.8441.39 ▼3.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_pet_of_the_day_widget
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/pet-of-the-day-widget/pet-of-the-day-widget.php

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: animals, adoption, pets, adoptable pets, adopt-me

pet-of-the-day-widget/pet-of-the-day-widget.php Passed 13 tests

This is the main PHP file of "Pet of the Day Widget" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
53 characters long description:
Display an Adopt-a-Pet.com pet of the day in a widget

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin79 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1275679

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.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%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.25MB with 0.18MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png49.10KB13.34KB▼ 72.83%
screenshot-1.png205.95KB57.42KB▼ 72.12%