73% recipes

Code Review | Recipes

WordPress plugin Recipes scored73%from 54 tests.

About plugin

  • Plugin page: recipes
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7.2
  • WordPress version: 6.3.1
  • First release: Aug 2, 2016
  • Latest release: Feb 5, 2017
  • Number of updates: 8
  • Update frequency: every 23.4 days
  • Top authors: aristath (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /6,539 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼3.88ms] Passed 4 tests

This is a short check of server-side resources used by Recipes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6045.83 ▲1.51
Dashboard /wp-admin3.89 ▲0.5951.42 ▼1.91
Posts /wp-admin/edit.php3.96 ▲0.6155.98 ▲0.63
Add New Post /wp-admin/post-new.php5.98 ▲0.0987.58 ▼15.76
Media Library /wp-admin/upload.php3.74 ▲0.5141.69 ▲4.25
Recipe Tag /wp-admin/edit-tags.php?taxonomy=recipe-tag&post_type=recipe3.7442.85
All Recipes /wp-admin/edit.php?post_type=recipe3.8540.90
Add New /wp-admin/post-new.php?post_type=recipe3.9857.28
Install Plugins /wp-admin/edit.php?post_type=recipe&page=tgmpa-install-plugins3.8237.71
Recipe Category /wp-admin/edit-tags.php?taxonomy=recipe-category&post_type=recipe3.7438.56

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Recipes
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲16513.53 ▼0.775.12 ▲3.3441.03 ▲1.31
Dashboard /wp-admin2,287 ▲1024.94 ▼0.91122.80 ▲19.1645.96 ▲2.07
Posts /wp-admin/edit.php2,181 ▲922.31 ▲0.2550.27 ▲9.5341.16 ▲11.07
Add New Post /wp-admin/post-new.php1,588 ▲5517.81 ▼5.50692.28 ▲28.0456.34 ▲6.91
Media Library /wp-admin/upload.php1,477 ▲924.34 ▲0.10100.86 ▲2.2249.19 ▲1.02
Recipe Tag /wp-admin/edit-tags.php?taxonomy=recipe-tag&post_type=recipe1,3302.0935.1336.62
All Recipes /wp-admin/edit.php?post_type=recipe1,2052.2733.0843.13
Add New /wp-admin/post-new.php?post_type=recipe2,9108.06196.4785.99
Install Plugins /wp-admin/edit.php?post_type=recipe&page=tgmpa-install-plugins1,0161.8625.9831.15
Recipe Category /wp-admin/edit-tags.php?taxonomy=recipe-category&post_type=recipe1,3552.1431.6132.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=recipe-category&post_type=recipe
    • > Notice in wp-content/plugins/recipes/includes/class-recipes-metabox.php+100
    Undefined index: data
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=recipe-category&post_type=recipe
    • > Notice in wp-content/plugins/recipes/includes/class-recipes-metabox.php+104
    Undefined index: path
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=recipe-category&post_type=recipe
    • > Warning in wp-content/plugins/recipes/includes/class-recipes-metabox.php+104
    include(): Filename cannot be empty
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=recipe-category&post_type=recipe
    • > Warning in wp-content/plugins/recipes/includes/class-recipes-metabox.php+104
    include(): Failed opening '' for inclusion (include_path='.:/usr/share/php')

SRP 0% 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 take a closer look at the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/recipes/includes/template-steps.php
    • > /wp-content/plugins/recipes/includes/template-ingredients.php
    • > /wp-content/plugins/recipes/includes/template-general-info.php
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Recipes_Metabox' not found in wp-content/plugins/recipes/includes/class-recipes-metabox-general-info.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/recipes/templates/content-single-recipe-execution.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/recipes/templates/content-single-recipe-general-info.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function has_post_thumbnail() in wp-content/plugins/recipes/templates/content-single-recipe-featured-image.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Recipes_Metabox' not found in wp-content/plugins/recipes/includes/class-recipes-metabox-ingredients.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_title() in wp-content/plugins/recipes/templates/content-single-recipe-title.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/recipes/includes/post-type.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/recipes/includes/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/recipes/includes/taxonomies.php:82
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/recipes/recipes.php:79

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: cooking, custom post type, recipes, chef, custom taxonomy

recipes/recipes.php Passed 13 tests

The main PHP script in "Recipes" version 1.2.1 is automatically included on every request by WordPress
39 characters long description:
Recipes plugin with simplicity in mind.

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
There were no executable files found in this plugin3,366 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP216982,0512,567
Markdown11210553
Sass2140131
CSS22099
JavaScript10116

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.48
Average class complexity29.85
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods131
▷ Static methods53.82%
▷ Public methods10378.63%
▷ Protected methods2317.56%
▷ Private methods53.82%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin