78% ai-content-generator

Code Review | Sage AI Content Writer | OpenAI GPT-4 Article, Landing Page, WooCommerce AI & Image Generator

WordPress plugin Sage AI Content Writer | OpenAI GPT-4 Article, Landing Page, WooCommerce AI & Image Generator scored78%from 54 tests.

About plugin

  • Plugin page: ai-content-generator
  • Plugin version: 2.2.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 16, 2022
  • Latest release: Nov 25, 2023
  • Number of updates: 57
  • Update frequency: every 6.0 days
  • Top authors: wpmonks (61.4%)aicontentwriter (33.33%)aman086 (8.77%)

Code review

54 tests

User reviews

6 reviews

Install metrics

800+ active /19,493 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.34MB] [CPU: ▲3.18ms] Passed 4 tests

A check of server-side resources used by Sage AI Content Writer | OpenAI GPT-4 Article, Landing Page, WooCommerce AI & Image Generator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0841.68 ▼0.90
Dashboard /wp-admin3.77 ▲0.4652.72 ▲2.56
Posts /wp-admin/edit.php3.83 ▲0.4762.27 ▲16.06
Add New Post /wp-admin/post-new.php6.30 ▲0.4188.43 ▲1.34
Media Library /wp-admin/upload.php3.64 ▲0.4143.49 ▲9.71
Landing Pages Generator /wp-admin/admin.php?page=wp_ai_content_gen_landing_page3.6239.94
Sage AI Writer /wp-admin/admin.php?page=wp-ai-content-gen-settings3.6239.01
Bulk Content Generator /wp-admin/admin.php?page=wp_ai_content_gen_bulk3.6236.80
Support /wp-admin/admin.php?page=wp_ai_content_gen_support3.6236.33
Prompts /wp-admin/admin.php?page=ai-content-writer-templates3.6239.14

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 74 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
wp_ai_content_gen_settings
theysaidso_admin_options
db_upgraded
can_compress_scripts
sage_ai_reviews_installed_on

Browser metrics Passed 4 tests

Sage AI Content Writer | OpenAI GPT-4 Article, Landing Page, WooCommerce AI & Image Generator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,979 ▲19224.41 ▲10.111.63 ▼0.3438.78 ▼6.38
Dashboard /wp-admin2,388 ▲21114.64 ▲9.02314.21 ▲214.7545.15 ▼1.48
Posts /wp-admin/edit.php2,339 ▲23912.00 ▲9.98109.54 ▲68.5531.73 ▼3.86
Add New Post /wp-admin/post-new.php1,588 ▲6223.82 ▲0.83539.06 ▼115.2138.84 ▼9.33
Media Library /wp-admin/upload.php1,656 ▲25314.52 ▲10.33141.11 ▲44.8841.28 ▼0.95
Landing Pages Generator /wp-admin/admin.php?page=wp_ai_content_gen_landing_page1,36413.50155.1137.42
Sage AI Writer /wp-admin/admin.php?page=wp-ai-content-gen-settings1,44112.52132.7726.12
Bulk Content Generator /wp-admin/admin.php?page=wp_ai_content_gen_bulk1,20313.46178.9425.99
Support /wp-admin/admin.php?page=wp_ai_content_gen_support1,04011.6998.4623.41
Prompts /wp-admin/admin.php?page=ai-content-writer-templates1,27812.33125.8030.74

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wp_ai_content_gen_settings
    • widget_recent-comments
    • sage_ai_reviews_installed_on
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require(ABSPATHwp-load.php): failed to open stream: No such file or directory in wp-content/plugins/ai-content-generator/inc/admin/bulk-pages-generator.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ai-content-generator/inc/admin/upload-to-media-library.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ai-content-generator/inc/wpaicontent-block.php:8
    • > PHP Fatal error
      require(): Failed opening required 'ABSPATHwp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/ai-content-generator/inc/admin/bulk-pages-generator.php on line 3
    • > PHP Warning
      require(WP_SAGE_AI_DIR/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/ai-content-generator/inc/fetch/callDallE.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ai-content-generator/inc/admin/bulk-pages-generator.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ai-content-generator/inc/admin/class-wp-ai-core-gen-admin-settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ai-content-generator/inc/queue/generate-post-structure.php:3
    • > PHP Fatal error
      require(): Failed opening required 'WP_SAGE_AI_DIR/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/ai-content-generator/inc/fetch/callOpenAI.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ai-content-generator/inc/fetch/callPixabay.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=wp_ai_content_gen_bulk
    • > Console-api (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:53544 ReferenceError: Button is not definedat /wp-content/plugins/ai-content-generator/build/index.js?ver=6.3.1:1:195163at o (/wp-content/plugins/ai-content-generator/build/index.js?ver=6.3.1:1:196233)at /wp-content/plugins/ai-content-generator/build/index.js?ver=6.3.1:1:200430at /wp-includes/js/dist/components.min.js?ver=f914d11cd76135f7269e:55:2491at wt (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:47637)at dr (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:54880)at js (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:122633)at wl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:88659)at bl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:88587)at yl (/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10:88450)
    • > GET request to /wp-admin/admin.php?page=wp_ai_content_gen_bulk
    • > Javascript (severe) in unknown
    /wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0 9:32518 Uncaught ReferenceError: Button is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

ai-content-generator/wpaicore.php 92% from 13 tests

"Sage AI Content Writer | OpenAI GPT-4 Article, Landing Page, WooCommerce AI & Image Generator" version 2.2.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ai-content-generator.php" instead of "wpaicore.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin4,030 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP279941,0062,972
Markdown33220760
JavaScript394144
JSON400137
CSS30015
SVG2002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity18.82
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods137
▷ Static methods5137.23%
▷ Public methods13296.35%
▷ Protected methods00.00%
▷ Private methods53.65%
Functions46
▷ Named functions4495.65%
▷ Anonymous functions24.35%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ 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
14 PNG files occupy 0.07MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
build/images/thunder.f289d66f.png0.40KB0.45KB0.00%
build/images/check-mark.73329fb0.png3.67KB1.60KB▼ 56.30%
build/images/lightning-bolt.54200623.png0.43KB0.46KB0.00%
build/images/step.3547222f.png0.90KB1.12KB0.00%
build/images/money.364d77c6.png8.33KB4.33KB▼ 48.08%