83% client-portal

Code Review | Client Portal - Private user pages and login

WordPress plugin Client Portal - Private user pages and login scored 83% from 54 tests.

About plugin

  • Plugin page: client-portal
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.8.1
  • WordPress version: 5.9.2
  • First release: Apr 11, 2016
  • Latest release: Feb 7, 2022
  • Number of updates: 29
  • Update frequency: every 73.5 days
  • Top authors: madalin.ungureanu (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

6,000+ active / 99,038 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼306.40ms] Passed 4 tests

Server-side resources used by Client Portal - Private user pages and login
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0655.12 ▲5.00
Dashboard /wp-admin3.47 ▲0.0633.23 ▼1.14
Posts /wp-admin/edit.php3.70 ▲0.0639.26 ▲0.90
Add New Post /wp-admin/post-new.php7.00 ▲0.0399.82 ▼1,214.99
Media Library /wp-admin/upload.php3.35 ▲0.0425.53 ▼10.35
Client Portal Settings /wp-admin/users.php?page=client_portal_settings3.4031.17

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 1 new option
New WordPress options
cp_activation_date_time

Browser metrics Passed 4 tests

A check of browser resources used by Client Portal - Private user pages and login
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲7815.82 ▲0.176.09 ▼0.172.68 ▲0.40
Dashboard /wp-admin2,897 ▲366.11 ▲0.02116.99 ▼19.02157.55 ▼4.31
Posts /wp-admin/edit.php2,696 ▲83.23 ▼0.0070.21 ▲4.28141.97 ▼1.34
Add New Post /wp-admin/post-new.php1,714 ▲4021.43 ▲0.19456.61 ▲33.27159.77 ▼6.59
Media Library /wp-admin/upload.php1,703 ▲85.54 ▼0.01148.76 ▲6.34189.09 ▼13.37
Client Portal Settings /wp-admin/users.php?page=client_portal_settings2,84512.05204.76233.85

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 1 option
    • cp_activation_date_time

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 | 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 trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/client-portal/index.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Access the Private Page in the Users Listing in the admin area: screenshot-1.jpg), #2 (A Private Page edited using the Classic Editor: screenshot-2.jpg), #3 (A Private Page edited with the Gutenberg Editor: screenshot-3.jpg), #4 (The Settings Page for the Plugin: screenshot-3.jpg)
The official readme.txt is a good inspiration

client-portal/index.php 85% from 13 tests

This is the main PHP file of "Client Portal - Private user pages and login" version 1.1.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("client-portal.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin588 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1124180536
CSS28052

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity126.00
▷ Minimum class complexity126.00
▷ Maximum class complexity126.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods35
▷ Static methods00.00%
▷ Public methods35100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.58MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png73.30KB30.44KB▼ 58.47%
assets/logo_landing_pb_2x_red.png4.55KB2.93KB▼ 35.61%
screenshot-1.png158.18KB65.93KB▼ 58.32%
screenshot-4.png171.83KB58.38KB▼ 66.02%
screenshot-3.png187.61KB66.78KB▼ 64.41%