89% gpt-3-ai-content-generator

Code Review | OpenAI For WordPress - #1 Content Generator

WordPress plugin OpenAI For WordPress - #1 Content Generator scored 89% from 54 tests.

About plugin

  • Plugin page: gpt-3-ai-content-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 3, 2023
  • Latest release: Jan 3, 2023
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: hireadrian (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active / 2,896 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.73MB] [CPU: ▲4.94ms] Passed 4 tests

This is a short check of server-side resources used by OpenAI For WordPress - #1 Content Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.19 ▲0.7448.62 ▲11.73
Dashboard /wp-admin4.03 ▲0.7356.36 ▲9.09
Posts /wp-admin/edit.php4.08 ▲0.7348.89 ▼1.84
Add New Post /wp-admin/post-new.php6.69 ▲0.8097.91 ▲2.03
Media Library /wp-admin/upload.php3.95 ▲0.7343.36 ▲10.48

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

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

Browser metrics Passed 4 tests

Checking browser requirements for OpenAI For WordPress - #1 Content Generator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7714.47 ▲0.292.27 ▲0.5356.55 ▲13.92
Dashboard /wp-admin2,215 ▲275.86 ▲0.9597.45 ▼16.2635.89 ▼7.52
Posts /wp-admin/edit.php2,101 ▲121.97 ▼0.0736.47 ▼4.3534.32 ▼0.58
Add New Post /wp-admin/post-new.php1,557 ▲3819.54 ▼3.46636.49 ▼1.1256.99 ▲7.49
Media Library /wp-admin/upload.php1,403 ▲184.35 ▼0.0498.58 ▼1.7544.47 ▼2.93

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Playground Settings), #2 (Content Generated), #3 (Content Options), #4 (Template Settings), #5 (Template Editor)
Please take inspiration from this readme.txt

gpt-3-ai-content-generator/wpopenai.php 69% from 13 tests

The main PHP file in "OpenAI For WordPress - #1 Content Generator" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 189 characters long)
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gpt-3-ai-content-generator.php" instead of "wpopenai.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected31,576 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript237,43927,634
PHP437141,8083,938
CSS2003
Markdown1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.78
Average class complexity24.55
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes33
▷ Abstract classes00.00%
▷ Concrete classes33100.00%
▷ Final classes00.00%
Methods174
▷ Static methods1910.92%
▷ Public methods13074.71%
▷ Protected methods00.00%
▷ Private methods4425.29%
Functions64
▷ Named functions3351.56%
▷ Anonymous functions3148.44%
Constants7
▷ Global constants457.14%
▷ Class constants342.86%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-256.png26.64KB10.42KB▼ 60.90%
assets/images/onboarding-2.png26.37KB28.51KB0.00%