PopupMaker / Popup-Maker

Popup Maker plugin for WordPress
https://wppopupmaker.com/
104 stars 38 forks source link

Custom popups no longer working #571

Closed iSWORD closed 5 years ago

iSWORD commented 6 years ago

Popup Maker version: 1.7.28 WordPress version: 4.9.4 Active theme: Divi version: 3.0.105

How to reproduce

Either follow the "Create Read More Popups for Posts" tutorial or,

  1. Install and activate the plugin
  2. Create a new WordPress page
  3. Add a popup shortcode like this [popup id='foo']Hello World[/popup]
  4. Add a trigger like this <a href='#' class='popmake-foo'>Show foo</a>
  5. Preview / post the page and open it

Expected behaviour

This was working in v1.6.6 so I copied the output of the steps above in here:


<div id="pum-foo" class="pum pum-overlay pum-theme-35571 pum-theme-default-theme popmake-overlay click_open" data-popmake="{&quot;id&quot;:&quot;foo&quot;,&quot;slug&quot;:&quot;&quot;,&quot;theme_id&quot;:35571,&quot;cookies&quot;:[],&quot;triggers&quot;:[{&quot;type&quot;:&quot;click_open&quot;,&quot;settings&quot;:[]}],&quot;mobile_disabled&quot;:null,&quot;tablet_disabled&quot;:null,&quot;meta&quot;:{&quot;display&quot;:{&quot;size&quot;:&quot;small&quot;,&quot;overlay_disabled&quot;:0,&quot;custom_width&quot;:&quot;&quot;,&quot;custom_width_unit&quot;:&quot;px&quot;,&quot;custom_height&quot;:&quot;&quot;,&quot;custom_height_unit&quot;:&quot;px&quot;,&quot;custom_height_auto&quot;:1,&quot;location&quot;:&quot;center top&quot;,&quot;position_top&quot;:100,&quot;position_left&quot;:0,&quot;position_bottom&quot;:0,&quot;position_right&quot;:0,&quot;position_fixed&quot;:0,&quot;animation_type&quot;:&quot;slide&quot;,&quot;animation_speed&quot;:350,&quot;animation_origin&quot;:&quot;top&quot;},&quot;close&quot;:{&quot;overlay_click&quot;:0,&quot;esc_press&quot;:1},&quot;click_open&quot;:{&quot;extra_selectors&quot;:&quot;&quot;}}}" role="dialog" aria-hidden="true" >

    <div id="popmake-foo" class="pum-container popmake theme-35571 pum-responsive pum-responsive-small responsive size-small">

        <div class="pum-content popmake-content">
            <p>Hello World</p>
        </div>

        <button type="button" class="pum-close popmake-close" aria-label="Close">
        CLOSE            </button>

    </div>

</div>

<a href='#' class='popmake-foo'>Show foo</a>

Actual behaviour

This is the result from the latest version as of today

<div id="pum-" class=""  role="dialog" aria-hidden="true" >

    <div id="popmake-" class="">

        <div class="">
        </div>

        <button type="button" class="" aria-label="Close">
        </button>

    </div>

</div>

<a href='#' class='popmake-foo'>Show foo</a>
rgadon107 commented 6 years ago

@iSWORD Hello Muhannad. There's been a lot of change in the Popup Maker plugin since version 1.7 launched in mid-March. To begin with, please flush your browser cache per the instructions in this article: https://docs.wppopupmaker.com/article/365-my-editor-is-suddenly-broken-by-popup-maker

See if that makes a difference.

The [popup] shortcode is still supported in version 1.7, but is a deprecated method. The plugin development roadmap is to replace that shortcode entirely by plugin version 2.0.

Can you tell us more about what precisely you are trying to do with Popup Maker? If you want to set a popup trigger using the Popup Maker shortcode button, there is a cleaner way to do it. Please see this document for guidance: https://docs.wppopupmaker.com/article/90-shortcode-popup-trigger

And if you just need an overview on the Popup Maker shortcode button in general, please refer to this article: https://docs.wppopupmaker.com/article/153-shortcode-button.

And by the way, Popup Maker is fully compatible with the latest version of WordPress Core 4.9.6. We recommend that you update your core files.

iSWORD commented 6 years ago

Hi & thanks for the prompt response! Truly appreciated.

I use Popup Maker to make dynamic popups (generated with PHP) for custom post types. Example: https://fitsquadegypt.com/programs/ (this stopped working when I updated to 1.7.x so I reinstalled 1.6.6)

The website I am using PUM with right now is a website that never had the plugin installed so I'm sure it's not a cache thing.

So the [popup] shortcode was deprecated in favor of what exactly? What should I be using to create popups on the fly? It worked flawlessly.

Thanks again @rgadon107 :)

rgadon107 commented 6 years ago

