10% wp-calc-weight

Code Review | Wp Calc Weight

WordPress plugin Wp Calc Weight scored10%from 54 tests.

About plugin

  • Plugin page: wp-calc-weight
  • Plugin version: 0.3.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2.2
  • WordPress version: 6.3.1
  • First release: Jun 21, 2018
  • Latest release: Jul 29, 2019
  • Number of updates: 11
  • Update frequency: every 36.6 days
  • Top authors: jarvis365 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,261 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-calc-weight/includes/functions.php+9
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼2.19MB] [CPU: ▼60.01ms] Passed 4 tests

An overview of server-side resources used by Wp Calc Weight
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.664.48 ▼42.32
Dashboard /wp-admin2.09 ▼1.475.71 ▼53.22
Posts /wp-admin/edit.php2.09 ▼1.595.36 ▼47.15
Add New Post /wp-admin/post-new.php2.09 ▼4.067.18 ▼97.35
Media Library /wp-admin/upload.php2.09 ▼1.405.80 ▼30.03
Settings /wp-admin/admin.php?page=calc_weight2.095.07
FAQ /wp-admin/admin.php?page=calc_weight_faq2.095.92
What's new /wp-admin/admin.php?page=calc_weight_whats_new2.095.89

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 10 new options
New WordPress options
wp-calc-weight-round_up_calc
wp-calc-weight-meas_system
theysaidso_admin_options
wp-calc-weight-opt_version
widget_theysaidso_widget
db_upgraded
wp-calc-weight-show_header
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Wp Calc Weight
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲17213.48 ▼0.898.61 ▲6.7345.16 ▲1.88
Dashboard /wp-admin2,226 ▲465.67 ▲0.1088.51 ▼4.2843.36 ▲2.83
Posts /wp-admin/edit.php2,134 ▲342.04 ▲0.0233.91 ▼2.7434.65 ▼5.90
Add New Post /wp-admin/post-new.php1,570 ▲4423.66 ▲6.19669.67 ▼18.2157.82 ▼0.04
Media Library /wp-admin/upload.php1,431 ▲314.22 ▲0.0199.21 ▼7.6644.70 ▲0.79
Settings /wp-admin/admin.php?page=calc_weight2,4133.4586.6528.28
FAQ /wp-admin/admin.php?page=calc_weight_faq1,0901.9731.4230.96
What's new /wp-admin/admin.php?page=calc_weight_whats_new8891.9829.8825.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-calc-weight/includes/functions.php+9
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=calc_weight_whats_new
    • > Deprecated in wp-content/plugins/wp-calc-weight/includes/functions.php+9
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+82
    Undefined index: btn_reset_display
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+93
    Undefined index: basic_font_size
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+98
    Undefined index: basic_border_color
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+108
    Undefined index: btn_calc_background
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+113
    Undefined index: btn_calc_color
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+114
    Undefined index: btn_calc_hover_color
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+120
    Undefined index: btn_reset_background
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+125
    Undefined index: btn_reset_color
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+126
    Undefined index: btn_reset_hover_color
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+133
    Undefined index: table_head_background
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+137
    Undefined index: table_head_color
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+143
    Undefined index: input_border_color
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+147
    Undefined index: input_background
    • > GET request to /wp-admin/admin.php?page=calc_weight
    • > Notice in wp-content/plugins/wp-calc-weight/admin/settings.php+152
    Undefined index: input_color

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: calculator in wp-content/plugins/wp-calc-weight/public/templates/public/idealweight.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-calc-weight/admin/whats_new.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-calc-weight/admin/settings.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-calc-weight/wp-calc-weight.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-calc-weight/public/templates/public/idealweight.php:6
    • > PHP Notice
      Undefined variable: calc_weight_front_idx in wp-content/plugins/wp-calc-weight/public/templates/public/idealweight.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-calc-weight/public/templates/public/idealweight.php on line 3
    • > PHP Notice
      Undefined variable: calculator in wp-content/plugins/wp-calc-weight/public/templates/public/idealweight.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-calc-weight/public/templates/public/idealweight.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-calc-weight/admin/faq.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: weight, health, calculator

wp-calc-weight/wp-calc-weight.php Passed 13 tests

The main PHP file in "Wp Calc Weight" ver. 0.3.2 adds more information about the plugin and also serves as the entry point for this plugin
31 characters long description:
Ideal Weight Calculator Plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin3,483 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS4113992,563
PHP1017147644
PO File2110114270
JavaScript2216

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin