admin_url( 'admin-ajax.php' ), 'security' => wp_create_nonce( 'iconall_bulk_nonce' ), 'exception_nonce' => wp_create_nonce( 'iconall_exception_upload' ), 'i18n' => [ 'processing' => __( 'در حال تبدیل...', 'iconall' ), 'convert_all' => __( 'تبدیل همه آیکونها', 'iconall' ), 'done' => __( 'همه تبدیلها انجام شد!', 'iconall' ), 'error_stopped' => __( 'تبدیل بهدلیل خطا متوقف شد.', 'iconall' ), 'confirm_msg' => __( 'آیا مطمئن هستید؟ تمام SVGهای موجود در رسانه وردپرس تبدیل میشوند.', 'iconall' ), 'calculating' => __( 'در حال محاسبه تعداد فایلها...', 'iconall' ), 'no_files' => __( 'هیچ فایل SVG برای تبدیل پیدا نشد.', 'iconall' ), 'found' => __( 'فایل SVG برای تبدیل پیدا شد.', 'iconall' ), 'converting' => __( 'در حال تبدیل:', 'iconall' ), 'retry' => __( 'تلاش مجدد...', 'iconall' ), 'net_error' => __( 'خطای شبکه — تلاش مجدد', 'iconall' ), 'confirm_title' => __( 'تأیید فرایند', 'iconall' ), 'cancel' => __( 'انصراف', 'iconall' ), 'proceed' => __( 'ادامه', 'iconall' ), ], ] ); } public function settings_init() { register_setting( 'iconall_settings_group', 'iconall_auto_convert', 'absint' ); register_setting( 'iconall_settings_group', 'iconall_backup_enabled', 'absint' ); if ( get_option( 'iconall_auto_convert' ) === false ) update_option( 'iconall_auto_convert', 1 ); if ( get_option( 'iconall_backup_enabled' ) === false ) update_option( 'iconall_backup_enabled', 1 ); } public function show_notices() { // This only controls whether a success notice is displayed after WordPress's // own Settings API (options.php) redirects back here; it does not process or // save any form data itself, so no nonce check is required — the settings // save nonce is verified by options.php before this redirect ever happens. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $settings_updated = isset( $_GET['settings-updated'] ) ? sanitize_text_field( wp_unslash( $_GET['settings-updated'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; if ( $settings_updated && $page === 'iconall' ) { echo '
' . esc_html__( 'تنظیمات آیکونال با موفقیت ذخیره شد.', 'iconall' ) . '