77% wps-cleaner

Code Review | WPS Cleaner

WordPress plugin WPS Cleaner scored77%from 54 tests.

About plugin

  • Plugin page: wps-cleaner
  • Plugin version: 1.6.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: May 29, 2018
  • Latest release: Aug 24, 2023
  • Number of updates: 38
  • Update frequency: every 50.6 days
  • Top authors: NicolasKulka (100%)

Code review

54 tests

User reviews

96 reviews

Install metrics

20,000+ active /259,723 total downloads

Benchmarks

Plugin footprint 82% 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.02MB] [CPU: ▼5.81ms] 75% from 4 tests

This is a short check of server-side resources used by WPS Cleaner
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,004.49ms on /wp-admin/tools.php?page=wps-cleaner)
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1445.06 ▲1.86
Dashboard /wp-admin3.46 ▲0.1685.30 ▲39.66
Posts /wp-admin/edit.php3.50 ▼0.3548.51 ▼5.96
Add New Post /wp-admin/post-new.php5.97 ▲0.0889.07 ▼18.62
Media Library /wp-admin/upload.php3.31 ▲0.0732.58 ▼0.50
WPS Cleaner /wp-admin/tools.php?page=wps-cleaner4.431,004.49

Server storage [IO: ▲7.19MB] [DB: ▲0.30MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 68 new files
Database: 2 new tables, 7 new options
New tables
wp_wps_cleaner
wp_wps_cleaner_queue
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
wps_cleaner_alert
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WPS Cleaner
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.31 ▼1.121.65 ▲0.0538.90 ▼1.58
Dashboard /wp-admin2,210 ▲255.79 ▲0.83104.85 ▼4.3443.11 ▼1.34
Posts /wp-admin/edit.php2,096 ▲72.02 ▼0.0438.18 ▲2.4934.25 ▲1.96
Add New Post /wp-admin/post-new.php1,537 ▼1023.02 ▲4.68596.20 ▼14.6053.12 ▼3.96
Media Library /wp-admin/upload.php1,392 ▲74.18 ▲0.0297.63 ▼4.9343.87 ▼2.30
WPS Cleaner /wp-admin/tools.php?page=wps-cleaner1,2915.2550.2893.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • wps_cleaner_alert
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 17× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/wps-cleaner/blocks/settings_plugin.php
    • > /wp-content/plugins/wps-cleaner/blocks/settings_media.php
    • > /wp-content/plugins/wps-cleaner/blocks/settings_option.php
    • > /wp-content/plugins/wps-cleaner/blocks/title.php
    • > /wp-content/plugins/wps-cleaner/blocks/settings_database.php
    • > /wp-content/plugins/wps-cleaner/wps-cleaner.php
    • > /wp-content/plugins/wps-cleaner/blocks/menu.php
    • > /wp-content/plugins/wps-cleaner/blocks/pub-wpserveur.php
    • > /wp-content/plugins/wps-cleaner/admin_page/plugin.php
    • > /wp-content/plugins/wps-cleaner/blocks/settings_comment.php
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Trait 'WPS\\WPS_Cleaner\\Singleton' not found in wp-content/plugins/wps-cleaner/classes/db.php on line 5
    • > PHP Fatal error
      Trait 'WPS\\WPS_Cleaner\\Singleton' not found in wp-content/plugins/wps-cleaner/classes/db-table.php on line 5
    • > PHP Fatal error
      Trait 'WPS\\WPS_Cleaner\\Singleton' not found in wp-content/plugins/wps-cleaner/classes/helpers.php on line 5
    • > PHP Fatal error
      Trait 'WPS\\WPS_Cleaner\\Singleton' not found in wp-content/plugins/wps-cleaner/classes/index.php on line 5
    • > PHP Fatal error
      Trait 'WPS\\WPS_Cleaner\\Singleton' not found in wp-content/plugins/wps-cleaner/classes/plugin.php on line 5
    • > PHP Warning
      Use of undefined constant WPS_CLEANER_DIR - assumed 'WPS_CLEANER_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wps-cleaner/autoload.php on line 203
    • > PHP Warning
      Use of undefined constant WPS_CLEANER_DIR - assumed 'WPS_CLEANER_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wps-cleaner/autoload.php on line 197

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (29 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

wps-cleaner/wps-cleaner.php 85% from 13 tests

The main file in "WPS Cleaner" v. 1.6.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin14,903 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
SVG40169,002
PHP351,0851,0804,294
CSS21108771
PO File1244310597
JavaScript2467211
JSON20028

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity43.36
▷ Minimum class complexity1.00
▷ Maximum class complexity214.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces3
Interfaces0
Traits1
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods208
▷ Static methods13363.94%
▷ Public methods19191.83%
▷ Protected methods83.85%
▷ Private methods94.33%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/wps-cleaner-logo-wpserveur.png39.32KB7.75KB▼ 80.28%