84% tnc-ai-excerpt-generator

Code Review | TNC AI Excerpt Generator

WordPress plugin TNC AI Excerpt Generator scored84%from 54 tests.

About plugin

  • Plugin page: tnc-ai-excerpt-ge...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 1, 2023
  • Latest release: Jun 1, 2023
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: abdulawal39 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /378 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

A check of server-side resources used by TNC AI Excerpt Generator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.92 ▼4.01
Dashboard /wp-admin3.35 ▲0.0548.36 ▲0.59
Posts /wp-admin/edit.php3.40 ▲0.0445.01 ▼3.56
Add New Post /wp-admin/post-new.php5.93 ▲0.0483.63 ▼15.08
Media Library /wp-admin/upload.php3.27 ▲0.0432.12 ▼1.75
TNC AI Excerpt /wp-admin/options-general.php?page=tnc-ai-excerpt-generator3.2430.42

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
db_upgraded
ai_excerpt_gen_api_key
ai_excerpt_gen_post_types_enabled
widget_recent-posts
ai_excerpt_gen_max_token
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
ai_excerpt_gen_model

Browser metrics Passed 4 tests

Checking browser requirements for TNC AI Excerpt Generator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.30 ▼0.991.81 ▲0.2445.53 ▼1.30
Dashboard /wp-admin2,210 ▲184.87 ▼0.03101.28 ▼7.3739.44 ▼4.26
Posts /wp-admin/edit.php2,090 ▲12.02 ▼0.0435.48 ▼5.8233.59 ▼1.78
Add New Post /wp-admin/post-new.php1,539 ▲423.36 ▲0.15643.85 ▼23.6252.00 ▼16.78
Media Library /wp-admin/upload.php1,392 ▲14.21 ▲0.0194.99 ▼2.2241.52 ▼2.77
TNC AI Excerpt /wp-admin/options-general.php?page=tnc-ai-excerpt-generator8802.1421.6130.10

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
  • The uninstall procedure has failed, leaving 10 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • ai_excerpt_gen_model
    • ai_excerpt_gen_max_token
    • ai_excerpt_gen_api_key
    • db_upgraded
    • ai_excerpt_gen_post_types_enabled

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tnc-ai-excerpt-generator/tnc-ai-excerpt-generator.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

tnc-ai-excerpt-generator/tnc-ai-excerpt-generator.php Passed 13 tests

The main file in "TNC AI Excerpt Generator" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
106 characters long description:
Automatically generates a excerpt of posts and saves it as an excerpt using OpenAI's GPT-3 language model.

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 detected193 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14632193

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 1.68MB with 0.98MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshots/screenshot-2.png701.74KB301.85KB▼ 56.99%
screenshots/screenshot-1.png1,016.30KB409.56KB▼ 59.70%