NF_Admin_Menus_Addons

The Ninja Forms NF Admin Menus Addons class.

Defined (1)

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

/includes/Admin/Menus/Addons.php  
  1. final class NF_Admin_Menus_Addons extends NF_Abstracts_Submenu 
  2. public $parent_slug = 'ninja-forms'; 
  3.  
  4. public $menu_slug = 'ninja-forms#apps'; 
  5.  
  6. public $priority = 13; 
  7.  
  8. public function __construct() 
  9. parent::__construct(); 
  10.  
  11. public function get_page_title() 
  12. return __( 'Add-Ons', 'ninja-forms' ); 
  13.  
  14. public function get_capability() 
  15. return apply_filters( 'ninja_forms_admin_extend_capabilities', $this->capability ); 
  16.  
  17. public function display() 
  18. //wp_enqueue_style( 'nf-admin-addons', Ninja_Forms::$url . 'assets/css/admin-addons.css' ); 
  19. // $items = wp_remote_get( 'https://ninjaforms.com/?extend_feed=jlhrbgf89734go7387o4g3h' ); 
  20. // $items = wp_remote_retrieve_body( $items ); 
  21. $items = file_get_contents( Ninja_Forms::$dir . '/deprecated/addons-feed.json' ); 
  22. $items = json_decode( $items, true ); 
  23. //shuffle( $items ); 
  24.  
  25. $notices = array(); 
  26.  
  27. foreach ($items as $item) { 
  28. $plugin_data = array(); 
  29. if( !empty( $item['plugin'] ) && file_exists( WP_PLUGIN_DIR.'/'.$item['plugin'] ) ) { 
  30. $plugin_data = get_plugin_data( WP_PLUGIN_DIR.'/'.$item['plugin'], false, true ); 
  31.  
  32. $version = isset ( $plugin_data['Version'] ) ? $plugin_data['Version'] : ''; 
  33.  
  34. if ( ! empty ( $version ) && $version < $item['version'] ) { 
  35.  
  36. $notices[] = array( 
  37. 'title' => $item[ 'title' ],  
  38. 'old_version' => $version,  
  39. 'new_version' => $item[ 'version' ] 
  40. ); 
  41.  
  42. Ninja_Forms::template( 'admin-menu-addons.html.php', compact( 'items', 'notices' ) ); 
  43.  
  44. } // End Class NF_Admin_Addons