67% writersblok-ai

Code Review | WritersBlok AI Content Generator for WordPress

WordPress plugin WritersBlok AI Content Generator for WordPress scored67%from 54 tests.

About plugin

  • Plugin page: writersblok-ai
  • Plugin version: 1.3.19
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 28, 2022
  • Latest release: Jul 6, 2023
  • Number of updates: 41
  • Update frequency: every 4.6 days
  • Top authors: spyderman4g63 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,956 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲5.37MB] [CPU: ▲29.48ms] 75% from 4 tests

Analyzing server-side resources used by WritersBlok AI Content Generator for WordPress
Please have a look at the following items
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.37MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.19 ▲5.7371.65 ▲29.76
Dashboard /wp-admin9.21 ▲5.9177.06 ▲29.80
Posts /wp-admin/edit.php9.21 ▲5.8579.69 ▲28.93
Add New Post /wp-admin/post-new.php9.88 ▲3.99118.88 ▲29.41
Media Library /wp-admin/upload.php9.21 ▲5.9866.61 ▲34.12
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2161.10

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 213 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
fs_debug_mode
widget_theysaidso_widget
db_upgraded
widget_recent-posts
wpwrtblk_api_settings
fs_accounts
fs_active_plugins
theysaidso_admin_options
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by WritersBlok AI Content Generator for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,997 ▲25123.91 ▲9.321.78 ▼0.1131.75 ▼13.44
Dashboard /wp-admin2,398 ▲20714.22 ▲9.32278.13 ▲168.67164.54 ▲121.65
Posts /wp-admin/edit.php2,330 ▲24411.82 ▲9.80114.62 ▲76.87146.22 ▲112.46
Add New Post /wp-admin/post-new.php1,586 ▲5118.54 ▼4.72480.54 ▼172.9977.24 ▲26.12
Media Library /wp-admin/upload.php1,569 ▲18113.17 ▲8.94170.17 ▲73.2861.50 ▲17.63
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,31511.48108.25143.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/writersblok-ai/vendor/freemius/wordpress-sdk/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 11 options in the database
    • wpwrtblk_api_key
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • wpwrtblk_api_settings
    • can_compress_scripts
    • fs_active_plugins
    • fs_accounts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/writersblok-ai/templates/app.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/writersblok-ai/classes/class-create-settings-routes.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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: You can take inspiration from this readme.txt

writersblok-ai/writersblok-ai.php 85% from 13 tests

The main PHP script in "WritersBlok AI Content Generator for WordPress" version 1.3.19 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin35,881 lines of code in 164 files:
LanguageFilesBlank linesComment linesLines of code
PHP1388,38318,25634,770
Markdown33220760
JavaScript43460194
JSON300132
CSS140014
SVG20011

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity80.47
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,367
▷ Static methods23617.26%
▷ Public methods97371.18%
▷ Protected methods171.24%
▷ Private methods37727.58%
Functions121
▷ Named functions11292.56%
▷ Anonymous functions97.44%
Constants227
▷ Global constants17777.97%
▷ Class constants5022.03%
▷ Public constants50100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/wordpress-sdk/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/wordpress-sdk/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/logo.png9.91KB6.83KB▼ 31.11%