72% themify-store-locator

Code Review | Themify Store Locator

WordPress plugin Themify Store Locator scored 72% from 54 tests.

About plugin

  • Plugin page: themify-store-loc...
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Dec 21, 2016
  • Latest release: Aug 16, 2023
  • Number of updates: 135
  • Update frequency: every 18.0 days
  • Top authors: themifyme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active / 14,297 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.78MB] [CPU: ▼1.26ms] Passed 4 tests

A check of server-side resources used by Themify Store Locator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.7842.88 ▲1.83
Dashboard /wp-admin4.17 ▲0.8652.39 ▼0.11
Posts /wp-admin/edit.php4.17 ▲0.8251.61 ▼0.02
Add New Post /wp-admin/post-new.php6.67 ▲0.7891.52 ▼6.73
Media Library /wp-admin/upload.php3.98 ▲0.7539.66 ▲3.82
Manage Locations /wp-admin/edit.php?post_type=themify_storelocator4.0940.10
Add New /wp-admin/post-new.php?post_type=themify_storelocator4.2362.01
Categories /wp-admin/edit-tags.php?taxonomy=store_category&post_type=themify_storelocator4.0044.14
Settings /wp-admin/edit.php?post_type=themify_storelocator&page=themify-sl-setting3.9336.79
About /wp-admin/edit.php?post_type=themify_storelocator&page=themify-sl-about3.9337.95

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 104 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Themify Store Locator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲12313.26 ▼1.121.95 ▲0.3342.06 ▼6.08
Dashboard /wp-admin2,254 ▲635.83 ▼0.0797.96 ▼6.3138.25 ▼1.70
Posts /wp-admin/edit.php2,137 ▲451.98 ▼0.0634.20 ▼4.5933.58 ▼3.97
Add New Post /wp-admin/post-new.php6,505 ▲4,97720.37 ▲2.12910.79 ▲308.4838.53 ▼18.31
Media Library /wp-admin/upload.php1,436 ▲484.19 ▼0.0397.30 ▼14.6941.42 ▼6.09
Manage Locations /wp-admin/edit.php?post_type=themify_storelocator1,1091.9632.8633.22
Add New /wp-admin/post-new.php?post_type=themify_storelocator3,18011.33306.34211.41
Categories /wp-admin/edit-tags.php?taxonomy=store_category&post_type=themify_storelocator1,4993.5043.3027.55
Settings /wp-admin/edit.php?post_type=themify_storelocator&page=themify-sl-setting9322.0424.9531.12
About /wp-admin/edit.php?post_type=themify_storelocator&page=themify-sl-about1,0472.0223.6330.22

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/themify-store-locator/store_locator.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Themify_Store_Locator' not found in wp-content/plugins/themify-store-locator/template/single-loop.php:3
    • > PHP Notice
      Undefined variable: the_query in wp-content/plugins/themify-store-locator/template/archive-loop.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/themify-store-locator/template/archive-loop.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/themify-store-locator/views/shortcode-fields.php:2
    • > PHP Notice
      Undefined variable: layout in wp-content/plugins/themify-store-locator/template/archive-loop.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/themify-store-locator/views/config-for-include.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/post-new.php?post_type=themify_storelocator
    • > Console-api (warning) in unknown
    http://maps.googleapis.com/maps/api/js?key=&_=1696220496943 208: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/post-new.php?post_type=themify_storelocator
    • > Console-api (severe) in unknown
    http://maps.googleapis.com/maps/api/js?key=&_=1696220496943 128:245 "You are using this API without a key. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors"

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: shortcode, location, map, google-map, store

themify-store-locator/store_locator.php 85% from 13 tests

The main PHP script in "Themify Store Locator" version 1.1.8 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("themify-store-locator.php" instead of "store_locator.php")
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected8,722 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP134414553,269
CSS1335602,776
JavaScript253322582,617
HTML10059
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity73.50
▷ Minimum class complexity29.00
▷ Maximum class complexity172.00
Average method complexity4.82
▷ Minimum method complexity1.00
▷ Maximum method complexity54.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods76
▷ Static methods810.53%
▷ Public methods6990.79%
▷ Protected methods00.00%
▷ Private methods79.21%
Functions51
▷ Named functions5098.04%
▷ Anonymous functions11.96%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/X_icon.png1.87KB1.86KB0.31%
includes/themify-metabox/img/ddbtn-blank.png0.07KB0.09KB0.00%
includes/themify-metabox/img/icon-delete.png0.45KB0.46KB0.00%
includes/themify-metabox/img/ddbtn-check.png0.14KB0.23KB0.00%
includes/themify-metabox/img/ddbtn-cross.png0.18KB0.27KB0.00%