62% nutritionwp

Code Review | NutritionWP

WordPress plugin NutritionWP scored 62% from 54 tests.

About plugin

  • Plugin page: nutritionwp
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.4
  • WordPress version: 6.3.1
  • First release: May 15, 2017
  • Latest release: Oct 13, 2020
  • Number of updates: 41
  • Update frequency: every 30.4 days
  • Top authors: rescuethemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 3,843 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.00MB] [CPU: ▼38.32ms] Passed 4 tests

A check of server-side resources used by NutritionWP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1025.13 ▼21.18
Dashboard /wp-admin2.94 ▼0.3619.13 ▼25.95
Posts /wp-admin/edit.php2.94 ▼0.4119.83 ▼25.01
Add New Post /wp-admin/post-new.php2.94 ▼2.9417.80 ▼81.12
Media Library /wp-admin/upload.php2.94 ▼0.2917.58 ▼16.49
Add New Recipe /wp-admin/post-new.php?post_type=nutritionwp-recipe2.9419.45
Special Diets /wp-admin/edit-tags.php?taxonomy=nutritionwp-special-diet&post_type=nutritionwp-recipe2.9420.04
Occasions /wp-admin/edit-tags.php?taxonomy=nutritionwp-occasion&post_type=nutritionwp-recipe2.9419.88
Settings /wp-admin/edit.php?post_type=nutritionwp-recipe&page=nwp-settings2.9418.32
Courses /wp-admin/edit-tags.php?taxonomy=nutritionwp-course&post_type=nutritionwp-recipe2.9418.27
Recipes /wp-admin/edit.php?post_type=nutritionwp-recipe2.9419.01
Cuisines /wp-admin/edit-tags.php?taxonomy=nutritionwp-cuisine&post_type=nutritionwp-recipe2.9418.98

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 248 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for NutritionWP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲8413.17 ▼1.081.53 ▼0.3940.36 ▼4.55
Dashboard /wp-admin2,253 ▲684.92 ▼0.9697.02 ▼2.3372.09 ▲30.14
Posts /wp-admin/edit.php2,142 ▲532.00 ▲0.0135.50 ▲0.5934.15 ▲0.57
Add New Post /wp-admin/post-new.php1,556 ▲3717.46 ▼5.62753.21 ▲85.7751.15 ▼7.44
Media Library /wp-admin/upload.php1,435 ▲504.29 ▲0.0697.67 ▼2.8173.60 ▲28.17
Add New Recipe /wp-admin/post-new.php?post_type=nutritionwp-recipe3,1219.37214.17114.93
Special Diets /wp-admin/edit-tags.php?taxonomy=nutritionwp-special-diet&post_type=nutritionwp-recipe1,2872.1629.0429.68
Occasions /wp-admin/edit-tags.php?taxonomy=nutritionwp-occasion&post_type=nutritionwp-recipe1,2872.1626.4831.31
Settings /wp-admin/edit.php?post_type=nutritionwp-recipe&page=nwp-settings9282.0823.4724.49
Courses /wp-admin/edit-tags.php?taxonomy=nutritionwp-course&post_type=nutritionwp-recipe1,2842.2826.5429.54
Recipes /wp-admin/edit.php?post_type=nutritionwp-recipe1,1591.9534.0330.47
Cuisines /wp-admin/edit-tags.php?taxonomy=nutritionwp-cuisine&post_type=nutritionwp-recipe1,2842.1625.9930.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/nutritionwp/admin/CMB2/includes/helper-functions.php+44
    include_once(wp-content/plugins/nutritionwp/admin/CMB2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

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
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nutritionwp-cuisine&post_type=nutritionwp-recipe
    • > Warning in wp-content/plugins/nutritionwp/admin/CMB2/includes/helper-functions.php+44
    include_once(wp-content/plugins/nutritionwp/admin/CMB2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nutritionwp-cuisine&post_type=nutritionwp-recipe
    • > Warning in wp-content/plugins/nutritionwp/admin/CMB2/includes/helper-functions.php+44
    include_once(): Failed opening 'wp-content/plugins/nutritionwp/admin/CMB2/includes/CMB2_Hookup.php' for inclusion (include_path='.:/usr/share/php')
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=nutritionwp-cuisine&post_type=nutritionwp-recipe
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'CMB2_Hookup' not found
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=nutritionwp-recipe&page=nwp-settings
    • > Notice in wp-content/plugins/nutritionwp/admin/partials/nutritionwp-admin-display.php+83
    Trying to access array offset on value of type bool

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/nutritionwp/public/partials/nutritionwp-public-display.php
  • 74× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2/includes/types/CMB2_Type_Title.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/nutritionwp/admin/CMB2old/includes/CMB2_hookup.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

nutritionwp/nutritionwp.php Passed 13 tests

This is the main PHP file of "NutritionWP" version 1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
71 characters long description:
Super easy free recipe plugin with nutritional facts. Made by a foodie!

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
There were no executable files found in this plugin29,301 lines of code in 186 files:
LanguageFilesBlank linesComment linesLines of code
PHP1154,29812,01013,936
CSS241,3942,3449,469
JavaScript126188662,413
Sass30506512,279
Markdown539701,204

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity17.60
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes142
▷ Abstract classes1812.68%
▷ Concrete classes12487.32%
▷ Final classes00.00%
Methods1,096
▷ Static methods17215.69%
▷ Public methods91683.58%
▷ Protected methods16414.96%
▷ Private methods161.46%
Functions53
▷ Named functions53100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants633.33%
▷ Class constants1266.67%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
29 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/CMB2old/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
admin/CMB2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
admin/CMB2old/images/ico-delete.png0.70KB0.72KB0.00%
admin/CMB2old/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
admin/CMB2old/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%