57% mapbox-for-wp-advanced

Code Review | Mapbox for WP Advanced

WordPress plugin Mapbox for WP Advanced scored 57% from 54 tests.

About plugin

  • Plugin page: mapbox-for-wp-adv...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 6.3.1
  • First release: May 2, 2015
  • Latest release: Sep 14, 2015
  • Number of updates: 18
  • Update frequency: every 7.5 days
  • Top authors: stephanemartinw (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 5,053 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.34MB] [CPU: ▼48.18ms] Passed 4 tests

A check of server-side resources used by Mapbox for WP Advanced
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.64 ▼0.828.15 ▼37.18
Dashboard /wp-admin2.66 ▼0.649.10 ▼37.93
Posts /wp-admin/edit.php2.66 ▼0.6910.42 ▼35.72
Add New Post /wp-admin/post-new.php2.66 ▼3.228.08 ▼81.89
Media Library /wp-admin/upload.php2.66 ▼0.579.38 ▼24.49
Controls /wp-admin/admin.php?page=mapboxadv-controls2.669.09
Maps /wp-admin/admin.php?page=mapboxadv-maps2.669.91
General /wp-admin/admin.php?page=mapboxadv2.668.13
Add new /wp-admin/admin.php?page=mapboxadv-maps-form2.668.81

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 14 new files
Database: 1 new table, 8 new options
New tables
wp_mapboxadv_maps
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
mapboxadv_db_version
widget_recent-comments
theysaidso_admin_options
widget_mapboxadv
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mapbox for WP Advanced
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲13515.22 ▲0.855.51 ▲3.2140.14 ▼5.38
Dashboard /wp-admin2,250 ▲655.93 ▲0.08117.03 ▼1.7340.40 ▼8.66
Posts /wp-admin/edit.php2,133 ▲442.62 ▲0.5949.20 ▲13.4936.34 ▼0.40
Add New Post /wp-admin/post-new.php1,549 ▲3522.41 ▲4.90726.11 ▲74.9361.95 ▲9.75
Media Library /wp-admin/upload.php1,435 ▲505.18 ▲0.97107.43 ▲6.9943.90 ▲1.49
Controls /wp-admin/admin.php?page=mapboxadv-controls1,0602.5332.4029.60
Maps /wp-admin/admin.php?page=mapboxadv-maps9622.5334.4026.23
General /wp-admin/admin.php?page=mapboxadv1,0532.4933.4029.41
Add new /wp-admin/admin.php?page=mapboxadv-maps-form1,6667.44136.6965.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxadvcss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie tables were found after uninstall: 1 table
    • wp_mapboxadv_maps
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_mapboxadv
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • mapboxadv_db_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxadvcss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxadvcss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > User notice in wp-includes/functions.php+5905
    Function wp_add_inline_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxadvcss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxjs handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxjs handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxcss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the mapboxcss handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > Notice in wp-content/plugins/mapbox-for-wp-advanced/mapboxmaps.php+67
    Undefined variable: mapboxadv_db_version
    • > GET request to /wp-admin/admin.php?page=mapboxadv-maps-form
    • > Notice in wp-content/plugins/mapbox-for-wp-advanced/mapboxmaps.php+152
    Undefined index: nonce

SRP 50% 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 take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mapbox-for-wp-advanced/shortcut.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mapbox-for-wp-advanced/default.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mapbox-for-wp-advanced/mapboxmaps.php:87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mapbox-for-wp-advanced/mapboxwidgetadv.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mapbox-for-wp-advanced/mapboxadv.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

mapbox-for-wp-advanced/mapboxadv.php 77% from 13 tests

Analyzing the main PHP file in "Mapbox for WP Advanced" version 1.0.0
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mapbox-for-wp-advanced.php" instead of "mapboxadv.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Make the plugin description longer than 10 characters (currently 0 characters long)

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,413 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP62792671,574
JavaScript2151127503
PO File1159834335
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity17.00
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods94
▷ Static methods11.06%
▷ Public methods9398.94%
▷ Protected methods00.00%
▷ Private methods11.06%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin