68% food-truck

Code Review | Food Truck Locations & Times

WordPress plugin Food Truck Locations & Times scored68%from 54 tests.

About plugin

  • Plugin page: food-truck
  • Plugin version: 1.0.15
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Oct 2, 2017
  • Latest release: Jul 19, 2020
  • Number of updates: 17
  • Update frequency: every 60.1 days
  • Top authors: paulcollett (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /3,804 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.77ms] Passed 4 tests

An overview of server-side resources used by Food Truck Locations & Times
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1141.53 ▼4.57
Dashboard /wp-admin3.45 ▲0.0754.78 ▼16.03
Posts /wp-admin/edit.php3.57 ▲0.1753.92 ▲4.16
Add New Post /wp-admin/post-new.php6.03 ▲0.1194.28 ▼10.65
Media Library /wp-admin/upload.php3.38 ▲0.1138.98 ▲5.51

Server storage [IO: ▲0.34MB] [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: 19 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_food-truck
widget_theysaidso_widget

Browser metrics Passed 4 tests

Food Truck Locations & Times: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14913.45 ▼1.049.13 ▲7.3442.96 ▼1.60
Dashboard /wp-admin2,213 ▲335.62 ▼0.0790.23 ▲0.0537.38 ▼7.86
Posts /wp-admin/edit.php2,118 ▲152.16 ▲0.1839.74 ▼4.5935.70 ▲0.34
Add New Post /wp-admin/post-new.php1,541 ▲623.32 ▲5.01666.67 ▼5.5153.02 ▼14.89
Media Library /wp-admin/upload.php1,418 ▲214.36 ▲0.07104.38 ▼2.7242.11 ▼8.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_food-truck
    • widget_recent-posts
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/food-truck/templates/full_item.php
    • > /wp-content/plugins/food-truck/admin/templates/locations.php
  • 18× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/food-truck/templates/full_item.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/food-truck/admin/templates/locations.php:193
    • > PHP Notice
      Undefined variable: is_tomorrow in wp-content/plugins/food-truck/templates/full_item.php on line 7
    • > PHP Notice
      Undefined variable: location in wp-content/plugins/food-truck/templates/full_item.php on line 2
    • > PHP Notice
      Undefined variable: close_time in wp-content/plugins/food-truck/templates/full_item.php on line 13
    • > PHP Warning
      Use of undefined constant TRUCKLOT_THEME_URI - assumed 'TRUCKLOT_THEME_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/food-truck/admin/templates/locations.php on line 52
    • > PHP Warning
      Use of undefined constant TRUCKLOT_THEME_URI - assumed 'TRUCKLOT_THEME_URI' (this will throw an Error in a future version of PHP) in wp-content/plugins/food-truck/admin/templates/locations.php on line 28
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/food-truck/templates/full_item.php on line 2
    • > PHP Notice
      Undefined variable: location in wp-content/plugins/food-truck/templates/full_item.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function foodtruck_get_upcoming_locations() in wp-content/plugins/food-truck/templates/summary.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: food truck, locations, map, dates, google map...

food-truck/food-truck.php Passed 13 tests

The principal PHP file in "Food Truck Locations & Times" v. 1.0.15 is loaded by WordPress automatically on each request
56 characters long description:
Food Truck Location & Dates plugin built for Food Trucks

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .url - Internet Shortcut in Firefox, IE, Chrome, Safari
      • wp-content/plugins/food-truck/readme.url
1,762 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP6232961,248
Sass2327302
JavaScript268316211
CSS1111

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity9.00
▷ Minimum class complexity4.00
▷ Maximum class complexity14.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions2796.43%
▷ Anonymous functions13.57%
Constants2
▷ Global constants2100.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
4 compressed PNG files occupy 0.08MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/example-full.png37.07KB34.70KB▼ 6.39%
admin/assets/example-change-text.png7.52KB6.72KB▼ 10.63%
admin/assets/example-summary.png16.20KB15.11KB▼ 6.73%
admin/assets/example-list.png24.36KB23.40KB▼ 3.97%