Skip to content

Commit 7fa8a81

Browse files
committed
added images
1 parent 8e527df commit 7fa8a81

11 files changed

Lines changed: 31 additions & 19 deletions

.DS_Store

0 Bytes
Binary file not shown.

.wordpress-org/banner-772x250.png

27.7 KB
Loading

.wordpress-org/icon-128x128.png

5.62 KB
Loading

.wordpress-org/icon-256x256.png

-20.7 KB
Binary file not shown.

.wordpress-org/screenshot-1.png

52.7 KB
Loading

.wordpress-org/screenshot-2.png

71 KB
Loading

.wordpress-org/screenshot-3.png

68.8 KB
Loading

.wordpress-org/screenshot-4.png

66.3 KB
Loading

cbwct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin URI: https://wordpress.org/plugins/wc-order-tracker/
55
Description: Your customer can track his/her order on your WooCommerce website easily, woocommerce order tracking system with ajax
66
Author: Md Abul Bashar
7-
Version: 1.2.3
7+
Version: 1.2.4
88
Author URI: https://facebook.com/hmbashar
99
Text Domain: cbwct
1010
Requires Plugins: woocommerce

inc/custom.php

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,39 @@
66

77
// Show Admin notice if Woocommerce plugin isn't installed.
88

9-
function cbwct_notice_for_wc_admin_notice(){
10-
11-
if (!class_exists( 'WooCommerce' )) {
12-
if( ! function_exists('get_plugin_data') ){
13-
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
14-
}
15-
$plugin_data = get_plugin_data( CBWCT_TRACKER_PATH .'cbwct.php' );
16-
$woo_url = 'https://wordpress.org/plugins/woocommerce/';
17-
18-
printf('<div class="notice notice-error">
19-
<p><a href="%s" target="_blank">Woocommerce</a> Is Required! Woocommerce plugin needs to activated if you want to install the <strong>"%s"</strong> plugin.</p>
20-
</div>', $woo_url, $plugin_data['Name']);
21-
}else {
22-
return false;
23-
}
24-
9+
function cbwct_notice_for_wc_admin_notice() {
10+
// Check if WooCommerce is not active
11+
if (!class_exists('WooCommerce')) {
12+
// Include the plugin.php file if the get_plugin_data function is not available
13+
if (!function_exists('get_plugin_data')) {
14+
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
15+
}
16+
17+
// Get plugin data
18+
$plugin_data = get_plugin_data(CBWCT_TRACKER_PATH . 'cbwct.php');
19+
$woo_url = 'https://wordpress.org/plugins/woocommerce/';
20+
21+
// Display the admin notice with proper translation and escaping
22+
printf(
23+
'<div class="notice notice-error">
24+
<p>%s</p>
25+
</div>',
26+
sprintf(
27+
/* translators: %1$s is the WooCommerce link, %2$s is the plugin name */
28+
esc_html__('The %2$s plugin requires WooCommerce to be installed and activated. Please install and activate WooCommerce from %1$s.', 'cbwet'),
29+
'<a href="' . esc_url($woo_url) . '" target="_blank">' . esc_html__('the WordPress plugin repository', 'cbwet') . '</a>',
30+
esc_html($plugin_data['Name'])
31+
)
32+
);
33+
} else {
34+
return false;
35+
}
2536
}
2637
add_action('admin_notices', 'cbwct_notice_for_wc_admin_notice');
2738

2839

2940

41+
3042
if(!class_exists('CBWCT_ORDER_TRACKER')) {
3143

3244
final class CBWCT_ORDER_TRACKER {

0 commit comments

Comments
 (0)