73% gift4u-gift-cards-all-in-one-for-woo

Code Review | GIFT4U - Gift Cards All in One for Woo

WordPress plugin GIFT4U - Gift Cards All in One for Woo scored73%from 54 tests.

About plugin

  • Plugin page: gift4u-gift-cards...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 28, 2023
  • Latest release: Aug 29, 2023
  • Number of updates: 16
  • Update frequency: every 12.3 days
  • Top authors: thanhtd (87.5%)villatheme (18.75%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /594 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.93ms] Passed 4 tests

Server-side resources used by GIFT4U - Gift Cards All in One for Woo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.71 ▼1.45
Dashboard /wp-admin3.32 ▲0.0144.27 ▼0.81
Posts /wp-admin/edit.php3.43 ▲0.0746.53 ▼1.81
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.66 ▼15.63
Media Library /wp-admin/upload.php3.24 ▲0.0135.91 ▲4.70

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 732 new files
Database: 1 new table, 6 new options
New tables
wp_gift4u_giftcard_coupons
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for GIFT4U - Gift Cards All in One for Woo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9913.38 ▼0.971.86 ▲0.2439.53 ▼2.79
Dashboard /wp-admin2,212 ▲275.79 ▼0.12103.25 ▼6.6839.63 ▼2.32
Posts /wp-admin/edit.php2,098 ▲91.97 ▼0.0838.15 ▼1.0135.43 ▲1.29
Add New Post /wp-admin/post-new.php1,551 ▲3218.30 ▼4.88636.14 ▼17.9561.66 ▲7.20
Media Library /wp-admin/upload.php1,400 ▲94.24 ▼0.00100.28 ▲2.4541.45 ▼2.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_gift4u_giftcard_coupons
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% 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)
Even though everything seems fine, this is not 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
  • 228× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\TypeFilter\\TypeFilter' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/mpdf/mpdf/src/Tag/PageFooter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'tFPDF' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/setasign/fpdi/src/Tfpdf/FpdfTpl.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\SetHtmlPageFooter' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/mpdf/mpdf/src/Tag/SetPageFooter.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/setasign/fpdi/src/PdfParser/Type/PdfToken.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/setasign/fpdi/src/PdfParser/Type/PdfIndirectObject.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\Filter\\Filter' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/mpdf/mpdf/src/Tag/Img.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/mpdf/mpdf/src/Http/Exception/ForbiddenRequestException.php:5
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/gift4u-gift-cards-all-in-one-for-woo/vendor/mpdf/mpdf/src/Writer/FontWriter.php on line 10

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 to be fixed: The official readme.txt might help

gift4u-gift-cards-all-in-one-for-woo/gift4u-gift-cards-all-in-one-for-woo.php 92% from 13 tests

This is the main PHP file of "GIFT4U - Gift Cards All in One for Woo" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 159 characters long)

Code Analysis 95% 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 detected90,256 lines of code in 566 files:
LanguageFilesBlank linesComment linesLines of code
PHP44112,88512,93782,407
SVG2081,991
CSS501681951,626
JavaScript33326551,436
Sass11217441,053
Markdown92950977
JSON1600688
XML310075
Bourne Shell1203

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 7,024)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity54.37
▷ Minimum class complexity1.00
▷ Maximum class complexity7,024.00
Average method complexity12.00
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces55
Interfaces25
Traits6
Classes317
▷ Abstract classes92.84%
▷ Concrete classes30897.16%
▷ Final classes144.55%
Methods1,768
▷ Static methods1739.79%
▷ Public methods1,55888.12%
▷ Protected methods623.51%
▷ Private methods1488.37%
Functions35
▷ Named functions617.14%
▷ Anonymous functions2982.86%
Constants429
▷ Global constants51.17%
▷ Class constants42498.83%
▷ Public constants424100.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
6 PNG files occupy 0.42MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/just-for-you.png103.13KB105.18KB0.00%
assets/img/thank-you.png119.13KB55.84KB▼ 53.13%
assets/img/love.png60.06KB26.44KB▼ 55.97%
assets/img/happy-birthday.png89.13KB40.59KB▼ 54.46%
assets/img/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%