示例#1
0
 /**
  * Check for availability of premium features and download them
  */
 static function check_plugin_updates()
 {
     $result = WPI_Functions::check_for_premium_features(true);
     if (is_wp_error($result)) {
         printf(__('An error occurred during premium feature check: <b> %s </b>.', 'wpp'), $result->get_error_message());
     } else {
         echo $result;
     }
 }
  /**
   * Run manually when a version mismatch is detected.
   *
   * Holds official current version designation.
   * Called in admin_init hook.
   *
  **/
  function manual_activation() {

    $installed_ver = get_option( "wp_invoice_version" );
    $wpi_version = WP_INVOICE_VERSION_NUM;

    if(@version_compare($installed_ver, $wpi_version) == '-1') {
      //** We are upgrading */

      //** Update option to latest version so this isn't run on next admin page load */
      update_option( "wp_invoice_version", $wpi_version );
      
      //** Try to create new schema tables */
      WPI_Functions::create_new_schema_tables();

      //** Get premium features on activation */
      WPI_Functions::check_for_premium_features();

    }

    return;

  }
 /**
  * Check for availability of premium features and download them
  *
  * @since 3.01
  *
  */
 function check_plugin_updates() {
   echo WPI_Functions::check_for_premium_features(true);
 }