73% k2-essentials

Code Review | K2 Essentials

WordPress plugin K2 Essentials scored73%from 54 tests.

About plugin

  • Plugin page: k2-essentials
  • Plugin version: 1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4.1
  • WordPress version: 6.3.1
  • First release: Jul 25, 2020
  • Latest release: Nov 23, 2020
  • Number of updates: 10
  • Update frequency: every 12.3 days
  • Top authors: pookidevs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /751 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.17MB] [CPU: ▼39.74ms] Passed 4 tests

Analyzing server-side resources used by K2 Essentials
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.80 ▼0.6614.57 ▼25.69
Dashboard /wp-admin2.84 ▼0.4617.18 ▼29.56
Posts /wp-admin/edit.php2.84 ▼0.5216.00 ▼29.66
Add New Post /wp-admin/post-new.php2.84 ▼3.0519.43 ▼74.04
Media Library /wp-admin/upload.php2.84 ▼0.3919.18 ▼19.89

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

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

Browser metrics Passed 4 tests

K2 Essentials: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.23 ▼1.171.79 ▼0.0239.90 ▼6.98
Dashboard /wp-admin2,222 ▲345.98 ▲0.12100.29 ▼9.2430.84 ▼11.95
Posts /wp-admin/edit.php2,111 ▲252.01 ▼0.0439.47 ▲1.5226.04 ▼8.19
Add New Post /wp-admin/post-new.php1,693 ▲18024.83 ▲7.40611.76 ▼78.0660.33 ▲3.69
Media Library /wp-admin/upload.php1,401 ▲164.21 ▲0.0199.66 ▲2.1243.42 ▲1.34

Uninstaller [IO: ▲0.00MB] [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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/k2-essentials/class-controls.php+128
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/k2-essentials/plugin.php:20

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 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: You can take inspiration from this readme.txt

k2-essentials/plugin.php 85% from 13 tests

"K2 Essentials" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("k2-essentials.php" instead of "plugin.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin755 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP15169253493
CSS1558214
Markdown120048

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.50
▷ Minimum class complexity2.00
▷ Maximum class complexity15.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods16
▷ Static methods212.50%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin