10% visitor-mailer

Code Review | Visitor Mailer

WordPress plugin Visitor Mailer scored10%from 54 tests.

About plugin

  • Plugin page: visitor-mailer
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.4
  • WordPress version: 6.3.1
  • First release: Feb 6, 2013
  • Latest release: Feb 7, 2013
  • Number of updates: 9
  • Update frequency: every 0.1 days
  • Top authors: ConnerT (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,641 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/visitor-mailer/visitormailer.php+39
    Undefined variable: wpdb

Server metrics [RAM: ▼1.84MB] [CPU: ▼54.13ms] Passed 4 tests

Server-side resources used by Visitor Mailer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.325.08 ▼31.78
Dashboard /wp-admin2.16 ▼1.146.58 ▼44.42
Posts /wp-admin/edit.php2.16 ▼1.196.26 ▼42.19
Add New Post /wp-admin/post-new.php2.16 ▼3.726.08 ▼98.14
Media Library /wp-admin/upload.php2.16 ▼1.065.25 ▼26.70
Visitor Mailer /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php2.166.69

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: 2 new tables, 9 new options
New tables
visitormailer
wp_visitormailer
New WordPress options
recovery_mode_email_last_sent
visitormailer_version
widget_recent-posts
can_compress_scripts
widget_recent-comments
VISITORMAILER_VERSION_KEY
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Visitor Mailer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,460 ▼28613.51 ▼1.140.48 ▼1.1819.03 ▼22.76
Dashboard /wp-admin2,210 ▲225.85 ▲0.96110.83 ▲4.2942.52 ▼7.39
Posts /wp-admin/edit.php45 ▼2,0440.44 ▼1.540.08 ▼36.579.19 ▼25.17
Add New Post /wp-admin/post-new.php1,539 ▲623.15 ▲0.09635.45 ▼31.0664.52 ▲9.35
Media Library /wp-admin/upload.php1,389 ▲44.18 ▼0.0196.82 ▼8.6843.94 ▼1.07
Visitor Mailer /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php8372.0327.6726.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/visitor-mailer/visitormailer.php+41
    Use of undefined constant VISITORMAILER_VERSION_KEY - assumed 'VISITORMAILER_VERSION_KEY' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_visitormailer
    • visitormailer
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • db_upgraded
    • VISITORMAILER_VERSION_KEY
    • visitormailer_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php
    • > Warning in wp-content/plugins/visitor-mailer/visitormailer.php+41
    Use of undefined constant VISITORMAILER_VERSION_KEY - assumed 'VISITORMAILER_VERSION_KEY' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php
    • > Warning in wp-content/plugins/visitor-mailer/visitormailer.php+41
    Use of undefined constant VISITORMAILER_VERSION_NUM - assumed 'VISITORMAILER_VERSION_NUM' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php
    • > Notice in wp-content/plugins/visitor-mailer/visitormailer.php+355
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=visitor-mailer/visitormailer.php
    • > Notice in wp-content/plugins/visitor-mailer/visitormailer.php+357
    Undefined variable: checked

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/visitor-mailer/visitormailer.php on line 39
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/visitor-mailer/visitormailer.php on line 39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/visitor-mailer/visitormailer.php:41

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (27 tag instead of maximum 10)
Please take inspiration from this readme.txt

visitor-mailer/visitormailer.php 92% from 13 tests

Analyzing the main PHP file in "Visitor Mailer" version 1.0.0
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 ("visitor-mailer.php" instead of "visitormailer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin262 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26879262

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png20.05KB6.39KB▼ 68.12%
images/stat.png0.53KB0.74KB0.00%
screenshot-2.png12.01KB4.16KB▼ 65.39%