84% pmpro-woocommerce

Code Review | Paid Memberships Pro Integration with WooCommerce

WordPress plugin Paid Memberships Pro Integration with WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: pmpro-woocommerce
  • Plugin version: 1.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2014
  • Latest release: Jul 10, 2023
  • Number of updates: 57
  • Update frequency: every 60.2 days
  • Top authors: strangerstudios (78.95%)andrewza (22.81%)

Code review

54 tests

User reviews

12 reviews

Install metrics

10,000+ active /282,209 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼4.48ms] Passed 4 tests

A check of server-side resources used by Paid Memberships Pro Integration with WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1538.36 ▼4.68
Dashboard /wp-admin3.45 ▲0.1052.50 ▼11.99
Posts /wp-admin/edit.php3.56 ▲0.2050.29 ▼1.01
Add New Post /wp-admin/post-new.php6.03 ▲0.14105.73 ▲1.25
Media Library /wp-admin/upload.php3.37 ▲0.1437.75 ▼0.22

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Paid Memberships Pro Integration with WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.33 ▼0.022.17 ▲0.4042.62 ▼0.47
Dashboard /wp-admin2,200 ▲235.63 ▼0.0191.09 ▼5.5143.73 ▲2.73
Posts /wp-admin/edit.php2,102 ▼12.01 ▲0.0139.65 ▲3.0236.47 ▲2.37
Add New Post /wp-admin/post-new.php1,530 ▲223.36 ▲0.32643.11 ▼52.1852.81 ▼20.34
Media Library /wp-admin/upload.php1,399 ▲24.13 ▼0.1299.11 ▼21.7344.72 ▼1.31

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pmpro-woocommerce/includes/admin.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pmpro-woocommerce/includes/pmpro-gift-levels.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/pmpro-woocommerce/pmpro-woocommerce.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% 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 (The "Membership" meta box on a single product. Optionally use this WooCommerce Product to buy a PMPro Membership Level or set specific pricing based on membership level for each product.), #2 (The "Set Membership Discount" field on the "Edit Membership Level" page (Memberships > Settings > Membership Levels > Edit).)
The official readme.txt is a good inspiration

pmpro-woocommerce/pmpro-woocommerce.php 92% from 13 tests

The entry point to "Paid Memberships Pro Integration with WooCommerce" version 1.8 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.2" instead of "7.0.0")

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 plugin1,187 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4208345949
PO File298284225
CSS1208
HTML1005

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.53
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%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.06MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png28.92KB28.12KB▼ 2.76%
screenshot-2.png30.82KB29.44KB▼ 4.50%