82% unloct

Code Review | Unloct

WordPress plugin Unloct scored 82% from 53 tests.

About plugin

  • Plugin page: unloct
  • Plugin version: 3.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.2-5.6.0
  • WordPress version: 5.8.1
  • First release: Sep 10, 2019
  • Latest release: Dec 24, 2020
  • Number of updates: 12
  • Update frequency: every 39.8 days
  • Top authors: gabefiftyone (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 293 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼276.66ms] Passed 4 tests

Analyzing server-side resources used by Unloct
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2536.94 ▲15.73
Dashboard /wp-admin3.27 ▲0.2150.72 ▲13.84
Posts /wp-admin/edit.php3.31 ▲0.2142.30 ▲0.33
Add New Post /wp-admin/post-new.php5.57 ▲0.1489.23 ▼1,118.19
Media Library /wp-admin/upload.php3.15 ▲0.1434.72 ▼2.63

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 1 new option
New WordPress options
widget_my-text

Browser metrics Passed 4 tests

A check of browser resources used by Unloct
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,722 ▲14015.87 ▼0.017.42 ▼1.7248.91 ▲1.52
Dashboard /wp-admin2,958 ▲1055.92 ▲0.06151.13 ▲2.63119.86 ▲19.17
Posts /wp-admin/edit.php2,735 ▲292.69 ▼0.0071.99 ▲6.4489.24 ▼2.58
Add New Post /wp-admin/post-new.php1,501 ▼2,16718.53 ▼2.22365.50 ▼40.35110.87 ▲3.89
Media Library /wp-admin/upload.php1,806 ▲345.02 ▼0.01146.51 ▼5.17108.48 ▼11.79

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_my-text

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/unloct/unloct_widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/unloct/unloct_login.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/unloct/visitor_short_code.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/unloct/unloct_short_code.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 83% 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
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === unloct === )
Please take inspiration from this readme.txt

unloct/unloct_login.php 69% from 13 tests

Analyzing the main PHP file in "Unloct" version 3.1.0
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Please don't use more than 140 characters for the plugin description (currently 490 characters long)
  • Domain Path: The domain path folder was not found ("/wordpress")
  • Main file name: Name the main plugin file the same as the plugin slug ("unloct.php" instead of "unloct_login.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin700 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP517297652
CSS113048

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.36
Average class complexity27.33
▷ Minimum class complexity5.00
▷ Maximum class complexity64.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods54
▷ Static methods11.85%
▷ Public methods2342.59%
▷ Protected methods3055.56%
▷ Private methods11.85%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.64MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/widget4.png99.44KB40.11KB▼ 59.66%
img/widget3.png201.95KB56.03KB▼ 72.26%
img/widget1.png132.06KB56.27KB▼ 57.39%
img/widget2.png205.91KB55.97KB▼ 72.82%
img/widget5.png13.52KB6.05KB▼ 55.28%