files not minified

  • Hi.

    Firstly I would like to thank you for a great plugin, although I am still getting my head around what’s waht.

    I have installed W3 total cache plugin and ticked the minification.
    But in the analysis I still have this:
    Some Javascript files don’t seem to be minified.
    Some CSS files don’t seem to be minified.

    Is there something obvious that I am missing?

    Thank you,
    Alex

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Does this error reference you theme assets of third party plugins? If the latter, you may need to get in touch with the authors of the affected plugins so that they can advise on how to minify their CSS & JS.

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    HI there,

    Thanks for the follow up.

    I would suggest that you take a look at the following article on advanced minification.

    If the issue persists, I can suggest that you reach out to the guys from W3 Total Cache so that they can help further.

    Thank you.

    Thank you. I will try to figure it out.

    I have a quick question: just reading about FAQ schema for google rating and just wondering if Rank Math has something to help with that. Thank you

    HI Alex,

    Thanks for the question.

    I am afraid that this schema is not yet supported in the plugin but there are plans to introduce more schema types in the future.
    You can however extend the JSON-LD data by making use of the following filter on your theme:

    /**
     * Collect data to output in JSON-LD.
     *
     * @param array  $unsigned An array of data to output in json-ld.
     * @param JsonLD $unsigned JsonLD instance.
     */
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	return [];
    }, 10, 2);

    I hope this info helps. Thank you.

    Thank you Michael.
    I am not sure what to do with this code and where to put it?

    Thanks,
    Alex

    Hi Michael,

    I just did some reading. Am I correct in assuming that I need to paste the code you gave me in the header of every page and that would trigger google to recognise that there is a JSON-LD on the page. And then I add the faq markup to that page?

    Thanks again,
    Alex

    Hi Alex,

    Thanks for the follow up.

    This code go in your theme’s functions.php file but it will not detect the page data automatically. Some additional data will be required grab the data from the page and populate the Json-ld object.
    I would suggest that you seek the assistance of a freelance developer to integrate this schema.

    I hope this info helps. Thank you.

    Thank you Michael, I can not ire a developer atm. Just to double-check: I put the code you gave me into functions.php and the schema markup code in the header?

    Hi Alex,

    If you already have some custom schema data in JSON-LD format, you can skip the addition of the Rank Math filter on functions.php file and add the meta directly but this is not recommended. On the other hand if you would like the schema to be added to the current Rank Math schema on the page, you will need to add the FAQ schema as an extension within this filter. Meaning that you do not need to add the code to header since Rank Math will add this in when the filter executes.

    I hope this info helps.

    Thank you Michael, I feel like I am almost getting it.

    I would be great if the faq schema can be added to the current Rank Math schema on the page, so I imagine it will appear in the drop-down along with other schema types, right?

    “you will need to add the FAQ schema as an extension within this filter”. I have the schema markup, so that’s ok. Not sure I understand what you mean by adding it as an extension?

    So, I have:
    1. faq markup with my questions and answers.
    2. the code snippet that you kindly provided above.

    I would really like to just use the rank math without any other schema plugins, so if you could please tell me where to insert the above codes 1 and 2, that would be amazing.

    Thank you very much for your help,
    Alex

    Hi Alex,

    Thanks for the follow up.

    Here is a brief sample of how you can extend the page schema with a FAQ snippet:

    /**
     * Filter URL entry before it gets added to the sitemap.
     *
     * @param array  $url  Array of URL parts.
     * @param string $type URL type. Can be user, post or term.
     * @param object $object Data object for the URL.
     */
    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
            //check the current page
    	if($_SERVER['REQUEST_URI'] =="/faq/"){
            // return the data here, the example below is incomplete
    	return [
    			'@type'            => "QAPage",
    			'mainEntity'       => [
    				'@type' => 'Question',
    				'name'  => 'How many ounces are there in a pound?',
    				'text'  => 'I have taken up a new interest in baking and keep running across directions in ounces and pounds. I have to translate between them and was wondering how many ounces are in a pound?'
    				],
    			
    		];
    	}
    }, 10, 2);

    I hope this info helps. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

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

The ticket ‘files not minified’ is closed to new replies.