63% trail-status

Code Review | Trail Status

WordPress plugin Trail Status scored63%from 54 tests.

About plugin

  • Plugin page: trail-status
  • Plugin version: 2.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1
  • WordPress version: 6.3.1
  • First release: Mar 3, 2018
  • Latest release: Dec 10, 2022
  • Number of updates: 20
  • Update frequency: every 87.4 days
  • Top authors: falcon13 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /818 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.76ms] Passed 4 tests

Analyzing server-side resources used by Trail Status
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.96 ▼15.41
Dashboard /wp-admin3.36 ▲0.0158.56 ▼10.36
Posts /wp-admin/edit.php3.47 ▲0.1157.34 ▲5.42
Add New Post /wp-admin/post-new.php5.93 ▲0.0596.28 ▼8.59
Media Library /wp-admin/upload.php3.25 ▲0.0338.68 ▼0.67
/wp-admin/admin.php?page=trail-status-2-edit3.3134.46
Status List /wp-admin/admin.php?page=trail-status-2-statuses3.3041.76
Add Trail /wp-admin/admin.php?page=trail-status-2-add3.2233.41
Update Status /wp-admin/admin.php?page=trail-status-23.2840.76
Trail List /wp-admin/admin.php?page=trail-status-2-list3.2838.13

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: 2 new tables, 7 new options
New tables
wp_otgts2_trails
wp_otgts2_statuses
New WordPress options
can_compress_scripts
widget_recent-comments
widget_otgts2_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Trail Status
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲23514.96 ▲0.311.80 ▼0.1048.19 ▲5.50
Dashboard /wp-admin2,398 ▲2216.73 ▲1.09133.50 ▲47.2944.37 ▲5.63
Posts /wp-admin/edit.php2,329 ▲2323.82 ▲1.8269.80 ▲30.9836.23 ▲0.23
Add New Post /wp-admin/post-new.php1,580 ▲5423.41 ▲5.74667.74 ▼14.2040.06 ▼15.19
Media Library /wp-admin/upload.php1,463 ▲634.71 ▲0.4094.54 ▼23.7843.31 ▼5.18
/wp-admin/admin.php?page=trail-status-2-edit1,1323.5352.1931.89
Status List /wp-admin/admin.php?page=trail-status-2-statuses2,5915.31108.5539.28
Add Trail /wp-admin/admin.php?page=trail-status-2-add1,1323.5551.8029.32
Update Status /wp-admin/admin.php?page=trail-status-21,0803.5551.3830.30
Trail List /wp-admin/admin.php?page=trail-status-2-list1,2743.8567.5032.05

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
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_otgts2_trails
    • wp_otgts2_statuses
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_otgts2_widget
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=trail-status-2-add
    • > Notice in wp-content/plugins/trail-status/admin.php+408
    Undefined index: trail

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/trail-status/views/about.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/trail-status/trail-status.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/trail-status/trail-status.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgts2_display_messages() in wp-content/plugins/trail-status/views/update.php:20
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/trail-status/trail-status.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgts2_display_messages() in wp-content/plugins/trail-status/views/status_list.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/trail-status/widgets.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgts2_display_messages() in wp-content/plugins/trail-status/views/trail_list.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgts2_display_messages() in wp-content/plugins/trail-status/views/trail_edit.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: trails, widget, hiking, biking, shortcode...

trail-status/trail-status.php Passed 13 tests

"Trail Status" version 2.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
34 characters long description:
Show the current status of trails.

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
Success! There were no dangerous files found in this plugin1,325 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP121313571,053
CSS32124198
JavaScript3124674

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity7.67
▷ Minimum class complexity3.00
▷ Maximum class complexity10.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions2195.45%
▷ Anonymous functions14.55%
Constants1
▷ Global constants1100.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
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/trail-placeholder.png13.29KB5.77KB▼ 56.59%
images/sort_desc.png0.15KB0.25KB0.00%
images/sort_desc_disabled.png0.14KB0.25KB0.00%
images/sort_asc_disabled.png0.14KB0.25KB0.00%
images/sort_both.png0.20KB0.29KB0.00%