HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux box12.multicloud.host 4.18.0-553.52.1.el8_10.x86_64 #1 SMP Wed May 14 09:36:12 EDT 2025 x86_64
User: kashmira (1008)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: /home/kashmira/public_html/razitahir.com/wp-content/plugins/stylo-core/stylo-core.php
<?php
/*
* Plugin Name: Stylo Core
* Plugin URI: https://stylothemes.com
* Author: StyloThemes
* Author URI: https://stylothemes.com
* Description: StyloThems Core Plugin for Theme Settinhs.
* Version: 1.1.0
* License: GPL2
* License URI:  https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: stylocore
*/

//If this file is called directly, abort.
if (!defined( 'WPINC' )) {
    die;
}
//Define Constants
if ( !defined('STYLO_PLUGIN_VERSION')) {
    define('STYLO_PLUGIN_VERSION', '1.0.0');
}
if ( !defined('STYLO_PLUGIN_DIR')) {
    define('STYLO_PLUGIN_DIR', plugin_dir_url( __FILE__ ));
}
if(!defined('STYLO_ASSETS_PATH')) {
    define( 'STYLO_ASSETS_PATH', plugins_url( 'assets/', __FILE__ ) );
}
//License Validation
require plugin_dir_path( __FILE__ ). 'inc/License.php';

# Create an instance of the License SDK
$stylo_sdk_license = new LMFW\SDK\License( 
    'stylo-core',   // The plugin name is used to manage internationalization
    'https://stylothemes.com', //Replace with the URL of your license server (without the trailing slash)
    'ck_c0a73d4cdcf4d2319b935c889a3efc282a743f4c', //Customer key created in the license server
    'cs_f36f0e0538eaecfd6c2a97eebafa423d894474dd', //Customer secret created in the license server
    array(), //Set an array of the products IDs on your license server (if no product validation is needed, send an empty array)
    'stylocore_license_data', //Set a unique value to avoid conflict with other plugins
    'stylo_license_status',  //Set a unique value to avoid conflict with other plugins
    30 //How many days the valid object will be used before calling the license server
);

//Include Scripts & Styles
require plugin_dir_path( __FILE__ ). 'inc/scripts.php';

//Settings Menu & Page
require plugin_dir_path( __FILE__ ). 'admin/helper.php';
require plugin_dir_path( __FILE__ ). 'admin/settings.php';
require plugin_dir_path( __FILE__ ). 'admin/fields.php';
require plugin_dir_path( __FILE__ ). 'admin/panel-html.php';
require plugin_dir_path( __FILE__ ). 'inc/validity-test.php';

function stylo_is_plugin_active(){
    return true;
}

//Product Activation
function stylothemes_activate() {

    global $stylo_sdk_license;

    $license_data = get_option('stylocore_license_data');

    // Make sure we have the required data
    if (empty($license_data) || empty($license_data['order_id']) || empty($license_data['license_key'])) {
        wp_send_json_error('Missing required license information');
        wp_die();
    }

    // Add a placeholder email or remove the email parameter
    $admin_email = get_option('admin_email');
    
    $activate = $stylo_sdk_license->activate($admin_email, $license_data['order_id'], $license_data['license_key']);

    if($activate) {
        print_r($activate);
    }

    wp_die();
}
add_action('wp_ajax_stylothemes_activate', 'stylothemes_activate');
add_action('wp_ajax_nopriv_stylothemes_activate', 'stylothemes_activate');

//Product DeActivation
function stylothemes_deactivate() {

    global $stylo_sdk_license;
    $license_data = get_option('stylocore_license_data');
    $deactivate = $stylo_sdk_license->deactivate($license_data['license_key']);

    if($deactivate) {
        print_r($deactivate);
    }
    wp_die();
}
add_action('wp_ajax_stylothemes_deactivate', 'stylothemes_deactivate');
add_action('wp_ajax_nopriv_stylothemes_deactivate', 'stylothemes_deactivate');

function stylothemes_is_valid_license() {

    global $stylo_sdk_license;

    $status = get_option('stylo_license_status');

    if(!empty($status) && $status['is_valid'] == 1) {
        return true;
    } else {
        return false;
    }
}

function license_info_panel() {
    global $stylo_sdk_license;
    $license_data = get_option('stylocore_license_data');
    if(! empty($license_data)) {
        $license_details = $stylo_sdk_license->license_info($license_data['license_key']);
    } else {
        $license_details = array();
    }
    //print_r($license_details);
    if(!empty($license_details)) {
        $license_details_data = $license_details['data'];
        ?>
        <p><strong><?php esc_html_e('License Status:', 'stylo-core') ?></strong> <?php echo esc_html($license_details_data['status'] == 3 ? 'Active' : 'Unavailable') ?></p>
        <p><strong><?php esc_html_e('Activations:', 'stylo-core') ?></strong> <?php echo esc_html($license_details_data['timesActivated'] .'/'. $license_details_data['timesActivatedMax']) ?></p>
        <p><strong><?php esc_html_e('License Expiration:', 'stylo-core') ?></strong> Never</p>
        <?php
    } else {
        ?>
        <p><?php esc_html_e('No license information available.', 'stylo-core') ?></p>
        <?php
    }
    wp_die();
}
add_action('wp_ajax_license_info_panel', 'license_info_panel');
add_action('wp_ajax_nopriv_license_info_panel', 'license_info_panel');

// Remove Email Field
function stylocore_remove_email_field() {
    $license_data = get_option('stylocore_license_data');
    if (!empty($license_data) && isset($license_data['email'])) {
        unset($license_data['email']);
        update_option('stylocore_license_data', $license_data);
    }
}
add_action('admin_init', 'stylocore_remove_email_field');
?>