73% ai-mojo

Code Review | AI Mojo - ChatGPT / GPT-3 Playground for WordPress

WordPress plugin AI Mojo - ChatGPT / GPT-3 Playground for WordPress scored73%from 54 tests.

About plugin

  • Plugin page: ai-mojo
  • Plugin version: 0.9.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 10, 2021
  • Latest release: Nov 14, 2023
  • Number of updates: 32
  • Update frequency: every 22.0 days
  • Top authors: wpaimojo (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

800+ active /14,717 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.67MB] [CPU: ▼1.37ms] Passed 4 tests

This is a short check of server-side resources used by AI Mojo - ChatGPT / GPT-3 Playground for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6640.00 ▼1.63
Dashboard /wp-admin3.97 ▲0.6750.63 ▲4.05
Posts /wp-admin/edit.php4.03 ▲0.6747.62 ▼3.73
Add New Post /wp-admin/post-new.php6.58 ▲0.6985.59 ▼4.17
Media Library /wp-admin/upload.php3.90 ▲0.6737.54 ▲6.67
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius4.2236.05

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 267 new files
Database: no new tables, 9 new options
New WordPress options
fs_accounts
fs_active_plugins
widget_recent-comments
fs_debug_mode
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

AI Mojo - ChatGPT / GPT-3 Playground for WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8614.69 ▲0.631.83 ▲0.0730.56 ▼13.58
Dashboard /wp-admin2,228 ▲545.50 ▼0.0984.47 ▼7.5841.62 ▼4.12
Posts /wp-admin/edit.php2,137 ▲341.96 ▼0.0437.73 ▲0.0335.00 ▼0.55
Add New Post /wp-admin/post-new.php1,555 ▲2924.51 ▲1.31692.32 ▲4.6562.28 ▼7.16
Media Library /wp-admin/upload.php1,436 ▲364.20 ▼0.0297.87 ▼0.9444.36 ▼1.07
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0881.6725.3628.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/ai-mojo/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • fs_active_plugins
    • fs_debug_mode
    • widget_recent-comments
    • fs_accounts
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant WIMJ_PATH - assumed 'WIMJ_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ai-mojo/includes/freemius.php on line 20
    • > PHP Warning
      require_once(WIMJ_PATH/freemius/start.php): failed to open stream: No such file or directory in wp-content/plugins/ai-mojo/includes/freemius.php on line 20
    • > PHP Fatal error
      require_once(): Failed opening required 'WIMJ_PATH/freemius/start.php' (include_path='.:/usr/share/php') in wp-content/plugins/ai-mojo/includes/freemius.php on line 20

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
9 plugin tags: openai, jurassic-1, gpt-3, gpt3, ai content generation...

ai-mojo/wpaimojo.php 85% from 13 tests

This is the main PHP file of "AI Mojo - ChatGPT / GPT-3 Playground for WordPress" version 0.9.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("ai-mojo.php" instead of "wpaimojo.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected39,758 lines of code in 190 files:
LanguageFilesBlank linesComment linesLines of code
PHP1688,90519,43038,248
PO File15649231,283
JavaScript53459196
XML13016
CSS150015

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity60.64
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes89
▷ Abstract classes22.25%
▷ Concrete classes8797.75%
▷ Final classes00.00%
Methods1,478
▷ Static methods22515.22%
▷ Public methods1,02269.15%
▷ Protected methods171.15%
▷ Private methods43929.70%
Functions171
▷ Named functions13578.95%
▷ Anonymous functions3621.05%
Constants152
▷ Global constants10267.11%
▷ Class constants5032.89%
▷ Public constants50100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.19MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wpaimojo.png3.15KB2.85KB▼ 9.48%
(invalid) freemius/assets/img/ai-mojo.png28.98KB0.00KB▼ 100.00%
assets/images/onboarding-3.png59.17KB65.06KB0.00%
freemius/assets/img/wizardly-ai-main.png8.79KB9.39KB0.00%
assets/images/onboarding-2.png26.37KB28.51KB0.00%