Code Monkey home page Code Monkey logo

strangerstudios / pmpro-advanced-levels-shortcode Goto Github PK

View Code? Open in Web Editor NEW
27.0 6.0 25.0 341 KB

Build a beautiful membership levels page for Paid Memberships Pro using a customizable block or shortcode.

Home Page: https://www.paidmembershipspro.com/add-ons/pmpro-advanced-levels-shortcode/

CSS 16.29% PHP 67.78% JavaScript 15.93%
wordpress paid-memberships-pro strangerstudios-product wordpress-plugin block-editor wordpress-block wordpress-blocks

pmpro-advanced-levels-shortcode's Introduction

License

Welcome to the Paid Memberships Pro - Advanced Levels Page GitHub Repository

Customize the levels page with column layouts, hide/show specific plans and plan details, and display your pricing table anywhere on your membership site.

For more information please visit paidmembershipspro.com/add-ons/pmpro-advanced-levels-shortcode/

Installation

For detailed installation steps, visit the documentation page.

  1. Download the current development ZIP file directly: https://github.com/strangerstudios/pmpro-advanced-levels-shortcode/archive/dev.zip

Please ensure that once installing this version of the plugin to remove -dev from the plugin's folder name.

Bugs

If you find an issue/bug, let us know by creating a detailed GitHub issue.

Support

This is a developer's portal for Paid Memberships Pro - Advanced Levels Page. We do not offer support on this channel. Any support related questions should be directed to paidmembershipspro.com/add-ons/pmpro-advanced-levels-shortcode/.

Contributing to Paid Memberships Pro - Advanced Levels Page

We encourage and welcome any contribution to Paid Memberships Pro - Advanced Levels Page. Please read the guidelines for contributing to this repository.

There are various ways to the help development of Paid Memberships Pro - Advanced Levels Page:

  1. Report bugs/issues on GitHub.
  2. Work on any issues by submitting a Pull Request.

Here are some ways for non-developers to contribute to Paid Memberships Pro - Advanced Levels Page:

  1. Translate Paid Memberships Pro - Advanced Levels Page into your own language.
  2. Purchase a paid membership to help fund ongoing development and bug fixes.

pmpro-advanced-levels-shortcode's People

Contributors

andrewlimaza avatar dalareo avatar dparker1005 avatar eighty20results avatar github-actions[bot] avatar ideadude avatar jarrydlong avatar kimcoleman avatar lmntl avatar maximilianoricotabo avatar sjolshagen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pmpro-advanced-levels-shortcode's Issues

Issue: Unable to add Commas to output

Appears to be a WordPress problem with using shortcodes.
Users are unable to add a comma "," to display text. It will usually force a break to the next element.
Slash comma does not work and using HTML for comma will not work as it has a semicolon in it.

Example: can not display 10,000

Code to show Member Badges not working in Compare Table Layout

Steps to recreate:

  • Add a shortcode to display pricing like this: [pmpro_advanced_levels levels="1,3,2" layout="3col" compare="Compare Item 1,1,1;Compare Item 2,1,1;Compare Item 3,1,1;Numerical Thing,10 Things,20 Things"]
  • add this code gist to display member badges icon
  • change layout attribute in the shortcode to compare_table and in the code gist to 'compare_table'
  • member badge does not get displayed. change layout to Div, 4Col, or any other attribute, it works as intended.

MMPU Compatibility - "Your Level" text

"Your Level" text in table layout only shows for first membership level that a user has, all other levels show the default "Select" text regardless of if the user has that membership level. Not sure if this is an issue for other layouts as well.

Discount codes not recognized in URLs

If I link to a page with Advanced Levels Shortcode in the form of ?discount_code=CODE the code does not get recognized. As users usually don't link directly to a checkout page but to a product page or compare table this would be a very welcome feature.

compare_table layout doesn't honor pmpro_levels_array filter

