| 1 |
<?php |
| 2 |
namespace EmailKit\Promotional; |
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
use \Wpmet\UtilityPackage\Stories\Stories; |
| 5 |
use \Wpmet\UtilityPackage\Notice\Notice; |
| 6 |
use \Wpmet\UtilityPackage\Banner\Banner; |
| 7 |
use \Wpmet\UtilityPackage\Rating\Rating; |
| 8 |
use \Wpmet\UtilityPackage\Plugins\Plugins; |
| 9 |
|
| 10 |
use \EmailKit\Promotional\ProAwareness\ProAwareness; |
| 11 |
use \EmailKit\Promotional\Onboard\Onboard; |
| 12 |
use \EmailKit\Promotional\Onboard\Attr; |
| 13 |
class Promotional{ |
| 14 |
|
| 15 |
function init(){ |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
/** |
| 20 |
* Show elementskit Notice |
| 21 |
*/ |
| 22 |
Notice::init(); |
| 23 |
// Notice::instance( 'emailkit', 'go-pro-noti2ce' ) # @plugin_slug @notice_name |
| 24 |
// ->set_dismiss( 'global', ( 3600 * 24 * 300 ) ) # @global/user @time_period |
| 25 |
// ->set_type( 'warning' ) # @notice_type |
| 26 |
// ->set_html( |
| 27 |
// ' |
| 28 |
// <div class="ekit-go-pro-notice"> |
| 29 |
// <strong>Thank you for using EmailKit .</strong> To get more amazing |
| 30 |
// features and the outstanding pro ready-made templates, please get the |
| 31 |
// <a style="color: #FCB214;" target="_blank" |
| 32 |
// href="https://wpmet.com/emailkit-pricing">Premium Version</a>. |
| 33 |
// </div> |
| 34 |
// ' |
| 35 |
// ) # @notice_massage_html |
| 36 |
// ->call(); |
| 37 |
|
| 38 |
if( \EmailKit\Promotional\Util::get_settings( 'emailkit_user_consent_for_banner', 'yes' ) == 'yes' ){ |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
/** |
| 44 |
* Show WPMET stories widget in the dashboard |
| 45 |
*/ |
| 46 |
/* |
| 47 |
$filter_string = ''; // elementskit,metform-pro |
| 48 |
$filter_string .= ((!in_array('elementskit/elementskit.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',elementskit'); |
| 49 |
$filter_string .= (!class_exists('\MetForm\Plugin') ? '' : ',metform'); |
| 50 |
$filter_string .= (!class_exists('\MetForm_Pro\Plugin') ? '' : ',metform-pro'); |
| 51 |
|
| 52 |
Stories::instance( 'metform' ) # @plugin_slug |
| 53 |
// ->is_test(true) # @check_interval |
| 54 |
->set_filter( $filter_string ) # @active_plugins |
| 55 |
->set_plugin( 'EmailKit', 'https://wpmet.com/plugin/metform/' ) # @plugin_name @plugin_url |
| 56 |
->set_api_url( 'https://api.wpmet.com/public/stories/' ) # @api_url_for_stories |
| 57 |
->call(); |
| 58 |
*/ |
| 59 |
|
| 60 |
/** |
| 61 |
* Show WPMET banner (codename: jhanda) |
| 62 |
*/ |
| 63 |
/* |
| 64 |
Banner::instance( 'emailkit' ) # @plugin_slug |
| 65 |
// ->is_test(true) # @check_interval |
| 66 |
->set_filter( ltrim( $filter_string, ',' ) ) # @active_plugins |
| 67 |
->set_api_url( 'https://api.wpmet.com/public/jhanda' ) # @api_url_for_banners |
| 68 |
->set_plugin_screens( 'edit-elementskit_template' ) # @set_allowed_screen |
| 69 |
->set_plugin_screens( 'toplevel_page_elementskit' ) # @set_allowed_screen |
| 70 |
->call(); |
| 71 |
*/ |
| 72 |
|
| 73 |
/** |
| 74 |
* Ask for Ratings |
| 75 |
*/ |
| 76 |
Rating::instance('emailkit') # @plugin_slug |
| 77 |
->set_message('<strong>Loving the EmailKit email-building experience? 😀 </strong> </br> |
| 78 |
Share your feedback, like a 5-star review, and motivate us to take EmailKit to the next level! 💯') |
| 79 |
->set_plugin_logo('https://ps.w.org/emailkit/assets/icon-128x128.png') # @plugin_logo_url |
| 80 |
->set_plugin('EmailKit', 'https://wpmet.com/wordpress.org/rating/emailkit') # @plugin_name @plugin_url |
| 81 |
->set_rating_url('https://wordpress.org/support/plugin/emailkit/reviews/#new-post') |
| 82 |
->set_support_url('https://help.wpmet.com/') |
| 83 |
->set_allowed_screens('edit-emailkit') # @set_allowed_screen |
| 84 |
->set_allowed_screens('edit-emailkit') # @set_allowed_screen |
| 85 |
->set_allowed_screens('emailkit_page_emailkit_get_help') # @set_allowed_screen |
| 86 |
->set_priority(30) # @priority |
| 87 |
->set_first_appear_day(7) # @time_interval_days |
| 88 |
->set_condition(true) # @check_conditions |
| 89 |
->call(); |
| 90 |
} |
| 91 |
|
| 92 |
/** |
| 93 |
* Show our plugins menu for others wpmet plugins |
| 94 |
*/ |
| 95 |
/* |
| 96 |
Plugins::instance()->init('emailkit') # @text_domain |
| 97 |
->set_parent_menu_slug('emailkit-menu') # @plugin_slug |
| 98 |
->set_submenu_name(esc_html__('Our Plugins', 'emailkit')) |
| 99 |
->set_section_title( esc_html__('Get More out of Your WordPress Website!', 'emailkit')) |
| 100 |
->set_section_description(esc_html__('Revamp your website with other top plugins from us. And guess what, they\'re absolutely free!', 'emailkit')) # @section_description (optional) |
| 101 |
->set_items_per_row(4) # @items_per_row (optional- default: 6) |
| 102 |
->set_plugins( # @plugins |
| 103 |
[ |
| 104 |
'elementskit-lite/elementskit-lite.php' => [ |
| 105 |
'name' => esc_html__('ElementsKit Elementor addons', 'emailkit'), |
| 106 |
'url' => 'https://wordpress.org/plugins/elementskit-lite/', |
| 107 |
'icon' => 'https://ps.w.org/elementskit-lite/assets/icon-256x256.gif?rev=2518175', |
| 108 |
'desc' => esc_html__('All-in-one Elementor addon trusted by 1 Million+ users, makes your website builder process easier with ultimate freedom.', 'emailkit'), |
| 109 |
'docs' => 'https://wpmet.com/docs/elementskit/', |
| 110 |
], |
| 111 |
'getgenie/getgenie.php' => [ |
| 112 |
'name' => esc_html__('GetGenie', 'emailkit'), |
| 113 |
'url' => 'https://wordpress.org/plugins/getgenie/', |
| 114 |
'icon' => 'https://ps.w.org/getgenie/assets/icon-256x256.gif?rev=2798355', |
| 115 |
'desc' => esc_html__('Your personal AI assistant for content and SEO. Write content that ranks on Google with NLP keywords and SERP analysis data.', 'emailkit'), |
| 116 |
'docs' => 'https://getgenie.ai/docs/', |
| 117 |
], |
| 118 |
'gutenkit-blocks-addon/gutenkit-blocks-addon.php' => [ |
| 119 |
'name' => esc_html__('GutenKit', 'emailkit'), |
| 120 |
'url' => 'https://wordpress.org/plugins/gutenkit-blocks-addon/', |
| 121 |
'icon' => 'https://ps.w.org/gutenkit-blocks-addon/assets/icon-128x128.png?rev=3044956', |
| 122 |
'desc' => esc_html__('Gutenberg blocks, patterns, and templates that extend the page-building experience using the WordPress block editor.', 'emailkit'), |
| 123 |
'docs' => 'https://wpmet.com/doc/gutenkit/', |
| 124 |
], |
| 125 |
'shopengine/shopengine.php' => [ |
| 126 |
'name' => esc_html__('Shopengine', 'emailkit'), |
| 127 |
'url' => 'https://wordpress.org/plugins/shopengine/', |
| 128 |
'icon' => 'https://ps.w.org/shopengine/assets/icon-256x256.gif?rev=2505061', |
| 129 |
'desc' => esc_html__('Complete WooCommerce solution for Elementor to fully customize any pages including cart, checkout, shop page, and so on.', 'emailkit'), |
| 130 |
'docs' => 'https://wpmet.com/doc/shopengine/', |
| 131 |
], |
| 132 |
'metform/metform.php' => [ |
| 133 |
'name' => esc_html__('MetForm', 'emailkit'), |
| 134 |
'url' => 'https://wordpress.org/plugins/metform/', |
| 135 |
'icon' => 'https://ps.w.org/metform/assets/icon-256x256.png', |
| 136 |
'desc' => esc_html__('Drag & drop form builder for Elementor to create contact forms, multi-step forms, and more — smoother, faster, and better!', 'emailkit'), |
| 137 |
'docs' => 'https://wpmet.com/doc/metform/', |
| 138 |
], |
| 139 |
|
| 140 |
'wp-social/wp-social.php' => [ |
| 141 |
'name' => esc_html__('WP Social', 'emailkit'), |
| 142 |
'url' => 'https://wordpress.org/plugins/wp-social/', |
| 143 |
'icon' => 'https://ps.w.org/wp-social/assets/icon-256x256.png?rev=2544214', |
| 144 |
'desc' => esc_html__('Add social share, login, and engagement counter — unified solution for all social media with tons of different styles for your website.', 'emailkit'), |
| 145 |
'docs' => 'https://wpmet.com/doc/wp-social/', |
| 146 |
], |
| 147 |
|
| 148 |
'wp-ultimate-review/wp-ultimate-review.php' => [ |
| 149 |
'name' => esc_html__('WP Ultimate Review', 'emailkit'), |
| 150 |
'url' => 'https://wordpress.org/plugins/wp-ultimate-review/', |
| 151 |
'icon' => 'https://ps.w.org/wp-ultimate-review/assets/icon-256x256.png?rev=2544187', |
| 152 |
'desc' => esc_html__('Collect and showcase reviews on your website to build brand credibility and social proof with the easiest solution.', 'emailkit'), |
| 153 |
'docs' => 'https://wpmet.com/doc/wp-ultimate-review/', |
| 154 |
], |
| 155 |
|
| 156 |
'wp-fundraising-donation/wp-fundraising.php' => [ |
| 157 |
'name' => esc_html__('FundEngine', 'emailkit'), |
| 158 |
'url' => 'https://wordpress.org/plugins/wp-fundraising-donation/', |
| 159 |
'icon' => 'https://ps.w.org/wp-fundraising-donation/assets/icon-256x256.png?rev=2544150', |
| 160 |
'desc' => esc_html__('Create fundraising, crowdfunding, and donation websites with PayPal and Stripe payment gateway integration.', 'emailkit'), |
| 161 |
|
| 162 |
'docs' => 'https://wpmet.com/doc/fundengine/', |
| 163 |
], |
| 164 |
'blocks-for-shopengine/shopengine-gutenberg-addon.php' => [ |
| 165 |
'name' => esc_html__('Blocks for ShopEngine', 'emailkit'), |
| 166 |
'url' => 'https://wordpress.org/plugins/blocks-for-shopengine/', |
| 167 |
'icon' => 'https://ps.w.org/blocks-for-shopengine/assets/icon-256x256.gif?rev=2702483', |
| 168 |
'desc' => esc_html__('All in one WooCommerce solution for Gutenberg! Build your WooCommerce pages in a block editor with full customization.', 'emailkit'), |
| 169 |
'docs' => 'https://wpmet.com/doc/shopengine/shopengine-gutenberg/', |
| 170 |
], |
| 171 |
'genie-image-ai/genie-image-ai.php' => [ |
| 172 |
'name' => esc_html__('Genie Image', 'emailkit'), |
| 173 |
'url' => 'https://wordpress.org/plugins/genie-image-ai/', |
| 174 |
'icon' => 'https://ps.w.org/genie-image-ai/assets/icon-256x256.png?rev=2977297', |
| 175 |
'desc' => esc_html__('AI-powered text-to-image generator for WordPress with OpenAI’s DALL-E 2 technology to generate high-quality images in one click.', 'emailkit'), |
| 176 |
'docs' => 'https://getgenie.ai/docs/', |
| 177 |
], |
| 178 |
|
| 179 |
] |
| 180 |
) |
| 181 |
->call(); |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
$is_pro_active = ''; |
| 186 |
|
| 187 |
if (!in_array('emailkit-pro/emailkit-pro.php', apply_filters('active_plugins', get_option('active_plugins')))) { |
| 188 |
$is_pro_active = 'Go Premium'; |
| 189 |
} |
| 190 |
|
| 191 |
|
| 192 |
$pro_awareness = ProAwareness::instance('emailkit'); |
| 193 |
$pro_awareness |
| 194 |
->set_parent_menu_slug('emailkit-menu') |
| 195 |
->set_pro_link( |
| 196 |
(in_array('emailkit-pro/emailkit-pro.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : |
| 197 |
'https://wpmet.com/emailkit-pricing' |
| 198 |
) |
| 199 |
->set_plugin_file('emailkit/EmailKit.php') |
| 200 |
->set_default_grid_thumbnail(EMAILKIT_URL . '/Promotional/ProAwareness/assets/images/support.png') |
| 201 |
->set_page_grid([ |
| 202 |
'url' => 'https://wpmet.com/fb-group', |
| 203 |
'title' => esc_html__('Join the Community', 'emailkit'), |
| 204 |
'thumbnail' => EMAILKIT_URL . '/Promotional/ProAwareness/assets/images/community.png', |
| 205 |
'description' => esc_html__('Join our Facebook group to get 20% discount coupon on premium products. Follow us to get more exciting offers.', 'emailkit') |
| 206 |
|
| 207 |
]) |
| 208 |
->set_page_grid([ |
| 209 |
'url' => 'https://www.youtube.com/playlist?list=PL3t2OjZ6gY8NoB_48DwWKUDRtBEuBOxSc', |
| 210 |
'title' => esc_html__('Video Tutorials', 'emailkit'), |
| 211 |
'thumbnail' => EMAILKIT_URL . '/Promotional/ProAwareness/assets/images/videos.png', |
| 212 |
'description' => esc_html__('Learn the step by step process for developing your site easily from video tutorials.', 'emailkit') |
| 213 |
]) |
| 214 |
->set_page_grid([ |
| 215 |
'url' => 'https://wpmet.com/plugin/emailkit/roadmaps#ideas', |
| 216 |
'title' => esc_html__('Request a feature', 'emailkit'), |
| 217 |
'thumbnail' => EMAILKIT_URL . '/Promotional/ProAwareness/assets/images/request.png', |
| 218 |
'description' => esc_html__('Have any special feature in mind? Let us know through the feature request.', 'emailkit') |
| 219 |
]) |
| 220 |
->set_page_grid([ |
| 221 |
'url' => 'https://wpmet.com/doc/emailkit/', |
| 222 |
'title' => esc_html__('Documentation', 'emailkit'), |
| 223 |
'thumbnail' => EMAILKIT_URL . '/Promotional/ProAwareness/assets/images/documentation.png', |
| 224 |
'description' => esc_html__('Detailed documentation to help you understand the functionality of each feature.', 'emailkit') |
| 225 |
]) |
| 226 |
->set_page_grid([ |
| 227 |
'url' => 'https://wpmet.com/plugin/emailkit/roadmaps/', |
| 228 |
'title' => esc_html__('Public Roadmap', 'emailkit'), |
| 229 |
'thumbnail' => EMAILKIT_URL . '/Promotional/ProAwareness/assets/images/roadmaps.png', |
| 230 |
'description' => esc_html__( 'Check our upcoming new features, detailed development stories and tasks', 'emailkit') |
| 231 |
]) |
| 232 |
|
| 233 |
->set_plugin_row_meta('Documentation', 'https://help.wpmet.com/docs-cat/emailkit/', ['target' => '_blank']) |
| 234 |
->set_plugin_row_meta('Facebook Community', 'https://wpmet.com/fb-group', ['target' => '_blank']) |
| 235 |
->set_plugin_row_meta('Rate the plugin � |
| 236 |
� |
| 237 |
� |
| 238 |
� |
| 239 |
� |
| 240 |
', 'https://wordpress.org/support/plugin/emailkit/reviews/#new-post', ['target' => '_blank']) |
| 241 |
->set_plugin_action_link('Settings', admin_url() . 'admin.php?page=emailkit-menu-settings') |
| 242 |
->set_plugin_action_link($is_pro_active, 'https://wpmet.com/plugin/emailkit', ['target' => '_blank', 'style' => 'color: #FCB214; font-weight: bold;']) |
| 243 |
->call(); |
| 244 |
|
| 245 |
|
| 246 |
// Onboard::instance()->init(); |
| 247 |
|
| 248 |
// if(isset($_GET['emailkit-onboard-steps']) && isset($_GET['emailkit-onboard-steps-nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['emailkit-onboard-steps-nonce'])),'emailkit-onboard-steps-action')) { |
| 249 |
// Attr::instance(); |
| 250 |
// } |
| 251 |
|
| 252 |
add_action('emailkit-settings', function(){ |
| 253 |
|
| 254 |
// if(isset($_GET['emailkit-onboard-steps']) && $_GET['emailkit-onboard-steps'] == 'loaded' && isset($_GET['emailkit-onboard-steps-nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['emailkit-onboard-steps-nonce'])),'emailkit-onboard-steps-action')) { |
| 255 |
// wp_enqueue_style( 'emailkit-steps-css-steps' ); // needed when onboardning |
| 256 |
// Onboard::instance()->views(); |
| 257 |
// } |
| 258 |
|
| 259 |
(new \EmailKit\Promotional\ProConsent())->get_consent_form(); |
| 260 |
} |
| 261 |
); |
| 262 |
*/ |
| 263 |
|
| 264 |
} |
| 265 |
|
| 266 |
|
| 267 |
} |