84% geolocation-detector-for-gravity-forms

Code Review | Geolocation Detector for Gravity Forms

WordPress plugin Geolocation Detector for Gravity Forms scored84%from 54 tests.

About plugin

  • Plugin page: geolocation-detec...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.2
  • WordPress version: 6.3.1
  • First release: May 27, 2016
  • Latest release: Aug 10, 2019
  • Number of updates: 11
  • Update frequency: every 106.4 days
  • Top authors: dcgws (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

600+ active /5,960 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.03MB] [CPU: ▼10.70ms] Passed 4 tests

This is a short check of server-side resources used by Geolocation Detector for Gravity Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.71 ▼2.19
Dashboard /wp-admin3.33 ▲0.0355.08 ▼3.01
Posts /wp-admin/edit.php3.38 ▲0.0350.16 ▼4.25
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.81 ▼33.34
Media Library /wp-admin/upload.php3.26 ▲0.0338.79 ▲3.51

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Geolocation Detector for Gravity Forms
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.27 ▼0.341.74 ▲0.1144.43 ▲2.40
Dashboard /wp-admin2,192 ▲155.56 ▼0.1499.15 ▼16.4439.97 ▼13.44
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0835.09 ▼5.6938.70 ▲0.42
Add New Post /wp-admin/post-new.php1,530 ▲423.30 ▲0.47677.39 ▲80.6258.33 ▲0.26
Media Library /wp-admin/upload.php1,406 ▲64.22 ▲0.03100.77 ▼5.3645.06 ▼0.12

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/geolocation-detector-for-gravity-forms/geolocation-detector-for-gravity-forms.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Advanced Settings for ipcountry), #2 (Advanced Settings for ipcity), #3 (Advanced Settings for ipprovince), #4 (Advanced Settings for iplongitude), #5 (Advanced Settings for iplatitude), #6 (Advanced Settings for iptimezone), #7 (Advanced Settings for ipcontinent)
The official readme.txt is a good inspiration

geolocation-detector-for-gravity-forms/geolocation-detector-for-gravity-forms.php Passed 13 tests

Analyzing the main PHP file in "Geolocation Detector for Gravity Forms" version 1.0.3
86 characters long description:
Provides a dynamic country detection for Gravity Forms . Requires GeoIP Detect Plugin.

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 plugin93 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1191693

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions13
▷ Named functions13100.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
7 PNG files occupy 0.38MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png60.29KB16.87KB▼ 72.02%
screenshot-1.png27.11KB7.69KB▼ 71.65%
screenshot-4.png59.48KB16.59KB▼ 72.11%
screenshot-6.png75.59KB20.96KB▼ 72.27%
screenshot-7.png76.48KB21.33KB▼ 72.11%