68% map-my-locations

Code Review | Map My Locations

WordPress plugin Map My Locations scored 68% from 54 tests.

About plugin

  • Plugin page: map-my-locations
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.9
  • WordPress version: 6.3.1
  • First release: Sep 9, 2020
  • Latest release: Jan 29, 2022
  • Number of updates: 14
  • Update frequency: every 36.8 days
  • Top authors: lewisking0072 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active / 1,082 total downloads

Benchmarks

Plugin footprint 65% 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.07MB] [CPU: ▼1.68ms] Passed 4 tests

Server-side resources used by Map My Locations
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0834.19 ▼7.42
Dashboard /wp-admin3.37 ▲0.0744.21 ▼3.72
Posts /wp-admin/edit.php3.49 ▲0.1348.68 ▲3.73
Add New Post /wp-admin/post-new.php5.97 ▲0.09104.52 ▲5.34
Media Library /wp-admin/upload.php3.29 ▲0.0736.58 ▲0.71
Locations /wp-admin/edit.php?post_type=mml_location3.3436.81
Add New /wp-admin/post-new.php?post_type=mml_location3.4246.31
Maps /wp-admin/admin.php?page=map-my-locations-maps3.2935.98
Settings /wp-admin/admin.php?page=map-my-locations3.2933.09

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 30 new files
Database: 1 new table, 7 new options
New tables
wp_mml_search_geodata
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
map_my_locations_options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Map My Locations
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,991 ▲25618.35 ▲3.7234.39 ▲32.6057.50 ▲8.08
Dashboard /wp-admin2,285 ▲936.97 ▲2.06135.95 ▲21.5541.63 ▲1.38
Posts /wp-admin/edit.php2,167 ▲783.62 ▲1.5951.07 ▲11.9934.35 ▲0.59
Add New Post /wp-admin/post-new.php1,737 ▲21424.53 ▲0.86594.62 ▼56.8228.41 ▼15.72
Media Library /wp-admin/upload.php1,470 ▲826.10 ▲1.86104.25 ▲2.2040.37 ▼4.83
Locations /wp-admin/edit.php?post_type=mml_location1,1343.5959.4128.05
Add New /wp-admin/post-new.php?post_type=mml_location2,0778.40185.9966.41
Maps /wp-admin/admin.php?page=map-my-locations-maps9803.3038.3727.14
Settings /wp-admin/admin.php?page=map-my-locations9233.3036.7924.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_mml_search_geodata
  • The uninstall procedure has failed, leaving 7 options in the database
    • map_my_locations_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/map-my-locations/admin/class-map-my-locations-map-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/map-my-locations/admin/class-map-my-locations-map-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/map-my-locations/admin/class-map-my-locations-map-table.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/post-new.php?post_type=mml_location
    • > Javascript (severe) in unknown
    /wp-content/plugins/map-my-locations/admin//js/admin.js?ver=1.1 1:11088 Uncaught Error: An API access token is required to use Mapbox GL. …api-documentation/#access-tokens-and-token-scopes
    • > GET request to /wp-admin/post-new.php?post_type=mml_location
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=mml_location - [.WebGL-0x373000335400]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: google-maps, mapbox, maps

map-my-locations/map-my-locations.php Passed 13 tests

"Map My Locations" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
70 characters long description:
Show your locations as pins on a map, Works with Google Maps or Mapbox

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
There were no executable files found in this plugin1,117 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP18336448906
CSS2326209
JavaScript2022

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.20
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods67
▷ Static methods710.45%
▷ Public methods5785.07%
▷ Protected methods00.00%
▷ Private methods1014.93%
Functions8
▷ Named functions450.00%
▷ Anonymous functions450.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin