90% map-block-for-mapbox

Code Review | Map Block for Mapbox

WordPress plugin Map Block for Mapbox scored90%from 54 tests.

About plugin

  • Plugin page: map-block-for-mapbox
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.1
  • WordPress version: 6.3.1
  • First release: Oct 17, 2018
  • Latest release: Dec 20, 2018
  • Number of updates: 5
  • Update frequency: every 15.2 days
  • Top authors: samhermes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,064 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.02MB] [CPU: ▼4.41ms] Passed 4 tests

Server-side resources used by Map Block for Mapbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.76 ▼3.72
Dashboard /wp-admin3.34 ▼0.0149.79 ▼12.26
Posts /wp-admin/edit.php3.39 ▲0.0353.68 ▲0.33
Add New Post /wp-admin/post-new.php5.95 ▲0.0698.73 ▲6.90
Media Library /wp-admin/upload.php3.27 ▲0.0334.00 ▼1.98
Map Block for Mapbox /wp-admin/admin.php?page=mapbox-block-settings3.2333.25

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

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

Browser metrics Passed 4 tests

Map Block for Mapbox: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲6514.94 ▲0.6622.24 ▲20.3545.56 ▼3.52
Dashboard /wp-admin2,195 ▲185.59 ▼0.0691.05 ▲5.1137.06 ▼3.20
Posts /wp-admin/edit.php2,100 ▼31.99 ▼0.0439.78 ▲1.9936.35 ▲2.43
Add New Post /wp-admin/post-new.php6,218 ▲4,69222.56 ▼0.97917.31 ▲286.9167.05 ▲17.81
Media Library /wp-admin/upload.php1,400 ▲34.20 ▲0.03102.98 ▼0.7544.21 ▲0.98
Map Block for Mapbox /wp-admin/admin.php?page=mapbox-block-settings7911.9922.8626.83

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 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 Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: map, embed, block, mapbox

map-block-for-mapbox/map-block-mapbox.php 92% from 13 tests

Analyzing the main PHP file in "Map Block for Mapbox" version 1.0.1
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("map-block-for-mapbox.php" instead of "map-block-mapbox.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
Success! There were no dangerous files found in this plugin412 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript537102225
PHP23075134
Sass36038
CSS212315

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin