83% paid-memberships-pro-takbull-gateway

Code Review | TakBull For Paid Memberships Pro

WordPress plugin TakBull For Paid Memberships Pro scored83%from 54 tests.

About plugin

  • Plugin page: paid-memberships-...
  • Plugin version: 1.1.2.12
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8
  • WordPress version: 6.3.1
  • First release: May 29, 2020
  • Latest release: Mar 10, 2023
  • Number of updates: 38
  • Update frequency: every 26.7 days
  • Top authors: supporttakbull (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,448 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.05ms] Passed 4 tests

This is a short check of server-side resources used by TakBull For Paid Memberships Pro
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.80 ▼2.12
Dashboard /wp-admin3.31 ▼0.0345.12 ▼17.40
Posts /wp-admin/edit.php3.36 ▲0.0147.30 ▲0.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.59 ▼8.02
Media Library /wp-admin/upload.php3.24 ▲0.0135.27 ▼0.66

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

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

Browser metrics Passed 4 tests

A check of browser resources used by TakBull For Paid Memberships Pro
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.37 ▼1.031.70 ▼0.1838.87 ▼5.13
Dashboard /wp-admin2,206 ▲155.85 ▼0.10108.74 ▲6.6141.52 ▼2.27
Posts /wp-admin/edit.php2,086 ▼62.02 ▼0.0440.19 ▲4.2334.50 ▼1.29
Add New Post /wp-admin/post-new.php1,533 ▲1923.28 ▲5.70602.23 ▼21.1556.14 ▲5.37
Media Library /wp-admin/upload.php1,391 ▲64.19 ▼0.0099.63 ▲2.5842.35 ▲0.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Please take a closer look at the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'PMPRO_DIR/classes/gateways/class.pmprogateway.php' (include_path='.:/usr/share/php') in wp-content/plugins/paid-memberships-pro-takbull-gateway/classes/class.pmprogateway_takbull.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/paid-memberships-pro-takbull-gateway/pmpro-takbull-gateway.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/paid-memberships-pro-takbull-gateway/includes/takbull_webhook.php:4
    • > 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/paid-memberships-pro-takbull-gateway/classes/class.pmprogateway_takbull.php on line 3
    • > PHP Warning
      require_once(PMPRO_DIR/classes/gateways/class.pmprogateway.php): failed to open stream: No such file or directory in wp-content/plugins/paid-memberships-pro-takbull-gateway/classes/class.pmprogateway_takbull.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paid-memberships-pro-takbull-gateway/includes/takbull_order.php:24

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)
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Donate link: Invalid URI ("")
Please take inspiration from this readme.txt

paid-memberships-pro-takbull-gateway/pmpro-takbull-gateway.php 69% from 13 tests

The main file in "TakBull For Paid Memberships Pro" v. 1.1.2.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.0.1" instead of "4.4")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("paid-memberships-pro-takbull-gateway.php" instead of "pmpro-takbull-gateway.php")
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin2,282 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP81722101,344
CSS100585
JavaScript28112353

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity26.20
▷ Minimum class complexity4.00
▷ Maximum class complexity83.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods75
▷ Static methods2634.67%
▷ Public methods7296.00%
▷ Protected methods22.67%
▷ Private methods11.33%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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