Giter Site home page Giter Site logo

impress-org / yelp-widget-premium Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 603 KB

Easily display Yelp business reviews and ratings with a simple and intuitive WordPress, block, widget, and shortcode.

Home Page: https://wpbusinessreviews.com/

PHP 70.77% JavaScript 16.42% CSS 12.81%
wordpress-plugin wordpress gutenberg widgets yelp yelp-api

yelp-widget-premium's Introduction

Yelp Widget Premium

Easily display Yelp business reviews and ratings with a simple and intuitive WordPress widget and shortcode.

yelp-widget-premium's People

Contributors

kevinwhoffman avatar mathetos avatar devinwalker avatar drrobotnik avatar

Watchers

James Cloos avatar  avatar

Forkers

kostaonguard

yelp-widget-premium's Issues

Remove Yelp API 2.0 language and backup key fields

Issue Overview

As of April 1st, 2017, you can no longer sign up for Yelp API 2.0.

This causes issues with both the free and premium plugins:

  • Free - Users cannot currently set up the plugin since they cannot create their own Yelp API keys.
  • Premium - Users cannot create a backup key, so the messaging in the settings screen is confusing.

Free

Broken Links:

image

Premium

There are several paragraphs about providing a backup key on the settings screen, but it's no longer possible to create that backup key.

Broken Links:

image

Related

https://wordpress.org/support/topic/needs-work-24/
https://secure.helpscout.net/conversation/350739695/7042/?folderId=672189

Add backup Yelp API key

Issue Overview

Users upgrading from API v2 to API v3 in 1.9.6 may not realize they should create their own Yelp Fusion app. To prevent existing widgets from breaking, Devin created a Yelp Fusion API key that will be used as the default value of the key if the user does not provide one.

We should still encourage users to create their own app, especially those who have reached out in the past regarding exhausted API limits. By embedding an API key, it is possible that key's limit could be reached. The most reliable option is still to create your own app and use that API key.

Note in API v3, we can now see the requests per day in the Yelp dashboard and know if that's happening.

Tasks

  • Add default API key fallback when first retrieving the key from settings.

Add an appropriate error message for Yelp API exhausation

Issue Overview

When the Yelp API is exhausted it throws the error "The default Yelp API has exhausted its daily limit. Please enable your own API Key in your Yelp Widget Pro settings."

This is not appropriate with the current version of the plugin, where the option to add "own API key" is removed.

Expected Behavior

Add an appropriate error message.

Related issue link from Helpscout

https://secure.helpscout.net/conversation/434492171/10443/?folderId=672191

Screenshot

index php 1701x823

yelp-widget-pro-map shortcode doesn't populate markers correctly

This shortcode is intended to display the most popular results for a certain search term on a Google Map. This is a sample shortcode:
[yelp-widget-pro-map location="Tucson, Arizona" search_term="coffee"]

Here's a live demo:
http://yelpwidgetpro.wordimpress.com/yelp-search/

