77% before-and-after-product-images-for-woocommerce

Code Review | Before and After Product Images for WooCommerce

WordPress plugin Before and After Product Images for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: before-and-after-...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.5
  • WordPress version: 5.9.2
  • First release: Apr 19, 2018
  • Latest release: Apr 21, 2018
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: nplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 690 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼293.31ms] Passed 4 tests

Server-side resources used by Before and After Product Images for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3559.28 ▲11.44
Dashboard /wp-admin3.71 ▲0.3034.70 ▲1.05
Posts /wp-admin/edit.php3.93 ▲0.3038.34 ▲1.00
Add New Post /wp-admin/post-new.php7.21 ▲0.2297.22 ▼1,172.67
Media Library /wp-admin/upload.php3.66 ▲0.3625.22 ▼2.63
Contact Us /wp-admin/admin.php?page=baapifwc_settings-contact3.6723.11
Upgrade  ➤ /wp-admin/admin.php?page=baapifwc_settings-pricing3.9825.62
Freemius Debug [v.1.2.4] /wp-admin/admin.php?page=freemius3.9225.97

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 213 new files
Database: no new tables, 5 new options
New WordPress options
fs_active_plugins
fs_api_cache
fs_debug_mode
fs_options
fs_accounts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Before and After Product Images for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲8115.94 ▲0.246.09 ▲0.602.41 ▲0.18
Dashboard /wp-admin2,912 ▲516.15 ▼0.02117.20 ▼18.13157.16 ▼4.63
Posts /wp-admin/edit.php2,714 ▲573.25 ▲0.0164.50 ▲1.94140.78 ▲1.29
Add New Post /wp-admin/post-new.php1,722 ▲5520.80 ▲2.74431.56 ▲3.71163.09 ▲7.89
Media Library /wp-admin/upload.php1,721 ▲235.51 ▲0.07137.36 ▲2.50189.27 ▲1.37
Contact Us /wp-admin/admin.php?page=baapifwc_settings-contact1,2253.8767.4079.24
Upgrade  ➤ /wp-admin/admin.php?page=baapifwc_settings-pricing1,2583.8070.3075.28
Freemius Debug [v.1.2.4] /wp-admin/admin.php?page=freemius1,4102.5352.94125.87

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 5 options in the database
    • fs_debug_mode
    • fs_options
    • fs_active_plugins
    • fs_api_cache
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/before-and-after-product-images-for-woocommerce/freemius/templates/ajax-loader.php

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=baapifwc_settings-contact
    • > Network (severe)
    https://wp.freemius.com/contact/?page=baapifwc_settings-contact&plugin_id=1992&plugin_public_key=pk_1c285e5e3840235ec164c1e3bb5da&plugin_version=1.0.3&wp_login_url=http%3A%2F%2Fwp.com%2Fwp-login.php&site_url=http%3A%2F%2Fwp.com#http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dbaapifwc_settings-contact - Failed to load resource: the server responded with a status of 500 ()
    • > GET request to /wp-admin/admin.php?page=baapifwc_settings-pricing
    • > Network (severe)
    https://wp.freemius.com/pricing/?plugin_id=1992&plugin_public_key=pk_1c285e5e3840235ec164c1e3bb5da&plugin_version=1.0.3&home_url=http%3A%2F%2Fwp.com&page=baapifwc_settings-pricing&next=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Ffs_action%3Dbefore-and-after-product-images-for-woocommerce_sync_license%26page%3Dbaapifwc_settings-account&billing_cycle=annual#http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dbaapifwc_settings-pricing - Failed to load resource: the server responded with a status of 500 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: product images, before after, before and after, before and after product images for woocommerce, images

before-and-after-product-images-for-woocommerce/before-and-after-product-images-for-woocommerce.php 77% from 13 tests

The main file in "Before and After Product Images for WooCommerce" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")

Code Analysis 97% from 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 plugin29,840 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
PHP984,55610,81219,051
PO File62,7783,0586,111
Sass244381132,637
JavaScript7208147817
CSS141562716
Markdown3960292
HTML2810129
JSON20051
YAML22028
Ruby16128

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,332)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity44.23
▷ Minimum class complexity1.00
▷ Maximum class complexity1,332.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes47
▷ Abstract classes24.26%
▷ Concrete classes4595.74%
▷ Final classes00.00%
Methods807
▷ Static methods12515.49%
▷ Public methods61175.71%
▷ Protected methods141.73%
▷ Private methods18222.55%
Functions87
▷ Named functions87100.00%
▷ Anonymous functions00.00%
Constants105
▷ Global constants8580.95%
▷ Class constants2019.05%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/price-bands-for-woocommerce.png4.59KB2.45KB▼ 46.59%
public/assets/js/twentytwenty/img/after.png3.12KB0.34KB▼ 89.24%
public/assets/js/twentytwenty/img/before.png3.23KB0.39KB▼ 87.91%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%