74% wt-geotargeting

Code Review | WT GeoTargeting

WordPress plugin WT GeoTargeting scored74%from 54 tests.

About plugin

  • Plugin page: wt-geotargeting
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.0.3
  • WordPress version: 6.3.1
  • First release: Nov 8, 2015
  • Latest release: Nov 26, 2022
  • Number of updates: 71
  • Update frequency: every 37.5 days
  • Top authors: kustyrt (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

1,000+ active /18,834 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.44MB] [CPU: ▲1.26ms] Passed 4 tests

This is a short check of server-side resources used by WT GeoTargeting
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2339.12 ▲2.05
Dashboard /wp-admin3.84 ▲0.5452.83 ▲8.09
Posts /wp-admin/edit.php3.89 ▲0.5450.54 ▲4.19
Add New Post /wp-admin/post-new.php6.38 ▲0.5086.05 ▼8.87
Media Library /wp-admin/upload.php3.70 ▲0.4840.89 ▲7.67
Справка /wp-admin/admin.php?page=wt_geotargeting3.6935.66
Настройки /wp-admin/admin.php?page=wt_geotargeting/admin/setting.php3.6737.45

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 93 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

WT GeoTargeting: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.30 ▼1.101.71 ▲0.1639.40 ▼3.86
Dashboard /wp-admin2,232 ▲445.88 ▼0.1397.44 ▼7.0739.64 ▲0.74
Posts /wp-admin/edit.php2,118 ▲292.02 ▼0.0136.43 ▼2.5635.66 ▲1.91
Add New Post /wp-admin/post-new.php1,553 ▲2923.06 ▼0.25604.81 ▼18.3250.21 ▲4.47
Media Library /wp-admin/upload.php1,417 ▲264.30 ▲0.1396.39 ▼3.8843.70 ▼3.51
Справка /wp-admin/admin.php?page=wt_geotargeting9862.1923.8927.72
Настройки /wp-admin/admin.php?page=wt_geotargeting/admin/setting.php7,2141.8130.7342.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method WtGeoTargeting::uninstall() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 fix the following items
  • 39× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/wt-geotargeting/vendor/geoip2/geoip2/src/Record/AbstractPlaceRecord.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/wt-geotargeting/vendor/geoip2/geoip2/src/Model/ConnectionType.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/wt-geotargeting/vendor/geoip2/geoip2/src/Record/Traits.php:89
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\HttpException' not found in wp-content/plugins/wt-geotargeting/vendor/maxmind/web-service-common/src/Exception/InvalidRequestException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/wt-geotargeting/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wt-geotargeting/includes/WtKit.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\City' not found in wp-content/plugins/wt-geotargeting/vendor/geoip2/geoip2/src/Model/Insights.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/wt-geotargeting/vendor/geoip2/geoip2/src/Exception/AuthenticationException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/wt-geotargeting/vendor/geoip2/geoip2/src/Model/Domain.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractPlaceRecord' not found in wp-content/plugins/wt-geotargeting/vendor/geoip2/geoip2/src/Record/City.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: geotargeting, dadata, maxmind, ip-api, geo...

wt-geotargeting/wt_geotargeting.php 92% from 13 tests

The main PHP file in "WT GeoTargeting" ver. 1.9 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: It is recommended to name the main PHP file as the plugin slug ("wt-geotargeting.php" instead of "wt_geotargeting.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin4,917 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PHP667861,7603,332
Markdown73120700
C17315477
JSON500360
JavaScript11026
m415014
C/C++ Header14128

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.93
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces14
Interfaces4
Traits0
Classes57
▷ Abstract classes35.26%
▷ Concrete classes5494.74%
▷ Final classes00.00%
Methods200
▷ Static methods199.50%
▷ Public methods15175.50%
▷ Protected methods21.00%
▷ Private methods4723.50%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin