Nayeem Riddhi

Forum Replies Created

Viewing 25 posts - 1,476 through 1,500 (of 20,593 total)
May 27, 2025 at 2:05 am
#206756
Moderator
Nayeem Riddhi
Staff OP

Glad to hear that. However, if you need further help with anything else, then please don’t hesitate to open a new topic.

Thank you again and regards

May 26, 2025 at 8:13 am
#206740
Moderator
Nayeem Riddhi
Staff OP

I have again forwarded it to our related team authority. Please kindly check and let me know if you have any more queries.

Thank you and kind regards

May 25, 2025 at 12:19 pm
#206733
Moderator
Nayeem Riddhi
Staff OP

You can keep the site live too.

Thank you and regards

May 25, 2025 at 10:48 am
#206731
Moderator
Nayeem Riddhi
Staff OP

Sorry for the inconveneince. We are checking the issue. I have already forwarded it to our related team authority regarding the issue. Please kindly check and let me know if you have any more queries.

Thank you and kind regards

May 25, 2025 at 8:31 am
#206729
Moderator
Nayeem Riddhi
Staff OP

Please kindly let me know, if I can switch theme for a few moment or time and can back to your active theme then. Please kindly check.

Thank you and regards

May 25, 2025 at 3:03 am
#206727
Moderator
Nayeem Riddhi
Staff OP

It may have a conflict between your plugins or theme. Am i able to disable one by one other plugins for testing if there any conflicts. I can also switch theme to another for checking. Please kindly check and let me know.

Thank you and kind regards

May 24, 2025 at 3:40 am
#206714
Moderator
Nayeem Riddhi
Staff OP

I can check the WPDM plugin settings, however, now a days no such reports coming from other users. I can check the WPDM settings too if any issue persists with your issue. Please kindly check.

Thank you and kind regards

May 24, 2025 at 3:37 am
#206713
Moderator
Nayeem Riddhi
Staff OP

I have checked that, you are using old versions of WPDM add-ons, can you please kindly update the add-ons to the latest version, I hope it may then work properly for you. Please kindly check.

Thank you and kind regards

May 23, 2025 at 2:52 pm
#206705
Moderator
Nayeem Riddhi
Staff OP

Your credentials are not working. Please kindly check.

Thank you and kind regards

May 23, 2025 at 2:25 pm
#206703
Moderator
Nayeem Riddhi
Staff OP

Please kindly check and let me know if you have any queries more. Please kindly check.

Thank you and kind regards

May 23, 2025 at 2:23 pm
#206702
Moderator
Nayeem Riddhi
Staff OP

Can you please extend my access for download settings too thus I can check download manager settings. Please kindly check.

Thank you and kind regards

May 23, 2025 at 9:35 am
#206693
Moderator
Nayeem Riddhi
Staff OP

Here are the ways to override these functions in your theme’s functions.php:

# Simple WPDM Function Override in functions.php

Here are the ways to override these functions in your theme’s functions.php:

## Method 1: Direct Function Override (Recommended)


// Add to your theme's functions.php

// Override wpdm_user_has_access function
if (!function_exists('wpdm_user_has_access')) {
    function wpdm_user_has_access($id, $type = 'package') {
        $current_user = wp_get_current_user();
        
        if (!$id) {
            return false;
        }
        
        // Get allowed roles
        if ($type == 'package') {
            $roles = wpdm_allowed_roles($id);
        } else {
            // For categories - you may need to adjust this
            $roles = get_term_meta($id, '__wpdm_access', true);
            $roles = maybe_unserialize($roles);
        }

        if (!is_array($roles)) {
            $roles = array();
        }
        
        $matched = is_user_logged_in() ? array_intersect($current_user->roles, $roles) : array();

        // Check access conditions
        if ($type === 'category' && count($roles) == 0) {
            return true;
        }
        if (in_array('guest', $roles)) {
            return true;
        }
        if (count($matched) > 0) {
            return true;
        }

        return false;
    }
}

