ninja_forms_three_addons_version_check

The Ninja Forms ninja forms three addons version check function.

Description

ninja_forms_three_addons_version_check(); 

Usage

  1. if ( !function_exists( 'ninja_forms_three_addons_version_check' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/ninja-forms.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ninja_forms_three_addons_version_check(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/deprecated/ninja-forms.php  
  1. function ninja_forms_three_addons_version_check() { 
  2. // $items = wp_remote_get( 'https://ninjaforms.com/?extend_feed=jlhrbgf89734go7387o4g3h' ); 
  3. // $items = wp_remote_retrieve_body( $items ); 
  4. $items = file_get_contents( dirname( __FILE__ ) . '/addons-feed.json' ); 
  5. $items = json_decode( $items, true ); 
  6.  
  7. if( is_array( $items ) ) { 
  8. foreach ($items as $item) { 
  9.  
  10. if (empty($item['plugin'])) continue; 
  11. if (!file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) continue; 
  12.  
  13. $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $item['plugin'], false, true); 
  14.  
  15. if (!$plugin_data['Version']) continue; 
  16. if (version_compare($plugin_data['Version'], '3', '>=')) continue; 
  17.  
  18. /** 
  19. * There are non-compatible add-ons installed. 
  20. */ 
  21.  
  22. return FALSE; 
  23.  
  24. return TRUE;