67% meal-tracker

Code Review | Meal Tracker

WordPress plugin Meal Tracker scored67%from 54 tests.

About plugin

  • Plugin page: meal-tracker
  • Plugin version: 3.1.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.3.2
  • WordPress version: 6.3.1
  • First release: Nov 29, 2019
  • Latest release: Oct 24, 2023
  • Number of updates: 39
  • Update frequency: every 36.5 days
  • Top authors: aliakro (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /7,879 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.79ms] 75% from 4 tests

This is a short check of server-side resources used by Meal Tracker
Please take the time to fix the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,097.27ms on /wp-admin/admin.php?page=yk-mt-license)
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.24 ▲4.18
Dashboard /wp-admin3.38 ▲0.0844.46 ▼1.44
Posts /wp-admin/edit.php3.50 ▲0.1444.40 ▼4.14
Add New Post /wp-admin/post-new.php5.96 ▲0.0879.89 ▼19.37
Media Library /wp-admin/upload.php3.31 ▲0.0835.83 ▲1.78
Upgrade to Pro /wp-admin/admin.php?page=yk-mt-license3.281,097.27
Meal Collection /wp-admin/admin.php?page=yk-mt-meals3.3056.95
/wp-admin/admin.php?page=yk-mt-main-menu3.2941.67
Settings /wp-admin/admin.php?page=yk-mt-settings3.2836.69
Help /wp-admin/admin.php?page=yk-mt-help3.2730.05
User Data /wp-admin/admin.php?page=yk-mt-user3.2941.30
Setup Wizard /wp-admin/admin.php?page=yk-mt-setup-wizard3.2731.28

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 96 new files
Database: 5 new tables, 8 new options
New tables
wp_yk_mt_entry
wp_yk_mt_meal_types
wp_yk_mt_entry_meals
wp_yk_mt_meals
wp_yk_mt_settings
New WordPress options
can_compress_scripts
yk-wt-version-number-0
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
yk-mt-hash

Browser metrics Passed 4 tests

Meal Tracker: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲6914.39 ▼0.141.64 ▼0.0843.00 ▲2.91
Dashboard /wp-admin2,258 ▲845.57 ▲0.0481.84 ▼1.8537.15 ▼4.22
Posts /wp-admin/edit.php2,166 ▲632.05 ▲0.0536.42 ▼1.9032.44 ▲2.22
Add New Post /wp-admin/post-new.php1,577 ▲5123.16 ▼0.10672.31 ▲9.6958.03 ▼2.03
Media Library /wp-admin/upload.php1,469 ▲754.20 ▲0.0296.59 ▼0.6642.39 ▼3.60
Upgrade to Pro /wp-admin/admin.php?page=yk-mt-license1,1232.0224.9226.71
Meal Collection /wp-admin/admin.php?page=yk-mt-meals1,3694.6084.1943.35
/wp-admin/admin.php?page=yk-mt-main-menu1,2815.0181.4137.65
Settings /wp-admin/admin.php?page=yk-mt-settings1,8362.6950.5489.08
Help /wp-admin/admin.php?page=yk-mt-help9702.0528.7125.45
User Data /wp-admin/admin.php?page=yk-mt-user1,2875.0173.3340.52
Setup Wizard /wp-admin/admin.php?page=yk-mt-setup-wizard1,1372.1246.1150.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables were found after uninstall: 5 tables
    • wp_yk_mt_meal_types
    • wp_yk_mt_meals
    • wp_yk_mt_settings
    • wp_yk_mt_entry_meals
    • wp_yk_mt_entry
  • This plugin does not fully uninstall, leaving 8 options in the database
    • yk-mt-hash
    • widget_recent-posts
    • widget_recent-comments
    • yk-wt-version-number-0
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 41× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/meal-tracker/core/admin-pages/user/data-user.php
    • > /wp-content/plugins/meal-tracker/core/shortcode-various.php
    • > /wp-content/plugins/meal-tracker/core/external-sources.php
    • > /wp-content/plugins/meal-tracker/core/admin-pages/page.help.php
    • > /wp-content/plugins/meal-tracker/core/admin-pages/meals/meals-import.php
    • > /wp-content/plugins/meal-tracker/core/admin-pages/user/data-entry.php
    • > /wp-content/plugins/meal-tracker/core/functions.admin.php
    • > /wp-content/plugins/meal-tracker/core/external-sources/meal-tracker.php
    • > /wp-content/plugins/meal-tracker/core/meta.php
    • > /wp-content/plugins/meal-tracker/core/caching.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=yk-mt-setup-wizard
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: yk_mt_sc_meal_tracker is not defined" "ReferenceError: yk_mt_sc_meal_tracker is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/meal-tracker/assets/js/admin.js?ver=3.1.5:163:19)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=yk-mt-settings
    • > Network (severe)
    wp-content/plugins/meal-tracker/assets/css/images/z-tabs-icons.png - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=yk-mt-setup-wizard
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: yk_mt_sc_meal_tracker is not defined

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate 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
  • Screenshots: These screenshots require images: #8 (Search an external API for meals.), #9 (Manually add own meal to meal collection.)
The official readme.txt might help

meal-tracker/meal-tracker.php 92% from 13 tests

The main PHP script in "Meal Tracker" version 3.1.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Git Repository: There should be no Git repositories present in your plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected11,376 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
PHP432,2762,0806,287
PO File27428411,728
CSS122431811,215
JavaScript154314591,143
SVG12991986
YAML10017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.14
▷ Minimum class complexity2.00
▷ Maximum class complexity25.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes114.29%
▷ Concrete classes685.71%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods3665.45%
▷ Protected methods1425.45%
▷ Private methods59.09%
Functions314
▷ Named functions31399.68%
▷ Anonymous functions10.32%
Constants19
▷ Global constants19100.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
12 PNG files occupy 0.30MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/admin-pages/assets/images/product-logo.png9.00KB8.82KB▼ 2.00%
assets/images/setup-wizard-meal-tracker-shortcode.png36.31KB15.77KB▼ 56.58%
core/admin-pages/assets/images/yeken-logo.png8.83KB4.42KB▼ 49.97%
assets/images/setup-wizard-meal-tracker-shortcode-wysiwyg.png5.64KB3.34KB▼ 40.72%
core/admin-pages/assets/images/setup-wizard-meal-tracker-shortcode-small.png27.51KB10.54KB▼ 61.67%