10% wpchef

Code Review | WPChef

WordPress plugin WPChef scored10%from 54 tests.

About plugin

  • Plugin page: wpchef
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.9.5
  • WordPress version: 6.3.1
  • First release: Apr 6, 2018
  • Latest release: Apr 17, 2018
  • Number of updates: 6
  • Update frequency: every 1.8 days
  • Top authors: wpchefgadget (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,124 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/wpchef/wpchef.php+2754
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼0.87MB] [CPU: ▼55.47ms] Passed 4 tests

Analyzing server-side resources used by WPChef
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.12 ▼0.358.92 ▼36.48
Dashboard /wp-admin3.14 ▼0.178.37 ▼44.95
Posts /wp-admin/edit.php3.14 ▼0.2210.09 ▼44.30
Add New Post /wp-admin/post-new.php3.14 ▼2.758.60 ▼96.13
Media Library /wp-admin/upload.php3.14 ▼0.0912.17 ▼24.76
Installed Recipes /wp-admin/admin.php?page=recipes3.149.71
/wp-admin/admin.php?page=recipe-create3.148.99
Settings /wp-admin/admin.php?page=recipe-settings3.149.15
Add New /wp-admin/admin.php?page=recipe-install3.148.43
/wp-admin/admin.php?page=recipe-editor3.149.11

Server storage [IO: ▲0.40MB] [DB: ▲0.02MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for WPChef
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲13013.25 ▼1.461.90 ▲0.2643.43 ▼0.53
Dashboard /wp-admin2,285 ▲1085.85 ▲0.1891.68 ▲4.0578.56 ▲35.47
Posts /wp-admin/edit.php2,209 ▲1092.55 ▲0.5346.14 ▲7.2136.69 ▼0.63
Add New Post /wp-admin/post-new.php1,586 ▲5823.27 ▲0.18766.85 ▲63.4838.23 ▼13.29
Media Library /wp-admin/upload.php1,496 ▲934.40 ▲0.24105.47 ▼6.5869.35 ▲19.93
Installed Recipes /wp-admin/admin.php?page=recipes9222.1045.6235.60
/wp-admin/admin.php?page=recipe-create1,4552.4447.6846.13
Settings /wp-admin/admin.php?page=recipe-settings9031.9732.5125.94
Add New /wp-admin/admin.php?page=recipe-install2,1202.2239.6141.25
/wp-admin/admin.php?page=recipe-editor8841.9832.4120.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/wpchef/wpchef.php+2754
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_chef_options_snapshot
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=recipe-editor
    • > Warning in wp-content/plugins/wpchef/wpchef.php+2754
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=recipe-editor
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
    • > GET request to /wp-admin/admin.php?page=recipes
    • > Notice in wp-content/plugins/wpchef/wpchef.php+1032
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=recipe-install
    • > Notice in wp-content/plugins/wpchef/wpchef.php+1082
    Undefined index: tab
    • > GET request to /wp-admin/admin.php?page=recipe-install
    • > Notice in wp-content/plugins/wpchef/wpchef.php+1097
    Undefined index: p
    • > GET request to /wp-admin/admin.php?page=recipe-install
    • > Notice in wp-content/plugins/wpchef/inc/add.tpl.php+41
    Undefined index: s
    • > GET request to /wp-admin/admin.php?page=recipe-editor
    • > Notice in wp-content/plugins/wpchef/wpchef.php+1347
    Undefined index: recipe
    • > GET request to /wp-admin/admin.php?page=recipe-editor
    • > Notice in wp-content/plugins/wpchef/wpchef.php+1348
    Undefined index: recipe_new

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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpchef/inc/options_snapshot.tpl.php
  • 36× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant HOUR_IN_SECONDS - assumed 'HOUR_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpchef/wpchef.php on line 34
    • > PHP Notice
      Undefined variable: recipe in wp-content/plugins/wpchef/inc/apply-inline.tpl.php on line 137
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wpchef/inc/settings.tpl.php:3
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wpchef/wpchef.php on line 2754
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wpchef/inc/recipe-edit-info.tpl.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpchef/inc/apply-inline.tpl.php on line 37
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wpchef/inc/upload.tpl.php:1
    • > PHP Warning
      Use of undefined constant HOUR_IN_SECONDS - assumed 'HOUR_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpchef/wpchef.php on line 33
    • > PHP Notice
      Undefined variable: uninstall in wp-content/plugins/wpchef/inc/apply-inline.tpl.php on line 136
    • > PHP Notice
      Undefined variable: recipe in wp-content/plugins/wpchef/inc/apply-inline.tpl.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
No tags were found

wpchef/wpchef.php 92% from 13 tests

The main PHP script in "WPChef" version 2.1.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 149 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
Good job! No executable or dangerous file extensions detected9,845 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP171,6081897,086
CSS4841242,165
JavaScript215813594

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity171.83
▷ Minimum class complexity23.00
▷ Maximum class complexity654.00
Average method complexity6.42
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods189
▷ Static methods10.53%
▷ Public methods17994.71%
▷ Protected methods94.76%
▷ Private methods10.53%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
14 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/jquery-ui-smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png0.21KB0.08KB▼ 58.96%
wpchef.png1.13KB0.37KB▼ 67.16%
assets/jquery-ui-smoothness/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
assets/jquery-ui-smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
assets/jquery-ui-smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%