84% nearby-locations

Code Review | Nearby Locations

WordPress plugin Nearby Locations scored84%from 54 tests.

About plugin

  • Plugin page: nearby-locations
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.8.1
  • WordPress version: 6.3.1
  • First release: Aug 31, 2017
  • Latest release: Sep 25, 2017
  • Number of updates: 11
  • Update frequency: every 2.3 days
  • Top authors: aaronfrey (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,201 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▲2.44ms] Passed 4 tests

Analyzing server-side resources used by Nearby Locations
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0938.27 ▲3.88
Dashboard /wp-admin3.40 ▲0.1053.40 ▲7.62
Posts /wp-admin/edit.php3.51 ▲0.1649.47 ▲3.05
Add New Post /wp-admin/post-new.php6.00 ▲0.1194.00 ▼3.90
Media Library /wp-admin/upload.php3.32 ▲0.0944.74 ▲6.71
Settings /wp-admin/admin.php?page=nearby-locations-settings3.2931.80
Locations /wp-admin/admin.php?page=nearby-locations3.2933.84
Location Types /wp-admin/admin.php?page=nearby-locations-types3.2930.45

Server storage [IO: ▲0.08MB] [DB: ▲0.32MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: 2 new tables, 10 new options
New tables
wp_ajf_nl_locations
wp_ajf_nl_sections
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
ajf-nl-color-panel
db_upgraded
ajf-nl-version
theysaidso_admin_options
ajf-nl-color-text
ajf-nl-color-background
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Nearby Locations
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲20915.11 ▲0.7512.63 ▲11.0937.54 ▼3.14
Dashboard /wp-admin2,273 ▲995.86 ▲0.33100.93 ▲12.5443.02 ▼2.00
Posts /wp-admin/edit.php2,156 ▲563.02 ▲1.0048.90 ▲12.2332.69 ▼2.72
Add New Post /wp-admin/post-new.php1,762 ▲22725.85 ▲7.80585.62 ▼24.8234.87 ▼43.74
Media Library /wp-admin/upload.php1,476 ▲735.33 ▲1.1793.04 ▼2.2241.07 ▼1.57
Settings /wp-admin/admin.php?page=nearby-locations-settings1,2123.2861.2229.16
Locations /wp-admin/admin.php?page=nearby-locations8462.7434.2924.18
Location Types /wp-admin/admin.php?page=nearby-locations-types8672.5934.7725.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/nearby-locations/shared/partials/nearby-locations-map-display.php:15
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nearby-locations/admin/partials/nearby-locations-admin-display.php on line 17
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/nearby-locations/admin/partials/nearby-locations-admin-types-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/nearby-locations/admin/partials/nearby-locations-admin-types-display.php:35
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/nearby-locations/admin/partials/nearby-locations-admin-display.php:18
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nearby-locations/shared/partials/nearby-locations-map-display.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/nearby-locations/admin/partials/nearby-locations-admin-settings-display.php:12
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/nearby-locations/admin/partials/nearby-locations-admin-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/nearby-locations/admin/partials/nearby-locations-admin-table.php on line 4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nearby-locations/shared/partials/nearby-locations-map-display.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 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
2 plugin tags: locations, maps

nearby-locations/nearby-locations.php Passed 13 tests

The main PHP file in "Nearby Locations" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
54 characters long description:
Add locations, grouped by categories, to a Google map.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,282 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP17301466872
JavaScript36949311
CSS319889
SVG10110

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.44
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods54
▷ Static methods23.70%
▷ Public methods4277.78%
▷ Protected methods00.00%
▷ Private methods1222.22%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin