[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: lc-utility.php
<?php /** * Check Radius Theme License * * @since 1.0 * */ namespace RTLC; class Utility { /** * Start up */ public function __construct() { add_action( 'admin_notices', [$this, 'register_notice'], 1 ); add_action( 'admin_head', [$this, 'style'] ); add_action( 'admin_footer', [$this, 'script'] ); } function register_notice() { //if licensed activated and license page return if ( rtlc_is_valid()['success'] || ( isset( $_GET['page'] ) && $_GET['page'] == 'rtlc') ) return; $class = 'notice notice-error'; if ( isset( rtlc_is_valid()['domain_match'] ) && !rtlc_is_valid()['domain_match'] ) { $message = sprintf( wp_kses( __( '<b>Your license key doesn\'t match your current domain. Please activate the license again for your current domain. <a href="%s">Activate License</a></b>', 'koncrete' ), [ 'a' => [ 'href' => [], 'target' => [] ], 'b' => [] ] ), menu_page_url( 'rtlc', false ) ); printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), $message ); } else { $message = sprintf( wp_kses( __( '<b>Please activate your theme using Envato <a href="%s" target="_blank">purchase code</a>, to get full theme functionality and customer support. <a href="%s">Activate License</a></b>', 'koncrete' ), [ 'a' => [ 'href' => [], 'target' => [] ], 'b' => [] ] ), esc_url('https://help.market.envato.com/hc/en-us/articles/202822600-Where-Is-My-Purchase-Code-'), menu_page_url( 'rtlc', false ) ); printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), $message ); } } /** * Added some css style for rt license page */ function style( $path ) { if ( !isset( $_GET['page'] ) || $_GET['page'] != 'rtlc') return; ?> <style> .rtlc-status-btn { color: white; padding: 5px 15px; border-radius: 5px; } .rtlc-unverified { background: #b32121; } .rtlc-verified { background: #498414; } .rtcl-note { color: red; } .dashicons.spin { animation: dashicons-spin 1s infinite; animation-timing-function: linear; } @keyframes dashicons-spin { 0% { transform: rotate( 0deg ); } 100% { transform: rotate( 360deg ); } } .rtlc-loader { margin-top: 10px; display: inline-block; visibility: hidden; } #rtlc_license_check:focus { box-shadow: none; } .rtcl-active-btn { padding: 5px 20px !important; font-size: 14px !important; } #setting-error-tgmpa { display: none; } </style> <?php } /** * Check license by ajax */ function script() { if( wp_script_is( 'jquery', 'done' ) && ( isset( $_GET['page'] ) && $_GET['page'] == 'rtlc' ) ) { ?> <script type="text/javascript"> jQuery("#rtlc_license_check").on("click", function() { let purchase_code = jQuery('#rt_purchase_code').val(); if ( purchase_code ) { jQuery.ajax({ type: "post", dataType: "json", url: '<?php echo esc_url( admin_url('admin-ajax.php') ); ?>', data: { action: "rtlc_verification", purchase_code, }, beforeSend: function() { jQuery('.rtlc-loader').css("visibility", "inherit"); }, success: function( resp ) { if ( resp === 555 ) { alert('<?php esc_html_e('Purchase code already activated for one domain!!!', 'koncrete'); ?>'); } else { if ( resp ) { jQuery('.rtlc-status-btn').html('<?php esc_html_e('Activated', 'koncrete'); ?>'); jQuery('.rtlc-status-btn').removeClass('rtlc-unverified').addClass('rtlc-verified'); } else { alert('<?php esc_html_e('Sorry!!! Purchase code does not match', 'koncrete'); ?>'); } } jQuery('.rtlc-loader').css("visibility", "hidden"); }, }); } else { alert('<?php esc_html_e('Purchase code is required!!!', 'koncrete'); ?>'); } }); </script> <?php } if ( wp_script_is( 'jquery', 'done' ) && !rtlc_is_valid()['success'] ) { if ( isset( $_GET['page'] ) && $_GET['page'] == 'fw-backups-demo-content' ) { ?> <script type="text/javascript"> jQuery("#fw-ext-backups-demo-list .theme-actions a").on("click", function(e) { e.preventDefault(); alert('<?php esc_html_e('Please activate your theme using Envato purchase code, to install demo data.', 'koncrete'); ?>'); return false; }); </script> <?php } if ( isset( $_GET['page'] ) && $_GET['page'] == 'koncrete-install-plugins' ) { ?> <script type="text/javascript"> jQuery(".row-actions a").on("click", function(e) { if ( jQuery(this).closest('td').next().has('span').length > 0 ) { //find pre packaged e.preventDefault(); alert('<?php esc_html_e('Please activate your theme using Envato purchase code, to use this plugin.', 'koncrete'); ?>'); return false; } }); jQuery(".check-column input").on("change", function(e) { if ( !jQuery(e.target).is(':checked') ) return; if ( jQuery(this).parent().hasClass('column-cb') ) { //all checked or not jQuery('table.wp-list-table > tbody > tr').each(function(index, tr) { if ( jQuery(tr).find('.column-source').has('span').length > 0 ) { jQuery(tr).find('.check-column input').prop('checked', false); } }); } else { if ( jQuery(this).closest('th').next().next().has('span').length > 0 ) { //find pre packaged jQuery(this).prop('checked', false); alert('<?php esc_html_e('Please activate your theme using Envato purchase code, to use this plugin.', 'koncrete'); ?>'); } } }); </script> <?php } } } } if ( is_admin() ) { new Utility(); } if ( !function_exists('rtlc_is_valid') ) { function rtlc_is_valid() { $theme_info = wp_get_theme(); $theme_info = ( $theme_info->parent() ) ? $theme_info->parent() : $theme_info; $koncrete = $theme_info->get('Name'); //replace space $koncrete = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $koncrete))); $get_option = get_option('rt_licenses'); //this first line is for checking old codebase if ( isset( $get_option[$koncrete.'_license_key'] ) ) { return [ 'success' => true, 'domain_match' => true ]; } else if ( isset( $get_option[$koncrete.'_license'] ) && isset( $get_option[$koncrete.'_license']['key'] ) ) { $domian_name = esc_url( home_url() ); $domain = $get_option[$koncrete.'_license']['domain']; $domian_name = str_replace(['https', 'http'], ['', ''], $domian_name); $domain = str_replace(['https', 'http'], ['', ''], $domain); if ( $domian_name == $domain ) { return [ 'success' => true, 'domain_match' => true ]; } else { return [ 'success' => false, 'domain_match' => false ]; } } else { return [ 'success' => false ]; } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium264.web-hosting.com
Server IP: 69.57.162.13
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium264.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 73.71 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kidscntx
User ID (UID): 1154
Group ID (GID): 1112
Script Owner UID: 1154
Current Dir Owner: 1154