62% blogsafe-scanner

Code Review | BlogSafe Scanner

WordPress plugin BlogSafe Scanner scored 62% from 54 tests.

About plugin

  • Plugin page: blogsafe-scanner
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.8.2
  • WordPress version: 5.9.2
  • First release: Dec 28, 2020
  • Latest release: Nov 16, 2021
  • Number of updates: 42
  • Update frequency: every 7.8 days
  • Top authors: blogsafe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 941 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲4.38MB] [CPU: ▼276.13ms] Passed 4 tests

A check of server-side resources used by BlogSafe Scanner
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.34 ▲4.8277.08 ▲26.43
Dashboard /wp-admin8.36 ▲4.9557.87 ▲24.06
Posts /wp-admin/edit.php8.36 ▲4.7160.67 ▲17.03
Add New Post /wp-admin/post-new.php10.04 ▲3.06113.38 ▼1,163.58
Media Library /wp-admin/upload.php8.36 ▲5.0643.23 ▲17.98
Freemius Debug [v.2.4.1] /wp-admin/admin.php?page=freemius8.3642.59

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 196 new files
Database: 2 new tables, 4 new options
New tables
wp_BS_Scanner_Data
wp_BS_Scanner
New WordPress options
fs_accounts
fs_active_plugins
fs_debug_mode
fs_gdpr

Browser metrics Passed 4 tests

This is an overview of browser requirements for BlogSafe Scanner
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,838 ▲8415.71 ▼0.305.80 ▼0.482.02 ▼1.01
Dashboard /wp-admin2,946 ▲886.14 ▼0.04120.51 ▼19.45199.31 ▲37.04
Posts /wp-admin/edit.php2,743 ▲553.13 ▼0.1065.40 ▲4.61157.16 ▲21.83
Add New Post /wp-admin/post-new.php1,686 ▼3322.57 ▲5.63400.24 ▼16.60175.89 ▲20.41
Media Library /wp-admin/upload.php1,736 ▲385.55 ▲0.01129.76 ▼15.51221.30 ▲28.99
Freemius Debug [v.2.4.1] /wp-admin/admin.php?page=freemius1,4562.7455.10114.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/blogsafe-scanner/freemius/includes/class-freemius.php+8540
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 4 options in the database
    • fs_gdpr
    • fs_accounts
    • fs_active_plugins
    • fs_debug_mode

Smoke tests 25% 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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Notice in wp-content/plugins/blogsafe-scanner/admin/class-blogsafe-scanner-plus-admin.php+105
    ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush

SRP 0% 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
Please take a closer look at the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/blogsafe-scanner/public/partials/blogsafe-scanner-plus-public-display.php
    • > /wp-content/plugins/blogsafe-scanner/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/blogsafe-scanner/admin/partials/blogsafe-scanner-plus-admin-display.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/blogsafe-scanner/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/blogsafe-scanner/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/blogsafe-scanner/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/blogsafe-scanner/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/blogsafe-scanner/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/blogsafe-scanner/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/blogsafe-scanner/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/blogsafe-scanner/freemius/templates/account/partials/addon.php on line 6

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 96% from 29 tests

readme.txt Passed 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
3 plugin tags: malware, scanner, checksum

blogsafe-scanner/blogsafe-scanner-plus.php 92% from 13 tests

The main PHP file in "BlogSafe Scanner" ver. 1.1.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("blogsafe-scanner.php" instead of "blogsafe-scanner-plus.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin32,949 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PHP1267,53016,44432,490
PO File195104235
JavaScript43559197
CSS131827

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,895)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity71.02
▷ Minimum class complexity1.00
▷ Maximum class complexity2,895.00
Average method complexity4.54
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods1,238
▷ Static methods17514.14%
▷ Public methods86569.87%
▷ Protected methods151.21%
▷ Private methods35828.92%
Functions99
▷ Named functions9898.99%
▷ Anonymous functions11.01%
Constants135
▷ Global constants11081.48%
▷ Class constants2518.52%
▷ Public constants25100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.52MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/blogsafe-scanner.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/images/BSScannerIcon.png133.13KB0.60KB▼ 99.55%
admin/images/BSS_Subscribe_Button.png193.20KB8.49KB▼ 95.61%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%