"Non-mainwp-changes" API after the 5.4 release

Hi guys,

We’re seeing odd behaviour with one of the API’s end-point:

{{mainwp-dashboard-url}}/wp-json/mainwp/v2/sites/{{site_id_or_domain}}/non-mainwp-changes/

https://www.postman.com/mainwp/mainwp/documentation/ujfddk4/mainwp-rest-api-v2-current?entity=request-7374956b-d983-4a3a-a6c7-280e43b9e582

This used to work as expected but it seems like after the recent major updates, it started fetching the results for all sites, instead of the specified one in the request. We tried using both - the siteID or domain name.

Here’s an example of the response we get:

сurl -v "https://MAINWPDASH.com/wp-json/mainwp/v2/sites/DOMAIN.COM/non-mainwp-changes/"

{"success":1,"total":2502,"data":[{"log_id":"1371747","site_id":"1284","item":"FunnelKit Funnel Builder Pro Plugin","user_id":"30595","action":"updated","context":"installer","connector":"non-mainwp-changes","state":"1","created":"1741724475","duration":"9.8777","object_id":"17416848755041","dismiss":"0","url":"https:\/\/SITE1.com\/","log_site_name":"SITE1.com","view_log_id":"1371747","meta_name":"FunnelKit Funnel Builder Pro","user_meta_json":"{\"wp_user_id\":30595,\"display_name\":\"USER\",\"action_user\":\"USER\",\"role\":\"administrator\",\"user_role_label\":\"Administrator\",\"agent\":\"\"}","usermeta":null,"extra_info":null},{"log_id":"1371746","site_id":"1284","item":"FunnelKit Funnel Builder Plugin","user_id":"30595","action":"updated","context":"installer","connector":"non-mainwp-changes","state":"1","created":"1741724460","duration":"11.2002","object_id":"17416848608662","dismiss":"0","url":"https:\/\/SITE1.com\/","log_site_name":"SITE1.com","view_log_id":"1371746","meta_name":"FunnelKit Funnel Builder","user_meta_json":"{\"wp_user_id\":30595,\"display_name\":\"USER\",\"action_user\":\"USER USER\",\"role\":\"administrator\",\"user_role_label\":\"Administrator\",\"agent\":\"\"}","usermeta":null,"extra_info":null},{"log_id":"1371745","site_id":"1284","item":"FunnelKit Automations Pro Plugin","user_id":"30595","action":"updated","context":"installer","connector":"non-mainwp-changes","state":"1","created":"1741724413","duration":"18.4739","object_id":"17416848133924","dismiss":"0","url":"https:\/\/SITE1.com\/","log_site_name":"SITE1.com","view_log_id":"1371745","meta_name": ...and so on for the rest of the sites.

Could you please try replicating on your end and advise if this could be due to a bug after the update release?

Thanks!
Fixed .net

Hey @Fixed

I’ve managed to reproduce the issue and can see that the REST API call is indeed returning changes for all sites.

I’ve passed it along to our dev team.

Great!

Thanks, Bojan!

Hi Bojan,

It looks like this is addressed in the latest 5.4.0.2 version - thank you.

However, I do have a few questions.

  1. Could you please confirm if the JSON structure of the response has changed? It does look like many of the values have been modified:

(double-check on this, it’s rough data)

This has caused quite a few issues as the code and variables had to be revised.

Is this the case as there does not seem to be any changelog history in postman for this?

  1. Previously the response was returning data/changes from months ago - which is great, since it provides more info. But currently, it seems like it’s fetching only recent changes (I can confirm it’s at least 1 month period, but not older it seems). So, is the period for the performed nonwp-changes changed/shortend now?

  2. The response looks to be much, much slower now. Previously it was taking about 5~ seconds, but now it’s more like 30s or sometimes even longer. This is even the case for sites that have only 1 or 2 “nonwp-changes” in the response - so it doesn’t seem to be related to the length of it. It’s definitely not due to server performance or similar - it’s all running normally as before the update.

Thanks again!
Fixed .net

Hi @Fixed,

Good catch! I was wondering why our n8n workflow didn’t work anymore… They changed site_id is now wpid. Why @bojan did you change it without notification? That starts to be a lot of changes made it and not properly announced.
Can we have a new documentation that show all the fields in the JSON structure you changed? It has an impact on our external Pro report.

@Fixed @wpexpert

The response for this call was inadvertently changed.

Here’s the full info on what was changed: Non-MainWP Changes call changes - Pastebin.com

@Fixed

I cannot reproduce the remaining two issues.
I’m getting the response for 22 changes in 1.14 seconds:

Also, I’m seeing all of the changes for a site going back to Dec 2024:

However, I will check with the dev team if there were any changes to the REST API that might impact these two behaviors in some circumstances.

Hi Bojan,

Thanks for the pastebin - it does help to some extent.

I believe the missing entries may be due to a new value - “connector”.

On the screenshots we see the only 3 entries that I’m getting from the API, they’re the the only ones that are with non-mainwp-changes “connector” and have “object_id” (not sure what that is exactly).
And in the postman request, it shows that it again fetches just 3, but right above them there are other “updated” entries that are missing in the response.

It seems like all new changes in WP now have “non-mainwp-changes” “connector” assigned, but any previous ones don’t have it and are not being fetched in the response.

It would be nice to have some updated API documentation on this since it seems like lots have changed and it’s breaking functionalities.

Thanks again.
Fixed .net

The API call responses are expected to be somewhat slower than before, because the data is now stored in a larger table than previously.
That table, as can be seen in your screenshot, now stores Non-MainWP Changes and changes performed via the MainWP Dashboard.

However, having to wait 30s for 1-2 results is unusual.

The API call only return the list of Non-MainWP changes, so the ‘connector’ will always show ‘non-mainwp-changes’.

The entries in that table without that connector are for changes that were made via the MainWP Dashboard.

For the API call, there are 3 parameters related the with the limit of the result: ‘limit’, ‘start’, ‘rowcount’.
They were unchanged, so if these parameters are being passed as before, the results should be the same.

Would you mind opening a private help desk ticket regarding both of these points: https://mainwp.com/my-account/get-support

The team would like to look into the response time and the result count and potentially add introduce parameters that could speed up the response time.

Thanks, Bojan - done.

1 Like