83% paystack-memberpress

Code Review | Paystack MemberPress

WordPress plugin Paystack MemberPress scored83%from 54 tests.

About plugin

  • Plugin page: paystack-memberpress
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3
  • WordPress version: 6.3.1
  • First release: Feb 23, 2020
  • Latest release: Oct 4, 2023
  • Number of updates: 11
  • Update frequency: every 124.2 days
  • Top authors: paystack (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /6,296 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.02MB] [CPU: ▼11.59ms] Passed 4 tests

This is a short check of server-side resources used by Paystack MemberPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.0047.78 ▲2.77
Dashboard /wp-admin3.57 ▼0.0649.52 ▼23.68
Posts /wp-admin/edit.php3.68 ▲0.0050.01 ▼0.86
Add New Post /wp-admin/post-new.php6.15 ▲0.0084.80 ▼20.70
Media Library /wp-admin/upload.php3.49 ▲0.0039.13 ▼1.13

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Paystack MemberPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.25 ▼0.501.91 ▼0.0044.37 ▲0.52
Dashboard /wp-admin2,192 ▲185.57 ▼0.0281.72 ▼9.0938.19 ▼2.47
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0734.48 ▼4.3135.98 ▲0.35
Add New Post /wp-admin/post-new.php1,545 ▲123.38 ▲0.31677.47 ▼48.8462.35 ▲7.10
Media Library /wp-admin/upload.php1,397 ▼04.23 ▲0.10106.45 ▼1.3545.40 ▼0.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

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)
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/paystack-memberpress/MpPaystack.php
    • > /wp-content/plugins/paystack-memberpress/MeprPaystackGateway.php
    • > /wp-content/plugins/paystack-memberpress/MeprPaystackAPI.php
    • > /wp-content/plugins/paystack-memberpress/main.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Requires php: The plugin version is formatted incorrectly
  • Screenshots: A description for screenshot #1 is missing in paystack-memberpress/assets to your readme.txt
You can take inspiration from this readme.txt

paystack-memberpress/main.php 92% from 13 tests

The main PHP file in "Paystack MemberPress" ver. 1.3.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("paystack-memberpress.php" instead of "main.php")

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
Success! There were no dangerous files found in this plugin1,247 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP42992861,155
Markdown136051
JavaScript192922
SVG10019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity48.67
▷ Minimum class complexity2.00
▷ Maximum class complexity135.00
Average method complexity3.51
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods57
▷ Static methods23.51%
▷ Public methods5291.23%
▷ Protected methods58.77%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.60MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress.org/banner-1544x500.png86.48KB33.12KB▼ 61.70%
.wordpress.org/banner-772x250-rtl.png33.83KB14.86KB▼ 56.08%
.wordpress.org/icon-256x256.png11.66KB3.59KB▼ 69.22%
images/paystack.png2.71KB2.74KB0.00%
.wordpress.org/screenshot-1.png344.50KB73.96KB▼ 78.53%