84% lh-private-content-login

Code Review | LH Private Content Login

WordPress plugin LH Private Content Login scored84%from 54 tests.

About plugin

  • Plugin page: lh-private-conten...
  • Plugin version: 1.04
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jan 23, 2017
  • Latest release: Jul 28, 2022
  • Number of updates: 12
  • Update frequency: every 167.8 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /4,022 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.01MB] [CPU: ▼4.08ms] Passed 4 tests

Analyzing server-side resources used by LH Private Content Login
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.61 ▼9.98
Dashboard /wp-admin3.31 ▲0.0155.89 ▼4.66
Posts /wp-admin/edit.php3.36 ▲0.0172.11 ▲14.49
Add New Post /wp-admin/post-new.php5.89 ▲0.01106.31 ▲2.41
Media Library /wp-admin/upload.php3.23 ▲0.0137.05 ▼4.09

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by LH Private Content Login
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.48 ▲0.492.18 ▼0.2856.44 ▲6.63
Dashboard /wp-admin2,200 ▲125.88 ▲1.04122.80 ▼36.6352.83 ▲0.75
Posts /wp-admin/edit.php2,089 ▼32.02 ▲0.0542.97 ▼4.0738.12 ▼24.60
Add New Post /wp-admin/post-new.php1,412 ▲2018.05 ▼0.43850.06 ▲133.7186.83 ▲34.15
Media Library /wp-admin/upload.php1,391 ▲64.25 ▼0.07107.99 ▼25.2057.44 ▼6.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-private-content-login/lh-private-content-login.php:134

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: private content, redirection, status, post status, login

lh-private-content-login/lh-private-content-login.php 92% from 13 tests

"LH Private Content Login" version 1.04's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin68 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2591968

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods555.56%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected