10% near-login

Code Review | Login with NEAR

WordPress plugin Login with NEAR scored10%from 54 tests.

About plugin

  • Plugin page: near-login
  • Plugin version: 0.2.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Nov 26, 2023
  • Number of updates: 35
  • Update frequency: every 9.7 days
  • Top authors: learnnearclub (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,199 total downloads

Benchmarks

Plugin footprint 58% 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
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Error in wp-content/plugins/near-login/Model/Constructor/Constructor.php+92
    Uncaught TypeError: Typed property LNCNearLogin\Model\Constructor\Constructor::$options must be an instance of LNCNearLogin\Model\Constructor\mixed, bool used in wp-content/plugins/near-login/Model/Constructor/Constructor.php:92
    Stack trace:
    #0 wp-content/plugins/near-login/Model/Constructor/Constructor.php(147): LNCNearLogin\Model\Constructor\Constructor->__construct()
    #1 wp-content/plugins/near-login/index.php(20): LNCNearLogin\Model\Constructor\Constructor::getInstance()
    #2 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #3 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

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

Analyzing server-side resources used by Login with NEAR
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.45 ▼9.19
Dashboard /wp-admin3.31 ▼0.0447.28 ▼11.17
Posts /wp-admin/edit.php3.36 ▲0.0048.11 ▼1.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.62 ▼6.08
Media Library /wp-admin/upload.php3.23 ▲0.0032.71 ▼3.42

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Login with NEAR
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.27 ▼0.491.63 ▼0.2737.75 ▼4.65
Dashboard /wp-admin2,198 ▲215.64 ▲0.1092.77 ▼7.5242.47 ▼2.03
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0738.39 ▼3.0235.46 ▼2.09
Add New Post /wp-admin/post-new.php1,526 ▼1023.22 ▲0.21675.52 ▲30.8754.79 ▲3.65
Media Library /wp-admin/upload.php1,397 ▼64.21 ▲0.0197.77 ▲1.8340.24 ▼5.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'LNCNearLogin\\Model\\Abstractions\\AdminPages' not found in wp-content/plugins/near-login/Model/Constructor/ConfigPage.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function LNCNearLogin\\Model\\plugin_dir_path() in wp-content/plugins/near-login/Model/Config.php:75

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Contributors: Plugin contributors field is missing
  • Screenshots: Screenshot #2 (Add shortcode to [login_near_link] to any place on your site.) image not found
The official readme.txt is a good inspiration

near-login/index.php 92% from 13 tests

The main file in "Login with NEAR" v. 0.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("near-login.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin3,903 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
JSON4002,618
PHP202335921,075
JavaScript43314210

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.35
Average class complexity9.85
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods83
▷ Static methods2428.92%
▷ Public methods7387.95%
▷ Protected methods33.61%
▷ Private methods78.43%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.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
7 PNG files occupy 0.29MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png53.28KB19.92KB▼ 62.61%
assets/banner-772x250.png54.24KB25.83KB▼ 52.37%
assets/icon-256x256.png7.04KB3.18KB▼ 54.89%
assets/icon-128x128.png4.28KB2.10KB▼ 50.89%
assets/screenshot-5.png54.08KB20.47KB▼ 62.15%