-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from codersaiful/3.4.9.0
3.4.9.0
- Loading branch information
Showing
7 changed files
with
65 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,12 +59,6 @@ public function admin_menu() | |
if( ! $this->is_pro ){ | ||
add_submenu_page( $this->main_slug, esc_html__( 'GET PRO VERSION', 'woo-product-table' ), __( 'Get <strong>Pro</strong>', 'woo-product-table' ), 'read', 'https://wooproducttable.com/pricing/' ); | ||
} | ||
// var_dump($this->license); | ||
|
||
//License Menu if pro version is getter or equal V2.0.8.4 | ||
// if( is_object( $this->license ) && version_compare($this->pro_version, '2.0.8.4', '>=')){ | ||
// add_submenu_page( $this->main_slug, __('Min Max Control License', 'wcmmq_pro'), __( 'License', 'wcmmq_pro' ), $capability, 'wcmmq-license', [$this->license, 'license_page'] ); | ||
// } | ||
|
||
} | ||
|
||
|
@@ -159,14 +153,18 @@ public function handle_license_n_update() | |
$this->license_status_key = 'wpt_pro_license_status'; | ||
$this->license_status = get_option( $this->license_status_key ); | ||
$this->license_data = get_option($this->license_data_key); | ||
|
||
|
||
add_action( 'admin_notices', [$this, 'license_activation_message'] ); | ||
|
||
/** | ||
* Actually if not found lisen data, we will return null here | ||
* | ||
* @since 3.4.3.0 | ||
* @author Saiful Islam <[email protected]> | ||
*/ | ||
if( empty( $this->license_status ) || empty( $this->license_data ) ) return; | ||
|
||
$expires = isset($this->license_data->expires) ? $this->license_data->expires : ''; | ||
$this->item_id = isset($this->license_data->item_id) ? $this->license_data->item_id : ''; | ||
if('lifetime' == $expires) return; | ||
|
@@ -198,9 +196,35 @@ public function handle_license_n_update() | |
add_action( 'admin_notices', [$this, 'renew_license_notice'] ); | ||
} | ||
|
||
|
||
} | ||
|
||
public function license_activation_message() | ||
{ | ||
|
||
if( ! empty( $_GET['page'] ) && $_GET['page'] === 'woo-product-table-license' ) return; | ||
if(empty($this->item_id)) return; | ||
$wpt_logo = WPT_ASSETS_URL . 'images/logo.png'; | ||
|
||
if( empty( $this->license_status ) || $this->license_status === 'invalid' || $this->license_status === 'site_inactive' || $this->license_status === 'inactive' ){ | ||
$wpt_logo = WPT_ASSETS_URL . 'images/logo.png'; | ||
|
||
$link_label = __( 'Activate License', 'wpt_pro' ); | ||
$link = admin_url('edit.php?post_type=wpt_product_table&page=woo-product-table-license'); | ||
$message = esc_html__( ' Please Activate License to get Pro Feature', 'wpt_pro' ); | ||
ob_start(); | ||
?> | ||
<div class="error wpt-renew-license-notice"> | ||
<div class="wpt-license-notice-inside"> | ||
<img src="<?php echo esc_url( $wpt_logo ); ?>" class="wpt-license-brand-logo"> | ||
Your License of <strong>Woo Product Table pro</strong> is <span style="color: #d00;font-weight:bold;">Invalid/Inactive</span> | ||
%1$s <a href="%2$s">%3$s</a> | ||
</div> | ||
</div> | ||
<?php | ||
$full_message = ob_get_clean(); | ||
printf( $full_message, $message, $link, $link_label ); | ||
} | ||
} | ||
public function renew_license_notice() | ||
{ | ||
|
||
|
@@ -209,7 +233,7 @@ public function renew_license_notice() | |
$expired_date = date( 'd M, Y', $this->exp_timestamp ); | ||
$link_label = __( 'Renew License', 'wpt_pro' ); | ||
$link = "https://codeastrology.com/checkout/?edd_license_key={$this->license_key}&download_id={$this->item_id}"; | ||
$message = esc_html__( ' Renew it to get latest update.', 'wpt_pro' ) . '</strong>'; | ||
$message = esc_html__( ' Renew it to enable pro features.', 'wpt_pro' ) . '</strong>'; | ||
ob_start(); | ||
?> | ||
<div class="error wpt-renew-license-notice"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Product Table for WooCommerce by CodeAstrology (WooproductTable) | ||
* Requires Plugins: woocommerce | ||
* Plugin URI: https://wooproducttable.com/pricing/?utm_source=WPT+Plugin+Dashboard&utm_medium=Free+Version | ||
* Description: (WooProductTable - woo product table) WooCommerce product table plugin helps you to display your products in a searchable table layout with filters. Boost conversions & sales. Woo Product Table is best for Wholesale. wooproducttable, woo-product-table | ||
* Author: CodeAstrology Team | ||
|
@@ -11,7 +12,7 @@ | |
* Requires at least: 4.0.0 | ||
* Tested up to: 6.5.2 | ||
* WC requires at least: 5.0.0 | ||
* WC tested up to: 8.7.2 | ||
* WC tested up to: 8.8.3 | ||
* | ||
* | ||
* Text Domain: woo-product-table | ||
|
@@ -446,6 +447,15 @@ public function init(){ | |
* @author Saiful Islam <[email protected]> | ||
*/ | ||
include_once $dir . '/autoloader.php'; | ||
|
||
/** | ||
* Include Functions | ||
* it was bottom site of this method, | ||
* I have bring at the begining of this method. | ||
* | ||
* @since 3.4.9.0 | ||
*/ | ||
include_once $this->path('BASE_DIR','includes/functions.php'); | ||
//why this file outside of is_admin() actually if we want to show preview, need load outside. | ||
include_once $this->path('BASE_DIR','admin/wpt_product_table_post.php'); | ||
if( is_admin() ){ | ||
|
@@ -501,7 +511,7 @@ public function init(){ | |
*/ | ||
//include_once $this->path('BASE_DIR','includes/wpt_product_table_post.php'); | ||
include_once $this->path('BASE_DIR','includes/enqueue.php'); | ||
include_once $this->path('BASE_DIR','includes/functions.php'); | ||
|
||
include_once $this->path('BASE_DIR','includes/helper-functions.php'); | ||
include_once $this->path('BASE_DIR','includes/shortcode.php'); | ||
|
||
|