8bit7
Forum Replies Created
-
Was finally able to install and test. worked great. Thanks again! Marking as resolved.
Unfortunately I am not able to make a video, however I have created several screenshots that should explain what’s going on.
https://imgur.com/a/w36Gh8l
User Case:
1. user clicks the “pay now” button in the pending transactions using shortcode [mycred_buy_pending ctype=””]
2. the JS alert error “you have exceeded your limit” pops up.
I created a new user and tried it as well as I tried with the admin account, it still shows the error in both cases. I do not have a maximum set for this point type, as you can see in the screenshot. I turned off all plugins except mycred to test things and the bug is still there. I am using the Spectra One theme with no modifications.
A quick search of the source code shows that the showing of the error and the error logic are inside \mycred\addons\buy-creds\abstracts\mycred-abstract-payment-gateway.php
The code throws from line 199-201 and then the exceeds_limit() function starts at line 287.I hope this information is helpful, please let me know if you need anything else. If you have a private email I can send more sensitive data if needed.
Awesome. Glad to hear it’s being fixed ??
I did as you said and can confirm it is still working perfectly. Thanks so much!omg wow man, thank you for going above and beyond! You are a hero!
The payment gateway is PayPal. I have tried it in sandbox mode and live. I do not have it set to central deposit.
Still get the same error.Awesome ??
Any recommendation to fix it until an official fix comes out? I know these things can take a while and I need something now. I can make a custom plugin and shove some code in it if needed no problem.
Thanks!
Forum: Plugins
In reply to: [Spectra - WordPress Gutenberg Blocks] Issue with text color in 2.5.0I tried editing the colors in the blocks in the wp page editor, and I also tried the asset recovery and it did nothing.
I am using the Spectra theme so it would be pretty crazy if it’s not even compatible with its own theme…. so something must be amiss in the code.
I can confirm it’s caused by the update. I rolled back to Version 2.4.2 and it fixed it.
Not too happy, it colored every header on my site to #FFF, which, like most people, is also my background color so as far as the user was concerned all my headers had disappeared.
the below code is a temp fix for those who cannot roll back, however if you use headers in any spectra block where you need a bright color it will also change it too, which kinda sucks.
/* sorta fixes odd color issue with spectra blocks after update .wp-block-uagb-container.wp-block-uagb-container h1, .wp-block-uagb-container.wp-block-uagb-container h2, .wp-block-uagb-container.wp-block-uagb-container h3, .wp-block-uagb-container.wp-block-uagb-container h4, .wp-block-uagb-container.wp-block-uagb-container h5, .wp-block-uagb-container.wp-block-uagb-container h6 { color: #333333 !important; } */
- This reply was modified 1 year, 10 months ago by 8bit7.
To clarify the issue is in?/wp-content/plugins/mycred/addons/transfer/includes/mycred-transfer-object.php on line 1358. changing it to return $content and not echo $content fixes the problem.
1. is this good to do and 2. How can I change this without modifying the core mycred files?/** * Get Error Message * @since 1.8 * @version 1.0 */ public function get_error_message( $return = false ) { $content = ''; if ( ! empty( $this->errors ) ) { foreach ( $this->errors as $error_code => $message ) { $content = '<div class="alert alert-warning error-' . $error_code . '"><p>' . $message . '</p></div>'; } } $content = apply_filters( 'mycred_transfer_form_errors', $content, $this ); if ( $return ) return $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped return $content; // MY EDIT -#- WAS ECHO, NOW IS RETURN. }
Thanks for the help and quick reply. Here is the form.
https://file.io/pgtILj8wUSF7I fixed it. the issue was my theme Specrta. I made a basic plugin for it and it works fine. Here’s the final working function.
function buycred_user_pays_fees( $cost, $amount, $type ) { if ( $type != 'mycred_default' ) return $cost; // paypal fees $percent_fee = 3.49; $set_fee = 0.49; // Calculate PayPal fees $percent = round( ( $percent_fee / 100 ) * $cost, 4); $total_fee = $percent + $set_fee; // Add fees to the cost $cost = $cost + $total_fee; // Round up the cost to the nearest cent $cost = ceil( $cost * 100 ) / 100; return $cost; }
- This reply was modified 1 year, 11 months ago by 8bit7.
The error file this example code (and my modification) gives is
[14-Apr-2023 16:58:00 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘mycredpro_buyred_volume_price_discount’ not found or invalid function name in [redacted] /wp-includes/class-wp-hook.php on line 310Also I found an error with the example code on the website.
It has $discount_amount but is calling $discounted_amount. Also the function it called buyred instead of buycredHere is the fixed example code (however, note this does not solve my issue):
/** * Give 10% Discount on Custom Point Purchases * @mycred * @version 1.0 */ add_filter( 'mycred_buycred_get_cost', 'mycredpro_buycred_volume_price_discount', 10, 3 ); function mycredpro_buycred_volume_price_discount( $cost, $amount, $type ) { if ( $type != 'mycred_default' ) return $cost; // 10% $discount = 10; // Get the discount amount $discount_amount = round( ( ( $discount / 100 ) * $cost ) ); // Deduct the discount amount $cost = $cost - $discount_amount; return $cost; }
- This reply was modified 1 year, 11 months ago by 8bit7.
Fixed it. It was buddypress! Add this to your themes functions.php file
function px_bp_activity_excerpt_length() { return 750; } add_filter('bp_activity_excerpt_length', 'px_bp_activity_excerpt_length');
yes, this solved it! Ty!
awesome! Thanks! Do you think it will be by the end of this year?