90% random-dog

Code Review | Random Dog

WordPress plugin Random Dog scored90%from 54 tests.

About plugin

  • Plugin page: random-dog
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Mar 25, 2021
  • Latest release: Mar 25, 2021
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: monolithon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /385 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.68ms] Passed 4 tests

Analyzing server-side resources used by Random Dog
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.71 ▲3.04
Dashboard /wp-admin3.33 ▼0.0156.67 ▼8.15
Posts /wp-admin/edit.php3.38 ▲0.0350.75 ▲1.92
Add New Post /wp-admin/post-new.php5.91 ▲0.0396.92 ▼11.54
Media Library /wp-admin/upload.php3.25 ▲0.0337.72 ▲3.08

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_random_dog_js_widget
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_random_dog_widget
db_upgraded

Browser metrics Passed 4 tests

Random Dog: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.75 ▲0.141.66 ▲0.1344.41 ▲0.52
Dashboard /wp-admin2,195 ▲215.62 ▲0.0296.86 ▲5.0443.03 ▼1.32
Posts /wp-admin/edit.php2,097 ▼31.97 ▲0.0039.13 ▲1.9536.60 ▼1.41
Add New Post /wp-admin/post-new.php1,536 ▼218.27 ▼5.01597.63 ▼87.7061.67 ▲10.65
Media Library /wp-admin/upload.php1,397 ▼04.20 ▼0.03100.70 ▲2.1945.10 ▲3.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • db_upgraded
    • widget_recent-posts
    • widget_random_dog_js_widget
    • widget_random_dog_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: images, dogs, dog, image, shortcode

random-dog/random-dog.php Passed 13 tests

"Random Dog" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
122 characters long description:
This plugin adds widgets and shortcodes that show dogs randomly. Dogs are fetched from Dogs API(https://dog.ceo/dog-api/).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected94 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3204594

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin