By woocommerce-sl, posted on August 1, 2017

The speed of an application is one of its most important features — and the WP Software License plugin is engineered with that in mind. Its core code is highly optimized: enabling the plugin adds only about 0.07 seconds to a typical page request when inactive code paths are avoided, so the plugin itself does not become a bottleneck. Fast execution improves user experience, reduces bounce rates, and — importantly — helps with search visibility since Google favors quicker-loading pages.

On WordPress sites many components run on every request: theme code, other plugins, and the WordPress core. As a shop grows, API interactions (license checks, product updates, activation checks, domain protection) rise too, consuming CPU, database I/O and memory. On modest hosting plans this growth can push response times up and sometimes force site owners to pay for costly hosting upgrades or risk resource throttling by the provider.

That’s why we built the proprietary Cache Module — a lightweight, purpose-built caching layer for API interactions. Instead of executing a full WordPress call for each client request, the Cache Module stores recent API responses and serves them in microseconds. On cache misses it falls back to the normal process, then stores the result for subsequent requests. The cache supports configurable TTL (time-to-live) and automatic invalidation when a license or product is updated, so data remains fresh without constant recomputation.

Performance tests clearly show the benefit: the Cache Module is roughly 35–37× faster than a standard WordPress API call. In one benchmark of 1,000 API interactions, a server using the Cache Module completed processing in about 114 seconds, whereas the same workload without caching required more than 4,200 seconds. Practically, this means one regular $14/month server can safely handle many more clients and frequent automated product updates without immediate migration to higher-cost hosting.

The overall speed on a large number of interactions (1000 calls), a regular server will require 92 seconds to process the data requests, while on other plugin 4259 seconds (near 71 minutes), away much longer.

Benefits at a glance

  • Massive reduction in API processing time — supports thousands of interactions per day with low resource usage.
  • Lower hosting costs — scale further on the same infrastructure.
  • Better reliability — lower risk of account throttling or suspension due to resource spikes.
  • Simple deployment — enable it from the WordPress admin: WooCommerce > Settings > Products > License Products → check “Use Cache Module for API interactions.”
  • Safe defaults — cache falls back to live checks for misses and invalidates on updates to keep data accurate.

In short, the WP Software License plugin plus its Cache Module delivers faster API performance, reduced server load, and smoother scaling — giving shop owners a cost-effective way to keep license checks and product updates fast and reliable as their customer base grows.
The Cache Module can be enabled through WordPress Dashboard at WooCommerce > Settings > Products > License Products, the Use Cache Module for API interactions  checkbox need to be checked.

Read more

By woocommerce-sl, posted on February 22, 2022

The WooCommerce Software License plugin provides a Cache Module for API interactions. This dramatically reduces the response time, preserving the server resources. That ensure other calls are also fast-forward processed. This is a unique functionality on the market, none of the other similar codes can provide such capability.
For a small business, this may not sound much. Few API calls over a time frame might not be an issue, after all.  The server can handle it with no bottleneck. Considering a growing perspective, that eventually becomes a real issue. Such a scenario is threatening your business as the host is unable to successfully process all incoming traffic. This is a vicious circle, as every new call on top of existing, with limited processing power, it conclude to an imminent break-up of the HTTP service. Worth mentioning the costs for a performance server, a dedicated machine go above $100 / month.  Using the Cache module, the plugin can easily handle thousands of API calls over a cheap hosting ( $10 /month ).

When using the Cache Module, just a small chunk of WordPress is loaded. There is no need for anything else, no themes files, either plugins assets. Just the core! That goes to an incredible response time, that gives enough room for many other API calls.

If the Cache Module is active, the WordPress filters can still run, including custom PHP code. Such filters are invoked through the add_filter function. To ensure the code is loaded by the cache module, the custom PHP block needs saved into /wp-content/mu-plugins/woosl-custom.php. That file is also loaded when turning off the Cache Module, as WordPress loads the Must-Use Plugins as default.

 

 

Read more

By woocommerce-sl, posted on July 31, 2017

The plugin include a very intuitive and simple to use License Product Expiration functionality. This provide an easy way to set expiration for licenses. No need to spend tons on money on additional tools like subscription application, membership etc this plugin support expiration out of the box!

