Skip to content

Commit

Permalink
Merge pull request #169 from NewPath-Consulting/issues-125-129-140
Browse files Browse the repository at this point in the history
Issues #125, 129, and 140
  • Loading branch information
asirota authored Oct 15, 2024
2 parents dd5c74c + f4a3b2e commit 73f2e2a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: wildapricot, wild apricot, membership, event management, events, membershi
Requires at least: 5.0
Tested up to: 6.6.2
Requires PHP: 7.4
Stable Tag: 1.0.3
Stable Tag: 1.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -199,6 +199,12 @@ In Plugin Options tab you can turn on the "Print log messages to log file" to st

== Changelog ==

= Version 1.1 - October xx, 2024 =

- enable plugin debugging log by default
- improved WA credentials validation flow
- remove ability to sync admin-only fields

= Version 1.0.3 - October 2, 2024 =

- improved post restriction compatibility with other plugins that manage page or post contents
Expand Down
4 changes: 2 additions & 2 deletions assets/blueprints/blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"blogname": "WildApricot Press Demo Site"
},
"plugins": [
"https://github-proxy.com/proxy/?repo=NewPath-Consulting/Wild-Apricot-Press&branch=v1.1",
"https://github-proxy.com/proxy/?repo=NewPath-Consulting/Wild-Apricot-Press&branch=1.1",
"error-log-viewer",
"generateblocks",
"plugin-check"
Expand Down Expand Up @@ -60,4 +60,4 @@
"code": "<?php require_once('/wordpress/wp-load.php'); wp_insert_post(array( 'post_title' => 'WildApricot Press', 'post_content' => '<!-- wp:generateblocks/headline {\"uniqueId\":\"a449061d\",\"blockVersion\":3} --><h2 class=\"gb-headline gb-headline-a449061d gb-headline-text\">All the user-friendliness of WordPress with all the power of WildApricot</h2><!-- /wp:generateblocks/headline --><!-- wp:paragraph --><p>WordPress is the world\\'s most popular website builder. WildApricot is the #1 rated membership management software. Now, your organization can seamlessly combine the best of both with NewPath Consulting\\'s WildApricot Press plugin.</p><!-- /wp:paragraph --><!-- wp:generateblocks/headline {\"uniqueId\":\"62b72239\",\"blockVersion\":3,\"typography\":{\"textAlign\":\"left\"}} --><h2 class=\"gb-headline gb-headline-62b72239 gb-headline-text\">Build beautiful, mobile-friendly websites for WildApricot</h2><!-- /wp:generateblocks/headline --><!-- wp:paragraph {\"align\":\"left\"} --><p class=\"has-text-align-left\"><strong>NewPath Consulting\\'s WildApricot</strong> <strong>Press</strong> and our custom theme library enables you to build and manage your own full-featured website using just your web browser—without having to learn how to code. In fact, if you\\'ve ever used a layout editor like Microsoft Word or PowerPoint, you\\'ll be right at home with the WildApricot Press blocks in the <a href=\"https://wordpress.org/gutenberg/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress Block Editor</a>. Enjoy the elegance, diversity of plugins and unparalleled versatility of WordPress with the user-friendliness power of WildApricot Membership Management software. Build faster, customize more and lower the learning curve to produce the high-quality membership websites your members deserve.</p><!-- /wp:paragraph --><!-- wp:generateblocks/button-container {\"uniqueId\":\"302f0ee2\",\"alignment\":\"left\",\"isDynamic\":true,\"blockVersion\":3,\"stackTablet\":true,\"stackMobile\":true} --><!-- wp:generateblocks/button {\"uniqueId\":\"d7deeade\",\"hasUrl\":true,\"blockVersion\":4,\"hasButtonContainer\":true,\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"typography\":{\"textAlign\":\"center\"},\"spacing\":{\"paddingTop\":\"15px\",\"paddingRight\":\"25px\",\"paddingBottom\":\"15px\",\"paddingLeft\":\"30px\"},\"borders\":{\"borderTopRightRadius\":\"50px\",\"borderBottomRightRadius\":\"50px\",\"borderBottomLeftRadius\":\"50px\",\"borderTopLeftRadius\":\"50px\"},\"backgroundColor\":\"var(--button-hover-1)\",\"backgroundColorHover\":\"var(--buy-hover-1)\",\"textColor\":\"var(--accent)\",\"textColorHover\":\"var(--accent)\",\"hasIcon\":true,\"iconStyles\":{\"width\":\"1.5em\",\"height\":\"1.5em\",\"paddingRight\":\"0.5em\"}} --><a class=\"gb-button gb-button-d7deeade\" href=\"/product-purchase-wild-apricot-for-wordpress-plugin/\"><span class=\"gb-icon\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path d=\"M24 0C10.7 0 0 10.7 0 24S10.7 48 24 48H76.1l60.3 316.5c2.2 11.3 12.1 19.5 23.6 19.5H488c13.3 0 24-10.7 24-24s-10.7-24-24-24H179.9l-9.1-48h317c14.3 0 26.9-9.5 30.8-23.3l54-192C578.3 52.3 563 32 541.8 32H122l-2.4-12.5C117.4 8.2 107.5 0 96 0H24zM176 512c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm336-48c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48z\"></path></svg></span><span class=\"gb-button-text\">Buy</span></a><!-- /wp:generateblocks/button --><!-- wp:generateblocks/button {\"uniqueId\":\"33c2a880\",\"hasUrl\":true,\"blockVersion\":4,\"hasButtonContainer\":true,\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"columnGap\":\"0.5em\",\"typography\":{\"textAlign\":\"center\"},\"spacing\":{\"paddingTop\":\"15px\",\"paddingRight\":\"20px\",\"paddingBottom\":\"15px\",\"paddingLeft\":\"25px\",\"marginLeft\":\"20px\",\"marginTopTablet\":\"20px\",\"marginLeftTablet\":\"0px\",\"marginTopMobile\":\"20px\",\"marginLeftMobile\":\"0px\"},\"borders\":{\"borderTopRightRadius\":\"50px\",\"borderBottomRightRadius\":\"50px\",\"borderBottomLeftRadius\":\"50px\",\"borderTopLeftRadius\":\"50px\"},\"backgroundColor\":\"var(--buy-1)\",\"backgroundColorHover\":\"var(--button-hover-1)\",\"textColor\":\"var(--accent)\",\"textColorHover\":\"var(--accent)\",\"hasIcon\":true,\"iconStyles\":{\"width\":\"1.5em\",\"height\":\"1.5em\",\"paddingRight\":\"0.5em\"}} --><a class=\"gb-button gb-button-33c2a880\" href=\"#demo\"><span class=\"gb-icon\"><svg aria-hidden=\"true\" role=\"img\" height=\"1em\" width=\"1em\" viewBox=\"0 0 640 512\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M192 384h192c53 0 96-43 96-96h32c70.6 0 128-57.4 128-128S582.6 32 512 32H120c-13.3 0-24 10.7-24 24v232c0 53 43 96 96 96zM512 96c35.3 0 64 28.7 64 64s-28.7 64-64 64h-32V96h32zm47.7 384H48.3c-47.6 0-61-64-36-64h583.3c25 0 11.8 64-35.9 64z\"></path></svg></span><span class=\"gb-button-text\">Demo</span></a><!-- /wp:generateblocks/button --><!-- wp:generateblocks/button {\"uniqueId\":\"2584daf4\",\"hasUrl\":true,\"blockVersion\":4,\"hasButtonContainer\":true,\"display\":\"inline-flex\",\"flexWrap\":\"wrap\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"typography\":{\"textAlign\":\"center\"},\"spacing\":{\"paddingTop\":\"15px\",\"paddingRight\":\"20px\",\"paddingBottom\":\"15px\",\"paddingLeft\":\"20px\",\"marginLeft\":\"20px\",\"marginTopTablet\":\"20px\",\"marginLeftTablet\":\"0px\",\"marginTopMobile\":\"20px\",\"marginLeftMobile\":\"0px\"},\"borders\":{\"borderTopRightRadius\":\"50px\",\"borderBottomRightRadius\":\"50px\",\"borderBottomLeftRadius\":\"50px\",\"borderTopLeftRadius\":\"50px\"},\"backgroundColor\":\"var(--accent)\",\"backgroundColorHover\":\"var(--button-hover-1)\",\"textColor\":\"var(--base-3)\",\"textColorHover\":\"var(--accent)\",\"hasIcon\":true,\"iconStyles\":{\"width\":\"1.5em\",\"height\":\"1.5em\",\"paddingRight\":\"0.5em\"}} --><a class=\"gb-button gb-button-2584daf4\" href=\"#features\"><span class=\"gb-icon\"><svg aria-hidden=\"true\" role=\"img\" height=\"1em\" width=\"1em\" viewBox=\"0 0 512 512\" xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"currentColor\" d=\"M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 48c110.532 0 200 89.451 200 200 0 110.532-89.451 200-200 200-110.532 0-200-89.451-200-200 0-110.532 89.451-200 200-200m140.204 130.267l-22.536-22.718c-4.667-4.705-12.265-4.736-16.97-.068L215.346 303.697l-59.792-60.277c-4.667-4.705-12.265-4.736-16.97-.069l-22.719 22.536c-4.705 4.667-4.736 12.265-.068 16.971l90.781 91.516c4.667 4.705 12.265 4.736 16.97.068l172.589-171.204c4.704-4.668 4.734-12.266.067-16.971z\"></path></svg></span><span class=\"gb-button-text\">Features</span></a><!-- /wp:generateblocks/button --><!-- /wp:generateblocks/button-container -->','post_status' => 'publish' ));"
}
]
}
}
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: NewPath WildApricot Press
* Plugin URI: https://newpathconsulting.com/wap
* Description: Integrates your WildApricot-powered organization with a WordPress website! Powered by WildApricot's API.
* Version: 1.0.3
* Version: 1.1
* Requires at least: 5.0
* Requires PHP: 7.4
* Author: NewPath Consulting
Expand Down Expand Up @@ -96,4 +96,4 @@ function wap_action_links($links)
// Deactivation hook
register_deactivation_hook(__FILE__, function () {
WAWP\Deactivator::deactivate();
});
});
6 changes: 3 additions & 3 deletions src/admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ public function restriction_message_sanitize($input)
public function custom_fields_print_info()
{
print 'Please select the WildApricot Contact Fields that you would like to sync with your WordPress site.<br>';
print 'Admin-only contact fields are displayed below the list of contact fields but are not available to sync. If you wish to sync these fields with your site please change the field settings in Wild Apricot.';
print 'Admin-only contact fields are displayed below the list of contact fields but are not available to sync. If you wish to sync these fields with your site please change the field settings in WildApricot.';
}

