68% apoyl-chatgpt

Code Review | [凹凸曼]ChatGPT聊天机器人

WordPress plugin [凹凸曼]ChatGPT聊天机器人 scored68%from 54 tests.

About plugin

  • Plugin page: apoyl-chatgpt
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-6.4
  • WordPress version: 6.3.1
  • First release: Apr 20, 2023
  • Latest release: Nov 23, 2023
  • Number of updates: 8
  • Update frequency: every 27.1 days
  • Top authors: apoyl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /446 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.65ms] Passed 4 tests

A check of server-side resources used by [凹凸曼]ChatGPT聊天机器人
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.64 ▼6.02
Dashboard /wp-admin3.35 ▲0.0447.35 ▼3.95
Posts /wp-admin/edit.php3.46 ▲0.1048.84 ▲1.57
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.17 ▼0.72
Media Library /wp-admin/upload.php3.27 ▲0.0433.74 ▼3.89
settings /wp-admin/options-general.php?page=apoyl-chatgpt-settings3.2531.31

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 25 new files
Database: 1 new table, 8 new options
New tables
wp_apoyl_chatgpt
New WordPress options
apoyl-chatgpt-settings
widget_theysaidso_widget
apoyl_chatgpt_db_version
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by [凹凸曼]ChatGPT聊天机器人
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.25 ▼0.101.75 ▲0.0339.58 ▼5.06
Dashboard /wp-admin2,202 ▲225.62 ▲0.0491.94 ▲4.5741.63 ▲0.24
Posts /wp-admin/edit.php2,104 ▲42.00 ▲0.0039.30 ▲0.1536.25 ▼2.42
Add New Post /wp-admin/post-new.php1,529 ▲323.66 ▲0.31602.27 ▼98.8750.61 ▼10.29
Media Library /wp-admin/upload.php1,404 ▲74.18 ▲0.0298.99 ▲2.2042.32 ▼3.23
settings /wp-admin/options-general.php?page=apoyl-chatgpt-settings9362.1524.1928.20

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
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_apoyl_chatgpt
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • apoyl_chatgpt_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/apoyl-chatgpt/public/my-chatgpt.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/apoyl-chatgpt/admin/partials/nav.php:11
    • > PHP Fatal error
      require_once(): Failed opening required 'APOYL_CHATGPT_DIRadmin/partials/nav.php' (include_path='.:/usr/share/php') in wp-content/plugins/apoyl-chatgpt/admin/partials/list.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/apoyl-chatgpt/public/partials/public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/apoyl-chatgpt/admin/partials/setting.php:25
    • > PHP Warning
      require_once(APOYL_CHATGPT_DIRadmin/partials/nav.php): failed to open stream: No such file or directory in wp-content/plugins/apoyl-chatgpt/admin/partials/list.php on line 13
    • > PHP Warning
      Use of undefined constant APOYL_CHATGPT_DIR - assumed 'APOYL_CHATGPT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/apoyl-chatgpt/admin/partials/list.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: chatgpt, openai

apoyl-chatgpt/apoyl-chatgpt.php 92% from 13 tests

This is the main PHP file of "[凹凸曼]ChatGPT聊天机器人" version 1.6.0, 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:
  • Description: The description should be shorter than 140 characters (currently 179 characters long)

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 detected470 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP16104165389
CSS115078
JavaScript1203

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.38
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.41
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods27
▷ Static methods414.81%
▷ Public methods2281.48%
▷ Protected methods00.00%
▷ Private methods518.52%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin