62% locatorlte

Code Review | LocatorLTE - Premium Store Locator

WordPress plugin LocatorLTE - Premium Store Locator scored62%from 54 tests.

About plugin

  • Plugin page: locatorlte
  • Plugin version: 1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 29, 2018
  • Latest release: Apr 15, 2018
  • Number of updates: 20
  • Update frequency: every 0.9 days
  • Top authors: themegeekio (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,009 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.08MB] [CPU: ▼45.30ms] Passed 4 tests

This is a short check of server-side resources used by LocatorLTE - Premium Store Locator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.90 ▼0.5714.03 ▼32.32
Dashboard /wp-admin2.94 ▼0.3720.89 ▼33.96
Posts /wp-admin/edit.php2.94 ▼0.4219.01 ▼32.36
Add New Post /wp-admin/post-new.php2.94 ▼2.9517.68 ▼82.57
Media Library /wp-admin/upload.php2.94 ▼0.2917.58 ▼20.50
Add New /wp-admin/post-new.php?post_type=branch2.9417.13
All Branches /wp-admin/edit.php?post_type=branch2.9418.28
locatorcity /wp-admin/edit-tags.php?taxonomy=locatorcity&post_type=branch3.0017.13
LocatorLTE Settings /wp-admin/options-general.php?page=locatorlte-settings2.9418.78

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

LocatorLTE - Premium Store Locator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,994 ▲23314.13 ▼0.0813.42 ▲11.4138.46 ▼4.66
Dashboard /wp-admin2,217 ▲375.65 ▼0.0185.79 ▼14.1868.46 ▲24.63
Posts /wp-admin/edit.php2,137 ▲372.01 ▼0.0133.80 ▼3.3434.25 ▼0.69
Add New Post /wp-admin/post-new.php1,576 ▲5023.23 ▼0.24791.84 ▲91.3567.29 ▲9.87
Media Library /wp-admin/upload.php1,434 ▲344.21 ▲0.09101.36 ▼13.7273.33 ▲25.46
Add New /wp-admin/post-new.php?post_type=branch2,3287.54174.07130.73
All Branches /wp-admin/edit.php?post_type=branch1,1091.9330.9429.34
locatorcity /wp-admin/edit-tags.php?taxonomy=locatorcity&post_type=branch1,3112.1227.7032.13
LocatorLTE Settings /wp-admin/options-general.php?page=locatorlte-settings8892.0324.1631.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/locatorlte/app/Init/LocatorInit.php+33
    Use of undefined constant prefix - assumed 'prefix' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=locatorlte-settings
    • > Warning in wp-content/plugins/locatorlte/app/Init/LocatorInit.php+36
    Use of undefined constant prefix - assumed 'prefix' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=locatorlte-settings
    • > Notice in wp-content/plugins/locatorlte/app/Init/LocatorInit.php+110
    Trying to get property 'mapapi_key' of non-object
    • > GET request to /wp-admin/options-general.php?page=locatorlte-settings
    • > Notice in wp-content/plugins/locatorlte/app/Init/LocatorInit.php+119
    Trying to get property 'zoom' of non-object
    • > GET request to /wp-admin/options-general.php?page=locatorlte-settings
    • > Notice in wp-content/plugins/locatorlte/app/Init/LocatorInit.php+123
    Trying to get property 'clustering' of non-object
    • > GET request to /wp-admin/options-general.php?page=locatorlte-settings
    • > Notice in wp-content/plugins/locatorlte/app/Init/LocatorInit.php+128
    Trying to get property 'styles' of non-object
    • > GET request to /wp-admin/options-general.php?page=locatorlte-settings
    • > Notice in wp-content/plugins/locatorlte/app/Init/LocatorInit.php+140
    Trying to get property 'items' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/locatorlte/locator.php
    • > /wp-content/plugins/locatorlte/app/Views/pages/locator.php
  • 52× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required '/Layer/easypage.php' (include_path='.:/usr/share/php') in wp-content/plugins/locatorlte/app/Pages/Locator.php on line 5
    • > PHP Warning
      require_once(/Layer/Metabox/metabox.php): failed to open stream: No such file or directory in wp-content/plugins/locatorlte/app/Metaboxes/LocatorMeta.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'Particles\\Layer\\Db\\Db' not found in wp-content/plugins/locatorlte/vendor/flowpress/particles/Layer/Db/Model.php:5
    • > PHP Notice
      Undefined variable: pluginUrl in wp-content/plugins/locatorlte/app/Cpt/Branch.php on line 3
    • > PHP Notice
      Undefined variable: vendorPath in wp-content/plugins/locatorlte/vendor/flowpress/particles/Layer/easypage.php on line 4
    • > PHP Notice
      Undefined variable: pluginUrl in wp-content/plugins/locatorlte/vendor/flowpress/particles/Layer/CPT/CptFactory.php on line 5
    • > PHP Notice
      Undefined variable: vendorPath in wp-content/plugins/locatorlte/vendor/flowpress/particles/Layer/easycpt.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'Particles\\Layer\\Db\\Model' not found in wp-content/plugins/locatorlte/app/Models/Location.php:7
    • > PHP Notice
      Undefined variable: vendorPath in wp-content/plugins/locatorlte/vendor/flowpress/particles/Layer/CPT/CptFactory.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required '/Base/basetaxonomy.php' (include_path='.:/usr/share/php') in wp-content/plugins/locatorlte/vendor/flowpress/particles/Layer/easytaxonomy.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Live Suggestion.), #3 (Default Icons + Custom icon upload option.), #4 (Custom Fields per post addition option.), #5 (API Key Setting.)
The official readme.txt might help

locatorlte/locator.php 92% from 13 tests

The main PHP file in "LocatorLTE - Premium Store Locator" ver. 1.3 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("locatorlte.php" instead of "locator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin5,874 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript21,0039094,171
PHP327031151,591
CSS1292112

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity3.68
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces12
Interfaces3
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods118
▷ Static methods2319.49%
▷ Public methods118100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants0
▷ Global constants00.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
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pointer_1.png1.50KB0.64KB▼ 57.15%
assets/images/custom.png3.74KB3.07KB▼ 17.81%
assets/images/pointer_2.png3.48KB0.61KB▼ 82.53%
assets/images/pointer_3.png3.45KB0.61KB▼ 82.43%
assets/images/pointer_default.png2.45KB2.20KB▼ 10.22%