← All changes
|
vendor/codeinwp/themeisle-sdk/src/Modules/About_us.php
+48
-90
4.0.5
→
3.10.7
View file →
| @@ -13,9 +13,8 @@ | ||
| 13 | 13 | * 'page_menu' => [['text' => '', 'url' => '']], // optional |
| 14 | 14 | * 'has_upgrade_menu' => <condition>, |
| 15 | 15 | * 'upgrade_link' => <url>, |
| 16 | 16 | * 'upgrade_text' => 'Get Pro Version', |
| 17 | - * 'review_link' => false, // Leave it empty for default WPorg link or false to hide it. | |
| 18 | 17 | * ] |
| 19 | 18 | * } |
| 20 | 19 | * |
| 21 | 20 | * @package ThemeIsleSDK |
| @@ -27,9 +26,8 @@ | ||
| 27 | 26 | |
| 28 | 27 | namespace ThemeisleSDK\Modules; |
| 29 | 28 | |
| 30 | 29 | use ThemeisleSDK\Common\Abstract_Module; |
| 31 | -use ThemeisleSDK\Loader; | |
| 32 | 30 | use ThemeisleSDK\Product; |
| 33 | 31 | |
| 34 | 32 | // Exit if accessed directly. |
| 35 | 33 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -95,15 +93,12 @@ | ||
| 95 | 93 | if ( ! isset( $this->about_data['location'] ) ) { |
| 96 | 94 | return; |
| 97 | 95 | } |
| 98 | 96 | |
| 99 | - // Refresh the about data to get the latest changes. | |
| 100 | - $this->about_data = apply_filters( $this->product->get_key() . '_about_us_metadata', array() ); | |
| 101 | - | |
| 102 | 97 | add_submenu_page( |
| 103 | 98 | $this->about_data['location'], |
| 104 | - Loader::$labels['about_us']['title'], | |
| 105 | - Loader::$labels['about_us']['title'], | |
| 99 | + __( 'About Us', 'textdomain' ), | |
| 100 | + __( 'About Us', 'textdomain' ), | |
| 106 | 101 | 'manage_options', |
| 107 | 102 | $this->get_about_page_slug(), |
| 108 | 103 | array( $this, 'render_about_us_page' ), |
| 109 | 104 | 100 |
| @@ -127,35 +122,14 @@ | ||
| 127 | 122 | |
| 128 | 123 | add_submenu_page( |
| 129 | 124 | $this->about_data['location'], |
| 130 | 125 | $this->about_data['upgrade_text'], |
| 131 | - '<span class="tsdk-upg-menu-item">' . $this->about_data['upgrade_text'] . '</span>', | |
| 126 | + $this->about_data['upgrade_text'], | |
| 132 | 127 | 'manage_options', |
| 133 | 128 | $this->about_data['upgrade_link'], |
| 134 | 129 | '', |
| 135 | 130 | 101 |
| 136 | 131 | ); |
| 137 | - add_action( | |
| 138 | - 'admin_footer', | |
| 139 | - function () { | |
| 140 | - ?> | |
| 141 | - <style> | |
| 142 | - .tsdk-upg-menu-item { | |
| 143 | - color: #009528; | |
| 144 | - } | |
| 145 | - | |
| 146 | - .tsdk-upg-menu-item:hover { | |
| 147 | - color: #008a20; | |
| 148 | - } | |
| 149 | - </style> | |
| 150 | - <script type="text/javascript"> | |
| 151 | - jQuery(document).ready(function ($) { | |
| 152 | - $('.tsdk-upg-menu-item').parent().attr('target', '_blank'); | |
| 153 | - }); | |
| 154 | - </script> | |
| 155 | - <?php | |
| 156 | - } | |
| 157 | - ); | |
| 158 | 132 | } |
| 159 | 133 | |
| 160 | 134 | /** |
| 161 | 135 | * Render page content. |
| @@ -185,10 +159,8 @@ | ||
| 185 | 159 | $handle = 'ti-sdk-about-' . $this->product->get_key(); |
| 186 | 160 | $asset_file = require $themeisle_sdk_max_path . '/assets/js/build/about/about.asset.php'; |
| 187 | 161 | $deps = array_merge( $asset_file['dependencies'], [ 'updates' ] ); |
| 188 | 162 | |
| 189 | - do_action( 'themeisle_internal_page', $this->product->get_slug(), 'about_us' ); | |
| 190 | - | |
| 191 | 163 | wp_register_script( $handle, $this->get_sdk_uri() . 'assets/js/build/about/about.js', $deps, $asset_file['version'], true ); |
| 192 | 164 | wp_localize_script( $handle, 'tiSDKAboutData', $this->get_about_localization_data() ); |
| 193 | 165 | |
| 194 | 166 | wp_enqueue_script( $handle ); |
| @@ -202,9 +174,8 @@ | ||
| 202 | 174 | */ |
| 203 | 175 | private function get_about_localization_data() { |
| 204 | 176 | $links = isset( $this->about_data['page_menu'] ) ? $this->about_data['page_menu'] : []; |
| 205 | 177 | $product_pages = isset( $this->about_data['product_pages'] ) ? $this->about_data['product_pages'] : []; |
| 206 | - | |
| 207 | 178 | return [ |
| 208 | 179 | 'links' => $links, |
| 209 | 180 | 'logoUrl' => $this->about_data['logo'], |
| 210 | 181 | 'productPages' => $this->get_product_pages_data( $product_pages ), |
| @@ -216,27 +187,25 @@ | ||
| 216 | 187 | 'name' => $this->product->get_name(), |
| 217 | 188 | ], |
| 218 | 189 | 'teamImage' => $this->get_sdk_uri() . 'assets/images/team.jpg', |
| 219 | 190 | 'strings' => [ |
| 220 | - 'aboutUs' => Loader::$labels['about_us']['title'], | |
| 221 | - 'heroHeader' => Loader::$labels['about_us']['heroHeader'], | |
| 222 | - 'heroTextFirst' => Loader::$labels['about_us']['heroTextFirst'], | |
| 223 | - 'heroTextSecond' => Loader::$labels['about_us']['heroTextSecond'], | |
| 224 | - 'teamImageCaption' => Loader::$labels['about_us']['teamImageCaption'], | |
| 225 | - 'newsHeading' => Loader::$labels['about_us']['newsHeading'], | |
| 226 | - 'emailPlaceholder' => Loader::$labels['about_us']['emailPlaceholder'], | |
| 227 | - 'signMeUp' => Loader::$labels['about_us']['signMeUp'], | |
| 228 | - 'services' => Loader::$labels['about_us']['services'], | |
| 229 | - 'installNow' => Loader::$labels['about_us']['installNow'], | |
| 230 | - 'activate' => Loader::$labels['about_us']['activate'], | |
| 231 | - 'learnMore' => Loader::$labels['about_us']['learnMore'], | |
| 232 | - 'installed' => Loader::$labels['about_us']['installed'], | |
| 233 | - 'notInstalled' => Loader::$labels['about_us']['notInstalled'], | |
| 234 | - 'active' => Loader::$labels['about_us']['active'], | |
| 191 | + 'aboutUs' => __( 'About us', 'textdomain' ), | |
| 192 | + 'heroHeader' => __( 'Our Story', 'textdomain' ), | |
| 193 | + '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.', 'textdomain' ), | |
| 194 | + '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.', 'textdomain' ), | |
| 195 | + 'teamImageCaption' => __( 'Our team in WCEU2022 in Portugal', 'textdomain' ), | |
| 196 | + 'newsHeading' => __( 'Stay connected for news & updates!', 'textdomain' ), | |
| 197 | + 'emailPlaceholder' => __( 'Your email address', 'textdomain' ), | |
| 198 | + 'signMeUp' => __( 'Sign me up', 'textdomain' ), | |
| 199 | + 'installNow' => __( 'Install Now', 'textdomain' ), | |
| 200 | + 'activate' => __( 'Activate', 'textdomain' ), | |
| 201 | + 'learnMore' => __( 'Learn More', 'textdomain' ), | |
| 202 | + 'installed' => __( 'Installed', 'textdomain' ), | |
| 203 | + 'notInstalled' => __( 'Not Installed', 'textdomain' ), | |
| 204 | + 'active' => __( 'Active', 'textdomain' ), | |
| 235 | 205 | ], |
| 236 | 206 | 'canInstallPlugins' => current_user_can( 'install_plugins' ), |
| 237 | 207 | 'canActivatePlugins' => current_user_can( 'activate_plugins' ), |
| 238 | - 'showReviewLink' => ! ( isset( $this->about_data['review_link'] ) && false === $this->about_data['review_link'] ), | |
| 239 | 208 | ]; |
| 240 | 209 | } |
| 241 | 210 | |
| 242 | 211 | /** |
| @@ -262,52 +231,52 @@ | ||
| 262 | 231 | 'hash' => '#otter-page', |
| 263 | 232 | 'product' => $otter_slug, |
| 264 | 233 | 'plugin' => $otter_plugin, |
| 265 | 234 | 'strings' => [ |
| 266 | - 'heading' => Loader::$labels['about_us']['otter-page']['heading'], | |
| 267 | - 'text' => Loader::$labels['about_us']['otter-page']['text'], | |
| 235 | + 'heading' => __( 'Build innovative layouts with Otter Blocks and Gutenberg', 'textdomain' ), | |
| 236 | + 'text' => __( 'Otter is a lightweight, dynamic collection of page building blocks and templates for the WordPress block editor.', 'textdomain' ), | |
| 268 | 237 | 'buttons' => [ |
| 269 | - 'install_otter_free' => Loader::$labels['about_us']['otter-page']['buttons']['install_otter_free'], | |
| 270 | - 'install_now' => Loader::$labels['about_us']['otter-page']['buttons']['install_now'], | |
| 271 | - 'learn_more' => Loader::$labels['about_us']['otter-page']['buttons']['learn_more'], | |
| 238 | + 'install_otter_free' => __( "Install Otter - It's free!", 'textdomain' ), | |
| 239 | + 'install_now' => __( 'Install Now', 'textdomain' ), | |
| 240 | + 'learn_more' => __( 'Learn More', 'textdomain' ), | |
| 272 | 241 | 'learn_more_link' => tsdk_utmify( 'https://themeisle.com/plugins/otter-blocks/', 'otter-page', 'about-us' ), |
| 273 | 242 | ], |
| 274 | 243 | 'features' => [ |
| 275 | - 'advancedTitle' => Loader::$labels['about_us']['otter-page']['features']['advancedTitle'], | |
| 276 | - 'advancedDesc' => Loader::$labels['about_us']['otter-page']['features']['advancedDesc'], | |
| 277 | - 'fastTitle' => Loader::$labels['about_us']['otter-page']['features']['fastTitle'], | |
| 278 | - 'fastDesc' => Loader::$labels['about_us']['otter-page']['features']['fastDesc'], | |
| 279 | - 'mobileTitle' => Loader::$labels['about_us']['otter-page']['features']['mobileTitle'], | |
| 280 | - 'mobileDesc' => Loader::$labels['about_us']['otter-page']['features']['mobileDesc'], | |
| 244 | + 'advancedTitle' => __( 'Advanced Features', 'textdomain' ), | |
| 245 | + 'advancedDesc' => __( 'Add features such as Custom CSS, Animations & Visibility Conditions to all blocks.', 'textdomain' ), | |
| 246 | + 'fastTitle' => __( 'Lightweight and Fast', 'textdomain' ), | |
| 247 | + 'fastDesc' => __( 'Otter enhances WordPress site building experience without impacting site speed.', 'textdomain' ), | |
| 248 | + 'mobileTitle' => __( 'Mobile-Friendly', 'textdomain' ), | |
| 249 | + 'mobileDesc' => __( 'Each block can be tweaked to provide a consistent experience across all devices.', 'textdomain' ), | |
| 281 | 250 | ], |
| 282 | 251 | 'details' => [ |
| 283 | - 's1Title' => Loader::$labels['about_us']['otter-page']['details']['s1Title'], | |
| 284 | - 's1Text' => Loader::$labels['about_us']['otter-page']['details']['s1Text'], | |
| 285 | - 's2Title' => Loader::$labels['about_us']['otter-page']['details']['s2Title'], | |
| 286 | - 's2Text' => Loader::$labels['about_us']['otter-page']['details']['s2Text'], | |
| 287 | - 's3Title' => Loader::$labels['about_us']['otter-page']['details']['s3Title'], | |
| 288 | - 's3Text' => Loader::$labels['about_us']['otter-page']['details']['s3Text'], | |
| 289 | 252 | 's1Image' => $this->get_sdk_uri() . 'assets/images/otter/otter-builder.png', |
| 253 | + 's1Title' => __( 'A Better Page Building Experience', 'textdomain' ), | |
| 254 | + '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.', 'textdomain' ), | |
| 290 | 255 | 's2Image' => $this->get_sdk_uri() . 'assets/images/otter/otter-patterns.png', |
| 256 | + 's2Title' => __( 'A New Collection of Patterns', 'textdomain' ), | |
| 257 | + '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.', 'textdomain' ), | |
| 291 | 258 | 's3Image' => $this->get_sdk_uri() . 'assets/images/otter/otter-library.png', |
| 259 | + 's3Title' => __( 'Advanced Blocks', 'textdomain' ), | |
| 260 | + 's3Text' => __( 'Enhance your website’s design with powerful blocks, like the Add to Cart, Business Hours, Review Comparison, and dozens of WooCommerce blocks.', 'textdomain' ), | |
| 292 | 261 | ], |
| 293 | 262 | 'testimonials' => [ |
| 294 | - 'heading' => Loader::$labels['about_us']['otter-page']['testimonials']['heading'], | |
| 263 | + 'heading' => __( 'Trusted by more than 300K website owners', 'textdomain' ), | |
| 295 | 264 | 'users' => [ |
| 296 | 265 | [ |
| 297 | 266 | 'avatar' => 'https://mllj2j8xvfl0.i.optimole.com/cb:3970~373ad/w:80/h:80/q:mauto/https://themeisle.com/wp-content/uploads/2021/05/avatar-03.png', |
| 298 | 267 | 'name' => 'Michael Burry', |
| 299 | - 'text' => Loader::$labels['about_us']['otter-page']['testimonials']['users']['user_1'], | |
| 268 | + 'text' => 'Loved the collection of blocks. If you want to create nice Gutenberg Pages, this plugin will be very handy and useful.', | |
| 300 | 269 | ], |
| 301 | 270 | [ |
| 302 | 271 | 'avatar' => 'https://mllj2j8xvfl0.i.optimole.com/cb:3970~373ad/w:80/h:80/q:mauto/https://themeisle.com/wp-content/uploads/2022/04/avatar-04.png', |
| 303 | 272 | 'name' => 'Maria Gonzales', |
| 304 | - 'text' => Loader::$labels['about_us']['otter-page']['testimonials']['users']['user_2'], | |
| 273 | + 'text' => '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. ', | |
| 305 | 274 | ], |
| 306 | 275 | [ |
| 307 | 276 | 'avatar' => 'https://mllj2j8xvfl0.i.optimole.com/cb:3970~373ad/w:80/h:80/q:mauto/https://themeisle.com/wp-content/uploads/2022/04/avatar-05.png', |
| 308 | 277 | 'name' => 'Florian Henckel', |
| 309 | - 'text' => Loader::$labels['about_us']['otter-page']['testimonials']['users']['user_3'], | |
| 278 | + 'text' => '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.', | |
| 310 | 279 | ], |
| 311 | 280 | ], |
| 312 | 281 | ], |
| 313 | 282 | ], |
| @@ -333,24 +302,21 @@ | ||
| 333 | 302 | private function get_other_products_data() { |
| 334 | 303 | $products = [ |
| 335 | 304 | 'optimole-wp' => [ |
| 336 | 305 | 'name' => 'Optimole', |
| 337 | - 'description' => Loader::$labels['about_us']['others']['optimole_desc'], | |
| 306 | + 'description' => '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.', | |
| 338 | 307 | ], |
| 339 | 308 | 'neve' => [ |
| 340 | 309 | 'skip_api' => true, |
| 341 | 310 | 'name' => 'Neve', |
| 342 | - 'description' => Loader::$labels['about_us']['others']['neve_desc'], | |
| 311 | + 'description' => __( 'A fast, lightweight, customizable WordPress theme offering responsive design, speed, and flexibility for various website types.', 'textdomain' ), | |
| 343 | 312 | 'icon' => $this->get_sdk_uri() . 'assets/images/neve.png', |
| 344 | 313 | ], |
| 345 | - 'learning-management-system' => [ | |
| 346 | - 'name' => 'Masteriyo LMS', | |
| 347 | - ], | |
| 348 | 314 | 'otter-blocks' => [ |
| 349 | 315 | 'name' => 'Otter', |
| 350 | 316 | ], |
| 351 | 317 | 'tweet-old-post' => [ |
| 352 | - 'name' => 'Revive Social', | |
| 318 | + 'name' => 'Revive Old Post', | |
| 353 | 319 | ], |
| 354 | 320 | 'feedzy-rss-feeds' => [ |
| 355 | 321 | 'name' => 'Feedzy', |
| 356 | 322 | ], |
| @@ -364,9 +330,9 @@ | ||
| 364 | 330 | 'wp-landing-kit' => [ |
| 365 | 331 | 'skip_api' => true, |
| 366 | 332 | 'premiumUrl' => tsdk_utmify( 'https://themeisle.com/plugins/wp-landing-kit', $this->get_about_page_slug() ), |
| 367 | 333 | 'name' => 'WP Landing Kit', |
| 368 | - 'description' => Loader::$labels['about_us']['others']['landingkit_desc'], | |
| 334 | + 'description' => __( 'Turn WordPress into a landing page powerhouse with Landing Kit, map domains to pages or any other published resource.', 'textdomain' ), | |
| 369 | 335 | 'icon' => $this->get_sdk_uri() . 'assets/images/wplk.png', |
| 370 | 336 | ], |
| 371 | 337 | 'multiple-pages-generator-by-porthas' => [ |
| 372 | 338 | 'name' => 'MPG', |
| @@ -374,25 +340,16 @@ | ||
| 374 | 340 | 'sparks-for-woocommerce' => [ |
| 375 | 341 | 'skip_api' => true, |
| 376 | 342 | 'premiumUrl' => tsdk_utmify( 'https://themeisle.com/plugins/sparks-for-woocommerce', $this->get_about_page_slug() ), |
| 377 | 343 | 'name' => 'Sparks', |
| 378 | - 'description' => Loader::$labels['about_us']['others']['sparks_desc'], | |
| 344 | + 'description' => __( 'Extend your store functionality with 8 ultra-performant features like product comparisons, variation swatches, wishlist, and more.', 'textdomain' ), | |
| 379 | 345 | 'icon' => $this->get_sdk_uri() . 'assets/images/sparks.png', |
| 380 | 346 | 'condition' => class_exists( 'WooCommerce', false ), |
| 381 | 347 | ], |
| 382 | 348 | 'templates-patterns-collection' => [ |
| 383 | 349 | 'name' => 'Templates Cloud', |
| 384 | - 'description' => Loader::$labels['about_us']['others']['tpc_desc'], | |
| 350 | + 'description' => __( 'Design, save, and revisit your templates anytime with your personal vault on Templates Cloud.', 'textdomain' ), | |
| 385 | 351 | ], |
| 386 | - 'wp-cloudflare-page-cache' => [ | |
| 387 | - 'name' => 'Super Page Cache', | |
| 388 | - ], | |
| 389 | - 'hyve-lite' => [ | |
| 390 | - 'name' => 'Hyve Lite', | |
| 391 | - ], | |
| 392 | - 'wp-full-stripe-free' => [ | |
| 393 | - 'name' => 'WP Full Pay', | |
| 394 | - ], | |
| 395 | 352 | ]; |
| 396 | 353 | |
| 397 | 354 | foreach ( $products as $slug => $product ) { |
| 398 | 355 | if ( isset( $product['condition'] ) && ! $product['condition'] ) { |
| @@ -428,15 +385,16 @@ | ||
| 428 | 385 | continue; |
| 429 | 386 | } |
| 430 | 387 | |
| 431 | 388 | $api_data = $this->call_plugin_api( $slug ); |
| 432 | - if ( ! isset( $product['icon'] ) && ( isset( $api_data->icons['2x'] ) || $api_data->icons['1x'] ) ) { | |
| 389 | + | |
| 390 | + if ( ! isset( $product['icon'] ) ) { | |
| 433 | 391 | $products[ $slug ]['icon'] = isset( $api_data->icons['2x'] ) ? $api_data->icons['2x'] : $api_data->icons['1x']; |
| 434 | 392 | } |
| 435 | - if ( ! isset( $product['description'] ) && isset( $api_data->short_description ) ) { | |
| 393 | + if ( ! isset( $product['description'] ) ) { | |
| 436 | 394 | $products[ $slug ]['description'] = $api_data->short_description; |
| 437 | 395 | } |
| 438 | - if ( ! isset( $product['name'] ) && isset( $api_data->name ) ) { | |
| 396 | + if ( ! isset( $product['name'] ) ) { | |
| 439 | 397 | $products[ $slug ]['name'] = $api_data->name; |
| 440 | 398 | } |
| 441 | 399 | } |
| 442 | 400 | |