Multisite CustomPress 404 errrors

I occasionally have 404 errors when looking at top level Pages (although child pages seem unaffected). This is the primary (and only) domain of a subdomain network installation (4.53)
This is not a live site yet - I'm still trying to test plugins and configurations.
I originally installed the multisite under a different URL and then edited the database to reflect a new. Most of the time everything works fine, but occasionally on this and previous tests I had problems with permalinks. CustomPress seems like the cause of the problems, and is configured to share the same settings across all subsites (even though no other subsites exist yet)

Troubleshooting part 1:
disabled all plugins except CustomPress (1.3.5.8)
deleted all content
deleted all taxonomy
set theme to twenty sixteen
created 2 pages:
/test/
/test/too/
tried each preset permalink pattern
deleted custom post type definitions

Results:
each permalink pattern that includes %postname% remains a problem for the page at:
/test/

each permalink pattern has no negative affect on the page at:
/test/too/

Troubleshooting part 2:
removed all custom taxonomy definitions

Results part 2:
both pages are now loading normally

Troubleshooting part 3:
I have subsequently added one hierarchical and one non-hierarchical custom taxonomy definitions

Results part 3:
both pages are now loading normally

Troubleshooting part 4:
I imported the original taxonomy definitions again
set permalinks as /%postname%/

Results part 4
404 error again for the page at:
/test/

no problem for the page at:
/test/too/

My conclusion is that something within the original set of custom taxonomies is conflicting with the permalinks, but don't know WordPress well enough to be able to troubleshoot further

I have included the exported settings for Post types, Taxonomies, and Fields in the hope that they will help:

// Post Types Export code for CustomPress
global $CustomPress_Core;
$CustomPress_Core->import=array (
'post_types' =>
array (
'phrase' =>
array (
'labels' =>
array (
'name' => 'Phrases',
'singular_name' => 'Phrase',
),
'supports' =>
array (
'title' => 'title',
'revisions' => 'revisions',
),
'supports_reg_tax' =>
array (
'category' => '',
'post_tag' => '',
),
'capability_type' => 'page',
'map_meta_cap' => false,
'description' => '',
'menu_position' => '',
'show_ui' => true,
'show_in_nav_menus' => false,
'publicly_queryable' => false,
'exclude_from_search' => true,
'hierarchical' => false,
'has_archive' => false,
'rewrite' =>
array (
'with_front' => false,
'feeds' => false,
'pages' => false,
'ep_mask' => 0,
),
'query_var' => true,
'can_export' => true,
'cf_columns' => '',
'capabilities' =>
array (
'create_posts' => 'create_pages',
),
),
'cluster' =>
array (
'labels' =>
array (
'name' => 'Clusters',
'singular_name' => 'Cluster',
),
'supports' =>
array (
'title' => 'title',
'editor' => 'editor',
'thumbnail' => 'thumbnail',
),
'supports_reg_tax' =>
array (
'category' => '',
'post_tag' => '',
),
'capability_type' => 'post',
'map_meta_cap' => true,
'description' => '',
'menu_position' => '',
'show_ui' => true,
'show_in_nav_menus' => false,
'publicly_queryable' => false,
'exclude_from_search' => true,
'hierarchical' => false,
'has_archive' => false,
'rewrite' =>
array (
'with_front' => false,
'feeds' => false,
'pages' => false,
'ep_mask' => 1,
),
'query_var' => true,
'can_export' => true,
'cf_columns' => '',
'capabilities' =>
array (
'create_posts' => 'create_posts',
),
),
),
);

