84% osm-tiles-proxy

Code Review | Tiles Proxy for OpenStreetMap

WordPress plugin Tiles Proxy for OpenStreetMap scored84%from 54 tests.

About plugin

  • Plugin page: osm-tiles-proxy
  • Plugin version: 2.3.2
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 2, 2018
  • Latest release: Nov 29, 2023
  • Number of updates: 22
  • Update frequency: every 90.5 days
  • Top authors: Adrian2k7 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,937 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.57ms] Passed 4 tests

Server-side resources used by Tiles Proxy for OpenStreetMap
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1336.70 ▲0.63
Dashboard /wp-admin3.42 ▲0.0746.39 ▼12.27
Posts /wp-admin/edit.php3.53 ▲0.1849.48 ▼1.77
Add New Post /wp-admin/post-new.php6.00 ▲0.1195.08 ▲5.07
Media Library /wp-admin/upload.php3.34 ▲0.1138.19 ▲3.14

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Tiles Proxy for OpenStreetMap
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.34 ▲0.021.49 ▲0.0436.52 ▼2.35
Dashboard /wp-admin2,195 ▲205.69 ▲0.0194.39 ▼25.0142.88 ▼2.66
Posts /wp-admin/edit.php2,100 ▼02.02 ▼0.0039.73 ▲1.0435.05 ▼1.44
Add New Post /wp-admin/post-new.php1,526 ▼023.19 ▼0.37635.34 ▲31.1245.47 ▼2.08
Media Library /wp-admin/upload.php1,400 ▲64.25 ▲0.07102.97 ▲6.7543.00 ▲2.64

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/osm-tiles-proxy/includes/plugin.leaflet-map.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/osm-tiles-proxy/osm-tiles-proxy.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: proxy, embed, openstreetmap, gdpr

osm-tiles-proxy/osm-tiles-proxy.php Passed 13 tests

This is the main PHP file of "Tiles Proxy for OpenStreetMap" version 2.3.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
42 characters long description:
Helper plugin for embedding OpenStreetMaps

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected17,520 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript45,2247,16016,585
CSS15627578
PHP48034357

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity15.00
▷ Minimum class complexity2.00
▷ Maximum class complexity28.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants2
▷ Global constants2100.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
6 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/leaflet/images/layers-2x.png1.23KB1.67KB0.00%
libs/leaflet/images/marker-icon.png1.43KB1.55KB0.00%
libs/leaflet/images/marker-shadow.png0.60KB1.16KB0.00%
libs/leaflet/images/layers.png0.68KB1.05KB0.00%
assets/out_of_range.png18.05KB9.85KB▼ 45.41%