/**
Expand Down Expand Up @@ -660,7 +660,7 @@ public function custom_fields_input()
}

/**
* Displays list of Wild Apricot member fields that have admin only access.
* Displays list of WildApricot member fields that have admin only access.
*
* @return void
*/
Expand Down Expand Up @@ -1304,7 +1304,7 @@ public function create_wa_auth_login_page()
echo '<p class="wap-error">Missing valid WildApricot credentials. Please enter them above.</p>';
} elseif ($api_status == WA_Integration::API_STATUS_INCORRECT_SCOPE) {
// incorrect scope selected
echo '<p class="wap-error">Incorrect application scope. Please create a <strong>full-access Server Application</strong> on Wild Apricot.</p>';
echo '<p class="wap-error">Incorrect application scope. Please create a <strong>full-access Server Application</strong> on WildApricot.</p>';
} elseif ($api_status == WA_Integration::API_STATUS_VALID && $wild_apricot_url) {
// successful login
echo '<p class="wap-success">Valid WildApricot credentials have been saved.</p>';
Expand Down
26 changes: 13 additions & 13 deletions src/class-wa-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function get_account_url_and_id()
try {
$details_response = self::response_to_data($response_api);
} catch (API_Exception $e) {
throw new API_Exception('There was an error retrieving the Wild Apricot account URL and ID.');
throw new API_Exception('There was an error retrieving the WildApricot account URL and ID.');
}

// Extract values
Expand Down Expand Up @@ -253,7 +253,7 @@ public function retrieve_custom_fields()
try {
$custom_field_response = self::response_to_data($response_api);
} catch (API_Exception $e) {
throw new API_Exception('There was an error retrieving the Wild Apricot custom fields.');
throw new API_Exception('There was an error retrieving the WildApricot custom fields.');
}


Expand Down Expand Up @@ -468,7 +468,7 @@ public static function get_new_access_token($refresh_token)
try {
$data = self::response_to_data($response);
} catch (API_Exception $e) {
throw new API_Exception('There was an error retrieving the Wild Apricot API access token.');
throw new API_Exception('There was an error retrieving the WildApricot API access token.');
}

return $data;
Expand All @@ -489,7 +489,7 @@ public function get_info_on_current_user()
try {
$contact_info = self::response_to_data($contact_info);
} catch (API_Exception $e) {
throw new API_Exception('There was an error retrieving Wild Apricot contact info.');
throw new API_Exception('There was an error retrieving WildApricot contact info.');
}

// Get if user is administrator or not
Expand All @@ -507,7 +507,7 @@ public function get_info_on_current_user()
try {
$full_info = self::response_to_data($user_data_api);
} catch (API_Exception $e) {
throw new API_Exception('There was an error retriving Wild Apricot user info.');
throw new API_Exception('There was an error retriving WildApricot user info.');
}

// Get all information for current user
Expand All @@ -533,7 +533,7 @@ public function get_membership_levels($request_groups = false)
try {
$membership_levels_response = self::response_to_data($membership_levels_response);
} catch (API_Exception $e) {
throw new API_Exception('There was an error retrieving the Wild Apricot membership levels.');
throw new API_Exception('There was an error retrieving the WildApricot membership levels.');
}

// Extract membership levels into array
Expand Down Expand Up @@ -611,14 +611,14 @@ public static function login_email_password($valid_login)
try {
$data = self::response_to_data($response);
} catch (API_Exception $e) {
throw new API_Exception('There was an error authorizing a Wild Apricot user\'s credentials.');
throw new API_Exception('There was an error authorizing a WildApricot user\'s credentials.');
}

return $data;
}