// Taxonomies Export code for CustomPress
global $CustomPress_Core;
$CustomPress_Core->import=array (
'taxonomies' =>
array (
'brand' =>
array (
'object_type' =>
array (
0 => 'post',
1 => 'page',
2 => 'attachment',
3 => 'ngg_gallery',
4 => 'ngg_pictures',
),
'args' =>
array (
'labels' =>
array (
'name' => 'Brands',
'singular_name' => 'Brand',
),
'public' => true,
'show_admin_column' => true,
'hierarchical' => true,
'rewrite' =>
array (
'with_front' => true,
'hierarchical' => false,
'ep_mask' => 0,
),
'query_var' => true,
'capabilities' =>
array (
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_pages',
),
),
),
'year' =>
array (
'object_type' =>
array (
0 => 'post',
1 => 'attachment',
2 => 'ngg_gallery',
3 => 'ngg_pictures',
),
'args' =>
array (
'labels' =>
array (
'name' => 'Years',
'singular_name' => 'Year',
),
'public' => true,
'show_admin_column' => true,
'hierarchical' => true,
'rewrite' =>
array (
'with_front' => true,
'hierarchical' => false,
'ep_mask' => 0,
),
'query_var' => false,
'capabilities' =>
array (
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_posts',
),
),
),
'person' =>
array (
'object_type' =>
array (
0 => 'post',
1 => 'page',
2 => 'ngg_gallery',
3 => 'ngg_pictures',
),
'args' =>
array (
'labels' =>
array (
'name' => 'Persons',
'singular_name' => 'Person',
),
'public' => true,
'show_admin_column' => true,
'hierarchical' => false,
'rewrite' =>
array (
'with_front' => true,
'hierarchical' => false,
'ep_mask' => 0,
),
'query_var' => true,
'capabilities' =>
array (
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_pages',
),
),
),
'group' =>
array (
'object_type' =>
array (
0 => 'post',
1 => 'page',
2 => 'attachment',
3 => 'revision',
4 => 'ngg_gallery',
5 => 'ngg_pictures',
),
'args' =>
array (
'labels' =>
array (
'name' => 'Groups',
'singular_name' => 'Group',
),
'public' => true,
'show_admin_column' => true,
'hierarchical' => false,
'rewrite' =>
array (
'with_front' => true,
'hierarchical' => false,
'ep_mask' => 0,
),
'query_var' => true,
'capabilities' =>
array (
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_pages',
),
),
),
'phrase_category' =>
array (
'object_type' =>
array (
0 => 'phrase',
),
'args' =>
array (
'labels' =>
array (
'name' => 'Phrase Categories',
'singular_name' => 'Phrase Category',
),
'public' => true,
'show_admin_column' => true,
'hierarchical' => true,
'rewrite' =>
array (
'with_front' => true,
'hierarchical' => false,
'ep_mask' => 0,
),
'query_var' => true,
'capabilities' =>
array (
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_pages',
),
),
),
'cluster_category' =>
array (
'object_type' =>
array (
0 => 'cluster',
),
'args' =>
array (
'labels' =>
array (
'name' => 'Cluster Categories',
'singular_name' => 'Cluster Category',
),
'public' => true,
'show_admin_column' => true,
'hierarchical' => true,
'rewrite' =>
array (
'with_front' => true,
'hierarchical' => false,
'ep_mask' => 0,
),
'query_var' => true,
'capabilities' =>
array (
'manage_terms' => 'manage_categories',
'edit_terms' => 'manage_categories',
'delete_terms' => 'manage_categories',
'assign_terms' => 'edit_posts',
),
),
),
),
);

