| 1 |
<?php // User Submitted Posts - Show Support Panel |
| 2 |
|
| 3 |
if (!function_exists('add_action')) die(); |
| 4 |
|
| 5 |
function user_submitted_posts_wp_resources() { |
| 6 |
|
| 7 |
$plugin_project = esc_html__('User Submitted Posts', 'usp'); |
| 8 |
|
| 9 |
$plugin_url = USP_URL; |
| 10 |
|
| 11 |
$array = array( |
| 12 |
|
| 13 |
0 => '<a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/bbq-pro/" title="BBQ Pro: Fastest Firewall for WordPress"> |
| 14 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-bbq-pro.jpg" alt=""> |
| 15 |
</a>', |
| 16 |
|
| 17 |
1 => '<a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/banhammer-pro/" title="Banhammer Pro: Monitor Traffic. Hammer the Enemy."> |
| 18 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-banhammer-pro.jpg" alt=""> |
| 19 |
</a>', |
| 20 |
|
| 21 |
2 => '<a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/blackhole-pro/" title="Blackhole Pro: Trap Bad Bots in a Virtual Black Hole"> |
| 22 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-blackhole-pro.jpg" alt=""> |
| 23 |
</a>', |
| 24 |
|
| 25 |
3 => '<a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/ga-google-analytics-pro/" title="GA Pro: Connect Google Analytics to WordPress"> |
| 26 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-ga-pro.jpg" alt=""> |
| 27 |
</a>', |
| 28 |
|
| 29 |
4 => '<a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/head-meta-pro/" title="Head Meta Pro: Ultimate Meta Tags for WordPress"> |
| 30 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-head-meta-pro.jpg" alt=""> |
| 31 |
</a>', |
| 32 |
|
| 33 |
5 => '<a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/simple-ajax-chat-pro/" title="SAC Pro: Own Your Chats"> |
| 34 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-sac-pro.jpg" alt=""> |
| 35 |
</a>', |
| 36 |
|
| 37 |
6 => '<a target="_blank" rel="noopener noreferrer" href="https://plugin-planet.com/usp-pro/" title="USP Pro: Unlimited Front-End Forms"> |
| 38 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-usp-pro.jpg" alt=""> |
| 39 |
</a>', |
| 40 |
|
| 41 |
// |
| 42 |
|
| 43 |
7 => '<a target="_blank" rel="noopener noreferrer" href="https://digwp.com/" title="Take your WordPress Skills to the Next Level"> |
| 44 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-digging-into-wordpress.jpg" alt=""> |
| 45 |
</a>', |
| 46 |
|
| 47 |
8 => '<a target="_blank" rel="noopener noreferrer" href="https://wp-tao.com/" title="Learn the Way of WordPress"> |
| 48 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-tao-of-wordpress.jpg" alt=""> |
| 49 |
</a>', |
| 50 |
|
| 51 |
9 => '<a target="_blank" rel="noopener noreferrer" href="https://wp-tao.com/wordpress-themes-book/" title="WordPress Themes In Depth"> |
| 52 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-wp-themes-in-depth.jpg" alt=""> |
| 53 |
</a>', |
| 54 |
|
| 55 |
10 => '<a target="_blank" rel="noopener noreferrer" href="https://htaccessbook.com/" title="Optimize and Secure with .htaccess"> |
| 56 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-htaccess-made-easy.jpg" alt=""> |
| 57 |
</a>', |
| 58 |
|
| 59 |
11 => '<a target="_blank" rel="noopener noreferrer" href="https://books.perishablepress.com/downloads/wizards-collection-sql-recipes-wordpress/" title="Wizard’s SQL Recipes for WordPress"> |
| 60 |
<img width="125" height="125" src="'. $plugin_url .'images/250x250-wizards-sql.jpg" alt=""> |
| 61 |
</a>', |
| 62 |
|
| 63 |
); |
| 64 |
|
| 65 |
$items = array_rand($array, 3); |
| 66 |
|
| 67 |
$item1 = isset($array[$items[0]]) ? $array[$items[0]] : 0; |
| 68 |
$item2 = isset($array[$items[1]]) ? $array[$items[1]] : 1; |
| 69 |
$item3 = isset($array[$items[2]]) ? $array[$items[2]] : 2; |
| 70 |
|
| 71 |
$url1 = esc_url('https://books.perishablepress.com/'); |
| 72 |
$url2 = esc_url('https://plugin-planet.com/store/'); |
| 73 |
$url3 = esc_url('https://monzillamedia.com/donate.html'); |
| 74 |
|
| 75 |
$title1 = esc_html__('Perishable Press Books', 'usp'); |
| 76 |
$title2 = esc_html__('Plugin Planet: Pro WordPress Plugins', 'usp'); |
| 77 |
$title3 = esc_html__('Donate via PayPal, credit card, or cryptocurrency', 'usp'); |
| 78 |
|
| 79 |
$link1 = ' <a target="_blank" rel="noopener noreferrer" href="'. $url1 .'" title="'. $title1 .'">'. esc_html__('books', 'usp') .'</a> '; |
| 80 |
$link2 = ' <a target="_blank" rel="noopener noreferrer" href="'. $url2 .'" title="'. $title2 .'">'. esc_html__('plugins', 'usp') .'</a>, '; |
| 81 |
$link3 = ' <a target="_blank" rel="noopener noreferrer" href="'. $url3 .'" title="'. $title3 .'">'. esc_html__('donation', 'usp') .'</a>. '; |
| 82 |
|
| 83 |
$message = esc_html__('Thank you for using', 'usp') .' '. $plugin_project .'! '; |
| 84 |
$message .= esc_html__('Please show support by purchasing one of my', 'usp') . $link1; |
| 85 |
$message .= esc_html__('or', 'usp') . $link2 . esc_html__('or by making a', 'usp') . $link3; |
| 86 |
$message .= esc_html__('Your generous support helps future development of', 'usp') .' '. $plugin_project .' '; |
| 87 |
$message .= esc_html__('and is greatly appreciated.', 'usp'); |
| 88 |
|
| 89 |
$donate = esc_html__('Any size donation helps me to continue developing this free plugin and other awesome WordPress resources.', 'usp'); |
| 90 |
|
| 91 |
?> |
| 92 |
|
| 93 |
<style type="text/css"> |
| 94 |
#project-wrap { width: 100%; overflow: hidden; } |
| 95 |
#project-wrap p { font-size: 12px; } |
| 96 |
#project-wrap .project-support { float: left; max-width: 480px; } |
| 97 |
#project-wrap .project-message p { margin: 5px 15px 15px 15px; } |
| 98 |
|
| 99 |
#project-wrap .project-links { width: 100%; overflow: hidden; margin: 15px 0; } |
| 100 |
#project-wrap .project-links img { display: block; width: 125px; height: 125px; margin: 0; padding: 0; border: 0; background-color: #fff; color: #fff; } |
| 101 |
#project-wrap .project-links a { float: left; width: 125px; height: 125px; margin: 0 0 0 15px; padding: 1px; border: 1px solid #ccc; opacity: 0.9; } |
| 102 |
#project-wrap .project-links a:link, #project-wrap .project-links a:visited, #project-wrap .project-links a:hover, #project-wrap .project-links a:after { box-shadow: none; } |
| 103 |
#project-wrap .project-links a:hover { opacity: 1.0; } |
| 104 |
|
| 105 |
#project-wrap .project-blurb { |
| 106 |
float: left; width: 220px; box-sizing: border-box; margin: 5px 0 25px 20px; padding: 15px 20px; border-radius: 5px; |
| 107 |
background-color: #fefefe; border: 1px solid #ccc; box-shadow: 0 20px 25px -20px rgba(0,0,0,0.5); |
| 108 |
} |
| 109 |
#project-wrap .project-blurb p { margin: 0 0 10px 0; } |
| 110 |
#project-wrap .project-blurb p:first-child { font-size: 13px; } |
| 111 |
#project-wrap .project-blurb p:last-child { margin: 0 0 5px 0; } |
| 112 |
|
| 113 |
@media (max-width: 880px) { |
| 114 |
#project-wrap .project-support { max-width: 100%; } |
| 115 |
#project-wrap .project-message p { font-size: 13px; } |
| 116 |
#project-wrap .project-blurb { display: none; } |
| 117 |
} |
| 118 |
@media (max-width: 550px) { |
| 119 |
#mm-panel-current { display: none; } |
| 120 |
} |
| 121 |
</style> |
| 122 |
<div id="project-wrap"> |
| 123 |
<div class="project-support"> |
| 124 |
<div class="project-message"> |
| 125 |
<p><?php echo $message; ?></p> |
| 126 |
</div> |
| 127 |
<div class="project-links"> |
| 128 |
<?php echo $item1 . $item2 . $item3; ?> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
<div class="project-blurb"> |
| 132 |
<p><strong><?php esc_html_e('Please Donate', 'usp'); ?></strong></p> |
| 133 |
<p><?php echo $donate; ?></p> |
| 134 |
<p><a target="_blank" rel="noopener noreferrer" href="<?php echo $url3; ?>" title="<?php echo $title3; ?>"><?php esc_html_e('Make a donation »', 'usp'); ?></a></p> |
| 135 |
</div> |
| 136 |
</div> |
| 137 |
|
| 138 |
<?php |
| 139 |
|
| 140 |
} |