90% purchaseroles

Code Review | PurchaseRoles

WordPress plugin PurchaseRoles scored90%from 54 tests.

About plugin

  • Plugin page: purchaseroles
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.3
  • WordPress version: 6.3.1
  • First release: Aug 31, 2015
  • Latest release: Aug 31, 2015
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: Tysss (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /975 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.87ms] Passed 4 tests

Server-side resources used by PurchaseRoles
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.97 ▼0.20
Dashboard /wp-admin3.32 ▲0.0148.61 ▼0.39
Posts /wp-admin/edit.php3.37 ▲0.0145.26 ▼5.09
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.63 ▼16.49
Media Library /wp-admin/upload.php3.24 ▲0.0138.48 ▼1.51

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for PurchaseRoles
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.15 ▼0.201.82 ▼0.1543.77 ▼1.96
Dashboard /wp-admin2,195 ▲155.57 ▼0.1484.17 ▼3.4942.92 ▲4.91
Posts /wp-admin/edit.php2,100 ▼31.99 ▼0.0335.22 ▼4.9334.97 ▼1.02
Add New Post /wp-admin/post-new.php1,528 ▲123.27 ▲0.18675.28 ▲29.6257.72 ▲7.57
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.11113.62 ▼2.6947.22 ▼4.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: woocommerce, role, roles

purchaseroles/purchaseroles.php Passed 13 tests

The primary PHP file in "PurchaseRoles" version 0.1 is used by WordPress to initiate all plugin functionality
102 characters long description:
Adds an option to assign a role tu user when a specific product has been bought. Requires Woocommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin80 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP119756
PO File13324

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.47
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin