PluginProbe ʕ •ᴥ•ʔ
Blocks Animation: CSS Animations for Gutenberg Blocks / 3.2.0
Blocks Animation: CSS Animations for Gutenberg Blocks v3.2.0
3.2.0 3.1.11 3.1.10 2.2.5 2.2.6 2.2.7 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.6.10 2.6.11 2.6.12 2.6.13 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 trunk 1.0.0 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4
blocks-animation / vendor / codeinwp / themeisle-sdk / src / Modules / Review.php
blocks-animation / vendor / codeinwp / themeisle-sdk / src / Modules Last commit date
About_us.php 1 week ago Abstract_Migration.php 1 month ago Announcements.php 1 month ago Compatibilities.php 1 year ago Dashboard_widget.php 1 week ago Featured_plugins.php 1 month ago Float_widget.php 1 year ago Licenser.php 1 month ago Logger.php 8 months ago Migrator.php 1 month ago Notification.php 1 year ago Promotions.php 1 week ago Recommendation.php 1 year ago Review.php 8 months ago Rollback.php 1 year ago Script_loader.php 8 months ago Translate.php 1 year ago Translations.php 8 months ago Uninstall_feedback.php 1 week ago Welcome.php 1 year ago
Review.php
113 lines
1 <?php
2 /**
3 * The Review model class for ThemeIsle SDK
4 *
5 * @package ThemeIsleSDK
6 * @subpackage Modules
7 * @copyright Copyright (c) 2017, Marius Cristea
8 * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9 * @since 1.0.0
10 */
11
12 namespace ThemeisleSDK\Modules;
13
14 use ThemeisleSDK\Common\Abstract_Module;
15 use ThemeisleSDK\Loader;
16 use ThemeisleSDK\Product;
17
18 // Exit if accessed directly.
19 if ( ! defined( 'ABSPATH' ) ) {
20 exit;
21 }
22
23 /**
24 * Review module for ThemeIsle SDK.
25 */
26 class Review extends Abstract_Module {
27
28 /**
29 * Check if we should load module for this.
30 *
31 * @param Product $product Product to check.
32 *
33 * @return bool Should load ?
34 */
35 public function can_load( $product ) {
36 if ( $this->is_from_partner( $product ) ) {
37 return false;
38 }
39 if ( ! $product->is_wordpress_available() ) {
40 return false;
41 }
42
43 return apply_filters( $product->get_slug() . '_sdk_should_review', true );
44 }
45
46
47 /**
48 * Add notification to queue.
49 *
50 * @param array $all_notifications Previous notification.
51 *
52 * @return array All notifications.
53 */
54 public function add_notification( $all_notifications ) {
55
56 $developers = [
57 'Marius',
58 'Hardeep',
59 'Andrei',
60 'Robert',
61 ];
62
63 $link = 'https://wordpress.org/support/' . $this->product->get_type() . '/' . $this->product->get_slug() . '/reviews/#wporg-footer';
64
65 $message = apply_filters( $this->product->get_key() . '_feedback_review_message', Loader::$labels['review']['notice'] );
66
67 $button_submit = apply_filters( $this->product->get_key() . '_feedback_review_button_do', Loader::$labels['review']['ctay'] );
68 $button_cancel = apply_filters( $this->product->get_key() . '_feedback_review_button_cancel', Loader::$labels['review']['ctan'] );
69 $message = str_replace(
70 [ '{product}', '{developer}' ],
71 [
72 $this->product->get_friendly_name(),
73 $developers[ strlen( get_site_url() ) % count( $developers ) ],
74 ],
75 $message
76 );
77
78 $all_notifications[] = [
79 'id' => $this->product->get_key() . '_review_flag',
80 'message' => $message,
81 'ctas' => [
82 'confirm' => [
83 'link' => $link,
84 'text' => $button_submit,
85 ],
86 'cancel' => [
87 'link' => '#',
88 'text' => $button_cancel,
89 ],
90 ],
91 ];
92
93 return $all_notifications;
94 }
95
96
97 /**
98 * Load module logic.
99 *
100 * @param Product $product Product to load.
101 *
102 * @return Review Module instance.
103 */
104 public function load( $product ) {
105
106 $this->product = $product;
107
108 add_filter( 'themeisle_sdk_registered_notifications', [ $this, 'add_notification' ] );
109
110 return $this;
111 }
112 }
113