68% better-detection

Code Review | Better Detection

WordPress plugin Better Detection scored68%from 54 tests.

About plugin

  • Plugin page: better-detection
  • Plugin version: 1.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Jun 27, 2019
  • Latest release: May 24, 2022
  • Number of updates: 21
  • Update frequency: every 50.6 days
  • Top authors: bettersecurity (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,162 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▲1.43ms] Passed 4 tests

A check of server-side resources used by Better Detection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1544.05 ▲2.01
Dashboard /wp-admin3.46 ▲0.1554.88 ▲0.18
Posts /wp-admin/edit.php3.57 ▲0.2147.68 ▼0.30
Add New Post /wp-admin/post-new.php6.04 ▲0.1593.49 ▲3.82
Media Library /wp-admin/upload.php3.38 ▲0.1545.40 ▲9.01
Better Detection /wp-admin/options-general.php?page=better-detection-settings3.3534.30

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: 2 new tables, 10 new options
New tables
wp_better_detection_errors
wp_better_detection_hashes
New WordPress options
better_detection_runtime
db_upgraded
can_compress_scripts
widget_recent-posts
better_detection_version
better_detection_running
theysaidso_admin_options
better_detection_endtime
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Better Detection
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.26 ▼1.041.51 ▼0.0346.25 ▲2.18
Dashboard /wp-admin2,210 ▲285.78 ▼0.09140.51 ▲20.4445.99 ▲3.17
Posts /wp-admin/edit.php2,090 ▼22.03 ▲0.0237.12 ▼6.1632.33 ▼6.17
Add New Post /wp-admin/post-new.php1,524 ▼1223.03 ▼0.10662.19 ▼37.3886.20 ▼1.56
Media Library /wp-admin/upload.php1,392 ▲14.22 ▼0.06121.66 ▲14.1743.62 ▼1.33
Better Detection /wp-admin/options-general.php?page=better-detection-settings9841.9636.2140.95

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 does not fully uninstall, leaving 2 tables in the database
    • wp_better_detection_errors
    • wp_better_detection_hashes
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • better_detection_running
    • can_compress_scripts
    • better_detection_endtime
    • better_detection_runtime
    • better_detection_version
    • 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-detection-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-detection-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-detection-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-detection-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/better-detection/better-detection.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: detection, scanner, content, security, better

better-detection/better-detection.php 85% from 13 tests

This is the main PHP file of "Better Detection" version 1.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected797 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP297119739
JavaScript12352
CSS1376

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.24
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%
Functions34
▷ Named functions3397.06%
▷ Anonymous functions12.94%
Constants1
▷ Global constants1100.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
12 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon-36x36.png1.35KB0.88KB▼ 34.62%
icon-white-36x36.png0.66KB0.53KB▼ 20.15%
images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
images/ui-bg_glass_75_e6e6e6_1x400.png0.26KB0.15KB▼ 42.37%
images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%