10% dietmaster-pro-nutrition

Code Review | DietMaster Integration

WordPress plugin DietMaster Integration scored10%from 54 tests.

About plugin

  • Plugin page: dietmaster-pro-nu...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3
  • WordPress version: 6.3.1
  • First release: Dec 5, 2015
  • Latest release: Dec 5, 2015
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: szstar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,438 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/dietmaster-pro-nutrition/includes/functions.php+10
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.23MB] [CPU: ▼51.72ms] Passed 4 tests

An overview of server-side resources used by DietMaster Integration
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7214.66 ▼29.97
Dashboard /wp-admin2.78 ▼0.5215.70 ▼38.64
Posts /wp-admin/edit.php2.78 ▼0.5816.34 ▼40.70
Add New Post /wp-admin/post-new.php2.78 ▼3.1117.13 ▼97.58
Media Library /wp-admin/upload.php2.78 ▼0.4515.73 ▼22.02
Dietmaster /wp-admin/options-general.php?page=dietmaster-menu2.7816.44

Server storage [IO: ▲0.09MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: 1 new table, 9 new options
New tables
wp_dietmaster
New WordPress options
theysaidso_admin_options
wpdmi
wpdmi_token_email_text
wpdmi_version
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for DietMaster Integration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.65 ▲0.522.04 ▲0.3343.33 ▲0.03
Dashboard /wp-admin2,202 ▲255.51 ▼0.0786.10 ▼16.2037.70 ▼4.77
Posts /wp-admin/edit.php2,108 ▲82.18 ▲0.2335.49 ▼3.5737.07 ▼0.04
Add New Post /wp-admin/post-new.php1,529 ▲322.94 ▼0.33654.27 ▼22.9557.22 ▼1.84
Media Library /wp-admin/upload.php1,398 ▼24.17 ▼0.0296.71 ▼9.2442.67 ▼3.86
Dietmaster /wp-admin/options-general.php?page=dietmaster-menu1,0891.8429.5431.27

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
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/dietmaster-pro-nutrition/includes/functions.php+191
    Undefined index: wpdmi-profile-update-nonce
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=dietmaster-menu
    • > Notice in wp-content/plugins/dietmaster-pro-nutrition/includes/functions.php+191
    Undefined index: wpdmi-profile-update-nonce
    • > GET request to /wp-admin/options-general.php?page=dietmaster-menu
    • > Notice in wp-content/plugins/dietmaster-pro-nutrition/dietmaster-integration.php+58
    Undefined index: activate
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dietmaster-menu
    • > Notice in wp-content/plugins/dietmaster-pro-nutrition/includes/admin.php+171
    Undefined index: detect_mobile
    • > GET request to /wp-admin/options-general.php?page=dietmaster-menu
    • > Notice in wp-content/plugins/dietmaster-pro-nutrition/includes/functions.php+760
    Undefined offset: 1
    • > GET request to /wp-admin/options-general.php?page=dietmaster-menu
    • > Notice in wp-content/plugins/dietmaster-pro-nutrition/includes/admin.php+180
    Undefined index: membership_integration

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 take a closer look at the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/dietmaster-pro-nutrition/dietmaster-integration.php:32
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/dietmaster-pro-nutrition/includes/view-profile-form.php on line 10
    • > PHP Notice
      Undefined variable: user_profile in wp-content/plugins/dietmaster-pro-nutrition/includes/view-profile-form.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dietmaster-pro-nutrition/includes/admin.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/dietmaster-pro-nutrition/includes/view-profile-form.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dietmaster-pro-nutrition/includes/functions.php:9

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 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 your attention: You can look at the official readme.txt

dietmaster-pro-nutrition/dietmaster-integration.php 92% from 13 tests

The primary PHP file in "DietMaster Integration" version 1.3.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dietmaster-pro-nutrition.php" instead of "dietmaster-integration.php")

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 plugin1,668 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP53521981,125
JavaScript37838526
CSS11017

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.30
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%
Functions50
▷ Named functions50100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon-help.png1.23KB0.36KB▼ 70.61%