Commit 94a48481 authored by Kenneth Hall's avatar Kenneth Hall

Merge branch 'remove-throttle' into 'develop'

Removed floodgates check to show upgrade notice for all free users.

See merge request ninja-forms/ninja-forms!3657
parents a035f571 36c9be85
......@@ -799,7 +799,7 @@ function ninja_forms_three_admin_notice(){
wp_enqueue_style( 'nf-admin-notices', NINJA_FORMS_URL .'assets/css/admin-notices.css?nf_ver=' . NF_PLUGIN_VERSION );
if( ! isset( $_GET[ 'nf-rollback' ] ) ){
if( ninja_forms_three_addons_version_check() && ( ninja_forms_three_addons_check() || ninja_forms_three_throttle() ) ){
if( ninja_forms_three_addons_version_check() && ninja_forms_three_addons_check() ){
?>
<div id="nf-admin-notice-upgrade" class="update-nag nf-admin-notice">
<div class="nf-notice-logo"></div>
......
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Upgrade Throttle
* @param int $threshold
* @option int $compare
* @return bool
*/
function ninja_forms_three_throttle( $threshold = 25 ) {
$compare = get_option( 'ninja_forms_three_throttle', 0 );
if( ! $compare ){
$compare = rand( 1, 100 );
update_option( 'ninja_forms_three_throttle', $compare );
}
return ( $threshold >= $compare );
}
......@@ -17,7 +17,6 @@ require_once dirname( __FILE__ ) . '/lib/NF_Tracking.php';
require_once dirname( __FILE__ ) . '/lib/NF_Conversion.php';
require_once dirname( __FILE__ ) . '/lib/NF_ExceptionHandlerJS.php';
require_once dirname( __FILE__ ) . '/lib/Conversion/Calculations.php';
require_once dirname( __FILE__ ) . '/lib/NF_UpgradeThrottle.php';
// Services require PHP v5.6+
if( version_compare( PHP_VERSION, '5.6', '>=' ) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment