84% wp-distance-calculator

Code Review | WP Distance Calculator

WordPress plugin WP Distance Calculator scored 84% from 54 tests.

About plugin

  • Plugin page: wp-distance-calcu...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.1
  • WordPress version: 6.3.1
  • First release: May 3, 2016
  • Latest release: Jun 4, 2019
  • Number of updates: 3
  • Update frequency: every 376.0 days
  • Top authors: ymonica32 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,018 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by WP Distance Calculator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.77 ▼4.49
Dashboard /wp-admin3.33 ▲0.0254.53 ▼0.54
Posts /wp-admin/edit.php3.38 ▲0.0255.77 ▲2.93
Add New Post /wp-admin/post-new.php5.91 ▲0.02106.14 ▲3.51
Media Library /wp-admin/upload.php3.25 ▲0.0235.30 ▼4.49

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP Distance Calculator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲12613.73 ▲0.105.71 ▲3.4337.74 ▼9.94
Dashboard /wp-admin2,217 ▲144.88 ▼1.02104.11 ▲5.6742.23 ▲4.17
Posts /wp-admin/edit.php2,100 ▲322.02 ▲0.0239.74 ▲5.6938.49 ▲5.29
Add New Post /wp-admin/post-new.php1,361 ▼17218.01 ▼5.37540.94 ▼84.2156.60 ▼17.42
Media Library /wp-admin/upload.php1,402 ▲144.21 ▲0.0397.50 ▼18.2537.92 ▼10.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-distance-calculator/index.php:16

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Calculator will look like screenshot-1.png)
You can take inspiration from this readme.txt

wp-distance-calculator/index.php 92% from 13 tests

The entry point to "WP Distance Calculator" version 2.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-distance-calculator.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin101 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1161268
JavaScript14321
CSS12112

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions0
▷ Named functions00.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
1 PNG file occupies 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png61.46KB38.40KB▼ 37.52%