77% trinity-audio

Code Review | Trinity Audio - Text to Speech AI audio player to convert content into audio

WordPress plugin Trinity Audio - Text to Speech AI audio player to convert content into audio scored77%from 54 tests.

About plugin

  • Plugin page: trinity-audio
  • Plugin version: 5.7.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Aug 11, 2019
  • Latest release: Nov 28, 2023
  • Number of updates: 263
  • Update frequency: every 6.0 days
  • Top authors: sergiotrinity (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

2,000+ active /88,579 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.70MB] [CPU: ▲503.00ms] 75% from 4 tests

Analyzing server-side resources used by Trinity Audio - Text to Speech AI audio player to convert content into audio
Please take the time to fix the following items
  • Extra CPU: The extra CPU usage should be kept under 200.00ms (currently 503.00ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5446.38 ▲1.91
Dashboard /wp-admin4.07 ▲0.76733.98 ▲682.52
Posts /wp-admin/edit.php4.12 ▲0.76721.41 ▲667.29
Add New Post /wp-admin/post-new.php6.61 ▲0.72771.63 ▲674.84
Media Library /wp-admin/upload.php4.05 ▲0.81701.86 ▲667.94

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 23 new options
New WordPress options
trinity_audio_allow_shortcodes
trinity_audio_first_changes_save
trinity_audio_gender_id
theysaidso_admin_options
widget_recent-posts
db_upgraded
trinity_audio_preconnect
trinity_audio_installkey
trinity_audio_poweredby
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Trinity Audio - Text to Speech AI audio player to convert content into audio
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲12813.58 ▼1.132.18 ▲0.5042.60 ▼3.16
Dashboard /wp-admin2,258 ▲845.85 ▲0.2398.98 ▼0.5381.60 ▲35.36
Posts /wp-admin/edit.php2,168 ▲682.33 ▲0.3739.53 ▲0.2537.12 ▼0.55
Add New Post /wp-admin/post-new.php1,595 ▲6923.64 ▲0.40605.07 ▼71.22158.10 ▲103.59
Media Library /wp-admin/upload.php1,460 ▲604.40 ▲0.26107.32 ▲11.9985.29 ▲45.31

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 11 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • trinity_audio_check_for_loop
    • widget_recent-comments
    • trinity_audio_viewkey
    • db_upgraded
    • theysaidso_admin_options
    • trinity_audio_preconnect
    • widget_theysaidso_widget
    • trinity_audio_installkey
    • ...

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/trinity-audio/admin/inc/logs.php
    • > /wp-content/plugins/trinity-audio/admin/inc/phpinfo.php
  • 40× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/trinity-audio/inc/common.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/trinity-audio/inc/post-hashes-cron.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/trinity-audio/inc/constants.php:17
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/trinity-audio/inc/common.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trinity_get_install_key() in wp-content/plugins/trinity-audio/migrations/inc/2022-06-21-21-00.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/trinity-audio/admin/index.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/trinity-audio/inc/text.php:80
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/trinity-audio/inc/constants.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/trinity-audio/inc/common.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trinity_should_migrate_for() in wp-content/plugins/trinity-audio/migrations/inc/2020-03-30-19-00.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Contributors: The plugin contributors field is missing
The official readme.txt is a good inspiration

trinity-audio/trinity.php 85% from 13 tests

The main file in "Trinity Audio - Text to Speech AI audio player to convert content into audio" v. 5.7.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 396 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("trinity-audio.php" instead of "trinity.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin6,890 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,1095174,906
CSS14211,389
JavaScript413013552
SVG70142
Markdown1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity129.67
▷ Minimum class complexity1.00
▷ Maximum class complexity250.00
Average method complexity5.29
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods90
▷ Static methods11.11%
▷ Public methods7583.33%
▷ Protected methods1516.67%
▷ Private methods00.00%
Functions196
▷ Named functions18594.39%
▷ Anonymous functions115.61%
Constants129
▷ Global constants3124.03%
▷ Class constants9875.97%
▷ Public constants98100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner-review-background.png116.36KB55.61KB▼ 52.21%