function mm_ux_log_buy_now_clicks_preview() { if (isset($_GET['page']) && $_GET['page'] == "mojo-theme-preview") { global $theme; ?> <script type="text/javascript"> jQuery( 'form .mm-btn-primary' ).click( function() { var item = "item_preview_<?php echo mm_title_to_slug($theme->name); ?> "; var endpoint = "<?php echo MM_BASE_URL . 'e.php'; ?> "; var value = "<?php echo $theme->prices->single_domain_license; ?> "; var nonce = "<?php echo wp_create_nonce('mm_nonce-buy_now_click'); ?> "; jQuery.ajax( endpoint + "?action=buy_now_click&item=" + item + "&value=" + value + "&nonce=" + nonce ); } ); </script> <?php } }
function mm_plugin_search_offer() { if (isset($_GET['s']) && ($plugin = mm_check_plugin_search_value($_GET['s']))) { $mm_test = get_transient('mm_test', array('name' => 'none')); $link = mm_build_link($plugin['url'], array('utm_medium' => 'plugin_admin', 'utm_content' => 'plugin_search')); switch ($mm_test['name']) { case 'plugin-search-banner': $plugin_html = ' <div style="display: inline-block;background-color: #D54E21;margin-left: -20px;padding-right: 20px;width: 100%;"> <p style="font-size: 1.2rem;color: #fff;padding-left: 20px;"> Did you know MOJO Marketplace has <a style="color:#fff;" href="' . $link . '">Pro Services</a> for ' . $plugin['name'] . '? <a style="color: #fff; font-size: .8rem; margin: 15px;" href="' . $link . '">Click here for more</a> </p> </div>'; $plugin_html = mm_minify($plugin_html); echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tjQuery( document ).ready( function( jQuery ) {\n\t\t\t\t\t\tjQuery( '#wpbody' ).before( '" . $plugin_html . "' );\n\t\t\t\t\t} );\n\t\t\t\t</script>"; break; case 'plugin-search-result': //this should be fast as a transient $api_args = array('mojo-platform' => 'wordpress', 'mojo-type' => '', 'mojo-items' => 'popular-services'); $result = mm_api($api_args, array('count' => '30')); if (!is_wp_error($result)) { //this makes me wanna cry $descriptions = array('530782e3-1388-4e6a-a8ac-6f7b0a140b28' => 'WooCommerce will transform your WordPress site into a full eCommerce store that is simple to use. WooCommerce comes ready for all the features you need to operate such as a shipping calculator, easy checkout, rating system, reporting, tax options, and much more. There is a reason WooCommerce is the leading eCommerce WordPress plugin today!', '530697a6-92cc-4329-9cdd-21e40a140b28' => 'Google Analytics is a powerful tool that is free to use when you have a Google account. For many people, integrating Google Analytics can be a challenge and that is why we are offering help from our professional service team. You can follow users on your site in real time and get in depth analysis as to their behaviors when browsing your website.', '530788ba-c450-45eb-b154-47ce0a141528' => 'Google loves to see a list of every page on your site and how those pages relate to each other. Not only does it help Google find each page it also shows them understand what is and is not important and that‘s how they determine which pages show up in the Google search results. As an added bonus, it helps your users find what they‘re looking for within your site. ', '53d7ea4d-e52c-42fe-9b7e-5ed50a141528' => 'As a platform, WordPress offers some sound SEO components to rank high in the search engines like Google. With the WordPress SEO plugin by Yoast, you‘re guided within each post and page your publish inside your WordPress site. The plugin ensures your content is fully optimized for the search engines.', '53078511-1974-470c-8ed5-43500a141528' => 'BuddyPress is a WordPress plugin that takes your WordPress site and adds a full-blown social network. By using BuddyPress, you instantly get access to user profiles, activity streams, user groups and much more functionality. You can use your existing WordPress site and add BuddyPress on top of it for your personal social network.', '530783b3-d4d8-4823-ad1e-70310a140b28' => 'bbPress is a WordPress plugin that makes it easy to add a forum to your website. From within your WordPress admin, you can easily setup and moderate forums, topics and replies. All bbPress features integrate nicely with your current users and pages.', '53078468-fc10-45de-b813-70b70a140b28' => 'Adding a WordPress contact form to your website will make it easy for you to have your users contact you directly without you having to give away your email address. Contact forms also make it easy for you to view your contacts and leads directly from the your WordPress dashboard.', '530786ea-27b8-4f1b-bc94-46650a141528' => 'Does your business have a physical location? Then you probably want your customers to locate you, and Google Maps can make that happen. Let us add Google Maps to your WordPress website for you. We can add up to 10 different locations with include custom navigation. After we install Google Maps you‘ll be able to make sure that everyone knows just how to find your business.', '53b4501f-180c-4bd3-9b3f-56cb0a141528' => 'On average 30,000 websites are hacked every day! Unfortunately, WordPress can be an easy target. Let us help you drastically increase your site‘s security. ', '53d7e760-5140-4761-ac5b-5bd00a141528' => 'This service adds Facebook social plugins to your WordPress site. With this service, you can attach your WordPress site to a Facebook account and easily share new posts to your Facebook timeline.', '53e00b04-03b8-4025-bb75-173c0a141528' => 'Backing up your website is one of the single most important things you can do. With this backup service we will set things up so you can continually backup your WordPress website. So if your site gets hacked or you make an accidental change you’ll be able to backup your site to when it was in tip top shape.', '53ee5b7a-aef4-44f3-a4dd-48b90a140b28' => '<strong>Improve Usability and site traffic with a Faster Website. </strong>Is your WordPress website taking a long time to load? Did you know that Google and other search engines will actually send you more traffic if it loads quickly? Did you also know that having a faster site means visitors will stay on your site longer so you can be even more successful? It‘s True! Let our pros go through your site and speed it up.', '53ee5ec2-eff0-441a-944d-52050a140b28' => '<strong>Have a great theme, but don’t like the colors?</strong> Simply tell us which colors you’d like to replace and we’ll swap out up to 3 colors throughout your entire site. This is a great way to ensure that your theme properly reflects your unique style and brand.', '53ee5dce-e2ec-4697-a09a-52050a140b28' => '<strong>Wish someone else would write your content for you?</strong> We will! In fact we have an amazing team of college grads and English majors who just love writing content (Weird, right?). You’ve probably been meaning to write out the content yourself for a while now, but you never seem to have the time to finish it. Answer a few simple questions and our team will write 100 words of amazing content and add it to any page of your site.'); $items = json_decode($result['body']); foreach ($items as $item) { if ($item->id == $plugin['id']) { $service = $item; } } if (isset($service) && isset($descriptions[$plugin['id']])) { $plugin_html = ' <div class="plugin-card" style="border-color: #0074a2;"> <div class="plugin-card-top" style="border-bottom: 1px solid #0074a2;"> <a target="_blank" href="' . $link . '"><img class="plugin-icon" src="' . $service->images->square_thumbnail_url . '"></a> <div class="name column-name"> <h4><a href="' . $link . '">' . $service->name . '</a></h4> <div class="action-links"> <ul class="plugin-action-buttons"> <li> <a aria-label="' . esc_attr($service->name) . '" href="' . $link . '" class="button">More Details</a> </li> <li> <form method="POST" target="_blank" action="' . mm_build_link("https://www.mojomarketplace.com/cart", array('utm_medium' => 'plugin_admin', 'utm_content' => 'item_' . $api_args['mojo-items'] . '_plugin_search')) . '" class="item_plugin_search_' . mm_title_to_slug($item->name) . '"> <input type="hidden" name="data[CartItem][item_id]" value="' . esc_attr($service->id) . '"/> <input class="button" type="submit" value="Purchase"/> </form> </li> </ul> </div> </div> <div class="desc column-description"> <p>' . $descriptions[$plugin['id']] . '</p> <p class="authors"> <cite>By <a href="' . mm_build_link('https://mojomarketplace.com/', array('utm_medium' => 'plugin_admin', 'utm_content' => 'author_plugin_search')) . '">MOJO Marketplace</a></cite></p> </div> </div> <div class="plugin-card-bottom"> <div class="column-downloaded"> ' . $service->sales_count . ' downloads </div> </div> </div>'; $plugin_html = mm_minify($plugin_html); echo "\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tjQuery( document ).ready( function( \$ ) {\n\t\t\t\t\t\t\t\t\$( '#the-list' ).prepend( '" . $plugin_html . "' );\n\t\t\t\t\t\t\t\t\$( '.plugin-card:last-of-type' ).hide();\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t</script>"; } } break; default: add_action('admin_notices', 'mm_plugin_search_notice'); break; } } }
" src="<?php echo esc_url($item->images->preview_url); ?> "> </a> </div> <h3 class="service-name"><?php esc_html_e($item->name); ?> </h3> <div class="mojo-service-actions"> <form class="buy_now" method="POST" target="_blank" action="<?php echo mm_build_link("https://www.mojomarketplace.com/cart", array('utm_medium' => 'plugin_admin', 'utm_content' => 'item_' . $api_args['mojo-items'] . '_buy_now_button')); ?> " class="buy_now <?php echo 'item_' . $api_args['mojo-items'] . '_buy_now_' . mm_title_to_slug($item->name); ?> "> <input type="hidden" name="data[CartItem][item_id]" value="<?php esc_attr_e($item->id); ?> "/> <input class="mm-btn-primary" type="submit" value="Buy Now"/> </form> <a target="_blank" href="<?php echo mm_build_link($item->page_url, array('utm_medium' => 'plugin_admin', 'utm_content' => 'item_' . $api_args['mojo-items'] . '_details_button')); ?> " class="button button-secondary">Details</a> <div class="price">$<?php esc_html_e($item->prices->single_domain_license);
?> "><?php echo esc_html($item->seller_name); ?> </a></div> <h3 class="theme-name"><?php echo esc_html($item->name); ?> </h3> <div class="mojo-theme-actions"> <form class="buy_now" method="POST" target="_blank" action="<?php echo mm_build_link('https://www.mojomarketplace.com/cart', array('utm_medium' => 'plugin_admin', 'utm_content' => 'item_' . esc_attr($api_args['mojo-items']) . '_buy_now_button')); ?> " class="buy_now <?php echo 'item_' . esc_attr($api_args['mojo-items']) . '_buy_now_' . mm_title_to_slug($item->name); ?> "> <input type="hidden" name="data[CartItem][item_id]" value="<?php echo esc_attr($item->id); ?> "/> <input class="mm-btn-primary" type="submit" value="Buy Now"/> </form> <a href="admin.php?page=mojo-theme-preview&id=<?php echo esc_attr($item->id); ?> &items=<?php echo esc_attr($api_args['mojo-items']); ?>