78% car-route-planner

Code Review | Car Route Planner Plugin

WordPress plugin Car Route Planner Plugin scored78%from 54 tests.

About plugin

  • Plugin page: car-route-planner
  • Plugin version: 1.7
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Apr 28, 2018
  • Latest release: Oct 14, 2023
  • Number of updates: 28
  • Update frequency: every 71.3 days
  • Top authors: iGuk (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

600+ active /9,186 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

Analyzing server-side resources used by Car Route Planner Plugin
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 3,328.84ms on /wp-admin/options-general.php?page=car-route-planner-config-page)
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0534.97 ▼4.85
Dashboard /wp-admin3.36 ▲0.0244.41 ▼16.44
Posts /wp-admin/edit.php3.41 ▲0.0548.35 ▲4.87
Add New Post /wp-admin/post-new.php5.95 ▲0.0689.93 ▼12.42
Media Library /wp-admin/upload.php3.28 ▲0.0536.36 ▲2.08
Car Route Planner /wp-admin/options-general.php?page=car-route-planner-config-page4.253,328.84

Server storage [IO: ▲0.55MB] [DB: ▲0.11MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 86 new files
Database: no new tables, 22 new options
New WordPress options
widget_recent-comments
crp_show_result_scheme
crp_currency
widget_theysaidso_widget
widget_recent-posts
crp_show_result_length
crp_text_color
crp_show_speed_profile
crp_show_result_fuel_cost
crp_show_result_driving_time
...

Browser metrics Passed 4 tests

A check of browser resources used by Car Route Planner Plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.72 ▲0.371.81 ▲0.2439.74 ▲0.39
Dashboard /wp-admin2,196 ▲165.56 ▼0.0190.22 ▼2.0242.27 ▲0.98
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0338.81 ▲5.7938.41 ▲1.25
Add New Post /wp-admin/post-new.php1,696 ▲16122.03 ▲3.95630.40 ▼6.1657.12 ▼21.97
Media Library /wp-admin/upload.php1,404 ▲14.28 ▲0.0695.83 ▼4.9939.86 ▼5.47
Car Route Planner /wp-admin/options-general.php?page=car-route-planner-config-page7,5543.2466.0051.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • 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 everything seems fine, this is not an exhaustive test

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 fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/car-route-planner/car-route-planner.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant CRP_PLUGIN_DIR - assumed 'CRP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/car-route-planner/class.car-route-planner-admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/car-route-planner/block/car-route-planner-block.php:21
    • > PHP Fatal error
      require_once(): Failed opening required 'CRP_PLUGIN_DIRclass.car-route-planner.php' (include_path='.:/usr/share/php') in wp-content/plugins/car-route-planner/class.car-route-planner-admin.php on line 3
    • > PHP Warning
      require_once(CRP_PLUGIN_DIRclass.car-route-planner.php): failed to open stream: No such file or directory in wp-content/plugins/car-route-planner/class.car-route-planner-admin.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: route, direction, travel, calculator, distance

car-route-planner/car-route-planner.php 92% from 13 tests

The main PHP script in "Car Route Planner Plugin" version 1.7 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 141 characters long)

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 plugin7,031 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
JSON15502,866
JavaScript81081031,817
PO File127207201,500
PHP512125748
CSS420783
Sass12017

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity49.50
▷ Minimum class complexity48.00
▷ Maximum class complexity51.00
Average method complexity4.03
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods32100.00%
▷ Public methods1443.75%
▷ Protected methods00.00%
▷ Private methods1856.25%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants323.08%
▷ Class constants1076.92%
▷ Public constants10100.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
No PNG images were found in this plugin