';
$wppb_version_validation = version_compare(PROFILE_BUILDER_VERSION, $wppb_add_on['product_version']);
($wppb_version_validation != -1) ? $wppb_version_validation_class = 'wppb-add-on-compatible' : $wppb_version_validation_class = 'wppb-add-on-not-compatible';
echo '
';
// PB minimum version number is all good
if ($wppb_version_validation != -1) {
// PB version type does match
if (in_array(strtolower($version), $wppb_add_on['product_version_type'])) {
if ($wppb_add_on_exists) {
// Display activate/deactivate buttons
if (!$wppb_add_on_is_active) {
echo '
' . __('Activate', 'profile-builder') . '';
// If add-on is network activated don't allow deactivation
} elseif (!$wppb_add_on_is_network_active) {
echo '
' . __('Deactivate', 'profile-builder') . '';
}
// Display message to the user
if (!$wppb_add_on_is_active) {
echo '
' . __('Add-On is inactive', 'profile-builder') . '';
} else {
echo '
' . __('Add-On is active', 'profile-builder') . '';
}
} else {
// If we're on a multisite don't add the wpp-add-on-download class to the button so we don't fire the js that
// handles the in-page download
($wppb_add_on['paid']) ? $wppb_paid_link_class = 'button-primary' : $wppb_paid_link_class = 'button-secondary';
($wppb_add_on['paid']) ? $wppb_paid_link_text = __('Learn More', 'profile-builder') : $wppb_paid_link_text = __('Download Now', 'profile-builder');
($wppb_add_on['paid']) ? $wppb_paid_href_utm_text = '?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page-buy-button&utm_campaign=PB' . $version : $wppb_paid_href_utm_text = '?utm_source=wpbackend&utm_medium=clientsite&utm_content=add-on-page&utm_campaign=PB' . $version;
echo '
' . $wppb_paid_link_text . '';
echo '
' . __('Compatible with your version of Profile Builder.', 'profile-builder') . '';
}
echo '
';
// PB version type does not match
} else {
echo '
' . __('Upgrade Profile Builder', 'profile-builder') . '';
echo '
' . __('Not compatible with Profile Builder', 'profile-builder') . ' ' . $version . '';
}
} else {
// If PB version is older than the minimum required version of the add-on
echo ' ' . '
' . __('Update', 'profile-builder') . '';
echo '
' . __('Not compatible with your version of Profile Builder.', 'profile-builder') . '';
echo '
' . __('Minimum required Profile Builder version:', 'profile-builder') . ' ' . $wppb_add_on['product_version'] . '';
}
// We had to put this error here because we need the url of the add-on
echo '
' . sprintf(__('Could not install add-on. Retry or install manually.', 'profile-builder'), esc_url($wppb_add_on['url'])) . '';
echo '