78% recipe-calculator

Code Review | Recipe Calculator

WordPress plugin Recipe Calculator scored78%from 54 tests.

About plugin

  • Plugin page: recipe-calculator
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8
  • WordPress version: 6.3.1
  • First release: May 23, 2017
  • Latest release: Jun 1, 2017
  • Number of updates: 21
  • Update frequency: every 0.5 days
  • Top authors: helloirena (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,160 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.51MB] [CPU: ▲0.53ms] Passed 4 tests

An overview of server-side resources used by Recipe Calculator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3247.06 ▲5.93
Dashboard /wp-admin6.78 ▲3.44530,671.28 ▲530,614.44
Posts /wp-admin/edit.php3.87 ▲0.4755.09 ▼1.96
Add New Post /wp-admin/post-new.php6.69 ▲0.76111.81 ▼1.31
Media Library /wp-admin/upload.php3.77 ▲0.5041.44 ▼0.52

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 359 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Recipe Calculator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,034 ▲26313.57 ▼0.8514.74 ▲12.6785.94 ▲44.29
Dashboard /wp-admin2,210 ▲335.63 ▼0.0490.40 ▼4.5243.05 ▲2.57
Posts /wp-admin/edit.php2,115 ▲152.05 ▲0.0538.69 ▼2.8834.11 ▼4.71
Add New Post /wp-admin/post-new.php6,426 ▲4,90026.02 ▲2.31894.73 ▲207.5286.07 ▲25.23
Media Library /wp-admin/upload.php1,415 ▲124.29 ▲0.13106.91 ▲1.5743.76 ▼3.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/recipe-calculator/recipe-calculator.php
    • > /wp-content/plugins/recipe-calculator/public/rcal.php
    • > /wp-content/plugins/recipe-calculator/includes/metaboxes.php
    • > /wp-content/plugins/recipe-calculator/includes/functions.php
  • 32× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/recipe-calculator/includes/customizer.php:68
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/recipe-calculator/includes/CMB2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/recipe-calculator/includes/CMB2/init.php:120
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/recipe-calculator/includes/CMB2/includes/helper-functions.php:116
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/recipe-calculator/includes/CMB2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/recipe-calculator/includes/CMB2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/recipe-calculator/includes/CMB2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/recipe-calculator/includes/CMB2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/recipe-calculator/includes/CMB2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/recipe-calculator/includes/CMB2/includes/types/CMB2_Type_Text_Date.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

recipe-calculator/recipe-calculator.php 92% from 13 tests

The main PHP script in "Recipe Calculator" version 1.0.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin43,899 lines of code in 211 files:
LanguageFilesBlank linesComment linesLines of code
PO File12113,81617,92031,625
PHP501,4433,5145,007
CSS171,0061,0384,631
Sass13238251,149
JavaScript82712621,075
Markdown21390412

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity14.78
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes610.34%
▷ Concrete classes5289.66%
▷ Final classes00.00%
Methods326
▷ Static methods4413.50%
▷ Public methods27885.28%
▷ Protected methods4513.80%
▷ Private methods30.92%
Functions43
▷ Named functions43100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/CMB2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
includes/CMB2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
includes/CMB2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
includes/CMB2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/CMB2/images/ico-delete.png0.70KB0.72KB0.00%