The problem is this isn't working for NEW customers. So create a NEW dev site, install the current plugin, try to use that shortcode and you'll get several errors:

  1. A Google Maps API error (per #16)
  2. If you add your own API key into the JS call, the map will display but the map still won't populate the relevant markers based on the search query

Update plugin to use Yelp Fusion API

Issue Overview

image

Tasks

  • Add field for Yelp Fusion API Key.
  • Update search request to use Fusion API.
  • Update business request to use Fusion API.
  • Update reviews request to use Fusion API.
  • Update all variable names in templates if they have changed.
  • Add star images to plugin since API does not provide them anymore.
  • Replace Yelp logo image with transparent PNG
  • Update localized JSON data so that locations appear on Google Maps again.
  • Update inline docs with instructions to get Fusion API key.

Related

https://secure.helpscout.net/conversation/480415647/12209/?folderId=672191

Transition to oAuth 2.0

Yelp Fusion (v3) requires a new authentication scheme—oAuth 2.0 instead of 1.0. A walkthrough is available under the heading “Authorization” in their Getting Started guide. While it makes the vast majority of things easier, there are one or two things we’ll have to do differently.

Good things

  • No more signing URLs or creating weird hashed requests. Huzzah! Down with HMAC!
  • Still possible to bundle default credentials. (I’m 95% sure of this.)
  • Credentials are now only two values—an app ID and app secret—as opposed to four.
  • Authenticating is a simple matter of including a secret access token in all requests we make to the API.

Other things

  • Getting the secret access token requires a POST request to the Yelp servers (not a big deal). We then just store this access token in our database (also not a big deal).
  • The secret access token expires. Currently, it expires after 180 days, though this could change. (When requesting the access token, the expiration timeframe is included.) This is the one that could require a bit of work.

Dealing with renewing access tokens

Finding a way to deal with renewing these access tokens is key. We can create a WP Cron task that’s scheduled to get a new one before the timeout. WP Cron isn’t always reliable, though. We could also just always check the expiration time of the access token on each use, and request a new one if the one currently stored has expired. I don’t have a super clear idea of which is best for this, but it’s really the only aspect that’s somewhat difficult with this implementation.


Overall, this change should allow us to simplify a fair bit of the API code.

Business ID's with special characters return error

When a business ID has a special character the plugin returns an error.

Example:
Using business ID: café-poland-columbia the plugin returns an error.
If replaced with cafe-poland-columbia the reviews will display properly.

Can we build in a check to replace those characters or to allow them somehow?

Add setting for Google Maps API Key

Embedding a Google map in our Yelp widget/shortcode now requires a Maps API key.

We need to add a setting for this and admin alerts so users KNOW clearly that this is required now.

Add option for site visitor to search for locations from the front end.

Currently this feature works is the site owner sets it up in the back end to display places near a location. Like all sushi bars near San Diego for example.

A pre-sale support ticket asked if this could be done by site visitors on the front end. Could be a cool feature. I've only seen one person ask for it though.

fix: Display business reviews

Overview

Business reviews are not working.

If the option is checked in the widget, it shows nothing and if you have WP_DEBUG enabled, you can see a notice and a warning.
Notice: Undefined property: stdClass::$reviews in /app/public/wp-content/plugins/Yelp-Widget-Premium-master/includes/template-parts/business.php on line 44 Warning: Invalid argument supplied for foreach() in /app/public/wp-content/plugins/Yelp-Widget-Premium-master/includes/template-parts/business.php on line 44

Screenshots

1
2

Shortcode issues: reviews_filter not working

A customer reported an issue with their shortcode: [yelp-widget-pro id="dragons-den-san-diego" reviews="true" reviews_filter="4" avatar="40x40" profile_image_size="40x40"]

On the Yelp page for their business, with Yelp Sort, the top three reviews are 4 star, 3 star, and 1 star. With the reviews_filter set to 4 the widget is outputting the 3 and 1 star reviews still.

Customer's WordPress site

http://thedragonsdensd.com/

Customer's Yelp Page

http://www.yelp.com/biz/dragons-den-san-diego

Reference support ticket

https://secure.helpscout.net/conversation/175639686/905/?folderId=753630

Create new plugin banner to notify users of plugin's end of life

Issue Overview

We need to notify users that this plugin will no longer be supported or developed by end of 2018.

  • Notify users of plugin's end of life via a dismissible banner
  • Offer users an upgrade path with 1 free year of WPBR
  • Remove references to bundle / pro upgrade throughout
  • Notify users of the end of life on the settings page and widget
  • Remove old license notice

Proposed text:

On August 1st, 2018, Yelp Widget Premium became part of our brand new WordPress reviews plugin called WP Business Reviews. The Yelp Widget Premium plugin currently installed will be supported until December 31st, 2018. We are offering 1 year for free as a way to show you our appreciation for being a valued customer.

Upgrade now to WP Business Reviews
Have a Question? Contact Support

Google Map Search widget not working

Issue Overview

There are several issues with the Google Map Search widget. This is the second widget that is part of the premium plugin only.

  1. The widget does not recognize the built-in Yelp oAuth settings, and forces the user to enter a backup key (which no longer exists).
  2. Google Maps JS is not enqueued when this widget is present, which prevents the map from rendering on the front-end.
  3. There is a console error regarding Yelp oAuth which prevents locations from being searched.

Screenshots

Default state of the widget when added:

image

Google Maps Geocoding API required for Business Method

Issue Overview

Google Maps Geocoding API must be enabled in addition to the Google Maps JavaScript API for the map to work using the Business Method. The Search Method only requires the Google Maps JavaScript API.

Therefore Google Maps API key docs will need updated to ensure the following APIs are enabled:

  • Google Maps JavaScript API
  • Google Maps Geocoding API

Search Method w/ Both APIs enabled

image

Business Method w/ Both APIs enabled

image

Yelp Oauth classes conflict with other plugins/themes

It seems like we took the Yelp SDK straight into our plugin. If other plugins/themes do that as well, then the whole site gets white screened.

Case in point, Elegant Theme's "Extra" ( @DevinWalker you have access to it via your Elegant Themes account).

I believe namespacing will avoid this. Otherwise we'd have to prefix all the conflicting classes which would be like 20 different classes.

New Yelp API

Yelp just released "Yelp Fusion" a whole new API and developer program.
https://www.yelp.com/developers

We need to research what it does and how it can benefit our plugin. Here's how I see it happening:

  • 1) Research the new API and the developer program @lchski
  • 2) List all the things that are NEW about it @lchski
  • 3) List all the things it offers that we don't already implement @lchski
  • 4) Upgrade both Free/Pro to the new API @lchski
  • 5) Decide which new features should be added into which version FREE/PRO @mathetos
  • 6) Implement the new features into FREE/PRO based on #5

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.