• Resolved mattmary

    (@mattmary)


    Hello,

    We use your plugin on our different environments. The problem is the wp-content/tablepress-combined.min.css contains a full URL to a font file.:

    url(//%domain%/wp-content/plugins/tablepress/css/build/tablepress.woff)

    This is a problem because we can’t add it to our git repository.

    Can you either remove the domain name from this URL or provide a way to regenerate this CSS?

    Kind regards

    Mat

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Just for clarity: With different environment, do you mean things like a staging domain that is different from the live site’s domain?

    Indeed, the full URL is used in this CSS file, see https://github.com/TablePress/TablePress/blob/2.0.4/classes/class-css.php#L334 . This behavior has been introduced 10 years ago. The reason why this is needed still exists, but I’m wondering if using root-relative URLs like

    url(/wp-content/plugins/tablepress/css/build/tablepress.woff)

    would also work, or if there are scenarios where this could cause problems (considering that other caching plugins might interact with the file, or that the file might be offloaded to a different server/CDN/domain, …). Do you happen to have an opinion on this?

    So, in the meantime, my recommendation would be to do exactly that with a filter hook: The plugins_url() function offers the plugins_url filter hook that you could use to remove the domain.

    Regards,
    Tobias

    Thread Starter mattmary

    (@mattmary)

    Hello @tobiasbg

    Sorry for this late reply.

    Yes, our testing environments are:

    • local.website.org
    • staging.website.org

    So, yes, this is a problem when the CSS is embedded in the sources.

    Using a relative path would probably work for us, but I guess there are some configurations which would be a problem.

    Just wondering if you could implement a feature where we could regenerate the CSS? A button in the back-office or something like that?

    Anyway, great plugin.

    Kind regards

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for the clarification!

    Yes, using root-relative URLs could probably work, but I don’t really want to take the risk right now, to be honest. I’ll have to think about this some more, to rule out any negative side-effects.

    In the meantime, you could regenerate the CSS on the different sites by making an arbitrary (“dummy”) change in the “Custom CSS” and saving that (and then maybe reverting that change).

    Whenever the “Custom CSS” has been modified, the files will be regenerated (with the then-correct domain in those URLs).

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘full URL stored in wp-content/tablepress-combined.min.css’ is closed to new replies.