When applying the 'levels' array, certain membership levels may be excluded from the list of levels in spite of what the compare attribute in the pmpro_advanced_levels shortcode is configured to do. As a result, the table can look somewhat ugly (contains the checkmarks, but not the actual level description/price/etc.

I would have expected the shortcode to fully honor the filter, or completely ignore it.

Spacing of level benefits in mobile view

I love the comparison table, but on mobile longer level benefits are harder to read. In the screen shot below, I added dashes in a span that I hid in the comparison table. It helps, but reducing the line height within a benefit would be even better - that way the space delineates when one benefit description ends and another begins.

Do people still use <dl> & <dt> tags? They might be a better alternative to <p>'s.

image

Parse error:

syntax error, unexpected '}' in /home/dcsorenson63/public_html/wp-content/plugins/pmpro-advanced-levels-shortcode/templates/levels-compare_table.php on line 279

Fatal Error if plugin is active and levels page uses [pmpro_levels]

The following error occurs on the levels page when [pmpro_levels] is used instead of the advanced levels shortcode and the advanced shortcode plugin is active.

[11-Jul-2018 08:08:21 UTC] PHP Fatal error: Cannot redeclare pmpro_pages_shortcode() (previously declared in /public_html/wp-content/plugins/paid-memberships-pro/includes/init.php:138) in /public_html/wp-content/plugins/paid-memberships-pro/includes/init.php on line 138

Comparison items in the Compare Table view's mobile fallback aren't showing the value

Describe the bug
When you use the compare table layout, the plugin also shows a mobile div-style version since the compare table layout isn't able to be made fully responsive.

In the last update, we broke how the comparison items show on the collapsed/mobile view.

Expected behavior
We need to make sure the comparison items are either only showing the ones you "get" if its a true/false (0,1) OR show all items and then make sure we show a checkmark or an x.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

Warning with PHP 8.0.27

Describe the bug
A customer ran into a warning with PHP 8.0.27.

To Reproduce
Steps to reproduce the behavior for customer:

  1. Set PHP version to PHP 8.0.27
  2. Activate Paid Memberships Pro, and Advanced Levels Page Shortcode Add On
  3. Go to the the levels page. See this error:
Warning: Undefined property: stdClass::$allow_signups in /xxyy/public_html/wp-content/plugins/pmpro-advanced-levels-shortcode/templates/levels-table.php on line 91

Expected behavior
There should not be an error.

This came up in ticket 482012 on PHP 8.0.27, but I couldn't replicate on PHP 8.0.22.

WordPress Environment

Paid Memberships Pro 2.10.3, and Advanced Levels Page Shortcode Add On 0.2.5, WordPress 6.1.1, PHP 8.0.27

Bug: Does not work with links.

If you add a link within the compare values, it causes an error and doesn't display values at all.

Undefined offset: 1 in /app/public/wp-content/plugins/pmpro-advanced-levels-shortcode/templates/levels-compare_table.php on line 387

make a "button" layout

I think it would be great to have a "button" layout, that contains button text and (if applicable) price. This would enable a high freedom in creating product/membership pages (eg more advanced compare tables etc) by still maintaining the great functionality of the plug-in.

Feature request: Add a Gutenberg block

Feature request

A customer sent in ticket (id 284341) with the following question:

can we expect a gutenberg block for advanced levels next to shortcode?

Additional context
Add a Gutenberg block similar to the core Paid Memberships Pro blocks:
image

Custom Level Cost Text will not replace text for FREE levels

When using Advanced Levels Shortcode, the FREE levels cost text will not change when using the Custom LEvel Cost Text Add On.

<img width="471" alt="2-changedtext" src="https://user-images.githubusercontent.com/8083630/136456274-544ad9d4-2ed3-4138-ae1e-d45cea5d34cb.png"
1-text-should-change

The plugin is keeping the FREE wording here.

if(pmpro_isLevelFree($level))
{
if(!empty($expiration))
{
?>
<strong><?php _e('Free', 'pmpro-advanced-levels-shortcode'); ?></strong>
<?php
}
else
{
?>
<strong><?php _e('Free', 'pmpro-advanced-levels-shortcode'); ?></strong>
<?php
}
}

Disable buttons for certain levels

I use advanced levels plugin in compare_table layout. I would like to show logged in users the different levels but only allow them to upgrade to higher levels.
So I think it would create a lot of flexibility if users could disable buttons to certain levels completely. This could be old membership levels that are no longer offered or "lower" levels than the current level, so users can only upgrade, not downgrade.

display "instead prices"

If a discount code is used, it would be great to be able to display the regular price as well as the discount price. Like 7.99 instead of 9.99. Or -9.99- (strike through) 7.99. So the potential customers see the benefit they're getting.

Discount codes incorrectly applied when there's more than one shortcode instance

Describe the bug
When the [pmpro_advanced_levels] shortcode is added to a page with the discount parameter set, any subsequent uses of the shortcode on the page have the first shortcode's discount code applied to the URL.

To Reproduce
Steps to reproduce the behavior:

  1. Add one [pmpro_advanced_levels] shortcode to a page. Add the discount_code attribute and set a discount code.
  2. Add a second [pmpro_advanced_levels] shortcode, do not specify a discount code.
  3. Publish and view the page
  4. See that both shortcode's URLs have a discount_code parameter set

Expected behavior
Second shortcode's level URL should not have a discount code parameter.

WordPress Environment

``` WP 6.2.2 PMPro 2.11 Advanced Levels Page Shortcode 0.2.5 ```

Responsive view of compare_table quirky

If at compare_table layout the responsive view takes over and changes to a 1 column div layout, the with of the boxes vary. The first div is full with, the following are narrower (experienced on Firefox for Android).

Enhancement: Allow additional HTML tags in the level cost

Is your feature request related to a problem? Please describe.
I would like to be able to use additional HTML tags in the level cost, for greater flexibility in styling.

Describe the solution you'd like
Currently, other shortcode text like level description and expiration messages can be configured to allow more HTML tags using the pmproal_allowed_html filter. Apply the pmproal_allowed_html filter to the level cost text output as well.

Additional context
Mods: Ticket #500898

New filter to allow customization of the "compare" attribute and compare items

We should add a filter so that custom code can add html and special characters for compare items.

New filter will be placed here and will return an array of compare item values where the first value is the row's "label" and the other values are to populate each level / column of data. Something like:

$compareitem_values = apply_filters( 'pmpro_advanced_levels_compare_items', $compareitem_values );

Need to make sure you can use html tags like hyperlinks, line breaks, icons, images as well as all characters include a comma or semicolon (which are two current limitations of use the shortcode attribute directly).

This will resolve / provide an option and also address issues #30 and #31 .

Support data-* global attributes

Is your feature request related to a problem? Please describe.
Link items using a tags do not render or strip out data-* global attributes

Describe the solution you'd like
Have data-* global attributes returned in the HTML rendered by this plugin

Describe alternatives you've considered
Not aware of any

Additional context
Using the example on the plugin page:

'<a href="/item-1/" data-myattr="/myval/">Item 1</a>,1,1;<a href="/item-2/">Item 2</a>,0,1'

In the code above, the level page will return the a tag with the href but without the data-attr attribute

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.