83% prices-by-user-role-lite

Code Review | Prices By User Role Lite

WordPress plugin Prices By User Role Lite scored 83% from 54 tests.

About plugin

  • Plugin page: prices-by-user-ro...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Jun 1, 2018
  • Latest release: Jun 1, 2018
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: Festi-Team (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 869 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.15MB] [CPU: ▼9.94ms] Passed 4 tests

A check of server-side resources used by Prices By User Role Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▼0.5917.44 ▼22.65
Dashboard /wp-admin3.36 ▲0.0643.66 ▼5.60
Posts /wp-admin/edit.php3.22 ▼0.1333.77 ▼9.58
Add New Post /wp-admin/post-new.php5.94 ▲0.0687.10 ▼1.91
Media Library /wp-admin/upload.php3.29 ▲0.0643.81 ▲10.87
Prices by User Role Lite /wp-admin/admin.php?page=festi-user-role-prices-lite3.3048.06

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Prices By User Role Lite: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.67 ▼1.012.03 ▲0.4040.53 ▼11.94
Dashboard /wp-admin2,206 ▲185.79 ▲0.87104.64 ▲2.7636.72 ▼0.75
Posts /wp-admin/edit.php2,089 ▼31.98 ▼0.0235.68 ▼3.7831.24 ▲0.61
Add New Post /wp-admin/post-new.php1,533 ▲922.82 ▼0.47592.57 ▼31.2558.15 ▲1.77
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0198.42 ▼64.9642.33 ▼9.98
Prices by User Role Lite /wp-admin/admin.php?page=festi-user-role-prices-lite1,1002.0425.8126.71

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/prices-by-user-role-lite/prices-by-user-role-lite.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === prices-by-user-role-lite === )
  • Screenshots: Add images for these screenshots: #1 (Hide Add to Cart button for User Roles), #2 (Hide Prices for User Role)
You can look at the official readme.txt

prices-by-user-role-lite/prices-by-user-role-lite.php 92% from 13 tests

Analyzing the main PHP file in "Prices By User Role Lite" version 1.0
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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 plugin730 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP510727546
CSS2260172
JavaScript16012

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.17
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%
Functions43
▷ Named functions43100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/list-style-image.png1.46KB0.31KB▼ 78.79%