68% salt-map

Code Review | SALT Map

WordPress plugin SALT Map scored68%from 54 tests.

About plugin

  • Plugin page: salt-map
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.0.0
  • WordPress version: 6.3.1
  • First release: Jan 10, 2014
  • Latest release: Jan 7, 2015
  • Number of updates: 13
  • Update frequency: every 27.8 days
  • Top authors: samuel.erdtman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,007 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼1.84MB] [CPU: ▼52.67ms] Passed 4 tests

A check of server-side resources used by SALT Map
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.316.28 ▼32.85
Dashboard /wp-admin2.17 ▼1.138.29 ▼47.97
Posts /wp-admin/edit.php2.17 ▼1.197.26 ▼39.27
Add New Post /wp-admin/post-new.php2.17 ▼3.727.44 ▼90.57
Media Library /wp-admin/upload.php2.17 ▼1.066.44 ▼30.87
Locations /wp-admin/edit.php?post_type=salt_map_location2.177.59
Add New /wp-admin/post-new.php?post_type=salt_map_location2.177.83
Map Settings /wp-admin/options-general.php?page=test-setting-admin2.176.85

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

SALT Map: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲23414.44 ▲0.1629.34 ▲27.5336.72 ▼8.30
Dashboard /wp-admin2,226 ▲495.63 ▼0.0291.44 ▼7.5742.93 ▼3.34
Posts /wp-admin/edit.php2,131 ▲342.00 ▲0.0136.46 ▲0.8234.11 ▼0.22
Add New Post /wp-admin/post-new.php1,552 ▲2423.22 ▲0.24682.96 ▲31.9254.00 ▲0.66
Media Library /wp-admin/upload.php1,431 ▲314.17 ▲0.0094.11 ▼10.1143.89 ▼4.11
Locations /wp-admin/edit.php?post_type=salt_map_location1,1011.9430.7430.69
Add New /wp-admin/post-new.php?post_type=salt_map_location2,2377.74177.3963.21
Map Settings /wp-admin/options-general.php?page=test-setting-admin1,1983.1537.4629.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > 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 salt_map_page_script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=test-setting-admin
    • > 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 salt_map_page_script 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/options-general.php?page=test-setting-admin
    • > 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 salt_map_markerclusterer_script 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/options-general.php?page=test-setting-admin
    • > 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 salt_map_mustache_script 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/options-general.php?page=test-setting-admin
    • > 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 salt_map_google_map 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/options-general.php?page=test-setting-admin
    • > 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 salt_map_page_style 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/options-general.php?page=test-setting-admin
    • > 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 salt_map_smoothness_style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=salt_map_location
    • > Notice in wp-content/plugins/salt-map/salt_map_locations.php+60
    Undefined index: plib_meta_box_nonce
    • > GET request to /wp-admin/options-general.php?page=test-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=test-setting-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=test-setting-admin
    • > Notice in wp-content/plugins/salt-map/salt_map_settings.php+86
    Trying to access array offset on value of type null

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 fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/salt-map/salt_map_plugin.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #2, #3, #4, #5, #6, #7 in salt-map/assets to your readme.txt
Please take inspiration from this readme.txt

salt-map/salt_map_plugin.php 92% from 13 tests

The main PHP file in "SALT Map" ver. 1.4.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("salt-map.php" instead of "salt_map_plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,182 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript411976641
PHP5526384
PO File1316581
CSS315555
HTML12018
Markdown1103

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.25
▷ Minimum class complexity2.00
▷ Maximum class complexity27.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
jquery/css/smoothness/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
images/salt_location_cluster_3.png7.63KB2.73KB▼ 64.26%
jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
jquery/css/smoothness/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%