10% mapsian

Code Review | Mapsian

WordPress plugin Mapsian scored 10% from 54 tests.

About plugin

  • Plugin page: mapsian
  • Plugin version: 1.4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-3.9.1
  • WordPress version: 5.8.1
  • First release: Jun 23, 2014
  • Latest release: Aug 21, 2014
  • Number of updates: 231
  • Update frequency: every 0.3 days
  • Top authors: StanleyChoi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active / 2,035 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/mapsian/mapsian.php+31
    Use of undefined constant PLUGINSURL - assumed 'PLUGINSURL' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.85MB] [CPU: ▼193.20ms] Passed 4 tests

Analyzing server-side resources used by Mapsian
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.78 ▼0.945.22 ▼15.69
Dashboard /wp-admin1.80 ▼1.259.32 ▼36.33
Posts /wp-admin/edit.php1.80 ▼1.315.24 ▼46.94
Add New Post /wp-admin/post-new.php1.80 ▼3.635.13 ▼659.54
Media Library /wp-admin/upload.php1.80 ▼1.204.77 ▼29.99
Document /wp-admin/edit.php?post_type=maps&page=m_about1.805.24
Add new map /wp-admin/post-new.php?post_type=maps1.804.82
Locations /wp-admin/edit.php?post_type=locations1.806.66
Maps /wp-admin/edit.php?post_type=maps1.806.30
Setting /wp-admin/edit.php?post_type=maps&page=m_setting1.805.68
Groups /wp-admin/edit-tags.php?taxonomy=mapsian_group&post_type=locations1.805.44

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 48 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mapsian
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,898 ▲25117.37 ▲1.6817.21 ▲7.8046.00 ▼1.91
Dashboard /wp-admin3,025 ▲917.16 ▲1.12144.50 ▼15.11123.49 ▲15.00
Posts /wp-admin/edit.php2,821 ▲822.89 ▲0.1880.72 ▲7.6688.77 ▲3.49
Add New Post /wp-admin/post-new.php1,662 ▲4721.84 ▲0.36302.52 ▼8.65120.03 ▲19.89
Media Library /wp-admin/upload.php1,812 ▲55.86 ▲0.86147.59 ▼12.35157.16 ▲33.98
Document /wp-admin/edit.php?post_type=maps&page=m_about1,1662.9155.3464.46
Add new map /wp-admin/post-new.php?post_type=maps2,4603.8094.45132.90
Locations /wp-admin/edit.php?post_type=locations1,5062.9369.6572.65
Maps /wp-admin/edit.php?post_type=maps1,5012.8272.4871.29
Setting /wp-admin/edit.php?post_type=maps&page=m_setting1,4572.9376.4974.85
Groups /wp-admin/edit-tags.php?taxonomy=mapsian_group&post_type=locations1,8232.7362.6879.37

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
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/mapsian/mapsian.php+31
    Use of undefined constant PLUGINSURL - assumed 'PLUGINSURL' (this will throw an Error in a future version of PHP)

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=mapsian_group&post_type=locations
    • > Warning in wp-content/plugins/mapsian/mapsian.php+31
    Use of undefined constant PLUGINSURL - assumed 'PLUGINSURL' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/mapsian.php+67
    Undefined index: ID
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+182
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+200
    Undefined variable: only_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+201
    Undefined variable: maplist_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+209
    Undefined variable: grid_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+210
    Undefined variable: column_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+218
    Undefined variable: one_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+219
    Undefined variable: two_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+220
    Undefined variable: three_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+221
    Undefined variable: four_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+222
    Undefined variable: five_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+227
    Undefined variable: social_share
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+230
    Undefined variable: display_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+231
    Undefined variable: hide_selected
    • > GET request to /wp-admin/post-new.php?post_type=maps
    • > Notice in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php+73
    Undefined variable: group_value
    • > GET request to /wp-admin/edit.php?post_type=maps&page=m_setting
    • > Notice in wp-content/plugins/mapsian/includes/mapsian-general-settings.php+8
    Undefined index: api_key
    • > GET request to /wp-admin/edit.php?post_type=maps&page=m_setting
    • > Notice in wp-content/plugins/mapsian/includes/mapsian-general-settings.php+9
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=maps&page=m_setting
    • > Notice in wp-content/plugins/mapsian/includes/mapsian-general-settings.php+25
    Undefined index: language

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
Please take a closer look at the following
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mapsian/includes/mapsian-location-view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mapsian/templates/single-map.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mapsian/core/admin/setup-style.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mapsian/includes/mapsian-map-view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mapsian/ajax/ajaxs.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mapsian/mapsian.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mapsian/core/admin/setup-meta-maps.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mapsian/core/admin/setup-custom-post.php:5
    • > PHP Warning
      Use of undefined constant PLUGINSURL - assumed 'PLUGINSURL' (this will throw an Error in a future version of PHP) in wp-content/plugins/mapsian/mapsian.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mapsian/functions/mapsian-functions.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=mapsian_group&post_type=locations
    • > Network (severe)
    http://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 24 tag instead of maximum 10
You can take inspiration from this readme.txt

mapsian/mapsian.php 92% from 13 tests

"Mapsian" version 1.4.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 340 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin3,033 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP13379891,267
CSS3358114905
JavaScript423420551
PO File3126252310

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/mapsian_icon_remove.png0.85KB0.60KB▼ 28.77%
images/mapsian_icon_remove3.png2.05KB1.51KB▼ 26.24%
images/mapsian_icon_preview2.png2.93KB1.92KB▼ 34.36%
images/mapsian_admin_icon_enable.png3.80KB2.21KB▼ 41.78%
images/mapsian_icon_statusoff.png0.88KB1.08KB0.00%