10Quality
Forum Replies Created
-
Forum: Reviews
In reply to: [License Keys for WooCommerce] Plugin crashes my websiteWe received buffer overflow attack, we have removed cross-server checks (DRMs) on the extension plugin to prevent customer sites to crush. Please review our blog, since we will be compensating our customers by extending their license.
Forum: Reviews
In reply to: [License Keys for WooCommerce] Much improved for 2020!!We received buffer overflow attack, we have removed cross-server checks (DRMs) on the extension plugin to prevent customer sites to crush. Please review our blog, since we will be compensating our customers by extending their license.
Forum: Reviews
In reply to: [License Keys for WooCommerce] Extended Add-On Crashing My SiteWe received buffer overflow attack, we have removed cross-server checks (DRMs) on the extension plugin to prevent customer sites to crush. Please review our blog, since we will be compensating our customers by extending their license.
No problem!
Good thing you found out what was causing the issue.
Once you fix that, you may still encounter problems with any license keys created prior the fix, since their
uses
property was initialized as a string|null. So we recommend to add the patch/fix you were suggesting us to apply to our code using hooks.Sample:
add_filter( 'woocommerce_license_keys_activate_request_preval', function( $request ) { if ( ! is_array( $request['license_key']->uses ) ) $request['license_key']->uses = []; return $request; } );
Finally, review the other
hook
indicated above, to stop loop from iterating and allowing you to just create one license key, as wanted.@daigo75 variable
uses
in line 92 ofValidationController.php
is a property of the license key data model, which is initialized as an empty array when the license key is created, this is done inWooCommerceController.php
. Through out our code (regular and paid plugins), we treat this variable as an array; so, from our end, there is no way this variable could have been change to something different than an array.This issue points to be caused by a customization you guys made, and we have no reason to patch something that in vanilla (used by 400+ active installs and without your customizations) is working. You need to find out where in your code you guys are replacing this property and provoking the whole thing to crash.
“We” didn’t write any filter for those hooks, and “we” are not touching the $request array or the value assigned to its uses key.
Good, still, you may be replacing the initial value of the
uses
property with the hookwoocommerce_license_key_meta_value
. The license key data model in the$request
is not generated/created inValidatorController
, it is loaded during the endpoint calls withinValidatorController
and created onWooCommerceController.php
when an order is completed.I can see that the client didn’t post the full error log, perhaps it might help you finding out what the issue could be and the best way to prevent it
As the error suggests, the property is being initialized as a string. So most likely you are guys are overriding the initial empty array value with a string or null during the creation of the license key.
If you still need to patch the
uses
, you can always usewoocommerce_license_keys_activate_request_preval
and make sure thatuses
is an array.Review the post above in regards to the
uses
issue, because most likely you are initialized the property asnull
, causingValidatorController
to break.In regards to the new hook, we have added
woocommerce_license_key_generate_loop_index
filter that will allow you to stop the generation loop right after a license key has been created.Sample:
add_filter( 'woocommerce_license_key_generate_loop_index', function( $i, $item ) { // We set the index to be higher than the product quantity to force // the loop to end, preventing it to generate a second license key. return $i + $item->get_quantity(); }, 99, 2 );
Property
uses
is initialized as an empty array atWooCommerceController.php
notValidatorController.php
.There is no need from us to change anything in our code, since vanilla version works great on php 7.1, 7.2 or later.
If you were getting an error, it is probably because you are replacing the initial value, to a non array, using hook
woocommerce_license_key_meta_value
.In regards to the other hook. We will try to release the update today, regards.
- This reply was modified 5 years, 8 months ago by 10Quality.
You will also need a way to break the loop, so the plugin does not create more than 1 license keys. For that we will have to add a new hook for you to use. We will be adding it in the following days and notify you through this thread.
You want to set the limit based on the quantity purchased in the order, right?
Yes it is possible.
Before looking at the hook below, please read the following article, it will guide you and indicate how to customize the plugin properly:
https://www.10quality.com/2018/12/17/how-to-customize-wordpress-the-right-way/Then apply the following hook:
add_filter( 'woocommerce_license_key_meta_value', function( $meta, $item ) { // Set limit based on purchased quantity $meta['limit'] = $item->get_quantity(); return $meta; }, 99, 2 );
Documentation hook.
- This reply was modified 5 years, 9 months ago by 10Quality.
The extended (premium) plugin adds the limit option you are looking for. Although, you are also free to look at our code and WP hooks to code it yourself.
https://www.10quality.com/docs/woocommerce-license-keys/woocommerce/extended-features/
Regards.
Closing after no response.
You can use the filter hook
woocommerce_license_key_meta_value
https://www.10quality.com/docs/woocommerce-license-keys/developers/filter-hooks-reference/#woocommerce_license_key_meta_valueYou can code the hook to connect with your API and retrieve whatever license you have there, although this may affect some functionality of the plugin because current version looks for certain license key pattern to validate it when using the built-in API, but since your will be using another API for your validations, the there will be no problem
Forum: Plugins
In reply to: [Post Gallery] Can this plugin output a post image gallery?Yup, this is exactly the purpose of this plugin.
Forum: Plugins
In reply to: [Post Gallery] Moved site to different domain, now everything is broken!Looks like you might have not fully migrated the site, this does not appear to be an issue related with our plugin, still please do the following:
1) Manually review tables
[prefix]_posts
and[prefix]_postmeta
, they might still have fields with references to the old domain; onposts
table look for columnguid
on attachment records and onpostmeta
formeta_value
. You can create a SQL script to find and replace the old domain too.2) As we stated in our F.A.Q., we recommend to use the cache tool in our plugin to flush old cache and generate new references.
Regards
Forum: Plugins
In reply to: [License Keys for WooCommerce] Plugin no longer counting activationsMost likely this happen because the plugin was being tested on a development environment and the license was configured to not limit development activations.