84% embed-osm

Code Review | Embed OSM

WordPress plugin Embed OSM scored84%from 54 tests.

About plugin

  • Plugin page: embed-osm
  • Plugin version: 1.2
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.6.1
  • WordPress version: 6.3.1
  • First release: Apr 3, 2014
  • Latest release: Feb 8, 2021
  • Number of updates: 19
  • Update frequency: every 131.7 days
  • Top authors: tk01k (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /4,074 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▲1.42ms] Passed 4 tests

Analyzing server-side resources used by Embed OSM
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0743.35 ▼1.31
Dashboard /wp-admin3.38 ▲0.0849.57 ▼4.42
Posts /wp-admin/edit.php3.44 ▲0.0855.62 ▲5.86
Add New Post /wp-admin/post-new.php5.97 ▲0.0897.31 ▲5.53
Media Library /wp-admin/upload.php3.31 ▲0.0839.58 ▲8.10
Embed OSM /wp-admin/options-general.php?page=embed_osm3.2835.67

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 75 new files
Database: no new tables, 14 new options
New WordPress options
embed_osm_width
can_compress_scripts
embed_osm_marker
widget_recent-comments
embed_osm_lon
embed_osm_lat
embed_osm_zoom
theysaidso_admin_options
widget_recent-posts
embed_osm_height
...

Browser metrics Passed 4 tests

A check of browser resources used by Embed OSM
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.24 ▼0.031.98 ▲0.1244.06 ▲0.33
Dashboard /wp-admin2,199 ▲285.52 ▼0.0286.90 ▼29.1142.39 ▼0.04
Posts /wp-admin/edit.php2,104 ▲11.96 ▼0.2039.72 ▲1.8937.49 ▲0.50
Add New Post /wp-admin/post-new.php6,337 ▲4,80222.33 ▲4.211,004.32 ▲320.6162.95 ▼13.02
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.05100.44 ▼2.5248.83 ▲6.70
Embed OSM /wp-admin/options-general.php?page=embed_osm9764.3057.5032.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/embed-osm/embed-osm.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please a description for screenshot #2 in embed-osm/assets to your readme.txt
You can look at the official readme.txt

embed-osm/embed-osm.php Passed 13 tests

Analyzing the main PHP file in "Embed OSM" version 1.2
37 characters long description:
Embed OpenStreetMap on the page/post.

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
Everything looks great! No dangerous files found in this plugin2,429 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript223671,408
CSS84625538
PHP13839447
PO File10036

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity4.11
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
54 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
openlayers/theme/default/img/drag-rectangle-on.png1.02KB1.09KB0.00%
openlayers/img/east-mini.png0.33KB0.32KB▼ 5.56%
openlayers/img/zoombar.png0.34KB0.24KB▼ 29.71%
openlayers/img/layer-switcher-maximize.png0.40KB0.35KB▼ 11.60%
openlayers/theme/default/img/view_next_off.png1.46KB1.54KB0.00%