78% article-generator

Code Review | Article Generator

WordPress plugin Article Generator scored 78% from 54 tests.

About plugin

  • Plugin page: article-generator
  • Plugin version: 0.8.0
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.2
  • WordPress version: 6.3.1
  • First release: May 5, 2023
  • Latest release: May 6, 2023
  • Number of updates: 20
  • Update frequency: every 0.1 days
  • Top authors: cleissonbarbosa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 188 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.29ms] Passed 4 tests

Server-side resources used by Article Generator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.28 ▼3.48
Dashboard /wp-admin3.31 ▲0.0050.47 ▼3.27
Posts /wp-admin/edit.php3.36 ▲0.0048.84 ▲1.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.43 ▼10.97
Media Library /wp-admin/upload.php3.23 ▲0.0036.69 ▲0.57

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

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

Browser metrics Passed 4 tests

Article Generator: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.21 ▼1.171.79 ▼0.2445.11 ▼1.53
Dashboard /wp-admin2,209 ▲214.84 ▼1.1795.10 ▼19.9540.76 ▼6.56
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0640.57 ▲5.3935.11 ▲1.47
Add New Post /wp-admin/post-new.php1,528 ▼717.97 ▼5.37626.75 ▼25.8864.90 ▲19.25
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0095.67 ▼3.6041.96 ▼5.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/article-generator/templates/blocks/ai-gen-image/markup.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/article-generator/includes/Abstracts/RESTController.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/article-generator/templates/blocks/ai-complete/markup.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ArticleGen\\CBPlugin\\Abstracts\\BaseModel' not found in wp-content/plugins/article-generator/includes/Contexts/Context.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ArticleGen\\CBPlugin\\Abstracts\\DBSeeder' not found in wp-content/plugins/article-generator/includes/Databases/Seeder/SettingsSeeder.php:13
    • > PHP Fatal error
      Trait 'ArticleGen\\CBPlugin\\Traits\\Queryable' not found in wp-content/plugins/article-generator/includes/Abstracts/BaseModel.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'ArticleGen\\CBPlugin\\Abstracts\\DBSeeder' not found in wp-content/plugins/article-generator/includes/Databases/Seeder/ContextsSeeder.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/article-generator/templates/app.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ArticleGen\\CBPlugin\\Abstracts\\RESTController' not found in wp-content/plugins/article-generator/includes/REST/SettingsController.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ArticleGen\\CBPlugin\\Abstracts\\RESTController' not found in wp-content/plugins/article-generator/includes/REST/ContextsController.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'ArticleGen\\CBPlugin\\Abstracts\\DBMigrator' not found in wp-content/plugins/article-generator/includes/Databases/Migrations/SettingsMigration.php:10

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: article generator, chatgpt, gpt, writing assistant, automated content creation...

article-generator/article-gen.php 77% from 13 tests

The main file in "Article Generator" v. 0.8.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("article-generator.php" instead of "article-gen.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "5.8")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
No dangerous file extensions were detected2,852 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP405791,6092,243
PO File1132151313
JSON600288
CSS5105
JavaScript3003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces14
Interfaces0
Traits2
Classes27
▷ Abstract classes414.81%
▷ Concrete classes2385.19%
▷ Final classes14.35%
Methods144
▷ Static methods2718.75%
▷ Public methods13090.28%
▷ Protected methods64.17%
▷ Private methods85.56%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants19
▷ Global constants1052.63%
▷ Class constants947.37%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.06MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/article-gen-logo.png30.59KB30.62KB0.00%
assets/images/article-gen-logo-icon.png1.12KB0.90KB▼ 19.26%
build/images/article-gen-logo.2c9e3ee0.png30.59KB30.62KB0.00%