/**
* Retrieves list of contacts from Wild Apricot.
* Retrieves list of contacts from WildApricot.
*
* @param string $query additional query to append to the request url
* @param boolean $block whether a single block is requested or not, used
Expand Down Expand Up @@ -667,7 +667,7 @@ public function retrieve_contacts_list($query, $block = false, $skip = 0, $top =
}

/**
* Retrieves number of contacts from Wild Apricot.
* Retrieves number of contacts from WildApricot.
*
* @return int number of contacts
*/
Expand All @@ -689,7 +689,7 @@ public function get_contacts_count()
$data = self::response_to_data($response);
$count = $data['Count'];
} catch (API_Exception $e) {
throw new API_Exception('There was an error retrieving the number of Wild Apricot contacts.');
throw new API_Exception('There was an error retrieving the number of WildApricot contacts.');
}

update_option(WA_Integration::WA_CONTACTS_COUNT_KEY, $count);
Expand All @@ -698,7 +698,7 @@ public function get_contacts_count()
}

/**
* Requests a single block of contacts from Wild Apricot.
* Requests a single block of contacts from WildApricot.
*
* @param string $url base url to which to make the request
* @param int $skip the number of contacts to skip from the beginning
Expand All @@ -723,7 +723,7 @@ private function request_contact_block($url, $skip, $top)
try {
$data = self::response_to_data($response);
} catch (API_Exception $e) {
throw new API_Exception('There was an error retrieving Wild Apricot contacts.');
throw new API_Exception('There was an error retrieving WildApricot contacts.');
}

return $data;
Expand All @@ -738,4 +738,4 @@ private function get_yesterdays_date()
{
return date('Y-m-d', strtotime("-1 days"));
}
}
}
4 changes: 2 additions & 2 deletions src/class-wa-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WA_Integration
public const WA_CLIENT_SECRET_OPT = 'wawp_wal_client_secret';

/**
* Stores the validity status of the Wild Apricot API credentials.
* Stores the validity status of the WildApricot API credentials.
*
* @var string
*/
Expand Down Expand Up @@ -82,7 +82,7 @@ class WA_Integration


/**
* Stores the total number of Wild Apricot contacts.
* Stores the total number of WildApricot contacts.
*/
public const WA_CONTACTS_COUNT_KEY = 'wawp_contacts_count';

Expand Down

0 comments on commit 73f2e2a

Please sign in to comment.