78% litprotocol-wp-lit-gated

Code Review | Token / NFT / Blockchain Page Gating

WordPress plugin Token / NFT / Blockchain Page Gating scored78%from 54 tests.

About plugin

  • Plugin page: litprotocol-wp-li...
  • Plugin version: 0.0.5
  • PHP compatiblity: 5.6.40+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Feb 3, 2022
  • Latest release: Sep 15, 2022
  • Number of updates: 20
  • Update frequency: every 11.2 days
  • Top authors: litprotocol (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,739 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼10.29ms] Passed 4 tests

This is a short check of server-side resources used by Token / NFT / Blockchain Page Gating
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0934.72 ▼3.80
Dashboard /wp-admin3.37 ▲0.0246.56 ▼12.44
Posts /wp-admin/edit.php3.48 ▲0.1246.32 ▲1.32
Add New Post /wp-admin/post-new.php5.97 ▲0.0878.91 ▼19.86
Media Library /wp-admin/upload.php3.29 ▲0.0631.97 ▼5.04

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Token / NFT / Blockchain Page Gating
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,149 ▲40318.30 ▲3.9427.88 ▲26.1038.38 ▼2.41
Dashboard /wp-admin2,226 ▲417.34 ▲1.50143.08 ▲39.6375.45 ▲35.20
Posts /wp-admin/edit.php2,106 ▲174.63 ▲2.6174.24 ▲34.4935.57 ▲0.44
Add New Post /wp-admin/post-new.php1,543 ▲2020.72 ▼2.36681.43 ▲34.7843.31 ▼13.83
Media Library /wp-admin/upload.php1,408 ▲237.37 ▲3.13129.35 ▲15.0375.17 ▲28.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

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)
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 fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/litprotocol-wp-lit-gated/wp-lit-gated.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant LIT_MENU_PAGE_CONTENT - assumed 'LIT_MENU_PAGE_CONTENT' (this will throw an Error in a future version of PHP) in wp-content/plugins/litprotocol-wp-lit-gated/setup/Setup.php on line 106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/litprotocol-wp-lit-gated/setup/Setup.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/litprotocol-wp-lit-gated/setup/menu-page.php:7
    • > PHP Warning
      Use of undefined constant LIT_MENU_SLUG - assumed 'LIT_MENU_SLUG' (this will throw an Error in a future version of PHP) in wp-content/plugins/litprotocol-wp-lit-gated/setup/Setup.php on line 103
    • > PHP Warning
      Use of undefined constant LIT_ICON - assumed 'LIT_ICON' (this will throw an Error in a future version of PHP) in wp-content/plugins/litprotocol-wp-lit-gated/setup/Setup.php on line 104
    • > PHP Warning
      Use of undefined constant LIT_MENU_NAME - assumed 'LIT_MENU_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/litprotocol-wp-lit-gated/setup/Setup.php on line 102
    • > PHP Warning
      Use of undefined constant LIT_MENU_GROUP - assumed 'LIT_MENU_GROUP' (this will throw an Error in a future version of PHP) in wp-content/plugins/litprotocol-wp-lit-gated/setup/Setup.php on line 107

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: blockchain, ethereum, access control, dao, nft

litprotocol-wp-lit-gated/wp-lit-gated.php 92% from 13 tests

"Token / NFT / Blockchain Page Gating" version 0.0.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("litprotocol-wp-lit-gated.php" instead of "wp-lit-gated.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin4,205 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3250562,781
PHP33383561,003
CSS3912402
Markdown112016
Bourne Shell1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions1168.75%
▷ Anonymous functions531.25%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.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
7 PNG files occupy 0.53MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png12.45KB5.32KB▼ 57.27%
assets/favicon-16x16.png0.88KB0.85KB▼ 3.43%
assets/lit-logo.png13.75KB5.27KB▼ 61.67%
assets/bg-2.png110.60KB135.08KB0.00%
assets/icon-256x256.png31.88KB13.99KB▼ 56.12%