Title: botprophet's Replies | WordPress.org

---

# botprophet

  [  ](https://wordpress.org/support/users/botprophet/)

 *   [Profile](https://wordpress.org/support/users/botprophet/)
 *   [Topics Started](https://wordpress.org/support/users/botprophet/topics/)
 *   [Replies Created](https://wordpress.org/support/users/botprophet/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/botprophet/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/botprophet/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/botprophet/engagements/)
 *   [Favorites](https://wordpress.org/support/users/botprophet/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/users/botprophet/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/botprophet/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Plugin sold ?](https://wordpress.org/support/topic/plugin-sold/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/plugin-sold/#post-14908928)
 * [@drazenbebic](https://wordpress.org/support/users/drazenbebic/) Congrats!
    I
   hope they took good care of you, moneywize.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Account menu Link position](https://wordpress.org/support/topic/account-menu-link-position/)
 *  Thread Starter [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/account-menu-link-position/#post-14576715)
 * It’s not pretty, but i figured out a way.
    Put this in your functions file or
   code snippet plugin:
 *     ```
       add_filter( 'woocommerce_account_menu_items', 'lmfwc_reorder_my_license_link', 100, 1 );
       function lmfwc_reorder_my_license_link( $items ) {
           $ordered_items = array();
   
           // HERE set your custom label name for 'license' key in this array
           $license_item = array( 'view-license-keys' => __( 'Your License keys', 'license-manager-for-woocommerce' ) );
   
           // Remove 'license' key / label pair from original $items array
           unset( $items['view-license-keys'] );
   
           // merging arrays
           $license_item_position=3; // Define Position at which the New URL has to be inserted
       	$ordered_items_1 = array_slice($items, 0, $license_item_position-1);
       	$ordered_items_2 = $license_item;
       	$ordered_items_3 = array_slice($items, $license_item_position);
       	$items = array_merge( $ordered_items_1,$ordered_items_2,$ordered_items_3 );
   
           return $items;
       }
       ```
   
 * The shorter array_splice function didn’t work for me
    -  This reply was modified 5 years, 1 month ago by [botprophet](https://wordpress.org/support/users/botprophet/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] v2.2.3 Plugin Information](https://wordpress.org/support/topic/v2-2-3-plugin-information/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/v2-2-3-plugin-information/#post-14536603)
 * ok, np. it’s important for us though to know 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] v2.2.3 Plugin Information](https://wordpress.org/support/topic/v2-2-3-plugin-information/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/v2-2-3-plugin-information/#post-14536540)
 * Hi [@drazenbebic](https://wordpress.org/support/users/drazenbebic/), quick question.
 * Noticed you uploaded v.2.2.3 but we made customizations to our version because
   we do not want new License keys issued on each renewal order.
 * We added this in \includes\integrations\woocommerce\Order.php:75:
 *     ```
               if (get_post_meta($orderId, '_subscription_renewal')) {
                   return;
               }
       ```
   
 * And this in \templates\emails\lmfwc-email-order-license-keys.php:36
 *     ```
       if (!$row['keys']) {
                       ?>
                       <tr>
                           <td class="td" style="text-align: left; vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" colspan="1">
                               <code>You can find your original license key(s) in your account</code>
                           </td>
                       </tr>  
                   <?php
                   } else {
   
                       foreach ($row['keys'] as $license):
       ...
       ```
   
 * If we update, do we need to make these edits again, or did your update add some
   new subscription routines to prevent this re-issuing of license keys?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Github repo?](https://wordpress.org/support/topic/github-repo-18/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/github-repo-18/#post-14471001)
 * Maybe they’re not gone, he just might like to finish them in peace 🙂
 * Feb/March 2021
    “11 contributions in private repositories”
    -  This reply was modified 5 years, 2 months ago by [botprophet](https://wordpress.org/support/users/botprophet/).
    -  This reply was modified 5 years, 2 months ago by [botprophet](https://wordpress.org/support/users/botprophet/).
    -  This reply was modified 5 years, 2 months ago by [botprophet](https://wordpress.org/support/users/botprophet/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Github repo?](https://wordpress.org/support/topic/github-repo-18/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/github-repo-18/#post-14470984)
 * I probably should have (maybe I have though) downloaded it when it was there 
   🙂
 * I’m sure he didn’t just abandoned his work, he was pretty passionate about it.
   I hope he’s fine and just busy, ready to make it up-to-date when he feels ready
   to do so.
 * A free plugin does not make it a priority to update though, even though I’m sure
   lots of people would love to pay $10-$100 for it. It has an almost perfect rating,
   it’s just a great plugin.
 * Again, let’s hope he’s well and will get back soon.
 * ps. I don’t know how github’s repos work, but it’s kinda strange that just disappeared.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Github repo?](https://wordpress.org/support/topic/github-repo-18/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/github-repo-18/#post-14470364)
 * [@wpify](https://wordpress.org/support/users/wpify/) what are you looking for
   to solve?
    Have you read this thread I posted 7-ish months ago?
 * [https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/)
 * In that thread it was mentioned this issue was solved, but we’re still issuing
   many many license keys each (recurring) month to existing users, which is not
   good obviously as they’re getting an extra key each month.
 * You have some similar to change in mind?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Need Help in getting the order id](https://wordpress.org/support/topic/need-help-in-getting-the-order-id/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/need-help-in-getting-the-order-id/#post-14450394)
 * You can do an array search on license id with the get all license keys API call.
   
   It will give you the array key number that holds your data, then use that key
   to retrieve the orderId.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] De-activate key when order is canceled or refunded](https://wordpress.org/support/topic/de-activate-key-when-order-is-canceled-or-refunded/)
 *  Thread Starter [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/de-activate-key-when-order-is-canceled-or-refunded/#post-14445133)
 * To add to this, I’ve been playing around with this and I noticed a possible bug
   with the deactivate API
    [https://www.licensemanager.at/docs/rest-api/developer-documentation/deactivate-a-license/](https://www.licensemanager.at/docs/rest-api/developer-documentation/deactivate-a-license/)
 * The following Key has status ACTIVE in our system, yet we get this notice:
 * Array
    ( [code] => lmfwc_rest_data_error [message] => License Key: AGE-GOSW-V1CV-
   IBFY-R76C-N01 has not been activated yet. [data] => Array ( [status] => 404 )
 * )
 * Changing the status with update API works fine.
 * I hope this helps (we'll just use the update API, but I thought you'd like to
   know).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Product Variations](https://wordpress.org/support/topic/product-variations-61/)
 *  [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/product-variations-61/#post-13811540)
 * The keys are actually in the variant section. Click to expand your variation 
   and the license keys options will there.
 * Make sure to save the products first if you do not se eit.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Subscription renewal created new License Keys each month](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/)
 *  Thread Starter [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/page/2/#post-13533110)
 * [@drazenbebic](https://wordpress.org/support/users/drazenbebic/) Will this be
   uploaded to the WP repos for auto-update? Otherwise we’ll have to manually update
   this week as new renewals are coming up shortly 🙂
 * No problem either way, just doublechecking.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Subscription renewal created new License Keys each month](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/)
 *  Thread Starter [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/page/2/#post-13488363)
 * [@drazenbebic](https://wordpress.org/support/users/drazenbebic/) sorry i could
   not be of more/better/faster help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Subscription renewal created new License Keys each month](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/)
 *  Thread Starter [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/#post-13488226)
 * Cool, that’s awesome! Congrats, a new feature is always good for your plugin!
   
   I hope I motivated you to just get it off your to do list finally:-).
 * I can install the new files and changes, but I do not have a dev server for this
   so we’d have to wait until our next renewal in a few weeks.
 * Does that work for you?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Subscription renewal created new License Keys each month](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/)
 *  Thread Starter [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/#post-13487491)
 * Ok, the class and functions are in this file, i think:
    \wp-content\plugins\woocommerce-
   subscriptions\includes\class-wc-subscriptions-renewal-order.php
 * Not sure if there’s a public repository, I once wrote and published a ManyChat
   plugin and I think all plugins are visible in the repository when you publish
   your own, correct?
 * I understand what you are saying and of course it makes sense. A plugin is truly
   never finished, right. You can add so many features, options and checks you’d
   never see the light of day anymore :-). The subscription plugin alone has a ton
   of checks that if you want to close all gaps, it would mean a lot of (extra) 
   work.
 * The ‘fix’ in my earlier post might work for me, because we do a lookup on subscription
   level. The License is only used to check if it is issued and has no expiry or
   limted time usage. We then do a check for the ACTIVE subscription to give access.
   We have a seperate custom table which contains sub validity and licensekey etc
   which is being used on a custom platform, not in WP.
 * That said, here’s something I found in that file mentioned at the start (simplified),
   since we’re only looking for Complete Status (although that is also an optin 
   in your plugin (to make things more complicated haha)), this might be the call
   you need?
 *     ```
       class WC_Subscriptions_Renewal_Order {
       	public static function init() {
   
       		// Trigger special hook when payment is completed on renewal orders
       		add_action( 'woocommerce_payment_complete', array( __CLASS__, 'trigger_renewal_payment_complete' ), 10 );
   
       	public static function trigger_renewal_payment_complete( $order_id ) {
       		if ( wcs_order_contains_renewal( $order_id ) ) {
       			do_action( 'woocommerce_renewal_order_payment_complete', $order_id );
       		}
       	}
       ...
       ```
   
 * Here’s a list of all methods in that class:
 *     ```
       Array
       (
           [0] => ReflectionMethod Object
               (
                   [name] => init
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [1] => ReflectionMethod Object
               (
                   [name] => trigger_renewal_payment_complete
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [2] => ReflectionMethod Object
               (
                   [name] => get_failed_order_replaced_by
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [3] => ReflectionMethod Object
               (
                   [name] => maybe_record_subscription_payment
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [4] => ReflectionMethod Object
               (
                   [name] => add_order_note
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [5] => ReflectionMethod Object
               (
                   [name] => prevent_cancelling_renewal_orders
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [6] => ReflectionMethod Object
               (
                   [name] => remove_switch_item_meta_keys
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [7] => ReflectionMethod Object
               (
                   [name] => generate_paid_renewal_order
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [8] => ReflectionMethod Object
               (
                   [name] => generate_failed_payment_renewal_order
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [9] => ReflectionMethod Object
               (
                   [name] => maybe_generate_manual_renewal_order
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [10] => ReflectionMethod Object
               (
                   [name] => get_parent_order_id
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [11] => ReflectionMethod Object
               (
                   [name] => get_parent_order
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [12] => ReflectionMethod Object
               (
                   [name] => get_renewal_order_count
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [13] => ReflectionMethod Object
               (
                   [name] => get_users_renewal_link
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [14] => ReflectionMethod Object
               (
                   [name] => get_users_renewal_link_for_product
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [15] => ReflectionMethod Object
               (
                   [name] => can_subscription_be_renewed
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [16] => ReflectionMethod Object
               (
                   [name] => maybe_create_renewal_order_for_user
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [17] => ReflectionMethod Object
               (
                   [name] => product_addons_adjust_price
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [18] => ReflectionMethod Object
               (
                   [name] => generate_renewal_order
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [19] => ReflectionMethod Object
               (
                   [name] => is_purchasable
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [20] => ReflectionMethod Object
               (
                   [name] => is_renewal
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [21] => ReflectionMethod Object
               (
                   [name] => get_renewal_orders
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [22] => ReflectionMethod Object
               (
                   [name] => get_checkout_payment_url
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [23] => ReflectionMethod Object
               (
                   [name] => maybe_process_failed_renewal_order_payment
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [24] => ReflectionMethod Object
               (
                   [name] => process_failed_renewal_order_payment
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [25] => ReflectionMethod Object
               (
                   [name] => maybe_record_renewal_order_payment
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [26] => ReflectionMethod Object
               (
                   [name] => maybe_record_renewal_order_payment_failure
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [27] => ReflectionMethod Object
               (
                   [name] => process_subscription_payment_on_child_order
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [28] => ReflectionMethod Object
               (
                   [name] => renewal_orders_meta_box_section
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
           [29] => ReflectionMethod Object
               (
                   [name] => trigger_processed_failed_renewal_order_payment_hook
                   [class] => WC_Subscriptions_Renewal_Order
               )
   
       )
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[License Manager for WooCommerce] Subscription renewal created new License Keys each month](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/)
 *  Thread Starter [botprophet](https://wordpress.org/support/users/botprophet/)
 * (@botprophet)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/subscription-renewal-created-new-license-keys-each-month/#post-13487127)
 * Or, alternatively, if you can confirm and if you need to do it your way, like
   you said re-issue the same key again, use this at the end of the function, near
   line 222?:
 *     ```
       ...
       // Get existing key
                   // This order is a subscription renewal, thus no new key has to be issued
                   if (get_post_meta($orderId, '_subscription_renewal')) {
                       $orderId = get_post_meta($orderId, '_subscription_renewal', true);
                   }
   
                   $orderedLicenseKeys = LicenseResourceRepository::instance()->findAllBy(
                           array(
                               'order_id' => $orderId
                           )
                   );
   
                   /** Plugin event, Type: post, Name: order_license_keys */
                   do_action(
                           'lmfwc_event_post_order_license_keys',
                           array(
                               'orderId'  => $orderId,
                               'licenses' => $orderedLicenseKeys
                           )
                   );
       ```
   
 * That said, I think for my case my First suggestion if fine.
    -  This reply was modified 5 years, 9 months ago by [botprophet](https://wordpress.org/support/users/botprophet/).

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/users/botprophet/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/botprophet/replies/page/2/?output_format=md)