73% weight-loss-tracker

Code Review | Weight Tracker

WordPress plugin Weight Tracker scored73%from 54 tests.

About plugin

  • Plugin page: weight-loss-tracker
  • Plugin version: 10.7.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.3
  • WordPress version: 6.3.1
  • First release: Dec 13, 2014
  • Latest release: Nov 6, 2023
  • Number of updates: 271
  • Update frequency: every 12.0 days
  • Top authors: aliakro (100%)

Code review

54 tests

User reviews

46 reviews

Install metrics

600+ active /77,397 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲3.80MB] [CPU: ▲21.46ms] 75% from 4 tests

A check of server-side resources used by Weight Tracker
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,084.76ms on /wp-admin/admin.php?page=ws-ls-license)
PageMemory (MB)CPU Time (ms)
Home /7.23 ▲3.7768.40 ▲28.02
Dashboard /wp-admin7.13 ▲3.7971.87 ▲11.40
Posts /wp-admin/edit.php7.19 ▲3.8376.39 ▲29.18
Add New Post /wp-admin/post-new.php9.73 ▲3.85110.89 ▲17.22
Media Library /wp-admin/upload.php7.06 ▲3.8367.92 ▲35.63
Custom Fields /wp-admin/admin.php?page=ws-ls-meta-fields7.0356.54
Export Data /wp-admin/admin.php?page=ws-ls-export-data7.0255.51
Awards /wp-admin/admin.php?page=ws-ls-awards7.0355.44
Help & Log /wp-admin/admin.php?page=ws-ls-help7.0353.57
User Data /wp-admin/admin.php?page=ws-ls-data-home7.0473.28
Challenges /wp-admin/admin.php?page=ws-ls-challenges7.0351.83
Setup Wizard /wp-admin/admin.php?page=ws-ls-data-setup-wizard7.0354.96
Settings /wp-admin/admin.php?page=ws-ls-settings7.08101.39
User Groups /wp-admin/admin.php?page=ws-ls-user-groups7.0359.71
Upgrade /wp-admin/admin.php?page=ws-ls-license7.041,084.76

