idxbroker / wordpress-plugin

IMPress for IDX Broker
http://www.idxbroker.com
GNU General Public License v2.0
22 stars 30 forks source link

1.3.0 New Shortcode Button #16

Closed bhubbard closed 6 years ago

bhubbard commented 9 years ago

Checking out the updates for _1.3.0_, I thought it important to discuss the new UI for inserting IDX shortcodes. Shortcodes are great, but if we can limit them I think everyone will be better off. Since the pages are now a custom post type, we can use the native link feature in the WordPress editor to link to the IDX Broker pages.

Here is a screenshot, the first paragraph I used the new "Add IDX Shortcode" feature to add the link, while the second I simply created the link using the native WordPress link to existing content feature in the editor.

I think it would be better to begin phasing out the following shortcodes, in favor of using direct links:

[idx-platinum-system-link
[idx-platinum-saved-link

The _"Add IDX Shortcode"_ feature is more obvious for users, but for saved links and system links I suggest it just enter a regular link. By inserting as a regular link would mean that no matter which method the user uses the content will be consistent. In addition the editor code and output code will be exactly the same.

bhubbard commented 9 years ago

Here are two queries that can be used to check how many posts/pages are using the two shortcodes in question for a site:

SELECT ID FROM wp_posts WHERE post_content LIKE '%[idx-platinum-system-link%'
SELECT ID FROM wp_posts WHERE post_content LIKE '%[idx-platinum-saved-link%'

I would suggest for _1.3.0_, we just encourage the direct link, and then in some future update we run a find and replace for the old shortcodes replacing with the direct url, and then remove support for those shortcodes all together.

csjoblom commented 9 years ago

The 1.3 release version already does this.

  1. Edit post
  2. Click Add/Edit link button
  3. IDX Pages (system and saved links) show under "Or link to existing content" heading with search, identified by IDX Page in right column. http://cl.ly/image/2q340Y0x1I3y

Once 1.3.0 is live I will close this out.

bhubbard commented 9 years ago

@csjoblom - Sorry if it was unclear, but I understand that the add/link buttons lets you link to an IDX page.

My concern is that clicking on ADD IDX Shortcode will ALSO let the user insert a link to a IDX page, but using a shortcode. In my screenshot I showed two paragraphs that output the exact same code to the front-end of a website. The first paragraph I used the ADD IDX Shortcode and the second used the add/link buttons. Two methods, same results.

I know the current version of the plugin also uses these 2 shortcodes, but what I am suggesting is with 1.3.0 we begin the process of phasing them out in favor of regular links. There are two ways we can do this:

1) Remove the Add Saved/System Link feature from inside the ADD IDX Shortcode UI all together. We would then just need to train users to use the add/link buttons provided by the WordPress editor.

or

2) Update the Add Saved/ System Link buttons inside of the ADD IDX Shortcode UI to insert a regular link instead of the shortcode. We could remove the word "shortcode" from the button if that leaves confusion, so it would just say "Add IDX".

I am then proposing with version 1.3.X (some future version) we can do a find and replace and start to removing these old shortcodes in favor of direct links. Direct links are easier for clients to use within the WordPress editor. It also means in the future it would be easier to do find and replace for regular url strings when needed vs find and replace for the shortcodes (and/or the links) which would be more work.

Shortcodes are great and useful, but I think there are cases such as these (links) where it is overkill and can be confusing for clients. If you need me to reach out more directly to discuss just let me know, @antonioortegajr has my contact info.

csjoblom commented 9 years ago

@bhubbard thanks for the extra info. 1.3.0 is slated to be pushed out this week. After 1.3.x we are going to be working on 2.x so this might have to wait until then. I will get this added as an Enhancement Request and bring it to everyone's attention.

csjoblom commented 9 years ago

"The downside to inserting an actual link instead of a shortcode, is anytime the website domain changes on the IDX account or the url of the IDX page is changed, it will have to be manually updated by clients. The benefit to shortcodes is the client can change their account domain or idx page url in Middleware and the IDX page updates automatically. This is similar to using saved links in our system instead of copying hard-coded results urls. The benefits of being able to update these urls dynamically probably outweighs the downsides of displaying a shortcode instead of a link from a UX standpoint."

I can't say I don't agree with the statements quoted, having to manually go back and change direct links if something changes is a huge potential headache.

bhubbard commented 9 years ago

@csjoblom

I agree with the concern, however we must first ask, which domain are you talking about changing? There are three we must ALWAYS consider:

_WordPress URL:_ wpdomain.com _Custom IDX SubDomain:_ example.wpdomain.com _Default IDX SubDomain:_ wpdomain.idxbroker.com

All three of these could potentially be changed. I have put in a feature request in the past for IDX Broker to offer an update to the API to pull the Custom IDX SubDomain, and the Default IDX SubDomain, along with the setting to which is being used/set via middleware. If all three are stored in WordPress as an option, then we can simply detect when the url has changed via the setting. If the url has changed we can do a simple find and replace to update the urls. For most sites this shouldn't happen often, mostly when they go from the Default IDX SubDomain* to a _Custom IDX SubDomain_.

Same idea with the individual site urls, we can do a find and replace upon detection of a change for any of the urls.

As clients will now be able to link to a page directly thru the WordPress editor this will be a problem, regardless if the shortcode UI stays the same as it is now. That why I suggest just doing the url, and finding appropriate solutions to handle updating urls when the change.

Some things we can do to improve the process:

By sticking with just urls, it also means tools such as wp-cli command wp search-replace wpdomain.idxbroker.com example.wpdomain.com could still be used by developers/support teams.

Remember: As it is now clients already hard-code urls all the time. I'm just suggested we let them keep doing it an offer tools to keep the urls correct and up-to-date.

antonioortegajr commented 6 years ago

Since this issue and shortcodes in general are now affected by Gutenberg closing this issue. After the Gutenberg release this issue may be revisited.