| Server IP : 121.121.20.254 / Your IP : 216.73.216.66 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/AIWEBSTATION/wp-content/plugins/voice-message-addon/plugin-upgrader/ |
Upload File : |
<?php
define('wpbotvoicemessage_LICENSING_PLUGIN_SLUG', 'voice-message-addon/wpbotvoicemessage.php');
define('wpbotvoicemessage_LICENSING_PLUGIN_NAME', 'wpbotvoicemessage');
define('wpbotvoicemessage_LICENSING__DIR', plugin_dir_path(__DIR__));
define('wpbotvoicemessage_LICENSING__URL', plugin_dir_url(__FILE__));
define('wpbotvoicemessage_LICENSING_REMOTE_PATH', 'https://www.ultrawebmedia.com/li/plugins/voice-message-addon/update.php');
define('wpbotvoicemessage_LICENSING_PRODUCT_DEV_URL', 'https://quantumcloud.com/products/');
//start new-update-for-codecanyon
define('wpbotvoicemessage_ENVATO_PLUGIN_ID', -1);
//end new-update-for-codecanyon
function get_wpbotvoicemessage_licensing_plugin_data(){
include_once(ABSPATH.'wp-admin/includes/plugin.php');
return get_plugin_data(wpbotvoicemessage_LICENSING__DIR.'/wpbotvoicemessage.php', false);
}
//License Options
function get_wpbotvoicemessage_licensing_key(){
return get_option('qcld_wpbotvoicemessage_enter_license_key');
}
function get_wpbotvoicemessage_envato_key(){
return get_option('qcld_wpbotvoicemessage_enter_envato_key');
}
function get_wpbotvoicemessage_licensing_buy_from(){
return get_option('qcld_wpbotvoicemessage_buy_from_where');
}
//Update Transients
function get_wpbotvoicemessage_update_transient(){
return get_transient('qcld_update_wpbotvoicemessage');
}
function set_wpbotvoicemessage_update_transient($plugin_object){
return set_transient( 'qcld_update_wpbotvoicemessage', serialize($plugin_object), 1 * DAY_IN_SECONDS );
}
function delete_wpbotvoicemessage_update_transient(){
return delete_transient( 'qcld_update_wpbotvoicemessage' );
}
//Renewal Transients
function get_wpbotvoicemessage_renew_transient(){
return get_transient('qcld_renew_wpbotvoicemessage_subscription');
}
function set_wpbotvoicemessage_renew_transient($plugin_object){
return set_transient( 'qcld_renew_wpbotvoicemessage_subscription', serialize($plugin_object), 1 * DAY_IN_SECONDS );
}
function delete_wpbotvoicemessage_renew_transient(){
return delete_transient( 'qcld_renew_wpbotvoicemessage_subscription' );
}
//Invalid License Options
function get_wpbotvoicemessage_invalid_license(){
return get_option('wpbotvoicemessage_invalid_license');
}
function set_wpbotvoicemessage_invalid_license(){
return update_option('wpbotvoicemessage_invalid_license', 1);
}
function delete_wpbotvoicemessage_invalid_license(){
return delete_option('wpbotvoicemessage_invalid_license');
}
function wpbotvoicemessage_get_licensing_url(){
return admin_url('edit.php?post_type=qcldwpbot_record&page=wpbotvoicemessage_license');
}
//Valid License
function get_wpbotvoicemessage_valid_license(){
return get_option('wpbotvoicemessage_valid_license');
}
function set_wpbotvoicemessage_valid_license(){
return update_option('wpbotvoicemessage_valid_license', 1);
}
function delete_wpbotvoicemessage_valid_license(){
return delete_option('wpbotvoicemessage_valid_license');
}
//staging or live
function get_wpbotvoicemessage_site_type(){
return get_option('qcld_wpbotvoicemessage_site_type');
}
//start new-update-for-codecanyon
function get_wpbotvoicemessage_license_purchase_code(){
return get_option('qcld_wpbotvoicemessage_enter_license_or_purchase_key');
}
function get_wpbotvoicemessage_enter_license_notice_dismiss_transient(){
return get_transient('get_wpbotvoicemessage_enter_license_notice_dismiss_transient');
}
function set_wpbotvoicemessage_enter_license_notice_dismiss_transient(){
return set_transient('get_wpbotvoicemessage_enter_license_notice_dismiss_transient', 1, DAY_IN_SECONDS);
}
function get_wpbotvoicemessage_invalid_license_notice_dismiss_transient(){
return get_transient('get_wpbotvoicemessage_invalid_license_notice_dismiss_transient');
}
function set_wpbotvoicemessage_invalid_license_notice_dismiss_transient(){
return set_transient('get_wpbotvoicemessage_invalid_license_notice_dismiss_transient', 1, DAY_IN_SECONDS);
}
//end new-update-for-codecanyon
add_action('admin_menu', 'wpbotvoicemessage_license_page');
function wpbotvoicemessage_license_page(){
add_submenu_page(
'edit.php?post_type=qcldwpbot_record',
__( 'Help & License', 'textdomain' ),
__( 'Help & License', 'textdomain' ),
'manage_options',
'wpbotvoicemessage_license',
'wpbotvoicemessage_license_callback'
);
}
function wpbotvoicemessage_license_callback(){
?>
<h1>Please Insert your license Key</h1>
<div class="qcld-wpbotvoicemessage-section-block">
<?php
$total_active_domain = 0;
$active_domain_lists = array();
$track_domain_request = wp_remote_get(wpbotvoicemessage_LICENSING_PRODUCT_DEV_URL."wp-json/qc-domain-tracker/v1/getdomain/?license_key=".get_wpbotvoicemessage_licensing_key(), array('timeout' => 300));
if( !is_wp_error( $track_domain_request ) || wp_remote_retrieve_response_code( $track_domain_request ) === 200 ){
$track_domain_result = json_decode($track_domain_request['body']);
$current_domain_url = site_url() ;
$current_domain = str_replace(
array( 'https://', 'http://', 'www.' ),
array('', '', ''),
$current_domain_url
);
if( !empty($track_domain_result) ){
$max_domain_num = $track_domain_result[0]->max_domain + 1;
$total_domains = json_decode($track_domain_result[0]->domain, true);
$total_domains_num = count($total_domains);
foreach ($total_domains as $key => $value) {
if( !isset($value['status']) || $value['status'] == 'active' ){
$total_active_domain++;
$active_domain_lists[] = $value['domain_name'];
}
}
if($total_active_domain == $max_domain_num){
//if( $max_domain_num < $total_active_domain ){
//$first_domain_name = $total_domains[0]['domain_name'];
if( !in_array($current_domain, $active_domain_lists) ){
set_wpbotvoicemessage_invalid_license();
delete_wpbotvoicemessage_valid_license();
?>
<div class="qcld-error-notice">
<p>You have activated this key for maximum number of sites allowed by your license. Please <a href='https://www.quantumcloud.com/products/'>purchase additional license.</a></p>
</div>
<?php
}
}
}
}
?>
<?php if( get_wpbotvoicemessage_valid_license() ){ ?>
<div class="qcld-success-notice">
<p>Thank you, Your License is active. <?php if( get_wpbotvoicemessage_licensing_buy_from() == 'codecanyon' ){ ?>Please <a href="https://envato.com/market-plugin/">Download</a> the Envato Market Plugin to Get Auto Updates During Your Support Period. <?php } ?></p>
</div>
<?php } ?>
<form onsubmit="return false" id="qc-license-form" method="post" action="options.php">
<?php
delete_wpbotvoicemessage_update_transient();
delete_wpbotvoicemessage_renew_transient();
delete_option('_site_transient_update_plugins');
settings_fields( 'qcld_wpbotvoicemessage_license' );
do_settings_sections( 'qcld_wpbotvoicemessage_license' );
// if( isset($_POST['submit']) ){
// echo 'qcld_wpbotvoicemessage_buy_from_where '.$_POST['qcld_wpbotvoicemessage_buy_from_where'];
// }
?>
<table class="form-table">
<tr id="quantumcloud_portfolio_license_row" style="display: none">
<th>
<label for="qcld_wpbotvoicemessage_enter_license_key">Enter License Key:</label>
</th>
<td>
<input type="<?php echo (get_wpbotvoicemessage_licensing_key()!=''?'password':'text'); ?>" id="qcld_wpbotvoicemessage_enter_license_key" name="qcld_wpbotvoicemessage_enter_license_key" class="regular-text" value="<?php echo get_wpbotvoicemessage_licensing_key(); ?>">
<p>You can copy the license key from <a target="_blank" href='https://www.quantumcloud.com/products/account/'>your account</a></p>
</td>
</tr>
<tr id="show_envato_plugin_downloader" style="display: none">
<th>
<label for="qcld_wpbotvoicemessage_enter_envato_key">Enter Purchase Code:</label>
</th>
<td colspan="4">
<input type="<?php echo (get_wpbotvoicemessage_envato_key()!=''?'password':'text'); ?>" id="qcld_wpbotvoicemessage_enter_envato_key" name="qcld_wpbotvoicemessage_enter_envato_key" class="regular-text" value="<?php echo get_wpbotvoicemessage_envato_key(); ?>">
<p>You can install the <a target="_blank" href="https://envato.com/market-plugin/">Envato Plugin</a> to stay up to date.</p>
</td>
</tr>
<!-- //start new-update-for-codecanyon -->
<tr>
<th>
<label for="qcld_wpbotvoicemessage_enter_license_or_purchase_key">Enter License Key or Purchase Code:</label>
</th>
<td>
<input type="<?php echo (get_wpbotvoicemessage_license_purchase_code()!=''?'password':'text'); ?>" id="qcld_wpbotvoicemessage_enter_license_or_purchase_key" name="qcld_wpbotvoicemessage_enter_license_or_purchase_key" class="regular-text" value="<?php echo get_wpbotvoicemessage_license_purchase_code(); ?>" required>
</td>
</tr>
<!-- //end new-update-for-codecanyon -->
</table>
<!-- //start new-update-for-codecanyon -->
<input type="hidden" name="qcld_wpbotvoicemessage_buy_from_where" value="<?php echo get_wpbotvoicemessage_licensing_buy_from(); ?>" >
<!-- //end new-update-for-codecanyon -->
<?php submit_button(); ?>
</form>
</div>
<div class="qcld-wpbotvoicemessage-help-section">
<h1>How to get Key File for Google Speech to text API</h1>
<div class="qcld-wpbotvoicemessage-section-block">
<div class="entry-content"> <span id="more-2638"></span>
<p>This plugin has a great voice recognition feature that uses the Google Cloud Speech-to-Text API. Using the provided guide, you can create a new project and get your own Key File.</p>
<h2>Creating the Google Cloud Key File</h2>
<p>If you are a beginner and have never worked Google Cloud before, you will read and accept the <a rel="noreferrer noopener" href="https://cloud.google.com/terms/?_ga=2.121839752.-2023095445.1560767326" target="_blank">Google Cloud Platform Terms of Service</a> and <a rel="noreferrer noopener" target="_blank" href="https://console.cloud.google.com/terms">any applicable services and APIs</a>
</p>
<h6 class="qpvoicemessage-step-6">Step 1</h6>
<p>Everything is ready to begin the process of getting the API key. Visit the <a rel="noreferrer noopener" href="https://console.cloud.google.com/cloud-resource-manager" target="_blank">Google Cloud Platform project</a> to select or create a new project</p>
<h6 class="qpvoicemessage-step-6">Step 2</h6>
<p>Click <strong>+ Create Project</strong> button to create a new Google Cloud Project. Go to <strong>Step 4</strong>, if you have already created a project.</p>
<figure class="wp-block-image">
<img width="483" height="141" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-1.png" alt="Create a New Project" class="wp-image-804 ls-is-cached lazyloaded">
<figcaption>Create a New Project</figcaption>
</figure>
<p>Set a unique name for your project, or use the default project name. And click the <strong>Create</strong> button. Please note that the name of the project cannot be changed later.</p>
<figure class="wp-block-image">
<img width="536" height="237" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-2.png" class="wp-image-805 ls-is-cached lazyloaded">
<figcaption>Create a new project</figcaption>
</figure>
<h6 class="qpvoicemessage-step-6">Step 3</h6>
<p>After creating the project visit the Project Dashboard page.</p>
<figure class="wp-block-image">
<img width="542" height="47" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-3.png" alt="Select your project" class="wp-image-821 ls-is-cached lazyloaded">
<figcaption>Select your project</figcaption>
</figure>
<h6 class="qpvoicemessage-step-6">Step 4</h6>
<p>Visit the<strong> Billing</strong> tab to make sure that billing is enabled for your Google Cloud Platform project. Check out Google Cloud resource <a href="https://cloud.google.com/speech-to-text/pricing" target="_blank" rel="noreferrer noopener" aria-label=" (opens in a new tab)">prices and quotes</a>. You can use a free quote when using Voicer or pay if you use a plugin on a high-load WordPress website.</p>
<figure class="wp-block-image">
<img width="449" height="294" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-4.png" alt="Project billing settings" class="wp-image-808 lazyloaded">
<figcaption>Project billing settings</figcaption>
</figure>
<p>Link a billing account to your project. Learn how to <a rel="noreferrer noopener" aria-label="enable billing (opens in a new tab)" href="https://cloud.google.com/billing/docs/how-to/modify-project" target="_blank">enable billing</a> in Google Cloud Project.</p>
<h6 class="notes">Important</h6>
<p style="background-color:#ebf8ff" class="has-background">Set the <a rel="noreferrer noopener" aria-label="Budget Alerts (opens in a new tab)" href="https://cloud.google.com/billing/docs/how-to/budgets" target="_blank">Budget Alerts</a> to control the use of quotas and debits.</p>
<h6 class="qpvoicemessage-step-6">Step 5</h6>
<p>Enable<a href="https://console.cloud.google.com/flows/enableapi?apiid=speechtotext.googleapis.com" target="_blank" rel="noreferrer noopener" aria-label=" Speech-to-Text (opens in a new tab)"> Speech-to-Text </a>API for your project</p>
<figure class="wp-block-image size-large">
<img width="476" height="294" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-5.png" alt="Register your application" class="wp-image-2652 ls-is-cached lazyloaded">
<figcaption>Register your application</figcaption>
</figure>
<p>Cloud <em>Speech-to-Text</em> API has been enabled for your project</p>
<figure class="wp-block-image size-large">
<img width="414" height="194" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-6.png" alt="API enabled" class="wp-image-2657 ls-is-cached lazyloaded">
<figcaption>API enabled</figcaption>
</figure>
<h6 class="qpvoicemessage-step-6">Step 6</h6>
<p>To use the API you’ll need the right credentials.</p>
<figure class="wp-block-image size-large">
<img width="531" height="452" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-7.png" alt="Add a credential to your project" class="wp-image-2654 ls-is-cached lazyloaded">
<figcaption>Add a credential to your project</figcaption>
</figure>
<p>Click <strong>What credentials do I need? </strong>to proceed. Then click <strong>Create credentials</strong> -> <strong>Service account key</strong>
</p>
<figure class="wp-block-image">
<img width="452" height="418" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-8.png" alt="Voicer Key File Create Credentials" class="wp-image-825 ls-is-cached lazyloaded">
<figcaption>Create Service account key</figcaption>
</figure>
<h6 class="qpvoicemessage-step-6">Step 7</h6>
<p>From the <strong>Service account</strong> list, select <strong>New service account</strong>. In the Service account name field, enter a name.</p>
<figure class="wp-block-image">
<img width="479" height="350" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-9.png" alt="Create key file" class="wp-image-827 ls-is-cached lazyloaded">
<figcaption>Create a JSON file</figcaption>
</figure>
<h6 class="notes">Important</h6>
<p style="background-color:#ebf8ff" class="has-background"><strong>Don’t select</strong> a value from the Role list. No role is required to access this service.</p>
<p>Click <strong>Create</strong>. A note appears, warning that this service account has no role.</p>
<figure class="wp-block-image">
<img width="539" height="274" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-10.png" alt="Voicer Key File Creation
" class="wp-image-833 ls-is-cached lazyloaded">
<figcaption>Service account role</figcaption>
</figure>
<p>Click <strong>Create without role</strong>. A JSON file that contains your key downloads to your computer</p>
<p>After this, the Key File will be generated and saved on your computer. You can find it in your browser’s download folder.</p>
<h2>Upload the key file</h2>
<h6 class="qpvoicemessage-step-6">Step 1</h6>
<p>Visit your WordPress website Admin Panel and open the plugin settings. Go to <strong>BOT-Voice Messages > Settings >General</strong>
</p>
<figure class="wp-block-image size-large">
<img width="793" height="604" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-11.png" >
<figcaption>API Key File settings</figcaption>
</figure>
<h6 class="qpvoicemessage-step-6">Step 2</h6>
<p>Click <strong>Select Key File</strong> and upload your Key File to the WordPress media library.</p>
<figure class="wp-block-image size-large">
<img width="177" height="65" src="<?php echo wpbotvoicemessage_LICENSING__URL; ?>/images/screenshot-12.png" alt="" class="wp-image-2646 ls-is-cached lazyloaded">
<figcaption>API Key</figcaption>
</figure>
<h6 class="qpvoicemessage-step-6">Step 3</h6>
<p>Click <strong>Save Changes</strong> for the changes to take effect.</p>
<p>That’s all for getting the Key File. </p>
</div>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
//start new-update-for-codecanyon
jQuery('#qcld_wpbotvoicemessage_enter_license_or_purchase_key').on('focusout', function(){
qc_wpbotvoicemessage_set_plugin_license_fields();
});
jQuery('#qcld_wpbotvoicemessage_enter_license_or_purchase_key').on('keypress',function (e) {
qc_wpbotvoicemessage_set_plugin_license_fields();
});
jQuery('#qc-license-form input[type="submit"]').on('click', function(){
qc_wpbotvoicemessage_set_plugin_license_fields();
jQuery('#qc-license-form').removeAttr('onsubmit').submit();
});
function qc_wpbotvoicemessage_set_plugin_license_fields(){
var license_input = jQuery('#qcld_wpbotvoicemessage_enter_license_or_purchase_key').val();
if( /^(\w{8})-((\w{4})-){3}(\w{12})$/.test(license_input) ){
jQuery('input[name="qcld_wpbotvoicemessage_buy_from_where"]').val('codecanyon');
jQuery('input[name="qcld_wpbotvoicemessage_enter_envato_key"]').val(license_input);
}else{
jQuery('input[name="qcld_wpbotvoicemessage_buy_from_where"]').val('quantumcloud');
jQuery('input[name="qcld_wpbotvoicemessage_enter_license_key"]').val(license_input);
}
}
//end new-update-for-codecanyon
});
</script>
<?php
}