78% insert-image-alt-text

Code Review | Insert Image Alt Text

WordPress plugin Insert Image Alt Text scored78%from 54 tests.

About plugin

  • Plugin page: insert-image-alt-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 6.3.1
  • First release: Jul 12, 2019
  • Latest release: Jul 13, 2019
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: ramjon27 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /996 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.06MB] [CPU: ▼5.27ms] Passed 4 tests

Analyzing server-side resources used by Insert Image Alt Text
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.75 ▼3.92
Dashboard /wp-admin3.36 ▲0.0648.71 ▼0.12
Posts /wp-admin/edit.php3.48 ▲0.1247.25 ▼2.14
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.41 ▼14.91
Media Library /wp-admin/upload.php3.29 ▲0.0535.37 ▲0.47

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Insert Image Alt Text
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲19413.88 ▼0.748.39 ▲6.7343.73 ▼3.34
Dashboard /wp-admin2,225 ▲374.88 ▲0.04103.85 ▼4.5441.35 ▼2.17
Posts /wp-admin/edit.php2,105 ▲162.03 ▲0.0335.96 ▼6.3731.69 ▼4.09
Add New Post /wp-admin/post-new.php1,550 ▲1423.27 ▲0.03649.49 ▲2.9252.17 ▼6.65
Media Library /wp-admin/upload.php1,401 ▲134.21 ▲0.0397.31 ▲0.9343.59 ▲1.73

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/insert-image-alt-text/public/partials/insert-image-alt-text-public-display.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/insert-image-alt-text/admin/partials/insert-image-alt-text-admin-function.php:5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/insert-image-alt-text/admin/partials/insert-image-alt-text-admin-function.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/insert-image-alt-text/admin/partials/insert-image-alt-text-admin-display.php:22
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/insert-image-alt-text/admin/partials/insert-image-alt-text-admin-display.php on line 20
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/insert-image-alt-text/admin/partials/insert-image-alt-text-admin-display.php on line 21
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/insert-image-alt-text/admin/partials/insert-image-alt-text-admin-function.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === insert-image-alt-text === )
The official readme.txt is a good inspiration

insert-image-alt-text/insert-image-alt-text.php Passed 13 tests

The main PHP script in "Insert Image Alt Text" version 1.0.0 is automatically included on every request by WordPress
137 characters long description:
Tired of inserting alternative text in all images in your WordPress media? Insert Image Alt Text will automatically add alt text on them.

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
There were no executable files found in this plugin352 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13128558289
CSS27838
JavaScript285425

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.29
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.32
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected