Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Return value of main function "wp_aff_award_commission"

by

Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › Return value of main function "wp_aff_award_commission"

  • This topic has 4 replies, 2 voices, and was last updated 12 years, 7 months ago by Edward.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • August 10, 2010 at 4:59 pm #1658
    Edward
    Member

    Currently the return value of main function “wp_aff_award_commission” which do the job for award referer is a piece of html text always says the award is success no matter if this operation is indeed success or fail.

    The possibility of award fail is very tiny, but if the operation failed once and nobody to handle this mistake, it can occur twice, triple, and more. It is important for us to know if the operation unfortunately failed thus we can correct this manually and do something to avoid it happen again.

    Is there already a plan for this?

    August 11, 2010 at 2:11 am #23274
    amin007
    Participant

    As you have mentioned already that the possibility of a failure is tiny so if it does fail just knowing about it doesn’t help that much. What really helps is if you can have some sort of indication as to why it failed too.

    So I have made the function return a big string rather than just true or false. You can then search for the following in this returned string:

    “The sale has been registered in the WP Affiliates Platform Database”

    If the above is not present then that would mean a failure in which case you can print out the full string which will hopefully some indication as to why or where it actually failed.

    August 11, 2010 at 3:51 am #23275
    Edward
    Member

    I’m sorry, but in current logic of your script, “The sale has been registered in the WP Affiliates Platform Database” will always be presented, unless the script crashes, in that case, no message will be presented also includes this one.

    The only case it will not be presented is the input parameter $referer is empty, which is not so useful.

    Also i think crashes’d better be avoided at least in this MAIN function, because once it crashes, all following actions will not be executed

    August 11, 2010 at 4:50 am #23276
    amin007
    Participant

    I see. I can add in more checks so if it returns false then it adds the appropriate message to that string. I think the only one that can fail is the database update execution.

    August 11, 2010 at 5:24 am #23277
    Edward
    Member

    That’d be appreciated!

    And ye, database operation, like get, update, wordpress guys did a lot of error handling in these functions to catch exception in various situation, make use of their return value is easy and greatly improve script robustness.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