Skip to content

Some Membership Level Hooks not firing when Adding or Updating a Membership Level from PMP Admin Panel (Settings) #3517

@cjsdfw

Description

@cjsdfw

Describe the bug
When Adding or Editing a Membership Level from the PMP Admin Panel (Settings page) I expected the following action hooks to be fired but they are not:

When Adding:
"pmpro_add_membership_level"
"pmpro_added_membership_level"

When Editing:
"pmpro_updated_membership_level"

To Reproduce
Steps to reproduce the behavior:

  1. Hook to the referenced pmp hooks
  2. Go to PMP Admin Panel (Setting page)
  3. Executre the action: Add or Edit a membership level

In order to acertain that the hooks are not fired, I follow three independent procedures:

  1. XDEBUG Approach
  • Making use of XDEBUG, I placed a "Stop/Pause" execution inside my callback functions to the referenced hooks.
  • Program never stops.
  1. Hook to WordPress Action "all" Hook and log PMP related hooks called during the Add/Edit Membership level procedures.
  • I created a callback for the WordPress "all" hook and logged the name of any PMP action hook executed while I Add or Edit a memebrship level from the PMP Admin Panel (Settings page).
  • The referenced hooks are not logged.
  • I attached the logs to this report for your reference.

public function on_vtm_all_hooks( ){ return; // remove or comment out to log hook data $findstr1="pmpro_"; $called_hook = current_filter(); $result1 = str_contains($called_hook,$findstr1); If ( $result1 ){ $logpath1 = VTM_DIR_PATH."PMPRO_hooks.log"; error_log(date("d-m-y, H:i:s") . " PMP Hook: " . $called_hook . "\n",3,$logpath1); $findstr2 = "membership_level"; $result2 = str_contains($called_hook,$findstr2); If ( $result2 ){ $logpath2 = VTM_DIR_PATH."PMP_Membership_Level_hooks.log"; error_log(date("d-m-y, H:i:s") . " PMP Hook: " . $called_hook . "\n",3,$logpath2); } } return; }

  1. I searched PMP Code to locate where the referenced hooks are fired (do_action(action_name) ), and placed an XDEBUG "Stop/Pause" execution on those lines: program never stops.
  • Class: PMPro_Membership_Level
  • File: class-pmpro-levels.php
  • Lines: 135 & 190
  • I did not find any other place on PMP code where this hooks are referenced.

Expected behavior
I expected the referenced hooks to be fired so I can take appropriate integration actions in my plugin.

Isolating the problem (mark completed items with an [x]):

  • [X ] I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • [ X] This bug happens with a default WordPress theme active, or Memberlite.
  • [ X] I can reproduce this bug consistently using the steps above.

WordPress Environment
Version 6.8.3 Site Language en_US User Language en_US Timezone +00:00 Home URL https://test.vtmgr.com Site URL https://test.vtmgr.com Permalink structure /%year%/%monthnum%/%day%/%postname%/ Is this site using HTTPS? Yes Is this a multisite? No Can anyone register on this site? No Is this site discouraging search engines? Yes Default comment status Open Environment type production User count 1 Communication with WordPress.org WordPress.org is reachablVersion 6.8.3 Site Language en_US User Language en_US Timezone +00:00 Home URL https://test.vtmgr.com Site URL https://test.vtmgr.com Permalink structure /%year%/%monthnum%/%day%/%postname%/ Is this site using HTTPS? Yes Is this a multisite? No Can anyone register on this site? No Is this site discouraging search engines? Yes Default comment status Open Environment type production User count 1 Communication with WordPress.org WordPress.org is reachable
Server Environment
Server architecture Linux 5.15.0-157-generic x86_64 Web server Apache PHP version 8.2.29 (Supports 64bit values) PHP SAPI fpm-fcgi PHP max input variables 1000 PHP time limit 300 PHP memory limit 128M PHP memory limit (only for admin screens) 256M Max input time 60 Upload max filesize 20M PHP post max size 20M cURL version 7.81.0 OpenSSL/3.0.2 Is SUHOSIN installed? No Is the Imagick library available? Yes Are pretty permalinks supported? Yes .htaccess rules Your .htaccess file contains only core WordPress features. robots.txt There is a static robots.txt file in your installation folder. WordPress cannot dynamically serve one. Current time 2025-10-19T20:39:47+00:00 Current UTC time Sunday, 19-Oct-25 20:39:47 UTC Current Server time 2025-10-19T20:39:46+00:00
Paid Memberships Pro Info
`
Cron Job Status No cron jobs scheduled
Action Scheduler Health No issues found with the Action Scheduler tables.
Payment Gateway (gateway not registered)
Payment Gateway Environment Sandbox/Testing [sandbox]
Orders 3 orders
Discount Codes 0 discount codes
PHP Sessions
session_status: Active
Membership Levels { "14": { "id": "14", "name": "Added Level", "description": "", "confirmation": "", "initial_payment": 0, "billing_amount": 0, "cycle_number": "0", "cycle_period": "0", "billing_limit": "0", "trial_amount": 0, "trial_limit": "0", "allow_signups": "1", "expiration_number": "0", "expiration_period": "0", "formatted_price": "Free</strong>.", "formatted_expiration": "", "formatted_description": "", "meta": { "confirmation_in_email": [ "0" ], "membership_account_message": [ "" ] } }, "15": { "id": "15", "name": "Edited Level", "description": "", "confirmation": "", "initial_payment": 0, "billing_amount": 0, "cycle_number": "0", "cycle_period": "0", "billing_limit": "0", "trial_amount": 0, "trial_limit": "0", "allow_signups": "1", "expiration_number": "0", "expiration_period": "0", "formatted_price": "Free</strong>.", "formatted_expiration": "", "formatted_description": "", "meta": { "confirmation_in_email": [ "0" ], "membership_account_message": [ "" ] } } }
Level Groups { "1": { "id": "1", "name": "Main Group", "allow_multiple_selections": "0", "displayorder": "1", "level_ids": [ "14", "15" ] } }
Custom Templates
getfile.php Usage PMPRO_GETFILE_ENABLED is not set
.htaccess Cache Usage Off
Membership Pages
account: https://test.vtmgr.com/membership-account/
billing: https://test.vtmgr.com/membership-account/membership-billing/
cancel: https://test.vtmgr.com/membership-account/membership-cancel/
checkout: https://test.vtmgr.com/membership-checkout/
confirmation: https://test.vtmgr.com/membership-checkout/membership-confirmation/
invoice: https://test.vtmgr.com/membership-account/membership-orders/
levels: https://test.vtmgr.com/membership-levels/
login: https://test.vtmgr.com/login/
member_profile_edit: https://test.vtmgr.com/membership-account/your-profile/
Library Conflicts No library conflicts detected.
Incorrect Add On Folder Names No add ons with incorrect folder names detected.
Current Site URL https://test.vtmgr.com
Last Known Site URL https://test.vtmgr.com
Pause Mode Disabled

ADD_PMP_Membership_Level_hooks.log

EDIT_PMP_Membership_Level_hooks.log

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions