84% wp-geo

Code Review | WP Geo

WordPress plugin WP Geo scored 84% from 54 tests.

About plugin

  • Plugin page: wp-geo
  • Plugin version: 3.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.4
  • WordPress version: 6.3.1
  • First release: Apr 28, 2008
  • Latest release: Apr 16, 2020
  • Number of updates: 491
  • Update frequency: every 8.9 days
  • Top authors: husobj (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

2,000+ active / 106,090 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by WP Geo
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6546.58 ▲5.92
Dashboard /wp-admin4.12 ▲0.8250.95 ▲0.41
Posts /wp-admin/edit.php4.23 ▲0.8847.87 ▼2.66
Add New Post /wp-admin/post-new.php6.72 ▲0.8398.04 ▼10.25
Media Library /wp-admin/upload.php4.04 ▲0.8142.63 ▲11.00
WP Geo /wp-admin/options-general.php?page=wp-geo4.0135.52

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 72 new files
Database: no new tables, 12 new options
New WordPress options
widget_recent-comments
db_upgraded
wp_geo_options
widget_wpgeo_contextual_map_widget
can_compress_scripts
widget_wpgeo_category_map_widget
wp_geo_show_version_msg
theysaidso_admin_options
widget_wpgeo_recent_locations_widget
widget_recent-posts
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Geo
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲17414.60 ▼0.0025.37 ▲23.2737.35 ▼10.85
Dashboard /wp-admin2,212 ▲275.81 ▼0.0997.96 ▲0.8135.57 ▼3.21
Posts /wp-admin/edit.php2,094 ▲52.01 ▲0.0033.94 ▼1.4133.11 ▼0.78
Add New Post /wp-admin/post-new.php11,481 ▲9,93822.10 ▲3.581,138.45 ▲517.7250.97 ▲4.30
Media Library /wp-admin/upload.php1,397 ▲94.37 ▲0.1493.86 ▼2.9041.65 ▼1.28
WP Geo /wp-admin/options-general.php?page=wp-geo1,3362.1825.1133.95

Uninstaller [IO: ▲0.01MB] [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
These items require your attention
  • This plugin does not fully uninstall, leaving 12 options in the database
    • wp_geo_version
    • widget_recent-comments
    • widget_wpgeo_recent_locations_widget
    • wp_geo_options
    • wp_geo_show_version_msg
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_wpgeo_contextual_map_widget
    • widget_wpgeo_category_map_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WPGeo_Widget' not found in wp-content/plugins/wp-geo/widgets/category-map.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-geo/includes/shortcodes.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-geo/widgets/wpgeo-widget.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WPGeo_Widget' not found in wp-content/plugins/wp-geo/widgets/recent-locations.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-geo/admin/dashboard.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-geo/admin/donate-links.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPGeo_Widget' not found in wp-content/plugins/wp-geo/widgets/contextual-map.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WPGeo_API' not found in wp-content/plugins/wp-geo/api/googlemapsv3/googlemapsv3.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-geo/wp-geo.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WPGeo_API' not found in wp-content/plugins/wp-geo/api/googlemapsv2/googlemapsv2.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
7 plugin tags: maps, map, location, geo, georss...

wp-geo/wp-geo.php Passed 13 tests

Analyzing the main PHP file in "WP Geo" version 3.5.1
62 characters long description:
Adds location maps to your posts, pages and custom post types.

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
Success! There were no dangerous files found in this plugin6,992 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP266411,6223,168
PO File131,2781,7063,127
JavaScript7143160591
CSS1621106

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity18.00
▷ Minimum class complexity2.00
▷ Maximum class complexity123.00
Average method complexity2.55
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods231
▷ Static methods10.43%
▷ Public methods231100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions3191.18%
▷ Anonymous functions38.82%
Constants8
▷ Global constants8100.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
10 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/logo/wp-geo.png2.81KB1.57KB▼ 44.22%
img/logo/icon32.png2.23KB1.38KB▼ 38.17%
img/markers/dot-marker.png1.32KB0.20KB▼ 84.84%
img/markers/dot-marker-shadow.png1.27KB0.16KB▼ 87.73%
img/markers/large-marker.png2.12KB1.10KB▼ 48.02%