Skip to content

Local Development

Kevin Hoffman edited this page Jul 6, 2018 · 8 revisions

Local development of the WP Business Reviews Server plugin requires two local WordPress sites to mimic the client-server relationship. Complete the setup steps for both websites below.

Set Up WordPress Site #1: Local Client Site

This site represents the end user who has downloaded the WP Business Reviews plugin.

  1. Create a new local WordPress site at wpbusinessreviewsclient.test. This domain must be used in order for the local dev flags to work correctly.
  2. Install and activate the WP Business Reviews client plugin.
  3. Define the following constants in wp-config.php:
define( 'WPBR_ENV', 'development' );
define( 'WPBR_SERVER_URL', 'wpbusinessreviews.test' );

Setting these constants links the Connect to Facebook button to wpbusinessreviews.test for testing. If this constant is not set to development, then the plugin will attempt to authenticate through wpbusinessreviews.com.

Set Up WordPress Site #2: Local Server Site

  1. Create a new local WordPress site at wpbusinessreviews.test. This domain must be used in order for the local dev flags to work correctly.
  2. Install and activate the WP Business Reviews Server plugin.
  3. Visit https://developers.facebook.com/apps/ and select the WP Business Reviews app to access the app ID and app secret.
  4. Define the following constants in wp-config.php:
define( 'WPBRS_FACEBOOK_APP_ID', '{INSERT_APP_ID_HERE}' );
define( 'WPBRS_FACEBOOK_APP_SECRET', '{INSERT_APP_SECRET_HERE}' );
  1. Ensure that the wpbusinessreviews.test URL is listed among valid OAuth redirect URLs in the Facebook app settings at App Dashboard > Facebook Login > Settings > Valid OAuth Redirect URLs. It should already be there, but double-check to be sure.

Begin Development

The local environment should now be ready for development.