| @@ -36,9 +36,9 @@ | ||
| 36 | 36 | private static $version = '2.0.0'; |
| 37 | 37 | /** |
| 38 | 38 | * Holds registered products. |
| 39 | 39 | * |
| 40 | - * @var array The products which use the SDK. | |
| 40 | + * @var array<Product> The products which use the SDK. | |
| 41 | 41 | */ |
| 42 | 42 | private static $products = []; |
| 43 | 43 | /** |
| 44 | 44 | * Holds available modules to load. |
| @@ -45,8 +45,9 @@ | ||
| 45 | 45 | * |
| 46 | 46 | * @var array The modules which SDK will be using. |
| 47 | 47 | */ |
| 48 | 48 | private static $available_modules = [ |
| 49 | + 'script_loader', | |
| 49 | 50 | 'dashboard_widget', |
| 50 | 51 | 'rollback', |
| 51 | 52 | 'uninstall_feedback', |
| 52 | 53 | 'licenser', |
| @@ -51,8 +52,9 @@ | ||
| 51 | 52 | 'uninstall_feedback', |
| 52 | 53 | 'licenser', |
| 53 | 54 | 'logger', |
| 54 | 55 | 'translate', |
| 56 | + 'translations', | |
| 55 | 57 | 'review', |
| 56 | 58 | 'recommendation', |
| 57 | 59 | 'notification', |
| 58 | 60 | 'promotions', |
| @@ -58,14 +60,276 @@ | ||
| 58 | 60 | 'promotions', |
| 59 | 61 | 'welcome', |
| 60 | 62 | 'compatibilities', |
| 61 | 63 | 'about_us', |
| 64 | + 'announcements', | |
| 65 | + 'featured_plugins', | |
| 66 | + 'float_widget', | |
| 62 | 67 | ]; |
| 68 | + /** | |
| 69 | + * Holds the labels for the modules. | |
| 70 | + * | |
| 71 | + * @var array The labels for the modules. | |
| 72 | + */ | |
| 73 | + public static $labels = [ | |
| 74 | + 'announcements' => [ | |
| 75 | + 'hurry_up' => 'Hurry up! Only %s left.', | |
| 76 | + 'sale_live' => 'Themeisle Black Friday Sale is Live!', | |
| 77 | + 'learn_more' => 'Learn more', | |
| 78 | + 'max_savings' => 'Enjoy Maximum Savings on %s', | |
| 79 | + ], | |
| 80 | + 'compatibilities' => [ | |
| 81 | + 'notice' => '%s requires a newer version of %s. Please %supdate%s %s %s to the latest version.', | |
| 82 | + 'notice2' => '%s update requires a newer version of %s. Please %supdate%s %s %s.', | |
| 83 | + 'notice_theme' => '%1$sWarning:%2$s This theme has not been tested with your current version of %1$s%3$s%2$s. Please update %3$s plugin.', | |
| 84 | + 'notice_plugin' => '%1$sWarning:%2$s This plugin has not been tested with your current version of %1$s%3$s%2$s. Please update %3$s %4$s.', | |
| 85 | + 'theme' => 'theme', | |
| 86 | + 'plugin' => 'plugin', | |
| 87 | + ], | |
| 88 | + 'dashboard_widget' => [ | |
| 89 | + 'title' => 'WordPress Guides/Tutorials', | |
| 90 | + 'popular' => 'Popular %s', | |
| 91 | + 'install' => 'Install', | |
| 92 | + 'powered' => 'Powered by %s', | |
| 93 | + ], | |
| 94 | + 'licenser' => [ | |
| 95 | + 'activate' => 'Activate', | |
| 96 | + 'invalid_msg' => 'Invalid license.', | |
| 97 | + 'error_notice' => 'ERROR: Failed to connect to the license service. Please try again later. Reason: %s', | |
| 98 | + 'error_notice2' => 'ERROR: Failed to validate license. Please try again in one minute.', | |
| 99 | + 'error_invalid' => 'ERROR: Invalid license provided.', | |
| 100 | + 'update_license' => 'Updating this theme will lose any customizations you have made. Cancel to stop, OK to update.', | |
| 101 | + 'invalid_msg' => 'Invalid license.', | |
| 102 | + 'already_active' => 'License is already active.', | |
| 103 | + 'notice_update' => '%1$s is available. %2$sCheck out what\'s%3$s new or %4$supdate now%3$s.', | |
| 104 | + 'not_active' => 'License not active.', | |
| 105 | + 'deactivate' => 'Deactivate', | |
| 106 | + 'renew_cta' => 'Renew license to update', | |
| 107 | + 'autoactivate_notice' => '%s has been successfully activated using %s license !', | |
| 108 | + 'valid' => 'Valid', | |
| 109 | + 'invalid' => 'Invalid', | |
| 110 | + 'notice' => 'Enter your license from %s purchase history in order to get %s updates', | |
| 111 | + 'expired' => 'Your %s\'s License Key has expired. In order to continue receiving support and software updates you must %srenew%s your license key.', | |
| 63 | 112 | |
| 113 | + 'inactive' => 'In order to benefit from updates and support for %s, please add your license code from your %spurchase history%s and validate it %shere%s.', | |
| 114 | + 'no_activations' => 'No more activations left for %s. You need to upgrade your plan in order to use %s on more websites. If you need assistance, please get in touch with %s staff.', | |
| 115 | + ], | |
| 116 | + 'promotions' => [ | |
| 117 | + 'recommended' => 'Recommended by %s', | |
| 118 | + 'installActivate' => 'Install & Activate', | |
| 119 | + 'preview' => 'Preview', | |
| 120 | + 'installing' => 'Installing', | |
| 121 | + 'activating' => 'Activating', | |
| 122 | + 'connecting' => 'Connecting to API', | |
| 123 | + 'learnmore' => 'Learn More', | |
| 124 | + 'activate' => 'Activate', | |
| 125 | + 'all_set' => 'Awesome! You are all set!', | |
| 126 | + 'woo' => [ | |
| 127 | + 'title' => 'More extensions from Themeisle', | |
| 128 | + 'title2' => 'Recommended extensions', | |
| 129 | + 'cta_install' => 'Install', | |
| 130 | + 'learn_more' => 'Learn More', | |
| 131 | + 'dismiss' => 'Dismiss this suggestion', | |
| 132 | + 'ppom_title' => 'Product Add-Ons', | |
| 133 | + 'ppom_desc' => 'Add extra custom fields & add-ons on your product pages, like sizes, colors & more.', | |
| 134 | + 'spark_title1' => 'Wishlist', | |
| 135 | + 'spark_title2' => 'Multi-Announcement Bars', | |
| 136 | + 'spark_title3' => 'Advanced Product Review', | |
| 137 | + 'spark_desc1' => 'Loyalize your customers by allowing them to save their favorite products.', | |
| 138 | + 'spark_desc2' => 'Add a top notification bar on your website to highlight the latest products, offers, or upcoming events.', | |
| 139 | + 'spark_desc3' => 'Enable an advanced review section, enlarging the basic review options with lots of capabilities.', | |
| 140 | + ], | |
| 141 | + | |
| 142 | + 'feedzy' => [ | |
| 143 | + 'import_desc' => 'Schedule automatic content imports from any RSS feed directly to your site. %sBuilt by %s%s', | |
| 144 | + 'install_now' => 'Install Now', | |
| 145 | + 'by' => 'by %s', | |
| 146 | + 'editor_recommends' => '%s recommends %sFeedzy%s to display entries from any RSS feed with more advanced styling and filtering options.', | |
| 147 | + ], | |
| 148 | + 'optimole' => [ | |
| 149 | + 'installOptimole' => 'Install Optimole', | |
| 150 | + 'gotodash' => 'Go to Optimole dashboard', | |
| 151 | + 'dismisscta' => 'Dismiss this notice.', | |
| 152 | + 'message1' => 'Increase this page speed and SEO ranking by optimizing images with Optimole.', | |
| 153 | + 'message3' => 'Save your server space by storing images to Optimole and deliver them optimized from 400 locations around the globe. Unlimited images, Unlimited traffic.', | |
| 154 | + 'message4' => 'This image looks to be too large and would affect your site speed, we recommend you to install Optimole to optimize your images.', | |
| 155 | + 'message2' => 'Leverage Optimole\'s full integration with Elementor to automatically lazyload, resize, compress to AVIF/WebP and deliver from 400 locations around the globe!', | |
| 156 | + ], | |
| 157 | + 'redirectionCF7' => [ | |
| 158 | + 'gotodash' => 'Go to Contact Forms', | |
| 159 | + 'dismisscta' => 'Dismiss this notice.', | |
| 160 | + 'gst' => 'Get Started Free', | |
| 161 | + 'message' => 'Add URL redirects, spam protection, execute JavaScript after submissions, and more with the Redirection for CF7 free plugin.', | |
| 162 | + ], | |
| 163 | + 'hyve' => [ | |
| 164 | + 'gotodash' => 'Go to Hyve Dashboard', | |
| 165 | + 'install' => 'Install Hyve', | |
| 166 | + 'dismisscta' => 'Dismiss this notice.', | |
| 167 | + 'message' => 'Hyve is an AI-powered chatbot that turns your WordPress content into interactive conversations, helping you efficiently handle user inquiries.', | |
| 168 | + ], | |
| 169 | + 'wp_full_pay' => [ | |
| 170 | + 'gotodash' => 'Go to WP Full Pay Settings', | |
| 171 | + 'install' => 'Install WP Full Pay', | |
| 172 | + 'dismisscta' => 'Dismiss this notice.', | |
| 173 | + 'message' => 'Enhance your donation page with WP Full Pay—create custom Stripe forms for one-time and recurring donations, manage transactions easily, and boost support with a seamless setup.', | |
| 174 | + ], | |
| 175 | + ], | |
| 176 | + 'welcome' => [ | |
| 177 | + 'ctan' => 'No, thanks.', | |
| 178 | + 'ctay' => 'Upgrade Now!', | |
| 179 | + 'message' => '<p>You\'ve been using <b>{product}</b> for 7 days now and we appreciate your loyalty! We also want to make sure you\'re getting the most out of our product. That\'s why we\'re offering you a special deal - upgrade to <b>{pro_product}</b> in the next 5 days and receive a discount of <b>up to 30%</b>. <a href="{cta_link}" target="_blank">Upgrade now</a> and unlock all the amazing features of <b>{pro_product}</b>!</p>', | |
| 180 | + ], | |
| 181 | + 'uninstall' => [ | |
| 182 | + 'heading_plugin' => 'What\'s wrong?', | |
| 183 | + 'heading_theme' => 'What does not work for you in {theme}?', | |
| 184 | + 'submit' => 'Submit', | |
| 185 | + 'cta_info' => 'What info do we collect?', | |
| 186 | + 'button_submit' => 'Submit & Deactivate', | |
| 187 | + 'button_cancel' => 'Skip & Deactivate', | |
| 188 | + 'disclosure' => [ | |
| 189 | + 'title' => 'Below is a detailed view of all data that Themeisle will receive if you fill in this survey. No email address or IP addresses are transmitted after you submit the survey.', | |
| 190 | + 'version' => '%s %s version %s %s %s %s', | |
| 191 | + 'website' => '%sCurrent website:%s %s %s %s', | |
| 192 | + 'usage' => '%sUsage time:%s %s %s%s', | |
| 193 | + 'reason' => '%s Uninstall reason %s %s Selected reason from the above survey %s ', | |
| 194 | + ], | |
| 195 | + | |
| 196 | + 'options' => [ | |
| 197 | + 'id3' => [ | |
| 198 | + 'title' => 'I found a better plugin', | |
| 199 | + 'placeholder' => 'What\'s the plugin\'s name?', | |
| 200 | + ], | |
| 201 | + 'id4' => [ | |
| 202 | + | |
| 203 | + 'title' => 'I could not get the plugin to work', | |
| 204 | + 'placeholder' => 'What problem are you experiencing?', | |
| 205 | + ], | |
| 206 | + 'id5' => [ | |
| 207 | + | |
| 208 | + 'title' => 'I no longer need the plugin', | |
| 209 | + 'placeholder' => 'If you could improve one thing about our product, what would it be?', | |
| 210 | + ], | |
| 211 | + 'id6' => [ | |
| 212 | + 'title' => 'It\'s a temporary deactivation. I\'m just debugging an issue.', | |
| 213 | + 'placeholder' => 'What problem are you experiencing?', | |
| 214 | + ], | |
| 215 | + 'id7' => [ | |
| 216 | + 'title' => 'I don\'t know how to make it look like demo', | |
| 217 | + ], | |
| 218 | + 'id8' => [ | |
| 219 | + | |
| 220 | + 'placeholder' => 'What option is missing?', | |
| 221 | + 'title' => 'It lacks options', | |
| 222 | + ], | |
| 223 | + 'id9' => [ | |
| 224 | + 'title' => 'Is not working with a plugin that I need', | |
| 225 | + 'placeholder' => 'What is the name of the plugin', | |
| 226 | + ], | |
| 227 | + 'id10' => [ | |
| 228 | + 'title' => 'I want to try a new design, I don\'t like {theme} style', | |
| 229 | + ], | |
| 230 | + 'id999' => [ | |
| 231 | + 'title' => 'Other', | |
| 232 | + 'placeholder' => 'What can we do better?', | |
| 233 | + ], | |
| 234 | + ], | |
| 235 | + ], | |
| 236 | + 'review' => [ | |
| 237 | + 'notice' => '<p>Hey, it\'s great to see you have <b>{product}</b> active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers! <br/> <br/>~ {developer}, developer of {product}</p>', | |
| 238 | + 'ctay' => 'Ok, I will gladly help.', | |
| 239 | + 'ctan' => 'No, thanks.', | |
| 240 | + | |
| 241 | + ], | |
| 242 | + 'rollback' => [ | |
| 243 | + 'cta' => 'Rollback to v%s', | |
| 244 | + ], | |
| 245 | + 'logger' => [ | |
| 246 | + 'notice' => 'Do you enjoy <b>{product}</b>? Become a contributor by opting in to our anonymous data tracking. We guarantee no sensitive data is collected.', | |
| 247 | + 'cta_y' => 'Sure, I would love to help.', | |
| 248 | + 'cta_n' => 'No, thanks.', | |
| 249 | + ], | |
| 250 | + 'about_us' => [ | |
| 251 | + 'title' => 'About Us', | |
| 252 | + 'heroHeader' => 'Our Story', | |
| 253 | + 'heroTextFirst' => 'Themeisle was founded in 2012 by a group of passionate developers who wanted to create beautiful and functional WordPress themes and plugins. Since then, we have grown into a team of over 20 dedicated professionals who are committed to delivering the best possible products to our customers.', | |
| 254 | + 'heroTextSecond' => 'At Themeisle, we offer a wide range of WordPress themes and plugins that are designed to meet the needs of both beginners and advanced users. Our products are feature-rich, easy to use, and are designed to help you create beautiful and functional websites.', | |
| 255 | + 'teamImageCaption' => 'Our team in WCEU2022 in Portugal', | |
| 256 | + 'newsHeading' => 'Stay connected for news & updates!', | |
| 257 | + 'emailPlaceholder' => 'Your email address', | |
| 258 | + 'signMeUp' => 'Sign me up', | |
| 259 | + 'installNow' => 'Install Now', | |
| 260 | + 'activate' => 'Activate', | |
| 261 | + 'learnMore' => 'Learn More', | |
| 262 | + 'installed' => 'Installed', | |
| 263 | + 'notInstalled' => 'Not Installed', | |
| 264 | + 'active' => 'Active', | |
| 265 | + 'others' => [ | |
| 266 | + 'optimole_desc' => 'Optimole is an image optimization service that automatically optimizes your images and serves them to your visitors via a global CDN, making your website lighter, faster and helping you reduce your bandwidth usage.', | |
| 267 | + 'neve_desc' => 'A fast, lightweight, customizable WordPress theme offering responsive design, speed, and flexibility for various website types.', | |
| 268 | + 'landingkit_desc' => 'Turn WordPress into a landing page powerhouse with Landing Kit, map domains to pages or any other published resource.', | |
| 269 | + 'sparks_desc' => 'Extend your store functionality with 8 ultra-performant features like product comparisons, variation swatches, wishlist, and more.', | |
| 270 | + 'tpc_desc' => 'Design, save, and revisit your templates anytime with your personal vault on Templates Cloud.', | |
| 271 | + ], | |
| 272 | + 'otter-page' => [ | |
| 273 | + 'heading' => 'Build innovative layouts with Otter Blocks and Gutenberg', | |
| 274 | + 'text' => 'Otter is a lightweight, dynamic collection of page building blocks and templates for the WordPress block editor.', | |
| 275 | + 'buttons' => [ | |
| 276 | + 'install_otter_free' => "Install Otter - It's free!", | |
| 277 | + 'install_now' => 'Install Now', | |
| 278 | + 'learn_more' => 'Learn More', | |
| 279 | + ], | |
| 280 | + 'features' => [ | |
| 281 | + 'advancedTitle' => 'Advanced Features', | |
| 282 | + 'advancedDesc' => 'Add features such as Custom CSS, Animations & Visibility Conditions to all blocks.', | |
| 283 | + 'fastTitle' => 'Lightweight and Fast', | |
| 284 | + 'fastDesc' => 'Otter enhances WordPress site building experience without impacting site speed.', | |
| 285 | + 'mobileTitle' => 'Mobile-Friendly', | |
| 286 | + 'mobileDesc' => 'Each block can be tweaked to provide a consistent experience across all devices.', | |
| 287 | + ], | |
| 288 | + 'details' => [ | |
| 289 | + 's1Title' => 'A Better Page Building Experience', | |
| 290 | + 's1Text' => 'Otter can be used to build everything from a personal blog to an e-commerce site without losing the personal touch. Otter’s ease of use transforms basic blocks into expressive layouts in seconds.', | |
| 291 | + 's2Title' => 'A New Collection of Patterns', | |
| 292 | + 's2Text' => 'A New Patterns Library, containing a range of different elements in a variety of styles to help you build great pages. All of your website’s most important areas are covered: headers, testimonials, pricing tables, sections and more.', | |
| 293 | + 's3Title' => 'Advanced Blocks', | |
| 294 | + 's3Text' => 'Enhance your website’s design with powerful blocks, like the Add to Cart, Business Hours, Review Comparison, and dozens of WooCommerce blocks.', | |
| 295 | + ], | |
| 296 | + 'testimonials' => [ | |
| 297 | + 'heading' => 'Trusted by more than 300K website owners', | |
| 298 | + 'users' => [ | |
| 299 | + 'user_1' => 'Loved the collection of blocks. If you want to create nice Gutenberg Pages, this plugin will be very handy and useful.', | |
| 300 | + 'user_2' => 'I am very satisfied with Otter – a fantastic collection of blocks. And the plugin is perfectly integrated with Gutenberg and complete enough for my needs.', | |
| 301 | + 'user_3' => 'Otter Blocks work really well and I like the customization options. Easy to use and format to fit in with my site theme – and I’ve not encountered any compatibility or speed issues.', | |
| 302 | + ], | |
| 303 | + ], | |
| 304 | + ], | |
| 305 | + ], | |
| 306 | + 'float_widget' => [ | |
| 307 | + 'button' => 'Toggle Help Widget for %s', | |
| 308 | + 'panel' => [ | |
| 309 | + 'greeting' => 'Thank you for using %s', | |
| 310 | + 'title' => 'How can we help you?', | |
| 311 | + 'close' => 'Close Toggle Help Widget', | |
| 312 | + ], | |
| 313 | + 'links' => [ | |
| 314 | + 'documentation' => 'Documentation', | |
| 315 | + 'support' => 'Get Support', | |
| 316 | + 'wizard' => 'Run Setup Wizard', | |
| 317 | + 'upgrade' => 'Upgrade to Pro', | |
| 318 | + 'feature_request' => 'Suggest a Feature', | |
| 319 | + 'rate' => 'Rate Us', | |
| 320 | + ], | |
| 321 | + ], | |
| 322 | + ]; | |
| 323 | + | |
| 64 | 324 | /** |
| 65 | 325 | * Initialize the sdk logic. |
| 66 | 326 | */ |
| 67 | 327 | public static function init() { |
| 328 | + /** | |
| 329 | + * This filter can be used to localize the labels inside each product. | |
| 330 | + */ | |
| 331 | + self::$labels = apply_filters( 'themeisle_sdk_labels', self::$labels ); | |
| 68 | 332 | if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Loader ) ) { |
| 69 | 333 | self::$instance = new Loader(); |
| 70 | 334 | $modules = array_merge( self::$available_modules, apply_filters( 'themeisle_sdk_modules', [] ) ); |
| 71 | 335 | foreach ( $modules as $key => $module ) { |
| @@ -131,9 +395,9 @@ | ||
| 131 | 395 | |
| 132 | 396 | /** |
| 133 | 397 | * Get all products using the SDK. |
| 134 | 398 | * |
| 135 | - * @return array Products available. | |
| 399 | + * @return array<Product> Products available. | |
| 136 | 400 | */ |
| 137 | 401 | public static function get_products() { |
| 138 | 402 | return self::$products; |
| 139 | 403 | } |
| @@ -145,6 +409,5 @@ | ||
| 145 | 409 | */ |
| 146 | 410 | public static function get_version() { |
| 147 | 411 | return self::$version; |
| 148 | 412 | } |
| 149 | - | |
| 150 | 413 | } |