84% spectrom-db-cleanup

Code Review | SpectrOM DB Cleanup

WordPress plugin SpectrOM DB Cleanup scored84%from 54 tests.

About plugin

  • Plugin page: spectrom-db-cleanup
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Apr 8, 2015
  • Latest release: Dec 16, 2015
  • Number of updates: 12
  • Update frequency: every 21.2 days
  • Top authors: SpectrOMTech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,943 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼18.33ms] Passed 4 tests

An overview of server-side resources used by SpectrOM DB Cleanup
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0245.37 ▼0.59
Dashboard /wp-admin3.35 ▲0.0446.10 ▼13.32
Posts /wp-admin/edit.php3.40 ▲0.0472.25 ▲16.87
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.79 ▼43.51
Media Library /wp-admin/upload.php3.27 ▲0.0433.95 ▼15.88
SpectrOM DB Cleanup /wp-admin/options-general.php?page=spectrom-dbcleanup3.2638.65

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

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

Browser metrics Passed 4 tests

A check of browser resources used by SpectrOM DB Cleanup
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.13 ▼1.451.84 ▼0.4148.11 ▲2.27
Dashboard /wp-admin2,210 ▲254.86 ▼1.02133.39 ▼39.8843.95 ▼5.11
Posts /wp-admin/edit.php2,093 ▲12.02 ▲0.0052.39 ▲5.8651.74 ▼1.87
Add New Post /wp-admin/post-new.php1,517 ▼317.60 ▼5.70669.10 ▼65.6663.08 ▲8.56
Media Library /wp-admin/upload.php1,392 ▲44.16 ▼0.0293.29 ▼33.0944.30 ▼19.21
SpectrOM DB Cleanup /wp-admin/options-general.php?page=spectrom-dbcleanup1,0422.0431.8842.36

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • spectrom_dbcleanup_settings
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'SpectrOMDBCleanup' not found in wp-content/plugins/spectrom-db-cleanup/install/activate.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/spectrom-db-cleanup/spectrom-db-cleanup.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'SpectrOMDBCleanup' not found in wp-content/plugins/spectrom-db-cleanup/admin.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'SpectrOMDBCleanup' not found in wp-content/plugins/spectrom-db-cleanup/cron.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'SpectrOMDBCleanup' not found in wp-content/plugins/spectrom-db-cleanup/install/deactivate.php:30

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: spectromtech, optimize, davejesch, optimizer, report...

spectrom-db-cleanup/spectrom-db-cleanup.php 85% from 13 tests

The principal PHP file in "SpectrOM DB Cleanup" v. 1.0.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; 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
Everything looks great! No dangerous files found in this plugin806 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP6167281703
CSS22651103

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity12.17
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods47
▷ Static methods817.02%
▷ Public methods2961.70%
▷ Protected methods00.00%
▷ Private methods1838.30%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants225.00%
▷ Class constants675.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/spectrom-logo-plain.png8.16KB3.50KB▼ 57.16%
assets/img/spectrom.png16.67KB6.51KB▼ 60.95%