68% jaspreetchahals-wordpress-bot-detector-lite

Code Review | JaspreetChahal's wordpress bot detector lite

WordPress plugin JaspreetChahal's wordpress bot detector lite scored68%from 54 tests.

About plugin

  • Plugin page: jaspreetchahals-w...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2012
  • Latest release: Apr 15, 2015
  • Number of updates: 8
  • Update frequency: every 129.0 days
  • Top authors: jaschahal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,191 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.06ms] Passed 4 tests

This is a short check of server-side resources used by JaspreetChahal's wordpress bot detector lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.74 ▼0.40
Dashboard /wp-admin3.33 ▼0.0247.32 ▼17.30
Posts /wp-admin/edit.php3.38 ▲0.0252.07 ▼0.04
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.14 ▼18.48
Media Library /wp-admin/upload.php3.25 ▲0.0237.76 ▲1.30
Manage Bots /wp-admin/admin.php?page=jcorgbotdetect-sub3.2233.18
Live View /wp-admin/admin.php?page=jcorgbotdetect-live3.2232.62
JC Bot Detector /wp-admin/admin.php?page=jcorgbotdetect3.1929.78
History Report /wp-admin/admin.php?page=jcorgbotdetect-rep3.2231.93
Add/Edit Bot /wp-admin/admin.php?page=jcorgbotdetect-add3.1931.49

Server storage [IO: ▲0.09MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 22 new files
Database: 2 new tables, 12 new options
New tables
wp_jcorgbothistory
wp_jcorgbotinfo
New WordPress options
can_compress_scripts
widget_recent-posts
jcorgbotdetector_email_interval
widget_theysaidso_widget
db_upgraded
widget_recent-comments
jcorgbotdetector_last_email_sent
jcorgbotdetector_email_format
jcorgbotdetector_email
jcorgbotdetector_db_version
...

Browser metrics Passed 4 tests

JaspreetChahal's wordpress bot detector lite: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8314.28 ▼0.071.70 ▼0.2845.98 ▲2.78
Dashboard /wp-admin2,223 ▲435.56 ▼0.0489.08 ▼2.2672.00 ▲30.31
Posts /wp-admin/edit.php2,143 ▲432.01 ▼0.0035.38 ▼0.6236.24 ▲3.70
Add New Post /wp-admin/post-new.php1,562 ▲3623.37 ▲0.36763.29 ▲103.7650.30 ▼4.89
Media Library /wp-admin/upload.php1,440 ▲404.19 ▼0.0098.52 ▼12.4672.97 ▲27.55
Manage Bots /wp-admin/admin.php?page=jcorgbotdetect-sub8182.0026.3030.14
Live View /wp-admin/admin.php?page=jcorgbotdetect-live8072.1825.7928.36
JC Bot Detector /wp-admin/admin.php?page=jcorgbotdetect9902.0423.6633.71
History Report /wp-admin/admin.php?page=jcorgbotdetect-rep8222.0022.3128.60
Add/Edit Bot /wp-admin/admin.php?page=jcorgbotdetect-add8212.0022.9526.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_jcorgbotinfo
    • wp_jcorgbothistory
  • The uninstall procedure has failed, leaving 12 options in the database
    • db_upgraded
    • jcorgbotdetector_history_to_keep
    • widget_recent-posts
    • widget_theysaidso_widget
    • jcorgbotdetector_email_interval
    • theysaidso_admin_options
    • jcorgbotdetector_db_version
    • jcorgbotdetector_last_email_sent
    • widget_recent-comments
    • jcorgbotdetector_email
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=jcorgbotdetect
    • > 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/admin.php?page=jcorgbotdetect
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=jcorgbotdetect-add
    • > Notice in wp-content/plugins/jaspreetchahals-wordpress-bot-detector-lite/jaspreetchahals-wordpress-bot-detector-lite.php+241
    Undefined index: action

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/jaspreetchahals-wordpress-bot-detector-lite/jaspreetchahals-wordpress-bot-detector-lite.php on line 28
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/jaspreetchahals-wordpress-bot-detector-lite/jaspreetchahals-wordpress-bot-detector-lite.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/jaspreetchahals-wordpress-bot-detector-lite/jaspreetchahals-wordpress-bot-detector-lite.php:33

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 81% 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (A screen shot of the options page) image missing
  • Plugin Name: You should set the name of your plugin on the first line ( === jaspreetchahals-wordpress-bot-detector-lite === )
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can look at the official readme.txt

jaspreetchahals-wordpress-bot-detector-lite/jaspreetchahals-wordpress-bot-detector-lite.php Passed 13 tests

The primary PHP file in "JaspreetChahal's wordpress bot detector lite" version 1.0 is used by WordPress to initiate all plugin functionality
102 characters long description:
This plugin does what the title says. It identifies Bots and send you an email about the bot activity.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected364 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP25318352
CSS10012

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/warning.png1.32KB1.33KB0.00%
images/new.png1.06KB1.12KB0.00%
images/information.png1.44KB1.45KB0.00%
images/star_grey.png0.74KB0.67KB▼ 9.80%
images/star_red.png0.73KB0.67KB▼ 8.17%