71% wp-map-builderstyler

Code Review | WP Map Builder/Styler

WordPress plugin WP Map Builder/Styler scored71%from 54 tests.

About plugin

  • Plugin page: wp-map-builderstyler
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 29, 2021
  • Latest release: Jan 31, 2021
  • Number of updates: 10
  • Update frequency: every 0.2 days
  • Top authors: maulikearth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /334 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.15MB] [CPU: ▼2.23ms] Passed 4 tests

A check of server-side resources used by WP Map Builder/Styler
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1538.23 ▼5.18
Dashboard /wp-admin3.45 ▲0.1446.00 ▼3.44
Posts /wp-admin/edit.php3.56 ▲0.2047.30 ▼4.34
Add New Post /wp-admin/post-new.php6.05 ▲0.1694.23 ▲6.35
Media Library /wp-admin/upload.php3.37 ▲0.1436.93 ▲4.05
WP Map Builder /wp-admin/admin.php?page=wbm_map_init_page3.3429.97
Map List /wp-admin/admin.php?page=wbm_map_list_page3.3434.09
Create New Map /wp-admin/admin.php?page=wbm_create_new_map3.3431.37

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 85 new files
Database: 1 new table, 6 new options
New tables
wp_wmb_map_builder
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

WP Map Builder/Styler: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲22014.66 ▲0.0824.76 ▲22.7840.24 ▼7.36
Dashboard /wp-admin2,236 ▲485.47 ▲0.60101.44 ▼15.5380.66 ▲38.48
Posts /wp-admin/edit.php2,128 ▲362.52 ▲0.5139.14 ▼5.8434.27 ▼3.94
Add New Post /wp-admin/post-new.php1,551 ▲3723.19 ▲5.49751.62 ▲50.1235.53 ▼32.92
Media Library /wp-admin/upload.php1,424 ▲394.53 ▲0.31100.35 ▼0.2273.91 ▲31.43
WP Map Builder /wp-admin/admin.php?page=wbm_map_init_page9081.8929.8032.09
Map List /wp-admin/admin.php?page=wbm_map_list_page9712.4540.1229.68
Create New Map /wp-admin/admin.php?page=wbm_create_new_map1,3372.8838.8771.13

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% 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 | 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 output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-map-builderstyler/admin/partials/wp-map-builder-admin-display.php
    • > /wp-content/plugins/wp-map-builderstyler/public/partials/wp-map-builder-public-display.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Wp_Map_Builder_Admin' not found in wp-content/plugins/wp-map-builderstyler/admin/class-wp-map-listing.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Wp_Map_Builder_Admin' not found in wp-content/plugins/wp-map-builderstyler/admin/class-wp-map-builder-init-page.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Wp_Map_Builder_Admin' not found in wp-content/plugins/wp-map-builderstyler/admin/class-wp-map-builder-create-map.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-map-builderstyler/public/class-wp-map-builder-shortcode.php:45

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=wbm_map_list_page
    • > Network (severe)
    wp-content/plugins/wp-map-builderstyler/admin/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wbm_map_list_page
    • > Network (severe)
    wp-content/plugins/wp-map-builderstyler/admin/images/sort_asc.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wbm_create_new_map
    • > Javascript (severe) in unknown
    https://maps.googleapis.com/maps/api/js?key=&libraries=places&callback=myMap 152:473 Uncaught fca: Map: Expected mapDiv of type HTMLElement but was passed null.

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4 in wp-map-builderstyler/assets to your readme.txt
  • Contributors: Plugin contributors not specified
Please take inspiration from this readme.txt

wp-map-builderstyler/wp-map-builder.php 77% from 13 tests

The main file in "WP Map Builder/Styler" v. 1.2.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 146 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-map-builderstyler.php" instead of "wp-map-builder.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin5,303 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2918184,434
PHP16152573807
CSS33862

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
31 PNG files occupy 2.00MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/public/17.png83.94KB82.30KB▼ 1.95%
admin/images/public/11.png35.78KB20.42KB▼ 42.93%
admin/images/public/8.png20.56KB11.63KB▼ 43.43%
admin/images/public/19.png27.75KB25.49KB▼ 8.14%
admin/images/public/20.png75.87KB53.96KB▼ 28.88%