84% orens-unsplash-widget

Code Review | Oren's Unsplash Widget

WordPress plugin Oren's Unsplash Widget scored84%from 54 tests.

About plugin

  • Plugin page: orens-unsplash-wi...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 28, 2020
  • Latest release: Feb 28, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: Ornani (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /414 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.31ms] Passed 4 tests

An overview of server-side resources used by Oren's Unsplash Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.74 ▼2.62
Dashboard /wp-admin3.35 ▲0.0444.56 ▼4.49
Posts /wp-admin/edit.php3.40 ▲0.0445.39 ▲0.02
Add New Post /wp-admin/post-new.php5.93 ▲0.0498.82 ▲11.44
Media Library /wp-admin/upload.php3.27 ▲0.0434.56 ▲1.87

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: 8 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
widget_unsplash_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Oren's Unsplash Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.41 ▼0.081.61 ▼0.6042.93 ▼2.83
Dashboard /wp-admin2,195 ▲185.56 ▼0.1092.42 ▼9.0440.65 ▼4.09
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0741.24 ▲3.2536.60 ▲5.75
Add New Post /wp-admin/post-new.php1,526 ▼1122.95 ▲4.90662.27 ▲47.5056.15 ▼9.94
Media Library /wp-admin/upload.php1,400 ▼34.21 ▲0.0095.96 ▲1.8143.33 ▲1.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_unsplash_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

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)
Everything seems fine, however this is by no means 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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/orens-unsplash-widget/orens-unsplash-widget.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/orens-unsplash-widget/inc/class-unsplash-widget.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: photostream, photos, widget, sidebar, unsplash

orens-unsplash-widget/orens-unsplash-widget.php Passed 13 tests

Analyzing the main PHP file in "Oren's Unsplash Widget" version 1.0.0
61 characters long description:
Quickly display your Unsplash photos inside WordPress widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected191 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24731138
PO File1111136
CSS11017

PHP code Passed 2 tests

Analyzing 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.13
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG files were detected