78% woo-advanced-product-information

Code Review | Advanced Product Information for WooCommerce

WordPress plugin Advanced Product Information for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-advanced-prod...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 28, 2018
  • Latest release: Aug 11, 2023
  • Number of updates: 38
  • Update frequency: every 53.3 days
  • Top authors: kimvt1991 (84.21%)mrt3vn (15.79%)thanhtd (5.26%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active /6,173 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.38MB] [CPU: ▲1.62ms] 75% from 4 tests

This is a short check of server-side resources used by Advanced Product Information for WooCommerce
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 508.11ms on /wp-admin/admin.php?page=woo-advanced-product-information-extensions)
PageMemory (MB)CPU Time (ms)
Home /4.81 ▲1.3435.69 ▼4.12
Dashboard /wp-admin4.75 ▲1.4165.51 ▼1.02
Posts /wp-admin/edit.php4.81 ▲1.4463.71 ▲15.65
Add New Post /wp-admin/post-new.php7.27 ▲1.38101.76 ▼4.04
Media Library /wp-admin/upload.php4.62 ▲1.3850.73 ▲15.77
Extensions /wp-admin/admin.php?page=woo-advanced-product-information-extensions4.86508.11
WC Product Information /wp-admin/admin.php?page=woo-advanced-product-information4.5849.64

Server storage [IO: ▲2.21MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 87 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
woo-advanced-product-information_start_use
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-comments
_wapi_settings

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Product Information for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,500 ▼26114.04 ▼0.320.66 ▼1.0823.45 ▼19.33
Dashboard /wp-admin2,238 ▲615.54 ▼0.1588.66 ▼8.2040.78 ▲0.29
Posts /wp-admin/edit.php2,146 ▲462.01 ▲0.0437.44 ▼6.1534.57 ▼3.63
Add New Post /wp-admin/post-new.php1,561 ▲3323.43 ▲0.34669.10 ▼10.2372.21 ▲5.58
Media Library /wp-admin/upload.php1,437 ▲374.19 ▼0.07100.52 ▼10.8444.07 ▼4.35
Extensions /wp-admin/admin.php?page=woo-advanced-product-information-extensions1,7602.1728.2572.30
WC Product Information /wp-admin/admin.php?page=woo-advanced-product-information4,5613.0494.1938.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • woo-advanced-product-information_start_use
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • _wapi_settings
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=woo-advanced-product-information
    • > Error in wp-content/plugins/woo-advanced-product-information/admin/settings.php+1844
    Uncaught Error: Class 'WC_Payment_Gateways' not found in wp-content/plugins/woo-advanced-product-information/admin/settings.php:1844
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): WC_ADVANCED_PRODUCT_INFORMATION_Admin_Settings::settings_page()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=woo-advanced-product-information
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).iris is not a function" "TypeError: jQuery(...).iris is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/woo-advanced-product-information/js/admin-javascript.js?ver=1.1.0:179:29)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=woo-advanced-product-information
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).iris is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
7 plugin tags: triggers, rank of product, rank of category, sales, sales countdown...

woo-advanced-product-information/woo-advanced-product-information.php Passed 13 tests

The principal PHP file in "Advanced Product Information for WooCommerce" v. 1.1.0 is loaded by WordPress automatically on each request
75 characters long description:
More attractive information of products to make customers eager to buy them

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected16,870 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
PHP223792457,159
JavaScript91,2053075,574
SVG2032,636
CSS322851141,461
Sass36040

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 442)
Cyclomatic complexity
Average complexity per logical line of code0.75
Average class complexity66.00
▷ Minimum class complexity4.00
▷ Maximum class complexity641.00
Average method complexity13.41
▷ Minimum method complexity1.00
▷ Maximum method complexity442.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods110
▷ Static methods98.18%
▷ Public methods10595.45%
▷ Protected methods32.73%
▷ Private methods21.82%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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