79% recent-shots-widget

Code Review | Recent Shots Widget

WordPress plugin Recent Shots Widget scored79%from 54 tests.

About plugin

  • Plugin page: recent-shots-widget
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Nov 1, 2017
  • Latest release: Nov 3, 2017
  • Number of updates: 5
  • Update frequency: every 1.0 days
  • Top authors: outlane (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /577 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

A check of server-side resources used by Recent Shots Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.62 ▲1.08
Dashboard /wp-admin3.32 ▲0.0147.53 ▼9.86
Posts /wp-admin/edit.php3.37 ▲0.0151.49 ▲3.09
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.84 ▼9.41
Media Library /wp-admin/upload.php3.24 ▲0.0138.74 ▲4.83

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent_shots_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Recent Shots Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5613.30 ▼1.124.67 ▲2.8245.00 ▲1.70
Dashboard /wp-admin2,218 ▲124.86 ▼0.02113.14 ▲9.0541.59 ▼3.86
Posts /wp-admin/edit.php2,100 ▼02.03 ▼0.0039.56 ▲0.7535.27 ▲1.38
Add New Post /wp-admin/post-new.php1,554 ▲2823.16 ▲5.64681.34 ▲80.9657.88 ▲4.32
Media Library /wp-admin/upload.php1,403 ▲94.18 ▼0.0095.55 ▼7.5945.33 ▲5.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent_shots_widget
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/recent-shots-widget/includes/widget-output.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: username in wp-content/plugins/recent-shots-widget/includes/widget-output.php on line 11
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/recent-shots-widget/includes/widget-output.php on line 15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/recent-shots-widget/includes/form.php:1
    • > PHP Notice
      Undefined variable: api_key in wp-content/plugins/recent-shots-widget/includes/widget-output.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/recent-shots-widget/recent-shots-widget.php:14
    • > PHP Notice
      Undefined variable: number in wp-content/plugins/recent-shots-widget/includes/widget-output.php on line 11
    • > PHP Notice
      Undefined variable: is_team in wp-content/plugins/recent-shots-widget/includes/widget-output.php on line 5
    • > PHP Warning
      file_get_contents(https://api.dribbble.com/v1/users//shots?per_page=&access_token=): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found\r in wp-content/plugins/recent-shots-widget/includes/widget-output.php on line 12
    • > PHP Notice
      Undefined variable: show_follow_btn in wp-content/plugins/recent-shots-widget/includes/widget-output.php on line 47

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 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
4 plugin tags: shot, feed, dribbble, widget

recent-shots-widget/recent-shots-widget.php Passed 13 tests

The main PHP script in "Recent Shots Widget" version 1.0.0 is automatically included on every request by WordPress
43 characters long description:
Displays user's recent shots from Dribbble.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin281 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP35020161
CSS1160110
SVG50010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity6.40
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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