Advanced stats popup appearing on all sites with updated plugin

#376964
  • Resolved David
    Rank Math free

    Not sure what has changed in the latest version of the plugin but I am now seeing a popup for a second or two when each page is refreshed.

    This could be a Caching plugin (WP Rocket) conflict but has never been seen before until now.

    The information shown on the popup above the menu is:

    “Advanced Stats are available in the PRO version. Learn More. [UPGRADE TO PRO]”

    Image download by link: https://ibb.co/B3VTqBB

    Sites affected:
    https://www.signspreston.co.uk/
    Console error:
    Failed to load resource: the server responded with a status of 404 ()
    https://www.signspreston.co.uk/wp-json/rankmath/v1/an/post/undefined?_locale=user
    {“code”:”rest_no_route”,”message”:”No route was found matching the URL and request method.”,”data”:{“status”:404}}

    When I inspect the page source I can’t find it when I search for any relation to the text seen. It’s like its injected once then removed a second later

    I do see the same error on other sites that have the latest version of Rank math and WP Rocket.

    I have disabled all caching on JS files and the issue still exists.

    Any suggestions please do let me know.

    Regards

    Dave / Darren

Viewing 9 replies - 1 through 9 (of 9 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    Please take a backup of your .htaccess file and replace it with the default WordPress .htaccess file. You can get the file here: https://wordpress.org/support/article/htaccess/

    You can follow this guide to edit the .htaccess file:
    https://rankmath.com/kb/edit-htaccess/

    Let us know if the issue persists.

    We are here to assist you.

    David
    Rank Math free

    Thank you for getting back to me.

    I will try this but I don’t think this is the issue. Asking me to reset my .htaccess removes my security headers and other security measures put in place. All these have been there from the beginning and only recently I have noticed this popup.

    Can I ask why it might be in relation to the .htaccess?

    If it was .htaccess why does it inject a “pro” advert before the page loads on the front end? There is nothing in the .htaccess that relates to RankMath which makes me feel uneasy that you are asking me to reset it.

    What worries me, even more, is the code is seen on the front end and then removed. Why is the plugin injecting an advert on the front end? Surely this should be seen on the backend?

    Please do explain why it is the .htaccess that is the cause and I will investigate to see if it is a CDN/Caching issue and address this without messing with my .htaccess setup.

    Edit: What I can do is revert to a previous version of the plugin and see what version I had before this issue arises. That way I can see your changelog and possibly wait until you guys investigate further into this odd popup seen on the front end.

    Regards

    Darren

    David
    Rank Math free

    Just to rule out that it’s plugin related. when I deactivate RankMath all errors disappear, the popup is removed, and everything looks clean and running as expected on the console.

    David
    Rank Math free

    The popup issue disappears in version: 1.0.84. Whatever has been updated prior to this version is when the popup started to appear.

    Even with all plugins (except RanKMath), Cloudflare deactivated/disabled it still shows the popup/errors.

    Any help is much appreciated.

    David
    Rank Math free

    Looking at the Search console under ‘Network’ I am getting the following on a few websites;

    Request URL: https://www.signspreston.co.uk/wp-json/rankmath/v1/an/post/undefined?_locale=user
    Request Method: GET
    Status Code: 404
    Remote Address: [2606:4700:3031::ac43:8989]:443
    Referrer Policy: strict-origin-when-cross-origin

    Error with api:
    api-fetch.min.js
    /*! This file is auto-generated */
    this.wp=this.wp||{},this.wp.apiFetch=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){“undefined”!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:”Module”}),Object.defineProperty(e,”__esModule”,{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&”object”==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,”default”,{enumerable:!0,value:e}),2&t&&”string”!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,”a”,t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=””,r(r.s=”jqrR”)}({Mmq9:function(e,t){e.exports=window.wp.url},jqrR:function(e,t,r){“use strict”;r.r(t);var n=r(“l3Sj”);var o=function(e){const t=(e,r)=>{const{headers:n={}}=e;for(const o in n)if(“x-wp-nonce”===o.toLowerCase()&&n[o]===t.nonce)return r(e);return r({…e,headers:{…n,”X-WP-Nonce”:t.nonce}})};return t.nonce=e,t};var a=(e,t)=>{let r,n,o=e.path;return”string”==typeof e.namespace&&”string”==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,””),n=e.endpoint.replace(/^\//,””),o=n?r+”/”+n:r),delete e.namespace,delete e.endpoint,t({…e,path:o})};var s=e=>(t,r)=>a(t,t=>{let n,o=t.url,a=t.path;return”string”==typeof a&&(n=e,-1!==e.indexOf(“?”)&&(a=a.replace(“?”,”&”)),a=a.replace(/^\//,””),”string”==typeof n&&-1!==n.indexOf(“?”)&&(a=a.replace(“?”,”&”)),o=n+a),r({…t,url:o})}),c=r(“Mmq9″);var i=function(e){const t=Object.keys(e).reduce((t,r)=>(t[Object(c.normalizePath)(r)]=e[r],t),{});return(e,r)=>{const{parse:n=!0}=e;let o=e.path;if(!o&&e.url){const t=Object(c.getQueryArg)(e.url,”rest_route”);”string”==typeof t&&(o=t)}if(“string”==typeof o){const r=e.method||”GET”,a=Object(c.normalizePath)(o);if(“GET”===r&&t[a]){const e=t[a];return delete t[a],Promise.resolve(n?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:”OK”,headers:e.headers}))}if(“OPTIONS”===r&&t[r]&&t[r][a]){const e=t[r][a];return delete t[r][a],Promise.resolve(n?e.body:e)}}return r(e)}};const u=(e,t)=>{let{path:r,url:n,…o}=e;return{…o,url:n&&Object(c.addQueryArgs)(n,t),path:r&&Object(c.addQueryArgs)(r,t)}},d=e=>e.json?e.json():Promise.reject(e),l=e=>{const{next:t}=(e=>{if(!e)return{};const t=e.match(/<([^>]+)>; rel=”next”/);return t?{next:t[1]}:{}})(e.headers.get(“link”));return t};var p=async(e,t)=>{if(!1===e.parse)return t(e);if(!(e=>{const t=!!e.path&&-1!==e.path.indexOf(“per_page=-1”),r=!!e.url&&-1!==e.url.indexOf(“per_page=-1”);return t||r})(e))return t(e);const r=await T({…u(e,{per_page:100}),parse:!1}),n=await d(r);if(!Array.isArray(n))return n;let o=l(r);if(!o)return n;let a=[].concat(n);for(;o;){const t=await T({…e,path:void 0,url:o,parse:!1}),r=await d(t);a=a.concat(r),o=l(t)}return a};const h=new Set([“PATCH”,”PUT”,”DELETE”]),f=”GET”;const w=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},m=e=>{const t={code:”invalid_json”,message:Object(n.__)(“The response is not a valid JSON response.”)};if(!e||!e.json)throw t;return e.json().catch(()=>{throw t})},g=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(w(e,t)).catch(e=>y(e,t))};function y(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw e;return m(e).then(e=>{const t={code:”unknown_error”,message:Object(n.__)(“An unknown error occurred.”)};throw e||t})}var j=(e,t)=>{if(!function(e){const t=!!e.method&&”POST”===e.method;return(!!e.path&&-1!==e.path.indexOf(“/wp/v2/media”)||!!e.url&&-1!==e.url.indexOf(“/wp/v2/media”))&&t}(e))return t(e);let r=0;const o=e=>(r++,t({path:/wp/v2/media/${e}/post-process,method:”POST”,data:{action:”create-image-subsizes”},parse:!1}).catch(()=>r<5?o(e):(t({path:/wp/v2/media/${e}?force=true,method:”DELETE”}),Promise.reject())));return t({…e,parse:!1}).catch(t=>{const r=t.headers.get(“x-wp-upload-attachment-id”);return t.status>=500&&t.status<600&&r?o(r).catch(()=>!1!==e.parse?Promise.reject({code:”post_process”,message:Object(n.__)(“Media upload failed. If this is a photo or a large image, please scale it down and try again.”)}):Promise.reject(t)):y(t,e.parse)}).then(t=>g(t,e.parse))};const O={Accept:”application/json, */*;q=0.1″},b={credentials:”include”},v=[(e,t)=>(“string”!=typeof e.url||Object(c.hasQueryArg)(e.url,”_locale”)||(e.url=Object(c.addQueryArgs)(e.url,{_locale:”user”})),”string”!=typeof e.path||Object(c.hasQueryArg)(e.path,”_locale”)||(e.path=Object(c.addQueryArgs)(e.path,{_locale:”user”})),t(e)),a,(e,t)=>{const{method:r=f}=e;return h.has(r.toUpperCase())&&(e={…e,headers:{…e.headers,”X-HTTP-Method-Override”:r,”Content-Type”:”application/json”},method:”POST”}),t(e)},p];const _=e=>{if(e.status>=200&&e.status<300)return e;throw e};let P=e=>{const{url:t,path:r,data:o,parse:a=!0,…s}=e;let{body:c,headers:i}=e;i={…O,…i},o&&(c=JSON.stringify(o),i[“Content-Type”]=”application/json”);return window.fetch(t||r||window.location.href,{…b,…s,body:c,headers:i}).then(e=>Promise.resolve(e).then(_).catch(e=>y(e,a)).then(e=>g(e,a)),e=>{if(e&&”AbortError”===e.name)throw e;throw{code:”fetch_error”,message:Object(n.__)(“You are probably offline.”)}})};function x(e){return v.reduceRight((e,t)=>r=>t(r,e),P)(e).catch(t=>”rest_cookie_invalid_nonce”!==t.code?Promise.reject(t):window.fetch(x.nonceEndpoint).then(_).then(e=>e.text()).then(t=>(x.nonceMiddleware.nonce=t,x(e))))}x.use=function(e){v.unshift(e)},x.setFetchHandler=function(e){P=e},x.createNonceMiddleware=o,x.createPreloadingMiddleware=i,x.createRootURLMiddleware=s,x.fetchAllMiddleware=p,x.mediaUploadMiddleware=j;var T=t.default=x},l3Sj:function(e,t){e.exports=window.wp.i18n}}).default;

    Another site that we have with the same issue:

    Request URL: https://www.boltonsignservices.co.uk/wp-json/rankmath/v1/an/post/undefined?_locale=user
    Request Method: GET
    Status Code: 404
    Remote Address: [2606:4700:3034::ac43:baa3]:443
    Referrer Policy: strict-origin-when-cross-origin

    Request URL: https://signssouthport.co.uk/wp-json/rankmath/v1/an/post/undefined?_locale=user
    Request Method: GET
    Status Code: 404
    Remote Address: [2606:4700:3033::ac43:d018]:443
    Referrer Policy: strict-origin-when-cross-origin

    The only site we have that is not affected is https://www.liverpoolsigns.co.uk/. This site is the exact same setup as the others on the list. same .htaccess, same theme builder, similar plugin setup all up to date with correct versions across the board.

    Not sure why this one isn’t flagging the same error.

    David
    Rank Math free

    Hi Anas,

    Just realised I haven’t had a reply for a while and it might be down to how I have responded to your message. I didn’t reply to you directly but to the ticket itself.

    Please do advise what is best to do. I have tried resetting my .htaccess, turned off CDN (Cloudflare), disabled Caching plugins and still get the popup issue.

    To help this popup and any errors around this are not visible in version 1.0.84.

    Hello,

    Sorry for the unexpected delay and any inconvenience that might have been caused due to that.

    The suggestion to replace your .htaccess file with a default one was made because the error you shared showed that one of our plugin’s routes was returning a 404 error and that usually happens due to a rewrite rule in the .htaccess file.

    However, the popup that you are seeing is the Frontend Stats Bar that we have introduced in a recent update of our plugin. It is only visible to logged-in users mostly admins or the ones who have access to Rank Math’s Analytics module.

    You can disable it from WP Dashboard > Rank Math > General Settings > Analytics > Frontend Stats Bar(and disable).

    If you want us to check why it is not showing the stats on your site then please add the login details of your site in the sensitive data section so we can check this further.

    Looking forward to helping you.

    David
    Rank Math free

    Hi Jaideep,

    Thank you for clearing this up for me. It might be a good feature to show “NEW” features through a toolset that drives the customer to these settings when added. Similar to how you would show a tutorial when you first install a plugin or desktop tool which will show a pop-up speech bubble explaining the changes or tools used. That way people will learn about these features and have the option to keep them active or turn them off if not required.

    In regards to the stats not showing on the front end. I can only assume it’s my I.P block plugin that could be preventing your API from communicating with my site. Everything works on the back end just not the front.

    I can see all analytic scoring through the free version and everything works fine when using your SEO analysis tool. I can only assume it’s this that is the cause as it is affected on all sites using this plugin.

    Is there an I.P range I can whitelist to see if it is this? That way the error log shared above might be caused by something else and can be investigated further.

    Regards

    Darren

    Hello,

    This doesn’t seem to be related to the IP Blocking plugin. Something is preventing the REST route to run on the website. Please check the Network tab of your browser’s dev tools to check if the route is being redirected before returning a 404 error. If the route is returning a 301 and getting redirected before returning a 404 error then the issue is being caused by redirection.

    You can also check with your host if there is a server misconfiguration that is causing the issue.

    Let us know how that goes. Looking forward to helping you.

    Thanks.

    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 9 replies - 1 through 9 (of 9 total)

The ticket ‘Advanced stats popup appearing on all sites with updated plugin’ is closed to new replies.