77% woo-audio-preview

Code Review | Audio Preview for WooCommerce

WordPress plugin Audio Preview for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: woo-audio-preview
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.0
  • WordPress version: 6.3.1
  • First release: Jan 10, 2017
  • Latest release: Jul 25, 2023
  • Number of updates: 13
  • Update frequency: every 183.4 days
  • Top authors: wbcomdesigns (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,666 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.84ms] Passed 4 tests

This is a short check of server-side resources used by Audio Preview for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.24 ▼5.44
Dashboard /wp-admin3.31 ▲0.0045.94 ▼6.97
Posts /wp-admin/edit.php3.36 ▲0.0053.37 ▼0.13
Add New Post /wp-admin/post-new.php5.89 ▲0.00102.82 ▲15.37
Media Library /wp-admin/upload.php3.23 ▲0.0034.57 ▼6.80
Our Plugins /wp-admin/admin.php?page=wbcom-plugins-page3.0025.03
Support /wp-admin/admin.php?page=wbcom-support-page3.0023.49
Our Themes /wp-admin/admin.php?page=wbcom-themes-page3.0018.90
Welcome /wp-admin/admin.php?page=wbcomplugins3.0022.41
Woo Audio Preview /wp-admin/admin.php?page=woo-audio-preview-settings3.0025.46

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 68 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Audio Preview for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.79 ▲0.491.73 ▼0.5742.97 ▼0.43
Dashboard /wp-admin2,206 ▲185.85 ▲0.93108.81 ▼7.6840.69 ▼1.42
Posts /wp-admin/edit.php2,092 ▼02.03 ▲0.0439.90 ▲2.3632.73 ▼0.63
Add New Post /wp-admin/post-new.php1,533 ▲1423.00 ▼0.16611.04 ▼40.3055.20 ▲0.20
Media Library /wp-admin/upload.php1,385 ▼04.25 ▲0.01106.34 ▲5.3344.60 ▼0.09
Our Plugins /wp-admin/admin.php?page=wbcom-plugins-page280.440.073.84
Support /wp-admin/admin.php?page=wbcom-support-page280.440.114.31
Our Themes /wp-admin/admin.php?page=wbcom-themes-page280.440.194.17
Welcome /wp-admin/admin.php?page=wbcomplugins280.440.084.43
Woo Audio Preview /wp-admin/admin.php?page=woo-audio-preview-settings280.440.093.36

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-audio-preview/admin/wbcom/templates/wbcom-plugins-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-audio-preview/admin/class-admin-review.php:311
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-audio-preview/admin/wbcom/templates/wbcom-license-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-audio-preview/admin/partials/woo-audio-preview-general-pro.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-audio-preview/admin/wbcom/templates/wbcom-support-page.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=wbcom-plugins-page
    • > Network (severe)
    wp-admin/admin.php?page=wbcom-plugins-page - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wbcom-support-page
    • > Network (severe)
    wp-admin/admin.php?page=wbcom-support-page - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wbcom-themes-page
    • > Network (severe)
    wp-admin/admin.php?page=wbcom-themes-page - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wbcomplugins
    • > Network (severe)
    wp-admin/admin.php?page=wbcomplugins - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=woo-audio-preview-settings
    • > Network (severe)
    wp-admin/admin.php?page=woo-audio-preview-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (It is displaying Meta Box Field under specific product post screenshot-1.png), #2 (It is displaying a button and after click on button this will open a player with given audio demo in single product page screenshot-2.png)
You can look at the official readme.txt

woo-audio-preview/woo-product-audio-preview.php 77% from 13 tests

The main file in "Audio Preview for WooCommerce" v. 1.4.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-audio-preview.php" instead of "woo-product-audio-preview.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin9,938 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JSON2006,179
PHP162207741,767
CSS3279531,670
JavaScript52037322

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity16.86
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods5090.91%
▷ Protected methods00.00%
▷ Private methods59.09%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png6.68KB4.79KB▼ 28.39%
admin/wbcom/assets/imgs/logowbcom.png10.12KB3.87KB▼ 61.72%
admin/images/wbcom.png7.01KB3.44KB▼ 50.86%
admin/wbcom/assets/imgs/wbcom-offer-notice.png67.64KB32.40KB▼ 52.11%
Screenshot-2.png5.80KB3.26KB▼ 43.73%