84% gmap-targeting

Code Review | Google Map Targeting

WordPress plugin Google Map Targeting scored84%from 54 tests.

About plugin

  • Plugin page: gmap-targeting
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-5.2
  • WordPress version: 6.3.1
  • First release: Mar 12, 2012
  • Latest release: Jun 24, 2019
  • Number of updates: 121
  • Update frequency: every 22.0 days
  • Top authors: RealMag777 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /7,865 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.02MB] [CPU: ▼4.92ms] Passed 4 tests

Analyzing server-side resources used by Google Map Targeting
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.49 ▼3.50
Dashboard /wp-admin3.32 ▲0.0253.37 ▼0.84
Posts /wp-admin/edit.php3.37 ▲0.0249.72 ▲1.51
Add New Post /wp-admin/post-new.php5.92 ▲0.0488.88 ▼16.83
Media Library /wp-admin/upload.php3.24 ▲0.0240.74 ▲1.62

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_pluginusnet_gmaptargetingwidget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Google Map Targeting
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲16614.43 ▲0.2727.40 ▲25.8437.93 ▼10.39
Dashboard /wp-admin2,221 ▲155.85 ▲0.96112.21 ▼2.0837.61 ▼6.20
Posts /wp-admin/edit.php2,100 ▼32.00 ▲0.0137.47 ▼3.6835.96 ▲1.10
Add New Post /wp-admin/post-new.php1,557 ▲1218.33 ▼4.99632.10 ▼27.7063.44 ▼42.78
Media Library /wp-admin/upload.php1,400 ▼34.24 ▼0.05114.36 ▼4.0150.07 ▲0.38

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_pluginusnet_gmaptargetingwidget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gmap-targeting/views/widget/google_map.php
    • > /wp-content/plugins/gmap-targeting/views/widget/google_map_form.php
    • > /wp-content/plugins/gmap-targeting/index.php
    • > /wp-content/plugins/gmap-targeting/views/shortcodes/gmap_targeting.php
    • > /wp-content/plugins/gmap-targeting/views/shortcodes/popups/gmap_targeting.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: page, post, google, google map, map...

gmap-targeting/index.php 92% from 13 tests

The main PHP file in "Google Map Targeting" ver. 1.1.6 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gmap-targeting.php" instead of "index.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
There were no executable files found in this plugin2,653 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
CSS3199108971
PHP513433794
JavaScript695176671
PO File297221217

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity20.00
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods1881.82%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons/gmap_targeting_logo.png1.95KB1.91KB▼ 2.10%
images/icons/shortcode.png13.71KB6.12KB▼ 55.38%
js/pn_popup/images/close.png3.23KB0.43KB▼ 86.82%
images/icons/gmap_targeting.png6.19KB3.06KB▼ 50.50%
images/shortcode_icon.png1.06KB1.23KB0.00%