84% klan1-functions

Code Review | Klan1 Common WP Functions

WordPress plugin Klan1 Common WP Functions scored84%from 54 tests.

About plugin

  • Plugin page: klan1-functions
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.2.4
  • WordPress version: 6.3.1
  • First release: Nov 12, 2013
  • Latest release: Aug 12, 2015
  • Number of updates: 26
  • Update frequency: every 24.6 days
  • Top authors: k1-j0hnd03 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,516 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼6.39ms] Passed 4 tests

An overview of server-side resources used by Klan1 Common WP Functions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.99 ▼1.71
Dashboard /wp-admin3.31 ▼0.0450.89 ▼12.56
Posts /wp-admin/edit.php3.36 ▲0.0046.86 ▲0.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.15 ▼11.34
Media Library /wp-admin/upload.php3.23 ▲0.0036.19 ▲0.76

Server storage [IO: ▲0.08MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Klan1 Common WP Functions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.20 ▲0.231.72 ▲0.2640.29 ▼7.51
Dashboard /wp-admin2,198 ▲215.57 ▼0.0584.77 ▼6.9038.44 ▼4.92
Posts /wp-admin/edit.php2,100 ▼31.99 ▼0.1239.02 ▼0.3835.09 ▼2.59
Add New Post /wp-admin/post-new.php1,526 ▼022.86 ▼0.06629.45 ▼2.4555.46 ▼18.75
Media Library /wp-admin/upload.php1,400 ▼04.16 ▲0.0695.95 ▼6.2041.13 ▼2.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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 items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/klan1-functions/k1-functions.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: developer, basic functions, image resize, klan1

klan1-functions/k1-functions.php 92% from 13 tests

The principal PHP file in "Klan1 Common WP Functions" v. 0.5 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("klan1-functions.php" instead of "k1-functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected135 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21631,321126
XML1009

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity208.00
▷ Minimum class complexity208.00
▷ Maximum class complexity208.00
Average method complexity6.91
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods38.57%
▷ Public methods514.29%
▷ Protected methods3085.71%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants54
▷ Global constants54100.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
No PNG files were detected