@iSWORD Muhannad, You can create a popup on any type of post type; post, page, or CPT. Popup Maker itself registers a CPT to WordPress named 'popup'. It's not public because users were trying to preview their popups using the permalink that was available in the Popup Editor in version 1.6+. There's no template to go with the 'popup' post type. Users were always getting 'page not found' errors. The developer removed access to the 'popup' permalink in version 1.7.

It's quite easy to create a popup with Popup Maker. We have very good documentation in support of our latest version (1.7+). Besides, version 1.7+ is so far superior to 1.6 it's not worth monkeying around with the older version. Don't believe me? Go look at the plugin's changelog to see the number and frequency of changes added to Popup Maker in the past 2-1/2 months. https://wordpress.org/plugins/popup-maker/#developers

If I were you, I would reinstall the latest version of Popup Maker on your site. Then go read this document: https://docs.wppopupmaker.com/article/359-create-your-first-popup.

There's only 4 steps you need to take to generate a minimally viable popup. It's all described in that article.

Popup Maker registers a bunch of shortcodes, which are accessible in the Popup Editor via the shortcode button. Read this article to get acquainted with that feature. https://docs.wppopupmaker.com/article/153-shortcode-button The plugin developer is leveraging the the plugin's Shortcode API to migrate many of the Popup Maker premium extensions to use the shortcode button. It will be easier for plugin users to set their shortcode attributes. Just don't mess around with the [popup] shortcode. It's not worth your time.

If you're trying to dynamically pass in variables to a popup, then you're dealing with an entirely different animal. I suspect that you'll probably need to leverage the plugin's jQuery API to do it efficiently.

If the articles above do not help you to gin up a popup quickly, then submit a support request at https://wppopupmaker.com/support/. This is not a good forum to work out the problem that you initially posted.

danieliser commented 6 years ago

@iSWORD - sorry, @rgadon107 came on after we had already begun the process of deprecating the shortcode usage, so he has no experience with using it in templates like you are.

It was simply too hard to maintain with the speed of development of new features in the popup editor. IE no way to apply most of the awesome features to the shortcode in a useful way.

That said if you have simple content needs there are likely simpler more maintainable methods now such as our Remote Content extension which can probably do what you are after with ease and the full power of the editor. Plus only 1 popup for 1000s of posts, less extra markup on the page etc.

Hope that helps.

I will look into making the shortcode more backward compatible in v1.8 but it likely will be extremely simplified as I mentioned.

iSWORD commented 6 years ago

Thank you Daniel! I'll keep using v1.6.6 for now because I find the old way of adding popups on the fly very easy and straightforward. I hope this feature makes it back to the plugin. Please feel free to close the issue although I totally believe this is a bug until the docs make the necessary changes to state the alternative way to achieve what this feature provided, especially on this page "Create Read More Popups for Posts"

Thank you for all your efforts and for making & maintaining this wonderful plugin!

iSWORD commented 5 years ago

This seems to have been resolved as tested on v1.8.6.

PUM team however recently broke triggering popup actions with JavaScript by disallowing slugs and generating random IDs on every page reload to make it more difficult to work with the plugin.. ? Why break things that are working fine?

This used to be a great plugin.

danieliser commented 5 years ago

@iSWORD - I made extra efforts in v1.8 to make the shortcodes work correctly again.

That said are you saying you were previously using the slug via manual jQuery().popmake('open')? If so we deprecated those methods years ago in favor of our global API such as PUM.open(123). That said I can see that we missed something in terms of backward compatibility so start another issue on that specific issue and I'll see what I can do about making PUM.open accept string ids which would essentially be the equivalent to the slug generated for popups created with our admin interface.

iSWORD commented 5 years ago

@danieliser Thank you so much for your prompt response and sorry if sounded mean.

I appreciate all the effort you put into this plugin but it makes me sad to see my website break suddenly because of its updates, that's my only concern.

I have worked around the slug issue, no need to add it back to the plugin unless someone else needs to have it.

Thank you again,

danieliser commented 5 years ago

@iSWORD - Again all of these methods were marked deprecated a long time ago. As a dev that is the best we can do, kinda up to you to maintain your custom code over the course of 2 years. WordPress core & WooCommerce regularly deprecate and removes old stuff in the same fashion. We introduced the PUM JS API over 2 years ago, most all of our example code and internal code has been updated in that time as well.

Also from our estimates the number of users using the shortcode the way you are would probably be less than 100 if even that many. I only ever recommended it as a solution ~15 times via support compared to the many other methods we offer.

We simply can't hold the entire 300k+ user base hostage for 0.00001% either ;).

That said I am happy to keep this shortcode working. It has its place for now. And the slug issue as you said isn't an issue, but may make a nice helper utility for those doing siimilar when they update their code base.

I don't however see a current way around the css ID not being random and being a string instead. It sounds doable easily but will require modifying either the data model (Model_Popup) or the template itself to render differently as it currently pulls the $popup->ID which has to be numeric for things like get_post_meta( $popup->ID ).

There is a solution here, just gotta find it.