72% dm-visitor-location-notification

Code Review | DM Visitor Location Notification

WordPress plugin DM Visitor Location Notification scored72%from 54 tests.

About plugin

  • Plugin page: dm-visitor-locati...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Jul 3, 2020
  • Number of updates: 5
  • Update frequency: every 14.8 days
  • Top authors: necroob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /457 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.50MB] [CPU: ▲8.80ms] Passed 4 tests

Analyzing server-side resources used by DM Visitor Location Notification
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.95 ▲1.4950.16 ▲1.24
Dashboard /wp-admin4.83 ▲1.5267.21 ▲13.97
Posts /wp-admin/edit.php4.87 ▲1.5172.78 ▲18.84
Add New Post /wp-admin/post-new.php7.41 ▲1.52114.79 ▲10.43
Media Library /wp-admin/upload.php4.72 ▲1.4848.15 ▲9.54
DM VLN /wp-admin/admin.php?page=dm-vln-settings4.7954.04

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 712 new files
Database: 1 new table, 7 new options
New tables
wp_dm_visitor_location
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
dm_vln_api_key_status

Browser metrics Passed 4 tests

An overview of browser requirements for DM Visitor Location Notification
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,129 ▲37218.83 ▲4.402.00 ▼0.9930.37 ▼10.15
Dashboard /wp-admin2,505 ▲3149.25 ▲4.39189.40 ▲66.8744.28 ▲0.74
Posts /wp-admin/edit.php2,419 ▲3306.11 ▲4.0895.45 ▲51.8744.64 ▲8.20
Add New Post /wp-admin/post-new.php1,609 ▲9519.89 ▲2.42739.38 ▲65.8640.73 ▼34.47
Media Library /wp-admin/upload.php1,550 ▲1596.77 ▲2.57117.20 ▲8.7448.57 ▲1.91
DM VLN /wp-admin/admin.php?page=dm-vln-settings1,6286.90117.5137.90

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dm-vln-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dm-vln-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 68 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dm-vln-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dm-vln-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 0% from 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 119× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Predefined_Options_Field' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Field/Select_Field.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Container/Term_Meta_Container.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Ancestor_ID_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Term_Condition' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Container/Condition/Term_Parent_Condition.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Format_Condition.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Container/Condition/Boolean_Condition.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Field/Media_Gallery_Field.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function PHPSTORM_META\\override() in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/.phpstorm.meta.php/ioc.meta.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Field/Checkbox_Field.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Term_Condition' not found in wp-content/plugins/dm-visitor-location-notification/vendor/htmlburger/carbon-fields/core/Container/Condition/Term_Ancestor_Condition.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Donate link: Please fix this invalid url: "devmaverick.com/donate"
The official readme.txt might help

dm-visitor-location-notification/index.php 85% from 13 tests

"DM Visitor Location Notification" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dm-visitor-location-notification.php" instead of "index.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 153 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin50,126 lines of code in 662 files:
LanguageFilesBlank linesComment linesLines of code
SVG2320021,941
JavaScript1725,1928,44912,957
PHP1552,6326,6769,357
Sass594191072,047
PO File206107791,652
CSS113231,1431,648
JSON400376
Markdown9720148

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity8.34
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces26
Interfaces5
Traits0
Classes129
▷ Abstract classes118.53%
▷ Concrete classes11891.47%
▷ Final classes10.85%
Methods938
▷ Static methods10310.98%
▷ Public methods76181.13%
▷ Protected methods17318.44%
▷ Private methods40.43%
Functions103
▷ Named functions2322.33%
▷ Anonymous functions8077.67%
Constants30
▷ Global constants723.33%
▷ Class constants2376.67%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin