78% basic-google-maps-placemarks

Code Review | Basic Google Maps Placemarks

WordPress plugin Basic Google Maps Placemarks scored78%from 54 tests.

About plugin

  • Plugin page: basic-google-maps...
  • Plugin version: 1.10.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 6.3.1
  • First release: May 29, 2011
  • Latest release: May 26, 2017
  • Number of updates: 256
  • Update frequency: every 8.6 days
  • Top authors: iandunn (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

5,000+ active /197,753 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.37MB] [CPU: ▲0.93ms] Passed 4 tests

Analyzing server-side resources used by Basic Google Maps Placemarks
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3638.93 ▼1.87
Dashboard /wp-admin3.67 ▲0.3646.81 ▼5.37
Posts /wp-admin/edit.php3.78 ▲0.4252.24 ▲4.38
Add New Post /wp-admin/post-new.php6.27 ▲0.3898.42 ▲7.50
Media Library /wp-admin/upload.php3.59 ▲0.3640.41 ▲6.57
Placemarks /wp-admin/edit.php?post_type=bgmp3.6338.13
Basic Google Maps Placemarks /wp-admin/options-general.php?page=bgmp_settings3.5732.97
Add New /wp-admin/post-new.php?post_type=bgmp3.8053.26
Categories /wp-admin/edit-tags.php?taxonomy=bgmp-category&post_type=bgmp3.5836.08

Server storage [IO: ▲0.46MB] [DB: ▲0.32MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 54 new files
Database: no new tables, 21 new options
New WordPress options
widget_recent-comments
widget_recent-posts
bgmp_map-navigation-control
bgmp_map-height
theysaidso_admin_options
bgmp_map-address
bgmp_map-latitude
bgmp_map-zoom
widget_theysaidso_widget
bgmp_map-type-control
...

Browser metrics Passed 4 tests

An overview of browser requirements for Basic Google Maps Placemarks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10313.18 ▼1.411.63 ▼0.1737.44 ▼8.55
Dashboard /wp-admin2,241 ▲534.84 ▼0.27109.23 ▼5.4542.80 ▼6.88
Posts /wp-admin/edit.php2,127 ▲412.02 ▼0.0339.05 ▲4.7035.52 ▼1.83
Add New Post /wp-admin/post-new.php1,577 ▲5818.30 ▼4.88585.08 ▼115.3171.78 ▲23.55
Media Library /wp-admin/upload.php1,420 ▲324.19 ▼0.1299.55 ▼8.5042.07 ▼5.19
Placemarks /wp-admin/edit.php?post_type=bgmp1,1301.9532.7228.67
Basic Google Maps Placemarks /wp-admin/options-general.php?page=bgmp_settings1,2694.6852.7649.07
Add New /wp-admin/post-new.php?post_type=bgmp2,6677.66176.3269.39
Categories /wp-admin/edit-tags.php?taxonomy=bgmp-category&post_type=bgmp1,3002.1326.3927.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 21 options
    • bgmp_map-zoom
    • can_compress_scripts
    • bgmp_map-type
    • bgmp_map-latitude
    • bgmp_cluster-style
    • db_upgraded
    • bgmp_map-width
    • widget_theysaidso_widget
    • bgmp_map-type-control
    • bgmp_map-height
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/basic-google-maps-placemarks/basic-google-maps-placemarks.php
    • > /wp-content/plugins/basic-google-maps-placemarks/settings.php
    • > /wp-content/plugins/basic-google-maps-placemarks/core.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/basic-google-maps-placemarks/views/settings.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'WP_PLUGIN_DIR/simpletest-for-wordpress/WpSimpleTest.php' (include_path='.:/usr/share/php') in wp-content/plugins/basic-google-maps-placemarks/unit-tests.php on line 12
    • > PHP Warning
      require_once(WP_PLUGIN_DIR/simpletest-for-wordpress/WpSimpleTest.php): failed to open stream: No such file or directory in wp-content/plugins/basic-google-maps-placemarks/unit-tests.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/basic-google-maps-placemarks/views/meta-z-index.php:1
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/basic-google-maps-placemarks/views/settings-marker-clusterer.php on line 1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/basic-google-maps-placemarks/views/shortcode-bgmp-map.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/basic-google-maps-placemarks/views/meta-re-abolish-slavery.php:1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/basic-google-maps-placemarks/views/settings-marker-clusterer.php on line 1
    • > PHP Notice
      Undefined variable: class in wp-content/plugins/basic-google-maps-placemarks/views/message.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/basic-google-maps-placemarks/views/message.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: placemark, shortcode, google maps, marker clustering, map...

basic-google-maps-placemarks/basic-google-maps-placemarks.php 92% from 13 tests

The principal PHP file in "Basic Google Maps Placemarks" v. 1.10.7 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,115 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PO File87488162,103
PHP134505541,800
JavaScript24481156
CSS1131856

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity88.67
▷ Minimum class complexity29.00
▷ Maximum class complexity199.00
Average method complexity5.46
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods59
▷ Static methods23.39%
▷ Public methods4983.05%
▷ Protected methods1016.95%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants330.00%
▷ Class constants770.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/default-marker.png0.84KB1.10KB0.00%
includes/marker-clusterer/images/heart50.png2.93KB1.96KB▼ 33.08%
includes/marker-clusterer/images/m1.png2.93KB2.20KB▼ 25.07%
includes/marker-clusterer/images/m2.png3.18KB2.36KB▼ 25.77%
includes/marker-clusterer/images/m3.png3.86KB3.06KB▼ 20.80%