10% jsp-store-locator

Code Review | JSP Store Locator

WordPress plugin JSP Store Locator scored10%from 54 tests.

About plugin

  • Plugin page: jsp-store-locator
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0
  • WordPress version: 6.3.1
  • First release: Dec 12, 2018
  • Latest release: Jan 8, 2019
  • Number of updates: 6
  • Update frequency: every 5.7 days
  • Top authors: ajaylulia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /767 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/jsp-store-locator/public/class_jsp_store_locator_public.php+12
    Undefined index: map_type

Server metrics [RAM: ▼1.66MB] [CPU: ▼48.25ms] Passed 4 tests

A check of server-side resources used by JSP Store Locator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.33 ▼1.135.29 ▼35.28
Dashboard /wp-admin2.35 ▼0.966.68 ▼42.84
Posts /wp-admin/edit.php2.35 ▼1.017.47 ▼39.39
Add New Post /wp-admin/post-new.php2.35 ▼3.547.58 ▼75.49
Media Library /wp-admin/upload.php2.35 ▼0.885.99 ▼29.60
Configuration /wp-admin/admin.php?page=jspsl-configuration2.357.29
Import/Export (Pro) /wp-admin/admin.php?page=jspsl-import-export2.358.66
JSP Store Locator /wp-admin/admin.php?page=jspsl-plugin2.355.87
Add New Categories /wp-admin/admin.php?page=jspsl-add-new-categories2.358.12
Search Hit (Pro) /wp-admin/admin.php?page=jspsl-search-hit2.356.03
Branch Hit (Pro) /wp-admin/admin.php?page=jspsl-branch-hit2.357.11
Manage Stores /wp-admin/admin.php?page=jspsl-manage-stores2.356.05
Add New Store /wp-admin/admin.php?page=jspsl-add-new-store2.356.97
Google Places (Pro) /wp-admin/admin.php?page=jspsl-google-places2.355.80
Categories /wp-admin/admin.php?page=jspsl-categories2.357.37

Server storage [IO: ▲13.43MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 68 new files
Database: 5 new tables, 6 new options
New tables
wp_jsp_store_categories
wp_jsp_map_language
wp_jsp_mapstyle
wp_jsp_configuration_table
wp_jsp_stores
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for JSP Store Locator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲10213.26 ▼1.361.74 ▼0.3139.95 ▼9.12
Dashboard /wp-admin2,268 ▲804.84 ▼0.09103.74 ▼4.9238.74 ▼0.36
Posts /wp-admin/edit.php2,148 ▲591.99 ▼0.0336.30 ▲0.2635.02 ▲1.91
Add New Post /wp-admin/post-new.php1,581 ▲4823.28 ▲0.04603.12 ▼84.0648.42 ▼14.79
Media Library /wp-admin/upload.php1,450 ▲624.18 ▼0.0496.42 ▼19.6040.02 ▼7.07
Configuration /wp-admin/admin.php?page=jspsl-configuration1,2711.7125.9325.67
Import/Export (Pro) /wp-admin/admin.php?page=jspsl-import-export9032.0423.3435.37
JSP Store Locator /wp-admin/admin.php?page=jspsl-plugin1,1331.7125.7531.21
Add New Categories /wp-admin/admin.php?page=jspsl-add-new-categories8502.0624.0124.95
Search Hit (Pro) /wp-admin/admin.php?page=jspsl-search-hit8362.0625.0921.98
Branch Hit (Pro) /wp-admin/admin.php?page=jspsl-branch-hit8392.0624.3520.93
Manage Stores /wp-admin/admin.php?page=jspsl-manage-stores1,1331.7125.6931.20
Add New Store /wp-admin/admin.php?page=jspsl-add-new-store1,1672.1926.2528.24
Google Places (Pro) /wp-admin/admin.php?page=jspsl-google-places8962.0425.3331.15
Categories /wp-admin/admin.php?page=jspsl-categories1,0462.0726.2229.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/jsp-store-locator/public/class_jsp_store_locator_public.php+12
    Undefined index: map_type
  • Zombie tables were found after uninstall: 5 tables
    • wp_jsp_store_categories
    • wp_jsp_map_language
    • wp_jsp_configuration_table
    • wp_jsp_stores
    • wp_jsp_mapstyle
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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)
These errors were triggered by the plugin
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jspsl-categories
    • > Notice in wp-content/plugins/jsp-store-locator/public/class_jsp_store_locator_public.php+12
    Undefined index: map_type
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jspsl-categories
    • > 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 custom_style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+304
    Undefined property: stdClass::$CATEGORY_ID
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+368
    Undefined property: stdClass::$CONTACT_PERSON
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+380
    Undefined variable: config
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+380
    Trying to get property 'GENDER' of non-object
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+390
    Undefined property: stdClass::$EMAIL
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+402
    Undefined property: stdClass::$WEBSITE
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+410
    Undefined property: stdClass::$CONTACT_NUMBER
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+418
    Undefined property: stdClass::$DESCRIPTION
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+430
    Undefined property: stdClass::$FACEBOOK
    • > GET request to /wp-admin/admin.php?page=jspsl-add-new-store
    • > Notice in wp-content/plugins/jsp-store-locator/admin/class_jsp_store_locator_admin.php+438
    Undefined property: stdClass::$TWITTER

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/jsp-store-locator/public/class_jsp_store_locator_public.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/jsp-store-locator/admin/css/class_jsp_store_locator_admin_bk.php on line 3
    • > PHP Warning
      require_once(PLUGIN_PATHadmin/class_List_Table.php): failed to open stream: No such file or directory in wp-content/plugins/jsp-store-locator/admin/css/class_jsp_store_locator_admin_bk.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'PLUGIN_PATHadmin/class_List_Table.php' (include_path='.:/usr/share/php') in wp-content/plugins/jsp-store-locator/admin/css/class_jsp_store_locator_admin_bk.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jsp-store-locator/jsp-store-locator.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: geotagging, regional maps, maps locations, street maps, map directions

jsp-store-locator/jsp-store-locator.php 92% from 13 tests

The principal PHP file in "JSP Store Locator" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 280 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
Success! There were no dangerous files found in this plugin6,958 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,6471343,428
PHP82,106873,101
JavaScript512797429

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity27.75
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods80
▷ Static methods22.50%
▷ Public methods7998.75%
▷ Protected methods00.00%
▷ Private methods11.25%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
17 PNG files occupy 1.51MB with 0.80MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pointer.png0.96KB0.86KB▼ 11.34%
images/delete.png0.71KB0.46KB▼ 34.79%
images/theme2.png3.09KB0.60KB▼ 80.64%
screenshot-2.png239.80KB99.24KB▼ 58.62%
images/pointertheme3.png2.87KB0.57KB▼ 80.22%