83% kafkai

Code Review | Kafkai - AI Writer Plugin

WordPress plugin Kafkai - AI Writer Plugin scored83%from 54 tests.

About plugin

  • Plugin page: kafkai
  • Plugin version: 1.5.8
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.9
  • WordPress version: 6.3.1
  • First release: Nov 17, 2020
  • Latest release: Oct 27, 2022
  • Number of updates: 62
  • Update frequency: every 11.6 days
  • Top authors: kafkai (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /17,643 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼1.39ms] Passed 4 tests

A check of server-side resources used by Kafkai - AI Writer Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3637.62 ▲0.81
Dashboard /wp-admin3.67 ▲0.3245.94 ▼12.74
Posts /wp-admin/edit.php3.73 ▲0.3648.30 ▲3.97
Add New Post /wp-admin/post-new.php6.19 ▲0.3095.63 ▲2.42
Media Library /wp-admin/upload.php3.53 ▲0.3039.87 ▲4.62
Import Article /wp-admin/admin.php?page=kafkaiwp_import3.6236.32
Settings /wp-admin/admin.php?page=kafkaiwp_settings3.5133.20
Generate Article /wp-admin/admin.php?page=kafkaiwp_generate3.5334.56

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

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

Browser metrics Passed 4 tests

Kafkai - AI Writer Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.41 ▲0.161.75 ▲0.1939.39 ▼2.98
Dashboard /wp-admin2,222 ▲415.57 ▼0.0993.36 ▼5.4642.27 ▲4.51
Posts /wp-admin/edit.php2,127 ▲272.03 ▲0.0739.42 ▲3.3835.47 ▲0.82
Add New Post /wp-admin/post-new.php1,548 ▲2023.25 ▲0.13614.02 ▼85.0655.96 ▼0.68
Media Library /wp-admin/upload.php1,427 ▲274.19 ▲0.0196.27 ▼12.1940.64 ▼6.15
Import Article /wp-admin/admin.php?page=kafkaiwp_import1,0481.9028.3429.64
Settings /wp-admin/admin.php?page=kafkaiwp_settings9051.9025.8829.22
Generate Article /wp-admin/admin.php?page=kafkaiwp_generate1,1511.9024.3428.65

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/kafkai/vendor/symfony/yaml/Exception/DumpException.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/kafkai/inc/Admin/views/settings.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/kafkai/vendor/symfony/yaml/Command/LintCommand.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/kafkai/inc/Admin/views/generate.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/kafkai/inc/Admin/views/import.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' not found in wp-content/plugins/kafkai/vendor/symfony/yaml/Exception/RuntimeException.php:19
    • > PHP Fatal error
      Trait 'Niteo\\Kafkai\\Plugin\\Admin\\Helper' not found in wp-content/plugins/kafkai/inc/Admin.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/kafkai/vendor/symfony/yaml/Exception/ParseException.php:19

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: articles, content, kafkai, seo

kafkai/kafkai.php 85% from 13 tests

The main PHP file in "Kafkai - AI Writer Plugin" ver. 1.5.8 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Domain Path: Prefix the domain path with a forward slash character ("/i18n")
  • Domain Path: Use only dashes and lowercase characters for the domain path ("i18n")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin7,974 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
PHP421,1361,9124,391
JavaScript25847171,993
SVG3900544
CSS1820475
JSON500369
Markdown5840202

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity34.84
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity5.32
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces9
Interfaces1
Traits1
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes28.70%
Methods200
▷ Static methods5628.00%
▷ Public methods13567.50%
▷ Protected methods73.50%
▷ Private methods5829.00%
Functions31
▷ Named functions2580.65%
▷ Anonymous functions619.35%
Constants26
▷ Global constants00.00%
▷ Class constants26100.00%
▷ Public constants2492.31%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin