73% 2kb-performance

Code Review | 2kb Performance

WordPress plugin 2kb Performance scored73%from 54 tests.

About plugin

  • Plugin page: 2kb-performance
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-3.9
  • WordPress version: 6.3.1
  • First release: May 30, 2014
  • Latest release: Jan 20, 2015
  • Number of updates: 8
  • Update frequency: every 29.4 days
  • Top authors: 2kblater.com (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,209 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼4.11ms] Passed 4 tests

An overview of server-side resources used by 2kb Performance
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1139.92 ▲0.38
Dashboard /wp-admin3.39 ▲0.0847.97 ▼5.29
Posts /wp-admin/edit.php3.50 ▲0.1550.16 ▲3.00
Add New Post /wp-admin/post-new.php5.97 ▲0.0888.56 ▼8.92
Media Library /wp-admin/upload.php3.31 ▲0.0837.46 ▼2.61
2kb Performance /wp-admin/options-general.php?page=2kb-performance3.2931.74

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 8 new options
New WordPress options
2kb-performance-cached-js
db_upgraded
widget_recent-comments
theysaidso_admin_options
2kb-performance-cached-css
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by 2kb Performance
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.35 ▼0.061.76 ▼0.1926.34 ▼18.62
Dashboard /wp-admin2,202 ▲225.62 ▼0.0189.40 ▼3.0741.40 ▼1.35
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0035.18 ▼3.5032.31 ▼1.48
Add New Post /wp-admin/post-new.php1,530 ▲423.12 ▼0.79597.35 ▼68.3650.50 ▼10.76
Media Library /wp-admin/upload.php1,407 ▲104.18 ▼0.0897.98 ▼9.3741.46 ▼4.48
2kb Performance /wp-admin/options-general.php?page=2kb-performance8962.0130.4027.60

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/2kb-performance/uninstall.php+19
    rmdir(wp-content/uploads/2kb-performance): Directory not empty
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • 2kb-performance-cached-js
    • 2kb-performance-cached-css
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/2kb-performance/admin-template.php:1

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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === 2kb-performance === )
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

2kb-performance/plugin.php 92% from 13 tests

The principal PHP file in "2kb Performance" v. 1.1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("2kb-performance.php" instead of "plugin.php")

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 plugin1,140 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4205253983
Markdown1960157

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.37
Average class complexity78.50
▷ Minimum class complexity77.00
▷ Maximum class complexity80.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods61
▷ Static methods00.00%
▷ Public methods3455.74%
▷ Protected methods46.56%
▷ Private methods2337.70%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants321.43%
▷ Class constants1178.57%
▷ Public constants11100.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
There were not PNG files found in your plugin