52% stonehenge-em-osm

Code Review | Events Manager - OpenStreetMaps

WordPress plugin Events Manager - OpenStreetMaps scored52%from 54 tests.

About plugin

  • Plugin page: stonehenge-em-osm
  • Plugin version: 4.2.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.0
  • WordPress version: 6.3.1
  • First release: Dec 6, 2018
  • Latest release: Mar 16, 2022
  • Number of updates: 144
  • Update frequency: every 8.3 days
  • Top authors: DuisterDenHaag (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

1,000+ active /24,821 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.68MB] [CPU: ▼14.87ms] Passed 4 tests

Server-side resources used by Events Manager - OpenStreetMaps
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.32 ▲0.8632.67 ▼8.39
Dashboard /wp-admin4.04 ▲0.7041.72 ▼20.93
Posts /wp-admin/edit.php4.12 ▲0.7644.29 ▼1.78
Add New Post /wp-admin/post-new.php6.33 ▲0.4474.63 ▼28.39
Media Library /wp-admin/upload.php4.05 ▲0.8240.22 ▲5.28
EM - OpenStreetMap /wp-admin/admin.php?page=stonehenge_em_osm4.0337.14
 More... /wp-admin/admin.php?page=stonehenge-plugins4.0335.31
Free Support /wp-admin/admin.php?page=stonehenge_forums4.0342.85

Server storage [IO: ▲4.48MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 1,183 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Events Manager - OpenStreetMaps
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.29 ▼1.361.61 ▲0.0140.45 ▲0.64
Dashboard /wp-admin2,235 ▲495.90 ▼0.03104.54 ▼7.3239.68 ▲0.12
Posts /wp-admin/edit.php2,115 ▲662.01 ▼0.0640.71 ▲2.9236.05 ▲3.83
Add New Post /wp-admin/post-new.php1,551 ▲2323.15 ▼0.32651.36 ▼15.3848.67 ▼20.91
Media Library /wp-admin/upload.php1,420 ▲294.20 ▲0.0697.41 ▼3.1243.64 ▲0.20
EM - OpenStreetMap /wp-admin/admin.php?page=stonehenge_em_osm8292.2329.8541.58
 More... /wp-admin/admin.php?page=stonehenge-plugins1,0402.2227.2444.42
Free Support /wp-admin/admin.php?page=stonehenge_forums9052.3229.6347.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/stonehenge-em-osm/uninstall.php+13
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=stonehenge_forums
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
    • > GET request to /wp-admin/admin.php?page=stonehenge_forums
    • > Notice in wp-content/plugins/stonehenge-em-osm/stonehenge/class-forum.php+55
    Undefined offset: 1

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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/symfony/translation/Resources/bin/translation-status.php
    • > /wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/mustache/mustache/bin/build_bootstrap.php
  • 297× 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 show_hidden_fields() on null in wp-content/plugins/stonehenge-em-osm/templates/location-select.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Exception\\ExceptionInterface' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/symfony/css-selector/Exception/ParseException.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/symfony/translation/Loader/JsonFileLoader.php:21
    • > PHP Warning
      array_slice() expects parameter 1 to be array, null given in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/symfony/translation/Resources/bin/translation-status.php on line 54
    • > PHP Fatal error
      Uncaught Error: Interface 'Thunder\\Shortcode\\Processor\\ProcessorInterface' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/thunderer/shortcode/src/Processor/Processor.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/predicthq/address-formatter/tests/AddressObjectTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Config\\Definition\\Builder\umericNodeDefinition' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/symfony/config/Definition/Builder/IntegerNodeDefinition.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/symfony/css-selector/Node/SelectorNode.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Dumper\\FileDumper' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/symfony/translation/Dumper/MoFileDumper.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p6_DebugBar_Panel' not found in wp-content/plugins/stonehenge-em-osm/stonehenge/server/Puc/v4p6/DebugBar/PluginPanel.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #6 (Apply filters to change markers and map tile server.) image not found
Please take inspiration from this readme.txt

stonehenge-em-osm/stonehenge-em-osm.php Passed 13 tests

The principal PHP file in "Events Manager - OpenStreetMaps" v. 4.2.1 is loaded by WordPress automatically on each request
74 characters long description:
OpenStreetMap replacement for Events Manager. 0% Google, 100% Open Source.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .ms - Maxwell Script in Maxwell Render
      • wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/mustache/mustache/test/fixtures/templates/alpha.ms
      • wp-content/plugins/stonehenge-em-osm/stonehenge/vendor/mustache/mustache/test/fixtures/templates/beta.ms
77,411 lines of code in 1,039 files:
LanguageFilesBlank linesComment linesLines of code
PHP5338,66015,71644,015
JavaScript873,4654,03113,971
YAML2909756017,942
XSD392482,803
CSS14132892,325
Markdown3167801,824
JSON19001,629
PO File174184221,469
LESS211571,080
Mustache3610145
Perl114898
XML45097
make12011
Dockerfile1102

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 159)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity10.18
▷ Minimum class complexity1.00
▷ Maximum class complexity309.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity159.00
Code structure
Namespaces79
Interfaces58
Traits1
Classes462
▷ Abstract classes245.19%
▷ Concrete classes43894.81%
▷ Final classes8619.63%
Methods2,646
▷ Static methods2278.58%
▷ Public methods2,09679.21%
▷ Protected methods28010.58%
▷ Private methods27010.20%
Functions234
▷ Named functions9038.46%
▷ Anonymous functions14461.54%
Constants137
▷ Global constants53.65%
▷ Class constants13296.35%
▷ Public constants12594.70%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
44 compressed PNG files occupy 0.59MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/marker-icon-2x-violet.png1.95KB2.03KB0.00%
assets/images/marker-icon-yellow.png0.98KB0.99KB0.00%
assets/images/layers.png0.68KB1.05KB0.00%
assets/images/marker-icon.png0.94KB0.96KB0.00%
stonehenge/assets/images/ui-icons_777620_256x240.png4.57KB4.18KB▼ 8.43%