10% subtext-connector-for-paid-memberships-pro

Code Review | Connect Paid Memberships Pro to Subtext

WordPress plugin Connect Paid Memberships Pro to Subtext scored10%from 54 tests.

About plugin

  • Plugin page: subtext-connector...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9.3
  • WordPress version: 6.3.1
  • First release: May 10, 2022
  • Latest release: Jun 13, 2022
  • Number of updates: 23
  • Update frequency: every 1.5 days
  • Top authors: fourthestate (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /211 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > User error in wp-content/plugins/subtext-connector-for-paid-memberships-pro/subtext-for-pmp.php+69
    You need to install and activate Paid Memberships Pro to use this plugin.

Server metrics [RAM: ▲0.08MB] [CPU: ▼8.41ms] Passed 4 tests

Server-side resources used by Connect Paid Memberships Pro to Subtext
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.17 ▼1.94
Dashboard /wp-admin3.39 ▲0.0847.43 ▼4.79
Posts /wp-admin/edit.php3.50 ▲0.1444.25 ▼6.26
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.67 ▼20.63
Media Library /wp-admin/upload.php3.31 ▲0.0840.05 ▲1.55
Subtext Connector /wp-admin/admin.php?page=fe-subtext-pmp-settings3.2733.45

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for Connect Paid Memberships Pro to Subtext
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.35 ▼0.202.11 ▲0.1443.41 ▼0.87
Dashboard /wp-admin2,195 ▲155.62 ▼0.1082.44 ▼16.7639.36 ▼4.43
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0741.41 ▲2.6037.52 ▲0.95
Add New Post /wp-admin/post-new.php1,526 ▼923.15 ▼0.03673.67 ▲4.0557.54 ▲3.24
Media Library /wp-admin/upload.php1,400 ▼34.12 ▼0.06109.84 ▲11.1047.08 ▲0.71
Subtext Connector /wp-admin/admin.php?page=fe-subtext-pmp-settings6801.516.9616.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=fe-subtext-pmp-settings
    • > Error in wp-content/plugins/subtext-connector-for-paid-memberships-pro/templates/admin/settings.php+4
    Uncaught Error: Call to undefined function pmpro_getAllLevels() in wp-content/plugins/subtext-connector-for-paid-memberships-pro/templates/admin/settings.php:4
    Stack trace:
    #0 wp-content/plugins/subtext-connector-for-paid-memberships-pro/includes/admin/class-settings.php(42): require_once()
    #1 wp-includes/class-wp-hook.php(310): FESPMP_Settings->view_settings()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/subtext-connector-for-paid-memberships-pro/subtext-for-pmp.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/subtext-connector-for-paid-memberships-pro/templates/admin/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Subtext_API' not found in wp-content/plugins/subtext-connector-for-paid-memberships-pro/includes/api/class-subtext-subscriber.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Subtext_API' not found in wp-content/plugins/subtext-connector-for-paid-memberships-pro/includes/api/class-external-subscribers.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_user_meta() in wp-content/plugins/subtext-connector-for-paid-memberships-pro/templates/edit_profile_subtext_section.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/subtext-connector-for-paid-memberships-pro/includes/admin/class-settings.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/subtext-connector-for-paid-memberships-pro/includes/class-edit-profile.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: paid memberships pro, engagement, text message, pmp, subtext...

subtext-connector-for-paid-memberships-pro/subtext-for-pmp.php 77% from 13 tests

The primary PHP file in "Connect Paid Memberships Pro to Subtext" version 1.0.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("subtext-connector-for-paid-memberships-pro.php" instead of "subtext-for-pmp.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
No dangerous file extensions were detected548 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP99666515
Markdown122033
HTML1100

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity6.33
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png86.70KB37.14KB▼ 57.16%
assets/icon-256x256.png64.67KB32.72KB▼ 49.41%