10% zarinpal-paid-memberships-pro

Code Review | Zarinpal Paid Memberships Pro

WordPress plugin Zarinpal Paid Memberships Pro scored 10% from 54 tests.

About plugin

  • Plugin page: zarinpal-paid-mem...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 16, 2016
  • Latest release: Jul 19, 2016
  • Number of updates: 3
  • Update frequency: every 11.0 days
  • Top authors: Amini7 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active / 8,451 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/zarinpal-paid-memberships-pro/index.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; PMProGateway_Zarinpal has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼54.25ms] Passed 4 tests

This is a short check of server-side resources used by Zarinpal Paid Memberships Pro
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.304.52 ▼37.83
Dashboard /wp-admin2.18 ▼1.136.37 ▼45.75
Posts /wp-admin/edit.php2.18 ▼1.186.80 ▼42.36
Add New Post /wp-admin/post-new.php2.18 ▼3.716.55 ▼91.05
Media Library /wp-admin/upload.php2.18 ▼1.057.27 ▼25.57

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Zarinpal Paid Memberships Pro: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.70 ▼0.531.75 ▲0.0340.74 ▲0.30
Dashboard /wp-admin2,206 ▲215.77 ▲0.9094.52 ▼16.4939.17 ▼1.22
Posts /wp-admin/edit.php2,089 ▼32.03 ▲0.0134.06 ▼5.3532.82 ▼1.07
Add New Post /wp-admin/post-new.php1,538 ▲423.50 ▲0.26655.42 ▲7.2451.22 ▼1.82
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.06105.34 ▲6.8446.61 ▲1.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/zarinpal-paid-memberships-pro/index.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; PMProGateway_Zarinpal has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zarinpal-paid-memberships-pro/index.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
The official readme.txt might help

zarinpal-paid-memberships-pro/index.php 92% from 13 tests

The entry point to "Zarinpal Paid Memberships Pro" version 1.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("zarinpal-paid-memberships-pro.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin280 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP16462280

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods990.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin