active', 'profile-builder' ); ?> inactive', 'profile-builder' ); ?>
$wppb_add_on ) { $wppb_add_on_exists = 0; $wppb_add_on_is_active = 0; $wppb_add_on_is_network_active = 0; // Check to see if add-on is in the plugins folder foreach ($wppb_get_all_plugins as $wppb_plugin_key => $wppb_plugin) { if (strpos(strtolower($wppb_plugin['Name']), strtolower($wppb_add_on['name'])) !== false && strpos(strtolower($wppb_plugin['AuthorName']), strtolower('Cozmoslabs')) !== false) { $wppb_add_on_exists = 1; if (in_array($wppb_plugin_key, $wppb_get_active_plugins)) { $wppb_add_on_is_active = 1; } // Consider the add-on active if it's network active if (is_plugin_active_for_network($wppb_plugin_key)) { $wppb_add_on_is_network_active = 1; $wppb_add_on_is_active = 1; } $wppb_add_on['plugin_file'] = $wppb_plugin_key; } } echo '
'; echo '
'; echo ''; echo ''; echo ''; echo '

'; echo ''; echo $wppb_add_on['name']; echo ''; echo '

'; //echo '

' . $wppb_add_on['price'] . '

'; if( $wppb_add_on['type'] == 'paid' ) echo '

' . __( 'Available in Hobbyist and Pro Versions', 'profile-builder' ) . '

'; else echo '

' . __( 'Available in All Versions', 'profile-builder' ) . '

'; echo '

' . $wppb_add_on['description'] . '

'; echo '
'; $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'])) { $ajax_nonce = wp_create_nonce("wppb-activate-addon"); 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 '
'; echo '
'; } /* end $wppb_add_ons foreach */ } ?>

$wppb_plugin) { if( strtolower($wppb_plugin['Name']) == strtolower( 'Paid Member Subscriptions' ) && strpos(strtolower($wppb_plugin['AuthorName']), strtolower('Cozmoslabs')) !== false) { $pms_add_on_exists = 1; if (in_array($wppb_plugin_key, $wppb_get_active_plugins)) { $pms_add_on_is_active = 1; } // Consider the add-on active if it's network active if (is_plugin_active_for_network($wppb_plugin_key)) { $pms_add_on_is_network_active = 1; $pms_add_on_is_active = 1; } $plugin_file = $wppb_plugin_key; } } ?>
$wppb_plugin ) { if( strpos( $wppb_plugin['Name'], $wppb_add_on_name ) !== false && strpos( $wppb_plugin['AuthorName'], 'Cozmoslabs' ) !== false ) { // Deactivate the add-on if it's active if( is_plugin_active( $wppb_plugin_key )) { deactivate_plugins( $wppb_plugin_key ); } // Return the plugin path echo $wppb_plugin_key; wp_die(); } } wp_die(); } add_action( 'wp_ajax_wppb_add_on_get_new_plugin_data', 'wppb_add_on_get_new_plugin_data' );