10% wp-geoloc

Code Review | WP Geoloc

WordPress plugin WP Geoloc scored 10% from 54 tests.

About plugin

  • Plugin page: wp-geoloc
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.4.1
  • WordPress version: 5.8.1
  • First release: Jan 26, 2016
  • Latest release: Jan 29, 2016
  • Number of updates: 32
  • Update frequency: every 0.1 days
  • Top authors: bloutch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,167 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-geoloc/includes/widget-search.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; wpgeoloc_search_widget has a deprecated constructor

Server metrics [RAM: ▼1.80MB] [CPU: ▼190.86ms] Passed 4 tests

Analyzing server-side resources used by WP Geoloc
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.83 ▼0.896.20 ▼27.30
Dashboard /wp-admin1.85 ▼1.217.12 ▼37.48
Posts /wp-admin/edit.php1.85 ▼1.266.94 ▼41.55
Add New Post /wp-admin/post-new.php1.85 ▼3.597.64 ▼653.17
Media Library /wp-admin/upload.php1.85 ▼1.157.03 ▼31.22

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 14 new files
Database: 1 new table, 2 new options
New tables
wp_geodatastore
New WordPress options
sc_gds_db_version
widget_wpgeoloc-search

Browser metrics Passed 4 tests

An overview of browser requirements for WP Geoloc
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲23216.22 ▲0.3810.76 ▲0.6647.89 ▼1.24
Dashboard /wp-admin2,989 ▲585.91 ▼0.04173.60 ▲23.60116.33 ▼0.41
Posts /wp-admin/edit.php2,759 ▲202.69 ▲0.0072.85 ▼1.0597.75 ▲9.44
Add New Post /wp-admin/post-new.php5,815 ▲4,13219.92 ▲1.16566.26 ▲159.03110.92 ▼4.29
Media Library /wp-admin/upload.php1,830 ▲205.03 ▲0.02155.72 ▲5.25129.47 ▲6.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/wp-geoloc/includes/widget-search.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; wpgeoloc_search_widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_geodatastore
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • sc_gds_db_version
    • widget_wpgeoloc-search

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-geoloc === )
  • Tags: You are using too many tags: 16 tag instead of maximum 10
You can look at the official readme.txt

wp-geoloc/wp-geoloc.php 85% from 13 tests

The main file in "WP Geoloc" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 177 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
No dangerous file extensions were detected752 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7143191552
CSS160156
PO File1131643
JavaScript1011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity14.00
▷ Minimum class complexity13.00
▷ Maximum class complexity15.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods1381.25%
▷ Public methods1487.50%
▷ Protected methods00.00%
▷ Private methods212.50%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin