84% wpc-free-gift-coupons

Code Review | WPC Free Gift Coupons for WooCommerce

WordPress plugin WPC Free Gift Coupons for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wpc-free-gift-cou...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 8, 2022
  • Latest release: Oct 2, 2023
  • Number of updates: 11
  • Update frequency: every 27.1 days
  • Top authors: wpclever (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,075 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.10ms] Passed 4 tests

Analyzing server-side resources used by WPC Free Gift Coupons for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0744.91 ▲3.79
Dashboard /wp-admin3.37 ▲0.0749.32 ▼1.02
Posts /wp-admin/edit.php3.49 ▲0.1349.81 ▼8.02
Add New Post /wp-admin/post-new.php5.98 ▲0.0984.34 ▼10.73
Media Library /wp-admin/upload.php3.30 ▲0.0736.86 ▼0.63
Essential Kit /wp-admin/admin.php?page=wpclever-kit3.2627.83
About /wp-admin/admin.php?page=wpclever3.2633.49

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WPC Free Gift Coupons for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10514.34 ▼0.191.60 ▼0.0542.54 ▼1.90
Dashboard /wp-admin2,260 ▲805.66 ▲0.0392.37 ▲3.0875.70 ▲29.60
Posts /wp-admin/edit.php2,178 ▲751.98 ▲0.0440.84 ▲4.5536.58 ▼2.92
Add New Post /wp-admin/post-new.php1,600 ▲7422.93 ▲0.01710.27 ▲57.9355.44 ▲8.19
Media Library /wp-admin/upload.php1,480 ▲804.26 ▲0.09101.89 ▼9.3181.59 ▲36.37
Essential Kit /wp-admin/admin.php?page=wpclever-kit5,7442.1238.4856.12
About /wp-admin/admin.php?page=wpclever1,3782.2433.1437.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpc-free-gift-coupons/includes/class-backend.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpc-free-gift-coupons/wpc-free-gift-coupons.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpc-free-gift-coupons/includes/class-frontend.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpc-free-gift-coupons/includes/class-helper.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed: The official readme.txt might help

wpc-free-gift-coupons/wpc-free-gift-coupons.php Passed 13 tests

The main PHP script in "WPC Free Gift Coupons for WooCommerce" version 1.0.6 is automatically included on every request by WordPress
122 characters long description:
WPC Free Gift Coupons for WooCommerce offers a new way to give away free gifts to customers during special sale occasions.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,471 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP717587954
CSS2756402
JavaScript312286
SVG10029

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity20.43
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods56
▷ Static methods610.71%
▷ Public methods5598.21%
▷ Protected methods00.00%
▷ Private methods11.79%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
PNG images were not found in this plugin