10% loylap-gift-cards

Code Review | LoyLap Gift Cards

WordPress plugin LoyLap Gift Cards scored10%from 54 tests.

About plugin

  • Plugin page: loylap-gift-cards
  • Plugin version: 1.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.5.3
  • WordPress version: 6.3.1
  • First release: May 25, 2019
  • Latest release: Jan 6, 2021
  • Number of updates: 23
  • Update frequency: every 25.8 days
  • Top authors: loylap (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,156 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/loylap-gift-cards/Loylap.php+28
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.93MB] [CPU: ▼53.21ms] Passed 4 tests

This is a short check of server-side resources used by LoyLap Gift Cards
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.408.00 ▼31.60
Dashboard /wp-admin2.08 ▼1.236.92 ▼45.04
Posts /wp-admin/edit.php2.08 ▼1.286.29 ▼43.92
Add New Post /wp-admin/post-new.php2.08 ▼3.815.52 ▼91.87
Media Library /wp-admin/upload.php2.08 ▼1.155.56 ▼32.00

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 598 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for LoyLap Gift Cards
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲22414.75 ▲0.121.49 ▼0.1639.76 ▼4.27
Dashboard /wp-admin2,365 ▲1746.55 ▲1.64125.41 ▲23.9539.64 ▼4.72
Posts /wp-admin/edit.php2,271 ▲1793.35 ▲1.2148.06 ▲8.6331.21 ▼4.61
Add New Post /wp-admin/post-new.php1,533 ▼023.57 ▲0.51602.29 ▼65.3534.76 ▼19.08
Media Library /wp-admin/upload.php1,410 ▲224.19 ▼0.0381.73 ▼25.3142.28 ▼2.49

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/loylap-gift-cards/Loylap.php+28
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 405× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'LOYLAP_PLUGIN_PATHinc/IField.php' (include_path='.:/usr/share/php') in wp-content/plugins/loylap-gift-cards/inc/options/fields/floating_button_image.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'ProxyManager\\ProxyGenerator\\ProxyGeneratorInterface' not found in wp-content/plugins/loylap-gift-cards/vendor/ocramius/proxy-manager/src/ProxyManager/ProxyGenerator/NullObjectGenerator.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/loylap-gift-cards/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/Inflector/Util/ParameterEncoderTest.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Code\\Reflection\\ReflectionInterface' not found in wp-content/plugins/loylap-gift-cards/vendor/zendframework/zend-code/src/Reflection/ParameterReflection.php:14
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/loylap-gift-cards/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php on line 272
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/loylap-gift-cards/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/ProxyGenerator/AccessInterceptor/MethodGenerator/SetMethodSuffixInterceptorTest.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'ProxyManager\\Signature\\ClassSignatureGeneratorInterface' not found in wp-content/plugins/loylap-gift-cards/vendor/ocramius/proxy-manager/src/ProxyManager/Signature/ClassSignatureGenerator.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'ProxyManager\\Proxy\\ProxyInterface' not found in wp-content/plugins/loylap-gift-cards/vendor/ocramius/proxy-manager/src/ProxyManager/Proxy/SmartReferenceInterface.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/loylap-gift-cards/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingGhost/MethodGenerator/GetProxyInitializerTest.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\Code\\Generator\\DocBlock\\Tag\\GenericTag' not found in wp-content/plugins/loylap-gift-cards/vendor/zendframework/zend-code/src/Generator/DocBlock/Tag.php:18

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

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3 in loylap-gift-cards/assets to your readme.txt
  • Donate link: Invalid url: "--"
You can take inspiration from this readme.txt

loylap-gift-cards/Loylap.php 77% from 13 tests

The principal PHP file in "LoyLap Gift Cards" v. 1.5.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Domain Path: The domain path folder was not found ("/languages")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Name the main plugin file the same as the plugin slug ("loylap-gift-cards.php" instead of "Loylap.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/loylap-gift-cards/vendor/bin/sentry.bat
29,393 lines of code in 566 files:
LanguageFilesBlank linesComment linesLines of code
PHP4995,77316,20223,222
Markdown2884402,484
HTML1343001,851
CSS313549639
JSON700477
SVG1215329
YAML490151
JavaScript33124126
XML43178
Bourne Shell23117
make16015
DOS Batch1004

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.02
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces91
Interfaces49
Traits3
Classes392
▷ Abstract classes143.57%
▷ Concrete classes37896.43%
▷ Final classes112.91%
Methods1,625
▷ Static methods1177.20%
▷ Public methods1,45989.78%
▷ Protected methods1167.14%
▷ Private methods503.08%
Functions94
▷ Named functions11.06%
▷ Anonymous functions9398.94%
Constants79
▷ Global constants78.86%
▷ Class constants7291.14%
▷ Public constants72100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
17 PNG files occupy 0.38MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/003-arrow.png4.93KB2.65KB▼ 46.26%
assets/images/loylapFulltext_green.png19.53KB5.37KB▼ 72.51%
assets/images/loylap_icon_green.png123.22KB44.67KB▼ 63.75%
assets/images/loylapFulltext.png19.53KB5.37KB▼ 72.51%
vendor/ocramius/proxy-manager/html-docs/img/enf.png3.65KB3.65KB0.00%