84% woo-role-purchasable

Code Review | Woo Role Purchasable

WordPress plugin Woo Role Purchasable scored84%from 54 tests.

About plugin

  • Plugin page: woo-role-purchasable
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Jul 28, 2016
  • Latest release: Jul 28, 2016
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: eggemplo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /725 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Server-side resources used by Woo Role Purchasable
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.76 ▼3.25
Dashboard /wp-admin3.31 ▲0.0145.63 ▼8.99
Posts /wp-admin/edit.php3.37 ▲0.0048.61 ▲3.55
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.50 ▲2.95
Media Library /wp-admin/upload.php3.24 ▲0.0040.93 ▲7.41

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 13 new options
New WordPress options
theysaidso_admin_options
wrpur-editor
wrpur-method
widget_recent-comments
wrpur-subscriber
wrpur-administrator
widget_recent-posts
can_compress_scripts
wrpur-guest
db_upgraded
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woo Role Purchasable
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.271.69 ▼0.4739.66 ▼6.90
Dashboard /wp-admin2,206 ▲184.88 ▼1.03100.06 ▼19.6940.30 ▼6.51
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0040.23 ▲6.0634.65 ▼4.58
Add New Post /wp-admin/post-new.php1,535 ▲223.45 ▲0.13657.11 ▼14.9753.00 ▼1.04
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.03103.11 ▼10.7049.04 ▼0.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • wrpur-method
    • widget_recent-posts
    • wrpur-contributor
    • db_upgraded
    • theysaidso_admin_options
    • wrpur-guest
    • widget_theysaidso_widget
    • widget_recent-comments
    • wrpur-editor
    • wrpur-author
    • ...

Smoke tests 75% from 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woo-role-purchasable/woo-role-purchasable.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-role-purchasable/core/class-woorolepurchasable.php:29
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-role-purchasable/woo-role-purchasable.php on line 34

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Settings), #2 (Shop page), #3 (Product page)
You can look at the official readme.txt

woo-role-purchasable/woo-role-purchasable.php 92% from 13 tests

The main PHP file in "Woo Role Purchasable" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
No dangerous file extensions were detected258 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23666221
PO File14211337

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity15.50
▷ Minimum class complexity10.00
▷ Maximum class complexity21.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods11100.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 PNG files occupy 0.12MB with 0.09MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png66.87KB18.53KB▼ 72.29%
screenshot-3,png.png40.52KB11.59KB▼ 71.40%
screenshot-2.png17.19KB5.11KB▼ 70.25%