68% lock-by-ldap-query

Code Review | Lock By LDAP Query

WordPress plugin Lock By LDAP Query scored68%from 54 tests.

About plugin

  • Plugin page: lock-by-ldap-query
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.2-4.9.6
  • WordPress version: 6.3.1
  • First release: Apr 25, 2014
  • Latest release: Jun 21, 2018
  • Number of updates: 10
  • Update frequency: every 151.8 days
  • Top authors: george_michael (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /946 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.90MB] [CPU: ▼36.00ms] Passed 4 tests

A check of server-side resources used by Lock By LDAP Query
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.75 ▼4.49
Dashboard /wp-admin3.04 ▼0.2621.93 ▼26.26
Posts /wp-admin/edit.php3.04 ▼0.3123.16 ▼21.99
Add New Post /wp-admin/post-new.php3.04 ▼2.8421.33 ▼80.16
Media Library /wp-admin/upload.php3.04 ▼0.1921.65 ▼15.60

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
LockByLDAPQueryAdminOptions

Browser metrics Passed 4 tests

Lock By LDAP Query: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.30 ▼1.081.66 ▼0.2037.38 ▼6.96
Dashboard /wp-admin2,210 ▲224.88 ▼1.02112.89 ▲4.8742.39 ▲4.39
Posts /wp-admin/edit.php2,090 ▼22.02 ▲0.0134.92 ▼3.3435.36 ▲1.23
Add New Post /wp-admin/post-new.php6,470 ▲4,92620.44 ▲2.26905.19 ▲257.0454.76 ▲3.98
Media Library /wp-admin/upload.php1,389 ▼24.22 ▲0.05100.70 ▲0.4141.52 ▼4.29
Lock By LDAP Query /wp-admin/lock-by-ldap-query.php260.440.0614.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • LockByLDAPQueryAdminOptions
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/lock-by-ldap-query/lock-by-ldap-query.php:50

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/lock-by-ldap-query.php
    • > Network (severe)
    wp-admin/lock-by-ldap-query.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: There were no tags found
  • Donate link: Invalid URI found ("")
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === lock-by-ldap-query === )
The official readme.txt is a good inspiration

lock-by-ldap-query/lock-by-ldap-query.php Passed 13 tests

The main PHP script in "Lock By LDAP Query" version 1.0.2 is automatically included on every request by WordPress
69 characters long description:
Lock a page down so that it can only be viewed by certain LDAP groups

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin257 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12136257

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity7.00
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin