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.
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.)
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.
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:
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.
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.
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.