monsterinsights_addons_content

Callback for displaying the UI for Addons.

Description

monsterinsights_addons_content(); 

Usage

  1. if ( !function_exists( 'monsterinsights_addons_content' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/pages/addons.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = monsterinsights_addons_content(); 
  7.  

Defined (1)

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

/includes/admin/pages/addons.php  
  1. function monsterinsights_addons_content() { 
  2.  
  3. // Iferrors) occured during license key verification, display them and exit now. 
  4. ?> 
  5. <div class="error below-h2"> 
  6. <p> 
  7. <?php esc_html_e( 'In order to get access to Addons, you need to resolve your license key errors.', 'google-analytics-for-wordpress' ); ?> 
  8. </p> 
  9. </div> 
  10. <?php 
  11. return; 
  12.  
  13. // Get Addons 
  14.  
  15. // If no Addon(s) were returned, our API call returned an error. 
  16. // Show anerrormessage with a button to reload the page, which will trigger another API call. 
  17. if ( ! $addons ) { 
  18. ?> 
  19. <form id="monsterinsights-addons-refresh-addons-form" method="post"> 
  20. <p> 
  21. <?php esc_html_e( 'There was an issue retrieving the addons for this site. Please click on the button below the refresh the addons data.', 'google-analytics-for-wordpress' ); ?> 
  22. </p> 
  23. <p> 
  24. <a href="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" class="button button-primary"><?php esc_html_e( 'Refresh Addons', 'google-analytics-for-wordpress' ); ?></a> 
  25. </p> 
  26. </form> 
  27. <?php 
  28. return; 
  29.  
  30. // If here, we have Addons to display, so let's output them now. 
  31. // Get installed plugins and upgrade URL 
  32. $installed_plugins = get_plugins(); 
  33. ?> 
  34. <div id="monsterinsights-addons"> 
  35. <?php 
  36. // Output Addons the User is licensed to use. 
  37. if ( count( $addons['licensed'] )> 0 ) { 
  38. ?> 
  39. <div class="monsterinsights-addons-area licensed" class="monsterinsights-clear"> 
  40. <h3><?php esc_html_e( 'Available Addons:', 'google-analytics-for-wordpress' ); ?></h3> 
  41.  
  42. <div id="monsterinsights-addons-licensed" class="monsterinsights-addons"> 
  43. <!-- list container class required for list.js --> 
  44. <div class="list"> 
  45. <?php 
  46. foreach ( (array) $addons['licensed'] as $i => $addon ) { 
  47. monsterinsights_get_addon_card( $addon, $i, true, $installed_plugins ); 
  48. ?> 
  49. </div> 
  50. </div> 
  51. </div> 
  52. <?php 
  53. } // Close licensed addons 
  54.  
  55. // Output Addons the User isn't licensed to use. 
  56. if ( count( $addons['unlicensed'] ) > 0 ) { 
  57. ?> 
  58. <div class="monsterinsights-addons-area unlicensed" class="monsterinsights-clear"> 
  59. <h3><?php esc_html_e( 'Unlock More Addons', 'google-analytics-for-wordpress' ); ?></h3> 
  60. <p><?php echo sprintf( esc_html__( '%1$sWant even more addons?%2$sUpgrade your MonsterInsights account%3$s and unlock the following addons:', 'google-analytics-for-wordpress' ), '<strong>', '</strong> <a href="' . $upgrade_url. '">', '</a>' ); ?></p> 
  61.  
  62. <div id="monsterinsights-addons-unlicensed" class="monsterinsights-addons"> 
  63. <!-- list container class required for list.js --> 
  64. <div class="list"> 
  65. <?php 
  66. foreach ( (array) $addons['unlicensed'] as $i => $addon ) { 
  67. monsterinsights_get_addon_card( $addon, $i, false, $installed_plugins ); 
  68. ?> 
  69. </div> 
  70. </div> 
  71. </div> 
  72. <?php 
  73. } // Close unlicensed addons 
  74. ?> 
  75. </div> 
  76. <?php 
  77.