Support » Plugin: Ocean Extra » SVG/ xml uploads and its cancellation problem

  • By default, WordPress prohibits downloading a number of file formats from the mediafile admin console, for example svg. After installing OceanExtra xml/ svg files can be easily downloaded which is not good for our project for security reason. When the plugin is deactivated, the default deny-download function works perfect. Can I somehow prohibit the download of svg/xml when OceanExtra is active, for example, via functions.php of other way? Standard WordPress hooks such as deny/allow mime-types doesn’t work (code conflict breaking the site).

    • This topic was modified 6 months, 3 weeks ago by aleksandravu.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Abhishek

    (@abhikr781)

    Hello,

    I apologize for the delay in response.

    It’s because Ocean Extra allows the use of icons and images, and that an update will be released soon along with a filter to disable this option.
    You can add the below code in the functions.php file of a child theme or using a plugin like Woody, but only after the next Ocean Extra update and not before.
    add_filter( 'oe_icon_picker_image_mime_types_svg', '__return_false' );

    Thread Starter aleksandravu

    (@aleksandravu)

    Hello,

    Great thanks for detailed response and code, will wait for update!

    Plugin Support Abhishek

    (@abhikr781)

    You are welcome and thank you for being patient with us.

    Thread Starter aleksandravu

    (@aleksandravu)

    Hello,
    I updated plugin and added the code to functions.php of child theme, but this didn’t work. This is an upload svg after updating plugin and adding code to functions.php http://joxi.ru/GrqnY15tG54oZm. This is an upload svg after deactivating plugin (what was needed, but your code didn’t work) http://joxi.ru/zANPedvHj9vQkm.

    Plugin Support Abhishek

    (@abhikr781)

    Hello,

    We have managed to fix the issue and you will get the files in our next update.

    If you want to fixed it for now, kindly edit the ocean extra file and update the function like this – https://github.com/oceanwp/ocean-extra/blob/master/includes/menu-icons/includes/library/icon-selector/includes/types/svg.php

    Update only below function. File path – /ocean-extra/includes/menu-icons/includes/library/icon-selector/includes/types/svg.php

    public function _add_mime_type( array $mimes ) {
    		if ( ! isset( $mimes['svg'] ) ) {
    			if ( apply_filters( 'oe_icon_picker_svg_mime_type', true ) ) {
    				$mimes['svg'] = $this->mime_type;
    			}
    		}
    		return $mimes;
    	}

    After that add the below code to the functions.php file of child theme –
    add_filter( 'oe_icon_picker_svg_mime_type', '__return_false' );

    • This reply was modified 5 months, 2 weeks ago by Abhishek.
    Thread Starter aleksandravu

    (@aleksandravu)

    Hello,

    thanks a lot! I’ll better wait for your next update, so as not to harm something in plugin files.

    Plugin Support Abhishek

    (@abhikr781)

    You are most welcome.

    and Thank you for keeping patience with us.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.