SVG ایمن

توضیحات

افزونه امنیت vsg بهترین روش برای اجازه آپلود فایل vsg در وردپرس است!

این امکان را به شما می دهد تا آپلودهای SVG را مجاز کنید و در عین حال مطمئن شوید که برای جلوگیری از آسیب پذیری های SVG/XML که سایت شما را تحت تأثیر قرار می دهند، ضد عفونی شده اند.
همچنین به شما این امکان را می دهد که SVG های آپلود شده خود را در کتابخانه رسانه در همه نماها پیش نمایش کنید.

ویژگی های فعلی

  • Sanitised SVGs – Don’t open up security holes in your WordPress site by allowing uploads of unsanitised files.
  • SVGO Optimisation – Runs your SVGs through the SVGO tool on upload to save you space. This feature is disabled by default but can be enabled by adding the following code: add_filter( 'safe_svg_optimizer_enabled', '__return_true' );
  • مشاهده SVG در کتابخانه رسانه – زمان حدس زدن اینکه کدام SVG درست است گذشته است، پیش‌نمایش SVG را در کتابخانه رسانه وردپرس فعال می‌کنیم.
  • انتخاب چه کسی می‌تواند آپلود کند – آپلودهای SVG را به کاربران خاصی در سایت وردپرس خود محدود کنید یا به هر کسی اجازه آپلود دهید.

در ابتدا یک اثبات مفهوم برای #24251

پاکسازی SVG از طریق کتابخانه زیر انجام می‌شود: https://github.com/darylldoyle/svg-sanitizer

SVG Optimization is done through the following library: https://github.com/svg/svgo.

بلوک‌ها

این افزونه 1 بلوک ارائه می‌دهد.

  • Safe SVG Display the SVG icon

نصب

از طریق دایرکتوری وردپرس نصب کنید یا فایل ها را از حالت فشرده خارج کنید و در فهرست /wp-content/plugins/ خود آپلود کنید.

سوالات متداول

آیا می توانیم ویژگی ها و برچسب های مجاز را تغییر دهیم؟

بله، این کار را می توان با استفاده از فیلترهای svg_allowed_attributes و svg_allowed_tags انجام داد.
آنها یک آرگومان می گیرند که باید برگردانده شود. برای نمونه به زیر مراجعه کنید:

add_filter( 'svg_allowed_attributes', function ( $attributes ) {

    // Do what you want here...

    // This should return an array so add your attributes to
    // to the $attributes array before returning it. E.G.

    $attributes[] = 'target'; // This would allow the target="" attribute.

    return $attributes;
} );


add_filter( 'svg_allowed_tags', function ( $tags ) {

    // Do what you want here...

    // This should return an array so add your tags to
    // to the $tags array before returning it. E.G.

    $tags[] = 'use'; // This would allow the <use> element.

    return $tags;
} );

نقد و بررسی‌ها

10 ژانویه 2024 5 پاسخ
Hello everyone,the Plugin does not work for me, I refreshed, logged in and out, checked several different svg files but the uploading is still not possible.After having read so many positive reviews I think I am an exception. Thanks for any advice!
16 آگوست 2023 1 پاسخ
I don’t understand why this isn’t in core wordpress. Plugin integrates flawlessly into the website and causes no issues.
خواندن تمامی 73 نقد و بررسی‌

توسعه دهندگان و همکاران

“SVG ایمن” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

“SVG ایمن” به 29 زبان ترجمه شده است. با تشکر از مترجمین برای همکاری و کمک‌هایشان.

ترجمه “SVG ایمن” به زبان شما.

علاقه‌ مند به توسعه هستید؟

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

گزارش تغییرات

2.3.1 – 2024-12-05

2.3.0 – 2024-11-25

2.2.6 – 2024-08-28

2.2.5 – 2024-06-27

2.2.4 – 2024-03-28

2.2.3 – 2024-03-20

2.2.2 – 2023-11-21

2.2.1 – 2023-10-23

2.2.0 – 2023-08-21

View historical changelog details here.