321 lines
14 KiB
PHP
321 lines
14 KiB
PHP
<?php
|
||
/**
|
||
* مهاجرت از هلو به حسابیکس آرک — URLها، محتوا، ایجاد برگه
|
||
*
|
||
* @package Hesabix2
|
||
*/
|
||
|
||
if (!defined('ABSPATH')) {
|
||
exit;
|
||
}
|
||
|
||
/**
|
||
* آدرس صفحهٔ مهاجرت از هلو.
|
||
*
|
||
* @return string
|
||
*/
|
||
function hesabix2_helo_page_url() {
|
||
static $cached = null;
|
||
if ($cached !== null) {
|
||
return $cached;
|
||
}
|
||
$pages = get_pages(
|
||
array(
|
||
'meta_key' => '_wp_page_template',
|
||
'meta_value' => 'page-helo-hesabix.php',
|
||
'number' => 1,
|
||
)
|
||
);
|
||
$cached = !empty($pages)
|
||
? get_permalink($pages[0]->ID)
|
||
: home_url('/helo/');
|
||
return apply_filters('hesabix2_helo_page_url', $cached);
|
||
}
|
||
|
||
/**
|
||
* لینک مستقیم دانلود برنامهٔ انتقالدهنده.
|
||
*
|
||
* @return string
|
||
*/
|
||
function hesabix2_helo_migrator_url() {
|
||
$default = '';
|
||
$option = get_option('hesabix2_helo_migrator_url', $default);
|
||
$url = is_string($option) && $option !== '' ? $option : $default;
|
||
return esc_url_raw(apply_filters('hesabix2_helo_migrator_url', $url));
|
||
}
|
||
|
||
/**
|
||
* نسخهٔ نمایشی انتقالدهنده.
|
||
*
|
||
* @return string
|
||
*/
|
||
function hesabix2_helo_migrator_version() {
|
||
$ver = get_option('hesabix2_helo_migrator_version', '1.0.0');
|
||
if (!is_string($ver) || $ver === '') {
|
||
$ver = '1.0.0';
|
||
}
|
||
return apply_filters('hesabix2_helo_migrator_version', $ver);
|
||
}
|
||
|
||
/**
|
||
* حداقل سیستمعامل برای انتقالدهنده.
|
||
*
|
||
* @return string
|
||
*/
|
||
function hesabix2_helo_migrator_min_os() {
|
||
$os = get_option('hesabix2_helo_migrator_min_os', 'Windows 10 / 11 (64-bit)');
|
||
if (!is_string($os) || $os === '') {
|
||
$os = 'Windows 10 / 11 (64-bit)';
|
||
}
|
||
return apply_filters('hesabix2_helo_migrator_min_os', $os);
|
||
}
|
||
|
||
/**
|
||
* حجم تقریبی پکیج انتقالدهنده.
|
||
*
|
||
* @return string
|
||
*/
|
||
function hesabix2_helo_migrator_size() {
|
||
$size = get_option('hesabix2_helo_migrator_size', '≈ ۱۵ مگابایت');
|
||
if (!is_string($size) || $size === '') {
|
||
$size = '≈ ۱۵ مگابایت';
|
||
}
|
||
return apply_filters('hesabix2_helo_migrator_size', $size);
|
||
}
|
||
|
||
/**
|
||
* URL تصویر مرجع هلو (لوگوی رسمی).
|
||
*
|
||
* @return string
|
||
*/
|
||
function hesabix2_helo_product_image_url() {
|
||
$candidates = array(
|
||
'/assets/img/helo/holoo-logo.png',
|
||
'/assets/img/helo/holoo-badge.png',
|
||
'/assets/img/helo/holoo-product.png',
|
||
);
|
||
foreach ($candidates as $rel) {
|
||
$path = get_template_directory() . $rel;
|
||
if (file_exists($path)) {
|
||
return apply_filters('hesabix2_helo_product_image_url', get_template_directory_uri() . $rel);
|
||
}
|
||
}
|
||
return apply_filters('hesabix2_helo_product_image_url', '');
|
||
}
|
||
|
||
/**
|
||
* URL نشان/لوگوی کوچک هلو.
|
||
*
|
||
* @return string
|
||
*/
|
||
function hesabix2_helo_badge_image_url() {
|
||
$candidates = array(
|
||
'/assets/img/helo/holoo-logo.png',
|
||
'/assets/img/helo/holoo-badge.png',
|
||
);
|
||
foreach ($candidates as $rel) {
|
||
$path = get_template_directory() . $rel;
|
||
if (file_exists($path)) {
|
||
return apply_filters('hesabix2_helo_badge_image_url', get_template_directory_uri() . $rel);
|
||
}
|
||
}
|
||
return apply_filters('hesabix2_helo_badge_image_url', '');
|
||
}
|
||
|
||
/**
|
||
* تیترهای طعنهآمیز صریح برای نوار متحرک.
|
||
*
|
||
* @return array<int, string>
|
||
*/
|
||
function hesabix2_helo_roast_lines() {
|
||
$lines = array(
|
||
__('هلو هنوز روی دسکتاپ زندانیست؛ آرک روی وب، موبایل و ویندوز زنده است.', 'hesabix2'),
|
||
__('لایسنس، دانگل، نصب روی یک PC — مدلشان عوض نشده؛ دنیا عوض شده.', 'hesabix2'),
|
||
__('بکآپ روی هارد فروشگاه؟ دادهتان هنوز در عصر فلشمموری زندگی میکند.', 'hesabix2'),
|
||
__('هلو حسابداری میفروشد. حسابیکس آرک کسبوکار میسازد.', 'hesabix2'),
|
||
__('نوستالژی خوب است — برای فیلم؛ نه برای دفترکل.', 'hesabix2'),
|
||
__('ارتقای هلو یعنی دوباره پول بدهید تا کمی کمتر عقب بمانید.', 'hesabix2'),
|
||
);
|
||
return apply_filters('hesabix2_helo_roast_lines', $lines);
|
||
}
|
||
|
||
/**
|
||
* ردیفهای مقایسهٔ هلو در برابر آرک.
|
||
*
|
||
* @return array<int, array{label: string, helo: string, arc: string}>
|
||
*/
|
||
function hesabix2_helo_compare_rows() {
|
||
$rows = array(
|
||
array(
|
||
'label' => __('رابط کاربری', 'hesabix2'),
|
||
'helo' => __('پنجرههای خاکستری، منوهای تو در تو، حس ویندوز ویستا', 'hesabix2'),
|
||
'arc' => __('پنل مدرن، سریع، یکپارچه — طراحی برای کار واقعی', 'hesabix2'),
|
||
),
|
||
array(
|
||
'label' => __('دسترسی', 'hesabix2'),
|
||
'helo' => __('یک کامپیوتر. اگر خاموش باشد، کسبوکارتان هم خاموش است', 'hesabix2'),
|
||
'arc' => __('وب + اندروید + ویندوز؛ از هرجا، با هر نقشی', 'hesabix2'),
|
||
),
|
||
array(
|
||
'label' => __('بهروزرسانی', 'hesabix2'),
|
||
'helo' => __('نصب مجدد، ترس از خراب شدن دیتابیس، هزینهٔ نسخهٔ جدید', 'hesabix2'),
|
||
'arc' => __('بهروزرسانی مداوم روی سرور — بدون مراسم نصب', 'hesabix2'),
|
||
),
|
||
array(
|
||
'label' => __('دامنهٔ محصول', 'hesabix2'),
|
||
'helo' => __('حسابداری فروشگاهی؛ بقیهٔ کارها را خودتان جور کنید', 'hesabix2'),
|
||
'arc' => __('حسابداری + فروش + انبار + CRM + اتوماسیون + هوش مصنوعی', 'hesabix2'),
|
||
),
|
||
array(
|
||
'label' => __('مالکیت داده', 'hesabix2'),
|
||
'helo' => __('گروگان فایل بکآپ و نمایندهٔ محلی', 'hesabix2'),
|
||
'arc' => __('دسترسی شفاف، خروجی استاندارد، کنترل در دست شما', 'hesabix2'),
|
||
),
|
||
array(
|
||
'label' => __('هزینهٔ واقعی', 'hesabix2'),
|
||
'helo' => __('لایسنس + ارتقا + پشتیبانی + زمان تلفشده روی نصب', 'hesabix2'),
|
||
'arc' => __('شروع رایگان؛ رشد با نیاز کسبوکار — بدون نمایشگاه لایسنس', 'hesabix2'),
|
||
),
|
||
array(
|
||
'label' => __('آینده', 'hesabix2'),
|
||
'helo' => __('همان مسیر قدیمی با برچسب جدید روی جعبه', 'hesabix2'),
|
||
'arc' => __('پلتفرم باز، API، جامعه و نقشهٔ راه علنی', 'hesabix2'),
|
||
),
|
||
);
|
||
return apply_filters('hesabix2_helo_compare_rows', $rows);
|
||
}
|
||
|
||
/**
|
||
* دلایل مهاجرت (بخش roast/why).
|
||
*
|
||
* @return array<int, array{title: string, desc: string, jab: string, icon: string}>
|
||
*/
|
||
function hesabix2_helo_why_items() {
|
||
$items = array(
|
||
array(
|
||
'icon' => 'chain',
|
||
'title' => __('از زندان دسکتاپ آزاد شوید', 'hesabix2'),
|
||
'jab' => __('هلو شما را به یک PC قفل کرده است.', 'hesabix2'),
|
||
'desc' => __('در آرک تیمتان همزمان کار میکند — فروشگاه، انبار، دفتر و موبایل؛ یک منبع حقیقت.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'icon' => 'clock',
|
||
'title' => __('وقت با گزارش خاکستری نمیگذرد', 'hesabix2'),
|
||
'jab' => __('اگر پیدا کردن موجودی شبیه باستانشناسی است، مقصر نرمافزار است.', 'hesabix2'),
|
||
'desc' => __('داشبورد لحظهای، فاکتور سریع و CRM در همان پنل — بدون تور چندپنجرهای.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'icon' => 'unlock',
|
||
'title' => __('دادهتان گروگان نیست', 'hesabix2'),
|
||
'jab' => __('بکآپ فلشمموری، استراتژی امنیتی قرن گذشته است.', 'hesabix2'),
|
||
'desc' => __('خروجی استاندارد، انتقال شفاف با ابزار رسمی، و تضمین دسترسی به اطلاعات خودتان.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'icon' => 'rocket',
|
||
'title' => __('از حسابداری تا پلتفرم', 'hesabix2'),
|
||
'jab' => __('هلو همان حسابداری همیشگی را گرانتر میفروشد.', 'hesabix2'),
|
||
'desc' => __('آرک همان حسابداری را دارد — بهعلاوهٔ انبار، فروش، اتوماسیون و ابزارهای رشد.', 'hesabix2'),
|
||
),
|
||
);
|
||
return apply_filters('hesabix2_helo_why_items', $items);
|
||
}
|
||
|
||
/**
|
||
* مراحل مهاجرت.
|
||
*
|
||
* @return array<int, array{title: string, desc: string}>
|
||
*/
|
||
function hesabix2_helo_migrate_steps() {
|
||
$steps = array(
|
||
array(
|
||
'title' => __('حساب آرک بسازید', 'hesabix2'),
|
||
'desc' => __('در پنل آرک ثبتنام کنید. رایگان شروع کنید — لازم نیست اول همهچیز را منتقل کنید.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'title' => __('انتقالدهنده را دانلود کنید', 'hesabix2'),
|
||
'desc' => __('برنامهٔ رسمی مهاجرت از همین صفحه. روی همان ویندوزی که هلو نصب است اجرا کنید.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'title' => __('خروجی امن از هلو', 'hesabix2'),
|
||
'desc' => __('ابزار به دادههای هلو وصل میشود، اطلاعات را میخواند و بستهٔ انتقال میسازد — بدون شعبدهبازی دستی در اکسل.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'title' => __('وارد آرک شوید و تأیید کنید', 'hesabix2'),
|
||
'desc' => __('بسته را در آرک بارگذاری کنید، پیشنمایش ببینید، تأیید کنید. کسبوکار ادامه دارد؛ هلو میتواند بازنشسته شود.', 'hesabix2'),
|
||
),
|
||
);
|
||
return apply_filters('hesabix2_helo_migrate_steps', $steps);
|
||
}
|
||
|
||
/**
|
||
* پرسشهای متداول.
|
||
*
|
||
* @return array<int, array{q: string, a: string}>
|
||
*/
|
||
function hesabix2_helo_faq_items() {
|
||
$items = array(
|
||
array(
|
||
'q' => __('کدام نسخههای هلو پشتیبانی میشوند؟', 'hesabix2'),
|
||
'a' => __('ابزار روی نسخههای رایج فروشگاهی و شرکتی هلو روی ویندوز کار میکند. اگر نسخهٔ خیلی قدیمی یا سفارشی دارید، قبل از انتقال با پشتیبانی حسابیکس چک کنید.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'q' => __('آیا اطلاعاتم ناقص منتقل میشود؟', 'hesabix2'),
|
||
'a' => __('هدف ابزار انتقال منطقی اشخاص، کالا، موجودی، اسناد و ماندههاست. قبل از نهاییسازی، پیشنمایش و گزارش مغایرت میبینید تا چیزی جا نماند.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'q' => __('باید هلو را فوراً حذف کنم؟', 'hesabix2'),
|
||
'a' => __('نه. پیشنهاد ما موازیکاری کوتاهمدت است: انتقال، تأیید، سپس خاموشکردن هلو. عجله برای پاککردن دیتابیس قدیم ندارید.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'q' => __('هزینهٔ مهاجرت چقدر است؟', 'hesabix2'),
|
||
'a' => __('برنامهٔ انتقالدهنده از همین صفحه در دسترس است. شروع کار با آرک رایگان است؛ برای حجمهای سازمانی یا همراهی تخصصی میتوانید با پشتیبانی هماهنگ کنید.', 'hesabix2'),
|
||
),
|
||
array(
|
||
'q' => __('چرا اینقدر صریح دربارهٔ هلو حرف میزنید؟', 'hesabix2'),
|
||
'a' => __('چون کاربرانش را میشناسیم: سالها با رابط قدیمی، لایسنس و محدودیت دسکتاپ ساختهاند. مهاجرت یک تصمیم فنی است؛ تعارف بازاریابی کمکی نمیکند. محصول بهتر را نشان میدهیم.', 'hesabix2'),
|
||
),
|
||
);
|
||
return apply_filters('hesabix2_helo_faq_items', $items);
|
||
}
|
||
|
||
/**
|
||
* ایجاد یکبارهٔ برگهٔ مهاجرت از هلو.
|
||
*/
|
||
function hesabix2_maybe_create_helo_page() {
|
||
if (get_option('hesabix2_helo_page_created')) {
|
||
return;
|
||
}
|
||
$existing = get_pages(
|
||
array(
|
||
'meta_key' => '_wp_page_template',
|
||
'meta_value' => 'page-helo-hesabix.php',
|
||
'number' => 1,
|
||
)
|
||
);
|
||
if (!empty($existing)) {
|
||
update_option('hesabix2_helo_page_created', 1);
|
||
return;
|
||
}
|
||
$by_path = get_page_by_path('helo');
|
||
if ($by_path) {
|
||
update_post_meta($by_path->ID, '_wp_page_template', 'page-helo-hesabix.php');
|
||
update_option('hesabix2_helo_page_created', 1);
|
||
return;
|
||
}
|
||
$page_id = wp_insert_post(
|
||
array(
|
||
'post_title' => __('مهاجرت از هلو به حسابیکس آرک', 'hesabix2'),
|
||
'post_name' => 'helo',
|
||
'post_status' => 'publish',
|
||
'post_type' => 'page',
|
||
'post_content' => '',
|
||
'post_excerpt' => __('خداحافظی با هلو و انتقال داده به حسابیکس آرک — دانلود برنامهٔ انتقالدهنده و شروع رایگان.', 'hesabix2'),
|
||
),
|
||
true
|
||
);
|
||
if (!is_wp_error($page_id) && $page_id) {
|
||
update_post_meta($page_id, '_wp_page_template', 'page-helo-hesabix.php');
|
||
update_option('hesabix2_helo_page_created', 1);
|
||
}
|
||
}
|
||
add_action('after_setup_theme', 'hesabix2_maybe_create_helo_page', 35);
|