• Resolved Justin Fletcher

    (@justinticktock)


    Hi Jeff,

    I’ve got a plugin that creates a custom post type and it has pages such as https://network/subsite/posttype/archive-page.

    I’m using PO to disable globally and only enable the plugin on the post type pages single / archive etc.

    All works OK until I re-save / flush the permalinks then the permalinks save without knowledge of the plugin pages.

    This works ..
    1) Disable PO
    2) Save the permalinks
    3) Enable PO
    4) And it all works.

    But this does not work…
    1) PO running
    2) Save permalinks
    3) Breaks the site.

    Is this expected?

    Is there anyway of forcing all plugins active during permalinks saves (either manual or via code) so that this doesn’t cause an issue?

    we really don’t have control of when permalinks get flushed during other plugin settings saves or activation so this really looks problematic.

    https://ww.wp.xz.cn/plugins/plugin-organizer/

Viewing 15 replies - 1 through 15 (of 28 total)
  • Plugin Author Jeff Sterup

    (@foomagoo)

    There is a button on the po settings page to recreate the permalinks. It isn’t firing the po permalink save function when saving the permalinks. Try using that button after you save a permalink.

    Thread Starter Justin Fletcher

    (@justinticktock)

    unfortunately its not helping

    the message comes back with ..
    0 permalinks were updated successfully
    0 permalinks were already up to date

    how’s PO intended to work for deactivating plugins that themselves add new custom post types and so a new url (archive, single …pages) ?

    Plugin Author Jeff Sterup

    (@foomagoo)

    I have no problems with custom post types. It sounds like the plugin you are using is not setting the permalink properly so PO has no idea what the permalink is. It calls get_permalink to get the permalink for the custom post type. What is happening is PO is calling that function and the plugin isn’t applying it’s settings to set the permalink properly. If a plugin wants to add a custom permalink then it should be adding a hook to get_permalink that sets the custom structure. What plugin are you using that is causing the problem? I can install it on my test site to see if I can identify a better way for PO to get the permalink in this situation.

    Thread Starter Justin Fletcher

    (@justinticktock)

    Thanks,

    yes one plugin is Seriously Simple Podcasting

    its creating a ‘podcast’ custom post type and the archive landing page would be… https://mainsite.com/subsite/podcast/

    Plugin Author Jeff Sterup

    (@foomagoo)

    I was able to set up the podcasting plugin on my test site. I disabled it globally. Then I created 2 podcast post types with the podcast plugin enabled on one of them and not the other. When I go to the podcast that has the plugin enabled I get the podcast. When I go to the podcast that doesn’t have the plugin enabled I get a 404 error. So it looks like everything is working as expected.

    When you say “re-save / flush the permalinks” what do you mean? I don’t see any option in the podcast plugin to “re-save / flush the permalinks”.

    Thread Starter Justin Fletcher

    (@justinticktock)

    Thanks Jeff,

    are you testing on a network/multi-site install ?

    So for the “re-save / flush the permalinks”
    I mean going to the menu option …admin dashboard…settings… Permalinks
    I have the Common Settings set to “Post Name” so that the site urls are pretty.
    Then hitting save on the dashboard…settings… Permalinks page gives me the fault described above.

    Plugins can flush the permalinks using the function flush_rewrite_rules(), but I’m getting the fault just manually saving .

    When you say you have “with the podcast plugin enabled on one of them” did you do this only using plugin filters? Or by enabling the podcast post type in PO settings and then enabling the plugin on the page meta data?

    I am only talking of disabling with “global plugins” and re-enabling with a “plugin filter”

    Plugin Author Jeff Sterup

    (@foomagoo)

    I’m not running a multi site install on my test site. I am able to change the permalink structure without getting any errors. I can use a plugin filter to enable the podcast plugin and it works fine. When you say “permalinks save without knowledge of the plugin pages” do you mean the plugin filters permalink doesn’t change to the new structure? Or are you getting some kind of error? Plugin filters are manual and will not automatically update to the new structure of your permalinks for the site.

    Thread Starter Justin Fletcher

    (@justinticktock)

    “permalinks save without knowledge of the plugin pages”.. What I mean here is that the page can be working before the PO is used to disable and re-enable via plugin filter.. But once PO is setup and the permalinks are saved it doesn’t show the page any longer.

    My assumption is that the plugin is being disabled and so the custom post type not registered then when the permalinks are being saved it’s not there to register..
    . It looks more like a difference between Multisite and single site?

    Happy Christmas by the way 🙂

    Plugin Author Jeff Sterup

    (@foomagoo)

    I deleted my testing site and set it up as a multi site install. I created a sub site with the address http://www.domain.com/test1/. I activated Plugin Organizer and then the podcasting plugin. I enabled support for the podcast custom post type on the Plugin Organizer settings page and enabled selective plugin loading. Then I created a test podcast with the permalink http://www.domain.com/site1/podcast/testcast/. I then went to the global plugins and disabled the podcast plugin. Then I created a plugin filter with the permalink set to http://www.domain.com/site1/podcast/testcast/ and enabled the podcast plugin with that filter. When I went to http://www.domain.com/site1/podcast/testcast/ the podcast page showed up as expected. I did this all with the default permalink structure. Then I went into the permalinks setting and changed it to /%category%/%postname%/. When I went back to http://www.domain.com/site1/podcast/testcast/ the podcast plugin was still enabled. I’m not having any issues with the plugin being enabled through a plugin filter. Is the address of your podcast page changing after you change the permalink structure?

    Thread Starter Justin Fletcher

    (@justinticktock)

    Jeff thanks for hanging in with me…

    I’ve spent this evening looking at different set-ups a local dev site follows your testing and I confirm it works locally too for me. so I’ve looked at the production site and disabled everything re-activating a step at a time and I’ve found that the plugin All-in-One Event Calendar by Time.ly looks like its the problem with PO working correctly.

    Trying this on my local dev site shows it works ok so it could be a combination of https/SSL and the calendar plugin both on on the production site.

    will you be able to test https with the plugin?

    Plugin Author Jeff Sterup

    (@foomagoo)

    I was wrong with my first response. I have tested and yes the event calendar plugin is messing with the rewrite rules whenever the permalink structure is changed. It flushes the rules and removes the ones created by PO so the plugin filter post type is no longer registered. That’s why you can’t get to the podcast page anymore. I need to change the way the post type is registered and do a flush rewrite rules call after they are registered. I will do some testing and probably be able to get this fixed by some time next week.

    Thread Starter Justin Fletcher

    (@justinticktock)

    Great thanks that will be brilliant and speed my site up.. The all on one event calendar, whilst being great with its themes and functionality is one of the heavier kind of plugins and processes on most pages even when not relevant. plugin organiser really will help 🙂

    Plugin Author Jeff Sterup

    (@foomagoo)

    So it had nothing to do with my custom post types. The all in one events calendar is doing something with the rewrite rules when the permalink structure is changed. If you add a plugin filter for the root of your subsite like http://www.domain.com/site1/ and enable the podcast plugin on that filter then it will correctly register the rewrite rules for the podcasting plugin. If you don’t have the all in one calendar activated then the filter is not needed and the rewrite rules are registered even if the podcasting plugin is disabled.

    Thread Starter Justin Fletcher

    (@justinticktock)

    OK I’ve looked at what you have found works in enabling the plugin filter on the root url for the blog/site however I’m not seeing it work.

    I’m using ..
    premalink set for … http://maindomain/blog/sample-post/
    PO using a group to turn off the podcast plugin
    PO using a plugin filter and a group to turn on the podcast plugin.

    but http://maindomain/blog/podcast/ is still missing?
    I’ll post over at time.ly too to see what they say.

    Thread Starter Justin Fletcher

    (@justinticktock)

Viewing 15 replies - 1 through 15 (of 28 total)

The topic ‘Not playing right with saving permalinks’ is closed to new replies.