// Custom Fields Export code for CustomPress
global $CustomPress_Core;
$CustomPress_Core->import=array (
'custom_fields' =>
array (
'text_577a6e386de7d' =>
array (
'field_title' => 'Title Headline',
'field_wp_allow' => 0,
'field_type' => 'text',
'field_sort_order' => 'default',
'field_date_format' => '',
'field_regex' => '',
'field_regex_options' => '',
'field_regex_message' => '',
'field_message' => '',
'field_default_option' => NULL,
'field_description' => 'Longer version of the Title to display within the page',
'object_type' =>
array (
0 => 'post',
1 => 'page',
),
'hide_type' =>
array (
0 => 'attachment',
1 => 'revision',
2 => 'nav_menu_item',
3 => 'ms_membership',
4 => 'ms_relationship',
5 => 'ms_invoice',
6 => 'ms_communication',
7 => 'ms_event',
8 => 'phrase',
9 => 'cluster',
10 => 'ngg_album',
11 => 'ngg_gallery',
12 => 'ngg_pictures',
13 => 'lightbox_library',
14 => 'displayed_gallery',
15 => 'display_type',
16 => 'gal_display_source',
),
'field_required' => 0,
'field_id' => 'text_577a6e386de7d',
'field_order' => 0,
),
'textarea_577a78599fb13' =>
array (
'field_title' => 'Related Pages',
'field_wp_allow' => 0,
'field_type' => 'textarea',
'field_sort_order' => 'default',
'field_date_format' => '',
'field_regex' => '',
'field_regex_options' => '',
'field_regex_message' => '',
'field_message' => '',
'field_default_option' => NULL,
'field_description' => '',
'object_type' =>
array (
0 => 'post',
1 => 'page',
),
'hide_type' =>
array (
0 => 'attachment',
1 => 'revision',
2 => 'nav_menu_item',
3 => 'ms_membership',
4 => 'ms_relationship',
5 => 'ms_invoice',
6 => 'ms_communication',
7 => 'ms_event',
8 => 'phrase',
9 => 'cluster',
10 => 'ngg_album',
11 => 'ngg_gallery',
12 => 'ngg_pictures',
13 => 'lightbox_library',
14 => 'displayed_gallery',
15 => 'display_type',
16 => 'gal_display_source',
),
'field_required' => 0,
'field_id' => 'textarea_577a78599fb13',
'field_order' => 1,
),
'textarea_577a7803f2926' =>
array (
'field_title' => 'Related Links',
'field_wp_allow' => 0,
'field_type' => 'textarea',
'field_sort_order' => 'default',
'field_date_format' => '',
'field_regex' => '',
'field_regex_options' => '',
'field_regex_message' => '',
'field_message' => '',
'field_default_option' => NULL,
'field_description' => '',
'object_type' =>
array (
0 => 'post',
1 => 'page',
),
'hide_type' =>
array (
0 => 'attachment',
1 => 'revision',
2 => 'nav_menu_item',
3 => 'ms_membership',
4 => 'ms_relationship',
5 => 'ms_invoice',
6 => 'ms_communication',
7 => 'ms_event',
8 => 'phrase',
9 => 'cluster',
10 => 'ngg_album',
11 => 'ngg_gallery',
12 => 'ngg_pictures',
13 => 'lightbox_library',
14 => 'displayed_gallery',
15 => 'display_type',
16 => 'gal_display_source',
),
'field_required' => 0,
'field_id' => 'textarea_577a7803f2926',
'field_order' => 2,
),
'text_577a7a5d30729' =>
array (
'field_title' => 'Media',
'field_wp_allow' => 0,
'field_type' => 'text',
'field_sort_order' => 'default',
'field_date_format' => '',
'field_regex' => '',
'field_regex_options' => '',
'field_regex_message' => '',
'field_message' => '',
'field_default_option' => NULL,
'field_description' => '',
'object_type' =>
array (
0 => 'post',
1 => 'page',
),
'hide_type' =>
array (
0 => 'attachment',
1 => 'revision',
2 => 'nav_menu_item',
3 => 'ms_membership',
4 => 'ms_relationship',
5 => 'ms_invoice',
6 => 'ms_communication',
7 => 'ms_event',
8 => 'phrase',
9 => 'cluster',
10 => 'ngg_album',
11 => 'ngg_gallery',
12 => 'ngg_pictures',
13 => 'lightbox_library',
14 => 'displayed_gallery',
15 => 'display_type',
16 => 'gal_display_source',
),
'field_required' => 0,
'field_id' => 'text_577a7a5d30729',
'field_order' => 3,
),
'text_577a7ac207a16' =>
array (
'field_title' => 'Call to Action',
'field_wp_allow' => 0,
'field_type' => 'text',
'field_sort_order' => 'default',
'field_date_format' => '',
'field_regex' => '',
'field_regex_options' => '',
'field_regex_message' => '',
'field_message' => '',
'field_default_option' => NULL,
'field_description' => '',
'object_type' =>
array (
0 => 'post',
1 => 'page',
),
'hide_type' =>
array (
0 => 'attachment',
1 => 'revision',
2 => 'nav_menu_item',
3 => 'ms_membership',
4 => 'ms_relationship',
5 => 'ms_invoice',
6 => 'ms_communication',
7 => 'ms_event',
8 => 'phrase',
9 => 'cluster',
10 => 'ngg_album',
11 => 'ngg_gallery',
12 => 'ngg_pictures',
13 => 'lightbox_library',
14 => 'displayed_gallery',
15 => 'display_type',
16 => 'gal_display_source',
),
'field_required' => 0,
'field_id' => 'text_577a7ac207a16',
'field_order' => 4,
),
),
);

  • George

    Hi Panos,
    I did send a support access invitation to the new site I created that reproduced this error, but perhaps it wasn't obvious that it was connected to this support ticket.

    These are the steps I took in setting this up, importing the Custompress configuration from the support ticket:
    Install latest WP
    Configure Network
    Activate Custompress
    Activate WPMUDEV Dashboard
    Enable Custompress import
    Import Custompress types, fields, and taxonomies
    Configure Custompress
    Configure Custom Permalinks: /%category%/%postname%
    Create following pages:
    - Parent 1
    -- Child 1a
    -- Child 1b
    -- Child 1c
    Created 'Primary' menu
    Added pages to Primary menu
    Added Primary menu to theme location

    You can see the error if you browse to:
    /parent-1

    Thanks

  • George

    Hi Panos, thanks for investigating.
    I took a look and all was working fine, so I did a little extra testing and recreated the error by following these 3 steps:

    1. create 3 new child pages below the test page you created:
    Child 2a
    Child 2b
    Child 2c

    2. add child pages to the menu

    3. resaved the permalinks settings (without any changes)

    The reason I associate this with CustomPress is that I have only seen this error on my sites where CustomPress has been activated, and I recreated the error on this site with CustomPress and WPMUDEV Dashboard and Snapshot as the only plugins installed. If this error manifests itself also in multisite installs without WPMUDEV plugins then I would expect to be able to easily find reports and information about it but didn't find that.
    Saving the permalinks settings (with or without changes) is definitely one of the factors that seems to affect this behaviour but from memory it sometimes occurs when a page is updated.

    On larger sites I have been running into this problem after days or weeks of work and eventually stopped using CustomPress and the problem went away (so far).

  • Panos

    Hi George ,

    Of what it seems, if visiting Settings > Permalinks (or saving permalinks) while CustomPress is active this issue takes place. If you visit Settings > Permarlinks and CustomPress is deactivated then the issue gets fixed.

    I can't replicate this in any of my multisite or single installations. It seems to be somehow related to CP but unclear how. I would need ftp access in order to have a closer on this. You can send ftp and login creentials privately through our contact form: https://premium.wpmudev.org/contact/

    Select "I have a different question?" for your topic - this and the subject line ensure that it gets assigned to me.

    Send in:Subject: "Attn: Panos Lyrakis"

    - Admin login:
    Admin username
    Admin password
    Login url

    - FTP credentials
    host
    username
    password
    (and port if required)

    - link back to this thread for reference
    - any other relevant urls

    Thanks!
    Panos

  • George

    Hi Panos,
    is there any update about this problem? As this has been outstanding for many months without any contact I have removed the temporary website, but it could be recreated if required.

    Also, I received a confirmation email that surprisingly included all of the security credentials I had supplied. I suggest warning anyone submitting security information that will happen if it hasn't already been disabled.

    Many thanks,
    George

  • James Morris

    Hello George,

    I sincerely apologize for the extreme delay in response here.

    I'm going through some old threads here to see if there is anything further we can do to help where tickets have not been marked as resolved. Looking at the task notes for this ticket, it seems the resolution was re-saving permalinks as suggested by my colleague @panoskatws.

    We've performed a number of updates to CoursePress since this ticket was originally updated and since your last reply. Are you still experiencing problems after updating to the latest version?

    Best regards,

    James Morris

    • George

      Hi James,
      I did some more testing with the latest downloaded Version 1.3.7-beta and the same error still exists.

      The suggested resolution of saving permalink settings again with CustomPress deactivated does seem to work, with significant limitations:
      Even after using the workaround, a Page Not Found error is generated when a new subsite publishes a new top level page. So the workaround would have to be repeated across the network whenever a new subsite publishes its first page, which is clearly unrealistic.

      This version of CustomPress with all settings defined at network level is unusable if new subsites will continue to be added.

      Thanks,
      George

  • Panos

    Hi George ,

    Thanks for insisting on this one

    It seems it's the name of the taxonomy year that is causing this.

    I know that the plugin doesn't allow to change the taxonomy name, but you can do so with some code. You can paste the following in your functions.php:

    add_action( 'admin_init', function(){
    
    	$ct_custom_taxonomies = get_option( 'ct_custom_taxonomies' );
    	$ct_custom_taxonomies['ct_year'] = $ct_custom_taxonomies['year'];
    	unset( $ct_custom_taxonomies['year'] );
    	update_option( 'ct_custom_taxonomies', $ct_custom_taxonomies );
    
    }, 10 );

    or for mulstisite:

    add_action( 'admin_init', function(){
    
    	$ct_custom_taxonomies = get_site_option( 'ct_custom_taxonomies' );
    	$ct_custom_taxonomies['ct_year'] = $ct_custom_taxonomies['year'];
    	unset( $ct_custom_taxonomies['year'] );
    	update_site_option( 'ct_custom_taxonomies', $ct_custom_taxonomies );
    
    }, 10 );

    then refresh the admin page once and re-save permalinks. Finally check if this issue still insist.

    Thanks!

  • George

    Thank you so much for finding the cause of this error.

    The original website I had planned got postponed indefinitely when this problem was found in testing as I wanted to use a plugin for custom content types, but didn't feel I could trust CustomPress. That means I don't need to edit an existing site and can just rename the field in the import code for the new site.

    However, that also makes me wonder whether there is a list of other IDs for content types or fields that should be disallowed. Will there be a new version that checks against a list of reserved names?

    Many thanks again,
    George