78% giveaways-for-woocommerce

Code Review | Giveaways for woocommerce

WordPress plugin Giveaways for woocommerce scored 78% from 54 tests.

About plugin

  • Plugin page: giveaways-for-woo...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6.35+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.8
  • WordPress version: 5.9.2
  • First release: Sep 27, 2018
  • Latest release: Sep 28, 2018
  • Number of updates: 15
  • Update frequency: every 0.1 days
  • Top authors: sindyakinsergei (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 421 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: ▲3.49MB] [CPU: ▼276.84ms] Passed 4 tests

This is a short check of server-side resources used by Giveaways for woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /7.32 ▲3.8071.28 ▲22.19
Dashboard /wp-admin7.34 ▲3.9353.19 ▲19.31
Posts /wp-admin/edit.php7.34 ▲3.6953.92 ▲15.09
Add New Post /wp-admin/post-new.php9.52 ▲2.55106.68 ▼1,161.89
Media Library /wp-admin/upload.php7.34 ▲4.0443.58 ▲20.13
Freemius Debug [v.2.1.1] /wp-admin/admin.php?page=freemius7.3438.44

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 234 new files
Database: no new tables, 5 new options
New WordPress options
fs_debug_mode
fs_accounts
fs_gdpr
fs_api_cache
fs_active_plugins

Browser metrics Passed 4 tests

This is an overview of browser requirements for Giveaways for woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,828 ▲8415.62 ▼0.066.09 ▼0.212.34 ▲0.07
Dashboard /wp-admin2,922 ▲646.13 ▼0.06119.06 ▼18.83173.20 ▲5.92
Posts /wp-admin/edit.php2,735 ▲443.24 ▼0.0165.12 ▼0.10158.20 ▲15.64
Add New Post /wp-admin/post-new.php1,793 ▲13223.51 ▲7.39419.05 ▼7.52168.66 ▲12.49
Media Library /wp-admin/upload.php1,742 ▲475.50 ▼0.04155.70 ▼4.55212.82 ▲22.07
Freemius Debug [v.2.1.1] /wp-admin/admin.php?page=freemius1,4592.4655.09131.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 5 options
    • fs_active_plugins
    • fs_gdpr
    • fs_debug_mode
    • fs_accounts
    • fs_api_cache

Smoke tests 50% from 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 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 fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/giveaways-for-woocommerce/freemius/templates/ajax-loader.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/partials/network-activation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/giveaways-for-woocommerce/freemius/templates/account/partials/addon.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
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
5 plugin tags: woocommerce, coupon, giveaways, filter, purchases

giveaways-for-woocommerce/giveaways-for-woocommerce.php 92% from 13 tests

"Giveaways for woocommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0.0" instead of "3.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected44,533 lines of code in 189 files:
LanguageFilesBlank linesComment linesLines of code
PHP1216,72414,71528,894
PO File94,2164,9449,156
Sass335471153,720
JavaScript93526682,426
Markdown1610192
CSS15213118
JSON10027

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,224)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity56.11
▷ Minimum class complexity1.00
▷ Maximum class complexity2,224.00
Average method complexity4.13
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes63
▷ Abstract classes23.17%
▷ Concrete classes6196.83%
▷ Final classes00.00%
Methods1,141
▷ Static methods22920.07%
▷ Public methods82572.30%
▷ Protected methods151.31%
▷ Private methods30126.38%
Functions93
▷ Named functions93100.00%
▷ Anonymous functions00.00%
Constants118
▷ Global constants9681.36%
▷ Class constants2218.64%
▷ Public constants22100.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
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wc-dispatch-of-coupons-notices-user.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/giveaways-for-woocommerce.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/wc-dispatch-of-coupons-notices-users.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%