Server storage [IO: ▲11.39MB] [DB: ▲0.06MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 393 new files
Database: 18 new tables, 29 new options
New tables
wp_WS_LS_EXPORT
wp_WS_LS_AWARDS
wp_WS_LS_META_GROUPS
wp_WS_LS_DATA_TARGETS
wp_WS_LS_DATA
wp_WS_LS_META_FIELDS
wp_WS_LS_EXPORT_REPORT
wp_WS_LS_CHALLENGES_DATA
wp_WS_LS_DATA_USER_PREFERENCES
wp_WS_LS_DATA_USER_STATS
...
New WordPress options
theysaidso_admin_options
ws-ls-messaging-version-number
ws-ls-export-version-number
ws-ls-migrated-macro-percentages
widget_recent-posts
ws-ls-license-site-hash
widget_theysaidso_widget
ws-ls-macro-proteins-gain
ws-ls-meta-version-number
ws-ls-group-add-missing-group-row
...

Browser metrics Passed 4 tests

An overview of browser requirements for Weight Tracker
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲13914.41 ▲0.061.70 ▼0.0338.07 ▼6.50
Dashboard /wp-admin2,281 ▲1075.69 ▲0.1885.12 ▼4.3441.29 ▲2.18
Posts /wp-admin/edit.php2,189 ▲892.04 ▲0.0842.14 ▲2.0539.92 ▲1.80
Add New Post /wp-admin/post-new.php1,594 ▲5823.02 ▼0.29794.45 ▲91.9961.01 ▲11.64
Media Library /wp-admin/upload.php1,489 ▲894.32 ▲0.10100.34 ▼1.9145.27 ▲2.82
Custom Fields /wp-admin/admin.php?page=ws-ls-meta-fields1,8193.5789.7744.08
Export Data /wp-admin/admin.php?page=ws-ls-export-data9252.1826.6124.61
Awards /wp-admin/admin.php?page=ws-ls-awards1,1473.7070.3636.81
Help & Log /wp-admin/admin.php?page=ws-ls-help1,4414.0496.1838.06
User Data /wp-admin/admin.php?page=ws-ls-data-home1,6103.9993.1345.99
Challenges /wp-admin/admin.php?page=ws-ls-challenges1,1603.5669.4732.19
Setup Wizard /wp-admin/admin.php?page=ws-ls-data-setup-wizard1,4052.4546.7858.28
Settings /wp-admin/admin.php?page=ws-ls-settings5,0553.0462.7890.17
User Groups /wp-admin/admin.php?page=ws-ls-user-groups1,0853.7568.6234.55
Upgrade /wp-admin/admin.php?page=ws-ls-license1,4062.3645.0738.88

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 18 tables
    • wp_WS_LS_MESSAGING
    • wp_WS_LS_EXPORT_REPORT
    • wp_WS_LS_CHALLENGES_DATA
    • wp_WS_LS_META_GROUPS
    • wp_WS_LS_DATA_USER_STATS
    • wp_WS_LS_DATA_USER_PREFERENCES
    • wp_WS_LS_GROUPS
    • wp_WS_LS_DATA
    • wp_WS_LS_GROUPS_USER
    • wp_WS_LS_CHALLENGES
    • ...
  • The uninstall procedure has failed, leaving 29 options in the database
    • ws-ls-challenges-db-number
    • ws-ls-macro-fats-lose
    • ws-ls-email-notification-db-number
    • ws-ls-messaging-version-number
    • ws-ls-migrated-macro-percentages
    • db_upgraded
    • ws-ls-export-version-number
    • widget_theysaidso_widget
    • ws-ls-macro-fats-gain
    • ws-ls-license-site-hash
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 114× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/weight-loss-tracker/pro-features/plus/meta-fields/functions-photos.php
    • > /wp-content/plugins/weight-loss-tracker/includes/admin-pages/user-data/data-summary.php
    • > /wp-content/plugins/weight-loss-tracker/pro-features/hooks.php
    • > /wp-content/plugins/weight-loss-tracker/includes/admin-pages/page-license.php
    • > /wp-content/plugins/weight-loss-tracker/includes/components.php
    • > /wp-content/plugins/weight-loss-tracker/pro-features/user-preferences.php
    • > /wp-content/plugins/weight-loss-tracker/includes/converters.php
    • > /wp-content/plugins/weight-loss-tracker/pro-features/email-notifications.php
    • > /wp-content/plugins/weight-loss-tracker/pro-features/shortcode-stats.php
    • > /wp-content/plugins/weight-loss-tracker/pro-features/widget-progress.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

weight-loss-tracker/weight-loss-tracker.php 85% from 13 tests

"Weight Tracker" version 10.7.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 361 characters long)
  • Git Repository: A Git repository was detected inside this plugin

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
No dangerous file extensions were detected116,535 lines of code in 209 files:
LanguageFilesBlank linesComment linesLines of code
PO File2525,25145,69059,001
CSS2550915420,241
PHP1146,5585,60019,206
JavaScript437,32186018,066
YAML10017
Markdown1204

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity10.20
▷ Minimum class complexity7.00
▷ Maximum class complexity13.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions830
▷ Named functions82299.04%
▷ Anonymous functions80.96%
Constants48
▷ Global constants48100.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
132 PNG files occupy 0.30MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
pro-features/plus/unitegallery/skins/default/grid_handle_black_left.png1.25KB0.69KB▼ 44.81%
pro-features/plus/unitegallery/images/button_fullscreen.png1.49KB1.09KB▼ 27.14%
pro-features/plus/unitegallery/skins/default/tile_bullets_brown.png0.37KB0.27KB▼ 26.20%
assets/css/libraries/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
assets/css/images/ui-bg_diagonals-thick_20_666666_40x40.png0.30KB0.15KB▼ 49.68%