10% ddirections

Code Review | Driving Directions

WordPress plugin Driving Directions scored10%from 54 tests.

About plugin

  • Plugin page: ddirections
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8.1
  • WordPress version: 6.3.1
  • First release: Sep 28, 2012
  • Latest release: Jul 1, 2016
  • Number of updates: 56
  • Update frequency: every 24.5 days
  • Top authors: hectorgarrofe (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /6,742 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/ddirections/ddirections.php+550
    Function create_function() is deprecated

Server metrics [RAM: ▼1.97MB] [CPU: ▼59.02ms] Passed 4 tests

An overview of server-side resources used by Driving Directions
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.93 ▼36.47
Dashboard /wp-admin2.05 ▼1.305.91 ▼54.92
Posts /wp-admin/edit.php2.05 ▼1.316.13 ▼46.59
Add New Post /wp-admin/post-new.php2.05 ▼3.846.75 ▼98.08
Media Library /wp-admin/upload.php2.05 ▼1.186.48 ▼29.20
Driving Directions /wp-admin/options-general.php?page=ddirections2.056.51

Server storage [IO: ▲0.28MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
posk_options
widget_ddirectionswidget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Driving Directions
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.40 ▼0.021.78 ▼0.0043.85 ▲0.32
Dashboard /wp-admin2,202 ▲285.58 ▼0.0191.20 ▲4.0847.81 ▲7.97
Posts /wp-admin/edit.php2,107 ▲72.04 ▼0.0034.05 ▼6.6538.07 ▼0.86
Add New Post /wp-admin/post-new.php1,565 ▲1023.30 ▲4.87641.39 ▲19.8551.75 ▼0.45
Media Library /wp-admin/upload.php1,404 ▲44.30 ▲0.0696.72 ▼9.4141.65 ▼4.71
Driving Directions /wp-admin/options-general.php?page=ddirections1,2504.1065.2744.44

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/ddirections/ddirections.php+550
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_ddirectionswidget
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ddirections
    • > Deprecated in wp-content/plugins/ddirections/ddirections.php+550
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=ddirections
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in DDirectionsWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=ddirections
    • > Notice in wp-content/plugins/ddirections/ddirections.php+248
    Undefined index: scrolltop

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ddirections/ddirections.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ddirections/help.php:50

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=ddirections
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&ver=6.3.1 210:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/options-general.php?page=ddirections
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&ver=6.3.1 139:311 "google.maps.event.addDomListener() is deprecated, use the standard\naddEventListener() method instead:\nhttps://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener\nThe feature will continue to work and there is no plan to decommission\nit."

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: A description for screenshot #1 is required in ddirections/assets to your readme.txt
The official readme.txt might help

ddirections/ddirections.php Passed 13 tests

The main PHP script in "Driving Directions" version 1.4.4 is automatically included on every request by WordPress
55 characters long description:
Driving directions with geolocation and mobile support.

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
No dangerous file extensions were detected1,434 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PO File6344400737
PHP2110109383
JavaScript26869286
CSS18028

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.16
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/hg_logo.png3.75KB2.02KB▼ 46.28%
screenshot-1.png153.90KB61.08KB▼ 60.31%