78% acf-openstreetmap-field

Code Review | ACF OpenStreetMap Field

WordPress plugin ACF OpenStreetMap Field scored78%from 54 tests.

About plugin

  • Plugin page: acf-openstreetmap...
  • Plugin version: 1.5.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.4
  • WordPress version: 6.3.1
  • First release: Jul 5, 2019
  • Latest release: Nov 26, 2023
  • Number of updates: 36
  • Update frequency: every 44.6 days
  • Top authors: podpirate (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

7,000+ active /86,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.48MB] [CPU: ▼2.49ms] Passed 4 tests

Analyzing server-side resources used by ACF OpenStreetMap Field
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4243.49 ▲2.09
Dashboard /wp-admin3.86 ▲0.5152.57 ▼12.56
Posts /wp-admin/edit.php3.91 ▲0.5549.73 ▲6.18
Add New Post /wp-admin/post-new.php6.40 ▲0.5196.47 ▼4.57
Media Library /wp-admin/upload.php3.72 ▲0.4937.33 ▲5.07
OpenStreetMap /wp-admin/options-general.php?page=acf_osm3.8541.09

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for ACF OpenStreetMap Field
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.24 ▼0.111.65 ▼0.2043.32 ▼3.71
Dashboard /wp-admin2,199 ▲285.62 ▲0.0384.53 ▼19.0339.16 ▼6.05
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0537.55 ▼5.0033.28 ▼3.28
Add New Post /wp-admin/post-new.php1,529 ▼622.94 ▼2.25627.67 ▼48.5759.66 ▲4.04
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.07100.14 ▲5.0740.73 ▼3.82
OpenStreetMap /wp-admin/options-general.php?page=acf_osm3,0352.5657.6573.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 12× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Settings/Settings.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Templates.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Compat/ACF.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Singleton.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/autoload.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Core.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/OSMProviders.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/Plugin.php
    • > /wp-content/plugins/acf-openstreetmap-field/index.php
    • > /wp-content/plugins/acf-openstreetmap-field/include/ACFFieldOpenstreetmap/Core/PluginComponent.php
  • 30× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/leaflet.php on line 8
    • > 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
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/admin.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/leaflet.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/leaflet.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type null 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 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 13
    • > 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
      Trying to access array offset on value of type null in wp-content/plugins/acf-openstreetmap-field/templates/leaflet.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: map acf openstreetmap leaflet

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

This is the main PHP file of "ACF OpenStreetMap Field" version 1.5.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected2,710 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP195308231,540
JSON2001,160
CSS4004
JavaScript4044
SVG2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity14.75
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes12
▷ Abstract classes325.00%
▷ Concrete classes975.00%
▷ Final classes00.00%
Methods95
▷ Static methods88.42%
▷ Public methods7275.79%
▷ Protected methods88.42%
▷ Private methods1515.79%
Functions8
▷ Named functions337.50%
▷ Anonymous functions562.50%
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/layers-2x.png1.23KB1.67KB0.00%
assets/css/images/layers.png0.68KB1.05KB0.00%
assets/css/images/marker-shadow.png0.60KB1.16KB0.00%
assets/css/images/marker-icon.png1.43KB1.55KB0.00%
assets/css/images/geocoder.png0.48KB0.49KB0.00%