78% alttext-ai

Code Review | Alt Text AI - Automatically generate image alt text for SEO and accessibility

WordPress plugin Alt Text AI - Automatically generate image alt text for SEO and accessibility scored78%from 54 tests.

About plugin

  • Plugin page: alttext-ai
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Jan 6, 2023
  • Latest release: Nov 13, 2023
  • Number of updates: 125
  • Update frequency: every 2.5 days
  • Top authors: alttextai (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

4,000+ active /49,095 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.39MB] [CPU: ▲1.98ms] Passed 4 tests

Server-side resources used by Alt Text AI - Automatically generate image alt text for SEO and accessibility
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4038.33 ▼1.60
Dashboard /wp-admin3.74 ▲0.39101.02 ▲38.52
Posts /wp-admin/edit.php3.79 ▲0.4352.45 ▲7.60
Add New Post /wp-admin/post-new.php6.28 ▲0.3989.64 ▼4.44
Media Library /wp-admin/upload.php3.60 ▲0.3736.94 ▲6.34
Sync Library /wp-admin/admin.php?page=atai-csv-import3.5635.30
Settings /wp-admin/admin.php?page=atai3.6639.15

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Alt Text AI - Automatically generate image alt text for SEO and accessibility
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6214.09 ▼0.331.66 ▲0.0241.28 ▼3.05
Dashboard /wp-admin2,229 ▲555.64 ▲0.0897.64 ▼0.6741.98 ▼4.62
Posts /wp-admin/edit.php2,144 ▲442.04 ▲0.1044.87 ▲9.2635.73 ▲0.31
Add New Post /wp-admin/post-new.php6,283 ▲4,75226.03 ▲3.211,022.33 ▲266.3662.71 ▲7.73
Media Library /wp-admin/upload.php1,434 ▲344.23 ▼0.04102.55 ▼1.3341.89 ▲1.30
Sync Library /wp-admin/admin.php?page=atai-csv-import9002.0022.9338.35
Settings /wp-admin/admin.php?page=atai1,8192.0124.8035.55

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • 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 0% 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
Please fix the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/alttext-ai/admin/partials/settings.php
    • > /wp-content/plugins/alttext-ai/admin/partials/csv-import.php
    • > /wp-content/plugins/alttext-ai/admin/partials/bulk-generate.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/media.php): failed to open stream: No such file or directory in wp-content/plugins/alttext-ai/includes/class-atai-attachment.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/alttext-ai/includes/class-atai-attachment.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/media.php' (include_path='.:/usr/share/php') in wp-content/plugins/alttext-ai/includes/class-atai-attachment.php on line 5

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 96% from 29 tests

readme.txt Passed 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
10 plugin tags: alternative text, alt text, accessibility, ai, optimize seo...

alttext-ai/atai.php 92% from 13 tests

This is the main PHP file of "Alt Text AI - Automatically generate image alt text for SEO and accessibility" version 1.2.0, 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("alttext-ai.php" instead of "atai.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
Everything looks great! No dangerous files found in this plugin2,996 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP184941,3192,551
JavaScript110453444
CSS1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity16.58
▷ Minimum class complexity1.00
▷ Maximum class complexity117.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods88
▷ Static methods2022.73%
▷ Public methods8192.05%
▷ Protected methods00.00%
▷ Private methods77.95%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/icon-button-generate.png1.08KB1.25KB0.00%