10% lnd-for-wp

Code Review | LND For WP

WordPress plugin LND For WP scored10%from 54 tests.

About plugin

  • Plugin page: 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: Mar 13, 2019
  • Latest release: Mar 17, 2019
  • Number of updates: 12
  • Update frequency: every 1.1 days
  • Top authors: rosstitute (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /689 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/lnd-for-wp/classes/qrdecoder/lib/common/BitMatrix.php+37
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.00MB] [CPU: ▼48.02ms] Passed 4 tests

An overview of server-side resources used by LND For WP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.98 ▼0.489.94 ▼33.44
Dashboard /wp-admin3.00 ▼0.3016.07 ▼36.60
Posts /wp-admin/edit.php3.00 ▼0.3513.85 ▼34.28
Add New Post /wp-admin/post-new.php3.00 ▼2.8812.15 ▼87.28
Media Library /wp-admin/upload.php3.00 ▼0.2311.95 ▼33.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 520 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for LND For WP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲18913.55 ▼0.826.69 ▲4.5639.13 ▼9.87
Dashboard /wp-admin2,215 ▲275.91 ▼0.11102.21 ▼14.1187.93 ▲44.24
Posts /wp-admin/edit.php2,116 ▲272.03 ▼0.0039.18 ▲1.6633.71 ▼0.50
Add New Post /wp-admin/post-new.php1,528 ▼023.10 ▲4.93647.09 ▼14.5454.53 ▲1.85
Media Library /wp-admin/upload.php1,415 ▲304.26 ▲0.07115.51 ▼7.8847.20 ▼14.24

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
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/lnd-for-wp/classes/qrdecoder/lib/common/BitMatrix.php+37
    Array and string offset access syntax with curly braces is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/lnd-for-wp/classes/phpqrcode/index.php
    • > /wp-content/plugins/lnd-for-wp/public/partials/lnd-for-wp-request-invoice-ajax.php
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/lnd-for-wp/admin/partials/lnd-for-wp-admin-wallet.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/lnd-for-wp/admin/partials/lnd-for-wp-admin-transactions.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\LuminanceSource' not found in wp-content/plugins/lnd-for-wp/classes/qrdecoder/lib/GDLuminanceSource.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\Binarizer' not found in wp-content/plugins/lnd-for-wp/classes/qrdecoder/lib/common/GlobalHistogramBinarizer.php:36
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/lnd-for-wp/admin/partials/lnd-for-wp-admin-channels.php on line 208
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/lnd-for-wp/admin/partials/lnd-for-wp-admin-display.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/lnd-for-wp/admin/partials/lnd-for-wp-admin-network.php:14
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/lnd-for-wp/public/partials/lnd-for-wp-request-invoice-ajax.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\ReaderException' not found in wp-content/plugins/lnd-for-wp/classes/qrdecoder/lib/NotFoundException.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Zxing\\LuminanceSource' not found in wp-content/plugins/lnd-for-wp/classes/qrdecoder/lib/PlanarYUVLuminanceSource.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: lightning, lnd, lightning network, bitcoin

lnd-for-wp/lnd-for-wp.php Passed 13 tests

The main PHP file in "LND For WP" ver. 0.1.2 adds more information about the plugin and also serves as the entry point for this plugin
29 characters long description:
Manage and use your LND node.

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
It is important to fix the following items
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/lnd-for-wp/classes/phpqrcode/tools/merge.bat
14,319 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
PHP923,2665,46313,490
CSS2879598
JavaScript27939205
Markdown110022
Bourne Shell1002
DOS Batch1002

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues 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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
44 PNG files occupy 0.39MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
classes/phpqrcode/cache/frame_39.png0.26KB0.23KB▼ 9.85%
classes/phpqrcode/cache/frame_35.png0.24KB0.21KB▼ 9.47%
classes/phpqrcode/cache/frame_7.png0.18KB0.18KB▼ 0.53%
lnd-for-wp-preview.png347.96KB139.29KB▼ 59.97%
classes/phpqrcode/cache/frame_13.png0.21KB0.19KB▼ 5.24%