84% code-cleaner

Code Review | Code Cleaner

WordPress plugin Code Cleaner scored84%from 54 tests.

About plugin

  • Plugin page: code-cleaner
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.1
  • WordPress version: 6.3.1
  • First release: Apr 12, 2018
  • Latest release: Apr 12, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: cleancoded (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /969 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.29MB] [CPU: ▼4.56ms] Passed 4 tests

Analyzing server-side resources used by Code Cleaner
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2839.84 ▼3.49
Dashboard /wp-admin3.61 ▲0.3049.21 ▼0.41
Posts /wp-admin/edit.php3.72 ▲0.3647.98 ▲2.64
Add New Post /wp-admin/post-new.php6.19 ▲0.3083.43 ▼10.16
Media Library /wp-admin/upload.php3.53 ▲0.3035.41 ▼4.18
Code Cleaner /wp-admin/options-general.php?page=codecleaner3.5034.19

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
codecleaner_extras
db_upgraded
codecleaner_options
widget_recent-comments
widget_recent-posts
codecleaner_cdn

Browser metrics Passed 4 tests

Checking browser requirements for Code Cleaner
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.26 ▼1.114.40 ▲2.5040.05 ▼4.68
Dashboard /wp-admin2,209 ▲245.84 ▼0.01106.59 ▲6.2639.04 ▼3.15
Posts /wp-admin/edit.php2,095 ▲62.06 ▲0.0535.38 ▼1.4631.65 ▼4.55
Add New Post /wp-admin/post-new.php1,533 ▼223.39 ▼0.04662.23 ▼30.1053.47 ▼4.82
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.10103.98 ▲2.9946.13 ▲1.36
Code Cleaner /wp-admin/options-general.php?page=codecleaner1,3961.7224.8639.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • codecleaner_options
    • codecleaner_extras
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • codecleaner_cdn
    • can_compress_scripts

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/code-cleaner/inc/admin.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/code-cleaner/inc/network.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/code-cleaner/codecleaner.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/code-cleaner/inc/settings.php:531
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/code-cleaner/inc/functions.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: optimizer, clean-up, performance, optimize, cleanup...

code-cleaner/codecleaner.php 85% from 13 tests

The main file in "Code Cleaner" v. 1.1.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("code-cleaner.php" instead of "codecleaner.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin2,170 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP62942662,003
CSS1181167

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
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%
Functions69
▷ Named functions69100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/close.png1.53KB0.51KB▼ 66.41%