62% spotbot

Code Review | SpotBot

WordPress plugin SpotBot scored62%from 54 tests.

About plugin

  • Plugin page: spotbot
  • Plugin version: 0.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2013
  • Latest release: Nov 21, 2013
  • Number of updates: 13
  • Update frequency: every 0.2 days
  • Top authors: JakeHelbig (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /883 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.90MB] [CPU: ▼32.19ms] Passed 4 tests

This is a short check of server-side resources used by SpotBot
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0236.24 ▼4.16
Dashboard /wp-admin3.05 ▼0.2626.46 ▼25.06
Posts /wp-admin/edit.php3.05 ▼0.3124.35 ▼25.67
Add New Post /wp-admin/post-new.php3.05 ▼2.8425.56 ▼70.24
Media Library /wp-admin/upload.php3.05 ▼0.1826.59 ▼7.77
SpotBot /wp-admin/admin.php?page=sb_list3.0526.31
Settings /wp-admin/admin.php?page=sb_config3.0523.59
FAQ /wp-admin/admin.php?page=sb_faq3.0527.03

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 13 new files
Database: 2 new tables, 7 new options
New tables
wp_spotbot_config
wp_spotbot_meta
New WordPress options
db_upgraded
spotbot_version
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for SpotBot
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲10413.25 ▼1.381.66 ▼0.0642.76 ▼0.77
Dashboard /wp-admin2,248 ▲635.86 ▲0.00100.61 ▼0.3467.66 ▲25.40
Posts /wp-admin/edit.php2,133 ▲442.14 ▲0.1540.98 ▲1.6135.42 ▼1.83
Add New Post /wp-admin/post-new.php1,557 ▲2918.40 ▲0.02721.66 ▲114.0161.24 ▲13.73
Media Library /wp-admin/upload.php1,427 ▲394.21 ▲0.06105.85 ▲4.6044.37 ▲1.41
SpotBot /wp-admin/admin.php?page=sb_list9722.0625.8724.13
Settings /wp-admin/admin.php?page=sb_config1,6456.98136.62107.38
FAQ /wp-admin/admin.php?page=sb_faq1,0722.1228.1639.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/spotbot/sb_init.php+191
    Trying to access array offset on value of type null
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • spotbot_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sb_faq
    • > Notice in wp-content/plugins/spotbot/sb_init.php+251
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > Notice in wp-content/plugins/spotbot/sb_init.php+386
    Trying to get property 'spot_active' of non-object
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > Notice in wp-content/plugins/spotbot/sb_init.php+394
    Trying to get property 'spot_cleanup' of non-object
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > Notice in wp-content/plugins/spotbot/sb_init.php+402
    Trying to get property 'spot_cleantime' of non-object
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > Notice in wp-content/plugins/spotbot/sb_init.php+410
    Trying to get property 'spot_key' of non-object
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > Notice in wp-content/plugins/spotbot/sb_init.php+423
    Trying to get property 'spot_warning_html' of non-object
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > User deprecated in wp-includes/functions.php+5453
    Function the_editor is deprecated since version 3.3.0! Use wp_editor() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sb_faq
    • > Notice in wp-content/plugins/spotbot/sb_init.php+715
    Undefined index: tab

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/spotbot/sb_init.php:17
    • > PHP Notice
      Undefined index: url in wp-content/plugins/spotbot/check_bot.php on line 13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: SB(...).rwdImageMaps is not a function" "TypeError: SB(...).rwdImageMaps is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/spotbot/js/js_sb_func.js?ver=6.3.1:228:23)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sb_config
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: SB(...).rwdImageMaps is not a function
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sb_faq
    • > Network (severe)
    wp-content/plugins/spotbot/images/faq/list_anatomy.png - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sb_faq
    • > Network (severe)
    wp-content/plugins/spotbot/images/faq/config_anatomy.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: spam, login, comments, bots

spotbot/sb_init.php 85% from 13 tests

Analyzing the main PHP file in "SpotBot" version 0.1.8
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 361 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("spotbot.php" instead of "sb_init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin784 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3201222632
JavaScript24773142
CSS121110

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity65.00
▷ Minimum class complexity65.00
▷ Maximum class complexity65.00
Average method complexity6.33
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods12100.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
5 PNG files occupy 0.40MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/spotbotmini.png51.01KB0.79KB▼ 98.46%
images/refresh.png2.22KB1.69KB▼ 23.71%
images/faq/list-anatomy.png142.08KB20.04KB▼ 85.90%
images/faq/config-anatomy.png150.72KB20.91KB▼ 86.13%
images/spotbot.png64.10KB3.97KB▼ 93.81%