10% food-recipes

Code Review | Food Recipes

WordPress plugin Food Recipes scored10%from 54 tests.

About plugin

  • Plugin page: food-recipes
  • Plugin version: 2.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.1-6.3
  • WordPress version: 6.3.1
  • First release: Dec 20, 2020
  • Latest release: Aug 24, 2023
  • Number of updates: 17
  • Update frequency: every 57.6 days
  • Top authors: wpt00ls (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,645 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/food-recipes/freemius/require.php+16
    require_once(wp-content/plugins/food-recipes/freemius/includes/fs-html-escaping-functions.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.66ms] Passed 4 tests

Analyzing server-side resources used by Food Recipes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.07 ▼4.80
Dashboard /wp-admin3.31 ▲0.0049.16 ▼6.25
Posts /wp-admin/edit.php3.36 ▲0.0047.35 ▼1.83
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.71 ▼1.74
Media Library /wp-admin/upload.php3.23 ▲0.0034.62 ▼0.16

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Food Recipes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.69 ▲0.391.61 ▼0.1939.91 ▼6.20
Dashboard /wp-admin2,198 ▲245.62 ▲0.0887.07 ▼11.1941.00 ▼2.36
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0440.15 ▲2.1437.23 ▼1.55
Add New Post /wp-admin/post-new.php1,526 ▼023.59 ▼0.09628.20 ▼59.7749.10 ▼10.26
Media Library /wp-admin/upload.php1,400 ▲34.23 ▲0.12102.73 ▲0.0646.87 ▲1.70

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • fs_debug_mode
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_active_plugins
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/food-recipes/resources/views/divi/partials/instruction_step.php
    • > /wp-content/plugins/food-recipes/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 166× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/food-recipes/resources/views/divi/servings.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/food-recipes/vendor/htmlburger/carbon-fields/core/Service/Revisions_Service.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Post_Meta_Datastore' not found in wp-content/plugins/food-recipes/vendor/htmlburger/carbon-fields/core/Datastore/Nav_Menu_Item_Datastore.php:7
    • > PHP Notice
      Undefined variable: author in wp-content/plugins/food-recipes/resources/views/divi/author.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/food-recipes/vendor/htmlburger/carbon-fields/core/Field/Hidden_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PHPSTORM_META\\override() in wp-content/plugins/food-recipes/vendor/htmlburger/carbon-fields/.phpstorm.meta.php/ioc.meta.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/food-recipes/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Datastore\\Datastore_Holder_Interface' not found in wp-content/plugins/food-recipes/vendor/htmlburger/carbon-fields/core/Container/Container.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/food-recipes/post-types/wpt-food-ingredients.php:52
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Event\\Listener' not found in wp-content/plugins/food-recipes/vendor/htmlburger/carbon-fields/core/Event/PersistentListener.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: divi recipe, divi, food, recipe, food recipe

food-recipes/food-recipes.php Passed 13 tests

The main file in "Food Recipes" v. 2.6.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
53 characters long description:
Easy to use recipe plugin with Divi & SEO integration

Code Analysis 97% from 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 detected70,056 lines of code in 631 files:
LanguageFilesBlank linesComment linesLines of code
PHP32910,68224,72845,795
JavaScript1837,91512,12617,679
PO File268161,0172,194
CSS303411,1391,817
Sass4933501,749
JSON500525
Markdown5590113
reStructuredText19413597
YAML212174
XML11013

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity24.76
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces52
Interfaces9
Traits0
Classes218
▷ Abstract classes135.96%
▷ Concrete classes20594.04%
▷ Final classes31.46%
Methods2,422
▷ Static methods30012.39%
▷ Public methods1,87977.58%
▷ Protected methods1897.80%
▷ Private methods35414.62%
Functions275
▷ Named functions12144.00%
▷ Anonymous functions15456.00%
Constants160
▷ Global constants10565.62%
▷ Class constants5534.38%
▷ Public constants55100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/food-recipes.png9.00KB4.28KB▼ 52.46%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
images/recipe-equipment.png17.37KB6.96KB▼ 59.94%
images/open-link-icon.png0.25KB0.23KB▼ 8.59%