Skip Navigation

[Closed] Custom Post Type edit loads too much for posts with many connections

This support ticket is created 2 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 8 replies, has 2 voices.

Last updated by Nigel 2 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#2274063

Hello,

After one of the latest updates, we encounter the issue with loading the custom post types (Edit Post screens specifically) for the posts which have quite a lot of posts connected to them

It takes quite a lot of time to load the edit screen and perform the post update. Not to say that some of the admin get "page unresponsive" crash on chrome.

We run all the updates, checked our capacity with the hosting side, all looks well there. However, they pointed out that there are the following errors being thrown:

PHP Fatal error: Uncaught InvalidArgumentException: All provided arguments for a related element must be either an ID or a WP_Post object. in /nas/content/live/ceidotorgprod/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php:246\nStack trace:\n#0 /nas/content/live/ceidotorgprod/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php(177): OTGS\Toolset\Common\Interop\Commands\RelatedPosts->set_query_by_elements(Array, 'parent')\n#1 /nas/content/live/ceidotorgprod/wp-content/plugins/types/vendor/toolset/toolset-common/inc/public_api/m2m.php(110)
n#3 /nas/content/live/ceidotorgprod/wp-includes/template-loader.php(106): include('/nas/content/li...')\n#4 /nas/conten in /nas/content/live/ceidotorgprod/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/interop/commands/RelatedPosts.php on line 246

However, we never modified the original plugin files with the custom code.

What info you need to check out our side?

Thank you!

#2274169

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

When you say "quite a lot", what do you mean? 10? 100? 500?

I think I'd need a copy of your site to do some testing to see if I can spot what's happening when the error is thrown.

Could you share a copy of just the database using All in One WP Migration? (Before creating the export in the settings omit everything except the database.)

You can share a link directly to the file on your server, or upload it to dropbox or similar and share the link here. (The links are hidden from other users.)

Could you also share your debug info? hidden link

#2276523

Hello,

By 'quite a lot', around 1000+ is meant.

The link to the DB dump is here hidden link

I've attached the debug information.

Let me know if anything else is needed from our side.

#2277383

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Thanks for that, I've installed the site locally.

Sorry, where can I see the problem? Which post should I edit?

#2277533

Compare the post edit screen load and update for post with id 61796 and 92847, it has never been that long for 61796 before the updated. For some people the wait is even bigger and make a crash for browser.

#2277713

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

On my local copy editing post 61796 loads fairly promptly. The main page content loads within a couple of seconds, and then each of the related post sections below loads separately via ajax, but they complete loading within about 10 seconds, which I don't see as too high in the context of how many relationships and connected posts there are.

I installed the copy of the database into a clean site with just Types installed to test the issue.

You have a number of other plugins active on the site.

I'd suggest two steps.

First check the memory allocation: your server is set to 512M, but WordPress may not have all that available, and the admin side in particular requires more resources.

Add memory settings to your wp-config.php like so:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

If needs be increase the max memory limit as high as the 512M available on your server.

Does that make a difference?

You might also try disabling all plugins except for Types. How does that compare? It could be that other plugins you have active are using up significant resources, which presents as an issue when Types tries to load the related posts.

Let me know what you find.

#2278491

Hey,

Changing memory limit in wp-config does not make any difference at all, disabling all other plugins as well.

The timing decreases from 25 to roughly 21 sec for loading the editor if I switch to Block editor instead of Classic in toolset post settings.

Do you have any other suggestion what it might be?
Thanks!

#2278521

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Could I get the username and password for an admin account on that backup package you shared with me?

I'm installing it on another server for more testing, but it's a server I don't have FTP access to and having imported the backup I can only access it with an existing admin user.

I'll set a private reply, but it's just the username and password details I actually need.

#2279927

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I installed a copy of the site on an online test server, accessible with the same credentials you provided here: hidden link

The test page you suggested editing loaded more slowly than on my local version. Both have the WordPress memory settings set at 256M.

The new online server did load more slowly than my local site, but it is a shared server, and if you visit the suggested edit screen you should see that it typically loads in 10-15s.

Ordinarily I would say that is quite high, but it doesn't seem so high in the context of all of the relationships and connected posts you have set up.

I couldn't reproduce any errors, absent which, there is not much I can look into, as some performance impact from the number of relationships and connected posts is to be expected.

The topic ‘[Closed] Custom Post Type edit loads too much for posts with many connections’ is closed to new replies.