runthings.dev
Forum Replies Created
-
Ok v1.1.0 is released!
Progress
Ok I am making progress with this. The feature that you have requested is done, and tested.
I can only set aside a bit of time each day to work on this though and I’m out of time for today.
There is one other unrelated feature that I’m working on for the next version, before I release the update.
Pre Release Feature
I don’t know how urgent your requirement is, but if you don’t want to wait, you can just drop the contents of this gist into the file in your installed copy of the plugin:
https://gist.github.com/rtpHarry/5d41e071580f57bbaeede5d1640f3b65
It won’t affect the update when its released, and it will get you the feature today.
Basically, you can now select “Customer Is A Guest” in each field to control how that is treated.
If you set a role in the allowed roles field, it will automatically exclude the guest role as well, is its not specified in the included list. You can add “Customer Is A Guest” to allow it.
If you set a role in the excluded roles field, it will not exclude the guest role as it wasn’t specified in the excluded list. You can add “Customer Is A Guest” to block them.
Use Case
I am still surprised that two users immediately bumped into this issue. Out of curiosity, what was it that you were trying to implement?
I had assumed that if you were wanting to restrict a coupon to only be used by a specific role, that it would not be for guest users as well.
Is your scenario that you wanted to block certain existing users from using the coupon, but allow guests or certain roles?
Ok I have implemented a new role “Customer Is A Guest” which allows you to specifically allow or exclude guest users.
I have also fixed the issue where setting any role in the exclusions, also excluded guests.
I have run out of time today to do testing, and deploy, but I should have a new version out tomorrow.
Apologies, I only just saw this thread!
I will look into this.
Yep, I’ve just spent the last two hours trying to figure out what was wrong with the site. For shop managers, or editors, its failing, on multiple sites.
In the end I put a backtrace on the wp_die with this code:
// Remove this code after debugging function log_wp_die_backtrace($message, $title = '', $args = array()) { error_log('wp_die called: ' . print_r($message, true)); error_log('Backtrace: ' . print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true)); _default_wp_die_handler($message, $title, $args); } add_filter('wp_die_handler', function() { return 'log_wp_die_backtrace'; });
And this debug setting in wp-config.php:
define('WP_DEBUG', false); define('WP_DEBUG_LOG', false); define('WP_DEBUG_DISPLAY', false);
And that output the culprit:
[13-May-2024 21:52:39 UTC] wp_die called: You do not have permission to access this page! [13-May-2024 21:52:39 UTC] Backtrace: Array ( [0] => Array ( [file] => /home/sitename/public_html/wp-includes/functions.php [line] => 3785 [function] => log_wp_die_backtrace ) [1] => Array ( [file] => /home/sitename/public_html/wp-content/plugins/popup-builder/com/classes/Updates.php [line] => 110 [function] => wp_die ) [2] => Array ( [file] => /home/sitename/public_html/wp-includes/class-wp-hook.php [line] => 324 [function] => sgpbActivateLicense [class] => sgpb\Updates [type] => -> ) [3] => Array ( [file] => /home/sitename/public_html/wp-includes/class-wp-hook.php [line] => 348 [function] => apply_filters [class] => WP_Hook [type] => -> ) [4] => Array ( [file] => /home/sitename/public_html/wp-includes/plugin.php [line] => 517 [function] => do_action [class] => WP_Hook [type] => -> ) [5] => Array ( [file] => /home/sitename/public_html/wp-admin/admin.php [line] => 175 [function] => do_action ) [6] => Array ( [file] => /home/sitename/public_html/wp-admin/index.php [line] => 10 [args] => Array ( [0] => /home/sitename/public_html/wp-admin/admin.php ) [function] => require_once ) )
I’ve commented out the hook which is calling the rogue line in the bold reference above, which has fixed my site:
// add_action('admin_init', array($this, 'sgpbActivateLicense'));
I think thats a good enough fix for tonight as I expect you will be releasing a hotfix for this as soon as you see this thread…