73% 2kb-performance

Code Review | 2kb Performance

WordPress plugin 2kb Performance scored 73% 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: 5.8.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 / 1,945 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼144.75ms] Passed 4 tests

This is a short check of server-side resources used by 2kb Performance
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.0925.55 ▼2.40
Dashboard /wp-admin3.14 ▲0.0838.86 ▼9.16
Posts /wp-admin/edit.php3.26 ▲0.1435.53 ▼2.01
Add New Post /wp-admin/post-new.php5.51 ▲0.06104.60 ▼565.41
Media Library /wp-admin/upload.php3.09 ▲0.0827.87 ▲1.68
2kb Performance /wp-admin/options-general.php?page=2kb-performance3.0721.13

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 2 new options
New WordPress options
2kb-performance-cached-css
2kb-performance-cached-js

Browser metrics Passed 4 tests

Checking browser requirements for 2kb Performance
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,674 ▲7315.06 ▼0.864.98 ▲0.0760.23 ▼17.40
Dashboard /wp-admin2,934 ▲396.12 ▼0.03118.17 ▼15.49168.31 ▼5.14
Posts /wp-admin/edit.php2,748 ▲83.23 ▲0.0162.62 ▼8.01141.22 ▼0.61
Add New Post /wp-admin/post-new.php3,738 ▲318.49 ▲0.78505.14 ▲70.44193.57 ▲28.11
Media Library /wp-admin/upload.php1,757 ▲85.56 ▲0.08141.84 ▲3.72182.79 ▼2.40
2kb Performance /wp-admin/options-general.php?page=2kb-performance1,2312.4054.74113.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • 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
  • This plugin does not fully uninstall, leaving 2 options in the database
    • 2kb-performance-cached-js
    • 2kb-performance-cached-css

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Contributors: Plugin contributors not specified
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === 2kb-performance === )
The official readme.txt is a good inspiration

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

"2kb Performance" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("2kb-performance.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected1,140 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4205253983
Markdown1960157

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
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
No PNG images were found in this plugin