79% hm-wc-product-advertiser

Code Review | Product Advertiser for WooCommerce

WordPress plugin Product Advertiser for WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: hm-wc-product-adv...
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.6
  • WordPress version: 6.3.1
  • First release: Aug 22, 2019
  • Latest release: Jan 12, 2021
  • Number of updates: 17
  • Update frequency: every 29.9 days
  • Top authors: mhmrajib (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /824 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼10.93ms] Passed 4 tests

A check of server-side resources used by Product Advertiser for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0740.69 ▼0.62
Dashboard /wp-admin3.38 ▲0.0349.34 ▼17.58
Posts /wp-admin/edit.php3.49 ▲0.1351.03 ▼0.81
Add New Post /wp-admin/post-new.php5.96 ▲0.0787.92 ▼24.69
Media Library /wp-admin/upload.php3.30 ▲0.0640.26 ▲4.22

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Product Advertiser for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲15513.81 ▼0.198.65 ▲6.8440.16 ▼1.99
Dashboard /wp-admin2,211 ▲375.62 ▼0.0293.70 ▲2.5942.51 ▲0.02
Posts /wp-admin/edit.php2,116 ▲162.02 ▲0.0140.00 ▲1.6638.77 ▲4.56
Add New Post /wp-admin/post-new.php1,539 ▲817.65 ▼5.68676.95 ▲30.0560.77 ▲2.87
Media Library /wp-admin/upload.php1,419 ▲194.26 ▲0.0099.12 ▼14.0441.46 ▼6.08

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 did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/hm-wc-product-advertiser/front/view/hmwpa-front-view.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant HMWPA_ASSETS - assumed 'HMWPA_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/hm-wc-product-advertiser/front/view/hmwpa-front-view.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function stripslashes_deep() in wp-content/plugins/hm-wc-product-advertiser/admin/view/hmwpa-settings.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: ajax, woo-commerce, woocommerce, advertise, products

hm-wc-product-advertiser/hm-wc-product-advertiser.php Passed 13 tests

Analyzing the main PHP file in "Product Advertiser for WooCommerce" version 1.1
99 characters long description:
This plugin will display product randomly at the bottom right corner when scroll down your browser.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin581 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP84741372
CSS2354158
JavaScript2132351

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.25
▷ Minimum class complexity3.00
▷ Maximum class complexity18.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods1979.17%
▷ Protected methods28.33%
▷ Private methods312.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/close.png1.58KB1.50KB▼ 5.19%
assets/img/close_16.png4.40KB1.54KB▼ 65.07%
assets/img/loading.png5.14KB0.63KB▼ 87.75%
assets/img/wp-default.png8.01KB9.77KB0.00%