10% grs-lnd-for-wp

Code Review | GRS LND For WP

WordPress plugin GRS LND For WP scored10%from 54 tests.

About plugin

  • Plugin page: grs-lnd-for-wp
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.1.1
  • WordPress version: 6.3.1
  • First release: Jan 15, 2020
  • Latest release: Jan 15, 2020
  • Number of updates: 6
  • Update frequency: every 25.8 days
  • Top authors: groestlcoin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /424 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/grs-lnd-for-wp/classes/qrdecoder/lib/qrcode/decoder/DecodedBitStreamParser.php+286
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲0.50MB] [CPU: ▼0.01ms] Passed 4 tests

A check of server-side resources used by GRS LND For WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5337.78 ▼1.97
Dashboard /wp-admin3.83 ▲0.5249.91 ▲1.31
Posts /wp-admin/edit.php3.88 ▲0.5250.13 ▼0.99
Add New Post /wp-admin/post-new.php6.36 ▲0.4890.64 ▲1.62
Media Library /wp-admin/upload.php3.69 ▲0.4637.00 ▲3.59

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 519 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

GRS LND For WP: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲18913.65 ▼0.935.62 ▲3.8540.42 ▼4.58
Dashboard /wp-admin2,215 ▲275.85 ▲0.81105.48 ▲6.5791.60 ▲54.78
Posts /wp-admin/edit.php2,113 ▲212.03 ▲0.0339.14 ▲0.9034.30 ▲1.94
Add New Post /wp-admin/post-new.php1,388 ▼14016.61 ▼1.79661.58 ▲16.0051.77 ▼10.50
Media Library /wp-admin/upload.php1,412 ▲274.11 ▼0.10107.09 ▲2.5484.41 ▲38.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/grs-lnd-for-wp/public/partials/lnd-for-wp-request-invoice-ajax.php
    • > /wp-content/plugins/grs-lnd-for-wp/classes/phpqrcode/index.php
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/grs-lnd-for-wp/admin/partials/lnd-for-wp-admin-unreachable.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\LuminanceSource' not found in wp-content/plugins/grs-lnd-for-wp/classes/qrdecoder/lib/IMagickLuminanceSource.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\ReaderException' not found in wp-content/plugins/grs-lnd-for-wp/classes/qrdecoder/lib/FormatException.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\LuminanceSource' not found in wp-content/plugins/grs-lnd-for-wp/classes/qrdecoder/lib/PlanarYUVLuminanceSource.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\Common\\Reedsolomon\\GenericGFPoly' not found in wp-content/plugins/grs-lnd-for-wp/classes/qrdecoder/lib/common/reedsolomon/GenericGF.php:94
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\ResultPoint' not found in wp-content/plugins/grs-lnd-for-wp/classes/qrdecoder/lib/qrcode/detector/AlignmentPattern.php:28
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/grs-lnd-for-wp/admin/partials/lnd-for-wp-admin-peers.php on line 185
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/grs-lnd-for-wp/admin/partials/lnd-for-wp-admin-wallet.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\ResultPoint' not found in wp-content/plugins/grs-lnd-for-wp/classes/qrdecoder/lib/qrcode/detector/FinderPattern.php:29
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/grs-lnd-for-wp/admin/partials/lnd-for-wp-admin-display.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Responsive layout adapts for desktop, tablet and mobile.), #2 (Manage Channels), #3 (View Transaction History), #4 (Mobile Wallet)
The official readme.txt might help

grs-lnd-for-wp/lnd-for-wp.php 92% from 13 tests

The main PHP file in "GRS LND For WP" ver. 0.1.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("grs-lnd-for-wp.php" instead of "lnd-for-wp.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/grs-lnd-for-wp/classes/phpqrcode/tools/merge.bat
14,324 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
PHP923,2665,46313,490
CSS2879598
JavaScript27939205
Markdown111027
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity22.20
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces9
Interfaces1
Traits0
Classes99
▷ Abstract classes55.05%
▷ Concrete classes9494.95%
▷ Final classes4143.62%
Methods817
▷ Static methods17921.91%
▷ Public methods64779.19%
▷ Protected methods10813.22%
▷ Private methods627.59%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants98
▷ Global constants98100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
43 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
classes/phpqrcode/cache/frame_31.png0.25KB0.24KB▼ 6.54%
classes/phpqrcode/cache/frame_24.png0.24KB0.23KB▼ 4.55%
classes/phpqrcode/cache/frame_39.png0.26KB0.23KB▼ 9.85%
classes/phpqrcode/cache/frame_5.png0.15KB0.14KB▼ 1.33%
classes/phpqrcode/cache/frame_1.png0.12KB0.12KB▼ 1.59%