80% url-coupons-for-woocommerce-by-algoritmika

Code Review | Coupons & Add to Cart by URL Links for WooCommerce

WordPress plugin Coupons & Add to Cart by URL Links for WooCommerce scored80%from 54 tests.

About plugin

  • Plugin page: url-coupons-for-w...
  • Plugin version: 1.6.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Aug 18, 2017
  • Latest release: Sep 24, 2023
  • Number of updates: 66
  • Update frequency: every 33.8 days
  • Top authors: algoritmika (86.36%)wpcodefactory (15.15%)

Code review

54 tests

User reviews

10 reviews

Install metrics

2,000+ active /28,055 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.33ms] Passed 4 tests

This is a short check of server-side resources used by Coupons & Add to Cart by URL Links for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.37 ▼12.50
Dashboard /wp-admin3.31 ▼0.0448.79 ▼21.01
Posts /wp-admin/edit.php3.36 ▲0.0055.99 ▼0.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.62 ▼11.36
Media Library /wp-admin/upload.php3.23 ▲0.0032.46 ▼0.05

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Coupons & Add to Cart by URL Links for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.17 ▼0.181.61 ▼0.3643.77 ▲0.56
Dashboard /wp-admin2,195 ▲185.61 ▲0.0991.22 ▲0.1938.16 ▼3.84
Posts /wp-admin/edit.php2,097 ▼62.01 ▲0.0239.11 ▼0.4834.79 ▼0.15
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▲0.19653.10 ▼10.8865.09 ▲6.69
Media Library /wp-admin/upload.php1,400 ▼04.39 ▲0.1798.59 ▼12.3044.80 ▼3.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: coupons, woocommerce, url coupons, woo commerce

url-coupons-for-woocommerce-by-algoritmika/url-coupons-woocommerce.php 92% from 13 tests

The main PHP file in "Coupons & Add to Cart by URL Links for WooCommerce" ver. 1.6.11 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("url-coupons-for-woocommerce-by-algoritmika.php" instead of "url-coupons-woocommerce.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/url-coupons-for-woocommerce-by-algoritmika/vendor/bin/phpcbf.bat
      • wp-content/plugins/url-coupons-for-woocommerce-by-algoritmika/vendor/bin/phpcs.bat
1,884 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP202568771,720
JSON200134
XML1121422
DOS Batch2008

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity20.09
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods93
▷ Static methods1920.43%
▷ Public methods9197.85%
▷ Protected methods00.00%
▷ Private methods22.15%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants2
▷ Global constants2100.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