62% instant-locations

Code Review | Instant Locations

WordPress plugin Instant Locations scored62%from 54 tests.

About plugin

  • Plugin page: instant-locations
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.5
  • WordPress version: 6.3.1
  • First release: Apr 21, 2016
  • Latest release: Apr 21, 2016
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: tanng (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,100 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.05MB] [CPU: ▼9.91ms] Passed 4 tests

This is a short check of server-side resources used by Instant Locations
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0740.42 ▼2.81
Dashboard /wp-admin3.38 ▲0.0453.73 ▼14.97
Posts /wp-admin/edit.php3.49 ▲0.1449.75 ▼1.29
Add New Post /wp-admin/post-new.php5.52 ▼0.3676.22 ▼20.55
Media Library /wp-admin/upload.php3.30 ▲0.0837.72 ▲0.38
Instant Locations /wp-admin/options-general.php?page=instant-locations3.2533.99

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 11 new files
Database: 1 new table, 7 new options
New tables
wp_locations
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
gl_db_version
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Instant Locations: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5713.85 ▼0.412.38 ▲0.6040.63 ▼5.26
Dashboard /wp-admin2,206 ▲325.52 ▼0.08118.98 ▲21.3141.59 ▼2.39
Posts /wp-admin/edit.php2,117 ▲142.60 ▲0.6149.53 ▲11.9437.02 ▲4.72
Add New Post /wp-admin/post-new.php6,484 ▲4,95623.33 ▲0.171,004.07 ▲333.3345.86 ▼11.13
Media Library /wp-admin/upload.php1,417 ▲175.18 ▲1.07102.71 ▼14.1144.16 ▼5.53
Instant Locations /wp-admin/options-general.php?page=instant-locations9522.2941.4028.33

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_locations
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • gl_db_version
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=instant-locations
    • > Notice in wp-content/plugins/instant-locations/inc/class-il-settings.php+116
    Undefined index: componentRestrictions
    • > GET request to /wp-admin/options-general.php?page=instant-locations
    • > Notice in wp-content/plugins/instant-locations/inc/class-il-settings.php+116
    Trying to access array offset on value of type null

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 fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/instant-locations/inc/class-il-meta-box.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/instant-locations/inc/class-il-settings.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=instant-locations
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?libraries=places&ver=4.2.2 235:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/options-general.php?page=instant-locations
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?libraries=places&ver=4.2.2 153:248 "InvalidValueError: not an instance of HTMLInputElement"

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === instant-locations === )
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add descriptions for screenshots #2, #3 in instant-locations/assets to your readme.txt
The official readme.txt is a good inspiration

instant-locations/instant-locations.php Passed 13 tests

"Instant Locations" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
72 characters long description:
Instant & Auto populate location data with the power of Google Maps API.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin542 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP7109155436
JavaScript1294075
CSS15031

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.75
▷ Minimum class complexity3.00
▷ Maximum class complexity10.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods15
▷ Static methods320.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
There were not PNG files found in your plugin