72% locatepress

Code Review | Locatepress

WordPress plugin Locatepress scored 72% from 54 tests.

About plugin

  • Plugin page: locatepress
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 6.3.1
  • First release: Sep 27, 2021
  • Latest release: Nov 22, 2021
  • Number of updates: 8
  • Update frequency: every 7.4 days
  • Top authors: locatepress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 402 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.20MB] [CPU: ▲0.62ms] Passed 4 tests

An overview of server-side resources used by Locatepress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2037.29 ▼3.09
Dashboard /wp-admin3.49 ▲0.1950.78 ▲3.67
Posts /wp-admin/edit.php3.61 ▲0.2551.36 ▲2.33
Add New Post /wp-admin/post-new.php6.28 ▲0.3987.97 ▼0.42
Media Library /wp-admin/upload.php3.38 ▲0.1547.12 ▲12.47
Categories /wp-admin/edit-tags.php?taxonomy=listing_category&post_type=map_listing3.4639.77
Settings /wp-admin/edit.php?post_type=map_listing&page=locatepress_dashboard3.4936.00
Listing Types /wp-admin/edit-tags.php?taxonomy=listing_type&post_type=map_listing3.4141.25
Listing Tags /wp-admin/edit-tags.php?taxonomy=listing_tags&post_type=map_listing3.4034.00
Add new Listing /wp-admin/post-new.php?post_type=map_listing5.8274.55
All Listings /wp-admin/edit.php?post_type=map_listing3.4750.59

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 74 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Locatepress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,176 ▲44117.20 ▲3.0220.56 ▲18.8540.71 ▼0.27
Dashboard /wp-admin2,437 ▲2466.66 ▲1.77172.26 ▲68.6748.96 ▲8.16
Posts /wp-admin/edit.php2,354 ▲2624.03 ▲1.9978.64 ▲38.0338.03 ▲4.53
Add New Post /wp-admin/post-new.php1,731 ▲21724.08 ▲6.32610.52 ▼51.1328.37 ▼34.25
Media Library /wp-admin/upload.php1,487 ▲1025.28 ▲1.0898.40 ▼0.1349.32 ▲6.65
Categories /wp-admin/edit-tags.php?taxonomy=listing_category&post_type=map_listing1,5303.9860.1129.49
Settings /wp-admin/edit.php?post_type=map_listing&page=locatepress_dashboard1,5754.1866.6484.33
Listing Types /wp-admin/edit-tags.php?taxonomy=listing_type&post_type=map_listing1,5354.0062.1030.47
Listing Tags /wp-admin/edit-tags.php?taxonomy=listing_tags&post_type=map_listing1,4993.9466.9332.71
Add new Listing /wp-admin/post-new.php?post_type=map_listing7,70626.841,163.46153.30
All Listings /wp-admin/edit.php?post_type=map_listing1,3934.1472.4735.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=map_listing
    • > Notice in wp-content/plugins/locatepress/admin/class-locatepress-meta-map.php+40
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/locatepress/admin/partials/locatepress-admin-footer.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=map_listing
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key&libraries=places&ver=6.3.1 232: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=map_listing
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key&libraries=places&ver=6.3.1 163:373 "google.maps.event.addDomListener() is deprecated, use the standard\naddEventListener() method instead:\nhttps://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener\nThe feature will continue to work and there is no plan to decommission\nit."
    • > GET request to /wp-admin/post-new.php?post_type=map_listing
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?key&libraries=places&ver=6.3.1 152: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 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
There were no plugin tags found

locatepress/locatepress.php 92% from 13 tests

The principal PHP file in "Locatepress" v. 1.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 228 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin19,516 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
CSS92,53627912,467
JavaScript111,2845504,104
PHP268307682,260
SVG100685

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity13.06
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods88
▷ Static methods1213.64%
▷ Public methods7989.77%
▷ Protected methods00.00%
▷ Private methods910.23%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/cpm-logo.png6.34KB3.19KB▼ 49.69%
admin/images/logo.png25.87KB9.59KB▼ 62.92%