84% pmpro-payfast

Code Review | Paid Memberships Pro - Payfast Gateway Add On

WordPress plugin Paid Memberships Pro - Payfast Gateway Add On scored84%from 54 tests.

About plugin

  • Plugin page: pmpro-payfast
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 29, 2019
  • Latest release: Nov 30, 2023
  • Number of updates: 34
  • Update frequency: every 49.3 days
  • Top authors: andrewza (82.35%)strangerstudios (20.59%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /15,406 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Paid Memberships Pro - Payfast Gateway Add On
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0233.28 ▼7.65
Dashboard /wp-admin3.32 ▲0.0149.38 ▲2.80
Posts /wp-admin/edit.php3.37 ▲0.0148.39 ▲0.43
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.62 ▼4.71
Media Library /wp-admin/upload.php3.24 ▲0.0135.13 ▲0.41

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paid Memberships Pro - Payfast Gateway Add On
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4514.25 ▼0.481.61 ▼0.0136.48 ▼10.84
Dashboard /wp-admin2,195 ▲185.55 ▼0.1191.28 ▲4.2239.61 ▼1.05
Posts /wp-admin/edit.php2,103 ▲31.96 ▼0.0140.42 ▲2.0042.86 ▲7.25
Add New Post /wp-admin/post-new.php1,535 ▼125.48 ▲2.23630.75 ▼39.6265.00 ▲12.84
Media Library /wp-admin/upload.php1,403 ▲64.20 ▲0.0295.97 ▲1.2742.29 ▲1.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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 fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pmpro-payfast/pmpro-payfast.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'PMPRO_DIR/classes/gateways/class.pmprogateway.php' (include_path='.:/usr/share/php') in wp-content/plugins/pmpro-payfast/classes/class.pmprogateway_payfast.php on line 12
    • > PHP Warning
      Use of undefined constant PMPRO_DIR - assumed 'PMPRO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pmpro-payfast/classes/class.pmprogateway_payfast.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/pmpro-payfast/services/payfast_itn_handler.php:14
    • > PHP Warning
      require_once(PMPRO_DIR/classes/gateways/class.pmprogateway.php): failed to open stream: No such file or directory in wp-content/plugins/pmpro-payfast/classes/class.pmprogateway_payfast.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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
5 plugin tags: payfast, paid memberships pro, credit card, gateway, pmpro

pmpro-payfast/pmpro-payfast.php Passed 13 tests

The main file in "Paid Memberships Pro - Payfast Gateway Add On" v. 1.4.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
58 characters long description:
Adds PayFast as a gateway option for Paid Memberships Pro.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,003 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31983141,003

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods1168.75%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants29100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/payfast_logo.png12.40KB4.33KB▼ 65.07%