// Override wpdm_allowed_roles function
if (!function_exists('wpdm_allowed_roles')) {
    function wpdm_allowed_roles($id) {
        $roles = get_post_meta($id, '__wpdm_access', true);
        $roles = maybe_unserialize($roles);

        $cats = get_the_terms($id, 'wpdmcategory');
        if (!is_array($roles)) {
            $roles = array();
        }
        
        if (is_array($cats)) {
            foreach ($cats as $cat) {
                $croles = get_term_meta($cat->term_id, '__wpdm_access', true);
                $croles = maybe_unserialize($croles);
                if (is_array($croles)) {
                    $roles = array_merge($roles, $croles);
                }
            }
        }

        $roles = array_unique($roles);
        $roles = apply_filters("wpdm_allowed_roles", $roles, $id);
        
        if (!is_array($roles)) {
            $roles = array();
        }

        return $roles;
    }
}

## Method 2: Create Custom Versions


// Custom versions with your own names
function my_wpdm_user_has_access($id, $type = 'package') {
    // Your custom logic here
    $current_user = wp_get_current_user();
    
    if (!$id) return false;
    
    $roles = my_wpdm_allowed_roles($id);
    if (!is_array($roles)) $roles = array();
    
    $matched = is_user_logged_in() ? array_intersect($current_user->roles, $roles) : array();
    
    if (in_array('guest', $roles) || count($matched) > 0) {
        return true;
    }
    
    return false;
}

function my_wpdm_allowed_roles($id) {
    $roles = get_post_meta($id, '__wpdm_access', true);
    $roles = maybe_unserialize($roles);
    
    if (!is_array($roles)) {
        $roles = array();
    }
    
    // Apply your custom logic here
    $roles = apply_filters("my_wpdm_allowed_roles", $roles, $id);
    
    return $roles;
}

## Method 3: Using Filters to Modify Behavior


// Modify the allowed roles using existing filter
function modify_wpdm_allowed_roles($roles, $package_id) {
    // Add custom logic
    // Example: Always allow administrators
    if (!in_array('administrator', $roles)) {
        $roles[] = 'administrator';
    }
    
    // Example: Remove guest access for specific packages
    if ($package_id == 123 && in_array('guest', $roles)) {
        $roles = array_diff($roles, array('guest'));
    }
    
    return $roles;
}
add_filter('wpdm_allowed_roles', 'modify_wpdm_allowed_roles', 10, 2);

// Create custom access check filter
function custom_wpdm_access_check($has_access, $package_id, $user_id = null) {
    if ($user_id === null) {
        $user_id = get_current_user_id();
    }
    
    // Your custom access logic
    // Example: VIP users always have access
    if (user_can($user_id, 'vip_access')) {
        return true;
    }
    
    return $has_access;
}
// Apply this filter in your custom function

## Method 4: Wrapper Functions (Safest)


// Safe wrapper functions that fallback to originals
function safe_wpdm_user_has_access($id, $type = 'package') {
    // Try original function first
    if (function_exists('wpdm_user_has_access') && class_exists('WPDM')) {
        return wpdm_user_has_access($id, $type);
    }
    
    // Fallback logic
    return my_wpdm_user_has_access($id, $type);
}

function safe_wpdm_allowed_roles($id) {
    // Try original function first
    if (function_exists('wpdm_allowed_roles') && class_exists('WPDM')) {
        return wpdm_allowed_roles($id);
    }
    
    // Fallback logic
    return my_wpdm_allowed_roles($id);
}

## Usage Examples


// In your theme templates or other functions
if (safe_wpdm_user_has_access(123)) {
    echo "User has access to package 123";
}

$allowed_roles = safe_wpdm_allowed_roles(123);
if (in_array('subscriber', $allowed_roles)) {
    echo "Subscribers can access this package";
}

## Key Points:

– **Method 1** completely replaces the original functions
– **Method 2** creates parallel functions you control
– **Method 3** uses filters to modify existing behavior
– **Method 4** provides safe fallbacks

