10% create-sasnys-gift-voucher

Code Review | Create Sasnys Gift Voucher

WordPress plugin Create Sasnys Gift Voucher scored10%from 54 tests.

About plugin

  • Plugin page: create-sasnys-gif...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.4
  • WordPress version: 6.3.1
  • First release: Jun 28, 2019
  • Latest release: Jan 8, 2020
  • Number of updates: 38
  • Update frequency: every 5.2 days
  • Top authors: serrobert (97.37%)Otto42 (5.26%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,045 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/create-sasnys-gift-voucher/create-sasnys-gift-voucher.php+32
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.70ms] Passed 4 tests

This is a short check of server-side resources used by Create Sasnys Gift Voucher
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.45 ▼39.66
Dashboard /wp-admin2.05 ▼1.265.50 ▼46.20
Posts /wp-admin/edit.php2.05 ▼1.315.51 ▼45.67
Add New Post /wp-admin/post-new.php2.05 ▼3.845.56 ▼87.25
Media Library /wp-admin/upload.php2.05 ▼1.185.61 ▼34.41

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

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

Browser metrics Passed 4 tests

Create Sasnys Gift Voucher: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10114.25 ▼0.122.15 ▲0.1639.24 ▼6.24
Dashboard /wp-admin2,220 ▲435.71 ▲0.1889.16 ▼6.4843.32 ▼3.66
Posts /wp-admin/edit.php2,131 ▲311.96 ▼0.0339.45 ▲0.0840.01 ▲4.56
Add New Post /wp-admin/post-new.php1,397 ▼13120.66 ▼2.41605.77 ▼89.9554.87 ▲3.03
Media Library /wp-admin/upload.php1,419 ▲164.15 ▲0.0196.07 ▼6.4942.84 ▼3.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/create-sasnys-gift-voucher/create-sasnys-gift-voucher.php+32
    define(): Declaration of case-insensitive constants is deprecated
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

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
Good news, no errors were detected

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
  • 245× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/phenx/php-font-lib/src/FontLib/Table/Table.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/dompdf/dompdf/lib/php-svg-lib/src/Svg/Tag/Path.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\Table\\Table' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/dompdf/dompdf/lib/php-font-lib/src/FontLib/Table/Type/hhea.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Svg\\Surface\\SurfaceInterface' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/dompdf/dompdf/lib/php-svg-lib/src/Svg/Surface/SurfaceCpdf.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Group' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/phenx/php-svg-lib/src/Svg/Tag/Anchor.php:11
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'schweikert\\CSS\\Value\\Value' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/dompdf/dompdf/lib/php-css-parser/lib/Sabberworm/CSS/Value/ValueList.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/dompdf/dompdf/src/FrameReflower/Text.php:21
    • > PHP Notice
      Undefined variable: fontDir in wp-content/plugins/create-sasnys-gift-voucher/bin/vendor/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.php on line 57

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires php: Version not formatted correctly
You can take inspiration from this readme.txt

create-sasnys-gift-voucher/create-sasnys-gift-voucher.php Passed 13 tests

This is the main PHP file of "Create Sasnys Gift Voucher" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
47 characters long description:
Creates a Gift voucher with a PayPal CONNECTION

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin45,985 lines of code in 288 files:
LanguageFilesBlank linesComment linesLines of code
PHP2198,66215,44339,087
PO File71,1201,2672,338
SVG3001,644
Markdown62550909
CSS3215460846
JSON910439
JavaScript18319439
XML632201
YAML416365
HTML10017

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 652)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity30.66
▷ Minimum class complexity1.00
▷ Maximum class complexity765.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity652.00
Code structure
Namespaces35
Interfaces6
Traits0
Classes254
▷ Abstract classes145.51%
▷ Concrete classes24094.49%
▷ Final classes10.42%
Methods2,519
▷ Static methods1084.29%
▷ Public methods2,15585.55%
▷ Protected methods25410.08%
▷ Private methods1104.37%
Functions70
▷ Named functions5071.43%
▷ Anonymous functions2028.57%
Constants234
▷ Global constants125.13%
▷ Class constants22294.87%
▷ Public constants222100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.50MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/paypal1.png33.67KB13.39KB▼ 60.24%
img/GiftVoucher1s.png8.79KB3.49KB▼ 60.31%
img/GiftVoucher2.png98.97KB47.93KB▼ 51.57%
img/PayPal2.png44.99KB17.22KB▼ 61.72%
img/kingston.png27.15KB12.22KB▼ 55.00%