77% brilliant-geocoder-gravity-forms

Code Review | Brilliant Geocoder for Gravity Forms

WordPress plugin Brilliant Geocoder for Gravity Forms scored77%from 54 tests.

About plugin

  • Plugin page: brilliant-geocode...
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 8, 2017
  • Latest release: Feb 8, 2017
  • Number of updates: 3
  • Update frequency: every 7.3 days
  • Top authors: stuporglue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,719 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
This plugin's installer ran successfully

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

An overview of server-side resources used by Brilliant Geocoder for Gravity Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.81 ▲1.84
Dashboard /wp-admin3.31 ▲0.0051.65 ▲4.72
Posts /wp-admin/edit.php3.36 ▲0.0052.45 ▲5.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.30 ▼5.19
Media Library /wp-admin/upload.php3.23 ▲0.0041.01 ▲1.11

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 176 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Brilliant Geocoder for Gravity Forms: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.171.76 ▲0.1346.05 ▼0.41
Dashboard /wp-admin2,198 ▲185.58 ▼0.1591.64 ▲4.3249.44 ▲4.15
Posts /wp-admin/edit.php2,103 ▼01.99 ▼0.0139.13 ▲0.6334.02 ▼3.92
Add New Post /wp-admin/post-new.php1,526 ▼923.44 ▲5.44667.05 ▲4.2159.22 ▼2.50
Media Library /wp-admin/upload.php1,400 ▲34.11 ▼0.08113.66 ▲13.7846.72 ▼2.40

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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 fix the following
  • 20× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/PopulateTable.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/QueryOrderByTest.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/wp-geoquery.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/UnloadDataTest.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/wp-geometa-lib-loader.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/QueryOrderByDistance.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/QueryOneGeomInValTest.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/geoPHP/tests/test.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/LoadLatLng.php
    • > /wp-content/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/testsuite.php
  • 263× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query SELECT Dimension(meta_value) FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' AND post_id='30' made by require('/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/QueryOrderByTest.php')
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query SELECT Dimension(meta_value) FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' AND post_id='46' made by require('/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/QueryOrderByTest.php')
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query INSERT INTO wp_postmeta_geo \t\t\t\t(\t\tpost_id,\t\tfk_meta_id,\t\tmeta_key,\t\tmeta_value\t) VALUES (\t\t12,\t\t47,\t\t'geo_',\t\tGeomFromText('MULTIPOINT (-93.265 44.9778)',4326)\t) ON DUPLICATE KEY UPDATE meta_value=GeomFromText('MULTIPOINT (-93.265 44.9778)',4326) made by update_post_meta, update_metadata, add_metadata, do_action('added_post_meta'), WP_Hook->do_action, WP_Hook->apply_filters, WP_GeoMeta->__call, WP_GeoMeta->upsert_meta
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query DELETE FROM wp_postmeta_geo WHERE fk_meta_id IN (38) made by wp_delete_post, delete_metadata_by_mid, do_action('deleted_post_meta'), WP_Hook->do_action, WP_Hook->apply_filters, WP_GeoMeta->__call, WP_GeoMeta->deleted_meta
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query SELECT post_id FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' made by require('/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/LoadDataTest.php')
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query DELETE FROM wp_postmeta_geo WHERE fk_meta_id IN (69) made by require('/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/UnloadDataTest.php'), wp_delete_post, delete_metadata_by_mid, do_action('deleted_post_meta'), WP_Hook->do_action, WP_Hook->apply_filters, WP_GeoMeta->__call, WP_GeoMeta->deleted_meta
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query SELECT Dimension(meta_value) FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' AND post_id='26'
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query SELECT Dimension(meta_value) FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' AND post_id='39' made by require('/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/QueryOrderByTest.php')
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query SELECT Dimension(meta_value) FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' AND post_id='36' made by require('/plugins/brilliant-geocoder-gravity-forms/lib/wp-geometa-lib/test/tests/QueryOrderByTest.php')
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query DELETE FROM wp_postmeta_geo WHERE fk_meta_id IN (21) made by wp_delete_post, delete_metadata_by_mid, do_action('deleted_post_meta'), WP_Hook->do_action, WP_Hook->apply_filters, WP_GeoMeta->__call, WP_GeoMeta->deleted_meta

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

brilliant-geocoder-gravity-forms/brilliant-geocoder-gravityforms.php 77% from 13 tests

The main PHP script in "Brilliant Geocoder for Gravity Forms" version 0.0.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("brilliant-geocoder-gravity-forms.php" instead of "brilliant-geocoder-gravityforms.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected38,350 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
XML122018,393
JavaScript93,4954,03010,536
PHP571,3382,1056,459
Markdown1239701,066
CSS911948841
HTML1150720
SQL47620130
Pascal14316295
JSON40040
SVG10027
Bourne Shell313525
YAML16518

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.42
Average class complexity31.20
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes38.57%
▷ Concrete classes3291.43%
▷ Final classes00.00%
Methods392
▷ Static methods5113.01%
▷ Public methods30978.83%
▷ Protected methods4210.71%
▷ Private methods4110.46%
Functions23
▷ Named functions2086.96%
▷ Anonymous functions313.04%
Constants22
▷ Global constants731.82%
▷ Class constants1568.18%
▷ Public constants15100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
28 PNG files occupy 1.85MB with 0.72MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/leaflet-php/assets/Leaflet.draw/dist/images/marker-shadow.png0.60KB1.16KB0.00%
assets/screenshot-9.png49.33KB14.59KB▼ 70.42%
lib/leaflet-php/assets/leaflet/images/marker-shadow.png0.60KB1.16KB0.00%
assets/banner-1544x500.png341.05KB161.96KB▼ 52.51%
assets/screenshot-4.png113.03KB32.84KB▼ 70.95%