74% chat-with-gpt

Code Review | Chat with GPT

WordPress plugin Chat with GPT scored74%from 54 tests.

About plugin

  • Plugin page: chat-with-gpt
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 28, 2023
  • Latest release: Nov 14, 2023
  • Number of updates: 3
  • Update frequency: every 5.7 days
  • Top authors: kubalskiy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /57 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: ▲0.02MB] [CPU: ▼3.35ms] Passed 4 tests

Server-side resources used by Chat with GPT
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.34 ▼4.78
Dashboard /wp-admin3.32 ▲0.0248.64 ▲2.02
Posts /wp-admin/edit.php3.44 ▲0.0849.02 ▲1.60
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.88 ▼12.23
Media Library /wp-admin/upload.php3.25 ▲0.0237.02 ▲3.28
Chat with GPT /wp-admin/tools.php?page=chat-with-gpt3.66321.90

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 494 new files
Database: 1 new table, 6 new options
New tables
wp_qcg_user_access
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Chat with GPT
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲714.32 ▼0.031.74 ▼0.5845.36 ▲1.88
Dashboard /wp-admin2,202 ▲255.62 ▲0.0793.69 ▼7.1044.03 ▲3.47
Posts /wp-admin/edit.php2,104 ▲72.00 ▲0.0433.26 ▼4.0035.14 ▲0.58
Add New Post /wp-admin/post-new.php1,529 ▲323.17 ▲0.04687.03 ▲87.6953.99 ▼4.36
Media Library /wp-admin/upload.php1,404 ▲74.13 ▼0.0297.86 ▼10.0742.77 ▼3.00
Chat with GPT /wp-admin/tools.php?page=chat-with-gpt9042.0123.4127.98

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% 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 | 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
Please take a closer look at the following
  • 259× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\StreamFactory' not found in wp-content/plugins/chat-with-gpt/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Tectalic\\OpenAi\\Models\\AbstractModel' not found in wp-content/plugins/chat-with-gpt/vendor/tectalic/openai/src/Models/Edits/CreateResponseChoicesItem.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Authentication' not found in wp-content/plugins/chat-with-gpt/vendor/php-http/message/src/Authentication/Bearer.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Tectalic\\OpenAi\\Models\\AbstractModel' not found in wp-content/plugins/chat-with-gpt/vendor/tectalic/openai/src/Models/ImagesEdits/CreateImageRequest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Promise\\Promise' not found in wp-content/plugins/chat-with-gpt/vendor/php-http/promise/src/FulfilledPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/chat-with-gpt/vendor/tectalic/openai/tests/Unit/Handlers/FineTunesEventsTest.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\UriFactory' not found in wp-content/plugins/chat-with-gpt/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Tectalic\\OpenAi\\Models\\UnstructuredModel' not found in wp-content/plugins/chat-with-gpt/vendor/tectalic/openai/src/Models/FineTunesCancel/CancelFineTuneResponseTrainingFilesItemStatusDetails.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Exception' not found in wp-content/plugins/chat-with-gpt/vendor/php-http/message/src/Exception/UnexpectedValueException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/chat-with-gpt/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:13

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: The official readme.txt might help

chat-with-gpt/bootstrap.php 92% from 13 tests

This is the main PHP file of "Chat with GPT" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("chat-with-gpt.php" instead of "bootstrap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected29,908 lines of code in 464 files:
LanguageFilesBlank linesComment linesLines of code
PHP3784,91111,09719,816
Markdown401,93503,319
YAML4132153,147
JSON25102,681
CSS2152438
JavaScript2374209
PO File147100159
SVG900106
XML33433

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.94
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces62
Interfaces36
Traits12
Classes309
▷ Abstract classes72.27%
▷ Concrete classes30297.73%
▷ Final classes22173.18%
Methods1,437
▷ Static methods18612.94%
▷ Public methods1,22785.39%
▷ Protected methods624.31%
▷ Private methods14810.30%
Functions63
▷ Named functions2031.75%
▷ Anonymous functions4368.25%
Constants137
▷ Global constants64.38%
▷ Class constants13195.62%
▷ Public constants3325.19%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/images/pattern.png11.29KB4.83KB▼ 57.23%
asset/images/ico_32.png0.45KB0.29KB▼ 34.42%