90% product-advertisement

Code Review | Woocommerce Product Advertisement

WordPress plugin Woocommerce Product Advertisement scored90%from 54 tests.

About plugin

  • Plugin page: product-advertise...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9
  • WordPress version: 6.3.1
  • First release: Aug 21, 2017
  • Latest release: Feb 21, 2018
  • Number of updates: 20
  • Update frequency: every 9.3 days
  • Top authors: hittechmarket (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /4,056 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼13.04ms] Passed 4 tests

A check of server-side resources used by Woocommerce Product Advertisement
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.73 ▼2.45
Dashboard /wp-admin3.36 ▲0.0146.30 ▼19.03
Posts /wp-admin/edit.php3.41 ▲0.0551.26 ▼4.66
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.09 ▼25.47
Media Library /wp-admin/upload.php3.28 ▲0.0539.29 ▼2.99

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woocommerce Product Advertisement
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.24 ▼0.931.66 ▼0.4840.91 ▲1.93
Dashboard /wp-admin2,221 ▲184.85 ▼0.04107.66 ▼3.5443.13 ▼0.55
Posts /wp-admin/edit.php2,100 ▼32.02 ▼0.0439.37 ▼2.0634.92 ▼0.04
Add New Post /wp-admin/post-new.php1,545 ▲623.33 ▲5.31678.01 ▲24.7858.14 ▲0.90
Media Library /wp-admin/upload.php1,400 ▼04.29 ▲0.05102.49 ▲4.4846.61 ▲0.10

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: advertisement, upsale, product, woocommerce, ads

product-advertisement/hit-product-ads.php 92% from 13 tests

This is the main PHP file of "Woocommerce Product Advertisement" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("product-advertisement.php" instead of "hit-product-ads.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin922 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP714422922

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin