Support » Plugin: Central Color Palette » Uploaded file format not supported

  • Hi Daniel,

    Thanks for your great plugin that helps me let people only use brand colors.
    I’ve got a WP theme with 5 siblings, thus tried to export & import across them.
    But, no luck.
    I exported the .bak, then the .json, but upon import both give me the same error ‘The uploaded file format is not supported’.
    I have no plugins installed or restrictions regarding Mime types. Also, this error seems to stem from your plugin and not from WP, which will by default throw a different error with security reasons in it.

    Any idea what could be the cause?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Daniel Menȝies

    (@kungtiger)

    Hi,

    Thank you for your feedback. Glad it’s of use to you.
    Such an error only occurs if an uploaded file is not recognised as a valid import, or your server is creating corrupted exports to begin with. Of the top of my head I can think of two things you could try.

    Firstly post the content of your json file on e.g pastebin, and send me the link to that post, so I can have a look at it. Maybe something is wrong.

    Given that you have write access to the server your sites are running on, another thing you could try, is to turn on WP_DEBUG in your wp-config.php.

    Thread Starter ha_ulrich

    (@ha_ulrich)

    Hi Daniel,
    Thanks for the quick response! Those were options I should have checked out myself on beforehand…

    I just opened the files in Sublime quickly, to provide you some response – I’ll be away from work for a week from tomorrow on, thus no reply…

    I saw immediately what the faulty part was.
    I’ve been hacking a bit into the css, to make the pcr-color-palette and the pcr-color-chooser disappear (read: not hide, because then the input generates NaN values). This CSS got in my previous implementation, simply hurled into the body at some point. And it got 1:1 pulled along in both exports, making them corrupt.

    So here comes a follow-up question.
    The exact thing I do is:

    
    <style>.pcr-app .pcr-color-palette { width: 170px;height: 170px;visibility: hidden !important;position: absolute; } .pcr-app .pcr-color-chooser {display: none;}</style>
    

    but there must be a better way to not to invoke the two choosers at all. I’ve browsed through your code, and it seems to be possible to omit them; but via the plugin, I’m not able to. What I try to achieve is that, in the color popup, people can only choose:
    – the row of pre-set colors
    – the opacity slider
    because my marketing team may only choose branded colors, no derivates and certainly not the whole rainbow! 😉

    Is there any *good* way to achieve that? 🙂
    I’m able to add scripts to WP functions, so if I need to unload specific functions, … that’s an option.

    • This reply was modified 1 year, 4 months ago by ha_ulrich.
    Thread Starter ha_ulrich

    (@ha_ulrich)

    Also, afterthought;
    in my newest implementation, I only inject the CSS upon

    
    add_action( 'elementor/editor/before_enqueue_scripts','');
    

    so I think if I run an export again, the css won’t be in it… in your plugin screen the elementor editor doesn’t fire.

    But, I’m still open to a better, more neat, option! 🙂

    (because, who doesn’t want to restrict content editors to only choose safe colours ?)

    Plugin Author Daniel Menȝies

    (@kungtiger)

    We are talking Elementor here, right? I’ll have look at it later tonight (European Summer Time). Elementor is a but of a beast and has been troublesome to integrate.

    Plugin Author Daniel Menȝies

    (@kungtiger)

    I am not quite sure how custom CSS can end up in an export that my plugin creates. Life is mystery.

    I’ve recreated your bit of CSS that hide parts of Elementor’s colour picker. Looks good, I can’t find any fault with it. Using and a hook that Elementor provides is a good way.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Uploaded file format not supported’ is closed to new replies.