88% acf-openstreetmap-field

Code Review | ACF OpenStreetMap Field

WordPress plugin ACF OpenStreetMap Field scored 88% from 54 tests.

About plugin

  • Plugin page: acf-openstreetmap...
  • Plugin version: 1.3.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.6
  • WordPress version: 5.9.2
  • First release: Jul 5, 2019
  • Latest release: Jan 25, 2021
  • Number of updates: 22
  • Update frequency: every 25.9 days
  • Top authors: podpirate (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

5,000+ active / 40,337 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▼292.22ms] Passed 4 tests

Server-side resources used by ACF OpenStreetMap Field
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.4459.72 ▲5.94
Dashboard /wp-admin3.89 ▲0.4837.41 ▲3.16
Posts /wp-admin/edit.php4.12 ▲0.4740.36 ▲4.45
Add New Post /wp-admin/post-new.php7.42 ▲0.4497.12 ▼1,177.82
Media Library /wp-admin/upload.php3.84 ▲0.5426.61 ▲1.34
OpenStreetMap /wp-admin/options-general.php?page=acf_osm3.8228.74

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 45 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for ACF OpenStreetMap Field
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,790 ▲4615.83 ▲0.245.87 ▼0.562.13 ▼0.31
Dashboard /wp-admin2,897 ▲366.01 ▼0.19122.24 ▼13.26158.94 ▼6.26
Posts /wp-admin/edit.php2,696 ▲23.23 ▼0.0264.99 ▲1.82144.65 ▼2.02
Add New Post /wp-admin/post-new.php1,664 ▼4715.64 ▼6.14409.43 ▼24.17160.42 ▲6.71
Media Library /wp-admin/upload.php1,700 ▲25.51 ▼0.03150.69 ▲12.74195.47 ▲11.57
OpenStreetMap /wp-admin/options-general.php?page=acf_osm4,6113.8286.94204.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
Good news, no errors were detected

SRP 0% 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
  • 12× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Plugin.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/PluginComponent.php
    • > /wp-content/plugins/acf-openstreetmap-field/index.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Singleton.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Core.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Settings/SettingsOpenStreetMap.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/OSMProviders.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Templates.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/LeafletProviders.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Compat/ACF.php
  • 30× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/acf-openstreetmap-field/templates/osm.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/admin.php on line 14
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/acf-openstreetmap-field/templates/admin.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/admin.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/leaflet.php on line 7
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/acf-openstreetmap-field/templates/leaflet.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/admin.php on line 13
    • > PHP Fatal error
      Uncaught Error: Unsupported operand types in wp-content/plugins/acf-openstreetmap-field/templates/admin.php:17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/admin.php on line 8
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/acf-openstreetmap-field/templates/admin.php on line 7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: map acf openstreetmap leaflet

acf-openstreetmap-field/index.php 92% from 13 tests

Analyzing the main PHP file in "ACF OpenStreetMap Field" version 1.3.2
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("acf-openstreetmap-field.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected16,658 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript83,2684,50812,660
PHP195757531,484
JSON1001,350
CSS690671,164

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity14.42
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes12
▷ Abstract classes325.00%
▷ Concrete classes975.00%
▷ Final classes00.00%
Methods92
▷ Static methods88.70%
▷ Public methods6772.83%
▷ Protected methods99.78%
▷ Private methods1617.39%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/geocoder.png0.48KB0.49KB0.00%
assets/css/images/marker-icon-2x.png2.41KB2.52KB0.00%
assets/css/images/layers-2x.png1.23KB1.67KB0.00%
assets/css/images/marker-icon.png1.43KB1.55KB0.00%
assets/css/images/marker-shadow.png0.60KB1.16KB0.00%