PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/broken-link-checker/includes/admin/sidebar.php

https://bitbucket.org/lgorence/quickpress
PHP | 143 lines | 129 code | 12 blank | 2 comment | 11 complexity | 229dee99acbc604cf4c43b3c0b66fe37 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
  1. <?php
  2. $configuration = blc_get_configuration();
  3. if ( !function_exists('fetch_feed') ){
  4. include_once(ABSPATH . WPINC . '/feed.php');
  5. }
  6. $show_plugin_feed = $show_ame_ad = false;
  7. if ( !$configuration->get('user_has_donated', false) ) {
  8. if ( (blcUtility::constrained_hash(get_site_url() . 'y', 0, 100) < 40) && function_exists('fetch_feed') ) {
  9. $show_plugin_feed = true;
  10. } else {
  11. $show_ame_ad = true;
  12. }
  13. }
  14. ?>
  15. <!-- "More plugins" RSS feed -->
  16. <?php
  17. if ( $show_plugin_feed ):
  18. $feed_url = 'http://w-shadow.com/files/blc-plugin-links.rss';
  19. $num_items = 3;
  20. $feed = fetch_feed($feed_url);
  21. if ( !is_wp_error($feed) ):
  22. ?>
  23. <div id="advertising" class="postbox">
  24. <h3 class="hndle"><?php _e('More plugins by Janis Elsts', 'broken-link-checker'); ?></h3>
  25. <div class="inside">
  26. <ul>
  27. <?php
  28. foreach($feed->get_items(0, $num_items) as $item) { /** @var SimplePie_Item $item */
  29. printf(
  30. '<li><a href="%1$s" title="%2$s">%3$s</a></li>',
  31. esc_url( $item->get_link() ),
  32. esc_attr( strip_tags( $item->get_title() ) ),
  33. esc_html( $item->get_title() )
  34. );
  35. }
  36. ?>
  37. </ul>
  38. </div>
  39. </div>
  40. <?php
  41. endif;
  42. endif;
  43. ?>
  44. <!-- Admin Menu Editor Pro ad -->
  45. <?php
  46. if ( $show_ame_ad ):
  47. //Display an ad for Admin Menu Editor.
  48. //We're A/B testing a bunch of different ad copies.
  49. $ame_copy_variants = array(
  50. array('a', "Add, delete, hide, or move any admin menu item."),
  51. array('b', "Organize your admin menu the way you want it."),
  52. array('c', "Hide, move or customize admin menus. Perfect for client sites."),
  53. );
  54. $ad_copy_index = intval(blcUtility::constrained_hash(get_site_url(), 0, count($ame_copy_variants)));
  55. $ad_copy = $ame_copy_variants[$ad_copy_index];
  56. $ad_url = sprintf(
  57. 'http://w-shadow.com/admin-menu-editor-pro/?utm_source=broken_link_checker&utm_medium=text_link&utm_campaign=Plugins&utm_content=%s',
  58. urlencode('ad_copy_') . $ad_copy[0]
  59. );
  60. ?>
  61. <div class="postbox" id="advertising">
  62. <h3 class="hndle"><?php _e('More plugins by Janis Elsts', 'broken-link-checker'); ?></h3>
  63. <div class="inside">
  64. <p class="ws-ame-ad-copy"><?php echo $ad_copy[1]; ?></p>
  65. <p class="ws-ame-ad-link">
  66. <a href="<?php echo esc_attr($ad_url); ?>" title="Admin Menu Editor">
  67. Admin Menu Editor
  68. </a>
  69. </p>
  70. </div>
  71. </div>
  72. <?php
  73. endif;
  74. ?>
  75. <!-- Donation button -->
  76. <div id="donate" class="postbox">
  77. <h3 class="hndle"><?php _e('Donate $10, $20 or $50!', 'broken-link-checker'); ?></h3>
  78. <div class="inside">
  79. <p><?php
  80. _e('If you like this plugin, please donate to support development and maintenance!', 'broken-link-checker');
  81. ?></p>
  82. <form style="text-align: center;" action="https://www.paypal.com/cgi-bin/webscr" method="post">
  83. <input type="hidden" name="cmd" value="_donations">
  84. <input type="hidden" name="business" value="G3GGNXHBSHKYC">
  85. <input type="hidden" name="lc" value="US">
  86. <input type="hidden" name="item_name" value="Broken Link Checker">
  87. <input type="hidden" name="no_note" value="1">
  88. <input type="hidden" name="no_shipping" value="1">
  89. <input type="hidden" name="currency_code" value="USD">
  90. <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
  91. <input type="hidden" name="rm" value="2">
  92. <input type="hidden" name="return" value="<?php
  93. echo esc_attr(admin_url('options-general.php?page=link-checker-settings&donated=1'));
  94. ?>" />
  95. <input type="hidden" name="cbt" value="<?php
  96. echo esc_attr(__('Return to WordPress Dashboard', 'broken-link-checker'));
  97. ?>" />
  98. <input type="hidden" name="cancel_return" value="<?php
  99. echo esc_attr(admin_url('options-general.php?page=link-checker-settings&donation_canceled=1'));
  100. ?>" />
  101. <input type="image" src="https://www.sandbox.paypal.com/en_US/GB/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online." style="max-width:170px;height:47px;border:0;">
  102. </form>
  103. </div>
  104. </div>
  105. <!-- Other advertising -->
  106. <?php
  107. if ( !$configuration->get('user_has_donated') ):
  108. $ad_switch_time = strtotime('2012-06-05 12:00');
  109. if ( time() < $ad_switch_time ):
  110. ?>
  111. <div id="themefuse-ad" class="postbox">
  112. <!--<h3 class="hndle">ThemeFuse</h3> -->
  113. <div class="inside">
  114. <a href="http://themefuse.com/wp-themes-shop/?plugin=broken-link-checker" title="ThemeFuse themes">
  115. <img src="<?php echo plugins_url('images/themefuse-250x250.jpg', BLC_PLUGIN_FILE) ?>" width="250" height="250" alt="ThemeFuse">
  116. </a>
  117. </div>
  118. </div>
  119. <?php
  120. else:
  121. ?>
  122. <div id="managewp-ad" class="postbox">
  123. <div class="inside">
  124. <a href="http://managewp.com/?utm_source=broken_link_checker&utm_medium=Banner&utm_content=mwp250_2&utm_campaign=Plugins" title="ManageWP">
  125. <img src="<?php echo plugins_url('images/mwp250_2.png', BLC_PLUGIN_FILE) ?>" width="250" height="250" alt="ManageWP">
  126. </a>
  127. </div>
  128. </div>
  129. <?php
  130. endif;
  131. endif; ?>