The licence expire module is linked to other components like API, so any key usage are directly connected to status of product licence.

To set-up an expire for a lincesed product, the following options need to be filled in within Licence area on the product admin page. From below image, the Units 2 and Time Months means the licence will expire in 2 months from the time of purchase. (more…)

Read more

By woocommerce-sl, posted on September 22, 2025

When using the Default Expire feature in WP Software License for WooCommerce, you may want to adjust the renewal price for licenses. This can be achieved in two different ways, depending on whether you prefer manual control or automation.

Manual adjustment – Each order that generates a license can be updated directly from the WooCommerce admin area. Simply open the order, locate the license details, and change the Renewal Price field. This allows you to set a custom amount for specific customers or orders without affecting others.

Automatic adjustment with custom code – For larger stores or recurring scenarios, the renewal price can be modified programmatically. By adding a small custom snippet, you can set new default renewal pricing rules that apply globally to all future orders. This approach ensures consistency, saves time, and reduces human error.


    include_once( 'wp-load.php' );
    
    $UpdateRenewalPriceForProductID     =   '745';
    $UpdateRenewalPriceForVariationD    =   '0';
    $UpdateLicenseGroupID               =   '0';
    $NewUpdatePrice                     =   '3.20';
    
    
    global $wpdb;
                                                
    $mysql_query    =   $wpdb->prepare ( "SELECT
                                            woi1.order_item_id
                                        FROM
                                            " . $wpdb->prefix . "woocommerce_order_itemmeta AS woi1
                                        JOIN " . $wpdb->prefix . "woocommerce_order_itemmeta AS woi2
                                        ON
                                            woi1.order_item_id = woi2.order_item_id
                                        WHERE
                                            woi1.meta_key = '_product_id' AND woi1.meta_value = %s AND woi2.meta_key = '_variation_id' AND woi2.meta_value = %s
                                        GROUP BY
                                            woi1.order_item_id", $UpdateRenewalPriceForProductID, $UpdateRenewalPriceForVariationD );
                                                
    $results        =   $wpdb->get_results( $mysql_query );
    
    if ( ! $results )
        wp_die ( "No records founds" );
        
    foreach ( $results  as  $result )
        {
            $_woo_sl    =   wc_get_order_item_meta( $result->order_item_id, '_woo_sl', TRUE );
            
            if ( ! is_array ( $_woo_sl )    ||  ! isset ( $_woo_sl['product_expire_renew_price'] )  || ! isset ( $_woo_sl['product_expire_renew_price'][ $UpdateLicenseGroupID ] ) )
                continue;
                
            //Update the price    
            $_woo_sl['product_expire_renew_price'][ $UpdateLicenseGroupID ] =   $NewUpdatePrice;
            
            wc_update_order_item_meta ( $result->order_item_id, '_woo_sl', $_woo_sl );
        }
        
    echo "Renewal prices updated";

Both methods give you full flexibility over license renewal pricing while using Default Expire.

Read more

By woocommerce-sl, on , posted on January 17, 2020

Using Expiration for Products provides a way to set limited access to a Product, mainly set as downloadable content or generally dependent to licence key. The Expire setup is easy through the interfaces implemented by WP Software License plugin.

As default, on order completed the system set automatically the expire details, those consist on few details:

  • Subscription start date
  • Expiration date
  • Licence status

(more…)

Read more

By woocommerce-sl, on , posted on March 6, 2025

Managing software licenses across multiple products can be a daunting task, especially when each product in an order traditionally receives a unique license key. The WooCommerce Software License plugin addresses this complexity with a smart feature: the ability to assign the same license key to all products within a single order. This enhancement not only streamlines license management for both merchants and customers but also ensures that licensed applications continue to function seamlessly with all their update features and API integrations.

How It Works

By default, the plugin is configured to generate or assign individual license keys for every product purchased. This setup caters to scenarios where products are designed to have separate licenses, providing granular control over licensing. However, certain licensing models benefit from a unified approach, where a single license key is applied to all items in an order. With this feature, when a customer completes a purchase, the plugin bypasses the default behavior and assigns one license key across all the purchased products. This uniformity simplifies post-purchase management, especially in cases where the products are complementary or part of a bundle.

Benefits for Customers

For customers, managing a single license key instead of multiple keys is a significant convenience. It reduces the risk of misplacing or mismanaging multiple credentials and minimizes confusion when it comes to software activation or renewal. Instead of tracking down separate keys for each product, customers can now activate or update all their software using one unified key. This not only enhances the overall user experience but also reduces support queries related to license management, thereby easing the burden on customer service teams.

Enhanced Functionality for Licensed Applications

A common concern with simplifying license key distribution is whether it might impact the functionality of the licensed applications. Rest assured, the WooCommerce Software License plugin ensures that even when the same key is applied across all products in an order, the software’s APIs remain fully functional. The unique product ID ensures that the system accurately distinguishes between individual order items. Licensed applications continue to receive updates and can leverage additional features such as API integrations, ensuring that the streamlined licensing process does not compromise on performance or security. Whether the license key is used for enabling auto-updates or accessing premium support through the API, the system is designed to handle all standard operations with ease.

Integrating the Feature

To create a unique license key for the products in the order, the filter woo_sl/generate_license_key can be used. The following code assigns the created license key to all other licensed products in the order:

    add_filter ( 'woo_sl/generate_license_key', 'custom_woo_sl_generate_license_key', 999, 4 );
    function custom_woo_sl_generate_license_key ( $license_key, $order_id, $order_item_id, $license_group_id )
        {
            global $WOOSL_UniqueLicenseKeys;
            
            if ( ! is_array ( $WOOSL_UniqueLicenseKeys ) )
                $WOOSL_UniqueLicenseKeys    =   array ();
                
            if ( ! isset ( $WOOSL_UniqueLicenseKeys[ $order_id ] ) )
                $WOOSL_UniqueLicenseKeys[ $order_id ]   =   $license_key;
                
            $license_key    =   $WOOSL_UniqueLicenseKeys[ $order_id ];
            
            return $license_key;   
        }

To assign a specific license key—for example, one retrieved from a custom API—you can use the following code example:

    add_filter ( 'woo_sl/generate_license_key', 'custom_woo_sl_generate_license_key', 999, 4 );
    function custom_woo_sl_generate_license_key ( $license_key, $order_id, $order_item_id, $license_group_id )
        {
            global $WOOSL_UniqueLicenseKeys;
            
            if ( ! is_array ( $WOOSL_UniqueLicenseKeys ) )
                $WOOSL_UniqueLicenseKeys    =   array ();
                
            if ( ! isset ( $WOOSL_UniqueLicenseKeys[ $order_id ] ) )
                {
                    $endpoint = 'api.example.com';

                    $body = [
                        'name'  => 'LicenseKeyRetrieve',
                        'email' => 'lkr@example.com',
                    ];

                    $body = wp_json_encode( $body );

                    $options = [
                        'body'        => $body,
                        'headers'     => [
                            'Content-Type' => 'application/json',
                        ],
                        'timeout'     => 60,
                        'redirection' => 5,
                        'blocking'    => true,
                        'httpversion' => '1.0',
                        'sslverify'   => false,
                        'data_format' => 'body',
                    ];

                    $apiResponse =  wp_remote_post( $endpoint, $options );
                    $apiBody     = json_decode( wp_remote_retrieve_body( $apiResponse ) );
                    $WOOSL_UniqueLicenseKeys[ $order_id ]   =   $apiBody->license_key;
                }
                
            $license_key    =   $WOOSL_UniqueLicenseKeys[ $order_id ];
            
            return $license_key;   
        }

Conclusion

The ability to assign a single license key to all products in an order represents a significant leap forward in license management for WooCommerce users. By simplifying the process, the WooCommerce Software License plugin not only improves the customer experience but also maintains the full range of functionality required by licensed applications. This innovation strikes the perfect balance between ease-of-use and powerful licensing capabilities, making it a valuable asset for any business looking to streamline its software distribution process. With this feature, businesses can ensure that license management is as efficient and user-friendly as possible, paving the way for smoother operations and happier customers.

 

Read more

By woocommerce-sl, on , posted on May 23, 2024

A license can be configured to allow multiple assignments to domains or devices, depending on the Product License setup. By default, when a customer purchases multiple quantities of a product, the system generates a corresponding number of license keys, up to the number of items purchased. (more…)

Read more

By woocommerce-sl, posted on September 29, 2022

When setting up the Licensing information for a Product, an Instance per License Key field is available to provide the number of domains that can be assigned towards a license key. This can be from 1 to unlimited.

When using a limited number of active domains, a Staging, Development or a Test may be required to not count towards an active instance. This is achievable programmatically using a filter.
For a domain to be considered as a staging or development, it must match a specific format. The following patterns can be used to determine if applys:

  • dev.
  • .dev
  • staging.
  • .local
  • localhost
  • test.
  • .test

The following code is using the above formats to make a comparison against the provided domain, inquired for a license key activation. The code should be placed within a custom file on /wp-content/mu-plugins/.

    add_filter ('WOOSL/API_call/activate/can_register_domain', '_woosl_api__can_register_domain', 10, 4 );
    function _woosl_api__can_register_domain( $can_register_domain_to_license_key, $domain, $key_instances, $max_instances_per_key )
        {
            //If already allowing more instances, just return
            if ( $can_register_domain_to_license_key )
                return TRUE;
             
            //check if the domain is actually a development
            $is_development_domain  =   TRUE;
            $regex_domain_development_check =   '/(^dev\.|\.dev$|^stage\.|^staging\.|\.local$|localhost|^test\.|\.test$)/i';   
            if ( preg_match( $regex_domain_development_check, $domain ) !== 1 )
                $is_development_domain  =   FALSE;
             
            //count the currently registered instances
            $count_production_instances     =   0;
            $count_dev_instances            =   0;
            
            foreach ( $key_instances    as  $key_instance )
                {
                    if ( preg_match( $regex_domain_development_check, $key_instance->active_domain ) !== 1 )
                        $count_production_instances +=  1;
                        else
                        $count_dev_instances    +=  1;
                }
            
            //We grant a single development one.
            if ( $is_development_domain &&  $count_dev_instances    <   1 )
                return TRUE;  
            
            if (    ! $is_development_domain    &&  $count_production_instances <   $max_instances_per_key )
                return TRUE;                   
                 
            return FALSE;   
        }

Accordingly to the above code logic, it allows a single staging/development domain registration. If already registered such a domain, it will not allow access for another activation.
In case of required unlimited activation, the code can be changed to the following:

    add_filter ('WOOSL/API_call/activate/can_register_domain', '_woosl_api__can_register_domain', 10, 4 );
    function _woosl_api__can_register_domain( $can_register_domain_to_license_key, $domain, $key_instances, $max_instances_per_key )
        {
            //If already allowing more instances, just return
            if ( $can_register_domain_to_license_key )
                return TRUE;
            
            //check if the domain is actually a development
            $regex_domain_development_check =   '/(^dev\.|\.dev$|^stage\.|^staging\.|\.local$|localhost|^test\.|\.test$)/i';   
            if ( preg_match( $regex_domain_development_check, $domain ) !== 1 )
                return FALSE;
            
            return TRUE;  
        }

Read more

By woocommerce-sl, on , posted on October 25, 2023

Managing licenses for your software products can be a tedious task, especially when you have multiple licenses to keep track of. That’s why the WP Software License for WooCommerce provides an easy-to-use All Licenses interface that allows administrators to manage all aspects of their licenses in one place.

The All Licenses interface is designed to provide administrators with a comprehensive view of their licenses and the ability to manage each license individually. Administrators can view the status of each license, including the product name, customer, license key, expiration details, license generation date, and active domains. (more…)

Read more

By woocommerce-sl, posted on August 8, 2024

The WooCommerce Software License plugin is a powerful tool designed to manage software licenses within a WooCommerce-powered store. It provides an intuitive interface that allows customers to view and manage their licenses directly from their account dashboard. The plugin includes two key template files: (more…)

Read more