10% login-mandatory-pages

Code Review | Login Mandatory Pages

WordPress plugin Login Mandatory Pages scored10%from 54 tests.

About plugin

  • Plugin page: login-mandatory-p...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.1
  • WordPress version: 6.3.1
  • First release: Sep 29, 2017
  • Latest release: Oct 4, 2017
  • Number of updates: 13
  • Update frequency: every 0.5 days
  • Top authors: dinesh224 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /773 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'LOGINMANDATORYPAGES_plugin_activate' not found or invalid function name

Server metrics [RAM: ▼0.30MB] [CPU: ▼19.00ms] Passed 4 tests

This is a short check of server-side resources used by Login Mandatory Pages
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▼0.0134.12 ▼16.68
Dashboard /wp-admin3.34 ▲0.0450.90 ▼0.75
Posts /wp-admin/edit.php3.39 ▲0.0452.30 ▲0.77
Add New Post /wp-admin/post-new.php4.63 ▼1.2544.54 ▼59.34
Media Library /wp-admin/upload.php3.26 ▲0.0341.67 ▲3.93
About Login Mandatory Pages /wp-admin/admin.php?page=about_login_mandatory_pages3.2334.53
Login Mandatory Pages Settings /wp-admin/admin.php?page=ls_settings3.2132.67

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Login Mandatory Pages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5614.34 ▼0.381.63 ▼0.2841.01 ▲2.70
Dashboard /wp-admin2,214 ▲375.52 ▼0.0887.46 ▼1.3667.37 ▲24.01
Posts /wp-admin/edit.php2,128 ▲311.98 ▼0.0338.86 ▲1.4437.51 ▼1.44
Add New Post /wp-admin/post-new.php1,704 ▲16422.30 ▲4.28705.50 ▲83.9155.00 ▼5.97
Media Library /wp-admin/upload.php1,428 ▲254.20 ▼0.02101.08 ▼2.8875.50 ▲30.44
About Login Mandatory Pages /wp-admin/admin.php?page=about_login_mandatory_pages8191.9923.5827.93
Login Mandatory Pages Settings /wp-admin/admin.php?page=ls_settings1,5706.72136.90117.01

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'LOGINMANDATORYPAGES_plugin_activate' not found or invalid function name
  • Zombie WordPress options were found after uninstall: 10 options
    • lr_message
    • widget_recent-comments
    • theysaidso_admin_options
    • lr_button
    • widget_recent-posts
    • widget_theysaidso_widget
    • login_restrictions_settings
    • db_upgraded
    • can_compress_scripts
    • selected_pages

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ls_settings
    • > Warning in wp-content/plugins/login-mandatory-pages/login-mandatory-pages.php+77
    in_array() expects parameter 2 to be array, string given
    • > GET request to /wp-admin/admin.php?page=ls_settings
    • > Notice in wp-content/plugins/login-mandatory-pages/login-mandatory-pages.php+81
    Undefined variable: checked

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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/login-mandatory-pages/includes/about.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: force login, login page, user access control, login pages, control pages...

login-mandatory-pages/login-mandatory-pages.php 85% from 13 tests

The main PHP script in "Login Mandatory Pages" version 1.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin283 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21439159
CSS110124

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/lmp.png0.77KB0.88KB0.00%