72% cm-map-locations

Code Review | CM Map Locations

WordPress plugin CM Map Locations scored72%from 54 tests.

About plugin

  • Plugin page: cm-map-locations
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 26, 2015
  • Latest release: Sep 10, 2023
  • Number of updates: 313
  • Update frequency: every 9.1 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /19,106 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲2.06MB] [CPU: ▲10.46ms] 75% from 4 tests

This is a short check of server-side resources used by CM Map Locations
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 981.73ms on /wp-admin/admin.php?page=cmloc-settings)
PageMemory (MB)CPU Time (ms)
Home /5.52 ▲2.0652.90 ▲12.08
Dashboard /wp-admin5.38 ▲2.0859.88 ▲12.08
Posts /wp-admin/edit.php5.43 ▲2.0873.51 ▲24.93
Add New Post /wp-admin/post-new.php7.98 ▲2.1097.24 ▼1.20
Media Library /wp-admin/upload.php5.23 ▲2.0151.66 ▲18.87
Settings /wp-admin/admin.php?page=cmloc-settings5.62981.73
Locations /wp-admin/edit.php?post_type=cmloc_object5.3552.24
User Guide /wp-admin/admin.php?page=cmloc_about5.41452.01
Upgrade ➤ /wp-admin/admin.php?page=cmloc_pro5.2752.86

Server storage [IO: ▲2.30MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 196 new files
Database: no new tables, 10 new options
New WordPress options
cmlocplugin_error
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
cmloc_update_methods
widget_recent-posts
widget_cmloc_menuwidget
widget_cmloc_searchwidget

Browser metrics Passed 4 tests

A check of browser resources used by CM Map Locations
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14913.35 ▼1.021.91 ▲0.2430.02 ▼10.75
Dashboard /wp-admin2,273 ▲854.88 ▼1.05108.44 ▲3.7750.18 ▲7.53
Posts /wp-admin/edit.php2,155 ▲662.06 ▲0.0541.35 ▲3.0241.08 ▲6.12
Add New Post /wp-admin/post-new.php1,574 ▲4123.19 ▼0.08672.94 ▼10.2461.07 ▲0.25
Media Library /wp-admin/upload.php1,455 ▲674.35 ▲0.1097.09 ▼2.0546.80 ▲1.87
Settings /wp-admin/admin.php?page=cmloc-settings3,41413.39184.20158.19
Locations /wp-admin/edit.php?post_type=cmloc_object1,1282.0132.4235.02
User Guide /wp-admin/admin.php?page=cmloc_about4,08716.50385.67204.21
Upgrade ➤ /wp-admin/admin.php?page=cmloc_pro1,9682.1640.6747.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_cmloc_searchwidget
    • widget_cmloc_menuwidget
    • widget_recent-posts
    • widget_recent-comments
    • cmloc_update_methods
    • db_upgraded
    • theysaidso_admin_options
    • cmlocplugin_error
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/cm-map-locations/view/backend/business/form-icon.php
    • > /wp-content/plugins/cm-map-locations/view/frontend/route/common-map-category-filter.php
    • > /wp-content/plugins/cm-map-locations/view/frontend/route/index-top.php
    • > /wp-content/plugins/cm-map-locations/view/backend/route/metabox-shortcodes.php
  • 108× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\maplocations\\model\\TaxonomyTerm' not found in wp-content/plugins/cm-map-locations/model/Category.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function getJSLocations() on null in wp-content/plugins/cm-map-locations/view/frontend/route/single-map-canvas.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/cm-map-locations/view/frontend/dashboard/msg.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\maplocations\\model\\Labels' not found in wp-content/plugins/cm-map-locations/view/frontend/business/index-after-filters.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\maplocations\\controller\\Controller' not found in wp-content/plugins/cm-map-locations/controller/SidebarController.php:11
    • > PHP Notice
      Undefined variable: mapId in wp-content/plugins/cm-map-locations/view/frontend/embed/embed-single.php on line 9
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/cm-map-locations/view/frontend/embed/embed-single.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\maplocations\\model\\Labels' not found in wp-content/plugins/cm-map-locations/view/frontend/business/zip-filter.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\maplocations\\metabox\\MetaBox' not found in wp-content/plugins/cm-map-locations/metabox/LocationShortcodesMetabox.php:8
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/cm-map-locations/view/backend/route/metabox-shortcodes.php on line 13

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/admin.php?page=cmloc_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmloc_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmloc_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yx/r/RBH7b7zeA6F.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmloc_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yx/r/RBH7b7zeA6F.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: mapping, google maps, store locator, business locations, map widget

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

Analyzing the main PHP file in "CM Map Locations" version 2.0.6
63 characters long description:
Manage locations and support location finder using Google Maps.

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
Everything looks great! No dangerous files found in this plugin18,039 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
PHP1082,44974011,664
CSS9172283,037
JavaScript236878192,698
SVG100640

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity18.97
▷ Minimum class complexity1.00
▷ Maximum class complexity254.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces12
Interfaces0
Traits0
Classes58
▷ Abstract classes1017.24%
▷ Concrete classes4882.76%
▷ Final classes00.00%
Methods639
▷ Static methods36657.28%
▷ Public methods57790.30%
▷ Protected methods548.45%
▷ Private methods81.25%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants265
▷ Global constants10.38%
▷ Class constants26499.62%
▷ Public constants264100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
39 PNG files occupy 0.60MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
package/views/businessdir.png30.22KB8.77KB▼ 70.98%
package/css/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
package/views/downloads.png34.70KB9.25KB▼ 73.35%
package/views/img/assets.png16.34KB6.92KB▼ 57.67%