72% food-to-prep

Code Review | Food To Prep

WordPress plugin Food To Prep scored72%from 54 tests.

About plugin

  • Plugin page: food-to-prep
  • Plugin version: 0.1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2.1
  • WordPress version: 6.3.1
  • First release: Sep 27, 2019
  • Latest release: Oct 24, 2019
  • Number of updates: 28
  • Update frequency: every 1.0 days
  • Top authors: tweakdigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /787 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.36MB] [CPU: ▼21.04ms] Passed 4 tests

Server-side resources used by Food To Prep
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0725.84 ▼9.65
Dashboard /wp-admin3.82 ▲0.5242.35 ▼0.34
Posts /wp-admin/edit.php3.66 ▲0.3128.49 ▼18.14
Add New Post /wp-admin/post-new.php3.69 ▼2.2040.31 ▼56.02
Media Library /wp-admin/upload.php3.82 ▲0.5940.35 ▲5.74
All Meals /wp-admin/edit.php?post_type=meal3.6734.54
Add New /wp-admin/post-new.php?post_type=meal3.6837.83
Categories /wp-admin/edit-tags.php?taxonomy=meal-category&post_type=meal3.8441.12
All Orders /wp-admin/edit.php?post_type=mp-order3.6734.67
Payment Settings /wp-admin/edit.php?post_type=mp-order&page=ftp-settings3.8236.17
Supports /wp-admin/edit.php?post_type=mp-order&page=ftp-supports3.8234.05

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 286 new files
Database: no new tables, 8 new options
New WordPress options
meal_prep_paypal_express
meal_prep_other
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Food To Prep
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,116 ▲33015.70 ▲1.137.11 ▲5.3344.65 ▲5.31
Dashboard /wp-admin2,413 ▲2326.36 ▲0.65115.12 ▲13.2741.11 ▲0.38
Posts /wp-admin/edit.php2,344 ▲2443.53 ▲1.4950.90 ▲16.3530.83 ▼7.44
Add New Post /wp-admin/post-new.php1,591 ▲6322.39 ▼0.68658.46 ▲14.4036.79 ▼13.88
Media Library /wp-admin/upload.php1,478 ▲754.33 ▲0.0683.16 ▼23.5943.77 ▼3.99
All Meals /wp-admin/edit.php?post_type=meal1,3413.5444.2526.61
Add New /wp-admin/post-new.php?post_type=meal2,6677.98167.5267.68
Categories /wp-admin/edit-tags.php?taxonomy=meal-category&post_type=meal1,5183.3740.0530.66
All Orders /wp-admin/edit.php?post_type=mp-order1,3233.6048.5826.76
Payment Settings /wp-admin/edit.php?post_type=mp-order&page=ftp-settings1,2363.4848.1632.14
Supports /wp-admin/edit.php?post_type=mp-order&page=ftp-supports1,0363.2138.4421.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • meal_prep_paypal_express
    • can_compress_scripts
    • db_upgraded
    • meal_prep_other
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=mp-order
    • > User notice in wp-includes/functions.php+5905
    Function is_main_query was called incorrectly. In pre_get_posts, use the WP_Query->is_main_query() method, not the is_main_query() function. See https://developer.wordpress.org/reference/functions/is_main_query/. Please see Debugging in WordPress for more information. (This message was added in version 3.7.0.)
    • > GET request to /wp-admin/post-new.php?post_type=meal
    • > Notice in wp-content/plugins/food-to-prep/post-types/CPT_MP_Meal.php+224
    Undefined index: quantity
    • > GET request to /wp-admin/post-new.php?post_type=meal
    • > Notice in wp-content/plugins/food-to-prep/post-types/CPT_MP_Meal.php+225
    Undefined index: unit

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/food-to-prep/templates/cart/mini-cart.php
  • 159× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/ShippingCost.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/WebhookEvent.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Presentation.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'PayPal\\Handler\\IPayPalHandler' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Handler/RestHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/FmfDetails.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/PaymentOptions.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/MerchantInfo.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/OpenIdUserinfo.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Links.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/food-to-prep/vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/InstallmentOption.php:19

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: These screenshots need descriptions #10, #11, #8, #9 in food-to-prep/assets to your readme.txt
  • Tags: There are too many tags (13 tag instead of maximum 10)
You can look at the official readme.txt

food-to-prep/food-to-prep.php Passed 13 tests

This is the main PHP file of "Food To Prep" version 0.1.12, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
30 characters long description:
Food To Prep by Tweak Digital.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected18,049 lines of code in 269 files:
LanguageFilesBlank linesComment linesLines of code
PHP2223,56515,73016,326
Sass1819512852
Markdown51260427
JSON500200
JavaScript126242195
XML14032
CSS62717

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity3.96
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces16
Interfaces5
Traits2
Classes193
▷ Abstract classes63.11%
▷ Concrete classes18796.89%
▷ Final classes00.00%
Methods2,276
▷ Static methods924.04%
▷ Public methods2,22897.89%
▷ Protected methods80.35%
▷ Private methods401.76%
Functions25
▷ Named functions1872.00%
▷ Anonymous functions728.00%
Constants21
▷ Global constants29.52%
▷ Class constants1990.48%
▷ Public constants19100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin