61% wp-cleanup-and-basic-functions

Code Review | WP Cleanup and Basic Functions

WordPress plugin WP Cleanup and Basic Functions scored61%from 54 tests.

About plugin

  • Plugin page: wp-cleanup-and-ba...
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.3
  • WordPress version: 6.3.1
  • First release: Jul 9, 2015
  • Latest release: Nov 9, 2015
  • Number of updates: 28
  • Update frequency: every 4.4 days
  • Top authors: guillaume-lostweb (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /4,050 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: ▼1.58MB] [CPU: ▼48.05ms] Passed 4 tests

Server-side resources used by WP Cleanup and Basic Functions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.38 ▼1.089.37 ▼31.78
Dashboard /wp-admin2.43 ▼0.8713.57 ▼41.58
Posts /wp-admin/edit.php2.43 ▼0.9213.86 ▼34.20
Add New Post /wp-admin/post-new.php2.43 ▼3.4612.18 ▼84.65
Media Library /wp-admin/upload.php2.43 ▼0.8012.25 ▼25.15
WP Cleanup /wp-admin/options-general.php?page=wp-cbf2.4311.78

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Cleanup and Basic Functions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲4514.28 ▲0.001.80 ▼0.1036.12 ▼4.56
Dashboard /wp-admin2,199 ▲225.62 ▲0.0194.28 ▲1.3944.03 ▲2.06
Posts /wp-admin/edit.php2,101 ▲41.99 ▲0.0338.88 ▲1.5636.47 ▲2.26
Add New Post /wp-admin/post-new.php1,531 ▲323.07 ▼0.07668.68 ▲31.4762.86 ▲4.21
Media Library /wp-admin/upload.php1,404 ▲74.18 ▼0.0895.50 ▼2.0545.73 ▲1.83
WP Cleanup /wp-admin/options-general.php?page=wp-cbf2,1514.0076.9825.53

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/wp-cleanup-and-basic-functions/public/class-wp-cbf-public.php+379
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 43 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-cbf
    • > Notice in wp-content/plugins/wp-cleanup-and-basic-functions/public/class-wp-cbf-public.php+392
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-cbf
    • > Notice in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-images_settings.php+177
    Undefined index: medium_large
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-cbf
    • > Notice in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-images_settings.php+177
    Trying to access array offset on value of type null

SRP 0% 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-cleanup-and-basic-functions/public/partials/wp-cbf-public-display.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-privacy_settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-admin_settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-images_settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-smtp.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-cleanup-and-basic-functions/admin/partials/wp-cbf-cleanup_settings.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (No screenshots yet)
The official readme.txt might help

wp-cleanup-and-basic-functions/wp-cbf.php 77% from 13 tests

The principal PHP file in "WP Cleanup and Basic Functions" v. 2.2.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 150 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-cleanup-and-basic-functions.php" instead of "wp-cbf.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,310 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP173527531,319
PO File3295341784
JavaScript23447130
CSS2121177

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity28.86
▷ Minimum class complexity1.00
▷ Maximum class complexity133.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods68
▷ Static methods22.94%
▷ Public methods5783.82%
▷ Protected methods00.00%
▷ Private methods1116.18%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin