73% lh-places

Code Review | LH Places

WordPress plugin LH Places scored73%from 54 tests.

About plugin

  • Plugin page: lh-places
  • Plugin version: 1.02
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Jun 1, 2016
  • Latest release: Apr 2, 2017
  • Number of updates: 6
  • Update frequency: every 376.0 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /714 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.57MB] [CPU: ▼19.76ms] Passed 4 tests

Server-side resources used by LH Places
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1136.56 ▼8.75
Dashboard /wp-admin3.42 ▲0.1146.04 ▼7.42
Posts /wp-admin/edit.php3.53 ▲0.1748.37 ▼0.36
Add New Post /wp-admin/post-new.php3.26 ▼2.6334.64 ▼62.50
Media Library /wp-admin/upload.php3.34 ▲0.1137.90 ▲7.59
Places /wp-admin/edit.php?post_type=lh-place3.3835.82
Add New /wp-admin/post-new.php?post_type=lh-place3.2632.10

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for LH Places
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8414.46 ▲0.081.52 ▲0.0236.82 ▼3.54
Dashboard /wp-admin2,233 ▲445.85 ▲0.95103.29 ▼6.7840.21 ▼1.66
Posts /wp-admin/edit.php2,113 ▲422.07 ▲0.0037.62 ▲1.0535.57 ▲1.46
Add New Post /wp-admin/post-new.php1,537 ▲117.63 ▼5.63635.83 ▼21.4655.87 ▲6.46
Media Library /wp-admin/upload.php1,415 ▲274.28 ▲0.0593.23 ▼2.1942.58 ▲0.85
Places /wp-admin/edit.php?post_type=lh-place1,0971.9731.7128.32
Add New /wp-admin/post-new.php?post_type=lh-place2,5089.44302.34174.37

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

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
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Notice in wp-content/plugins/lh-places/lh-places.php+117
    Undefined index: geo_latitude
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Notice in wp-content/plugins/lh-places/lh-places.php+323
    Undefined index: lh_places-place-geojson
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Notice in wp-content/plugins/lh-places/lh-places.php+145
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Notice in wp-content/plugins/lh-places/lh-places.php+123
    Undefined index: geo_longitude
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Notice in wp-content/plugins/lh-places/lh-places.php+145
    Undefined index: geo_address

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/lh-places/lh-places.php:737

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Network (severe)
    wp-content/plugins/lh-places/assets/admin-stye.css?ver=1.0.2 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Network (severe)
    https://google-developers.appspot.com/maps/documentation/utils/geojson/editor.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/post-new.php?post_type=lh-place
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?v=3.exp&ver=6.3.1 210: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"

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

lh-places/lh-places.php Passed 13 tests

"LH Places" version 1.02's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
30 characters long description:
Adds a places custom post type

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected567 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP128320484
JavaScript264083

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods1881.82%
▷ Protected methods00.00%
▷ Private methods418.18%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
9 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons/marker4.png3.61KB0.90KB▼ 74.98%
assets/icons/marker5.png3.69KB0.99KB▼ 73.29%
assets/icons/marker6.png3.71KB1.04KB▼ 72.07%
assets/icons/marker1.png3.59KB0.90KB▼ 74.97%
assets/icons/marker3.png3.70KB1.00KB▼ 72.85%