diff --git a/03_WordPress/wp-content/plugins/ifnex-bridge/ifnex-bridge.php b/03_WordPress/wp-content/plugins/ifnex-bridge/ifnex-bridge.php
new file mode 100644
index 0000000..e5638fb
--- /dev/null
+++ b/03_WordPress/wp-content/plugins/ifnex-bridge/ifnex-bridge.php
@@ -0,0 +1,52 @@
+
تنظیمات ذخیره شد.
';
+ }
+
+ $api_url = get_option('ifnex_api_url', 'http://localhost:8000/api/v1');
+ $api_key = get_option('ifnex_api_key', '');
+ ?>
+
+
تنظیمات IFNEX Logistics Bridge
+
+
+ api_url = rtrim(get_option('ifnex_api_url', 'http://localhost:8000/api/v1'), '/');
+ $this->api_key = get_option('ifnex_api_key', '');
+ }
+
+ public function track_shipment($awb_no) {
+ if (empty($this->api_key)) {
+ return new WP_Error('no_api_key', 'API Key تنظیم نشده است.');
+ }
+
+ $url = $this->api_url . '/track/' . urlencode($awb_no);
+
+ $args = array(
+ 'headers' => array(
+ 'Authorization' => 'Bearer ' . $this->api_key,
+ 'Accept' => 'application/json',
+ ),
+ 'timeout' => 30,
+ );
+
+ $response = wp_remote_get($url, $args);
+
+ if (is_wp_error($response)) {
+ return $response;
+ }
+
+ $body = wp_remote_retrieve_body($response);
+ $data = json_decode($body, true);
+
+ if ($response['response']['code'] === 404) {
+ return new WP_Error('not_found', 'مرسولهای با این کد پیدا نشد.');
+ }
+
+ if ($response['response']['code'] !== 200) {
+ return new WP_Error('api_error', 'خطا در ارتباط با API: ' . ($data['message'] ?? 'Unknown error'));
+ }
+
+ return $data;
+ }
+}
diff --git a/03_WordPress/wp-content/plugins/ifnex-bridge/includes/shortcodes.php b/03_WordPress/wp-content/plugins/ifnex-bridge/includes/shortcodes.php
new file mode 100644
index 0000000..d9f5651
--- /dev/null
+++ b/03_WordPress/wp-content/plugins/ifnex-bridge/includes/shortcodes.php
@@ -0,0 +1,88 @@
+ 'رهگیری مرسوله',
+ 'placeholder' => 'شماره بارنامه را وارد کنید',
+ 'button_text' => 'رهگیری',
+ ), $atts);
+
+ ob_start();
+ ?>
+
+ '',
+ ), $atts);
+
+ if (empty($atts['awb'])) {
+ return 'شماره بارنامه وارد نشده است.
';
+ }
+
+ $client = new IFNEX_API_Client();
+ $result = $client->track_shipment($atts['awb']);
+
+ if (is_wp_error($result)) {
+ return '' . esc_html($result->get_error_message()) . '
';
+ }
+
+ ob_start();
+ ?>
+
+
وضعیت مرسوله
+
+
+
+
+
نوع:
+
جهت:
+
فرستنده:
+
گیرنده:
+
+
+
+
+
+ post_content, 'ifnex_tracking_form')) {
+ ?>
+
+
+ false, 'message' => 'شماره بارنامه وارد نشده است.'));
+ return;
+ }
+
+ $client = new IFNEX_API_Client();
+ $result = $client->track_shipment($awb);
+
+ if (is_wp_error($result)) {
+ wp_send_json(array('success' => false, 'message' => $result->get_error_message()));
+ return;
+ }
+
+ // ساخت HTML نتیجه
+ ob_start();
+ ?>
+
+
وضعیت مرسوله
+
+
+
+
+
نوع:
+
جهت:
+
+
فرستنده:
+
+
+
گیرنده:
+
+
+
+
+
+
+ true, 'html' => $html));
+}