83% spoonacular-widgets

Code Review | spoonacular recipe visualizer

WordPress plugin spoonacular recipe visualizer scored83%from 54 tests.

About plugin

  • Plugin page: spoonacular-widgets
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.3
  • WordPress version: 6.3.1
  • First release: Dec 1, 2014
  • Latest release: Nov 18, 2015
  • Number of updates: 7
  • Update frequency: every 50.3 days
  • Top authors: dsky (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,210 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.09MB] [CPU: ▼9.74ms] Passed 4 tests

This is a short check of server-side resources used by spoonacular recipe visualizer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.52 ▼1.80
Dashboard /wp-admin3.33 ▲0.0344.20 ▼5.36
Posts /wp-admin/edit.php3.38 ▲0.0242.94 ▼3.71
Add New Post /wp-admin/post-new.php5.47 ▼0.4269.13 ▼28.09
Media Library /wp-admin/upload.php3.25 ▲0.0236.43 ▲6.72

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

spoonacular recipe visualizer: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.38 ▼1.221.50 ▼0.2741.30 ▼2.49
Dashboard /wp-admin2,214 ▲295.79 ▲0.9399.52 ▼16.9637.39 ▼7.70
Posts /wp-admin/edit.php2,097 ▲82.01 ▼0.1137.44 ▲1.2533.11 ▼1.28
Add New Post /wp-admin/post-new.php1,785 ▲25721.19 ▲2.98692.65 ▲71.2566.57 ▲0.92
Media Library /wp-admin/upload.php1,399 ▲144.20 ▼0.07102.15 ▲3.2239.34 ▼6.66

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/spoonacular-widgets/spoonacular.php:37
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/spoonacular-widgets/template/price.php:4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/spoonacular-widgets/template/ingredient.php:5
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/spoonacular-widgets/template/nutrition.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

spoonacular-widgets/spoonacular.php 85% from 13 tests

The main file in "spoonacular recipe visualizer" v. 1.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("spoonacular-widgets.php" instead of "spoonacular.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 439 characters long)

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
Everything looks great! No dangerous files found in this plugin1,676 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS339761,320
PHP44825341
JavaScript21115

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.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%
Constants2
▷ Global constants2100.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