You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, the tables wp_p2p and wp_p2pmeta are missing. If there are any other plugins that depend on this functionality, this could cause errors like this one to appear:
Based on reading the source code, it looks like the tables are created when an instance of the class P2P_Tools_Page is created for the first time here:
This is inside the function _p2p_load_admin, which is only called if is_admin() is true. Instead, the tables should be created upon plugin registration.
Of course, the workaround is to visit the WordPress admin before using the site. Sure enough, as soon as the WordPress admin dashboard is visited, the tables are created.
Requiring visiting the WordPress admin makes it harder to automate setting up new websites with certain plugins using the WP CLI.
The text was updated successfully, but these errors were encountered:
Let's say that I install the "Posts 2 Posts" plugin on a brand new WordPress installation, using the WP CLI, like this:
At this point, the plugin has been installed and activated. However, the tables have not been created yet:
As you can see, the tables
wp_p2p
andwp_p2pmeta
are missing. If there are any other plugins that depend on this functionality, this could cause errors like this one to appear:Based on reading the source code, it looks like the tables are created when an instance of the class
P2P_Tools_Page
is created for the first time here:wp-posts-to-posts/posts-to-posts.php
Line 53 in d2f297d
This is inside the function
_p2p_load_admin
, which is only called ifis_admin()
is true. Instead, the tables should be created upon plugin registration.Of course, the workaround is to visit the WordPress admin before using the site. Sure enough, as soon as the WordPress admin dashboard is visited, the tables are created.
Requiring visiting the WordPress admin makes it harder to automate setting up new websites with certain plugins using the WP CLI.
The text was updated successfully, but these errors were encountered: