78% near-access

Code Review | Web3devs NEAR Access Plugin

WordPress plugin Web3devs NEAR Access Plugin scored78%from 54 tests.

About plugin

  • Plugin page: near-access
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0
  • WordPress version: 6.3.1
  • First release: Sep 27, 2022
  • Latest release: Sep 27, 2022
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: web3devs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /143 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼6.84ms] Passed 4 tests

An overview of server-side resources used by Web3devs NEAR Access Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1840.59 ▲2.95
Dashboard /wp-admin3.49 ▲0.1847.87 ▼3.78
Posts /wp-admin/edit.php3.60 ▲0.2455.29 ▲5.38
Add New Post /wp-admin/post-new.php5.63 ▼0.2675.95 ▼28.83
Media Library /wp-admin/upload.php3.41 ▲0.1837.34 ▲2.32
NEAR Access /wp-admin/admin.php?page=web3devs-near-access3.3834.11
Settings /wp-admin/admin.php?page=web3devs-near-access-settings3.3934.32

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

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

Browser metrics Passed 4 tests

Web3devs NEAR Access Plugin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲16614.75 ▲0.4030.12 ▲28.2741.01 ▲1.36
Dashboard /wp-admin2,219 ▲415.59 ▼0.1495.17 ▼15.6440.09 ▼4.22
Posts /wp-admin/edit.php2,127 ▲272.02 ▼0.0240.62 ▲0.5636.12 ▲3.70
Add New Post /wp-admin/post-new.php6,257 ▲4,72526.19 ▲2.93906.65 ▲251.2755.28 ▼11.63
Media Library /wp-admin/upload.php1,424 ▲304.17 ▲0.0196.89 ▼11.6943.65 ▼2.75
NEAR Access /wp-admin/admin.php?page=web3devs-near-access8132.0325.3527.96
Settings /wp-admin/admin.php?page=web3devs-near-access-settings1,0412.0022.4527.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/near-access/admin/partials/web3devs-near-access-admin-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/near-access/admin/partials/web3devs-near-access-admin-settings-display.php:73
    • > PHP Notice
      Undefined variable: coins in wp-content/plugins/near-access/admin/partials/web3devs-near-access-admin-settings-display.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/near-access/public/class-web3devs-near-access-public.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Requires php: Version not formatted correctly
You can look at the official readme.txt

near-access/web3devs-near-access.php 85% from 13 tests

Analyzing the main PHP file in "Web3devs NEAR Access Plugin" version 1.0.0
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("near-access.php" instead of "web3devs-near-access.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,046 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP14226564947
JavaScript566743
JSON20040
CSS3199
Markdown1406
HTML1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity11.75
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods65
▷ Static methods23.08%
▷ Public methods4163.08%
▷ Protected methods00.00%
▷ Private methods2436.92%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.01MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/js/component/build/logo192.png5.22KB5.57KB0.00%
public/js/component/build/logo512.png9.44KB10.35KB0.00%