10% distancefromme

Code Review | DistanceFromMe

WordPress plugin DistanceFromMe scored 10% from 54 tests.

About plugin

  • Plugin page: distancefromme
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.4
  • WordPress version: 6.3.1
  • First release: Jun 26, 2012
  • Latest release: Oct 9, 2012
  • Number of updates: 14
  • Update frequency: every 7.5 days
  • Top authors: rdconnell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,277 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
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/distancefromme/distancefromme.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; DistanceFromMeWidget has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼52.90ms] Passed 4 tests

This is a short check of server-side resources used by DistanceFromMe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.325.52 ▼36.08
Dashboard /wp-admin2.17 ▼1.147.31 ▼41.34
Posts /wp-admin/edit.php2.17 ▼1.198.38 ▼39.41
Add New Post /wp-admin/post-new.php2.17 ▼3.726.66 ▼94.78
Media Library /wp-admin/upload.php2.17 ▼1.065.37 ▼30.84

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_distancefrommewidget
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for DistanceFromMe
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲17513.59 ▼0.717.66 ▲5.7643.71 ▼4.41
Dashboard /wp-admin2,208 ▲205.88 ▲1.03107.40 ▼7.0840.09 ▼6.23
Posts /wp-admin/edit.php2,091 ▲22.02 ▼0.0235.80 ▼4.6330.67 ▼5.92
Add New Post /wp-admin/post-new.php1,530 ▲1123.14 ▼0.05599.76 ▼59.2454.83 ▲4.26
Media Library /wp-admin/upload.php1,390 ▲24.19 ▼0.0598.45 ▼3.7640.43 ▼0.04

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/distancefromme/distancefromme.php+30
    Methods with the same name as their class will not be constructors in a future version of PHP; DistanceFromMeWidget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_distancefrommewidget
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/distancefromme/sosumi/class.sosumi.php on line 49
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/distancefromme/sosumi/class.sosumi.php on line 49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/distancefromme/distancefromme.php:18
    • > PHP Fatal error
      Uncaught Exception: Error parsing json string in wp-content/plugins/distancefromme/sosumi/class.sosumi.php:121
    • > PHP Fatal error
      Uncaught Exception: Error parsing json string in wp-content/plugins/distancefromme/sosumi/class.sosumi.php:121
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/distancefromme/distancefromme.php on line 16
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/distancefromme/distancefromme.php on line 16
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/distancefromme/distancefromme.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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:
  • Plugin Name: You should set the name of your plugin on the first line ( === distancefromme === )
  • Screenshots: Add images for these screenshots: #1 (Distancefromme widget in action), #2 (Configuration screen)
Please take inspiration from this readme.txt

distancefromme/distancefromme.php 92% from 13 tests

Analyzing the main PHP file in "DistanceFromMe" version 0.3
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 262 characters long)

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin686 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP512692606
Markdown119044
JavaScript1131536

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1152.38%
▷ Protected methods00.00%
▷ Private methods1047.62%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
3 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png35.08KB12.66KB▼ 63.93%
screenshot-2.png18.85KB8.60KB▼ 54.40%
screenshot-1.png33.71KB10.66KB▼ 68.39%