10% spot-hit

Code Review | Spot-Hit - Send mail, sms (Compatible with Woocommerce)

WordPress plugin Spot-Hit - Send mail, sms (Compatible with Woocommerce) scored10%from 54 tests.

About plugin

  • Plugin page: spot-hit
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Dec 4, 2018
  • Latest release: Dec 13, 2022
  • Number of updates: 41
  • Update frequency: every 35.9 days
  • Top authors: techspothit (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /2,659 total downloads

Benchmarks

Plugin footprint 58% 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
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/spot-hit/spothit.php+42
    Undefined variable: wpdb

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.76ms] Passed 4 tests

An overview of server-side resources used by Spot-Hit - Send mail, sms (Compatible with Woocommerce)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0840.79 ▼0.71
Dashboard /wp-admin3.39 ▲0.0451.59 ▼15.62
Posts /wp-admin/edit.php3.44 ▲0.0851.95 ▲0.52
Add New Post /wp-admin/post-new.php5.99 ▲0.1095.61 ▼7.23
Media Library /wp-admin/upload.php3.31 ▲0.0844.19 ▲8.81

Server storage [IO: ▲18.14MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 783 new files
Database: 3 new tables, 6 new options
New tables
wp_spothit_hooks
wp_spothit_hooks_meta
wp_spothit_settings
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Spot-Hit - Send mail, sms (Compatible with Woocommerce)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,042 ▲28116.97 ▲2.6118.32 ▲16.4845.09 ▲1.45
Dashboard /wp-admin2,276 ▲966.58 ▲0.99120.67 ▲25.8237.27 ▼7.66
Posts /wp-admin/edit.php2,187 ▲873.83 ▲1.8258.70 ▲17.3763.10 ▲25.41
Add New Post /wp-admin/post-new.php6,431 ▲4,90323.82 ▲0.57864.94 ▲185.5255.08 ▼7.65
Media Library /wp-admin/upload.php1,610 ▲2106.24 ▲2.05131.35 ▲17.7143.82 ▼3.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/spot-hit/components/notification.php
  • 40× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/spot-hit/views/sms_campaign.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/spot-hit/views/sms_campaign/step6.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/spot-hit/views/email_campaign.php:29
    • > PHP Warning
      Use of undefined constant SH_URL_PATH - assumed 'SH_URL_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/spot-hit/views/login.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/spot-hit/views/settings.php:36
    • > PHP Warning
      Use of undefined constant SH_URL_PATH - assumed 'SH_URL_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/spot-hit/components/loader.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/spot-hit/views/sms_campaign/step4.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/spot-hit/views/email_campaign/step4.php:2
    • > PHP Warning
      Use of undefined constant SH_URL_PATH - assumed 'SH_URL_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/spot-hit/components/header.php on line 45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/spot-hit/components/loader.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

spot-hit/spothit.php 85% from 13 tests

The main file in "Spot-Hit - Send mail, sms (Compatible with Woocommerce)" v. 2.1.0 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:
  • Main file name: The principal plugin file should be the same as the plugin slug ("spot-hit.php" instead of "spothit.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/spot-hit/node_modules/bootstrap-select/nuget/MyGet.ps1
216,904 lines of code in 543 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript30110,4576,398112,475
CSS508,32530652,256
JSON152028,337
Sass1051,7441,2618,696
Markdown1397404,974
PHP368073324,929
TypeScript1002,876
PO File1443568953
HTML91058832
LESS28915449
YAML681592
XML10024
PowerShell1569
SVG2002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity24.40
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods2790.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions42
▷ Named functions3788.10%
▷ Anonymous functions511.90%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo.png10.18KB0.94KB▼ 90.80%
assets/img/icon-128x128.png1.54KB0.52KB▼ 66.39%