78% pronamic-google-maps

Code Review | Pronamic Google Maps

WordPress plugin Pronamic Google Maps scored78%from 54 tests.

About plugin

  • Plugin page: pronamic-google-maps
  • Plugin version: 2.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Sep 30, 2010
  • Latest release: Sep 15, 2016
  • Number of updates: 176
  • Update frequency: every 12.4 days
  • Top authors: pronamic (53.98%)remcotolsma (46.59%)

Code review

54 tests

User reviews

34 reviews

Install metrics

2,000+ active /162,173 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.19MB] [CPU: ▼0.16ms] Passed 4 tests

This is a short check of server-side resources used by Pronamic Google Maps
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.2243.41 ▼4.40
Dashboard /wp-admin3.81 ▲0.2554.23 ▲0.50
Posts /wp-admin/edit.php3.86 ▲0.1860.11 ▲10.98
Add New Post /wp-admin/post-new.php6.33 ▲0.1893.10 ▼7.71
Media Library /wp-admin/upload.php3.67 ▲0.1847.99 ▲12.24
Settings /wp-admin/admin.php?page=pronamic_google_maps3.6437.53
Geocoder /wp-admin/admin.php?page=pronamic_google_maps_geocoder3.6641.79

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 62 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_pronamic_google_maps

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pronamic Google Maps
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7914.39 ▲0.102.11 ▲0.5443.15 ▼0.95
Dashboard /wp-admin2,206 ▲295.67 ▼0.0286.57 ▼3.4482.49 ▲38.86
Posts /wp-admin/edit.php2,129 ▲292.04 ▼0.0137.31 ▼0.2235.56 ▼1.55
Add New Post /wp-admin/post-new.php1,561 ▲3022.71 ▼0.44779.62 ▲100.0355.50 ▲4.26
Media Library /wp-admin/upload.php1,423 ▲264.25 ▲0.03103.45 ▲1.7976.45 ▲33.17
Settings /wp-admin/admin.php?page=pronamic_google_maps8802.7047.2227.59
Geocoder /wp-admin/admin.php?page=pronamic_google_maps_geocoder8222.5247.8130.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_pronamic_google_maps
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

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 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
The following issues need your attention
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/pronamic-google-maps/views/widget-form.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pronamic_get_google_maps_meta() in wp-content/plugins/pronamic-google-maps/views/meta-box.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/pronamic-google-maps/views/page-geocoder.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/pronamic-google-maps/views/page-general.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pronamic-google-maps/views/widget-form.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function format_to_edit() in wp-content/plugins/pronamic-google-maps/views/widget-form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pronamic-google-maps/pronamic-google-maps.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pronamic-google-maps/classes/Pronamic/Google/Maps/Widget.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pronamic_google_maps_geocoder
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?sensor=false 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 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (The Google Maps widget.), #2 (Meta box where you can easily manage the Google Maps / GEO data.), #3 (Configuration panel of the Pronamic Google Maps plugin. Within this panel you can easily activate the Google Maps functionality for the registered post types.), #4 (The geocoder can be used to geocode multiple posts at once.)
Please take inspiration from this readme.txt

pronamic-google-maps/pronamic-google-maps.php Passed 13 tests

"Pronamic Google Maps" version 2.3.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
104 characters long description:
This plugin makes it simple to add Google Maps to your WordPress post, pages or other custom post types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected3,826 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript95091,2251,552
PHP265269531,481
PO File7393583777
CSS21616

PHP code Passed 2 tests

An short overview of 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.17
Average class complexity6.72
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods75
▷ Static methods4965.33%
▷ Public methods75100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants34
▷ Global constants00.00%
▷ Class constants34100.00%
▷ Public constants34100.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
8 PNG files occupy 0.79MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png543.47KB200.90KB▼ 63.03%
images/icon-256x256.png50.61KB15.52KB▼ 69.33%
images/icon-16x16.png1.03KB0.85KB▼ 17.47%
screenshot-1.png144.30KB57.13KB▼ 60.41%
images/icon-16x16-v2.png0.55KB0.62KB0.00%