Plugin Directory

Changeset 3182932


Ignore:
Timestamp:
11/06/2024 07:53:54 AM (17 months ago)
Author:
codeclouds
Message:

Initial commit for version 3.4.5 with proLicense func updation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • unify/trunk/Services/Helper.php

    r3181354 r3182932  
    161161        $proLicense = new ProLicense;
    162162
    163         // Fetch license from wp_options table
    164         $proLicenseFromOptionTable = \get_option('codeclouds_unify_pro_license');
    165 
    166163        // Table does not exist, so we will create it
    167164        $proLicense->createTable();
    168 
    169         !empty($licenseData) && $proLicenseFromOptionTable = $licenseData;
    170        
    171165        // Table exists, fetch data
    172166        $fetchLicenseData = $proLicense->fetchData($option_key);
     
    174168            // Option exists, handle the option value
    175169            $proLicenseFromOptionTable =  $fetchLicenseData->option_value;
    176         }
    177         else {
    178             // Option does not exist but row exist
    179             if(!empty($fetchLicenseData->id)){
    180                 $proLicense->update($fetchLicenseData->id,$option_key,$proLicenseFromOptionTable);
    181             }
    182             else if(!empty($proLicenseFromOptionTable)){
    183                 // Insert unify pro license data into the table
    184                 $proLicense->saveData($option_key,$proLicenseFromOptionTable);
     170        } else{
     171            !empty($licenseData) && $proLicenseFromOptionTable = $licenseData;
     172
     173            if(empty($proLicenseFromOptionTable)){
     174                // Fetch license from wp_options table
     175                $proLicenseFromOptionTable = \get_option('codeclouds_unify_pro_license');
     176            }
     177
     178            if(!empty($proLicenseFromOptionTable)){
     179                // Option does not exist but row exist
     180                if(!empty($fetchLicenseData->id)){
     181                    $proLicense->update($fetchLicenseData->id,$option_key,$proLicenseFromOptionTable);
     182                }
     183                else {
     184                    // Insert unify pro license data into the table
     185                    $proLicense->saveData($option_key,$proLicenseFromOptionTable);
     186                }
    185187            }
    186188        }
Note: See TracChangeset for help on using the changeset viewer.