78% geometa-acf

Code Review | GeoMeta For ACF

WordPress plugin GeoMeta For ACF scored78%from 54 tests.

About plugin

  • Plugin page: geometa-acf
  • Plugin version: 0.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.7.2
  • WordPress version: 6.3.1
  • First release: Nov 29, 2016
  • Latest release: Mar 4, 2017
  • Number of updates: 8
  • Update frequency: every 10.9 days
  • Top authors: stuporglue (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,778 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by GeoMeta For ACF
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.30 ▼1.07
Dashboard /wp-admin3.31 ▲0.0050.05 ▼0.22
Posts /wp-admin/edit.php3.36 ▲0.0048.86 ▲3.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.04 ▼3.68
Media Library /wp-admin/upload.php3.23 ▲0.0037.78 ▲1.87

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 165 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by GeoMeta For ACF
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.74 ▲0.671.69 ▼0.4044.50 ▲2.53
Dashboard /wp-admin2,200 ▲125.91 ▲1.05100.41 ▼5.7236.59 ▼10.50
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0134.81 ▼3.6232.82 ▲0.83
Add New Post /wp-admin/post-new.php1,519 ▼023.33 ▲0.15657.26 ▼17.6852.37 ▼5.02
Media Library /wp-admin/upload.php1,388 ▲34.12 ▼0.0897.79 ▼7.7647.75 ▲1.71

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% 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
Almost there! Just fix the following items
  • 20× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/tests/DeleteLatLngMeta.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/tests/HandleMultiMetaClause.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/testsuite.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/tests/LoadDataTest.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/geoPHP/tests/test.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/wp-geometa-lib.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/tests/QueryOneGeomValTest.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/tests/__load.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/tests/QueryOneGeomBoolTest.php
    • > /wp-content/plugins/geometa-acf/wp-geometa-lib/test/tests/LoadLatLng.php
  • 262× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > 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/geometa-acf/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 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\t34,\t\t99,\t\t'myplugin_geo',\t\tGeomFromText('MULTIPOINT (-93 44)',4326)\t) ON DUPLICATE KEY UPDATE meta_value=GeomFromText('MULTIPOINT (-93 44)',4326) made by require('/plugins/geometa-acf/wp-geometa-lib/test/tests/LoadLatLng.php'), 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 SELECT Dimension(meta_value) FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' AND post_id='16'
    • > WordPress database error Table 'potrivit.wp_postmeta_geo' doesn't exist for query DELETE FROM wp_postmeta_geo WHERE fk_meta_id IN (37) 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 Dimension(meta_value) FROM wp_postmeta_geo WHERE meta_key='wpgeometa_test' AND post_id='16'
    • > 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='41' made by require('/plugins/geometa-acf/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 (28) 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 DELETE FROM wp_postmeta_geo WHERE fk_meta_id IN (50) 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 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\t33,\t\t62,\t\t'wpgeometa_test',\t\tGeomFromText('MULTIPOLYGON (((-93.252632618387 45.090331317491, -93.252632618387 45.093724575976, -93.244907856424 45.093724575976, -93.244907856424 45.090331317491, -93.252632618387 45.090331317491)))',4326)\t) ON DUPLICATE KEY UPDATE meta_value=GeomFromText('MULTIPOLYGON (((-93.252632618387 45.090331317491, -93.252632618387 45.093724575976, -93.244907856424 45.093724575976, -93.244907856424 45.090331317491, -93.252632618387 45.090331317491)))',4326) made by require('/plugins/geometa-acf/wp-geometa-lib/test/tests/LoadDataTest.php'), 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 (24) 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 shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: spatial, geo, gis, geojson, acf...

geometa-acf/geometa-acf.php Passed 13 tests

The main file in "GeoMeta For ACF" v. 0.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
63 characters long description:
Store real spatial data with ACF, using the WP-GeoMeta library.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected37,793 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
XML122018,393
JavaScript63,4504,01310,319
PHP541,2201,9416,061
Markdown1138401,055
CSS911948860
HTML1150720
SQL47620130
Pascal14316295
PO File1121250
JSON40040
SVG10027
Bourne Shell313525
YAML16518

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity29.66
▷ Minimum class complexity1.00
▷ Maximum class complexity166.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes38.57%
▷ Concrete classes3291.43%
▷ Final classes00.00%
Methods370
▷ Static methods5013.51%
▷ Public methods28777.57%
▷ Protected methods4211.35%
▷ Private methods4111.08%
Functions15
▷ Named functions1386.67%
▷ Anonymous functions213.33%
Constants21
▷ Global constants628.57%
▷ Class constants1571.43%
▷ Public constants15100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
21 PNG files occupy 1.02MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wp-geometa-lib/sql/8_point_buffer.png109.78KB35.56KB▼ 67.60%
leaflet-php/assets/leaflet/images/layers.png0.68KB1.05KB0.00%
assets/screenshot-2.png201.79KB59.61KB▼ 70.46%
leaflet-php/assets/leaflet/images/layers-2x.png1.23KB1.67KB0.00%
leaflet-php/assets/Leaflet.draw/dist/images/marker-shadow.png0.60KB1.16KB0.00%