Choose the method that best fits your needs. Method 4 is recommended for production use as it’s the safest approach. Please kindly check.

Thank you and regards

May 23, 2025 at 8:32 am
#206691
Moderator
Nayeem Riddhi
Staff OP

Can you please let me know which fumction/hook you have adjusted thus I can check if there any possibility for keeping backup for next update. Please kindly check.

Thank you and kind regards

May 23, 2025 at 8:30 am
#206690
Moderator
Nayeem Riddhi
Staff OP

I think this is a server issue. You can directly contact with your server administrator too for your issue. Please kindly check.

Thank you and kind regards

May 23, 2025 at 6:16 am
#206686
Moderator
Nayeem Riddhi
Staff OP

Hello Jakub Jurgiel,

Hope you are well. Can you please kindly let me know which appearance or features you want to extend? Please kindly check.

Thank you and kind regards

May 23, 2025 at 4:44 am
#206684
Moderator
Nayeem Riddhi
Staff OP

For cancelling auto-renew please send an order note from this Page by following This. Also, please let us know which feature we can add/improve or support we can give you. Please check and let me know if you have any queries.

Thank you and kind regards

May 23, 2025 at 4:43 am
#206683
Moderator
Nayeem Riddhi
Staff OP

Hello Tham Hoang,

Hope you are well. And sorry for the inconvenience. if possible, can you please, give your temporary wp-admin login details in a private reply to check the issue?

Thank you and regards

May 23, 2025 at 4:40 am
#206682
Moderator
Nayeem Riddhi
Staff OP

Hello Kees Krul,

Hope you are well. And sorry for the inconvenience. Please kindly share the related URLs. if possible, please, give your temporary wp-admin login details in a private reply to check the issue.

Thank you and regards

May 22, 2025 at 12:12 pm
#206672
Moderator
Nayeem Riddhi
Staff OP

Hello Denis Beliajevas,

Hope you are well. For cancelling auto-renew please send an order note from this Page by following This. Also, please let us know which feature we can add/improve or support we can give you. Please check and let me know if you have any queries.

Thank you and kind regards

May 22, 2025 at 8:28 am
#206669
Moderator
Nayeem Riddhi
Staff OP

Ok, glad to hear this , Please kindly let me know if you have any issues.

Thank you and kinmd regards

May 22, 2025 at 6:35 am
#206666
Moderator
Nayeem Riddhi
Staff OP

It’s name link-template-deafult, you can find it from Downloads > Templates > Link Templates, please kindly check.

Thank you and kind regards

May 22, 2025 at 6:24 am
#206663
Moderator
Nayeem Riddhi
Staff OP

With [wpdm_packages] shortcode you are capable to use custom link-template for appearance. It has also a parameter callied template, Please kindly check.

Thank you and kind regards

May 22, 2025 at 6:09 am
#206661
Moderator
Nayeem Riddhi
Staff OP

Glad to hear that. However, if you need further help with anything else, then please don’t hesitate to open a new topic. If you get some free moments, can you please give us a 5* here https://wordpress.org/support/plugin/download-manager/reviews/?rate=5#new-post, It will inspire us a lot. Thanks in advance…

Thank you again and regards

May 21, 2025 at 11:49 pm
#206658
Moderator
Nayeem Riddhi
Staff OP

Glad to hear that. However, if you need further help with anything else, then please don’t hesitate to open a new topic. If you get some free moments, can you please give us a 5* here https://wordpress.org/support/plugin/download-manager/reviews/?rate=5#new-post, It will inspire us a lot. Thanks in advance…

Thank you again and regards

May 21, 2025 at 1:33 pm
#206656
Moderator
Nayeem Riddhi
Staff OP

Please kindly update the default value add-on to the latest version. please kindly check.

Thank you and kind regards

Viewing 25 posts - 1,476 through 1,500 (of 20,593 total)