78% trail-manager

Code Review | Trail Manager

WordPress plugin Trail Manager scored78%from 54 tests.

About plugin

  • Plugin page: trail-manager
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.4
  • WordPress version: 6.3.1
  • First release: May 9, 2017
  • Latest release: May 10, 2017
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: phegman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /658 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 gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▲0.48ms] Passed 4 tests

Server-side resources used by Trail Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.59 ▼5.18
Dashboard /wp-admin3.46 ▲0.1551.48 ▲3.17
Posts /wp-admin/edit.php3.57 ▲0.2153.33 ▲2.62
Add New Post /wp-admin/post-new.php6.03 ▲0.1390.42 ▲4.08
Media Library /wp-admin/upload.php3.38 ▲0.1540.62 ▲1.29
Add New Trail Network /wp-admin/post-new.php?post_type=trail_network3.5052.42
All Trail Networks /wp-admin/edit.php?post_type=trail_network3.4239.63

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 46 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Trail Manager
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲10914.36 ▼0.021.70 ▼0.2341.61 ▼1.40
Dashboard /wp-admin2,271 ▲975.66 ▲0.0595.42 ▲7.2941.47 ▲1.75
Posts /wp-admin/edit.php2,176 ▲762.04 ▲0.0139.28 ▲2.3334.92 ▼2.63
Add New Post /wp-admin/post-new.php1,568 ▲3923.39 ▲5.88694.28 ▲78.8259.35 ▼4.89
Media Library /wp-admin/upload.php1,477 ▲834.27 ▲0.01100.35 ▼0.8443.99 ▼1.22
Add New Trail Network /wp-admin/post-new.php?post_type=trail_network2,4098.34207.2971.04
All Trail Networks /wp-admin/edit.php?post_type=trail_network1,1402.0135.5430.63

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/trail-manager/admin/partials/trail-manager-admin-display.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/trail-manager/public/partials/trail-manager-single-network.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/trail-manager/public/partials/trail-manager-single-network.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/trail-manager/public/partials/trail-manager-all-networks.php:22
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/trail-manager/public/partials/trail-manager-single-network.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: caution, mountain bike, trails, manager, open...

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

The primary PHP file in "Trail Manager" version 1.0.0 is used by WordPress to initiate all plugin functionality
55 characters long description:
Manage trail networks and display them on the front end

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
No dangerous file extensions were detected1,087 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP13148610556
Sass2524236
Vuejs Component230151
JavaScript6144364
SVG50550
JSON20028
CSS2002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods39
▷ Static methods410.26%
▷ Public methods3487.18%
▷ Protected methods00.00%
▷ Private methods512.82%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.78MB with 0.59MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png311.32KB78.77KB▼ 74.70%
assets/screenshot-2.png148.91KB35.48KB▼ 76.17%
assets/screenshot-1.png339.71KB88.20KB▼ 74.04%