carlomanf / wp-funnel-manager

Organises wordpress content into multi-step funnels.
https://wordpress.org/plugins/wp-funnel-manager/
5 stars 0 forks source link

Introduce legacy funnel class #11

Closed carlomanf closed 3 years ago

carlomanf commented 3 years ago

Funnels typically are styled differently from the rest of the site, often removing a lot of navigation elements. A shortcoming of this plugin has been that it hasn't worked in this way, with funnels showing up like any other posts.

Many of the latest commits have been focused on integrating the plugin with the full site editing features coming soon to core. This will enable funnels to be styled differently from the rest of the site through their own editable theme template, and make the plugin behave more like a typical funnel builder.

There is the need to keep the legacy funnels working without causing anything to break. This is being done by making a legacy sub-class of the main funnel class, moving methods to the appropriate class and overriding them if necessary.

Moving forward, all new features will fall into one of 3 categories:

  1. New features that depend on the full site editing features. These methods must be overridden in the legacy sub-class to keep them away from the legacy funnels.

  2. New features that don't depend on the full site editing features, and can be safely applied to both legacy and new funnel types. These don't need to be overridden in the sub-class.

  3. New features that may or may not be related to full site editing, but would still break any existing funnels. There is an opportunity to apply these kinds of changes to only the new funnel types, overriding them in the sub-class, before the next version of the plugin is released.

An example of category 3 is a change to the way that user roles work. With legacy funnels, the capability type is borrowed from the default post type. With the new system, each funnel type will have its own capabilities. Changes like this will break any existing funnel, so they must be overridden in the legacy sub-class as well.

There are a few other new features that I am considering at the moment, and it will need to be determined which of the 3 categories each one fits into. If it's category 3, then there is only a limited window of opportunity to implement the new feature.

carlomanf commented 3 years ago

One feature that will probably fall into category 3 concerns the post author. I am thinking the post author should be uniform across all steps of a funnel, since it is a single entity, and the way to solve this may be to automatically set the post author upon save. This would obviously break existing funnels, so it will need to be kept out of the legacy class.

carlomanf commented 3 years ago

Another probable feature for category 3 concerns the hierarchical post type. I am considering turning this off, since funnels don't really support the multi-level nature of this setting. There are different issues being caused whether it's on or off, so I am still undecided. In any case, it will most probably need to remain for the legacy class so as not to break anything.

carlomanf commented 3 years ago

I am aware of two issues remaining with the current implementation, which are #12 and #13. When those are solved, this issue can be closed and v1.2.0 will be ready.