68% get-directions

Code Review | Get Directions Map

WordPress plugin Get Directions Map scored 68% from 54 tests.

About plugin

  • Plugin page: get-directions
  • Plugin version: 2.15.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.9
  • WordPress version: 5.9.2
  • First release: Mar 15, 2013
  • Latest release: Mar 6, 2022
  • Number of updates: 111
  • Update frequency: every 29.5 days
  • Top authors: llocally (64.86%)fullworks (36.04%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active / 17,563 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Get Directions Map
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,580.56ms on /wp-admin/options-general.php?page=get-directions-settings)
PageMemory (MB)CPU Time (ms)
Home /8.59 ▲5.0780.70 ▲26.67
Dashboard /wp-admin8.60 ▲5.1965.98 ▲27.25
Posts /wp-admin/edit.php8.61 ▲4.9665.40 ▲24.22
Add New Post /wp-admin/post-new.php11.11 ▲4.14119.01 ▼1,158.14
Media Library /wp-admin/upload.php8.61 ▲5.3153.17 ▲24.05
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.6152.80
MapQuest - Get Directions /wp-admin/options-general.php?page=get-directions-settings8.611,580.56

Server storage [IO: ▲25.12MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • Total filesystem usage should be limited to 25MB (currently using 25.12MB)
Filesystem: 1,169 new files
Database: no new tables, 6 new options
New WordPress options
fs_active_plugins
fs_gdpr
get-directions_donate
fs_accounts
get-directions_review
fs_debug_mode

Browser metrics Passed 4 tests

Get Directions Map: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,954 ▲20018.54 ▲2.9564.88 ▲59.012.58 ▼0.76
Dashboard /wp-admin2,929 ▲786.25 ▼0.04125.91 ▼11.84177.55 ▲10.23
Posts /wp-admin/edit.php2,734 ▲493.26 ▲0.0267.73 ▲1.73167.17 ▲17.24
Add New Post /wp-admin/post-new.php1,684 ▼3316.58 ▼4.53417.86 ▼27.70147.93 ▼11.89
Media Library /wp-admin/upload.php1,741 ▲465.70 ▲0.20142.52 ▼5.69207.26 ▲21.29
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,4342.5657.17112.87
MapQuest - Get Directions /wp-admin/options-general.php?page=get-directions-settings1,5322.7458.92176.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/get-directions/includes/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 6 options in the database
    • fs_active_plugins
    • fs_debug_mode
    • fs_gdpr
    • get-directions_review
    • fs_accounts
    • get-directions_donate

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)
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
Almost there! Just fix the following items
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/get-directions/includes/vendor/mustangostang/spyc/php4/5to4.php
    • > /wp-content/plugins/get-directions/templates/widget.php
    • > /wp-content/plugins/get-directions/templates/shortcode_layout_1.php
    • > /wp-content/plugins/get-directions/includes/vendor/cmb2/apigen/hook-docs.php
    • > /wp-content/plugins/get-directions/includes/vendor/matomo/device-detector/misc/statistics.php
    • > /wp-content/plugins/get-directions/includes/vendor/mustangostang/spyc/examples/yaml-load.php
  • 287× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DeviceDetector\\Parser\\Client\\ClientParserAbstract' not found in wp-content/plugins/get-directions/includes/vendor/piwik/device-detector/Parser/Client/Browser.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Tests\\Common\\Cache\\CacheTest' not found in wp-content/plugins/get-directions/includes/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcuCacheTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Common\\Cache\\CacheProvider' not found in wp-content/plugins/get-directions/includes/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/get-directions/includes/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Tests\\Common\\Cache\\BaseFileCacheTest' not found in wp-content/plugins/get-directions/includes/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/PhpFileCacheTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/get-directions/includes/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/get-directions/includes/vendor/matomo/device-detector/Tests/Parser/Client/LibraryTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/get-directions/includes/vendor/cmb2/includes/types/CMB2_Type_File.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Common\\Cache\\CacheProvider' not found in wp-content/plugins/get-directions/includes/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/get-directions/includes/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: responsive map, map, maps, directions, get directions...

get-directions/get-directions.php Passed 13 tests

The main PHP file in "Get Directions Map" ver. 2.15.9 adds more information about the plugin and also serves as the entry point for this plugin
42 characters long description:
Map with directions display using MapQuest

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin694,082 lines of code in 861 files:
LanguageFilesBlank linesComment linesLines of code
YAML1394,5053,414557,266
PHP44313,95131,03059,786
PO File13622,92128,90450,926
JSON2006,955
CSS375221,3695,941
SVG15005,364
Sass527671094,256
JavaScript286829053,215
XML63015187
Ant113097
reStructuredText1839682
INI1107

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity19.99
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces26
Interfaces11
Traits0
Classes347
▷ Abstract classes277.78%
▷ Concrete classes32092.22%
▷ Final classes20.62%
Methods2,994
▷ Static methods37612.56%
▷ Public methods2,18773.05%
▷ Protected methods39513.19%
▷ Private methods41213.76%
Functions188
▷ Named functions15984.57%
▷ Anonymous functions2915.43%
Constants231
▷ Global constants11851.08%
▷ Class constants11348.92%
▷ Public constants10996.46%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
63 PNG files occupy 0.21MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/vendor/cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
images/map-pin.png0.45KB0.33KB▼ 25.92%
includes/vendor/cmb2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
includes/vendor/cmb2/apigen/theme-bootstrap/src/resources/sort.png0.17KB0.12KB▼ 30.41%