77% sp-google-maps

Code Review | SP Google Maps

WordPress plugin SP Google Maps scored77%from 54 tests.

About plugin

  • Plugin page: sp-google-maps
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.0-4.8.2
  • WordPress version: 6.3.1
  • First release: Aug 24, 2015
  • Latest release: Sep 26, 2017
  • Number of updates: 17
  • Update frequency: every 44.9 days
  • Top authors: mhamudul_hk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,299 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.01ms] Passed 4 tests

Analyzing server-side resources used by SP Google Maps
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.33 ▼5.66
Dashboard /wp-admin3.33 ▲0.0349.12 ▼5.34
Posts /wp-admin/edit.php3.39 ▲0.0350.89 ▲1.23
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.54 ▼20.47
Media Library /wp-admin/upload.php3.26 ▲0.0337.63 ▼0.58
Maps Settings /wp-admin/edit.php?post_type=sp_google_maps&page=maps-settings3.2336.07
All Maps /wp-admin/edit.php?post_type=sp_google_maps3.3039.45
Add New /wp-admin/post-new.php?post_type=sp_google_maps3.3848.31

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
spgmSettings
widget_theysaidso_widget

Browser metrics Passed 4 tests

SP Google Maps: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲3114.69 ▲0.431.77 ▼0.4844.40 ▲0.50
Dashboard /wp-admin2,223 ▲435.62 ▼0.0585.57 ▼12.8338.96 ▼3.57
Posts /wp-admin/edit.php2,128 ▲281.99 ▲0.0038.40 ▲0.8633.44 ▼2.94
Add New Post /wp-admin/post-new.php1,549 ▲2122.98 ▼0.05666.52 ▼18.0961.71 ▲7.67
Media Library /wp-admin/upload.php1,428 ▲284.25 ▲0.1298.32 ▼19.7347.12 ▼3.13
Maps Settings /wp-admin/edit.php?post_type=sp_google_maps&page=maps-settings9252.0125.6961.54
All Maps /wp-admin/edit.php?post_type=sp_google_maps1,0912.0929.4131.62
Add New /wp-admin/post-new.php?post_type=sp_google_maps3,12313.21329.86253.13

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • spgmSettings
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sp-google-maps/sp_google_maps.php
    • > /wp-content/plugins/sp-google-maps/metaboxes.php
    • > /wp-content/plugins/sp-google-maps/admin.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=sp_google_maps
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?libraries=geometry&language=en 219: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"
    • > GET request to /wp-admin/post-new.php?post_type=sp_google_maps
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?libraries=geometry&language=en 148:311 "google.maps.event.addDomListener() is deprecated, use the standard\naddEventListener() method instead:\nhttps://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener\nThe feature will continue to work and there is no plan to decommission\nit."

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Create And Publish A New Map), #2 (Publish The Map In A Page Or Post), #3 (Maps Preview (Styled Map)), #4 (Maps Preview (Default Google Style)), #5 (Maps Settings)
Please take inspiration from this readme.txt

sp-google-maps/sp_google_maps.php 85% from 13 tests

"SP Google Maps" version 1.1.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sp-google-maps.php" instead of "sp_google_maps.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,424 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP43897530
PO File2170172507
JavaScript4462213
CSS4320100
Markdown110074

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 2.41MB with 1.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png86.71KB25.82KB▼ 70.22%
screenshot-2.png28.69KB9.82KB▼ 65.76%
screenshot-1.png1,112.00KB324.90KB▼ 70.78%
screenshot-4.png676.02KB190.35KB▼ 71.84%
map_marker_icon.png2.39KB1.20KB▼ 49.92%