93% album-products-for-woocommerce

Code Review | Albums WooCommerce Plugin

WordPress plugin Albums WooCommerce Plugin scored 93% from 54 tests.

About plugin

  • Plugin page: album-products-fo...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.0
  • WordPress version: 5.8.1
  • First release: Feb 4, 2019
  • Latest release: Feb 6, 2019
  • Number of updates: 4
  • Update frequency: every 5.5 days
  • Top authors: prosvit (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 883 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Albums WooCommerce Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1236.57 ▲11.92
Dashboard /wp-admin3.07 ▲0.0151.38 ▼5.35
Posts /wp-admin/edit.php3.12 ▲0.0146.36 ▼6.63
Add New Post /wp-admin/post-new.php5.42 ▼0.0197.04 ▼573.38
Media Library /wp-admin/upload.php3.01 ▲0.0127.76 ▼8.66

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Albums WooCommerce Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲11715.93 ▲0.3113.59 ▲3.9152.27 ▲0.75
Dashboard /wp-admin2,980 ▲465.92 ▼0.02154.53 ▼4.25121.47 ▼0.90
Posts /wp-admin/edit.php2,749 ▲102.72 ▲0.0169.56 ▼1.64101.96 ▲3.96
Add New Post /wp-admin/post-new.php1,690 ▲718.56 ▼0.19409.88 ▲3.47116.81 ▲0.38
Media Library /wp-admin/upload.php1,820 ▲725.03 ▲0.00160.44 ▲8.70128.86 ▲6.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php:12
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php on line 9
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php on line 10
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php on line 9
    • > PHP Notice
      Undefined variable: variation in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php on line 9
    • > PHP Notice
      Undefined variable: variation in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php on line 10
    • > PHP Notice
      Undefined variable: variation in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php on line 10
    • > PHP Notice
      Undefined variable: variation in wp-content/plugins/album-products-for-woocommerce/includes/admin/templates/html-admin-album-variable.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/album-products-for-woocommerce/templates/checkout/download_album.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/album-products-for-woocommerce/includes/core/class-widget.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Contributors: Plugin contributors field is missing
Please take inspiration from this readme.txt

album-products-for-woocommerce/album-products.php 85% from 13 tests

The main PHP file in "Albums WooCommerce Plugin" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • 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 ("album-products-for-woocommerce.php" instead of "album-products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,755 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP125692391,364
CSS210190
JavaScript2561141
SVG20060

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.22
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods74
▷ Static methods00.00%
▷ Public methods7195.95%
▷ Protected methods00.00%
▷ Private methods34.05%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected