10% visitoraudit

Code Review | Visitor Audit

WordPress plugin Visitor Audit scored10%from 54 tests.

About plugin

  • Plugin page: visitoraudit
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 7, 2016
  • Latest release: Mar 15, 2016
  • Number of updates: 3
  • Update frequency: every 4.3 days
  • Top authors: justincampo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,187 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/visitoraudit/visitor-audit.setup.php+65
    Undefined variable: opt

Server metrics [RAM: ▼1.37MB] [CPU: ▼281,343.44ms] Passed 4 tests

A check of server-side resources used by Visitor Audit
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1044.54 ▲4.19
Dashboard /wp-admin3.53 ▼5.9960.28 ▼1,125,373.63
Posts /wp-admin/edit.php3.65 ▲0.2557.03 ▲3.85
Add New Post /wp-admin/post-new.php6.13 ▲0.2096.21 ▼8.18
Media Library /wp-admin/upload.php3.46 ▲0.1944.88 ▲10.92
Configuration /wp-admin/admin.php?page=visitor_audit_config3.4239.89
Banned Visitors /wp-admin/admin.php?page=visitor_audit_banned3.4239.46
Visitor Audit /wp-admin/admin.php?page=visitor_audit_admin3.4240.38

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 7 new files
Database: 3 new tables, 6 new options
New tables
wp_visitor_audit_banned
wp_visitor_audit
wp_visitor_audit_history
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Visitor Audit
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8514.38 ▼0.351.99 ▲0.2343.22 ▼4.24
Dashboard /wp-admin2,224 ▲505.50 ▼0.1487.31 ▼15.4741.12 ▼7.87
Posts /wp-admin/edit.php2,135 ▲351.97 ▼0.0634.25 ▼5.3733.79 ▼1.22
Add New Post /wp-admin/post-new.php1,553 ▲1723.21 ▲0.09672.02 ▼44.8956.43 ▼5.17
Media Library /wp-admin/upload.php1,432 ▲354.26 ▲0.0598.44 ▼2.6447.82 ▲3.88
Configuration /wp-admin/admin.php?page=visitor_audit_config9742.0523.9827.99
Banned Visitors /wp-admin/admin.php?page=visitor_audit_banned8192.0526.2129.08
Visitor Audit /wp-admin/admin.php?page=visitor_audit_admin8662.0225.5728.76

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 36 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=visitor_audit_admin
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 36 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=visitor_audit_admin
    • > POST request to /wp-cron.php?doing_wp_cron=1697551793.8827230930328369140625
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

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
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Visitor_Audit\\Vistor_Audit_Config' not found in wp-content/plugins/visitoraudit/visitor-audit.setup.php:14
    • > PHP Notice
      Undefined index: wpdb in wp-content/plugins/visitoraudit/visitor-audit.class.php on line 56
    • > PHP Fatal error
      Uncaught Error: Class 'Visitor_Audit\\Visitor_Audit_Setup' not found in wp-content/plugins/visitoraudit/visitor-audit.class.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Visitor_Audit\\Vistor_Audit_Config' not found in wp-content/plugins/visitoraudit/visitor-audit.admin.php:14
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/visitoraudit/visitor-audit.class.php:57

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === visitoraudit === )
Please take inspiration from this readme.txt

visitoraudit/visitor-audit.php 92% from 13 tests

Analyzing the main PHP file in "Visitor Audit" version 1.0.0
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("visitoraudit.php" instead of "visitor-audit.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
Success! There were no dangerous files found in this plugin789 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP581370742
Markdown111031
JavaScript10016

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity36.25
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3078.95%
▷ Protected methods00.00%
▷ Private methods821.05%
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

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected