Edit File by line
/home/barbar84/www/wp-conte.../plugins/ninja-fo...
File: ninja-forms.php
<?php
[0] Fix | Delete
/*
[1] Fix | Delete
Plugin Name: Ninja Forms
[2] Fix | Delete
Plugin URI: http://ninjaforms.com/?utm_source=Ninja+Forms+Plugin&utm_medium=readme
[3] Fix | Delete
Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
[4] Fix | Delete
Version: 3.4.33
[5] Fix | Delete
Author: Saturday Drive
[6] Fix | Delete
Author URI: http://ninjaforms.com/?utm_source=Ninja+Forms+Plugin&utm_medium=Plugins+WP+Dashboard
[7] Fix | Delete
Text Domain: ninja-forms
[8] Fix | Delete
Domain Path: /lang/
[9] Fix | Delete
[10] Fix | Delete
Copyright 2016 WP Ninjas.
[11] Fix | Delete
*/
[12] Fix | Delete
[13] Fix | Delete
require_once dirname( __FILE__ ) . '/lib/NF_VersionSwitcher.php';
[14] Fix | Delete
require_once dirname( __FILE__ ) . '/lib/NF_Tracking.php';
[15] Fix | Delete
require_once dirname( __FILE__ ) . '/lib/NF_Conversion.php';
[16] Fix | Delete
require_once dirname( __FILE__ ) . '/lib/NF_ExceptionHandlerJS.php';
[17] Fix | Delete
require_once dirname( __FILE__ ) . '/lib/Conversion/Calculations.php';
[18] Fix | Delete
require_once dirname( __FILE__ ) . '/includes/Integrations/sendwp.php';
[19] Fix | Delete
[20] Fix | Delete
// Services require PHP v5.6+
[21] Fix | Delete
if( version_compare( PHP_VERSION, '5.6', '>=' ) ) {
[22] Fix | Delete
include_once dirname( __FILE__ ) . '/services/bootstrap.php';
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
function ninja_forms_three_table_exists(){
[26] Fix | Delete
global $wpdb;
[27] Fix | Delete
$table_name = $wpdb->prefix . 'nf3_forms';
[28] Fix | Delete
return ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name );
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf2to3' ] ) && ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) ){
[32] Fix | Delete
[33] Fix | Delete
include 'deprecated/ninja-forms.php';
[34] Fix | Delete
[35] Fix | Delete
register_activation_hook( __FILE__, 'ninja_forms_activation_deprecated' );
[36] Fix | Delete
[37] Fix | Delete
function ninja_forms_activation_deprecated( $network_wide ){
[38] Fix | Delete
include_once 'deprecated/includes/activation.php';
[39] Fix | Delete
[40] Fix | Delete
ninja_forms_activation( $network_wide );
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
} else {
[44] Fix | Delete
[45] Fix | Delete
include_once 'lib/NF_Upgrade.php';
[46] Fix | Delete
include_once 'lib/NF_AddonChecker.php';
[47] Fix | Delete
[48] Fix | Delete
include_once plugin_dir_path( __FILE__ ) . 'includes/deprecated.php';
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Class Ninja_Forms
[52] Fix | Delete
*/
[53] Fix | Delete
final class Ninja_Forms
[54] Fix | Delete
{
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* @since 3.0
[58] Fix | Delete
*/
[59] Fix | Delete
[60] Fix | Delete
const VERSION = '3.4.33';
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* @since 3.4.0
[64] Fix | Delete
*/
[65] Fix | Delete
const DB_VERSION = '1.4';
[66] Fix | Delete
[67] Fix | Delete
const WP_MIN_VERSION = '5.0';
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* @var Ninja_Forms
[71] Fix | Delete
* @since 2.7
[72] Fix | Delete
*/
[73] Fix | Delete
private static $instance;
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Plugin Directory
[77] Fix | Delete
*
[78] Fix | Delete
* @since 3.0
[79] Fix | Delete
* @var string $dir
[80] Fix | Delete
*/
[81] Fix | Delete
public static $dir = '';
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* Plugin Database Version
[85] Fix | Delete
*
[86] Fix | Delete
* This may be overwritten at a later point in this file.
[87] Fix | Delete
*
[88] Fix | Delete
* @since 3.4.0
[89] Fix | Delete
* @var string $db_version
[90] Fix | Delete
*/
[91] Fix | Delete
public static $db_version = self::DB_VERSION;
[92] Fix | Delete
[93] Fix | Delete
/**
[94] Fix | Delete
* Plugin URL
[95] Fix | Delete
*
[96] Fix | Delete
* @since 3.0
[97] Fix | Delete
* @var string $url
[98] Fix | Delete
*/
[99] Fix | Delete
public static $url = '';
[100] Fix | Delete
[101] Fix | Delete
/**
[102] Fix | Delete
* Admin Menus
[103] Fix | Delete
*
[104] Fix | Delete
* @since 3.0
[105] Fix | Delete
* @var array
[106] Fix | Delete
*/
[107] Fix | Delete
public $menus = array();
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* AJAX Controllers
[111] Fix | Delete
*
[112] Fix | Delete
* @since 3.0
[113] Fix | Delete
* @var array
[114] Fix | Delete
*/
[115] Fix | Delete
public $controllers = array();
[116] Fix | Delete
[117] Fix | Delete
/**
[118] Fix | Delete
* Form Fields
[119] Fix | Delete
*
[120] Fix | Delete
* @since 3.0
[121] Fix | Delete
* @var array
[122] Fix | Delete
*/
[123] Fix | Delete
public $fields = array();
[124] Fix | Delete
[125] Fix | Delete
/**
[126] Fix | Delete
* Form Actions
[127] Fix | Delete
*
[128] Fix | Delete
* @since 3.0
[129] Fix | Delete
* @var array
[130] Fix | Delete
*/
[131] Fix | Delete
public $actions = array();
[132] Fix | Delete
[133] Fix | Delete
/**
[134] Fix | Delete
* Merge Tags
[135] Fix | Delete
*
[136] Fix | Delete
* @since 3.0
[137] Fix | Delete
* @var array
[138] Fix | Delete
*/
[139] Fix | Delete
public $merge_tags = array();
[140] Fix | Delete
[141] Fix | Delete
/**
[142] Fix | Delete
* Metaboxes
[143] Fix | Delete
*
[144] Fix | Delete
* @since 3.0
[145] Fix | Delete
* @var array
[146] Fix | Delete
*/
[147] Fix | Delete
public $metaboxes = array();
[148] Fix | Delete
[149] Fix | Delete
/**
[150] Fix | Delete
* Model Factory
[151] Fix | Delete
*
[152] Fix | Delete
* @var object
[153] Fix | Delete
*/
[154] Fix | Delete
public $factory = '';
[155] Fix | Delete
[156] Fix | Delete
/**
[157] Fix | Delete
* Logger
[158] Fix | Delete
*
[159] Fix | Delete
* @var string
[160] Fix | Delete
*/
[161] Fix | Delete
protected $_logger = '';
[162] Fix | Delete
[163] Fix | Delete
/**
[164] Fix | Delete
* Dispatcher
[165] Fix | Delete
*
[166] Fix | Delete
* @var string
[167] Fix | Delete
*/
[168] Fix | Delete
protected $_dispatcher = '';
[169] Fix | Delete
[170] Fix | Delete
/**
[171] Fix | Delete
* @var NF_Session
[172] Fix | Delete
*/
[173] Fix | Delete
protected $session = '';
[174] Fix | Delete
[175] Fix | Delete
/**
[176] Fix | Delete
* @var NF_Tracking
[177] Fix | Delete
*/
[178] Fix | Delete
public $tracking;
[179] Fix | Delete
[180] Fix | Delete
/**
[181] Fix | Delete
* Plugin Settings
[182] Fix | Delete
*
[183] Fix | Delete
* @since 3.0
[184] Fix | Delete
* @var array
[185] Fix | Delete
*/
[186] Fix | Delete
protected $settings = array();
[187] Fix | Delete
[188] Fix | Delete
protected $requests = array();
[189] Fix | Delete
[190] Fix | Delete
protected $processes = array();
[191] Fix | Delete
[192] Fix | Delete
/**
[193] Fix | Delete
* Main Ninja_Forms Instance
[194] Fix | Delete
*
[195] Fix | Delete
* Insures that only one instance of Ninja_Forms exists in memory at any one
[196] Fix | Delete
* time. Also prevents needing to define globals all over the place.
[197] Fix | Delete
*
[198] Fix | Delete
* @since 2.7
[199] Fix | Delete
* @static
[200] Fix | Delete
* @staticvar array $instance
[201] Fix | Delete
* @return Ninja_Forms Highlander Instance
[202] Fix | Delete
*/
[203] Fix | Delete
public static function instance()
[204] Fix | Delete
{
[205] Fix | Delete
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Ninja_Forms ) ) {
[206] Fix | Delete
self::$instance = new Ninja_Forms;
[207] Fix | Delete
[208] Fix | Delete
self::$dir = plugin_dir_path( __FILE__ );
[209] Fix | Delete
[210] Fix | Delete
// Define old constants for backwards compatibility.
[211] Fix | Delete
if( ! defined( 'NF_PLUGIN_DIR' ) ){
[212] Fix | Delete
define( 'NF_PLUGIN_DIR', self::$dir );
[213] Fix | Delete
define( 'NINJA_FORMS_DIR', self::$dir . 'deprecated' );
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
self::$url = plugin_dir_url( __FILE__ );
[217] Fix | Delete
if( ! defined( 'NF_PLUGIN_URL' ) ){
[218] Fix | Delete
define( 'NF_PLUGIN_URL', self::$url );
[219] Fix | Delete
}
[220] Fix | Delete
[221] Fix | Delete
$saved_version = get_option( 'ninja_forms_version' );
[222] Fix | Delete
// If we have a recorded version...
[223] Fix | Delete
// AND that version is less than our current version...
[224] Fix | Delete
if ( $saved_version && version_compare( $saved_version, self::VERSION, '<' ) ) {
[225] Fix | Delete
// *IMPORTANT: Filter to delete old bad data.
[226] Fix | Delete
// Leave this here until at least 3.4.0.
[227] Fix | Delete
if ( version_compare( $saved_version, '3.3.7', '<' ) && version_compare( $saved_version, '3.3.4', '>' ) ) {
[228] Fix | Delete
delete_option( 'nf_sub_expiration' );
[229] Fix | Delete
}
[230] Fix | Delete
// We just upgraded the plugin.
[231] Fix | Delete
$plugin_upgrade = true;
[232] Fix | Delete
} else {
[233] Fix | Delete
$plugin_upgrade = false;
[234] Fix | Delete
}
[235] Fix | Delete
update_option( 'ninja_forms_version', self::VERSION );
[236] Fix | Delete
// If we've not recorded our db version...
[237] Fix | Delete
if ( ! get_option( 'ninja_forms_db_version' ) ) {
[238] Fix | Delete
// If this isn't a fresh install...
[239] Fix | Delete
// AND If we're upgrading from a version before 3.3.0...
[240] Fix | Delete
if ( $saved_version && version_compare( $saved_version, '3.3.0', '<' ) ) {
[241] Fix | Delete
// Set it to the baseline (1.0) so that our upgrade process will run properly.
[242] Fix | Delete
add_option( 'ninja_forms_db_version', '1.0', '', 'no' );
[243] Fix | Delete
} // OR If this isn't a fresh install...
[244] Fix | Delete
elseif ( $saved_version ) {
[245] Fix | Delete
// Set it to the expected (1.1) so that our upgrade process will handle that.
[246] Fix | Delete
add_option( 'ninja_forms_db_version', '1.1', '', 'no' );
[247] Fix | Delete
} // Otherwise... (This is a fresh install.)
[248] Fix | Delete
else {
[249] Fix | Delete
// Set it to the current DB version.
[250] Fix | Delete
add_option( 'ninja_forms_db_version', self::DB_VERSION, '', 'no' );
[251] Fix | Delete
// Establish that our upgrades don't need to take place.
[252] Fix | Delete
$required_updates = Ninja_Forms()->config( 'RequiredUpdates' );
[253] Fix | Delete
$updated = array();
[254] Fix | Delete
// Get a timestamp.
[255] Fix | Delete
date_default_timezone_set( 'UTC' );
[256] Fix | Delete
$now = date( "Y-m-d H:i:s" );
[257] Fix | Delete
foreach( $required_updates as $slug => $update ) {
[258] Fix | Delete
$updated[ $slug ] = $now;
[259] Fix | Delete
}
[260] Fix | Delete
update_option( 'ninja_forms_required_updates', $updated );
[261] Fix | Delete
}
[262] Fix | Delete
}
[263] Fix | Delete
// Set our static db version.
[264] Fix | Delete
self::$db_version = get_option( 'ninja_forms_db_version', self::$db_version );
[265] Fix | Delete
[266] Fix | Delete
/*
[267] Fix | Delete
* Register our autoloader
[268] Fix | Delete
*/
[269] Fix | Delete
spl_autoload_register( array( self::$instance, 'autoloader' ) );
[270] Fix | Delete
[271] Fix | Delete
/*
[272] Fix | Delete
* Admin Menus
[273] Fix | Delete
*/
[274] Fix | Delete
self::$instance->menus[ 'forms' ] = new NF_Admin_Menus_Forms();
[275] Fix | Delete
self::$instance->menus[ 'dashboard' ] = new NF_Admin_Menus_Dashboard();
[276] Fix | Delete
self::$instance->menus[ 'add-new' ] = new NF_Admin_Menus_AddNew();
[277] Fix | Delete
self::$instance->menus[ 'submissions'] = new NF_Admin_Menus_Submissions();
[278] Fix | Delete
self::$instance->menus[ 'import-export'] = new NF_Admin_Menus_ImportExport();
[279] Fix | Delete
self::$instance->menus[ 'settings' ] = new NF_Admin_Menus_Settings();
[280] Fix | Delete
self::$instance->menus[ 'licenses'] = new NF_Admin_Menus_Licenses();
[281] Fix | Delete
self::$instance->menus[ 'system_status'] = new NF_Admin_Menus_SystemStatus();
[282] Fix | Delete
self::$instance->menus[ 'add-ons' ] = new NF_Admin_Menus_Addons();
[283] Fix | Delete
self::$instance->menus[ 'divider'] = new NF_Admin_Menus_Divider();
[284] Fix | Delete
self::$instance->menus[ 'mock-data'] = new NF_Admin_Menus_MockData();
[285] Fix | Delete
[286] Fix | Delete
/*
[287] Fix | Delete
* AJAX Controllers
[288] Fix | Delete
*/
[289] Fix | Delete
self::$instance->controllers[ 'form' ] = new NF_AJAX_Controllers_Form();
[290] Fix | Delete
self::$instance->controllers[ 'fields' ] = new NF_AJAX_Controllers_Fields();
[291] Fix | Delete
self::$instance->controllers[ 'batch_process' ] = new NF_AJAX_REST_BatchProcess();
[292] Fix | Delete
self::$instance->controllers[ 'required_updates' ] = new NF_AJAX_REST_RequiredUpdate();
[293] Fix | Delete
self::$instance->controllers[ 'preview' ] = new NF_AJAX_Controllers_Preview();
[294] Fix | Delete
self::$instance->controllers[ 'submission' ] = new NF_AJAX_Controllers_Submission();
[295] Fix | Delete
self::$instance->controllers[ 'savedfields' ] = new NF_AJAX_Controllers_SavedFields();
[296] Fix | Delete
self::$instance->controllers[ 'deletealldata' ] = new NF_AJAX_Controllers_DeleteAllData();
[297] Fix | Delete
self::$instance->controllers[ 'jserror' ] = new NF_AJAX_Controllers_JSError();
[298] Fix | Delete
self::$instance->controllers[ 'dispatchpoints' ] = new NF_AJAX_Controllers_DispatchPoints();
[299] Fix | Delete
[300] Fix | Delete
/*
[301] Fix | Delete
* REST Controllers
[302] Fix | Delete
*/
[303] Fix | Delete
self::$instance->controllers[ 'REST' ][ 'forms' ] = new NF_AJAX_REST_Forms();
[304] Fix | Delete
self::$instance->controllers[ 'REST' ][ 'new-form-templates' ] = new NF_AJAX_REST_NewFormTemplates();
[305] Fix | Delete
[306] Fix | Delete
/*
[307] Fix | Delete
* Async Requests
[308] Fix | Delete
*/
[309] Fix | Delete
require_once Ninja_Forms::$dir . 'includes/Libraries/BackgroundProcessing/classes/wp-async-request.php';
[310] Fix | Delete
self::$instance->requests[ 'delete-field' ] = new NF_AJAX_Requests_DeleteField();
[311] Fix | Delete
[312] Fix | Delete
/*
[313] Fix | Delete
* Background Processes
[314] Fix | Delete
*/
[315] Fix | Delete
require_once Ninja_Forms::$dir . 'includes/Libraries/BackgroundProcessing/wp-background-processing.php';
[316] Fix | Delete
self::$instance->requests[ 'update-fields' ] = new NF_AJAX_Processes_UpdateFields();
[317] Fix | Delete
[318] Fix | Delete
[319] Fix | Delete
/*
[320] Fix | Delete
* WP-CLI Commands
[321] Fix | Delete
*/
[322] Fix | Delete
if( class_exists( 'WP_CLI_Command' ) ) {
[323] Fix | Delete
WP_CLI::add_command('ninja-forms', 'NF_WPCLI_NinjaFormsCommand');
[324] Fix | Delete
}
[325] Fix | Delete
[326] Fix | Delete
/*
[327] Fix | Delete
* Preview Page
[328] Fix | Delete
*/
[329] Fix | Delete
self::$instance->preview = new NF_Display_Preview();
[330] Fix | Delete
[331] Fix | Delete
/*
[332] Fix | Delete
* Public Form Link
[333] Fix | Delete
*/
[334] Fix | Delete
add_filter('template_include', array(self::$instance, 'maybe_load_public_form'));
[335] Fix | Delete
[336] Fix | Delete
/*
[337] Fix | Delete
* Shortcodes
[338] Fix | Delete
*/
[339] Fix | Delete
self::$instance->shortcodes = new NF_Display_Shortcodes();
[340] Fix | Delete
[341] Fix | Delete
/*
[342] Fix | Delete
* Submission CPT
[343] Fix | Delete
*/
[344] Fix | Delete
new NF_Admin_CPT_Submission();
[345] Fix | Delete
new NF_Admin_CPT_DownloadAllSubmissions();
[346] Fix | Delete
require_once Ninja_Forms::$dir . 'lib/StepProcessing/menu.php';
[347] Fix | Delete
[348] Fix | Delete
/**
[349] Fix | Delete
* Blocks
[350] Fix | Delete
*/
[351] Fix | Delete
[352] Fix | Delete
require_once Ninja_Forms::$dir . 'blocks/ninja-forms-blocks.php';
[353] Fix | Delete
[354] Fix | Delete
/*
[355] Fix | Delete
* Submission Metabox
[356] Fix | Delete
*/
[357] Fix | Delete
new NF_Admin_Metaboxes_Calculations();
[358] Fix | Delete
[359] Fix | Delete
/*
[360] Fix | Delete
* User data requests ( GDPR actions )
[361] Fix | Delete
*/
[362] Fix | Delete
new NF_Admin_UserDataRequests();
[363] Fix | Delete
[364] Fix | Delete
/*
[365] Fix | Delete
* Logger
[366] Fix | Delete
*/
[367] Fix | Delete
self::$instance->_logger = new NF_Database_Logger();
[368] Fix | Delete
[369] Fix | Delete
/*
[370] Fix | Delete
* Dispatcher
[371] Fix | Delete
*/
[372] Fix | Delete
self::$instance->_dispatcher = new NF_Dispatcher();
[373] Fix | Delete
[374] Fix | Delete
/*
[375] Fix | Delete
* Merge Tags
[376] Fix | Delete
*/
[377] Fix | Delete
self::$instance->merge_tags[ 'wp' ] = new NF_MergeTags_WP();
[378] Fix | Delete
self::$instance->merge_tags[ 'fields' ] = new NF_MergeTags_Fields();
[379] Fix | Delete
self::$instance->merge_tags[ 'calcs' ] = new NF_MergeTags_Calcs();
[380] Fix | Delete
self::$instance->merge_tags[ 'form' ] = new NF_MergeTags_Form();
[381] Fix | Delete
self::$instance->merge_tags[ 'other' ] = new NF_MergeTags_Other();
[382] Fix | Delete
self::$instance->merge_tags[ 'deprecated' ] = new NF_MergeTags_Deprecated();
[383] Fix | Delete
[384] Fix | Delete
/*
[385] Fix | Delete
* Add Form Modal
[386] Fix | Delete
*/
[387] Fix | Delete
self::$instance->add_form_modal = new NF_Admin_AddFormModal();
[388] Fix | Delete
[389] Fix | Delete
/*
[390] Fix | Delete
* EOS Parser
[391] Fix | Delete
*/
[392] Fix | Delete
self::$instance->_eos[ 'parser' ] = require_once 'includes/Libraries/EOS/Parser.php';
[393] Fix | Delete
[394] Fix | Delete
/*
[395] Fix | Delete
* Plugin Settings
[396] Fix | Delete
*/
[397] Fix | Delete
self::$instance->settings = apply_filters( 'ninja_forms_settings', get_option( 'ninja_forms_settings' ) );
[398] Fix | Delete
[399] Fix | Delete
/*
[400] Fix | Delete
* Admin Notices System
[401] Fix | Delete
*/
[402] Fix | Delete
self::$instance->notices = new NF_Admin_Notices();
[403] Fix | Delete
[404] Fix | Delete
self::$instance->widgets[] = new NF_Widget();
[405] Fix | Delete
[406] Fix | Delete
/*
[407] Fix | Delete
* Opt-In Tracking
[408] Fix | Delete
*/
[409] Fix | Delete
self::$instance->tracking = new NF_Tracking();
[410] Fix | Delete
[411] Fix | Delete
[412] Fix | Delete
self::$instance->submission_expiration_cron = new NF_Database_SubmissionExpirationCron();
[413] Fix | Delete
[414] Fix | Delete
/*
[415] Fix | Delete
* JS Exception Handler
[416] Fix | Delete
*
[417] Fix | Delete
* TODO: Review PR#2492 for improvements.
[418] Fix | Delete
*/
[419] Fix | Delete
// self::$instance->exception_handler_js = new NF_ExceptionHandlerJS();
[420] Fix | Delete
[421] Fix | Delete
/*
[422] Fix | Delete
* Activation Hook
[423] Fix | Delete
* TODO: Move to a permanent home.
[424] Fix | Delete
*/
[425] Fix | Delete
register_activation_hook( __FILE__, array( self::$instance, 'activation' ) );
[426] Fix | Delete
[427] Fix | Delete
self::$instance->metaboxes[ 'append-form' ] = new NF_Admin_Metaboxes_AppendAForm();
[428] Fix | Delete
[429] Fix | Delete
/*
[430] Fix | Delete
* Email Telemetry
[431] Fix | Delete
*/
[432] Fix | Delete
[433] Fix | Delete
$email_telemetry = new NF_EmailTelemetry( get_option( 'ninja_forms_optin_reported' ) );
[434] Fix | Delete
$email_telemetry->setup();
[435] Fix | Delete
[436] Fix | Delete
/*
[437] Fix | Delete
* Require EDD auto-update file
[438] Fix | Delete
*/
[439] Fix | Delete
if( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
[440] Fix | Delete
// Load our custom updater if it doesn't already exist
[441] Fix | Delete
require_once( self::$dir . 'includes/Integrations/EDD/EDD_SL_Plugin_Updater.php');
[442] Fix | Delete
}
[443] Fix | Delete
require_once self::$dir . 'includes/Integrations/EDD/class-extension-updater.php';
[444] Fix | Delete
[445] Fix | Delete
// If Ninja Forms was just upgraded...
[446] Fix | Delete
if ( $plugin_upgrade ) {
[447] Fix | Delete
// Ensure all of our tables have been defined.
[448] Fix | Delete
$migrations = new NF_Database_Migrations();
[449] Fix | Delete
$migrations->migrate();
[450] Fix | Delete
[451] Fix | Delete
add_action( 'init', array( self::$instance, 'flush_rewrite_rules' ) );
[452] Fix | Delete
// Enable "Dev Mode" for existing installations.
[453] Fix | Delete
$settings = Ninja_Forms()->get_settings();
[454] Fix | Delete
if( ! isset($settings['builder_dev_mode'])){
[455] Fix | Delete
Ninja_Forms()->update_setting('builder_dev_mode', 1);
[456] Fix | Delete
}
[457] Fix | Delete
}
[458] Fix | Delete
}
[459] Fix | Delete
[460] Fix | Delete
add_action( 'admin_notices', array( self::$instance, 'admin_notices' ) );
[461] Fix | Delete
[462] Fix | Delete
add_action( 'plugins_loaded', array( self::$instance, 'plugins_loaded' ) );
[463] Fix | Delete
[464] Fix | Delete
add_action( 'ninja_forms_available_actions', array( self::$instance, 'scrub_available_actions' ) );
[465] Fix | Delete
[466] Fix | Delete
add_action( 'init', array( self::$instance, 'init' ), 5 );
[467] Fix | Delete
add_action( 'admin_init', array( self::$instance, 'admin_init' ), 5 );
[468] Fix | Delete
[469] Fix | Delete
add_action( 'nf_weekly_promotion_update', array( self::$instance, 'nf_run_promotion_manager' ) );
[470] Fix | Delete
add_action( 'activated_plugin', array( self::$instance, 'nf_bust_promotion_cache_on_plugin_activation' ), 10, 2 );
[471] Fix | Delete
[472] Fix | Delete
// Checks php version and..
[473] Fix | Delete
if (version_compare(PHP_VERSION, '7.2.0', '<')) {
[474] Fix | Delete
// Pulls in the whip notice if the user is.
[475] Fix | Delete
add_action( 'admin_init', array( self::$instance, 'nf_php_version_whip_notice' ) );
[476] Fix | Delete
}
[477] Fix | Delete
[478] Fix | Delete
add_action( 'admin_init', array( self::$instance, 'nf_do_telemetry' ) );
[479] Fix | Delete
add_action( 'admin_init', array( self::$instance, 'nf_plugin_add_suggested_privacy_content' ), 20 );
[480] Fix | Delete
[481] Fix | Delete
return self::$instance;
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
public function init()
[485] Fix | Delete
{
[486] Fix | Delete
do_action( 'nf_init', self::$instance );
[487] Fix | Delete
$this->register_rewrite_rules();
[488] Fix | Delete
}
[489] Fix | Delete
[490] Fix | Delete
public function flush_rewrite_rules()
[491] Fix | Delete
{
[492] Fix | Delete
$this->register_rewrite_rules();
[493] Fix | Delete
flush_rewrite_rules();
[494] Fix | Delete
}
[495] Fix | Delete
[496] Fix | Delete
public function register_rewrite_rules()
[497] Fix | Delete
{
[498] Fix | Delete
add_rewrite_tag('%nf_public_link%', '([a-zA-Z0-9]+)');
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function