83% gifty-for-woocommerce

Code Review | Gifty for WooCommerce

WordPress plugin Gifty for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: gifty-for-woocomm...
  • Plugin version: 2.0.3
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: Sep 24, 2020
  • Latest release: Dec 1, 2023
  • Number of updates: 14
  • Update frequency: every 83.1 days
  • Top authors: jeroengifty (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /881 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.42ms] Passed 4 tests

This is a short check of server-side resources used by Gifty for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.87 ▼4.01
Dashboard /wp-admin3.31 ▲0.0048.20 ▼4.02
Posts /wp-admin/edit.php3.36 ▲0.0045.57 ▼6.26
Add New Post /wp-admin/post-new.php5.89 ▲0.00111.17 ▲18.80
Media Library /wp-admin/upload.php3.23 ▲0.0036.36 ▲0.60

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 113 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Gifty for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.34 ▼0.001.54 ▼0.0136.83 ▼10.20
Dashboard /wp-admin2,198 ▲245.60 ▼0.0195.71 ▼3.8742.38 ▼3.14
Posts /wp-admin/edit.php2,100 ▼31.96 ▲0.0240.19 ▼3.8836.69 ▼0.53
Add New Post /wp-admin/post-new.php1,526 ▼323.20 ▲0.15685.24 ▲69.3456.67 ▲0.01
Media Library /wp-admin/upload.php1,394 ▼34.17 ▲0.0893.76 ▼14.0141.68 ▼2.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 37× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.16. in wp-content/plugins/gifty-for-woocommerce/vendor/composer/platform_check.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Gifty\\Client\\Services\\AbstractService' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/src/Services/PackageService.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/tests/Services/LocationServiceTest.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit\\Runner\\BeforeTestHook' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/tests/Common/BypassFinalHook.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Gifty\\Client\\Resources\\AbstractResource' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/src/Resources/Package.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/tests/Services/PackageServiceTest.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Gifty\\Client\\HttpClient\\GiftyHttpClientInterface' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/src/HttpClient/GiftyHttpClient.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/tests/Resources/PackageTest.php:14
    • > PHP Parse error
      syntax error, unexpected '|', expecting ';' or '{' in wp-content/plugins/gifty-for-woocommerce/inc/Migration/Migration_1.php on line 120
    • > PHP Fatal error
      Uncaught Error: Class 'Gifty\\Client\\Resources\\AbstractResource' not found in wp-content/plugins/gifty-for-woocommerce/vendor/gifty/gifty-php/src/Resources/Location.php:8

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Contributors: Contributors not specified
  • Contributors: The plugin tags were not defined
You can take inspiration from this readme.txt

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

The main file in "Gifty for WooCommerce" v. 2.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gifty-for-woocommerce.php" instead of "gifty-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin24,197 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
JSON150019,083
PHP721,0412,3033,997
PO File2224380432
Markdown51240365
JavaScript46872225
YAML116056
XML12024
Sass14014
CSS1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.27
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces19
Interfaces9
Traits2
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes3065.22%
Methods359
▷ Static methods246.69%
▷ Public methods31788.30%
▷ Protected methods195.29%
▷ Private methods236.41%
Functions8
▷ Named functions112.50%
▷ Anonymous functions787.50%
Constants13
▷ Global constants00.00%
▷ Class constants13100.00%
▷ Public constants430.77%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin