84% mapbox-for-wp

Code Review | Mapbox For WP

WordPress plugin Mapbox For WP scored84%from 54 tests.

About plugin

  • Plugin page: mapbox-for-wp
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 20, 2023
  • Latest release: Jun 27, 2023
  • Number of updates: 3
  • Update frequency: every 4.7 days
  • Top authors: webdevstudios (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /386 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 gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.76ms] Passed 4 tests

A check of server-side resources used by Mapbox For WP
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1537.80 ▼5.78
Dashboard /wp-admin3.44 ▲0.1447.88 ▼2.79
Posts /wp-admin/edit.php3.55 ▲0.2050.14 ▲2.45
Add New Post /wp-admin/post-new.php6.03 ▲0.1495.03 ▼0.53
Media Library /wp-admin/upload.php3.36 ▲0.1335.76 ▲2.06

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 243 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
mbwp_public_token
mbwp_default_style
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Mapbox For WP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲10716.91 ▲2.2834.79 ▲32.6039.39 ▼4.95
Dashboard /wp-admin2,225 ▲344.86 ▼0.01109.23 ▲2.7345.01 ▲6.06
Posts /wp-admin/edit.php2,105 ▲132.05 ▲0.0541.01 ▲2.7634.75 ▲1.06
Add New Post /wp-admin/post-new.php6,279 ▲4,74224.04 ▲0.75909.16 ▲194.7666.07 ▲11.80
Media Library /wp-admin/upload.php1,404 ▲164.18 ▲0.0692.87 ▼24.5841.86 ▼6.04

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 8 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • mbwp_public_token
    • mbwp_default_style
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 203× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WebDevStudios\\MBWP\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor_prefixed/composer/installers/src/Composer/Installers/SilverStripeInstaller.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WebDevStudios\\MBWP\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor_prefixed/composer/installers/src/Composer/Installers/PhpBBInstaller.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WebDevStudios\\MBWP\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor_prefixed/composer/installers/src/Composer/Installers/ShopwareInstaller.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WebDevStudios\\MBWP\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor_prefixed/composer/installers/src/Composer/Installers/TuskInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WebDevStudios\\MBWP\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor_prefixed/composer/installers/src/Composer/Installers/CakePHPInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WebDevStudios\\MBWP\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor_prefixed/composer/installers/src/Composer/Installers/Symfony1Installer.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WebDevStudios\\MBWP\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mapbox-for-wp/vendor_prefixed/composer/installers/src/Composer/Installers/WolfCMSInstaller.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: block, maps, map, mapbox, interactive map...

mapbox-for-wp/mapbox-for-wp.php Passed 13 tests

The main PHP file in "Mapbox For WP" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
87 characters long description:
Integrate your maps from Mapbox into WordPress using a simple yet powerful Mapbox Block

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected5,751 lines of code in 237 files:
LanguageFilesBlank linesComment linesLines of code
PHP2249332,1215,001
JSON400341
Markdown2600283
YAML3313123
JavaScript2002
CSS2101

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity2.38
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes211
▷ Abstract classes20.95%
▷ Concrete classes20999.05%
▷ Final classes10.48%
Methods244
▷ Static methods208.20%
▷ Public methods15663.93%
▷ Protected methods6827.87%
▷ Private methods208.20%
Functions18
▷ Named functions527.78%
▷ Anonymous functions1372.22%
Constants14
▷ Global constants642.86%
▷ Class constants857.14%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin