This is what works for me. Add the following to the child theme functions.php. I have used untouched jnews theme and a child theme where I added the following snippets.
1.
PHP:
add_filter( 'jnews_check_is_license_validated', '__return_true' );
2.
Add this snippet , open wp admin once and then remove or disable it by commenting it. Needed just in case the theme shows unregistered. Once done, the theme will show a migration message.
PHP:
update_option( 'jnews_license', [ 'validated' => true, 'token' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'purchase_code' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' ] );
update_option( 'jnews_dismiss_license_notice', true );
$options = get_option( 'jnews_option', array() );
$options[ 'interval_validation' ] = null;
update_option( 'jnews_option', $options );
3.
This snippet is needed just in case the theme automatically resets the license information. Keep this added always, since this will counter any attempt by theme to reset the license.
PHP:
add_action('updated_option', function( $option_name, $old_value, $value ) {
if ($option_name == 'jnews_license') {
$value[ 'validated'] = true;
$value[ 'token'] = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$value[ 'purchase_code'] = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
}
if ( $option_name == 'jnews_dismiss_license_notice' ) {
$value = true;
}
if ( $option_name == 'jnews_option' ) {
$value[ 'interval_validation'] = time() * 2;
$value[ 'tm_exp' ] = time() * 2;
}
update_option ($option_name, $value);
}, 10, 3);
4.
These REST endpoints are what validate and reset the license info in the background. This snippet will remove the check.
PHP:
add_filter( 'rest_endpoints', function( $endpoints ){
if ( isset( $endpoints['/jnews/v1/resetLicense'] ) ) {
unset( $endpoints['/jnews/v1/resetLicense'] );
}
if ( isset( $endpoints['/jnews/v1/getValidateNoticeLength'] ) ) {
unset( $endpoints['/jnews/v1/getValidateNoticeLength'] );
}
return $endpoints;
});
5.
There is another check in /assets/js/admin/jnews-essential.local.js file. The js file calls the same REST endpoints again in the background. DId not have enough time and patience to mess with the minified js so simply removed it with the following snippet. Works fine for me except that the theme plugin install page lost the plugins sections toggle and plugin update link opens the default wp update screen to update the plugin. If someone has enough patience they may mess with the js to null the REST calls. Nulling these two REST API endpoints will get the theme working just fine.
PHP:
add_action( 'admin_print_styles', 'jnews_remove_admin_styles', 1 );
function jnews_remove_admin_styles() {
wp_dequeue_script( 'jnews-essential-local' );
wp_deregister_script( 'jnews-essential-local' );
}