68% food-business-gross-profit-calculator

Code Review | Food Business Gross Profit Calculator Plugin

WordPress plugin Food Business Gross Profit Calculator Plugin scored68%from 54 tests.

About plugin

  • Plugin page: food-business-gro...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Mar 21, 2015
  • Latest release: May 12, 2015
  • Number of updates: 4
  • Update frequency: every 13.2 days
  • Top authors: sherkspear (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,498 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by Food Business Gross Profit Calculator Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0936.31 ▼1.93
Dashboard /wp-admin3.07 ▼0.2322.71 ▼25.30
Posts /wp-admin/edit.php3.07 ▼0.2823.39 ▼23.93
Add New Post /wp-admin/post-new.php3.07 ▼2.8121.81 ▼82.00
Media Library /wp-admin/upload.php3.07 ▼0.1623.18 ▼12.06
How To Use /wp-admin/edit.php?post_type=screcipe&page=screcipe_info3.0723.02
Recipe Categories /wp-admin/edit-tags.php?taxonomy=screcipe_categories&post_type=screcipe3.0823.46
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=screcipe3.0827.61
Recipes /wp-admin/edit.php?post_type=screcipe3.0722.60
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=screcipe3.0823.65
Add New /wp-admin/post-new.php?post_type=screcipe3.0722.89

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

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

Browser metrics Passed 4 tests

Food Business Gross Profit Calculator Plugin: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲9914.17 ▼0.122.02 ▲0.4040.08 ▼1.96
Dashboard /wp-admin2,238 ▲615.62 ▲0.1183.55 ▼9.1837.34 ▼5.13
Posts /wp-admin/edit.php2,140 ▲402.04 ▲0.0138.48 ▲2.2436.17 ▼2.98
Add New Post /wp-admin/post-new.php1,563 ▲3423.23 ▼0.00649.70 ▲49.8858.71 ▲6.86
Media Library /wp-admin/upload.php1,440 ▲374.22 ▲0.0496.41 ▼0.0041.52 ▼0.17
How To Use /wp-admin/edit.php?post_type=screcipe&page=screcipe_info1,1562.1626.6644.04
Recipe Categories /wp-admin/edit-tags.php?taxonomy=screcipe_categories&post_type=screcipe1,3142.1227.1730.73
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=screcipe1,4952.1327.7332.49
Recipes /wp-admin/edit.php?post_type=screcipe1,2041.9629.1331.00
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=screcipe1,3622.1327.1529.63
Add New /wp-admin/post-new.php?post_type=screcipe2,7687.81185.1464.41

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • category_children
    • theysaidso_admin_options

Smoke tests 50% 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
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=screcipe
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 50% 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
Please fix the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/food-business-gross-profit-calculator/includes/SCRecipeCssJsScripts.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/food-business-gross-profit-calculator/includes/CPT_Recipe.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'SCRecipe' not found in wp-content/plugins/food-business-gross-profit-calculator/templates/screcipe_dashboard.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/food-business-gross-profit-calculator/includes/CPT_Recipe.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/food-business-gross-profit-calculator/includes/SCRecipeMenu.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_terms() in wp-content/plugins/food-business-gross-profit-calculator/templates/single-screcipe-content.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

food-business-gross-profit-calculator/sc-recipe-calc.php 85% from 13 tests

"Food Business Gross Profit Calculator Plugin" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 155 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("food-business-gross-profit-calculator.php" instead of "sc-recipe-calc.php")

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
No dangerous file extensions were detected7,704 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,9696,8826,439
CSS42363816
PHP712490449

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity7.80
▷ Minimum class complexity1.00
▷ Maximum class complexity33.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods21
▷ Static methods29.52%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dbtables/media/images/sort_asc_disabled.png2.85KB0.25KB▼ 91.36%
assets/dbtables/media/images/back_disabled.png1.33KB0.60KB▼ 55.11%
assets/dbtables/media/images/forward_disabled.png1.33KB0.58KB▼ 56.42%
assets/img/glyphicons-halflings.png13.50KB10.35KB▼ 23.34%
assets/dbtables/media/images/sort_both.png1.11KB0.29KB▼ 74.12%