YITH Essential Kit for WooCommerce #1 - Version 1.0.8

Version Description

  • Updated: All YITH plugins to latest version
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH Essential Kit for WooCommerce #1
Version 1.0.8
Comparing to
See all releases

Code changes from version 1.0.7 to 1.0.8

Files changed (61) hide show
  1. README.txt +6 -2
  2. init.php +1 -1
  3. languages/yith-jetpack.pot +41 -43
  4. modules/yith-woocommerce-advanced-reviews/class.yith-woocommerce-advanced-reviews.php +1639 -1637
  5. modules/yith-woocommerce-advanced-reviews/init.php +2 -2
  6. modules/yith-woocommerce-ajax-navigation/assets/css/admin.css +6 -1
  7. modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-admin.js +2 -16
  8. modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-admin.php +0 -28
  9. modules/yith-woocommerce-ajax-navigation/init.php +2 -2
  10. modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-it_IT.mo +0 -0
  11. modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-it_IT.po +37 -37
  12. modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-tr_TR.mo +0 -0
  13. modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-tr_TR.po +34 -29
  14. modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav.pot +12 -12
  15. modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php +3 -3
  16. modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-reset-navigation-widget.php +1 -1
  17. modules/yith-woocommerce-catalog-mode/class.yith-woocommerce-catalog-mode.php +8 -1
  18. modules/yith-woocommerce-catalog-mode/init.php +4 -4
  19. modules/yith-woocommerce-catalog-mode/plugin-options/settings-options.php +1 -1
  20. modules/yith-woocommerce-colors-labels-variations/assets/js/frontend.js +2 -0
  21. modules/yith-woocommerce-colors-labels-variations/assets/js/frontend.min.js +1 -1
  22. modules/yith-woocommerce-colors-labels-variations/changelog.txt +6 -0
  23. modules/yith-woocommerce-colors-labels-variations/class.yith-wccl-frontend.php +36 -0
  24. modules/yith-woocommerce-colors-labels-variations/init.php +3 -3
  25. modules/yith-woocommerce-colors-labels-variations/templates/single-product/add-to-cart/variable-wccl.php +12 -1
  26. modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-admin.php +10 -40
  27. modules/yith-woocommerce-product-vendors/init.php +2 -2
  28. modules/yith-woocommerce-quick-view/init.php +3 -3
  29. modules/yith-woocommerce-quick-view/templates/yith-quick-view-content.php +2 -2
  30. modules/yith-woocommerce-review-reminder/class.yith-woocommerce-review-reminder.php +26 -69
  31. modules/yith-woocommerce-review-reminder/includes/admin/class-yith-custom-table.php +48 -28
  32. modules/yith-woocommerce-review-reminder/init.php +86 -6
  33. modules/yith-woocommerce-review-reminder/plugin-options/mail-options.php +8 -13
  34. modules/yith-woocommerce-review-reminder/templates/admin/premium.php +52 -25
  35. modules/yith-woocommerce-zoom-magnifier/assets/css/frontend.css +6 -0
  36. modules/yith-woocommerce-zoom-magnifier/assets/images/yith-woocommerce-zoom-magnifier-video.jpg +0 -0
  37. modules/yith-woocommerce-zoom-magnifier/assets/js/frontend.js +1 -1
  38. modules/yith-woocommerce-zoom-magnifier/assets/js/yith_magnifier.js +16 -11
  39. modules/yith-woocommerce-zoom-magnifier/assets/js/yith_magnifier.min.js +1 -1
  40. modules/yith-woocommerce-zoom-magnifier/class.yith-wcmg-admin.php +163 -165
  41. modules/yith-woocommerce-zoom-magnifier/class.yith-wcmg-frontend.php +145 -146
  42. modules/yith-woocommerce-zoom-magnifier/class.yith-wcmg.php +1 -1
  43. modules/yith-woocommerce-zoom-magnifier/functions.yith-wcmg.php +56 -45
  44. modules/yith-woocommerce-zoom-magnifier/init.php +3 -3
  45. modules/yith-woocommerce-zoom-magnifier/languages/ywzm-it_IT.mo +0 -0
  46. modules/yith-woocommerce-zoom-magnifier/languages/ywzm-it_IT.po +167 -88
  47. modules/yith-woocommerce-zoom-magnifier/languages/ywzm.pot +70 -64
  48. modules/yith-woocommerce-zoom-magnifier/lib/class.yith-woocommerce-zoom-magnifier.php +1 -1
  49. modules/yith-woocommerce-zoom-magnifier/lib/class.yith-ywzm-custom-types.php +177 -207
  50. modules/yith-woocommerce-zoom-magnifier/lib/class.yith-ywzm-plugin-fw-loader.php +1 -1
  51. modules/yith-woocommerce-zoom-magnifier/plugin-options/general-options.php +50 -49
  52. modules/yith-woocommerce-zoom-magnifier/templates/admin/premium.php +13 -15
  53. modules/yith-woocommerce-zoom-magnifier/templates/single-product/product-thumbnails-magnifier.php +4 -0
  54. modules/yith-woocommerce-zoom-magnifier/yit-common/yith-panel.php +3 -9
  55. plugin-fw/assets/js/yit-cpt-unlimited.js +1 -1
  56. plugin-fw/assets/js/yit-cpt-unlimited.min.js +1 -1
  57. plugin-fw/lib/yit-cpt-unlimited.php +1 -1
  58. plugin-fw/lib/yit-video.php +12 -4
  59. plugin-fw/yit-functions.php +5 -0
  60. templates/yith-single-plugin.php +1 -1
  61. yith-jetpack.php +130 -11
README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce,jetpack,woocommerce jetpack, essential, kit, plugins, plugin, product, e-commerce, ecommerce, commerce, shop, yith, yit, yithemes,yith woocommerce colors and labels variations, colors and labels variations,colors and labels variations jetpack,yith woocommerce zoom magnifier,zoom magnifier,zoom magnifier jetpack,yith woocommerce wishlist,wishlist,wishlist jetpack,yith woocommerce compare,compare,compare jetpack,yith woocommerce ajax product filter,ajax product filter,ajax product filter jetpack,yith woocommerce ajax search,ajax search,ajax search jetpack,yith woocommerce catalog mode,catalog mode,catalog mode jetpack,yith woocommerce order tracking,order tracking,order tracking jetpack, yith woocommerce advanced reviews,advanced reviews,advanced reviews jetpack,yith woocommerce badges management,badges management,badges management jetpack,yith woocommerce cart messages,cart messages,cart messages jetpack,yith woocommerce review reminder,review reminder,review reminder jetpack,yith woocommerce quick view,quick view,quick view jetpack,yith live chat,live chat,live chat jetpack,yith woocommerce eu vat,eu vat,eu vat jetpack,yith woocommerce mailchimp,mailchimp,mailchimp jetpack,yith woocommerce stripe,stripe, stripe jetpack,yith infinite scrolling,infinite scrolling,infinite scrolling jetpack,yith woocommerce request a quote,request a quote,request a quote jetpack,yith woocommerce waiting list,waiting list,waiting list jetpack,yith woocommerce tab manager,tab manager,tab manager jetpack,yith woocommerce multi vendor,multi vendor,multi vendor jetpack,product vendor,products vendor,products vendor jetpack, booster for woocommerce
5
  Requires at least: 3.5.1
6
  Tested up to: 4.2.4
7
- Stable tag: 1.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -150,6 +150,10 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
150
 
151
  == Changelog ==
152
 
 
 
 
 
153
  = 1.0.7 =
154
 
155
  * Updated: YITH WooCommerce Badge Mangement
@@ -187,5 +191,5 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
187
 
188
  == Upgrade Notice ==
189
 
190
- Last Stable Tag 1.0.7
191
 
4
  Tags: woocommerce,jetpack,woocommerce jetpack, essential, kit, plugins, plugin, product, e-commerce, ecommerce, commerce, shop, yith, yit, yithemes,yith woocommerce colors and labels variations, colors and labels variations,colors and labels variations jetpack,yith woocommerce zoom magnifier,zoom magnifier,zoom magnifier jetpack,yith woocommerce wishlist,wishlist,wishlist jetpack,yith woocommerce compare,compare,compare jetpack,yith woocommerce ajax product filter,ajax product filter,ajax product filter jetpack,yith woocommerce ajax search,ajax search,ajax search jetpack,yith woocommerce catalog mode,catalog mode,catalog mode jetpack,yith woocommerce order tracking,order tracking,order tracking jetpack, yith woocommerce advanced reviews,advanced reviews,advanced reviews jetpack,yith woocommerce badges management,badges management,badges management jetpack,yith woocommerce cart messages,cart messages,cart messages jetpack,yith woocommerce review reminder,review reminder,review reminder jetpack,yith woocommerce quick view,quick view,quick view jetpack,yith live chat,live chat,live chat jetpack,yith woocommerce eu vat,eu vat,eu vat jetpack,yith woocommerce mailchimp,mailchimp,mailchimp jetpack,yith woocommerce stripe,stripe, stripe jetpack,yith infinite scrolling,infinite scrolling,infinite scrolling jetpack,yith woocommerce request a quote,request a quote,request a quote jetpack,yith woocommerce waiting list,waiting list,waiting list jetpack,yith woocommerce tab manager,tab manager,tab manager jetpack,yith woocommerce multi vendor,multi vendor,multi vendor jetpack,product vendor,products vendor,products vendor jetpack, booster for woocommerce
5
  Requires at least: 3.5.1
6
  Tested up to: 4.2.4
7
+ Stable tag: 1.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
150
 
151
  == Changelog ==
152
 
153
+ = 1.0.8 =
154
+
155
+ * Updated: All YITH plugins to latest version
156
+
157
  = 1.0.7 =
158
 
159
  * Updated: YITH WooCommerce Badge Mangement
191
 
192
  == Upgrade Notice ==
193
 
194
+ Last Stable Tag 1.0.8
195
 
init.php CHANGED
@@ -7,7 +7,7 @@ Text Domain: yith-jetpack
7
  Domain Path: /languages/
8
  Author: YIThemes
9
  Author URI: http://yithemes.com/
10
- Version: 1.0.7
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
7
  Domain Path: /languages/
8
  Author: YIThemes
9
  Author URI: http://yithemes.com/
10
+ Version: 1.0.8
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
languages/yith-jetpack.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YIT Framework\n"
4
- "POT-Creation-Date: 2015-08-07 11:18+0100\n"
5
- "PO-Revision-Date: 2015-08-11 14:05+0100\n"
6
  "Last-Translator: Giustino Borzacchiello <giustinob@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: en\n"
@@ -19,159 +19,157 @@ msgstr ""
19
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
20
  "X-Poedit-SearchPathExcluded-1: modules\n"
21
 
22
- #: templates/yith-list-plugins.php:27
23
  msgid "Module <strong>activated</strong>."
24
  msgstr ""
25
 
26
- #: templates/yith-list-plugins.php:30
27
- msgid "Module <strong>deactivated</strong>."
28
- msgstr ""
29
-
30
  #: templates/yith-list-plugins.php:34
31
- msgid "Modules <strong>activated</strong>."
32
  msgstr ""
33
 
34
  #: templates/yith-list-plugins.php:38
35
- msgid "Modules <strong>deactivated</strong>."
36
  msgstr ""
37
 
38
  #: templates/yith-list-plugins.php:42
39
- msgid "YITH WooCommerce JetPack 1"
40
  msgstr ""
41
 
42
- #: templates/yith-list-plugins.php:44
43
  msgid ""
44
  "Here you can activate or deactive some of our plugins to enhance your e-"
45
  "commerce site."
46
  msgstr ""
47
 
48
- #: templates/yith-list-plugins.php:49
 
49
  msgid "Activate all"
50
- msgstr ""
51
 
52
- #: templates/yith-list-plugins.php:50
53
  msgid "Deactivate all"
54
  msgstr ""
55
 
56
- #: templates/yith-list-plugins.php:59
57
  msgid "All"
58
  msgstr ""
59
 
60
- #: templates/yith-list-plugins.php:60
61
  msgid "Active"
62
  msgstr ""
63
 
64
- #: templates/yith-list-plugins.php:61
65
  msgid "Inactive"
66
  msgstr ""
67
 
68
- #: templates/yith-single-plugin.php:50
69
  #, fuzzy, php-format
70
  msgid "By %s"
71
  msgstr ""
72
  "Note: Delivery and taxes are estimated%s and will be updated during checkout "
73
  "based on your billing and shipping information."
74
 
75
- #: templates/yith-single-plugin.php:55
76
  #, php-format
77
  msgid "Deactivate %s now"
78
  msgstr ""
79
 
80
- #: templates/yith-single-plugin.php:55
81
  msgid "Deactivate"
82
  msgstr ""
83
 
84
- #: templates/yith-single-plugin.php:67
85
  #, php-format
86
  msgid "activate %s now"
87
  msgstr ""
88
 
89
- #: templates/yith-single-plugin.php:67
 
90
  msgid "Activate"
91
- msgstr ""
92
 
93
- #: templates/yith-single-plugin.php:74
94
  #, php-format
95
  msgid "More information about %s"
96
  msgstr ""
97
 
98
- #: templates/yith-single-plugin.php:74
99
  msgid "More Details"
100
  msgstr ""
101
 
102
- #: templates/yith-single-plugin.php:80
103
  msgid "Premium Installed"
104
  msgstr ""
105
 
106
- #: templates/yith-single-plugin.php:84
107
  msgid "Premium Version"
108
  msgstr ""
109
 
110
- #: templates/yith-single-plugin.php:88
111
  #, php-format
112
  msgid "Premium Version of %s"
113
  msgstr ""
114
 
115
- #: templates/yith-single-plugin.php:91
116
  msgid "M j, Y @ H:i"
117
  msgstr ""
118
 
119
- #: templates/yith-single-plugin.php:126
120
  msgid "Last Updated:"
121
  msgstr ""
122
 
123
- #: templates/yith-single-plugin.php:127
124
  #, php-format
125
  msgid "%s ago"
126
  msgstr ""
127
 
128
- #: templates/yith-single-plugin.php:138
129
  msgctxt "Active plugin installs"
130
  msgid "1+ Million"
131
  msgstr ""
132
 
133
- #: templates/yith-single-plugin.php:145
134
  msgctxt "Downloaded"
135
  msgid "1+ Million"
136
  msgstr ""
137
 
138
- #: templates/yith-single-plugin.php:150
139
  #, php-format
140
  msgid "%s Download, %s Active Installs"
141
  msgstr ""
142
 
143
- #: yith-jetpack.php:86
144
  msgid "Plugins List"
145
  msgstr ""
146
 
147
- #: yith-jetpack.php:392
148
  msgid "YIT Plugins"
149
  msgstr ""
150
 
151
- #: yith-jetpack.php:425
152
  #, php-format
153
  msgid ""
154
  "There are new plugins available on <b>%s</b>, <a href=\"%s\">take a look at "
155
  "them</a> !"
156
  msgstr ""
157
 
158
- #: yith-jetpack.php:475 yith-jetpack.php:507
159
  msgid "The module is not valid."
160
  msgstr ""
161
 
162
- #: yith-jetpack.php:475 yith-jetpack.php:480 yith-jetpack.php:484
163
- #: yith-jetpack.php:507 yith-jetpack.php:512 yith-jetpack.php:516
164
  msgid "Back to modules"
165
  msgstr ""
166
 
167
- #: yith-jetpack.php:480
168
  msgid "The module is already activated."
169
  msgstr ""
170
 
171
- #: yith-jetpack.php:484 yith-jetpack.php:516
172
  msgid "Activation of the module is not possible."
173
  msgstr ""
174
 
175
- #: yith-jetpack.php:512
176
  msgid "The module is already deactivated."
177
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YIT Framework\n"
4
+ "POT-Creation-Date: 2015-09-09 10:27+0100\n"
5
+ "PO-Revision-Date: 2015-09-09 10:27+0100\n"
6
  "Last-Translator: Giustino Borzacchiello <giustinob@gmail.com>\n"
7
  "Language-Team: \n"
8
  "Language: en\n"
19
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
20
  "X-Poedit-SearchPathExcluded-1: modules\n"
21
 
22
+ #: templates/yith-list-plugins.php:31
23
  msgid "Module <strong>activated</strong>."
24
  msgstr ""
25
 
 
 
 
 
26
  #: templates/yith-list-plugins.php:34
27
+ msgid "Module <strong>deactivated</strong>."
28
  msgstr ""
29
 
30
  #: templates/yith-list-plugins.php:38
31
+ msgid "Modules <strong>activated</strong>."
32
  msgstr ""
33
 
34
  #: templates/yith-list-plugins.php:42
35
+ msgid "Modules <strong>deactivated</strong>."
36
  msgstr ""
37
 
38
+ #: templates/yith-list-plugins.php:48
39
  msgid ""
40
  "Here you can activate or deactive some of our plugins to enhance your e-"
41
  "commerce site."
42
  msgstr ""
43
 
44
+ #: templates/yith-list-plugins.php:53
45
+ #, fuzzy
46
  msgid "Activate all"
47
+ msgstr "TUTTI PARI PARI"
48
 
49
+ #: templates/yith-list-plugins.php:54
50
  msgid "Deactivate all"
51
  msgstr ""
52
 
53
+ #: templates/yith-list-plugins.php:63
54
  msgid "All"
55
  msgstr ""
56
 
57
+ #: templates/yith-list-plugins.php:64
58
  msgid "Active"
59
  msgstr ""
60
 
61
+ #: templates/yith-list-plugins.php:65
62
  msgid "Inactive"
63
  msgstr ""
64
 
65
+ #: templates/yith-single-plugin.php:54
66
  #, fuzzy, php-format
67
  msgid "By %s"
68
  msgstr ""
69
  "Note: Delivery and taxes are estimated%s and will be updated during checkout "
70
  "based on your billing and shipping information."
71
 
72
+ #: templates/yith-single-plugin.php:59
73
  #, php-format
74
  msgid "Deactivate %s now"
75
  msgstr ""
76
 
77
+ #: templates/yith-single-plugin.php:59
78
  msgid "Deactivate"
79
  msgstr ""
80
 
81
+ #: templates/yith-single-plugin.php:71
82
  #, php-format
83
  msgid "activate %s now"
84
  msgstr ""
85
 
86
+ #: templates/yith-single-plugin.php:71
87
+ #, fuzzy
88
  msgid "Activate"
89
+ msgstr "TUTTI PARI PARI"
90
 
91
+ #: templates/yith-single-plugin.php:78
92
  #, php-format
93
  msgid "More information about %s"
94
  msgstr ""
95
 
96
+ #: templates/yith-single-plugin.php:78
97
  msgid "More Details"
98
  msgstr ""
99
 
100
+ #: templates/yith-single-plugin.php:84
101
  msgid "Premium Installed"
102
  msgstr ""
103
 
104
+ #: templates/yith-single-plugin.php:88
105
  msgid "Premium Version"
106
  msgstr ""
107
 
108
+ #: templates/yith-single-plugin.php:92
109
  #, php-format
110
  msgid "Premium Version of %s"
111
  msgstr ""
112
 
113
+ #: templates/yith-single-plugin.php:95
114
  msgid "M j, Y @ H:i"
115
  msgstr ""
116
 
117
+ #: templates/yith-single-plugin.php:130
118
  msgid "Last Updated:"
119
  msgstr ""
120
 
121
+ #: templates/yith-single-plugin.php:131
122
  #, php-format
123
  msgid "%s ago"
124
  msgstr ""
125
 
126
+ #: templates/yith-single-plugin.php:142
127
  msgctxt "Active plugin installs"
128
  msgid "1+ Million"
129
  msgstr ""
130
 
131
+ #: templates/yith-single-plugin.php:149
132
  msgctxt "Downloaded"
133
  msgid "1+ Million"
134
  msgstr ""
135
 
136
+ #: templates/yith-single-plugin.php:154
137
  #, php-format
138
  msgid "%s Download, %s Active Installs"
139
  msgstr ""
140
 
141
+ #: yith-jetpack.php:100
142
  msgid "Plugins List"
143
  msgstr ""
144
 
145
+ #: yith-jetpack.php:405
146
  msgid "YIT Plugins"
147
  msgstr ""
148
 
149
+ #: yith-jetpack.php:438
150
  #, php-format
151
  msgid ""
152
  "There are new plugins available on <b>%s</b>, <a href=\"%s\">take a look at "
153
  "them</a> !"
154
  msgstr ""
155
 
156
+ #: yith-jetpack.php:488 yith-jetpack.php:520
157
  msgid "The module is not valid."
158
  msgstr ""
159
 
160
+ #: yith-jetpack.php:488 yith-jetpack.php:493 yith-jetpack.php:497
161
+ #: yith-jetpack.php:520 yith-jetpack.php:525 yith-jetpack.php:529
162
  msgid "Back to modules"
163
  msgstr ""
164
 
165
+ #: yith-jetpack.php:493
166
  msgid "The module is already activated."
167
  msgstr ""
168
 
169
+ #: yith-jetpack.php:497 yith-jetpack.php:529
170
  msgid "Activation of the module is not possible."
171
  msgstr ""
172
 
173
+ #: yith-jetpack.php:525
174
  msgid "The module is already deactivated."
175
  msgstr ""
modules/yith-woocommerce-advanced-reviews/class.yith-woocommerce-advanced-reviews.php CHANGED
@@ -1,1734 +1,1736 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit; // Exit if accessed directly
4
  }
5
 
6
- if ( ! class_exists( 'YITH_WooCommerce_Advanced_Reviews' ) ) {
7
-
8
- /**
9
- * Implements features of FREE version of YWAR plugin
10
- *
11
- * @class YITH_WooCommerce_Advanced_Reviews
12
- * @package Yithemes
13
- * @since 1.0.0
14
- * @author Your Inspiration Themes
15
- */
16
- class YITH_WooCommerce_Advanced_Reviews {
17
- /**
18
- * @var $_panel Panel Object
19
- */
20
- protected $_panel;
21
-
22
- /**
23
- * @var $_premium string Premium tab template file name
24
- */
25
- protected $_premium = 'premium.php';
26
-
27
- /**
28
- * @var string Premium version landing link
29
- */
30
- protected $_premium_landing = 'http://yithemes.com/themes/plugins/yith-woocommerce-advanced-reviews/';
31
-
32
- /**
33
- * @var string Plugin official documentation
34
- */
35
- protected $_official_documentation = 'http://yithemes.com/docs-plugins/yith-woocommerce-advanced-reviews/';
36
-
37
- /**
38
- * @var string Advanced Reviews panel page
39
- */
40
- protected $_panel_page = 'yith_ywar_panel';
41
-
42
- /**
43
- * @var $enable_title Let users to add a title when writing a review
44
- */
45
- protected $enable_title = 0;
46
-
47
- /**
48
- * @var $enable_attachments Let users to add attachments when submit a review
49
- */
50
- protected $enable_attachments = 0;
51
-
52
- /**
53
- * @var $attachments_limit Set the maximum number of attachments a users can add when submit a review
54
- */
55
- protected $attachments_limit = 0;
56
-
57
- public $post_type_name = "ywar_reviews";
58
-
59
- public $items_for_page = 10;
60
-
61
- public $meta_key_rating = "_ywar_rating";
62
- public $meta_key_product_id = "_ywar_product_id";
63
- public $meta_key_imported = "_ywar_imported";
64
- public $meta_key_approved = "_ywar_approved";
65
- public $meta_key_thumb_ids = "_ywar_thumb_ids";
66
- public $meta_key_comment_id = "_ywar_comment_id";
67
-
68
- /**
69
- * @var string meta_key used for saving data about segnalation of inappropriate content from users
70
- */
71
- public $meta_key_inappropriate_list = "_ywar_inappropriate_list";
72
-
73
- /**
74
- * @var string meta_key used for saving data about inappropriate reviews
75
- */
76
- public $meta_key_inappropriate_count = "_ywar_inappropriate_count";
77
-
78
- /**
79
- * @var string meta_key used for saving data about inappropriate reviews
80
- */
81
- public $meta_key_featured = "_ywar_featured";
82
-
83
- /**
84
- * @var string meta_key used for saving data about upvotes
85
- */
86
- public $meta_key_upvotes_count = "_ywar_upvotes_count";
87
-
88
- /**
89
- * @var string meta_key used for saving data about downvotes
90
- */
91
- public $meta_key_downvotes_count = "_ywar_downvotes_count";
92
-
93
- /**
94
- * @var string meta_key used for saving data about reviews votes
95
- */
96
- public $meta_key_votes = "_ywar_votes";
97
-
98
- /**
99
- * @var string meta_key used for saving data about replies status
100
- */
101
- public $meta_key_stop_reply = "_ywar_stop_reply";
102
-
103
- /**
104
- * @var string meta_key used for saving review's user id
105
- */
106
- public $meta_key_review_user_id = "_ywar_review_user_id";
107
-
108
- /**
109
- * @var string meta_key used for saving review's author
110
- */
111
- public $meta_key_review_author = "_ywar_review_author";
112
-
113
- /**
114
- * @var string meta_key used for saving review author's email
115
- */
116
- public $meta_key_review_author_email = "_ywar_review_author_email";
117
-
118
- /**
119
- * @var string meta_key used for saving review author's url
120
- */
121
- public $meta_key_review_author_url = "_ywar_review_author_url";
122
-
123
- /**
124
- * @var string meta_key used for saving review author's IP
125
- */
126
- public $meta_key_review_author_IP = "_ywar_review_author_IP";
127
-
128
- public $custom_column_review = "review-text";
129
 
130
- public $custom_column_rating = "review-rating";
131
 
132
- public $custom_column_date = "review-date";
133
 
134
- public $custom_column_author = "review-author";
135
 
136
- public $custom_column_product = "product";
137
 
138
- /**
139
- * @var string action name for "approve" review
140
- */
141
- protected $approve_review_action = "approve-review";
142
 
143
- /**
144
- * @var string action name for "untrash" review
145
- */
146
- protected $untrash_review_action = "untrash";
147
 
148
- /**
149
- * @var string action name for "unapprove" review
150
- */
151
- protected $unapprove_review_action = "unapprove-review";
152
 
153
- /**
154
- * Single instance of the class
155
- *
156
- * @since 1.0.0
157
- */
158
- protected static $instance;
159
 
160
- /**
161
- * Returns single instance of the class
162
- *
163
- * @since 1.0.0
164
- */
165
- public static function get_instance() {
166
- if ( is_null( self::$instance ) ) {
167
- self::$instance = new self();
168
- }
169
 
170
- return self::$instance;
171
- }
172
 
173
- /**
174
- * Constructor
175
- *
176
- * Initialize plugin and registers actions and filters to be used
177
- *
178
- * @since 1.0
179
- * @author Lorenzo Giuffrida
180
- */
181
- protected function __construct() {
182
- if ( ! function_exists( 'WC' ) ) {
183
- return;
184
- }
185
 
186
- add_action( 'admin_menu', array( $this, 'add_menu_item' ) );
187
 
188
- add_action( 'init', array( $this, 'initialize_settings' ) );
189
 
190
- //region ******* YIT Plugin Framework *********
191
 
192
- // Load Plugin Framework
193
- add_action( 'after_setup_theme', array( $this, 'plugin_fw_loader' ), 1 );
194
 
195
 
196
- // Add row meta
197
- add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 4 );
198
 
199
- // Add stylesheets and scripts files
200
- add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
201
 
202
- // register plugin pointer
203
- add_action( 'admin_init', array( $this, 'register_pointer' ) );
204
 
205
- // verify import reviews action request
206
- add_action( "admin_init", array( $this, "check_import_actions" ) );
207
 
208
 
209
- //Add action links
210
- add_filter( 'plugin_action_links_' . plugin_basename( YITH_YWAR_DIR . '/' . basename( YITH_YWAR_FILE ) ), array(
211
- $this,
212
- 'action_links'
213
- ) );
214
 
215
- add_action( 'yith_advanced_reviews_premium', array( $this, 'premium_tab' ) );
216
 
217
- //endregion
218
 
219
- //region *********** Add stylesheets and scripts files ************
220
 
221
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
222
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
223
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles_scripts' ) );
224
 
225
- //endregion
226
 
227
- //region *********** Advanced reviews post type functionalities
228
 
229
- add_action( 'init', array( $this, 'register_post_type' ) );
230
 
231
 
232
- //endregion
233
 
234
- //region *********** Review table
235
 
236
- add_filter( 'yith_advanced_reviews_row_actions', array( $this, 'add_review_actions' ), 10, 2 );
237
 
238
- add_filter( 'post_class', array( $this, 'add_review_table_class' ), 10, 3 );
239
 
240
- /**
241
- * intercept approve and unapprove actions
242
- */
243
- add_action( "admin_action_{$this->approve_review_action}", array( $this, 'update_review_attributes' ) );
244
- add_action( "admin_action_{$this->unapprove_review_action}", array( $this, 'update_review_attributes' ) );
245
- add_action( "admin_action_{$this->untrash_review_action}", array( $this, 'update_review_attributes' ) );
246
 
247
- //endregion ******************************************
248
 
249
- // Load reviews template
250
- add_filter( 'comments_template', array(
251
- $this,
252
- 'show_advanced_reviews_template'
253
- ), 99 );
254
 
255
- // Save additional comment fields on comment submit
256
- add_action( 'comment_post', array( $this, 'submit_review' ) );
257
 
258
- // redirect to product page on comment submitted
259
- add_filter( 'comment_post_redirect', array( $this, 'redirect_after_submit_review' ), 10, 2 );
260
 
261
- add_filter( 'woocommerce_product_review_comment_form_args', array(
262
- $this,
263
- 'add_fields_to_comment_form'
264
- ) );
265
 
266
- // Add custom fields "Title" on top of comment form
267
- add_action( 'comment_form_logged_in_after', array( $this, 'add_custom_fields_on_comment_form' ) );
268
- add_action( 'comment_form_after_fields', array( $this, 'add_custom_fields_on_comment_form' ) );
269
 
270
- add_filter( 'yith_advanced_reviews_review_content', array( $this, 'show_expanded_review_content' ) );
271
 
272
- add_filter( 'woocommerce_product_tabs', array( $this, 'update_tab_reviews_count' ), 20 );
273
 
274
- /**
275
- * Add summary bars for product rating
276
- */
277
- add_action( 'yith_advanced_reviews_before_reviews', array( $this, 'load_reviews_summary' ) );
278
 
279
- // Show details with average rating for the current product
280
- add_action( 'ywar_summary_prepend', array( $this, 'add_reviews_average_info' ) );
281
 
282
- add_filter( 'wc_get_template', array( $this, 'wc_get_template' ), 99, 5 );
283
 
284
- add_filter( 'woocommerce_product_get_rating_html', array( $this, 'get_product_rating_html' ), 99, 2 );
285
 
286
- //region ***************** Show, edit and save back-end review metabox
287
- // Add a new metabox for editing and saving title comment in meta_comment table
288
- add_action( 'add_meta_boxes', array( $this, 'add_plugin_metabox' ), 1 );
289
 
290
- // save the custom fields
291
- add_action( 'save_post', array( $this, 'save_plugin_metabox' ), 1, 2 );
292
 
293
- add_action( 'admin_menu', array( $this, 'remove_unwanted_custom_post_type_features' ), 5 );
294
- add_action( 'admin_head', array( $this, 'hide_unwanted_custom_post_type_features' ) );
295
- //endregion
296
 
297
- add_action( 'woocommerce_admin_field_ywar_import_previous_reviews', array(
298
- $this,
299
- 'show_import_reviews_button'
300
- ), 10, 1 );
301
 
302
- add_action( 'wp_ajax_convert_reviews', array( $this, 'convert_reviews_callback' ) );
303
- }
304
 
305
- /**
306
- * Add the Commissions menu item in dashboard menu
307
- *
308
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
309
- * @since 1.0
310
- * @return void
311
- * @see wp-admin\includes\plugin.php -> add_menu_page()
312
- */
313
- public function add_menu_item() {
314
 
315
- $args = apply_filters( 'yith_wc_product_vendors_commissions_menu_items', array(
316
- 'page_title' => __( 'Reviews', 'ywar' ),
317
- 'menu_title' => __( 'Reviews', 'ywar' ),
318
- 'capability' => 'edit_products',
319
- 'menu_slug' => __( 'Reviews', 'ywar' ),
320
- 'function' => array( $this, 'show_reviews_table' ),
321
- 'icon' => 'dashicons-star-filled',
322
- 'position' => 8 /* After WC Products */
323
- )
324
- );
325
 
326
- extract( $args );
327
 
328
- add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon, $position );
329
- }
330
 
331
- /**
332
- * Show the reviews table
333
- *
334
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
335
- * @since 1.0
336
- * @return void
337
- * @fire yith_vendors_commissions_template hooks
338
- */
339
- public function show_reviews_table() {
340
- if ( ! class_exists( 'WP_Posts_List_Table' ) ) {
341
- require_once( ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php' );
342
- }
343
-
344
- require_once( YITH_YWAR_DIR . 'lib/class.yith-advanced-reviews-list-table.php' );
345
-
346
- $product_reviews = new YITH_Advanced_Reviews_List_Table();
347
- $product_reviews->prepare_items();
348
-
349
- wc_get_template( 'ywar-product-reviews-table.php', array( 'product_reviews' => $product_reviews ), YITH_YWAR_TEMPLATES_DIR, YITH_YWAR_TEMPLATES_DIR );
350
- }
351
-
352
- /**
353
- * Intercept review action url and do the requested job
354
- */
355
- public function update_review_attributes() {
356
-
357
- if ( ! isset( $_GET["review_id"] ) ) {
358
- return;
359
- }
360
-
361
- $review_id = $_GET["review_id"];
362
-
363
- $current_filter = current_filter();
364
-
365
- switch ( $current_filter ) {
366
- case "admin_action_{$this->approve_review_action}" :
367
- update_post_meta( $review_id, $this->meta_key_approved, 1 );
368
-
369
- break;
370
-
371
- case "admin_action_{$this->unapprove_review_action}" :
372
- update_post_meta( $review_id, $this->meta_key_approved, 0 );
373
-
374
- break;
375
-
376
- case "admin_action_{$this->untrash_review_action}" :
377
- $my_post = array(
378
- 'ID' => $review_id,
379
- 'post_status' => 'publish'
380
- );
381
-
382
- // Update the post into the database
383
- wp_update_post( $my_post );
384
-
385
- break;
386
- }
387
-
388
- wp_redirect( esc_url_raw( remove_query_arg( array( 'action', 'action2' ), $_SERVER['HTTP_REFERER'] ) ) );
389
- }
390
-
391
- public function add_review_table_class( $classes, $class, $post_id ) {
392
-
393
- if ( $this->post_type_name != get_post_type( $post_id ) ) {
394
- return $classes;
395
- }
396
-
397
- unset( $classes["review-unapproved"] );
398
- unset( $classes["review-approved"] );
399
-
400
- $approve = get_post_meta( $post_id, $this->meta_key_approved, true );
401
-
402
- if ( 1 == $approve ) {
403
- $classes[] = "review-approved";
404
- } elseif ( 0 == $approve ) {
405
- $classes[] = "review-unapproved";
406
- }
407
-
408
- return apply_filters( 'yith_advanced_reviews_table_class', $classes, $post_id );
409
- }
410
-
411
- /**
412
- * Build a url to be using as action url in row actions
413
- *
414
- * @param $action action to be performed
415
- * @param $post_id review id
416
- *
417
- * @return string|void the url used to send an "approve" action for a specific review
418
- */
419
- public function review_action_url( $action, $post_id ) {
420
- return admin_url( "admin.php?action=$action&post_type={$this->post_type_name}&review_id=$post_id" );
421
- }
422
-
423
- /**
424
- * Build an "untrash" action url
425
- *
426
- * @param $review the review on which the action is performed
427
- *
428
- * @return string|void action url
429
- */
430
- public function untrash_review_url( $review ) {
431
- return $this->review_action_url( $this->untrash_review_action, $review->ID );
432
- }
433
-
434
- /**
435
- * Build an "approve" action url
436
- *
437
- * @param $review the review on which the action is performed
438
- *
439
- * @return string|void action url
440
- */
441
- public function approve_review_url( $review ) {
442
- return $this->review_action_url( $this->approve_review_action, $review->ID );
443
- }
444
-
445
- /**
446
- * Build an "unapprove" action url
447
- *
448
- * @param $review the review on which the action is performed
449
- *
450
- * @return string|void action url
451
- */
452
- public function unapprove_review_url( $review ) {
453
- return $this->review_action_url( $this->unapprove_review_action, $review->ID );
454
- }
455
-
456
- public function add_review_actions( $actions, $post ) {
457
-
458
- if ( $post->post_type != $this->post_type_name ) {
459
- return $actions;
460
- }
461
-
462
- $approved = get_post_meta( $post->ID, $this->meta_key_approved, true );
463
-
464
- unset( $actions['view'] );
465
- unset( $actions['inline hide-if-no-js'] );
466
-
467
- if ( ! $approved ) {
468
- $actions['approve-review'] = '<a href="' . $this->approve_review_url( $post ) . '" title="' . esc_attr( __( 'Approve review', 'ywar' ) ) . '" rel="permalink">' . __( 'Approve', 'ywar' ) . '</a>';
469
- } elseif ( $approved ) {
470
- $actions['unapprove-review'] = '<a href="' . $this->unapprove_review_url( $post ) . '" title="' . esc_attr( __( 'Unapprove review', 'ywar' ) ) . '" rel="permalink">' . __( 'Unapprove', 'ywar' ) . '</a>';
471
- }
472
-
473
- return apply_filters( 'yith_advanced_reviews_review_actions', $actions, $post );
474
- }
475
-
476
- public function get_average_rating( $product_id ) {
477
- global $wpdb;
478
-
479
- $query = $wpdb->prepare( "
480
  select avg(meta_value)
481
  from {$wpdb->prefix}postmeta pm
482
  where meta_key = '{$this->meta_key_rating}' and post_id in
483
  (select post_id from {$wpdb->prefix}postmeta where meta_key = '{$this->meta_key_product_id}' and meta_value = %d and post_id IN
484
- (select post_id from {$wpdb->prefix}postmeta where meta_key = '{$this->meta_key_approved}' and meta_value = 1))", $product_id );
485
 
486
- $count = $wpdb->get_var( $query );
487
 
488
- return number_format( $count, 2 );
489
- }
490
 
491
- public function add_reviews_average_info( $product ) {
492
 
493
- if ( get_option( 'woocommerce_enable_review_rating' ) === 'no' ) {
494
- return;
495
- }
496
 
497
- global $product;
498
 
499
- $average = $this->get_average_rating( $product->id );
500
 
501
- $count = count( $this->get_product_reviews_by_rating( $product->id ) );
502
 
503
- if ( $count > 0 ) {
504
- echo '<div class="woocommerce-product-rating">
505
- <div class="star-rating" title="' . sprintf( __( 'Rated %s out of 5', 'ywar' ), $average ) . '">
506
- <span style="width:' . ( ( $average / 5 ) * 100 ) . '%"></span>
507
  </div>
508
- <span class="ywar_review_count">' . sprintf( "%d %s", $count, _n( " review", " reviews", $count, 'ywar' ) ) . '</span><span class="review-rating-value"> ' . esc_html( $average ) . ' ' . __( "out of 5 stars", 'ywar' ) . '</span>
509
  </div>';
510
- }
511
- }
512
-
513
- //region *********** YIT Plugin Framework ****************
514
-
515
-
516
- /**
517
- * Enqueue css file
518
- *
519
- * @since 1.0
520
- * @access public
521
- * @return void
522
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
523
- */
524
- public function plugin_fw_loader() {
525
- if ( ! defined( 'YIT' ) || ! defined( 'YIT_CORE_PLUGIN' ) ) {
526
- require_once( 'plugin-fw/yit-plugin.php' );
527
- }
528
- }
529
-
530
- /**
531
- * plugin_row_meta
532
- *
533
- * add the action links to plugin admin page
534
- *
535
- * @param $plugin_meta
536
- * @param $plugin_file
537
- * @param $plugin_data
538
- * @param $status
539
- *
540
- * @return Array
541
- * @since 1.0
542
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
543
- * @use plugin_row_meta
544
- */
545
- public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
546
- if ( ( defined( 'YITH_YWAR_INIT' ) && ( YITH_YWAR_INIT == $plugin_file ) ) ||
547
- ( defined( 'YITH_YWAR_FREE_INIT' ) && ( YITH_YWAR_FREE_INIT == $plugin_file ) )
548
- ) {
549
- $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'ywar' ) . '</a>';
550
- }
551
-
552
- return $plugin_meta;
553
- }
554
-
555
- /**
556
- * Action Links
557
- *
558
- * add the action links to plugin admin page
559
- *
560
- * @param $links | links plugin array
561
- *
562
- * @return mixed Array
563
- * @since 1.0
564
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
565
- * @return mixed
566
- * @use plugin_action_links_{$plugin_file_name}
567
- */
568
- public function action_links( $links ) {
569
-
570
- $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'ywar' ) . '</a>';
571
-
572
- if ( defined( 'YITH_YWAR_FREE_INIT' ) ) {
573
- $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'ywar' ) . '</a>';
574
- }
575
-
576
- return $links;
577
- }
578
-
579
- public function register_pointer() {
580
- if ( ! class_exists( 'YIT_Pointers' ) ) {
581
- include_once( 'plugin-fw/lib/yit-pointers.php' );
582
- }
583
-
584
- $premium_message = defined( 'YITH_YWAR_PREMIUM' )
585
- ? ''
586
- : __( 'YITH WooCommerce Advanced Reviews is available in an outstanding PREMIUM version with many new options, discover it now.', 'ywar' ) .
587
- ' <a href="' . $this->get_premium_landing_uri() . '">' . __( 'Premium version', 'ywar' ) . '</a>';
588
-
589
- $args[] = array(
590
- 'screen_id' => 'plugins',
591
- 'pointer_id' => 'yith_ywar_panel',
592
- 'target' => '#toplevel_page_yit_plugin_panel',
593
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
594
- __( 'YITH WooCommerce Advanced Reviews', 'ywar' ),
595
- __( 'In YIT Plugins tab you can find YITH WooCommerce Advanced Reviews options. From this menu you can access all settings of YITH plugins activated.', 'ywar' ) . '<br>' . $premium_message
596
- ),
597
- 'position' => array( 'edge' => 'left', 'align' => 'center' ),
598
- 'init' => defined( 'YITH_YWAR_PREMIUM' ) ? YITH_YWAR_INIT : YITH_YWAR_FREE_INIT
599
- );
600
-
601
- $args[] = array(
602
- 'screen_id' => 'update',
603
- 'pointer_id' => 'yith_ywar_panel',
604
- 'target' => '#toplevel_page_yit_plugin_panel',
605
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
606
- __( 'YITH WooCommerce Advanced Reviews', 'ywar' ),
607
- __( 'From now on, you can find all YITH WooCommerce Advanced Reviews options in YIT Plugin -> Advanced Reviews instead of WooCommerce -> Settings -> Advanced Reviews, as in the previous version. Any time one of our plugins is updated, a new entry will be added to this menu.', 'ywar' ) . $premium_message
608
- ),
609
- 'position' => array( 'edge' => 'left', 'align' => 'center' ),
610
- 'init' => defined( 'YITH_YWAR_PREMIUM' ) ? YITH_YWAR_INIT : YITH_YWAR_FREE_INIT
611
- );
612
-
613
- YIT_Pointers()->register( $args );
614
- }
615
-
616
- /**
617
- * Get the premium landing uri
618
- *
619
- * @since 1.0.0
620
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
621
- * @return string The premium landing link
622
- */
623
- public function get_premium_landing_uri() {
624
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
625
- }
626
-
627
- /**
628
- * Add a panel under YITH Plugins tab
629
- *
630
- * @return void
631
- * @since 1.0
632
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
633
- * @use /Yit_Plugin_Panel class
634
- * @see plugin-fw/lib/yit-plugin-panel.php
635
- */
636
- public function register_panel() {
637
-
638
- if ( ! empty( $this->_panel ) ) {
639
- return;
640
- }
641
-
642
- $admin_tabs = array(
643
- 'general' => __( 'General', 'ywar' ),
644
- 'layout' => __( 'Layout', 'ywar' )
645
- );
646
-
647
- if ( defined( 'YITH_YWAR_PREMIUM' ) ) {
648
- $admin_tabs['premium'] = __( 'Voting/Review settings', 'ywar' );
649
- } else {
650
- $admin_tabs['premium-landing'] = __( 'Premium Version', 'ywar' );
651
- }
652
-
653
- $args = array(
654
- 'create_menu_page' => true,
655
- 'parent_slug' => '',
656
- 'page_title' => __( 'Advanced Reviews', 'ywar' ),
657
- 'menu_title' => __( 'Advanced Reviews', 'ywar' ),
658
- 'capability' => 'manage_options',
659
- 'parent' => '',
660
- 'parent_page' => 'yit_plugin_panel',
661
- 'page' => $this->_panel_page,
662
- 'admin-tabs' => $admin_tabs,
663
- 'options-path' => YITH_YWAR_DIR . '/plugin-options'
664
- );
665
-
666
- /* === Fixed: not updated theme === */
667
- if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
668
- require_once( 'plugin-fw/lib/yit-plugin-panel-wc.php' );
669
- }
670
-
671
- $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
672
- }
673
-
674
- /**
675
- * Premium Tab Template
676
- *
677
- * Load the premium tab template on admin page
678
- *
679
- * @return void
680
- * @since 1.0
681
- * @author Andrea Grillo <andrea.grillo@yithemes.com>
682
- * @return void
683
- */
684
- public function premium_tab() {
685
- $premium_tab_template = YITH_YWAR_TEMPLATE_PATH . '/admin/' . $this->_premium;
686
- if ( file_exists( $premium_tab_template ) ) {
687
- include_once( $premium_tab_template );
688
- }
689
- }
690
-
691
- //endregion
692
-
693
- //region *********** Add stylesheets and scripts files ************
694
-
695
- /**
696
- * Add scripts
697
- *
698
- * @since 1.0
699
- * @author Lorenzo Giuffrida
700
- */
701
- public function enqueue_scripts() {
702
- // register and enqueue ajax calls related script file
703
- wp_register_script( "attachments-script", YITH_YWAR_URL . 'assets/js/ywar-attachments.js', array( 'jquery' ) );
704
-
705
- wp_localize_script( 'attachments-script', 'attach', array(
706
- 'limit_multiple_upload' => $this->attachments_limit
707
- ) );
708
- wp_enqueue_script( 'attachments-script' );
709
- }
710
-
711
- /**
712
- * Enqueue css file
713
- *
714
- * @since 1.0
715
- * @author Lorenzo Giuffrida
716
- */
717
- public function enqueue_styles() {
718
- wp_enqueue_style( 'yit-style', YITH_YWAR_ASSETS_URL . '/css/yit-advanced-reviews.css' );
719
- }
720
-
721
- /**
722
- * Enqueue scripts on administration comment page
723
- *
724
- * @param $hook
725
- */
726
- function enqueue_admin_styles_scripts( $hook ) {
727
-
728
- /** Add Woocommerce.css file */
729
- $styles = (array) WC_Frontend_Scripts::get_styles();
730
-
731
- if ( array_key_exists( 'woocommerce-general', $styles ) ) {
732
- wp_enqueue_style( 'woocommerce-general', $styles['woocommerce-general']['src'] );
733
- }
734
-
735
- wp_enqueue_style( 'yith-google-fonts', '//fonts.googleapis.com/css?family=Raleway:500,700,800,400' );
736
- wp_enqueue_style( 'yit-style', YITH_YWAR_ASSETS_URL . '/css/yit-advanced-reviews.css' );
737
-
738
- wp_register_script( "ajax-back-end-script", YITH_YWAR_URL . 'assets/js/ywar-back-end.js', array(
739
- 'jquery',
740
- 'jquery-blockui'
741
- ) );
742
-
743
- $loader = apply_filters( 'yith_advanced_reviews_loader_gif', YITH_YWAR_ASSETS_URL . '/images/loading.gif' );
744
-
745
- wp_localize_script( 'ajax-back-end-script', 'ywar', array(
746
- 'loader' => $loader,
747
- 'ajax_url' => admin_url( 'admin-ajax.php' )
748
- ) );
749
-
750
- wp_enqueue_script( "ajax-back-end-script" );
751
- }
752
-
753
- //endregion
754
-
755
- //region *********** Advanced reviews post type functionalities
756
-
757
- /**
758
- * Register advanced reviews post type
759
- */
760
- public function register_post_type() {
761
- // Set UI labels for Custom Post Type
762
- $labels = array(
763
- 'name' => _x( 'Reviews', 'Post Type General Name', 'ywar' ),
764
- 'singular_name' => _x( 'Review', 'Post Type Singular Name', 'ywar' ),
765
- 'menu_name' => __( 'Reviews', 'ywar' ),
766
- 'parent_item_colon' => __( 'Parent Review', 'ywar' ),
767
- 'all_items' => __( 'All reviews', 'ywar' ),
768
- 'view_item' => __( 'View review', 'ywar' ),
769
- 'add_new_item' => __( 'Add New Review', 'ywar' ),
770
- 'add_new' => __( 'Add New', 'ywar' ),
771
- 'edit_item' => __( 'Edit Review', 'ywar' ),
772
- 'update_item' => __( 'Update Review', 'ywar' ),
773
- 'search_items' => __( 'Search Review', 'ywar' ),
774
- 'not_found' => __( 'Not Found', 'ywar' ),
775
- 'not_found_in_trash' => __( 'Not found in bin', 'ywar' ),
776
- );
 
 
777
 
778
  // Set other options for Custom Post Type
779
 
780
- $args = array(
781
- 'label' => __( 'YIT Product reviews', 'ywar' ),
782
- 'description' => __( 'Advanced WooCommerce product reviews', 'ywar' ),
783
- 'labels' => $labels,
784
  // Features this CPT supports in Post Editor
785
- 'supports' => array(
786
- 'title',
787
- 'editor',
788
- 'author',
789
- ),
790
- /* A hierarchical CPT is like Pages and can have
791
- * Parent and child items. A non-hierarchical CPT
792
- * is like Posts.
793
- */
794
- 'hierarchical' => true,
795
- 'public' => true,
796
- 'show_ui' => false,
797
- 'show_in_menu' => true,
798
- 'show_in_nav_menus' => false,
799
- 'show_in_admin_bar' => true,
800
- 'menu_position' => 9,
801
- 'can_export' => true,
802
- 'has_archive' => true,
803
- 'exclude_from_search' => true,
804
- 'publicly_queryable' => false,
805
- 'capability_type' => 'page',
806
- 'menu_icon' => 'dashicons-star-filled',
807
- 'query_var' => false,
808
- );
809
 
810
  // Registering your Custom Post Type
811
- register_post_type( $this->post_type_name, $args );
812
-
813
-
814
- }
815
-
816
-
817
- /**
818
- * Default query arguments to be used where querying to review custom post type
819
- *
820
- * @param $product_id
821
- *
822
- * @return array
823
- */
824
- function default_query_args( $product_id ) {
825
- return array(
826
- 'numberposts' => - 1, //By default retrieve all reviews
827
- 'offset' => 0,
828
- 'orderby' => 'post_date',
829
- 'order' => 'DESC',
830
- 'post_type' => 'ywar_reviews',
831
- 'post_parent' => '0',
832
- 'post_status' => 'publish',
833
- 'meta_query' => array(
834
- 'relation' => 'AND',
835
- array(
836
- 'key' => $this->meta_key_product_id,
837
- 'value' => $product_id,
838
- 'compare' => '=',
839
- 'type' => 'numeric'
840
- ),
841
- array(
842
- 'key' => $this->meta_key_approved,
843
- 'value' => 1,
844
- 'compare' => '=',
845
- 'type' => 'numeric'
846
- )
847
- )
848
- );
849
- }
850
-
851
- /**
852
- * Retrieve reviews for a product
853
- *
854
- * @param $product_id product id for whose retrieve the reviews
855
- */
856
- public function get_product_reviews( $product_id = null, $args = null ) {
857
-
858
- if ( $args == null ) {
859
- $args = $this->default_query_args( $product_id );
860
- }
861
-
862
- // if $product_id is null, retrieve all reviews without filters
863
- if ( is_null( $product_id ) ) {
864
- unset( $args['meta_query'] );
865
- }
866
-
867
- return get_posts( $args );
868
- }
869
-
870
-
871
- /**
872
- * Return the number of reviews for a specific product
873
- *
874
- * @param $product_id product id for whose retrieve the reviews
875
- */
876
- public function get_product_reviews_by_rating( $product_id, $rating = 0 ) {
877
- $args = $this->default_query_args( $product_id );
878
- if ( $rating > 0 ) {
879
- $args['meta_query'][] = array(
880
- 'key' => $this->meta_key_rating,
881
- 'value' => $rating,
882
- 'compare' => '=',
883
- 'type' => 'numeric'
884
- );
885
- }
886
-
887
- return $this->get_product_reviews( $product_id, $args );
888
- }
889
-
890
-
891
- /**
892
- * Show the reviews for a specific product
893
- *
894
- * @param $product_id product id for whose should be shown the reviews
895
- */
896
- public function reviews_list( $product_id, $args = null ) {
897
- $reviews = $this->get_product_reviews( $product_id, $args );
898
-
899
- foreach ( $reviews as $review ) {
900
- $this->show_review( $review );
901
- }
902
- }
903
-
904
- /**
905
- * Call the review template and show the review
906
- *
907
- * @param $review review to be shown
908
- */
909
- public function show_review( $review, $featured = false, $classes = '' ) {
910
- global $ywar_review;
911
- $ywar_review = $review;
912
- wc_get_template( 'ywar-review.php', array(
913
- 'review' => $review,
914
- 'featured' => $featured,
915
- 'classes' => $classes
916
- ), '', YITH_YWAR_TEMPLATES_DIR );
917
- }
918
-
919
- //endregion
920
-
921
- /**
922
- * Initialize plugin options
923
- *
924
- * @since 1.0
925
- * @access public
926
- * @access public
927
- * @return void
928
- * @author Lorenzo Giuffrida
929
- */
930
- public function initialize_settings() {
931
- $this->enable_title = get_option( 'ywar_enable_review_title' ) === 'yes';
932
- $this->enable_attachments = get_option( 'ywar_enable_attachments' ) === 'yes';
933
- $this->attachments_limit = get_option( 'ywar_max_attachments' );
934
- }
935
-
936
- /**
937
- * Return the right path to the reviews template file
938
- *
939
- * @param $template the template that is currently used
940
- *
941
- * @return mixed|void new template path, only for product comments page
942
- */
943
- public function show_advanced_reviews_template( $template ) {
944
-
945
- if ( get_post_type() === 'product' ) {
946
- // return apply_filters( 'ywar_show_advanced_reviews_template', YITH_YWAR_TEMPLATES_DIR . "ywar-product-reviews.php" );
947
- return wc_locate_template( "ywar-product-reviews.php", '', YITH_YWAR_TEMPLATES_DIR );
948
- }
949
-
950
- return $template;
951
- }
952
-
953
- /**
954
- * Create new Advanced Review post type when a comment is saved to database
955
- *
956
- * @since 1.0
957
- * @author Lorenzo Giuffrida
958
- */
959
- public function submit_review( $comment_id ) {
960
- if ( ! isset( $_POST ) ) {
961
- return;
962
- }
963
-
964
- $review_title = $this->enable_title && isset( $_POST["title"] ) ? wp_strip_all_tags( $_POST["title"] ) : '';
965
-
966
- $post_parent = apply_filters( 'yith_advanced_reviews_post_parent', $_POST["comment_parent"] );
967
-
968
- $comment = get_comment( $comment_id );
969
-
970
- // Create post object
971
- $my_post = array(
972
- 'post_author' => $comment->user_id,
973
- 'post_title' => $review_title,
974
- 'post_content' => $comment->comment_content,
975
- 'post_status' => 'publish',
976
- 'post_author' => get_current_user_id(),
977
- 'post_type' => $this->post_type_name,
978
- 'post_parent' => $post_parent,
979
- 'review_user_id' => $comment->user_id,
980
- 'review_rating' => ( isset( $_POST["rating"] ) ? $_POST["rating"] : 0 ),
981
- 'review_product_id' => $comment->comment_post_ID,
982
- 'review_comment_id' => $comment_id,
983
- 'review_approved' => apply_filters( 'yith_advanced_reviews_approve_new_review', true ),
984
- 'review_author' => $comment->comment_author,
985
- 'review_author_email' => $comment->comment_author_email,
986
- 'review_author_IP' => $comment->comment_author_IP,
987
- 'review_author_url' => $comment->comment_author_url
988
- );
989
-
990
- // Insert the post into the database
991
- $review_id = $this->insert_review( $my_post );
992
-
993
- $this->submit_attachments( $review_id );
994
- }
995
-
996
- public function insert_review( $args ) {
997
- // Create post object
998
- $defaults = array(
999
- 'post_title' => '',
1000
- 'post_content' => '',
1001
- 'post_status' => 'publish',
1002
- 'post_author' => 0,
1003
- 'post_type' => $this->post_type_name,
1004
- 'post_parent' => 0,
1005
- 'review_user_id' => 0,
1006
- 'review_approved' => 1,
1007
- 'review_rating' => 0,
1008
- 'review_product_id' => 0,
1009
- 'review_comment_id' => 0,
1010
- 'review_upvotes' => 0,
1011
- 'review_downvotes' => 0,
1012
- 'review_votes' => array(),
1013
- 'review_inappropriate_list' => array(),
1014
- 'review_inappropriate_count' => 0,
1015
- 'review_is_featured' => 0,
1016
- 'review_is_reply_blocked' => 0,
1017
- 'review_thumbnails' => array(),
1018
- 'review_author' => '',
1019
- 'review_author_email' => '',
1020
- 'review_author_url' => '',
1021
- 'review_author_IP' => ''
1022
- );
1023
-
1024
- $args = wp_parse_args( $args, $defaults );
1025
-
1026
- // Insert the post into the database
1027
- $review_id = wp_insert_post( $args );
1028
-
1029
- // Set rating only for top level reviews, not for replies
1030
- if ( 0 != $args["post_parent"] ) {
1031
- update_post_meta( $review_id, $this->meta_key_rating, 0 );
1032
- } else {
1033
- update_post_meta( $review_id, $this->meta_key_rating, $args["review_rating"] );
1034
- }
1035
-
1036
- update_post_meta( $review_id, $this->meta_key_rating, $args["review_rating"] );
1037
- update_post_meta( $review_id, $this->meta_key_approved, $args["review_approved"] );
1038
- update_post_meta( $review_id, $this->meta_key_product_id, $args["review_product_id"] );
1039
- update_post_meta( $review_id, $this->meta_key_comment_id, $args["review_comment_id"] );
1040
- update_post_meta( $review_id, $this->meta_key_thumb_ids, $args["review_thumbnails"] );
1041
-
1042
- update_post_meta( $review_id, $this->meta_key_upvotes_count, $args["review_upvotes"] );
1043
- update_post_meta( $review_id, $this->meta_key_downvotes_count, $args["review_downvotes"] );
1044
- update_post_meta( $review_id, $this->meta_key_votes, $args["review_votes"] );
1045
-
1046
- update_post_meta( $review_id, $this->meta_key_inappropriate_list, $args["review_inappropriate_list"] );
1047
- update_post_meta( $review_id, $this->meta_key_inappropriate_count, $args["review_inappropriate_count"] );
1048
- update_post_meta( $review_id, $this->meta_key_featured, $args["review_is_featured"] );
1049
- update_post_meta( $review_id, $this->meta_key_stop_reply, $args["review_is_reply_blocked"] );
1050
-
1051
- update_post_meta( $review_id, $this->meta_key_review_user_id, $args["review_user_id"] );
1052
- update_post_meta( $review_id, $this->meta_key_review_author, $args["review_author"] );
1053
- update_post_meta( $review_id, $this->meta_key_review_author_email, $args["review_author_email"] );
1054
- update_post_meta( $review_id, $this->meta_key_review_author_url, $args["review_author_url"] );
1055
- update_post_meta( $review_id, $this->meta_key_review_author_IP, $args["review_author_IP"] );
1056
-
1057
- return $review_id;
1058
- }
1059
-
1060
- /**
1061
- * redirect to product page on comment submitted
1062
- */
1063
- public function redirect_after_submit_review( $location, $comment ) {
1064
- // Set the new comment as imported so it will not imported when clicking on "convert reviews", creating duplicated entries
1065
- update_comment_meta( $comment->comment_ID, $this->meta_key_imported, 1 );
1066
-
1067
- return get_permalink( $comment->comment_post_ID );
1068
- }
1069
-
1070
- /**
1071
- * Add custom field "Title" on top of comment form
1072
- *
1073
- * Check if the "enable title" option is activated and add a title field on comment form
1074
- *
1075
- * @return void
1076
- *
1077
- * @since 1.0
1078
- * @author Lorenzo Giuffrida
1079
- */
1080
- public function add_custom_fields_on_comment_form() {
1081
-
1082
- if ( ! is_product() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
1083
- return;
1084
- }
1085
-
1086
- if ( $this->enable_title ) {
1087
- echo '<p class="comment-form-title"><label for="title">' . __( 'Review title', 'ywar' ) . '</label><input type="text" name="title" id="title"/></p>';
1088
- }
1089
- }
1090
-
1091
- //region *********** attachments ********************
1092
-
1093
- /**
1094
- * Submit attachments from a comment form
1095
- *
1096
- * Check if attachment option is enabled and option value is satisfied, then upload attachment files.
1097
- *
1098
- * @param int $review_id the review id the files are referred.
1099
- *
1100
- * @return void
1101
- *
1102
- * @since 1.0
1103
- * @author Lorenzo Giuffrida
1104
- */
1105
- public function submit_attachments( $review_id ) {
1106
- // check if attachments are enabled
1107
- if ( ! $this->enable_attachments ) {
1108
- return;
1109
- }
1110
-
1111
- if ( $_FILES ) {
1112
- $files = $_FILES["uploadFile"];
1113
- $files_count = count( $files['name'] );
1114
-
1115
- // check for attachments limits
1116
- if ( ( $this->attachments_limit > 0 ) && ( $files_count > $this->attachments_limit ) ) {
1117
- return;
1118
- }
1119
-
1120
- $attacchments_array = array();
1121
-
1122
- foreach ( $files['name'] as $key => $value ) {
1123
- if ( $files['name'][ $key ] ) {
1124
- $file = array(
1125
- 'name' => $files['name'][ $key ],
1126
- 'type' => $files['type'][ $key ],
1127
- 'tmp_name' => $files['tmp_name'][ $key ],
1128
- 'error' => $files['error'][ $key ],
1129
- 'size' => $files['size'][ $key ]
1130
- );
1131
- $_FILES = array( "uploadFile" => $file );
1132
-
1133
- foreach ( $_FILES as $file => $array ) {
1134
- $attachId = $this->insert_attachment( $file, $review_id );
1135
-
1136
- // enqueue attachments to current comment
1137
- array_push( $attacchments_array, $attachId );
1138
- }
1139
- }
1140
- }
1141
-
1142
- // save review with attachments array
1143
- update_post_meta( $review_id, $this->meta_key_thumb_ids, $attacchments_array );
1144
- }
1145
- }
1146
-
1147
- /**
1148
- * Add attachment to media library
1149
- *
1150
- * @param int $postId
1151
- * @param string $fileHandler
1152
- *
1153
- * @return void
1154
- *
1155
- * @since 1.0
1156
- * @author Lorenzo Giuffrida
1157
- */
1158
- public function insert_attachment( $fileHandler, $postId ) {
1159
- if ( $_FILES[ $fileHandler ]['error'] !== UPLOAD_ERR_OK ) {
1160
- __return_false();
1161
- }
1162
-
1163
- require_once( ABSPATH . "wp-admin" . '/includes/image.php' );
1164
- require_once( ABSPATH . "wp-admin" . '/includes/file.php' );
1165
- require_once( ABSPATH . "wp-admin" . '/includes/media.php' );
1166
-
1167
- return media_handle_upload( $fileHandler, $postId );
1168
- }
1169
-
1170
- /**
1171
- * Append attachment fields on comment form
1172
- *
1173
- * @param object $comment_form
1174
- *
1175
- * @return object $comment_form
1176
- *
1177
- * @since 1.0
1178
- * @author Lorenzo Giuffrida
1179
- */
1180
- public function add_fields_to_comment_form( $comment_form ) {
1181
- $current_content = $comment_form['comment_field'];
1182
-
1183
- // In case of a page refresh following a reply request, don't add additional fields
1184
- $hide_rating = isset( $_REQUEST["replytocom"] ) ? "hide-rating" : '';
1185
- $selected = isset( $_REQUEST["replytocom"] ) ? "selected" : '';
1186
-
1187
- if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) {
1188
- $comment_form['comment_field'] = '<p class="' . $hide_rating . ' comment-form-rating">
1189
- <label for="rating">' . __( 'Your Rate', 'ywar' ) . '</label>
1190
  <select name="rating" id="rating">
1191
- <option value="">' . __( 'Rate&hellip;', 'ywar' ) . '</option>
1192
- <option value="5">' . __( 'Perfect', 'ywar' ) . '</option>
1193
- <option value="4">' . __( 'Good', 'ywar' ) . '</option>
1194
- <option value="3">' . __( 'Average', 'ywar' ) . '</option>
1195
- <option value="2">' . __( 'Not that bad', 'ywar' ) . '</option>
1196
- <option value="1" ' . $selected . '>' . __( 'Very Poor', 'ywar' ) . '</option>';
1197
-
1198
- $comment_form['comment_field'] .= '</select></p>' . $current_content;
1199
- }
1200
-
1201
- if ( $this->enable_attachments ) {
1202
- $comment_form['comment_field'] .= '<p class="upload_section ' . $hide_rating . '" >
1203
- <label for="uploadFile" > ' . __( 'Attachments', 'ywar' ) . ' </label >
1204
- <input type = "button" value = "' . __( 'Choose file(s)', 'ywar' ) . '" id = "do_uploadFile" />
1205
  <input type = "file" name = "uploadFile[]" id = "uploadFile" accept = "image/*" multiple = "2" />
1206
  </p>
1207
  <p>
1208
  <ul id = "uploadFileList" ></ul>
1209
  </p> ';
1210
- }
1211
-
1212
- return $comment_form;
1213
- }
1214
-
1215
- //endregion
1216
-
1217
- /**
1218
- * Display a customized comment content
1219
- *
1220
- * @param string $text
1221
- *
1222
- * @return string customized comment content
1223
- *
1224
- * @since 1.0
1225
- * @author Lorenzo Giuffrida
1226
- */
1227
- public function show_expanded_review_content( $review ) {
1228
-
1229
- if ( ! is_product() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
1230
- return $review->post_content;
1231
- }
1232
-
1233
- $review_title = '';
1234
- $thumbnail_div = $this->get_thumbnails( $review );
1235
-
1236
- if ( $this->enable_title ) {
1237
- // Add review title before review content text
1238
- if ( ! empty( $review->post_title ) ) {
1239
- $review_title = '<span class="review_title"> ' . esc_attr( $review->post_title ) . '</span> ';
1240
- }
1241
- }
1242
-
1243
- return $review_title . $review->post_content . $thumbnail_div;
1244
- }
1245
-
1246
- /**
1247
- * Get an HTML formatted attachment section
1248
- *
1249
- * @param $review the review for whose retrieve attachments
1250
- */
1251
- public function get_thumbnails( $review ) {
1252
- $is_toplevel = ( 0 == $review->post_parent );
1253
- $thumbnail_div = '';
1254
-
1255
- if ( $is_toplevel && $this->enable_attachments ) {
1256
-
1257
- if ( $thumbs = get_post_meta( $review->ID, $this->meta_key_thumb_ids, true ) ) {
1258
-
1259
- $thumbnail_div = '<div class="review_thumbnail horizontalRule"> ';
1260
-
1261
- foreach ( $thumbs as $thumb_id ) {
1262
- $file_url = wp_get_attachment_url( $thumb_id );
1263
- $image_thumb = wp_get_attachment_image_src( $thumb_id, array( 100, 100 ), true );
1264
-
1265
- $thumbnail_div .= "<a href='$file_url' data-rel = \"prettyPhoto[review-gallery-$review->ID]\"><img class=\"ywar_thumbnail\" src='{$image_thumb[0]}' width='70px' height='70px'></a>";
1266
- }
1267
- $thumbnail_div .= ' </div> ';
1268
- }
1269
- }
1270
-
1271
- return $thumbnail_div;
1272
- }
1273
-
1274
- /**
1275
- * Alter text on tab reviews, fixing wrong count of reviews(even replies to reviews were used
1276
- *
1277
- * @param $tabs tabs with description for product reviews
1278
- *
1279
- * @return mixed
1280
- */
1281
- public function update_tab_reviews_count( $tabs ) {
1282
- global $product;
1283
-
1284
- if ( isset( $tabs['reviews'] ) ) {
1285
- $tabs['reviews']['title'] = sprintf( __( 'Reviews(%d)', 'ywar' ), count( $this->get_product_reviews_by_rating( $product->id ) ) );
1286
- }
1287
-
1288
- return $tabs;
1289
- }
1290
-
1291
- /**
1292
- * Collect data about reviews rating and show a summary grouped by stars
1293
- *
1294
- * @param object $template a custom template to be shown
1295
- *
1296
- * @return object $template
1297
- *
1298
- * @since 1.0
1299
- * @author Lorenzo Giuffrida
1300
- */
1301
- public function load_reviews_summary( $template ) {
1302
- if ( ! is_product() ) {
1303
- return $template;
1304
- }
1305
-
1306
- global $product;
1307
- global $review_stats;
1308
- $review_stats = array(
1309
- '1' => count( $this->get_product_reviews_by_rating( $product->id, 1 ) ),
1310
- '2' => count( $this->get_product_reviews_by_rating( $product->id, 2 ) ),
1311
- '3' => count( $this->get_product_reviews_by_rating( $product->id, 3 ) ),
1312
- '4' => count( $this->get_product_reviews_by_rating( $product->id, 4 ) ),
1313
- '5' => count( $this->get_product_reviews_by_rating( $product->id, 5 ) ),
1314
- 'total' => count( $this->get_product_reviews_by_rating( $product->id ) )
1315
- );
1316
-
1317
- wc_get_template( 'ywar-single-product-reviews.php', null, '', YITH_YWAR_TEMPLATES_DIR );
1318
- }
1319
-
1320
- /**
1321
- * Add a metabox on review page for review's title
1322
- *
1323
- * @return void
1324
- *
1325
- * @since 1.0
1326
- * @author Lorenzo Giuffrida
1327
- */
1328
- public function add_plugin_metabox() {
1329
- add_meta_box( 'reviews-metabox', __( 'Review attributes', 'ywar' ), array(
1330
- $this,
1331
- 'display_plugin_metabox'
1332
- ), $this->post_type_name, 'normal', 'high' );
1333
- }
1334
-
1335
- /**
1336
- * Display a meta box with additional review data, like title and thumbnails
1337
- *
1338
- * @return void
1339
- *
1340
- * @since 1.0
1341
- * @author Lorenzo Giuffrida
1342
- */
1343
- public function display_plugin_metabox() {
1344
- global $post;
1345
-
1346
- $rating_div = '';
1347
- $thumbnail_div = '';
1348
-
1349
- $current = get_post_meta( $post->ID, $this->meta_key_rating, true );
1350
- ?>
1351
- <select name="rating" id="rating">
1352
- <?php for ( $rating = 0; $rating <= 5; $rating ++ ) {
1353
- echo sprintf( '<option value="%1$s"%2$s>%1$s</option>', $rating, selected( $current, $rating, false ) );
1354
- } ?>
1355
- </select>
1356
-
1357
- <?php
1358
- // Generate a hidden nonce used for verifying if a request to update the following values came from here
1359
- echo '<input type="hidden" name="review_metabox_nonce" id="review_metabox_nonce" value="' .
1360
- wp_create_nonce( plugin_basename( __FILE__ ) ) . '" />';
1361
-
1362
- $review_thumbnails = get_post_meta( $post->ID, $this->meta_key_thumb_ids, true );
1363
-
1364
- if ( isset ( $review_thumbnails ) && is_array( $review_thumbnails ) ) {
1365
- $thumbnail_div = '<div style = "padding-top: 10px;padding-bottom: 10px;overflow:hidden"> ';
1366
- foreach ( $review_thumbnails as $thumb_id ) {
1367
- $file_url = wp_get_attachment_url( $thumb_id );
1368
- // $image_thumb = wp_get_attachment_image($thumb_id, array(100, 100), true );
1369
- $image_thumb = wp_get_attachment_image_src( $thumb_id, array( 100, 100 ), true );
1370
-
1371
- $thumbnail_div .= "<a href='$file_url'><img src='{$image_thumb[0]}' width='{$image_thumb[1]}' height='{$image_thumb[2]}'></a>";
1372
- }
1373
- $thumbnail_div .= '</div >';
1374
- }
1375
-
1376
- echo $thumbnail_div;
1377
- }
1378
-
1379
- /**
1380
- * Save the Metabox Data
1381
- *
1382
- * @param $post_id
1383
- * @param $post
1384
- *
1385
- * @return mixed
1386
- */
1387
- function save_plugin_metabox( $post_id, $post ) {
1388
-
1389
- if ( ! isset( $_POST['review_metabox_nonce'] ) ) {
1390
- return $post->ID;
1391
- }
1392
-
1393
- // verify the save request started from review edit page...
1394
- if ( ! wp_verify_nonce( $_POST['review_metabox_nonce'], plugin_basename( __FILE__ ) ) ) {
1395
- return $post->ID;
1396
- }
1397
-
1398
- // Check for authorization
1399
- if ( ! current_user_can( 'edit_post', $post->ID ) ) {
1400
- return $post->ID;
1401
- }
1402
-
1403
- // OK, we're authenticated: we need to find and save the data
1404
- // We'll put it into an array to make it easier to loop though.
1405
- if ( isset( $_POST['rating'] ) ) {
1406
- $rating = $_POST['rating'];
1407
-
1408
- if ( is_numeric( $rating ) && ( $rating > 0 ) && ( $rating <= 5 ) ) {
1409
- update_post_meta( $post_id, $this->meta_key_rating, $rating );
1410
- }
1411
- }
1412
- }
1413
-
1414
- /**
1415
- * Remove features for the review custom post type
1416
- */
1417
- public function remove_unwanted_custom_post_type_features() {
1418
- global $submenu;
1419
-
1420
- // Remove Add new for review custom post type
1421
- unset( $submenu["edit.php?post_type={$this->post_type_name}"][10] );
1422
- }
1423
-
1424
- public function hide_unwanted_custom_post_type_features() {
1425
- if ( $this->post_type_name == get_post_type() ) {
1426
- echo '<style type="text/css">
1427
 
1428
  .add-new-h2 {
1429
  display:none;
1430
  }
1431
 
1432
  </style>';
1433
- }
1434
- }
1435
-
1436
- //region ******* Retrieve postmeta values
1437
-
1438
- /**
1439
- * Retrieve value for the "rating" meta_key for a specific review
1440
- *
1441
- * @param $review_id review id from which retrieve the meta_value
1442
- *
1443
- * @return mixed meta_value for "rating" meta_key
1444
- */
1445
- function get_meta_value_rating( $review_id ) {
1446
- return get_post_meta( $review_id, $this->meta_key_rating, true );
1447
- }
1448
-
1449
- /**
1450
- * Retrieve value for the "approved" meta_key for a specific review
1451
- *
1452
- * @param $review_id review id from which retrieve the meta_value
1453
- *
1454
- * @return mixed meta_value for "approved" meta_key
1455
- */
1456
- function get_meta_value_approved( $review_id ) {
1457
- return get_post_meta( $review_id, $this->meta_key_approved, true );
1458
- }
1459
-
1460
- /**
1461
- * Retrieve value for the "product_id" meta_key for a specific review
1462
- *
1463
- * @param $review_id review id from which retrieve the meta_value
1464
- *
1465
- * @return mixed meta_value for "product_id" meta_key
1466
- */
1467
- function get_meta_value_product_id( $review_id ) {
1468
- return get_post_meta( $review_id, $this->meta_key_product_id, true );
1469
- }
1470
-
1471
- /**
1472
- * Retrieve information about the review author
1473
- *
1474
- * @param $review_id review id from which retrieve the meta_value
1475
- *
1476
- * @return array author's information
1477
- */
1478
- function get_meta_value_author( $review_id ) {
1479
- return array(
1480
- 'review_user_id' => get_post_meta( $review_id, $this->meta_key_review_user_id, true ),
1481
- 'review_author' => get_post_meta( $review_id, $this->meta_key_review_author, true ),
1482
- 'review_author_email' => get_post_meta( $review_id, $this->meta_key_review_author_email, true ),
1483
- 'review_author_url' => get_post_meta( $review_id, $this->meta_key_review_author_url, true ),
1484
- 'review_author_IP' => get_post_meta( $review_id, $this->meta_key_review_author_IP, true )
1485
- );
1486
- }
1487
-
1488
- //endregion
1489
-
1490
- public function wc_get_template( $located, $template_name, $args, $template_path, $default_path ) {
1491
- if ( "single-product/rating.php" != $template_name ) {
1492
- return $located;
1493
- }
1494
-
1495
- $located = wc_locate_template( "ywar-rating.php", $template_path, $default_path );
1496
-
1497
- if ( file_exists( $located ) ) {
1498
- return $located;
1499
- }
1500
-
1501
- return YITH_YWAR_TEMPLATES_DIR . 'ywar-rating.php';
1502
- }
1503
-
1504
- public function get_product_rating_html( $rating_html, $rating ) {
1505
- global $product;
1506
- $rating_html = '';
1507
-
1508
- $rating = $this->get_average_rating( $product->id );
1509
-
1510
- if ( $rating > 0 ) {
1511
-
1512
- $rating_html = '<div class="star-rating" title="' . sprintf( __( 'Rated %s out of 5', 'ywar' ), $rating ) . '">';
1513
-
1514
- $rating_html .= '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%"><strong class="rating">' . $rating . '</strong> ' . __( 'out of 5', 'ywar' ) . '</span>';
1515
-
1516
- $rating_html .= '</div>';
1517
- }
1518
-
1519
- return $rating_html;
1520
- }
1521
-
1522
- //region *********** Convert reviews from standard system to YITH Advanced reviews
1523
-
1524
- /**
1525
- * Show import button for starting convertion from standard system to YITH Advanced reviews
1526
- *
1527
- * @param array $args
1528
- */
1529
- public function show_import_reviews_button( $args = array() ) {
1530
- if ( ! empty( $args ) ) {
1531
- $args['value'] = ( get_option( $args['id'] ) ) ? get_option( $args['id'] ) : '';
1532
- extract( $args );
1533
- }
1534
-
1535
- ?>
1536
- <tr valign="top">
1537
- <th scope="row">
1538
-
1539
- </th>
1540
-
1541
- <td class="forminp forminp-color plugin-option">
1542
- <div class="convert-reviews">
1543
- <a href="<?php echo esc_url( add_query_arg( "convert-reviews", "start" ) ); ?>"
1544
- class="button convert-reviews"><?php _e( "Convert reviews", "ywar" ); ?></a>
1545
-
1546
- <div style="display: inline-block; width: 65%; margin-left: 15px;"><span
1547
- class="description"><?php _e( "If this is the first time you install the YITH Advanced Reviews plugin, or if you are using an older version prior to the 1.1.0, first you have to convert the older reviews if you want to use them.", "ywar" ); ?></span>
1548
- </div>
1549
- </div>
1550
- </td>
1551
- </tr>
1552
- <?php
1553
- }
1554
-
1555
- /**
1556
- * Convert previous reviews into new YITH Advanced review type
1557
- *
1558
- * @since 1.0
1559
- * @author Lorenzo Giuffrida
1560
- */
1561
- public function convert_reviews_callback() {
1562
-
1563
- $review_converted = $this->import_previous_reviews();
1564
- $response = '';
1565
-
1566
- if ( $review_converted ) {
1567
- $response = sprintf( __( 'Task completed. %d reviews have been processed and converted.', 'ywar' ), $review_converted );
1568
- } else {
1569
- $response = __( 'Task completed. No review to convert has been found.', 'ywar' );
1570
- }
1571
-
1572
- wp_send_json( array( "value" => $response ) );
1573
- }
1574
-
1575
- /**
1576
- * Set a maximum execution time
1577
- *
1578
- * @param $seconds time in seconds
1579
- */
1580
- private function set_time_limit( $seconds ) {
1581
- $check_safe_mode = ini_get( 'safe_mode' );
1582
- if ( ( ! $check_safe_mode ) || ( 'OFF' == strtoupper( $check_safe_mode ) ) ) {
1583
- @set_time_limit( $seconds );
1584
- }
1585
- }
1586
-
1587
- /**
1588
- * Read and convert previous reviews into new advanced reviews using custom post type
1589
- */
1590
- public function import_previous_reviews() {
1591
- global $wpdb;
1592
-
1593
- $review_converted = 0;
1594
-
1595
- $query = "SELECT *
1596
  FROM {$wpdb->prefix}comments as co left join {$wpdb->prefix}commentmeta as cm
1597
  on co.comment_ID = cm.comment_id
1598
  where ((co.comment_approved = '0') or (co.comment_approved = '1')) and cm.meta_key = 'rating'";
1599
 
1600
- $results = $wpdb->get_results( $query );
1601
-
1602
- // manage parent relationship and update all reviews when import ends
1603
- $review_ids = array();
1604
- $parent_review = array();
1605
-
1606
- foreach ( $results as $comment ) {
1607
-
1608
- // Check if comment_meta exists for previous reviews and is not still imported
1609
- if ( "1" === get_comment_meta( $comment->comment_ID, $this->meta_key_imported, true ) ) {
1610
- // comment still imported, update only author data (Fix for upgrade from 1.1.2 to 1.2.3 then skip it!
1611
-
1612
- // Retrieve review(post) id linked to current comment
1613
- $args = array(
1614
- 'post_type' => 'ywar_reviews',
1615
- 'meta_query' => array(
1616
- array(
1617
- 'key' => $this->meta_key_comment_id,
1618
- 'value' => $comment->comment_ID,
1619
- 'compare' => '=',
1620
- 'type' => 'numeric'
1621
- )
1622
- )
1623
- );
1624
- $reviews = get_posts( $args );
1625
-
1626
- if ( isset( $reviews ) ) {
1627
- $review = $reviews[0];
1628
-
1629
- // Update review meta
1630
- update_post_meta( $review->ID, $this->meta_key_review_user_id, $comment->user_id );
1631
- update_post_meta( $review->ID, $this->meta_key_review_author, $comment->comment_author );
1632
- update_post_meta( $review->ID, $this->meta_key_review_author_email, $comment->comment_author_email );
1633
- update_post_meta( $review->ID, $this->meta_key_review_author_url, $comment->comment_author_url );
1634
- update_post_meta( $review->ID, $this->meta_key_review_author_IP, $comment->comment_author_IP );
1635
- }
1636
-
1637
- continue;
1638
- }
1639
-
1640
- // Set execution time
1641
- $this->set_time_limit( 30 );
1642
-
1643
- $val = get_comment_meta( $comment->comment_ID, "title", true );
1644
- $title = $val ? $val : '';
1645
-
1646
- $val = get_comment_meta( $comment->comment_ID, "thumb_ids", true );
1647
- $thumb_ids = $val ? $val : array();
1648
-
1649
- $val = get_comment_meta( $comment->comment_ID, "rating", true );
1650
- $rating = $val ? $val : 0;
1651
-
1652
- // Import previous settings for "stop reply" from the comment
1653
- $val = get_comment_meta( $comment->comment_ID, "no_reply", true );
1654
- $no_reply = $val ? $val : 0;
1655
-
1656
- // Import previous settings for "votes" from the comment
1657
- $val = get_comment_meta( $comment->comment_ID, "votes", true );
1658
- $votes = $val ? $val : array();
1659
-
1660
- // Extract upvotes and downvotes count
1661
- $votes_grouped = array_count_values( array_values( $votes ) );
1662
- $yes_votes = isset( $votes_grouped['1'] ) && is_numeric( $votes_grouped['1'] ) ? $votes_grouped['1'] : 0;
1663
- $no_votes = isset( $votes_grouped['-1'] ) && is_numeric( $votes_grouped['-1'] ) ? $votes_grouped['-1'] : 0;
1664
-
1665
- // Create post object
1666
- $args = array(
1667
- 'post_author' => $comment->user_id,
1668
- 'post_date' => $comment->comment_date,
1669
- 'post_date_gmt' => $comment->comment_date_gmt,
1670
- 'post_content' => $comment->comment_content,
1671
- 'post_title' => $title,
1672
- 'review_user_id' => $comment->user_id,
1673
- 'review_approved' => $comment->comment_approved,
1674
- 'review_product_id' => $comment->comment_post_ID,
1675
- 'review_thumbnails' => $thumb_ids,
1676
- 'review_comment_id' => $comment->comment_ID,
1677
- 'review_rating' => $rating,
1678
- 'review_is_reply_blocked' => $no_reply,
1679
- 'review_votes' => $votes,
1680
- 'review_upvotes' => $yes_votes,
1681
- 'review_downvotes' => $no_votes,
1682
- 'review_author' => $comment->comment_author,
1683
- 'review_author_email' => $comment->comment_author_email,
1684
- 'review_author_url' => $comment->comment_author_url,
1685
- 'review_author_IP' => $comment->comment_author_IP
1686
- );
1687
-
1688
- // Insert the post into the database
1689
- $review_id = $this->insert_review( $args );
1690
-
1691
- $review_ids[ $comment->comment_ID ] = $review_id;
1692
-
1693
- // If current comment have parent, store it and update all relationship when the import ends
1694
- if ( $comment->comment_parent > 0 ) {
1695
- $parent_review[ $review_id ] = $comment->comment_parent;
1696
- }
1697
-
1698
- // set current comment as imported
1699
- update_comment_meta( $comment->comment_ID, $this->meta_key_imported, 1 );
1700
- $review_converted ++;
1701
- }
1702
-
1703
- // if some hierarchical comment was found, update the review created
1704
- foreach ( $parent_review as $key => $value ) {
1705
- if ( isset( $review_ids[ $value ] ) ) {
1706
-
1707
- //update the post which id is in $key, setting parent to $review_ids[$value]
1708
- $args = array(
1709
- 'ID' => $key,
1710
- 'post_parent' => $review_ids[ $value ]
1711
- );
1712
-
1713
- // Update the post into the database
1714
- wp_update_post( $args );
1715
- }
1716
- }
1717
-
1718
- return $review_converted;
1719
- }
1720
-
1721
- /**
1722
- * On plugin init check query vars for commands to convert previous reviews
1723
- */
1724
- function check_import_actions() {
1725
- if ( isset( $_GET["convert-reviews"] ) ) {
1726
-
1727
- $this->import_previous_reviews();
1728
-
1729
- wp_redirect( esc_url( remove_query_arg( "convert-reviews" ) ) );
1730
- }
1731
- }
1732
- //endregion
1733
- }
1734
  }
1
  <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit; // Exit if accessed directly
4
  }
5
 
6
+ if (!class_exists('YITH_WooCommerce_Advanced_Reviews')) {
7
+
8
+ /**
9
+ * Implements features of FREE version of YWAR plugin
10
+ *
11
+ * @class YITH_WooCommerce_Advanced_Reviews
12
+ * @package Yithemes
13
+ * @since 1.0.0
14
+ * @author Your Inspiration Themes
15
+ */
16
+ class YITH_WooCommerce_Advanced_Reviews {
17
+ /**
18
+ * @var $_panel Panel Object
19
+ */
20
+ protected $_panel;
21
+
22
+ /**
23
+ * @var $_premium string Premium tab template file name
24
+ */
25
+ protected $_premium = 'premium.php';
26
+
27
+ /**
28
+ * @var string Premium version landing link
29
+ */
30
+ protected $_premium_landing = 'http://yithemes.com/themes/plugins/yith-woocommerce-advanced-reviews/';
31
+
32
+ /**
33
+ * @var string Plugin official documentation
34
+ */
35
+ protected $_official_documentation = 'http://yithemes.com/docs-plugins/yith-woocommerce-advanced-reviews/';
36
+
37
+ /**
38
+ * @var string Advanced Reviews panel page
39
+ */
40
+ protected $_panel_page = 'yith_ywar_panel';
41
+
42
+ /**
43
+ * @var $enable_title Let users to add a title when writing a review
44
+ */
45
+ protected $enable_title = 0;
46
+
47
+ /**
48
+ * @var $enable_attachments Let users to add attachments when submit a review
49
+ */
50
+ protected $enable_attachments = 0;
51
+
52
+ /**
53
+ * @var $attachments_limit Set the maximum number of attachments a users can add when submit a review
54
+ */
55
+ protected $attachments_limit = 0;
56
+
57
+ public $post_type_name = "ywar_reviews";
58
+
59
+ public $items_for_page = 10;
60
+
61
+ public $meta_key_rating = "_ywar_rating";
62
+ public $meta_key_product_id = "_ywar_product_id";
63
+ public $meta_key_imported = "_ywar_imported";
64
+ public $meta_key_approved = "_ywar_approved";
65
+ public $meta_key_thumb_ids = "_ywar_thumb_ids";
66
+ public $meta_key_comment_id = "_ywar_comment_id";
67
+
68
+ /**
69
+ * @var string meta_key used for saving data about segnalation of inappropriate content from users
70
+ */
71
+ public $meta_key_inappropriate_list = "_ywar_inappropriate_list";
72
+
73
+ /**
74
+ * @var string meta_key used for saving data about inappropriate reviews
75
+ */
76
+ public $meta_key_inappropriate_count = "_ywar_inappropriate_count";
77
+
78
+ /**
79
+ * @var string meta_key used for saving data about inappropriate reviews
80
+ */
81
+ public $meta_key_featured = "_ywar_featured";
82
+
83
+ /**
84
+ * @var string meta_key used for saving data about upvotes
85
+ */
86
+ public $meta_key_upvotes_count = "_ywar_upvotes_count";
87
+
88
+ /**
89
+ * @var string meta_key used for saving data about downvotes
90
+ */
91
+ public $meta_key_downvotes_count = "_ywar_downvotes_count";
92
+
93
+ /**
94
+ * @var string meta_key used for saving data about reviews votes
95
+ */
96
+ public $meta_key_votes = "_ywar_votes";
97
+
98
+ /**
99
+ * @var string meta_key used for saving data about replies status
100
+ */
101
+ public $meta_key_stop_reply = "_ywar_stop_reply";
102
+
103
+ /**
104
+ * @var string meta_key used for saving review's user id
105
+ */
106
+ public $meta_key_review_user_id = "_ywar_review_user_id";
107
+
108
+ /**
109
+ * @var string meta_key used for saving review's author
110
+ */
111
+ public $meta_key_review_author = "_ywar_review_author";
112
+
113
+ /**
114
+ * @var string meta_key used for saving review author's email
115
+ */
116
+ public $meta_key_review_author_email = "_ywar_review_author_email";
117
+
118
+ /**
119
+ * @var string meta_key used for saving review author's url
120
+ */
121
+ public $meta_key_review_author_url = "_ywar_review_author_url";
122
+
123
+ /**
124
+ * @var string meta_key used for saving review author's IP
125
+ */
126
+ public $meta_key_review_author_IP = "_ywar_review_author_IP";
127
+
128
+ public $custom_column_review = "review-text";
129
 
130
+ public $custom_column_rating = "review-rating";
131
 
132
+ public $custom_column_date = "review-date";
133
 
134
+ public $custom_column_author = "review-author";
135
 
136
+ public $custom_column_product = "product";
137
 
138
+ /**
139
+ * @var string action name for "approve" review
140
+ */
141
+ protected $approve_review_action = "approve-review";
142
 
143
+ /**
144
+ * @var string action name for "untrash" review
145
+ */
146
+ protected $untrash_review_action = "untrash";
147
 
148
+ /**
149
+ * @var string action name for "unapprove" review
150
+ */
151
+ protected $unapprove_review_action = "unapprove-review";
152
 
153
+ /**
154
+ * Single instance of the class
155
+ *
156
+ * @since 1.0.0
157
+ */
158
+ protected static $instance;
159
 
160
+ /**
161
+ * Returns single instance of the class
162
+ *
163
+ * @since 1.0.0
164
+ */
165
+ public static function get_instance() {
166
+ if (is_null(self::$instance)) {
167
+ self::$instance = new self();
168
+ }
169
 
170
+ return self::$instance;
171
+ }
172
 
173
+ /**
174
+ * Constructor
175
+ *
176
+ * Initialize plugin and registers actions and filters to be used
177
+ *
178
+ * @since 1.0
179
+ * @author Lorenzo Giuffrida
180
+ */
181
+ protected function __construct() {
182
+ if (!function_exists('WC')) {
183
+ return;
184
+ }
185
 
186
+ add_action('admin_menu', array($this, 'add_menu_item'));
187
 
188
+ add_action('init', array($this, 'initialize_settings'));
189
 
190
+ //region ******* YIT Plugin Framework *********
191
 
192
+ // Load Plugin Framework
193
+ add_action('after_setup_theme', array($this, 'plugin_fw_loader'), 1);
194
 
195
 
196
+ // Add row meta
197
+ add_filter('plugin_row_meta', array($this, 'plugin_row_meta'), 10, 4);
198
 
199
+ // Add stylesheets and scripts files
200
+ add_action('admin_menu', array($this, 'register_panel'), 5);
201
 
202
+ // register plugin pointer
203
+ add_action('admin_init', array($this, 'register_pointer'));
204
 
205
+ // verify import reviews action request
206
+ add_action("admin_init", array($this, "check_import_actions"));
207
 
208
 
209
+ //Add action links
210
+ add_filter('plugin_action_links_' . plugin_basename(YITH_YWAR_DIR . '/' . basename(YITH_YWAR_FILE)), array(
211
+ $this,
212
+ 'action_links'
213
+ ));
214
 
215
+ add_action('yith_advanced_reviews_premium', array($this, 'premium_tab'));
216
 
217
+ //endregion
218
 
219
+ //region *********** Add stylesheets and scripts files ************
220
 
221
+ add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));
222
+ add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
223
+ add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles_scripts'));
224
 
225
+ //endregion
226
 
227
+ //region *********** Advanced reviews post type functionalities
228
 
229
+ add_action('init', array($this, 'register_post_type'));
230
 
231
 
232
+ //endregion
233
 
234
+ //region *********** Review table
235
 
236
+ add_filter('yith_advanced_reviews_row_actions', array($this, 'add_review_actions'), 10, 2);
237
 
238
+ add_filter('post_class', array($this, 'add_review_table_class'), 10, 3);
239
 
240
+ /**
241
+ * intercept approve and unapprove actions
242
+ */
243
+ add_action("admin_action_{$this->approve_review_action}", array($this, 'update_review_attributes'));
244
+ add_action("admin_action_{$this->unapprove_review_action}", array($this, 'update_review_attributes'));
245
+ add_action("admin_action_{$this->untrash_review_action}", array($this, 'update_review_attributes'));
246
 
247
+ //endregion ******************************************
248
 
249
+ // Load reviews template
250
+ add_filter('comments_template', array(
251
+ $this,
252
+ 'show_advanced_reviews_template'
253
+ ), 99);
254
 
255
+ // Save additional comment fields on comment submit
256
+ add_action('comment_post', array($this, 'submit_review'));
257
 
258
+ // redirect to product page on comment submitted
259
+ add_filter('comment_post_redirect', array($this, 'redirect_after_submit_review'), 10, 2);
260
 
261
+ add_filter('woocommerce_product_review_comment_form_args', array(
262
+ $this,
263
+ 'add_fields_to_comment_form'
264
+ ));
265
 
266
+ // Add custom fields "Title" on top of comment form
267
+ add_action('comment_form_logged_in_after', array($this, 'add_custom_fields_on_comment_form'));
268
+ add_action('comment_form_after_fields', array($this, 'add_custom_fields_on_comment_form'));
269
 
270
+ add_filter('yith_advanced_reviews_review_content', array($this, 'show_expanded_review_content'));
271
 
272
+ add_filter('woocommerce_product_tabs', array($this, 'update_tab_reviews_count'), 20);
273
 
274
+ /**
275
+ * Add summary bars for product rating
276
+ */
277
+ add_action('yith_advanced_reviews_before_reviews', array($this, 'load_reviews_summary'));
278
 
279
+ // Show details with average rating for the current product
280
+ add_action('ywar_summary_prepend', array($this, 'add_reviews_average_info'));
281
 
282
+ add_filter('wc_get_template', array($this, 'wc_get_template'), 99, 5);
283
 
284
+ add_filter('woocommerce_product_get_rating_html', array($this, 'get_product_rating_html'), 99, 2);
285
 
286
+ //region ***************** Show, edit and save back-end review metabox
287
+ // Add a new metabox for editing and saving title comment in meta_comment table
288
+ add_action('add_meta_boxes', array($this, 'add_plugin_metabox'), 1);
289
 
290
+ // save the custom fields
291
+ add_action('save_post', array($this, 'save_plugin_metabox'), 1, 2);
292
 
293
+ add_action('admin_menu', array($this, 'remove_unwanted_custom_post_type_features'), 5);
294
+ add_action('admin_head', array($this, 'hide_unwanted_custom_post_type_features'));
295
+ //endregion
296
 
297
+ add_action('woocommerce_admin_field_ywar_import_previous_reviews', array(
298
+ $this,
299
+ 'show_import_reviews_button'
300
+ ), 10, 1);
301
 
302
+ add_action('wp_ajax_convert_reviews', array($this, 'convert_reviews_callback'));
303
+ }
304
 
305
+ /**
306
+ * Add the Commissions menu item in dashboard menu
307
+ *
308
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
309
+ * @since 1.0
310
+ * @return void
311
+ * @see wp-admin\includes\plugin.php -> add_menu_page()
312
+ */
313
+ public function add_menu_item() {
314
 
315
+ $args = apply_filters('yith_wc_product_vendors_commissions_menu_items', array(
316
+ 'page_title' => __('Reviews', 'ywar'),
317
+ 'menu_title' => __('Reviews', 'ywar'),
318
+ 'capability' => 'edit_products',
319
+ 'menu_slug' => __('Reviews', 'ywar'),
320
+ 'function' => array($this, 'show_reviews_table'),
321
+ 'icon' => 'dashicons-star-filled',
322
+ 'position' => 8 /* After WC Products */
323
+ )
324
+ );
325
 
326
+ extract($args);
327
 
328
+ add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon, $position);
329
+ }
330
 
331
+ /**
332
+ * Show the reviews table
333
+ *
334
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
335
+ * @since 1.0
336
+ * @return void
337
+ * @fire yith_vendors_commissions_template hooks
338
+ */
339
+ public function show_reviews_table() {
340
+ if (!class_exists('WP_Posts_List_Table')) {
341
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php');
342
+ }
343
+
344
+ require_once(YITH_YWAR_DIR . 'lib/class.yith-advanced-reviews-list-table.php');
345
+
346
+ $product_reviews = new YITH_Advanced_Reviews_List_Table();
347
+ $product_reviews->prepare_items();
348
+
349
+ wc_get_template('ywar-product-reviews-table.php', array('product_reviews' => $product_reviews), YITH_YWAR_TEMPLATES_DIR, YITH_YWAR_TEMPLATES_DIR);
350
+ }
351
+
352
+ /**
353
+ * Intercept review action url and do the requested job
354
+ */
355
+ public function update_review_attributes() {
356
+
357
+ if (!isset($_GET["review_id"])) {
358
+ return;
359
+ }
360
+
361
+ $review_id = $_GET["review_id"];
362
+
363
+ $current_filter = current_filter();
364
+
365
+ switch ($current_filter) {
366
+ case "admin_action_{$this->approve_review_action}" :
367
+ update_post_meta($review_id, $this->meta_key_approved, 1);
368
+
369
+ break;
370
+
371
+ case "admin_action_{$this->unapprove_review_action}" :
372
+ update_post_meta($review_id, $this->meta_key_approved, 0);
373
+
374
+ break;
375
+
376
+ case "admin_action_{$this->untrash_review_action}" :
377
+ $my_post = array(
378
+ 'ID' => $review_id,
379
+ 'post_status' => 'publish'
380
+ );
381
+
382
+ // Update the post into the database
383
+ wp_update_post($my_post);
384
+
385
+ break;
386
+ }
387
+
388
+ wp_redirect(esc_url_raw(remove_query_arg(array('action', 'action2'), $_SERVER['HTTP_REFERER'])));
389
+ }
390
+
391
+ public function add_review_table_class($classes, $class, $post_id) {
392
+
393
+ if ($this->post_type_name != get_post_type($post_id)) {
394
+ return $classes;
395
+ }
396
+
397
+ unset($classes["review-unapproved"]);
398
+ unset($classes["review-approved"]);
399
+
400
+ $approve = get_post_meta($post_id, $this->meta_key_approved, true);
401
+
402
+ if (1 == $approve) {
403
+ $classes[] = "review-approved";
404
+ } elseif (0 == $approve) {
405
+ $classes[] = "review-unapproved";
406
+ }
407
+
408
+ return apply_filters('yith_advanced_reviews_table_class', $classes, $post_id);
409
+ }
410
+
411
+ /**
412
+ * Build a url to be using as action url in row actions
413
+ *
414
+ * @param $action action to be performed
415
+ * @param $post_id review id
416
+ *
417
+ * @return string|void the url used to send an "approve" action for a specific review
418
+ */
419
+ public function review_action_url($action, $post_id) {
420
+ return admin_url("admin.php?action=$action&post_type={$this->post_type_name}&review_id=$post_id");
421
+ }
422
+
423
+ /**
424
+ * Build an "untrash" action url
425
+ *
426
+ * @param $review the review on which the action is performed
427
+ *
428
+ * @return string|void action url
429
+ */
430
+ public function untrash_review_url($review) {
431
+ return $this->review_action_url($this->untrash_review_action, $review->ID);
432
+ }
433
+
434
+ /**
435
+ * Build an "approve" action url
436
+ *
437
+ * @param $review the review on which the action is performed
438
+ *
439
+ * @return string|void action url
440
+ */
441
+ public function approve_review_url($review) {
442
+ return $this->review_action_url($this->approve_review_action, $review->ID);
443
+ }
444
+
445
+ /**
446
+ * Build an "unapprove" action url
447
+ *
448
+ * @param $review the review on which the action is performed
449
+ *
450
+ * @return string|void action url
451
+ */
452
+ public function unapprove_review_url($review) {
453
+ return $this->review_action_url($this->unapprove_review_action, $review->ID);
454
+ }
455
+
456
+ public function add_review_actions($actions, $post) {
457
+
458
+ if ($post->post_type != $this->post_type_name) {
459
+ return $actions;
460
+ }
461
+
462
+ $approved = get_post_meta($post->ID, $this->meta_key_approved, true);
463
+
464
+ unset($actions['view']);
465
+ unset($actions['inline hide-if-no-js']);
466
+
467
+ if (!$approved) {
468
+ $actions['approve-review'] = '<a href="' . $this->approve_review_url($post) . '" title="' . esc_attr(__('Approve review', 'ywar')) . '" rel="permalink">' . __('Approve', 'ywar') . '</a>';
469
+ } elseif ($approved) {
470
+ $actions['unapprove-review'] = '<a href="' . $this->unapprove_review_url($post) . '" title="' . esc_attr(__('Unapprove review', 'ywar')) . '" rel="permalink">' . __('Unapprove', 'ywar') . '</a>';
471
+ }
472
+
473
+ return apply_filters('yith_advanced_reviews_review_actions', $actions, $post);
474
+ }
475
+
476
+ public function get_average_rating($product_id) {
477
+ global $wpdb;
478
+
479
+ $query = $wpdb->prepare("
480
  select avg(meta_value)
481
  from {$wpdb->prefix}postmeta pm
482
  where meta_key = '{$this->meta_key_rating}' and post_id in
483
  (select post_id from {$wpdb->prefix}postmeta where meta_key = '{$this->meta_key_product_id}' and meta_value = %d and post_id IN
484
+ (select post_id from {$wpdb->prefix}postmeta where meta_key = '{$this->meta_key_approved}' and meta_value = 1))", $product_id);
485
 
486
+ $count = $wpdb->get_var($query);
487
 
488
+ return number_format($count, 2);
489
+ }
490
 
491
+ public function add_reviews_average_info($product) {
492
 
493
+ if (get_option('woocommerce_enable_review_rating') === 'no') {
494
+ return;
495
+ }
496
 
497
+ global $product;
498
 
499
+ $average = $this->get_average_rating($product->id);
500
 
501
+ $count = count($this->get_product_reviews_by_rating($product->id));
502
 
503
+ if ($count > 0) {
504
+ echo '<div class="woocommerce-product-rating">
505
+ <div class="star-rating" title="' . sprintf(__('Rated %s out of 5', 'ywar'), $average) . '">
506
+ <span style="width:' . (($average / 5) * 100) . '%"></span>
507
  </div>
508
+ <span class="ywar_review_count">' . sprintf("%d %s", $count, _n(" review", " reviews", $count, 'ywar')) . '</span><span class="review-rating-value"> ' . esc_html($average) . ' ' . __("out of 5 stars", 'ywar') . '</span>
509
  </div>';
510
+ }
511
+ }
512
+
513
+ //region *********** YIT Plugin Framework ****************
514
+
515
+
516
+ /**
517
+ * Enqueue css file
518
+ *
519
+ * @since 1.0
520
+ * @access public
521
+ * @return void
522
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
523
+ */
524
+ public function plugin_fw_loader() {
525
+ if (!defined('YIT') || !defined('YIT_CORE_PLUGIN')) {
526
+ require_once('plugin-fw/yit-plugin.php');
527
+ }
528
+ }
529
+
530
+ /**
531
+ * plugin_row_meta
532
+ *
533
+ * add the action links to plugin admin page
534
+ *
535
+ * @param $plugin_meta
536
+ * @param $plugin_file
537
+ * @param $plugin_data
538
+ * @param $status
539
+ *
540
+ * @return Array
541
+ * @since 1.0
542
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
543
+ * @use plugin_row_meta
544
+ */
545
+ public function plugin_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) {
546
+ if ((defined('YITH_YWAR_INIT') && (YITH_YWAR_INIT == $plugin_file)) ||
547
+ (defined('YITH_YWAR_FREE_INIT') && (YITH_YWAR_FREE_INIT == $plugin_file))
548
+ ) {
549
+ $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __('Plugin Documentation', 'ywar') . '</a>';
550
+ }
551
+
552
+ return $plugin_meta;
553
+ }
554
+
555
+ /**
556
+ * Action Links
557
+ *
558
+ * add the action links to plugin admin page
559
+ *
560
+ * @param $links | links plugin array
561
+ *
562
+ * @return mixed Array
563
+ * @since 1.0
564
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
565
+ * @return mixed
566
+ * @use plugin_action_links_{$plugin_file_name}
567
+ */
568
+ public function action_links($links) {
569
+
570
+ $links[] = '<a href="' . admin_url("admin.php?page={$this->_panel_page}") . '">' . __('Settings', 'ywar') . '</a>';
571
+
572
+ if (defined('YITH_YWAR_FREE_INIT')) {
573
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __('Premium Version', 'ywar') . '</a>';
574
+ }
575
+
576
+ return $links;
577
+ }
578
+
579
+ public function register_pointer() {
580
+ if (!class_exists('YIT_Pointers')) {
581
+ include_once('plugin-fw/lib/yit-pointers.php');
582
+ }
583
+
584
+ $premium_message = defined('YITH_YWAR_PREMIUM')
585
+ ? ''
586
+ : __('YITH WooCommerce Advanced Reviews is available in an outstanding PREMIUM version with many new options, discover it now.', 'ywar') .
587
+ ' <a href="' . $this->get_premium_landing_uri() . '">' . __('Premium version', 'ywar') . '</a>';
588
+
589
+ $args[] = array(
590
+ 'screen_id' => 'plugins',
591
+ 'pointer_id' => 'yith_ywar_panel',
592
+ 'target' => '#toplevel_page_yit_plugin_panel',
593
+ 'content' => sprintf('<h3> %s </h3> <p> %s </p>',
594
+ __('YITH WooCommerce Advanced Reviews', 'ywar'),
595
+ __('In YIT Plugins tab you can find YITH WooCommerce Advanced Reviews options. From this menu you can access all settings of YITH plugins activated.', 'ywar') . '<br>' . $premium_message
596
+ ),
597
+ 'position' => array('edge' => 'left', 'align' => 'center'),
598
+ 'init' => defined('YITH_YWAR_PREMIUM') ? YITH_YWAR_INIT : YITH_YWAR_FREE_INIT
599
+ );
600
+
601
+ $args[] = array(
602
+ 'screen_id' => 'update',
603
+ 'pointer_id' => 'yith_ywar_panel',
604
+ 'target' => '#toplevel_page_yit_plugin_panel',
605
+ 'content' => sprintf('<h3> %s </h3> <p> %s </p>',
606
+ __('YITH WooCommerce Advanced Reviews', 'ywar'),
607
+ __('From now on, you can find all YITH WooCommerce Advanced Reviews options in YIT Plugin -> Advanced Reviews instead of WooCommerce -> Settings -> Advanced Reviews, as in the previous version. Any time one of our plugins is updated, a new entry will be added to this menu.', 'ywar') . $premium_message
608
+ ),
609
+ 'position' => array('edge' => 'left', 'align' => 'center'),
610
+ 'init' => defined('YITH_YWAR_PREMIUM') ? YITH_YWAR_INIT : YITH_YWAR_FREE_INIT
611
+ );
612
+
613
+ YIT_Pointers()->register($args);
614
+ }
615
+
616
+ /**
617
+ * Get the premium landing uri
618
+ *
619
+ * @since 1.0.0
620
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
621
+ * @return string The premium landing link
622
+ */
623
+ public function get_premium_landing_uri() {
624
+ return defined('YITH_REFER_ID') ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
625
+ }
626
+
627
+ /**
628
+ * Add a panel under YITH Plugins tab
629
+ *
630
+ * @return void
631
+ * @since 1.0
632
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
633
+ * @use /Yit_Plugin_Panel class
634
+ * @see plugin-fw/lib/yit-plugin-panel.php
635
+ */
636
+ public function register_panel() {
637
+
638
+ if (!empty($this->_panel)) {
639
+ return;
640
+ }
641
+
642
+ $admin_tabs = array(
643
+ 'general' => __('General', 'ywar'),
644
+ 'layout' => __('Layout', 'ywar')
645
+ );
646
+
647
+ if (defined('YITH_YWAR_PREMIUM')) {
648
+ $admin_tabs['premium'] = __('Voting/Review settings', 'ywar');
649
+ } else {
650
+ $admin_tabs['premium-landing'] = __('Premium Version', 'ywar');
651
+ }
652
+
653
+ $args = array(
654
+ 'create_menu_page' => true,
655
+ 'parent_slug' => '',
656
+ 'page_title' => __('Advanced Reviews', 'ywar'),
657
+ 'menu_title' => __('Advanced Reviews', 'ywar'),
658
+ 'capability' => 'manage_options',
659
+ 'parent' => '',
660
+ 'parent_page' => 'yit_plugin_panel',
661
+ 'page' => $this->_panel_page,
662
+ 'admin-tabs' => $admin_tabs,
663
+ 'options-path' => YITH_YWAR_DIR . '/plugin-options'
664
+ );
665
+
666
+ /* === Fixed: not updated theme === */
667
+ if (!class_exists('YIT_Plugin_Panel_WooCommerce')) {
668
+ require_once('plugin-fw/lib/yit-plugin-panel-wc.php');
669
+ }
670
+
671
+ $this->_panel = new YIT_Plugin_Panel_WooCommerce($args);
672
+ }
673
+
674
+ /**
675
+ * Premium Tab Template
676
+ *
677
+ * Load the premium tab template on admin page
678
+ *
679
+ * @return void
680
+ * @since 1.0
681
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
682
+ * @return void
683
+ */
684
+ public function premium_tab() {
685
+ $premium_tab_template = YITH_YWAR_TEMPLATE_PATH . '/admin/' . $this->_premium;
686
+ if (file_exists($premium_tab_template)) {
687
+ include_once($premium_tab_template);
688
+ }
689
+ }
690
+
691
+ //endregion
692
+
693
+ //region *********** Add stylesheets and scripts files ************
694
+
695
+ /**
696
+ * Add scripts
697
+ *
698
+ * @since 1.0
699
+ * @author Lorenzo Giuffrida
700
+ */
701
+ public function enqueue_scripts() {
702
+ // register and enqueue ajax calls related script file
703
+ wp_register_script("attachments-script", YITH_YWAR_URL . 'assets/js/ywar-attachments.js', array('jquery'));
704
+
705
+ wp_localize_script('attachments-script', 'attach', array(
706
+ 'limit_multiple_upload' => $this->attachments_limit
707
+ ));
708
+ wp_enqueue_script('attachments-script');
709
+ }
710
+
711
+ /**
712
+ * Enqueue css file
713
+ *
714
+ * @since 1.0
715
+ * @author Lorenzo Giuffrida
716
+ */
717
+ public function enqueue_styles() {
718
+ wp_enqueue_style('yit-style', YITH_YWAR_ASSETS_URL . '/css/yit-advanced-reviews.css');
719
+ }
720
+
721
+ /**
722
+ * Enqueue scripts on administration comment page
723
+ *
724
+ * @param $hook
725
+ */
726
+ function enqueue_admin_styles_scripts($hook) {
727
+ if ('toplevel_page_Reviews' != get_current_screen()->id) {
728
+ return;
729
+ }
730
+
731
+ /** Add Woocommerce.css file */
732
+ $styles = (array)WC_Frontend_Scripts::get_styles();
733
+
734
+ if (array_key_exists('woocommerce-general', $styles)) {
735
+ wp_enqueue_style('woocommerce-general', $styles['woocommerce-general']['src']);
736
+ }
737
+
738
+ wp_enqueue_style('yit-style', YITH_YWAR_ASSETS_URL . '/css/yit-advanced-reviews.css');
739
+
740
+ wp_register_script("ajax-back-end-script", YITH_YWAR_URL . 'assets/js/ywar-back-end.js', array(
741
+ 'jquery',
742
+ 'jquery-blockui'
743
+ ));
744
+
745
+ $loader = apply_filters('yith_advanced_reviews_loader_gif', YITH_YWAR_ASSETS_URL . '/images/loading.gif');
746
+
747
+ wp_localize_script('ajax-back-end-script', 'ywar', array(
748
+ 'loader' => $loader,
749
+ 'ajax_url' => admin_url('admin-ajax.php')
750
+ ));
751
+
752
+ wp_enqueue_script("ajax-back-end-script");
753
+ }
754
+
755
+ //endregion
756
+
757
+ //region *********** Advanced reviews post type functionalities
758
+
759
+ /**
760
+ * Register advanced reviews post type
761
+ */
762
+ public function register_post_type() {
763
+ // Set UI labels for Custom Post Type
764
+ $labels = array(
765
+ 'name' => _x('Reviews', 'Post Type General Name', 'ywar'),
766
+ 'singular_name' => _x('Review', 'Post Type Singular Name', 'ywar'),
767
+ 'menu_name' => __('Reviews', 'ywar'),
768
+ 'parent_item_colon' => __('Parent Review', 'ywar'),
769
+ 'all_items' => __('All reviews', 'ywar'),
770
+ 'view_item' => __('View review', 'ywar'),
771
+ 'add_new_item' => __('Add New Review', 'ywar'),
772
+ 'add_new' => __('Add New', 'ywar'),
773
+ 'edit_item' => __('Edit Review', 'ywar'),
774
+ 'update_item' => __('Update Review', 'ywar'),
775
+ 'search_items' => __('Search Review', 'ywar'),
776
+ 'not_found' => __('Not Found', 'ywar'),
777
+ 'not_found_in_trash' => __('Not found in bin', 'ywar'),
778
+ );
779
 
780
  // Set other options for Custom Post Type
781
 
782
+ $args = array(
783
+ 'label' => __('YIT Product reviews', 'ywar'),
784
+ 'description' => __('Advanced WooCommerce product reviews', 'ywar'),
785
+ 'labels' => $labels,
786
  // Features this CPT supports in Post Editor
787
+ 'supports' => array(
788
+ 'title',
789
+ 'editor',
790
+ 'author',
791
+ ),
792
+ /* A hierarchical CPT is like Pages and can have
793
+ * Parent and child items. A non-hierarchical CPT
794
+ * is like Posts.
795
+ */
796
+ 'hierarchical' => true,
797
+ 'public' => true,
798
+ 'show_ui' => false,
799
+ 'show_in_menu' => true,
800
+ 'show_in_nav_menus' => false,
801
+ 'show_in_admin_bar' => true,
802
+ 'menu_position' => 9,
803
+ 'can_export' => true,
804
+ 'has_archive' => true,
805
+ 'exclude_from_search' => true,
806
+ 'publicly_queryable' => false,
807
+ 'capability_type' => 'page',
808
+ 'menu_icon' => 'dashicons-star-filled',
809
+ 'query_var' => false,
810
+ );
811
 
812
  // Registering your Custom Post Type
813
+ register_post_type($this->post_type_name, $args);
814
+
815
+
816
+ }
817
+
818
+
819
+ /**
820
+ * Default query arguments to be used where querying to review custom post type
821
+ *
822
+ * @param $product_id
823
+ *
824
+ * @return array
825
+ */
826
+ function default_query_args($product_id) {
827
+ return array(
828
+ 'numberposts' => -1, //By default retrieve all reviews
829
+ 'offset' => 0,
830
+ 'orderby' => 'post_date',
831
+ 'order' => 'DESC',
832
+ 'post_type' => 'ywar_reviews',
833
+ 'post_parent' => '0',
834
+ 'post_status' => 'publish',
835
+ 'meta_query' => array(
836
+ 'relation' => 'AND',
837
+ array(
838
+ 'key' => $this->meta_key_product_id,
839
+ 'value' => $product_id,
840
+ 'compare' => '=',
841
+ 'type' => 'numeric'
842
+ ),
843
+ array(
844
+ 'key' => $this->meta_key_approved,
845
+ 'value' => 1,
846
+ 'compare' => '=',
847
+ 'type' => 'numeric'
848
+ )
849
+ )
850
+ );
851
+ }
852
+
853
+ /**
854
+ * Retrieve reviews for a product
855
+ *
856
+ * @param $product_id product id for whose retrieve the reviews
857
+ */
858
+ public function get_product_reviews($product_id = null, $args = null) {
859
+
860
+ if ($args == null) {
861
+ $args = $this->default_query_args($product_id);
862
+ }
863
+
864
+ // if $product_id is null, retrieve all reviews without filters
865
+ if (is_null($product_id)) {
866
+ unset($args['meta_query']);
867
+ }
868
+
869
+ return get_posts($args);
870
+ }
871
+
872
+
873
+ /**
874
+ * Return the number of reviews for a specific product
875
+ *
876
+ * @param $product_id product id for whose retrieve the reviews
877
+ */
878
+ public function get_product_reviews_by_rating($product_id, $rating = 0) {
879
+ $args = $this->default_query_args($product_id);
880
+ if ($rating > 0) {
881
+ $args['meta_query'][] = array(
882
+ 'key' => $this->meta_key_rating,
883
+ 'value' => $rating,
884
+ 'compare' => '=',
885
+ 'type' => 'numeric'
886
+ );
887
+ }
888
+
889
+ return $this->get_product_reviews($product_id, $args);
890
+ }
891
+
892
+
893
+ /**
894
+ * Show the reviews for a specific product
895
+ *
896
+ * @param $product_id product id for whose should be shown the reviews
897
+ */
898
+ public function reviews_list($product_id, $args = null) {
899
+ $reviews = $this->get_product_reviews($product_id, $args);
900
+
901
+ foreach ($reviews as $review) {
902
+ $this->show_review($review);
903
+ }
904
+ }
905
+
906
+ /**
907
+ * Call the review template and show the review
908
+ *
909
+ * @param $review review to be shown
910
+ */
911
+ public function show_review($review, $featured = false, $classes = '') {
912
+ global $ywar_review;
913
+ $ywar_review = $review;
914
+ wc_get_template('ywar-review.php', array(
915
+ 'review' => $review,
916
+ 'featured' => $featured,
917
+ 'classes' => $classes
918
+ ), '', YITH_YWAR_TEMPLATES_DIR);
919
+ }
920
+
921
+ //endregion
922
+
923
+ /**
924
+ * Initialize plugin options
925
+ *
926
+ * @since 1.0
927
+ * @access public
928
+ * @access public
929
+ * @return void
930
+ * @author Lorenzo Giuffrida
931
+ */
932
+ public function initialize_settings() {
933
+ $this->enable_title = get_option('ywar_enable_review_title') === 'yes';
934
+ $this->enable_attachments = get_option('ywar_enable_attachments') === 'yes';
935
+ $this->attachments_limit = get_option('ywar_max_attachments');
936
+ }
937
+
938
+ /**
939
+ * Return the right path to the reviews template file
940
+ *
941
+ * @param $template the template that is currently used
942
+ *
943
+ * @return mixed|void new template path, only for product comments page
944
+ */
945
+ public function show_advanced_reviews_template($template) {
946
+
947
+ if (get_post_type() === 'product') {
948
+ // return apply_filters( 'ywar_show_advanced_reviews_template', YITH_YWAR_TEMPLATES_DIR . "ywar-product-reviews.php" );
949
+ return wc_locate_template("ywar-product-reviews.php", '', YITH_YWAR_TEMPLATES_DIR);
950
+ }
951
+
952
+ return $template;
953
+ }
954
+
955
+ /**
956
+ * Create new Advanced Review post type when a comment is saved to database
957
+ *
958
+ * @since 1.0
959
+ * @author Lorenzo Giuffrida
960
+ */
961
+ public function submit_review($comment_id) {
962
+ if (!isset($_POST)) {
963
+ return;
964
+ }
965
+
966
+ $review_title = $this->enable_title && isset($_POST["title"]) ? wp_strip_all_tags($_POST["title"]) : '';
967
+
968
+ $post_parent = apply_filters('yith_advanced_reviews_post_parent', $_POST["comment_parent"]);
969
+
970
+ $comment = get_comment($comment_id);
971
+
972
+ // Create post object
973
+ $my_post = array(
974
+ 'post_author' => $comment->user_id,
975
+ 'post_title' => $review_title,
976
+ 'post_content' => $comment->comment_content,
977
+ 'post_status' => 'publish',
978
+ 'post_author' => get_current_user_id(),
979
+ 'post_type' => $this->post_type_name,
980
+ 'post_parent' => $post_parent,
981
+ 'review_user_id' => $comment->user_id,
982
+ 'review_rating' => (isset($_POST["rating"]) ? $_POST["rating"] : 0),
983
+ 'review_product_id' => $comment->comment_post_ID,
984
+ 'review_comment_id' => $comment_id,
985
+ 'review_approved' => apply_filters('yith_advanced_reviews_approve_new_review', true),
986
+ 'review_author' => $comment->comment_author,
987
+ 'review_author_email' => $comment->comment_author_email,
988
+ 'review_author_IP' => $comment->comment_author_IP,
989
+ 'review_author_url' => $comment->comment_author_url
990
+ );
991
+
992
+ // Insert the post into the database
993
+ $review_id = $this->insert_review($my_post);
994
+
995
+ $this->submit_attachments($review_id);
996
+ }
997
+
998
+ public function insert_review($args) {
999
+ // Create post object
1000
+ $defaults = array(
1001
+ 'post_title' => '',
1002
+ 'post_content' => '',
1003
+ 'post_status' => 'publish',
1004
+ 'post_author' => 0,
1005
+ 'post_type' => $this->post_type_name,
1006
+ 'post_parent' => 0,
1007
+ 'review_user_id' => 0,
1008
+ 'review_approved' => 1,
1009
+ 'review_rating' => 0,
1010
+ 'review_product_id' => 0,
1011
+ 'review_comment_id' => 0,
1012
+ 'review_upvotes' => 0,
1013
+ 'review_downvotes' => 0,
1014
+ 'review_votes' => array(),
1015
+ 'review_inappropriate_list' => array(),
1016
+ 'review_inappropriate_count' => 0,
1017
+ 'review_is_featured' => 0,
1018
+ 'review_is_reply_blocked' => 0,
1019
+ 'review_thumbnails' => array(),
1020
+ 'review_author' => '',
1021
+ 'review_author_email' => '',
1022
+ 'review_author_url' => '',
1023
+ 'review_author_IP' => ''
1024
+ );
1025
+
1026
+ $args = wp_parse_args($args, $defaults);
1027
+
1028
+ // Insert the post into the database
1029
+ $review_id = wp_insert_post($args);
1030
+
1031
+ // Set rating only for top level reviews, not for replies
1032
+ if (0 != $args["post_parent"]) {
1033
+ update_post_meta($review_id, $this->meta_key_rating, 0);
1034
+ } else {
1035
+ update_post_meta($review_id, $this->meta_key_rating, $args["review_rating"]);
1036
+ }
1037
+
1038
+ update_post_meta($review_id, $this->meta_key_rating, $args["review_rating"]);
1039
+ update_post_meta($review_id, $this->meta_key_approved, $args["review_approved"]);
1040
+ update_post_meta($review_id, $this->meta_key_product_id, $args["review_product_id"]);
1041
+ update_post_meta($review_id, $this->meta_key_comment_id, $args["review_comment_id"]);
1042
+ update_post_meta($review_id, $this->meta_key_thumb_ids, $args["review_thumbnails"]);
1043
+
1044
+ update_post_meta($review_id, $this->meta_key_upvotes_count, $args["review_upvotes"]);
1045
+ update_post_meta($review_id, $this->meta_key_downvotes_count, $args["review_downvotes"]);
1046
+ update_post_meta($review_id, $this->meta_key_votes, $args["review_votes"]);
1047
+
1048
+ update_post_meta($review_id, $this->meta_key_inappropriate_list, $args["review_inappropriate_list"]);
1049
+ update_post_meta($review_id, $this->meta_key_inappropriate_count, $args["review_inappropriate_count"]);
1050
+ update_post_meta($review_id, $this->meta_key_featured, $args["review_is_featured"]);
1051
+ update_post_meta($review_id, $this->meta_key_stop_reply, $args["review_is_reply_blocked"]);
1052
+
1053
+ update_post_meta($review_id, $this->meta_key_review_user_id, $args["review_user_id"]);
1054
+ update_post_meta($review_id, $this->meta_key_review_author, $args["review_author"]);
1055
+ update_post_meta($review_id, $this->meta_key_review_author_email, $args["review_author_email"]);
1056
+ update_post_meta($review_id, $this->meta_key_review_author_url, $args["review_author_url"]);
1057
+ update_post_meta($review_id, $this->meta_key_review_author_IP, $args["review_author_IP"]);
1058
+
1059
+ return $review_id;
1060
+ }
1061
+
1062
+ /**
1063
+ * redirect to product page on comment submitted
1064
+ */
1065
+ public function redirect_after_submit_review($location, $comment) {
1066
+ // Set the new comment as imported so it will not imported when clicking on "convert reviews", creating duplicated entries
1067
+ update_comment_meta($comment->comment_ID, $this->meta_key_imported, 1);
1068
+
1069
+ return get_permalink($comment->comment_post_ID);
1070
+ }
1071
+
1072
+ /**
1073
+ * Add custom field "Title" on top of comment form
1074
+ *
1075
+ * Check if the "enable title" option is activated and add a title field on comment form
1076
+ *
1077
+ * @return void
1078
+ *
1079
+ * @since 1.0
1080
+ * @author Lorenzo Giuffrida
1081
+ */
1082
+ public function add_custom_fields_on_comment_form() {
1083
+
1084
+ if (!is_product() && !(defined('DOING_AJAX') && DOING_AJAX)) {
1085
+ return;
1086
+ }
1087
+
1088
+ if ($this->enable_title) {
1089
+ echo '<p class="comment-form-title"><label for="title">' . __('Review title', 'ywar') . '</label><input type="text" name="title" id="title"/></p>';
1090
+ }
1091
+ }
1092
+
1093
+ //region *********** attachments ********************
1094
+
1095
+ /**
1096
+ * Submit attachments from a comment form
1097
+ *
1098
+ * Check if attachment option is enabled and option value is satisfied, then upload attachment files.
1099
+ *
1100
+ * @param int $review_id the review id the files are referred.
1101
+ *
1102
+ * @return void
1103
+ *
1104
+ * @since 1.0
1105
+ * @author Lorenzo Giuffrida
1106
+ */
1107
+ public function submit_attachments($review_id) {
1108
+ // check if attachments are enabled
1109
+ if (!$this->enable_attachments) {
1110
+ return;
1111
+ }
1112
+
1113
+ if ($_FILES) {
1114
+ $files = $_FILES["uploadFile"];
1115
+ $files_count = count($files['name']);
1116
+
1117
+ // check for attachments limits
1118
+ if (($this->attachments_limit > 0) && ($files_count > $this->attachments_limit)) {
1119
+ return;
1120
+ }
1121
+
1122
+ $attacchments_array = array();
1123
+
1124
+ foreach ($files['name'] as $key => $value) {
1125
+ if ($files['name'][$key]) {
1126
+ $file = array(
1127
+ 'name' => $files['name'][$key],
1128
+ 'type' => $files['type'][$key],
1129
+ 'tmp_name' => $files['tmp_name'][$key],
1130
+ 'error' => $files['error'][$key],
1131
+ 'size' => $files['size'][$key]
1132
+ );
1133
+ $_FILES = array("uploadFile" => $file);
1134
+
1135
+ foreach ($_FILES as $file => $array) {
1136
+ $attachId = $this->insert_attachment($file, $review_id);
1137
+
1138
+ // enqueue attachments to current comment
1139
+ array_push($attacchments_array, $attachId);
1140
+ }
1141
+ }
1142
+ }
1143
+
1144
+ // save review with attachments array
1145
+ update_post_meta($review_id, $this->meta_key_thumb_ids, $attacchments_array);
1146
+ }
1147
+ }
1148
+
1149
+ /**
1150
+ * Add attachment to media library
1151
+ *
1152
+ * @param int $postId
1153
+ * @param string $fileHandler
1154
+ *
1155
+ * @return void
1156
+ *
1157
+ * @since 1.0
1158
+ * @author Lorenzo Giuffrida
1159
+ */
1160
+ public function insert_attachment($fileHandler, $postId) {
1161
+ if ($_FILES[$fileHandler]['error'] !== UPLOAD_ERR_OK) {
1162
+ __return_false();
1163
+ }
1164
+
1165
+ require_once(ABSPATH . "wp-admin" . '/includes/image.php');
1166
+ require_once(ABSPATH . "wp-admin" . '/includes/file.php');
1167
+ require_once(ABSPATH . "wp-admin" . '/includes/media.php');
1168
+
1169
+ return media_handle_upload($fileHandler, $postId);
1170
+ }
1171
+
1172
+ /**
1173
+ * Append attachment fields on comment form
1174
+ *
1175
+ * @param object $comment_form
1176
+ *
1177
+ * @return object $comment_form
1178
+ *
1179
+ * @since 1.0
1180
+ * @author Lorenzo Giuffrida
1181
+ */
1182
+ public function add_fields_to_comment_form($comment_form) {
1183
+ $current_content = $comment_form['comment_field'];
1184
+
1185
+ // In case of a page refresh following a reply request, don't add additional fields
1186
+ $hide_rating = isset($_REQUEST["replytocom"]) ? "hide-rating" : '';
1187
+ $selected = isset($_REQUEST["replytocom"]) ? "selected" : '';
1188
+
1189
+ if (get_option('woocommerce_enable_review_rating') === 'yes') {
1190
+ $comment_form['comment_field'] = '<p class="' . $hide_rating . ' comment-form-rating">
1191
+ <label for="rating">' . __('Your Rate', 'ywar') . '</label>
1192
  <select name="rating" id="rating">
1193
+ <option value="">' . __('Rate&hellip;', 'ywar') . '</option>
1194
+ <option value="5">' . __('Perfect', 'ywar') . '</option>
1195
+ <option value="4">' . __('Good', 'ywar') . '</option>
1196
+ <option value="3">' . __('Average', 'ywar') . '</option>
1197
+ <option value="2">' . __('Not that bad', 'ywar') . '</option>
1198
+ <option value="1" ' . $selected . '>' . __('Very Poor', 'ywar') . '</option>';
1199
+
1200
+ $comment_form['comment_field'] .= '</select></p>' . $current_content;
1201
+ }
1202
+
1203
+ if ($this->enable_attachments) {
1204
+ $comment_form['comment_field'] .= '<p class="upload_section ' . $hide_rating . '" >
1205
+ <label for="uploadFile" > ' . __('Attachments', 'ywar') . ' </label >
1206
+ <input type = "button" value = "' . __('Choose file(s)', 'ywar') . '" id = "do_uploadFile" />
1207
  <input type = "file" name = "uploadFile[]" id = "uploadFile" accept = "image/*" multiple = "2" />
1208
  </p>
1209
  <p>
1210
  <ul id = "uploadFileList" ></ul>
1211
  </p> ';
1212
+ }
1213
+
1214
+ return $comment_form;
1215
+ }
1216
+
1217
+ //endregion
1218
+
1219
+ /**
1220
+ * Display a customized comment content
1221
+ *
1222
+ * @param string $text
1223
+ *
1224
+ * @return string customized comment content
1225
+ *
1226
+ * @since 1.0
1227
+ * @author Lorenzo Giuffrida
1228
+ */
1229
+ public function show_expanded_review_content($review) {
1230
+
1231
+ if (!is_product() && !(defined('DOING_AJAX') && DOING_AJAX)) {
1232
+ return $review->post_content;
1233
+ }
1234
+
1235
+ $review_title = '';
1236
+ $thumbnail_div = $this->get_thumbnails($review);
1237
+
1238
+ if ($this->enable_title) {
1239
+ // Add review title before review content text
1240
+ if (!empty($review->post_title)) {
1241
+ $review_title = '<span class="review_title"> ' . esc_attr($review->post_title) . '</span> ';
1242
+ }
1243
+ }
1244
+
1245
+ return $review_title . $review->post_content . $thumbnail_div;
1246
+ }
1247
+
1248
+ /**
1249
+ * Get an HTML formatted attachment section
1250
+ *
1251
+ * @param $review the review for whose retrieve attachments
1252
+ */
1253
+ public function get_thumbnails($review) {
1254
+ $is_toplevel = (0 == $review->post_parent);
1255
+ $thumbnail_div = '';
1256
+
1257
+ if ($is_toplevel && $this->enable_attachments) {
1258
+
1259
+ if ($thumbs = get_post_meta($review->ID, $this->meta_key_thumb_ids, true)) {
1260
+
1261
+ $thumbnail_div = '<div class="review_thumbnail horizontalRule"> ';
1262
+
1263
+ foreach ($thumbs as $thumb_id) {
1264
+ $file_url = wp_get_attachment_url($thumb_id);
1265
+ $image_thumb = wp_get_attachment_image_src($thumb_id, array(100, 100), true);
1266
+
1267
+ $thumbnail_div .= "<a href='$file_url' data-rel = \"prettyPhoto[review-gallery-$review->ID]\"><img class=\"ywar_thumbnail\" src='{$image_thumb[0]}' width='70px' height='70px'></a>";
1268
+ }
1269
+ $thumbnail_div .= ' </div> ';
1270
+ }
1271
+ }
1272
+
1273
+ return $thumbnail_div;
1274
+ }
1275
+
1276
+ /**
1277
+ * Alter text on tab reviews, fixing wrong count of reviews(even replies to reviews were used
1278
+ *
1279
+ * @param $tabs tabs with description for product reviews
1280
+ *
1281
+ * @return mixed
1282
+ */
1283
+ public function update_tab_reviews_count($tabs) {
1284
+ global $product;
1285
+
1286
+ if (isset($tabs['reviews'])) {
1287
+ $tabs['reviews']['title'] = sprintf(__('Reviews(%d)', 'ywar'), count($this->get_product_reviews_by_rating($product->id)));
1288
+ }
1289
+
1290
+ return $tabs;
1291
+ }
1292
+
1293
+ /**
1294
+ * Collect data about reviews rating and show a summary grouped by stars
1295
+ *
1296
+ * @param object $template a custom template to be shown
1297
+ *
1298
+ * @return object $template
1299
+ *
1300
+ * @since 1.0
1301
+ * @author Lorenzo Giuffrida
1302
+ */
1303
+ public function load_reviews_summary($template) {
1304
+ if (!is_product()) {
1305
+ return $template;
1306
+ }
1307
+
1308
+ global $product;
1309
+ global $review_stats;
1310
+ $review_stats = array(
1311
+ '1' => count($this->get_product_reviews_by_rating($product->id, 1)),
1312
+ '2' => count($this->get_product_reviews_by_rating($product->id, 2)),
1313
+ '3' => count($this->get_product_reviews_by_rating($product->id, 3)),
1314
+ '4' => count($this->get_product_reviews_by_rating($product->id, 4)),
1315
+ '5' => count($this->get_product_reviews_by_rating($product->id, 5)),
1316
+ 'total' => count($this->get_product_reviews_by_rating($product->id))
1317
+ );
1318
+
1319
+ wc_get_template('ywar-single-product-reviews.php', null, '', YITH_YWAR_TEMPLATES_DIR);
1320
+ }
1321
+
1322
+ /**
1323
+ * Add a metabox on review page for review's title
1324
+ *
1325
+ * @return void
1326
+ *
1327
+ * @since 1.0
1328
+ * @author Lorenzo Giuffrida
1329
+ */
1330
+ public function add_plugin_metabox() {
1331
+ add_meta_box('reviews-metabox', __('Review attributes', 'ywar'), array(
1332
+ $this,
1333
+ 'display_plugin_metabox'
1334
+ ), $this->post_type_name, 'normal', 'high');
1335
+ }
1336
+
1337
+ /**
1338
+ * Display a meta box with additional review data, like title and thumbnails
1339
+ *
1340
+ * @return void
1341
+ *
1342
+ * @since 1.0
1343
+ * @author Lorenzo Giuffrida
1344
+ */
1345
+ public function display_plugin_metabox() {
1346
+ global $post;
1347
+
1348
+ $rating_div = '';
1349
+ $thumbnail_div = '';
1350
+
1351
+ $current = get_post_meta($post->ID, $this->meta_key_rating, true);
1352
+ ?>
1353
+ <select name="rating" id="rating">
1354
+ <?php for ($rating = 0; $rating <= 5; $rating++) {
1355
+ echo sprintf('<option value="%1$s"%2$s>%1$s</option>', $rating, selected($current, $rating, false));
1356
+ } ?>
1357
+ </select>
1358
+
1359
+ <?php
1360
+ // Generate a hidden nonce used for verifying if a request to update the following values came from here
1361
+ echo '<input type="hidden" name="review_metabox_nonce" id="review_metabox_nonce" value="' .
1362
+ wp_create_nonce(plugin_basename(__FILE__)) . '" />';
1363
+
1364
+ $review_thumbnails = get_post_meta($post->ID, $this->meta_key_thumb_ids, true);
1365
+
1366
+ if (isset ($review_thumbnails) && is_array($review_thumbnails)) {
1367
+ $thumbnail_div = '<div style = "padding-top: 10px;padding-bottom: 10px;overflow:hidden"> ';
1368
+ foreach ($review_thumbnails as $thumb_id) {
1369
+ $file_url = wp_get_attachment_url($thumb_id);
1370
+ // $image_thumb = wp_get_attachment_image($thumb_id, array(100, 100), true );
1371
+ $image_thumb = wp_get_attachment_image_src($thumb_id, array(100, 100), true);
1372
+
1373
+ $thumbnail_div .= "<a href='$file_url'><img src='{$image_thumb[0]}' width='{$image_thumb[1]}' height='{$image_thumb[2]}'></a>";
1374
+ }
1375
+ $thumbnail_div .= '</div >';
1376
+ }
1377
+
1378
+ echo $thumbnail_div;
1379
+ }
1380
+
1381
+ /**
1382
+ * Save the Metabox Data
1383
+ *
1384
+ * @param $post_id
1385
+ * @param $post
1386
+ *
1387
+ * @return mixed
1388
+ */
1389
+ function save_plugin_metabox($post_id, $post) {
1390
+
1391
+ if (!isset($_POST['review_metabox_nonce'])) {
1392
+ return $post->ID;
1393
+ }
1394
+
1395
+ // verify the save request started from review edit page...
1396
+ if (!wp_verify_nonce($_POST['review_metabox_nonce'], plugin_basename(__FILE__))) {
1397
+ return $post->ID;
1398
+ }
1399
+
1400
+ // Check for authorization
1401
+ if (!current_user_can('edit_post', $post->ID)) {
1402
+ return $post->ID;
1403
+ }
1404
+
1405
+ // OK, we're authenticated: we need to find and save the data
1406
+ // We'll put it into an array to make it easier to loop though.
1407
+ if (isset($_POST['rating'])) {
1408
+ $rating = $_POST['rating'];
1409
+
1410
+ if (is_numeric($rating) && ($rating > 0) && ($rating <= 5)) {
1411
+ update_post_meta($post_id, $this->meta_key_rating, $rating);
1412
+ }
1413
+ }
1414
+ }
1415
+
1416
+ /**
1417
+ * Remove features for the review custom post type
1418
+ */
1419
+ public function remove_unwanted_custom_post_type_features() {
1420
+ global $submenu;
1421
+
1422
+ // Remove Add new for review custom post type
1423
+ unset($submenu["edit.php?post_type={$this->post_type_name}"][10]);
1424
+ }
1425
+
1426
+ public function hide_unwanted_custom_post_type_features() {
1427
+ if ($this->post_type_name == get_post_type()) {
1428
+ echo '<style type="text/css">
1429
 
1430
  .add-new-h2 {
1431
  display:none;
1432
  }
1433
 
1434
  </style>';
1435
+ }
1436
+ }
1437
+
1438
+ //region ******* Retrieve postmeta values
1439
+
1440
+ /**
1441
+ * Retrieve value for the "rating" meta_key for a specific review
1442
+ *
1443
+ * @param $review_id review id from which retrieve the meta_value
1444
+ *
1445
+ * @return mixed meta_value for "rating" meta_key
1446
+ */
1447
+ function get_meta_value_rating($review_id) {
1448
+ return get_post_meta($review_id, $this->meta_key_rating, true);
1449
+ }
1450
+
1451
+ /**
1452
+ * Retrieve value for the "approved" meta_key for a specific review
1453
+ *
1454
+ * @param $review_id review id from which retrieve the meta_value
1455
+ *
1456
+ * @return mixed meta_value for "approved" meta_key
1457
+ */
1458
+ function get_meta_value_approved($review_id) {
1459
+ return get_post_meta($review_id, $this->meta_key_approved, true);
1460
+ }
1461
+
1462
+ /**
1463
+ * Retrieve value for the "product_id" meta_key for a specific review
1464
+ *
1465
+ * @param $review_id review id from which retrieve the meta_value
1466
+ *
1467
+ * @return mixed meta_value for "product_id" meta_key
1468
+ */
1469
+ function get_meta_value_product_id($review_id) {
1470
+ return get_post_meta($review_id, $this->meta_key_product_id, true);
1471
+ }
1472
+
1473
+ /**
1474
+ * Retrieve information about the review author
1475
+ *
1476
+ * @param $review_id review id from which retrieve the meta_value
1477
+ *
1478
+ * @return array author's information
1479
+ */
1480
+ function get_meta_value_author($review_id) {
1481
+ return array(
1482
+ 'review_user_id' => get_post_meta($review_id, $this->meta_key_review_user_id, true),
1483
+ 'review_author' => get_post_meta($review_id, $this->meta_key_review_author, true),
1484
+ 'review_author_email' => get_post_meta($review_id, $this->meta_key_review_author_email, true),
1485
+ 'review_author_url' => get_post_meta($review_id, $this->meta_key_review_author_url, true),
1486
+ 'review_author_IP' => get_post_meta($review_id, $this->meta_key_review_author_IP, true)
1487
+ );
1488
+ }
1489
+
1490
+ //endregion
1491
+
1492
+ public function wc_get_template($located, $template_name, $args, $template_path, $default_path) {
1493
+ if ("single-product/rating.php" != $template_name) {
1494
+ return $located;
1495
+ }
1496
+
1497
+ $located = wc_locate_template("ywar-rating.php", $template_path, $default_path);
1498
+
1499
+ if (file_exists($located)) {
1500
+ return $located;
1501
+ }
1502
+
1503
+ return YITH_YWAR_TEMPLATES_DIR . 'ywar-rating.php';
1504
+ }
1505
+
1506
+ public function get_product_rating_html($rating_html, $rating) {
1507
+ global $product;
1508
+ $rating_html = '';
1509
+
1510
+ $rating = $this->get_average_rating($product->id);
1511
+
1512
+ if ($rating > 0) {
1513
+
1514
+ $rating_html = '<div class="star-rating" title="' . sprintf(__('Rated %s out of 5', 'ywar'), $rating) . '">';
1515
+
1516
+ $rating_html .= '<span style="width:' . (($rating / 5) * 100) . '%"><strong class="rating">' . $rating . '</strong> ' . __('out of 5', 'ywar') . '</span>';
1517
+
1518
+ $rating_html .= '</div>';
1519
+ }
1520
+
1521
+ return $rating_html;
1522
+ }
1523
+
1524
+ //region *********** Convert reviews from standard system to YITH Advanced reviews
1525
+
1526
+ /**
1527
+ * Show import button for starting convertion from standard system to YITH Advanced reviews
1528
+ *
1529
+ * @param array $args
1530
+ */
1531
+ public function show_import_reviews_button($args = array()) {
1532
+ if (!empty($args)) {
1533
+ $args['value'] = (get_option($args['id'])) ? get_option($args['id']) : '';
1534
+ extract($args);
1535
+ }
1536
+
1537
+ ?>
1538
+ <tr valign="top">
1539
+ <th scope="row">
1540
+
1541
+ </th>
1542
+
1543
+ <td class="forminp forminp-color plugin-option">
1544
+ <div class="convert-reviews">
1545
+ <a href="<?php echo esc_url(add_query_arg("convert-reviews", "start")); ?>"
1546
+ class="button convert-reviews"><?php _e("Convert reviews", "ywar"); ?></a>
1547
+
1548
+ <div style="display: inline-block; width: 65%; margin-left: 15px;"><span
1549
+ class="description"><?php _e("If this is the first time you install the YITH Advanced Reviews plugin, or if you are using an older version prior to the 1.1.0, first you have to convert the older reviews if you want to use them.", "ywar"); ?></span>
1550
+ </div>
1551
+ </div>
1552
+ </td>
1553
+ </tr>
1554
+ <?php
1555
+ }
1556
+
1557
+ /**
1558
+ * Convert previous reviews into new YITH Advanced review type
1559
+ *
1560
+ * @since 1.0
1561
+ * @author Lorenzo Giuffrida
1562
+ */
1563
+ public function convert_reviews_callback() {
1564
+
1565
+ $review_converted = $this->import_previous_reviews();
1566
+ $response = '';
1567
+
1568
+ if ($review_converted) {
1569
+ $response = sprintf(__('Task completed. %d reviews have been processed and converted.', 'ywar'), $review_converted);
1570
+ } else {
1571
+ $response = __('Task completed. No review to convert has been found.', 'ywar');
1572
+ }
1573
+
1574
+ wp_send_json(array("value" => $response));
1575
+ }
1576
+
1577
+ /**
1578
+ * Set a maximum execution time
1579
+ *
1580
+ * @param $seconds time in seconds
1581
+ */
1582
+ private function set_time_limit($seconds) {
1583
+ $check_safe_mode = ini_get('safe_mode');
1584
+ if ((!$check_safe_mode) || ('OFF' == strtoupper($check_safe_mode))) {
1585
+ @set_time_limit($seconds);
1586
+ }
1587
+ }
1588
+
1589
+ /**
1590
+ * Read and convert previous reviews into new advanced reviews using custom post type
1591
+ */
1592
+ public function import_previous_reviews() {
1593
+ global $wpdb;
1594
+
1595
+ $review_converted = 0;
1596
+
1597
+ $query = "SELECT *
1598
  FROM {$wpdb->prefix}comments as co left join {$wpdb->prefix}commentmeta as cm
1599
  on co.comment_ID = cm.comment_id
1600
  where ((co.comment_approved = '0') or (co.comment_approved = '1')) and cm.meta_key = 'rating'";
1601
 
1602
+ $results = $wpdb->get_results($query);
1603
+
1604
+ // manage parent relationship and update all reviews when import ends
1605
+ $review_ids = array();
1606
+ $parent_review = array();
1607
+
1608
+ foreach ($results as $comment) {
1609
+
1610
+ // Check if comment_meta exists for previous reviews and is not still imported
1611
+ if ("1" === get_comment_meta($comment->comment_ID, $this->meta_key_imported, true)) {
1612
+ // comment still imported, update only author data (Fix for upgrade from 1.1.2 to 1.2.3 then skip it!
1613
+
1614
+ // Retrieve review(post) id linked to current comment
1615
+ $args = array(
1616
+ 'post_type' => 'ywar_reviews',
1617
+ 'meta_query' => array(
1618
+ array(
1619
+ 'key' => $this->meta_key_comment_id,
1620
+ 'value' => $comment->comment_ID,
1621
+ 'compare' => '=',
1622
+ 'type' => 'numeric'
1623
+ )
1624
+ )
1625
+ );
1626
+ $reviews = get_posts($args);
1627
+
1628
+ if (isset($reviews)) {
1629
+ $review = $reviews[0];
1630
+
1631
+ // Update review meta
1632
+ update_post_meta($review->ID, $this->meta_key_review_user_id, $comment->user_id);
1633
+ update_post_meta($review->ID, $this->meta_key_review_author, $comment->comment_author);
1634
+ update_post_meta($review->ID, $this->meta_key_review_author_email, $comment->comment_author_email);
1635
+ update_post_meta($review->ID, $this->meta_key_review_author_url, $comment->comment_author_url);
1636
+ update_post_meta($review->ID, $this->meta_key_review_author_IP, $comment->comment_author_IP);
1637
+ }
1638
+
1639
+ continue;
1640
+ }
1641
+
1642
+ // Set execution time
1643
+ $this->set_time_limit(30);
1644
+
1645
+ $val = get_comment_meta($comment->comment_ID, "title", true);
1646
+ $title = $val ? $val : '';
1647
+
1648
+ $val = get_comment_meta($comment->comment_ID, "thumb_ids", true);
1649
+ $thumb_ids = $val ? $val : array();
1650
+
1651
+ $val = get_comment_meta($comment->comment_ID, "rating", true);
1652
+ $rating = $val ? $val : 0;
1653
+
1654
+ // Import previous settings for "stop reply" from the comment
1655
+ $val = get_comment_meta($comment->comment_ID, "no_reply", true);
1656
+ $no_reply = $val ? $val : 0;
1657
+
1658
+ // Import previous settings for "votes" from the comment
1659
+ $val = get_comment_meta($comment->comment_ID, "votes", true);
1660
+ $votes = $val ? $val : array();
1661
+
1662
+ // Extract upvotes and downvotes count
1663
+ $votes_grouped = array_count_values(array_values($votes));
1664
+ $yes_votes = isset($votes_grouped['1']) && is_numeric($votes_grouped['1']) ? $votes_grouped['1'] : 0;
1665
+ $no_votes = isset($votes_grouped['-1']) && is_numeric($votes_grouped['-1']) ? $votes_grouped['-1'] : 0;
1666
+
1667
+ // Create post object
1668
+ $args = array(
1669
+ 'post_author' => $comment->user_id,
1670
+ 'post_date' => $comment->comment_date,
1671
+ 'post_date_gmt' => $comment->comment_date_gmt,
1672
+ 'post_content' => $comment->comment_content,
1673
+ 'post_title' => $title,
1674
+ 'review_user_id' => $comment->user_id,
1675
+ 'review_approved' => $comment->comment_approved,
1676
+ 'review_product_id' => $comment->comment_post_ID,
1677
+ 'review_thumbnails' => $thumb_ids,
1678
+ 'review_comment_id' => $comment->comment_ID,
1679
+ 'review_rating' => $rating,
1680
+ 'review_is_reply_blocked' => $no_reply,
1681
+ 'review_votes' => $votes,
1682
+ 'review_upvotes' => $yes_votes,
1683
+ 'review_downvotes' => $no_votes,
1684
+ 'review_author' => $comment->comment_author,
1685
+ 'review_author_email' => $comment->comment_author_email,
1686
+ 'review_author_url' => $comment->comment_author_url,
1687
+ 'review_author_IP' => $comment->comment_author_IP
1688
+ );
1689
+
1690
+ // Insert the post into the database
1691
+ $review_id = $this->insert_review($args);
1692
+
1693
+ $review_ids[$comment->comment_ID] = $review_id;
1694
+
1695
+ // If current comment have parent, store it and update all relationship when the import ends
1696
+ if ($comment->comment_parent > 0) {
1697
+ $parent_review[$review_id] = $comment->comment_parent;
1698
+ }
1699
+
1700
+ // set current comment as imported
1701
+ update_comment_meta($comment->comment_ID, $this->meta_key_imported, 1);
1702
+ $review_converted++;
1703
+ }
1704
+
1705
+ // if some hierarchical comment was found, update the review created
1706
+ foreach ($parent_review as $key => $value) {
1707
+ if (isset($review_ids[$value])) {
1708
+
1709
+ //update the post which id is in $key, setting parent to $review_ids[$value]
1710
+ $args = array(
1711
+ 'ID' => $key,
1712
+ 'post_parent' => $review_ids[$value]
1713
+ );
1714
+
1715
+ // Update the post into the database
1716
+ wp_update_post($args);
1717
+ }
1718
+ }
1719
+
1720
+ return $review_converted;
1721
+ }
1722
+
1723
+ /**
1724
+ * On plugin init check query vars for commands to convert previous reviews
1725
+ */
1726
+ function check_import_actions() {
1727
+ if (isset($_GET["convert-reviews"])) {
1728
+
1729
+ $this->import_previous_reviews();
1730
+
1731
+ wp_redirect(esc_url(remove_query_arg("convert-reviews")));
1732
+ }
1733
+ }
1734
+ //endregion
1735
+ }
1736
  }
modules/yith-woocommerce-advanced-reviews/init.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-advanced-reviews
5
  Description: Extends the basic functionality of woocommerce reviews and add a histogram table to the reviews of your products, as well as you see in most trendy e-commerce sites.
6
  Author: Yithemes
7
  Text Domain: ywar
8
- Version: 1.1.4
9
  Author URI: http://yithemes.com/
10
  */
11
 
@@ -57,7 +57,7 @@ if ( ! defined( 'YITH_YWAR_FREE_INIT' ) ) {
57
  }
58
 
59
  if ( ! defined( 'YITH_YWAR_VERSION' ) ) {
60
- define( 'YITH_YWAR_VERSION', '1.1.4' );
61
  }
62
 
63
  if ( ! defined( 'YITH_YWAR_FILE' ) ) {
5
  Description: Extends the basic functionality of woocommerce reviews and add a histogram table to the reviews of your products, as well as you see in most trendy e-commerce sites.
6
  Author: Yithemes
7
  Text Domain: ywar
8
+ Version: 1.1.5
9
  Author URI: http://yithemes.com/
10
  */
11
 
57
  }
58
 
59
  if ( ! defined( 'YITH_YWAR_VERSION' ) ) {
60
+ define( 'YITH_YWAR_VERSION', '1.1.5' );
61
  }
62
 
63
  if ( ! defined( 'YITH_YWAR_FILE' ) ) {
modules/yith-woocommerce-ajax-navigation/assets/css/admin.css CHANGED
@@ -23,10 +23,15 @@ p.yit-wcan-display-color,
23
  p#yit-wcan-style,
24
  p#yit-wcan-show-count,
25
  p.yit-wcan-display-tags,
26
- p.yit-wcan-display-brands {
 
27
  display: none;
28
  }
29
 
 
 
 
 
30
  p#yit-wcan-style.yit-wcan-style-color,
31
  p#yit-wcan-style.yit-wcan-style-multicolor,
32
  p#yit-wcan-show-count.yit-wcan-show-count-list,
23
  p#yit-wcan-style,
24
  p#yit-wcan-show-count,
25
  p.yit-wcan-display-tags,
26
+ p.yit-wcan-display-brands,
27
+ div.yit-wcan-widget-tag-list {
28
  display: none;
29
  }
30
 
31
+ div.yit-wcan-widget-tag-list.tags{
32
+ display: block;
33
+ }
34
+
35
  p#yit-wcan-style.yit-wcan-style-color,
36
  p#yit-wcan-style.yit-wcan-style-multicolor,
37
  p#yit-wcan-show-count.yit-wcan-show-count-list,
modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-admin.js CHANGED
@@ -12,7 +12,7 @@ jQuery(function ($) {
12
  field_name = range_filter.data('field_name'),
13
  position = parseInt(input_field.data('position')) + 1,
14
  html = '<input type="text" placeholder="min" name="' + field_name + '[' + position + '][min]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>' +
15
- '<input type="text" placeholder="max" name="' + field_name + '[' + position + '][max]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>';
16
 
17
  range_filter.append(html);
18
  };
@@ -74,16 +74,13 @@ jQuery(function ($) {
74
  tag_list.hide();
75
  }
76
 
77
-
78
- $.post(ajaxurl, data, function (response) {
79
  spinner.hide();
80
  container.html(response.content);
81
  $(document).trigger('yith_colorpicker');
82
  }, 'json');
83
  });
84
 
85
- $('.yith_wcan_type').trigger('change');
86
-
87
  //color-picker
88
  $(document).on('yith_colorpicker',function () {
89
  $('.yith-colorpicker').each(function () {
@@ -118,15 +115,4 @@ jQuery(function ($) {
118
  e.preventDefault();
119
  $(this).parents( '.yith-wcan-select-option').next('.yith_wcan_select_tag').find('.yith_wcan_tag_list_checkbox').attr( 'checked', false );
120
  });
121
-
122
- /* widget_select.on('yith_wcan_admin_widget_change', function(){
123
- $('#' + widget_select.val()).show();
124
- });
125
-
126
- widget_select.on('change', function(){
127
- $('.option-wrapper').hide();
128
- $('#' + widget_select.val()).fadeIn();
129
- });
130
-
131
- widget_select.trigger('yith_wcan_admin_widget_change');*/
132
  });
12
  field_name = range_filter.data('field_name'),
13
  position = parseInt(input_field.data('position')) + 1,
14
  html = '<input type="text" placeholder="min" name="' + field_name + '[' + position + '][min]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>' +
15
+ '<input type="text" placeholder="max" name="' + field_name + '[' + position + '][max]" value="" class="yith-wcan-price-filter-input widefat" data-position="' + position + '"/>';
16
 
17
  range_filter.append(html);
18
  };
74
  tag_list.hide();
75
  }
76
 
77
+ $.post(ajaxurl, data, function (response) {
 
78
  spinner.hide();
79
  container.html(response.content);
80
  $(document).trigger('yith_colorpicker');
81
  }, 'json');
82
  });
83
 
 
 
84
  //color-picker
85
  $(document).on('yith_colorpicker',function () {
86
  $('.yith-colorpicker').each(function () {
115
  e.preventDefault();
116
  $(this).parents( '.yith-wcan-select-option').next('.yith_wcan_select_tag').find('.yith_wcan_tag_list_checkbox').attr( 'checked', false );
117
  });
 
 
 
 
 
 
 
 
 
 
 
118
  });
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-admin.php CHANGED
@@ -66,7 +66,6 @@ if ( ! class_exists( 'YITH_WCAN_Admin' ) ) {
66
 
67
  //Actions
68
  add_action( 'init', array( $this, 'init' ) );
69
- add_action( 'wp_ajax_yith_wcan_select_type', array( $this, 'ajax_print_terms' ) );
70
 
71
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
72
  add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
@@ -222,33 +221,6 @@ if ( ! class_exists( 'YITH_WCAN_Admin' ) ) {
222
  return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
223
  }
224
 
225
- /**
226
- * Print terms for the element selected
227
- *
228
- * @access public
229
- * @return void
230
- * @since 1.0.0
231
- */
232
- public function ajax_print_terms() {
233
- $type = $_POST['value'];
234
- $attribute = $_POST['attribute'];
235
- $return = array( 'message' => '', 'content' => $_POST );
236
-
237
- $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
238
-
239
- $return['content'] = yith_wcan_attributes_table(
240
- $type,
241
- $attribute,
242
- $_POST['id'],
243
- $_POST['name'],
244
- json_decode( $_POST['value'] ),
245
- false
246
- );
247
-
248
- echo json_encode( $return );
249
- die();
250
- }
251
-
252
  public function register_pointer() {
253
 
254
  if( defined( 'YITH_WCAN_PREMIUM' ) && YITH_WCAN_PREMIUM ){
66
 
67
  //Actions
68
  add_action( 'init', array( $this, 'init' ) );
 
69
 
70
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
71
  add_action( 'admin_menu', array( $this, 'register_panel' ), 5 );
221
  return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
222
  }
223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  public function register_pointer() {
225
 
226
  if( defined( 'YITH_WCAN_PREMIUM' ) && YITH_WCAN_PREMIUM ){
modules/yith-woocommerce-ajax-navigation/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
- * Version: 2.1.2
7
  * Author: yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_ajxnav
@@ -65,7 +65,7 @@ if ( defined( 'YITH_WCAN_VERSION' ) ) {
65
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
66
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
67
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
68
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '2.1.2' );
69
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
70
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
71
 
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 2.2.0
7
  * Author: yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith_wc_ajxnav
65
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
66
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
67
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
68
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '2.2.0' );
69
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
70
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
71
 
modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-it_IT.mo CHANGED
Binary file
modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-it_IT.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-07-31 12:59+0200\n"
6
- "PO-Revision-Date: 2015-07-31 13:13+0200\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: it_IT\n"
@@ -11,7 +11,7 @@ msgstr ""
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
- "X-Generator: Poedit 1.8.3\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
@@ -20,29 +20,29 @@ msgstr ""
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
22
 
23
- #: includes/class.yith-wcan-admin.php:135
24
- #: includes/class.yith-wcan-admin.php:185
25
  msgid "Premium Version"
26
  msgstr "Versione Premium"
27
 
 
28
  #: includes/class.yith-wcan-admin.php:141
29
- #: includes/class.yith-wcan-admin.php:142
30
  msgid "Ajax Product Filter"
31
  msgstr "Ajax Product Filter"
32
 
33
- #: includes/class.yith-wcan-admin.php:181
34
  msgid "Premium live demo"
35
  msgstr "Anteprima versione premium"
36
 
37
- #: includes/class.yith-wcan-admin.php:181
38
  msgid "Live demo"
39
  msgstr "Anteprima"
40
 
41
- #: includes/class.yith-wcan-admin.php:209
42
  msgid "Plugin Documentation"
43
  msgstr "Documentazione Plugin"
44
 
45
- #: includes/class.yith-wcan-admin.php:262
46
  msgid ""
47
  "Dear users,\n"
48
  " we would like to inform you that the YITH "
@@ -71,18 +71,18 @@ msgstr ""
71
  "possibile aggiornare/tradurre il file .po seguendo la procedura classica di "
72
  "traduzione."
73
 
74
- #: includes/class.yith-wcan-admin.php:267
75
- #: widgets/class.yith-wcan-navigation-widget.php:26
76
  msgid "YITH WooCommerce Ajax Product Filter"
77
  msgstr "YITH WooCommerce Ajax Product Filter"
78
 
79
- #: includes/class.yith-wcan-admin.php:269
80
  msgid ""
81
  "YITH WooCommerce Product Filter has been updated with new available options"
82
  msgstr ""
83
  "YITH WooCommerce Product Filter è stato aggiornato con delle nuove opzioni"
84
 
85
- #: includes/class.yith-wcan-admin.php:269
86
  msgid "discover the PREMIUM version"
87
  msgstr "scopri la versione PREMIUM"
88
 
@@ -94,7 +94,7 @@ msgstr "Proprietà"
94
 
95
  # @ yit
96
  #: includes/functions.yith-wcan.php:57
97
- #: widgets/class.yith-wcan-navigation-widget.php:811
98
  msgid "Color"
99
  msgstr "Colore"
100
 
@@ -259,68 +259,73 @@ msgstr ""
259
  msgid "Filter the product list without reloading the page"
260
  msgstr "Filtra l'elenco prodotti senza ricaricare la pagina"
261
 
262
- #: widgets/class.yith-wcan-navigation-widget.php:262
 
 
 
 
 
263
  msgid "Filters:"
264
  msgstr "Filtri:"
265
 
266
  # @ yit
267
- #: widgets/class.yith-wcan-navigation-widget.php:810
268
  msgid "List"
269
  msgstr "Lista"
270
 
271
  # @ yit
272
- #: widgets/class.yith-wcan-navigation-widget.php:812
273
  msgid "Label"
274
  msgstr "Etichetta"
275
 
276
- #: widgets/class.yith-wcan-navigation-widget.php:813
277
  msgid "Dropdown"
278
  msgstr "Menu a tendina"
279
 
280
  # @ yit
281
- #: widgets/class.yith-wcan-navigation-widget.php:820
282
  #: widgets/class.yith-wcan-reset-navigation-widget.php:89
283
  msgid "Title"
284
  msgstr "Titolo"
285
 
286
  # @ yit
287
- #: widgets/class.yith-wcan-navigation-widget.php:826
288
  msgid "Type:"
289
  msgstr "Tipo:"
290
 
291
  # @ yit
292
- #: widgets/class.yith-wcan-navigation-widget.php:837
293
  msgid "Query Type:"
294
  msgstr "Tipo Query:"
295
 
296
  # @ yit
297
- #: widgets/class.yith-wcan-navigation-widget.php:839
298
  msgid "AND"
299
  msgstr "E"
300
 
301
  # @ yit
302
- #: widgets/class.yith-wcan-navigation-widget.php:840
303
  msgid "OR"
304
  msgstr "O"
305
 
306
  # @ yit
307
- #: widgets/class.yith-wcan-navigation-widget.php:844
308
  msgid "Attribute:"
309
  msgstr "Attributo:"
310
 
311
- #: widgets/class.yith-wcan-navigation-widget.php:851
312
  msgid "Display (default All):"
313
  msgstr "Visualizza (default Tutti)"
314
 
315
- #: widgets/class.yith-wcan-navigation-widget.php:853
316
  msgid "All (no hierarchical)"
317
  msgstr "Tutti (non gerarchico)"
318
 
319
- #: widgets/class.yith-wcan-navigation-widget.php:854
320
  msgid "All (hierarchical)"
321
  msgstr "Tutti (gerarchico)"
322
 
323
- #: widgets/class.yith-wcan-navigation-widget.php:855
324
  msgid "Only Parent"
325
  msgstr "Solo Principali"
326
 
@@ -341,16 +346,15 @@ msgstr "Resetta tutti i filtri"
341
  msgid "Button Label"
342
  msgstr "Etichetta Pulsante"
343
 
 
 
 
344
  #~ msgid "Settings"
345
  #~ msgstr "Impostazioni"
346
 
347
  #~ msgid "Front end"
348
  #~ msgstr "Front end"
349
 
350
- #~ msgctxt "Admin(Pointers): Plugin Title"
351
- #~ msgid "YITH WooCommerce Ajax Product Filter"
352
- #~ msgstr "YITH WooCommerce Ajax Product Filter"
353
-
354
  #~ msgid "General Settings"
355
  #~ msgstr "Impostazioni Generali"
356
 
@@ -541,10 +545,6 @@ msgstr "Etichetta Pulsante"
541
  #~ msgid "Please take note of the following Widgets ID"
542
  #~ msgstr "Si prega di prender nota dei seguenti ID dei widget"
543
 
544
- #~ msgctxt "Admin: Widget Title"
545
- #~ msgid "YITH WooCommerce Ajax Product Filter"
546
- #~ msgstr "YITH WooCommerce Filtro Prodotti Ajax"
547
-
548
  #~ msgid "Use custom style for reset button"
549
  #~ msgstr "Utilizza uno stile personalizzato per il pulsante di reset"
550
 
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-08-25 09:39+0100\n"
6
+ "PO-Revision-Date: 2015-08-25 09:40+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: it_IT\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Generator: Poedit 1.8.1\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
22
 
23
+ #: includes/class.yith-wcan-admin.php:134
24
+ #: includes/class.yith-wcan-admin.php:184
25
  msgid "Premium Version"
26
  msgstr "Versione Premium"
27
 
28
+ #: includes/class.yith-wcan-admin.php:140
29
  #: includes/class.yith-wcan-admin.php:141
 
30
  msgid "Ajax Product Filter"
31
  msgstr "Ajax Product Filter"
32
 
33
+ #: includes/class.yith-wcan-admin.php:180
34
  msgid "Premium live demo"
35
  msgstr "Anteprima versione premium"
36
 
37
+ #: includes/class.yith-wcan-admin.php:180
38
  msgid "Live demo"
39
  msgstr "Anteprima"
40
 
41
+ #: includes/class.yith-wcan-admin.php:208
42
  msgid "Plugin Documentation"
43
  msgstr "Documentazione Plugin"
44
 
45
+ #: includes/class.yith-wcan-admin.php:234
46
  msgid ""
47
  "Dear users,\n"
48
  " we would like to inform you that the YITH "
71
  "possibile aggiornare/tradurre il file .po seguendo la procedura classica di "
72
  "traduzione."
73
 
74
+ #: includes/class.yith-wcan-admin.php:239
75
+ msgctxt "Admin(Pointers): Plugin Title"
76
  msgid "YITH WooCommerce Ajax Product Filter"
77
  msgstr "YITH WooCommerce Ajax Product Filter"
78
 
79
+ #: includes/class.yith-wcan-admin.php:241
80
  msgid ""
81
  "YITH WooCommerce Product Filter has been updated with new available options"
82
  msgstr ""
83
  "YITH WooCommerce Product Filter è stato aggiornato con delle nuove opzioni"
84
 
85
+ #: includes/class.yith-wcan-admin.php:241
86
  msgid "discover the PREMIUM version"
87
  msgstr "scopri la versione PREMIUM"
88
 
94
 
95
  # @ yit
96
  #: includes/functions.yith-wcan.php:57
97
+ #: widgets/class.yith-wcan-navigation-widget.php:813
98
  msgid "Color"
99
  msgstr "Colore"
100
 
259
  msgid "Filter the product list without reloading the page"
260
  msgstr "Filtra l'elenco prodotti senza ricaricare la pagina"
261
 
262
+ #: widgets/class.yith-wcan-navigation-widget.php:26
263
+ msgctxt "Admin: Widget Title"
264
+ msgid "YITH WooCommerce Ajax Product Filter"
265
+ msgstr "YITH WooCommerce Filtro Prodotti Ajax"
266
+
267
+ #: widgets/class.yith-wcan-navigation-widget.php:264
268
  msgid "Filters:"
269
  msgstr "Filtri:"
270
 
271
  # @ yit
272
+ #: widgets/class.yith-wcan-navigation-widget.php:812
273
  msgid "List"
274
  msgstr "Lista"
275
 
276
  # @ yit
277
+ #: widgets/class.yith-wcan-navigation-widget.php:814
278
  msgid "Label"
279
  msgstr "Etichetta"
280
 
281
+ #: widgets/class.yith-wcan-navigation-widget.php:815
282
  msgid "Dropdown"
283
  msgstr "Menu a tendina"
284
 
285
  # @ yit
286
+ #: widgets/class.yith-wcan-navigation-widget.php:822
287
  #: widgets/class.yith-wcan-reset-navigation-widget.php:89
288
  msgid "Title"
289
  msgstr "Titolo"
290
 
291
  # @ yit
292
+ #: widgets/class.yith-wcan-navigation-widget.php:828
293
  msgid "Type:"
294
  msgstr "Tipo:"
295
 
296
  # @ yit
297
+ #: widgets/class.yith-wcan-navigation-widget.php:839
298
  msgid "Query Type:"
299
  msgstr "Tipo Query:"
300
 
301
  # @ yit
302
+ #: widgets/class.yith-wcan-navigation-widget.php:841
303
  msgid "AND"
304
  msgstr "E"
305
 
306
  # @ yit
307
+ #: widgets/class.yith-wcan-navigation-widget.php:842
308
  msgid "OR"
309
  msgstr "O"
310
 
311
  # @ yit
312
+ #: widgets/class.yith-wcan-navigation-widget.php:846
313
  msgid "Attribute:"
314
  msgstr "Attributo:"
315
 
316
+ #: widgets/class.yith-wcan-navigation-widget.php:853
317
  msgid "Display (default All):"
318
  msgstr "Visualizza (default Tutti)"
319
 
320
+ #: widgets/class.yith-wcan-navigation-widget.php:855
321
  msgid "All (no hierarchical)"
322
  msgstr "Tutti (non gerarchico)"
323
 
324
+ #: widgets/class.yith-wcan-navigation-widget.php:856
325
  msgid "All (hierarchical)"
326
  msgstr "Tutti (gerarchico)"
327
 
328
+ #: widgets/class.yith-wcan-navigation-widget.php:857
329
  msgid "Only Parent"
330
  msgstr "Solo Principali"
331
 
346
  msgid "Button Label"
347
  msgstr "Etichetta Pulsante"
348
 
349
+ #~ msgid "YITH WooCommerce Ajax Product Filter"
350
+ #~ msgstr "YITH WooCommerce Ajax Product Filter"
351
+
352
  #~ msgid "Settings"
353
  #~ msgstr "Impostazioni"
354
 
355
  #~ msgid "Front end"
356
  #~ msgstr "Front end"
357
 
 
 
 
 
358
  #~ msgid "General Settings"
359
  #~ msgstr "Impostazioni Generali"
360
 
545
  #~ msgid "Please take note of the following Widgets ID"
546
  #~ msgstr "Si prega di prender nota dei seguenti ID dei widget"
547
 
 
 
 
 
548
  #~ msgid "Use custom style for reset button"
549
  #~ msgstr "Utilizza uno stile personalizzato per il pulsante di reset"
550
 
modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-tr_TR.mo CHANGED
Binary file
modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav-tr_TR.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-07-28 10:37+0100\n"
6
- "PO-Revision-Date: 2015-07-28 10:37+0100\n"
7
  "Last-Translator: Caner Öncel <caneroncel@gmail.com>\n"
8
  "Language-Team: Caner Öncel <caneroncel@gmail.com>\n"
9
  "Language: tr\n"
@@ -20,29 +20,29 @@ msgstr ""
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
22
 
23
- #: includes/class.yith-wcan-admin.php:135
24
- #: includes/class.yith-wcan-admin.php:185
25
  msgid "Premium Version"
26
  msgstr ""
27
 
 
28
  #: includes/class.yith-wcan-admin.php:141
29
- #: includes/class.yith-wcan-admin.php:142
30
  msgid "Ajax Product Filter"
31
  msgstr ""
32
 
33
- #: includes/class.yith-wcan-admin.php:181
34
  msgid "Premium live demo"
35
  msgstr ""
36
 
37
- #: includes/class.yith-wcan-admin.php:181
38
  msgid "Live demo"
39
  msgstr ""
40
 
41
- #: includes/class.yith-wcan-admin.php:209
42
  msgid "Plugin Documentation"
43
  msgstr ""
44
 
45
- #: includes/class.yith-wcan-admin.php:262
46
  msgid ""
47
  "Dear users,\n"
48
  " we would like to inform you that the YITH "
@@ -58,17 +58,17 @@ msgid ""
58
  "translate the .po file following the classic procedure for translations."
59
  msgstr ""
60
 
61
- #: includes/class.yith-wcan-admin.php:267
62
- #: widgets/class.yith-wcan-navigation-widget.php:26
63
  msgid "YITH WooCommerce Ajax Product Filter"
64
  msgstr ""
65
 
66
- #: includes/class.yith-wcan-admin.php:269
67
  msgid ""
68
  "YITH WooCommerce Product Filter has been updated with new available options"
69
  msgstr ""
70
 
71
- #: includes/class.yith-wcan-admin.php:269
72
  msgid "discover the PREMIUM version"
73
  msgstr ""
74
 
@@ -80,7 +80,7 @@ msgstr "Terim"
80
 
81
  # @ yit
82
  #: includes/functions.yith-wcan.php:57
83
- #: widgets/class.yith-wcan-navigation-widget.php:807
84
  msgid "Color"
85
  msgstr "Renk"
86
 
@@ -318,7 +318,7 @@ msgstr ""
318
  msgid "Upload multiple files"
319
  msgstr ""
320
 
321
- #: plugin-fw/lib/yit-plugin-panel-wc.php:295
322
  msgid "The changes you have made will be lost if you leave this page."
323
  msgstr ""
324
 
@@ -1150,68 +1150,73 @@ msgstr ""
1150
  msgid "Filter the product list without reloading the page"
1151
  msgstr ""
1152
 
1153
- #: widgets/class.yith-wcan-navigation-widget.php:262
 
 
 
 
 
1154
  msgid "Filters:"
1155
  msgstr ""
1156
 
1157
  # @ yit
1158
- #: widgets/class.yith-wcan-navigation-widget.php:806
1159
  msgid "List"
1160
  msgstr "Liste"
1161
 
1162
  # @ yit
1163
- #: widgets/class.yith-wcan-navigation-widget.php:808
1164
  msgid "Label"
1165
  msgstr "Etiket"
1166
 
1167
- #: widgets/class.yith-wcan-navigation-widget.php:809
1168
  msgid "Dropdown"
1169
  msgstr "Açılır Menü"
1170
 
1171
  # @ yit
1172
- #: widgets/class.yith-wcan-navigation-widget.php:816
1173
  #: widgets/class.yith-wcan-reset-navigation-widget.php:89
1174
  msgid "Title"
1175
  msgstr "Başlık"
1176
 
1177
  # @ yit
1178
- #: widgets/class.yith-wcan-navigation-widget.php:822
1179
  msgid "Type:"
1180
  msgstr "Tür:"
1181
 
1182
  # @ yit
1183
- #: widgets/class.yith-wcan-navigation-widget.php:833
1184
  msgid "Query Type:"
1185
  msgstr "Sorgu Tipi:"
1186
 
1187
  # @ yit
1188
- #: widgets/class.yith-wcan-navigation-widget.php:835
1189
  msgid "AND"
1190
  msgstr "VE"
1191
 
1192
  # @ yit
1193
- #: widgets/class.yith-wcan-navigation-widget.php:836
1194
  msgid "OR"
1195
  msgstr "VEYA"
1196
 
1197
  # @ yit
1198
- #: widgets/class.yith-wcan-navigation-widget.php:840
1199
  msgid "Attribute:"
1200
  msgstr "Özellikler:"
1201
 
1202
- #: widgets/class.yith-wcan-navigation-widget.php:847
1203
  msgid "Display (default All):"
1204
  msgstr "Görüntüleme (Varsayılan tümü):"
1205
 
1206
- #: widgets/class.yith-wcan-navigation-widget.php:849
1207
  msgid "All (no hierarchical)"
1208
  msgstr "Tümü"
1209
 
1210
- #: widgets/class.yith-wcan-navigation-widget.php:850
1211
  msgid "All (hierarchical)"
1212
  msgstr ""
1213
 
1214
- #: widgets/class.yith-wcan-navigation-widget.php:851
1215
  msgid "Only Parent"
1216
  msgstr "Sadece Ebeveyn"
1217
 
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Product filter\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-08-25 09:40+0100\n"
6
+ "PO-Revision-Date: 2015-08-25 09:40+0100\n"
7
  "Last-Translator: Caner Öncel <caneroncel@gmail.com>\n"
8
  "Language-Team: Caner Öncel <caneroncel@gmail.com>\n"
9
  "Language: tr\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
22
 
23
+ #: includes/class.yith-wcan-admin.php:134
24
+ #: includes/class.yith-wcan-admin.php:184
25
  msgid "Premium Version"
26
  msgstr ""
27
 
28
+ #: includes/class.yith-wcan-admin.php:140
29
  #: includes/class.yith-wcan-admin.php:141
 
30
  msgid "Ajax Product Filter"
31
  msgstr ""
32
 
33
+ #: includes/class.yith-wcan-admin.php:180
34
  msgid "Premium live demo"
35
  msgstr ""
36
 
37
+ #: includes/class.yith-wcan-admin.php:180
38
  msgid "Live demo"
39
  msgstr ""
40
 
41
+ #: includes/class.yith-wcan-admin.php:208
42
  msgid "Plugin Documentation"
43
  msgstr ""
44
 
45
+ #: includes/class.yith-wcan-admin.php:234
46
  msgid ""
47
  "Dear users,\n"
48
  " we would like to inform you that the YITH "
58
  "translate the .po file following the classic procedure for translations."
59
  msgstr ""
60
 
61
+ #: includes/class.yith-wcan-admin.php:239
62
+ msgctxt "Admin(Pointers): Plugin Title"
63
  msgid "YITH WooCommerce Ajax Product Filter"
64
  msgstr ""
65
 
66
+ #: includes/class.yith-wcan-admin.php:241
67
  msgid ""
68
  "YITH WooCommerce Product Filter has been updated with new available options"
69
  msgstr ""
70
 
71
+ #: includes/class.yith-wcan-admin.php:241
72
  msgid "discover the PREMIUM version"
73
  msgstr ""
74
 
80
 
81
  # @ yit
82
  #: includes/functions.yith-wcan.php:57
83
+ #: widgets/class.yith-wcan-navigation-widget.php:813
84
  msgid "Color"
85
  msgstr "Renk"
86
 
318
  msgid "Upload multiple files"
319
  msgstr ""
320
 
321
+ #: plugin-fw/lib/yit-plugin-panel-wc.php:322
322
  msgid "The changes you have made will be lost if you leave this page."
323
  msgstr ""
324
 
1150
  msgid "Filter the product list without reloading the page"
1151
  msgstr ""
1152
 
1153
+ #: widgets/class.yith-wcan-navigation-widget.php:26
1154
+ msgctxt "Admin: Widget Title"
1155
+ msgid "YITH WooCommerce Ajax Product Filter"
1156
+ msgstr ""
1157
+
1158
+ #: widgets/class.yith-wcan-navigation-widget.php:264
1159
  msgid "Filters:"
1160
  msgstr ""
1161
 
1162
  # @ yit
1163
+ #: widgets/class.yith-wcan-navigation-widget.php:812
1164
  msgid "List"
1165
  msgstr "Liste"
1166
 
1167
  # @ yit
1168
+ #: widgets/class.yith-wcan-navigation-widget.php:814
1169
  msgid "Label"
1170
  msgstr "Etiket"
1171
 
1172
+ #: widgets/class.yith-wcan-navigation-widget.php:815
1173
  msgid "Dropdown"
1174
  msgstr "Açılır Menü"
1175
 
1176
  # @ yit
1177
+ #: widgets/class.yith-wcan-navigation-widget.php:822
1178
  #: widgets/class.yith-wcan-reset-navigation-widget.php:89
1179
  msgid "Title"
1180
  msgstr "Başlık"
1181
 
1182
  # @ yit
1183
+ #: widgets/class.yith-wcan-navigation-widget.php:828
1184
  msgid "Type:"
1185
  msgstr "Tür:"
1186
 
1187
  # @ yit
1188
+ #: widgets/class.yith-wcan-navigation-widget.php:839
1189
  msgid "Query Type:"
1190
  msgstr "Sorgu Tipi:"
1191
 
1192
  # @ yit
1193
+ #: widgets/class.yith-wcan-navigation-widget.php:841
1194
  msgid "AND"
1195
  msgstr "VE"
1196
 
1197
  # @ yit
1198
+ #: widgets/class.yith-wcan-navigation-widget.php:842
1199
  msgid "OR"
1200
  msgstr "VEYA"
1201
 
1202
  # @ yit
1203
+ #: widgets/class.yith-wcan-navigation-widget.php:846
1204
  msgid "Attribute:"
1205
  msgstr "Özellikler:"
1206
 
1207
+ #: widgets/class.yith-wcan-navigation-widget.php:853
1208
  msgid "Display (default All):"
1209
  msgstr "Görüntüleme (Varsayılan tümü):"
1210
 
1211
+ #: widgets/class.yith-wcan-navigation-widget.php:855
1212
  msgid "All (no hierarchical)"
1213
  msgstr "Tümü"
1214
 
1215
+ #: widgets/class.yith-wcan-navigation-widget.php:856
1216
  msgid "All (hierarchical)"
1217
  msgstr ""
1218
 
1219
+ #: widgets/class.yith-wcan-navigation-widget.php:857
1220
  msgid "Only Parent"
1221
  msgstr "Sadece Ebeveyn"
1222
 
modules/yith-woocommerce-ajax-navigation/languages/yith_wc_ajxnav.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2015-08-11 16:45+0100\n"
7
  "PO-Revision-Date: 2015-06-19 13:59+0100\n"
8
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
9
  "Language-Team: \n"
@@ -21,29 +21,29 @@ msgstr ""
21
  "X-Poedit-SearchPath-0: .\n"
22
  "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
23
 
24
- #: includes/class.yith-wcan-admin.php:135
25
- #: includes/class.yith-wcan-admin.php:185
26
  msgid "Premium Version"
27
  msgstr ""
28
 
 
29
  #: includes/class.yith-wcan-admin.php:141
30
- #: includes/class.yith-wcan-admin.php:142
31
  msgid "Ajax Product Filter"
32
  msgstr ""
33
 
34
- #: includes/class.yith-wcan-admin.php:181
35
  msgid "Premium live demo"
36
  msgstr ""
37
 
38
- #: includes/class.yith-wcan-admin.php:181
39
  msgid "Live demo"
40
  msgstr ""
41
 
42
- #: includes/class.yith-wcan-admin.php:209
43
  msgid "Plugin Documentation"
44
  msgstr ""
45
 
46
- #: includes/class.yith-wcan-admin.php:262
47
  msgid ""
48
  "Dear users,\n"
49
  " we would like to inform you that the YITH "
@@ -60,18 +60,18 @@ msgid ""
60
  "translations."
61
  msgstr ""
62
 
63
- #: includes/class.yith-wcan-admin.php:267
64
  msgctxt "Admin(Pointers): Plugin Title"
65
  msgid "YITH WooCommerce Ajax Product Filter"
66
  msgstr ""
67
 
68
- #: includes/class.yith-wcan-admin.php:269
69
  msgid ""
70
  "YITH WooCommerce Product Filter has been updated with new available "
71
  "options"
72
  msgstr ""
73
 
74
- #: includes/class.yith-wcan-admin.php:269
75
  msgid "discover the PREMIUM version"
76
  msgstr ""
77
 
@@ -320,7 +320,7 @@ msgstr ""
320
  msgid "Upload multiple files"
321
  msgstr ""
322
 
323
- #: plugin-fw/lib/yit-plugin-panel-wc.php:309
324
  msgid "The changes you have made will be lost if you leave this page."
325
  msgstr ""
326
 
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Ajax Product Filter\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2015-08-25 09:39+0100\n"
7
  "PO-Revision-Date: 2015-06-19 13:59+0100\n"
8
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
9
  "Language-Team: \n"
21
  "X-Poedit-SearchPath-0: .\n"
22
  "X-Poedit-SearchPathExcluded-0: ../plugin-fw\n"
23
 
24
+ #: includes/class.yith-wcan-admin.php:134
25
+ #: includes/class.yith-wcan-admin.php:184
26
  msgid "Premium Version"
27
  msgstr ""
28
 
29
+ #: includes/class.yith-wcan-admin.php:140
30
  #: includes/class.yith-wcan-admin.php:141
 
31
  msgid "Ajax Product Filter"
32
  msgstr ""
33
 
34
+ #: includes/class.yith-wcan-admin.php:180
35
  msgid "Premium live demo"
36
  msgstr ""
37
 
38
+ #: includes/class.yith-wcan-admin.php:180
39
  msgid "Live demo"
40
  msgstr ""
41
 
42
+ #: includes/class.yith-wcan-admin.php:208
43
  msgid "Plugin Documentation"
44
  msgstr ""
45
 
46
+ #: includes/class.yith-wcan-admin.php:234
47
  msgid ""
48
  "Dear users,\n"
49
  " we would like to inform you that the YITH "
60
  "translations."
61
  msgstr ""
62
 
63
+ #: includes/class.yith-wcan-admin.php:239
64
  msgctxt "Admin(Pointers): Plugin Title"
65
  msgid "YITH WooCommerce Ajax Product Filter"
66
  msgstr ""
67
 
68
+ #: includes/class.yith-wcan-admin.php:241
69
  msgid ""
70
  "YITH WooCommerce Product Filter has been updated with new available "
71
  "options"
72
  msgstr ""
73
 
74
+ #: includes/class.yith-wcan-admin.php:241
75
  msgid "discover the PREMIUM version"
76
  msgstr ""
77
 
320
  msgid "Upload multiple files"
321
  msgstr ""
322
 
323
+ #: plugin-fw/lib/yit-plugin-panel-wc.php:322
324
  msgid "The changes you have made will be lost if you leave this page."
325
  msgstr ""
326
 
modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -901,9 +901,9 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
901
  $instance['attribute'] = stripslashes( $new_instance['attribute'] );
902
  $instance['query_type'] = stripslashes( $new_instance['query_type'] );
903
  $instance['type'] = stripslashes( $new_instance['type'] );
904
- $instance['colors'] = $new_instance['colors'];
905
- $instance['multicolor'] = $new_instance['multicolor'];
906
- $instance['labels'] = $new_instance['labels'];
907
  $instance['display'] = $new_instance['display'];
908
 
909
  return $instance;
901
  $instance['attribute'] = stripslashes( $new_instance['attribute'] );
902
  $instance['query_type'] = stripslashes( $new_instance['query_type'] );
903
  $instance['type'] = stripslashes( $new_instance['type'] );
904
+ $instance['colors'] = ! empty( $new_instance['colors'] ) ? $new_instance['colors'] : array();
905
+ $instance['multicolor'] = ! empty( $new_instance['multicolor'] ) ? $new_instance['multicolor'] : array();
906
+ $instance['labels'] = ! empty( $new_instance['labels'] ) ? $new_instance['labels'] : array();
907
  $instance['display'] = $new_instance['display'];
908
 
909
  return $instance;
modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-reset-navigation-widget.php CHANGED
@@ -100,7 +100,7 @@ if ( ! class_exists( 'YITH_WCAN_Reset_Navigation_Widget' ) ) {
100
  <?php
101
  }
102
 
103
- function update( $new_instance, $old_instance ) { var_dump( $new_instance );
104
  $instance = $old_instance;
105
  $instance['title'] = strip_tags( $new_instance['title'] );
106
  $instance['label'] = strip_tags( $new_instance['label'] );
100
  <?php
101
  }
102
 
103
+ function update( $new_instance, $old_instance ) {
104
  $instance = $old_instance;
105
  $instance['title'] = strip_tags( $new_instance['title'] );
106
  $instance['label'] = strip_tags( $new_instance['label'] );
modules/yith-woocommerce-catalog-mode/class.yith-woocommerce-catalog-mode.php CHANGED
@@ -125,10 +125,17 @@ class YITH_WC_Catalog_Mode {
125
  * Hides "Add to cart" button from single product page
126
  *
127
  * @since 1.0.0
 
 
 
128
  * @author Alberto Ruggiero
129
  * @return void
130
  */
131
- public function hide_add_to_cart_single( $action = 'woocommerce_single_product_summary' ) {
 
 
 
 
132
 
133
  $priority = has_action( $action, 'woocommerce_template_single_add_to_cart' );
134
 
125
  * Hides "Add to cart" button from single product page
126
  *
127
  * @since 1.0.0
128
+ *
129
+ * @param $action
130
+ *
131
  * @author Alberto Ruggiero
132
  * @return void
133
  */
134
+ public function hide_add_to_cart_single( $action = '' ) {
135
+
136
+ if ( $action == '' ) {
137
+ $action = 'woocommerce_single_product_summary';
138
+ }
139
 
140
  $priority = has_action( $action, 'woocommerce_template_single_add_to_cart' );
141
 
modules/yith-woocommerce-catalog-mode/init.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/
5
  Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
6
  Author: Yithemes
7
  Text Domain: ywctm
8
- Version: 1.1.0
9
  Author URI: http://yithemes.com/
10
  */
11
 
@@ -34,7 +34,7 @@ function ywctm_install_free_admin_notice() {
34
  }
35
 
36
  if ( ! defined( 'YWCTM_VERSION' ) ) {
37
- define( 'YWCTM_VERSION', '1.1.0' );
38
  }
39
 
40
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
@@ -73,6 +73,8 @@ add_action( 'ywctm_init', 'ywctm_init' );
73
 
74
  function ywctm_install() {
75
 
 
 
76
  if ( ! function_exists( 'WC' ) ) {
77
  add_action( 'admin_notices', 'ywctm_install_woocommerce_admin_notice' );
78
  }
@@ -93,8 +95,6 @@ if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
93
  require_once 'plugin-fw/yit-plugin-registration-hook.php';
94
  }
95
 
96
- require_once( YWCTM_DIR . 'class.yith-woocommerce-catalog-mode.php' );
97
-
98
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
99
  register_activation_hook( __FILE__, 'ywctm_plugin_activation' );
100
 
5
  Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
6
  Author: Yithemes
7
  Text Domain: ywctm
8
+ Version: 1.1.2
9
  Author URI: http://yithemes.com/
10
  */
11
 
34
  }
35
 
36
  if ( ! defined( 'YWCTM_VERSION' ) ) {
37
+ define( 'YWCTM_VERSION', '1.1.2' );
38
  }
39
 
40
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
73
 
74
  function ywctm_install() {
75
 
76
+ require_once( YWCTM_DIR . 'class.yith-woocommerce-catalog-mode.php' );
77
+
78
  if ( ! function_exists( 'WC' ) ) {
79
  add_action( 'admin_notices', 'ywctm_install_woocommerce_admin_notice' );
80
  }
95
  require_once 'plugin-fw/yit-plugin-registration-hook.php';
96
  }
97
 
 
 
98
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
99
  register_activation_hook( __FILE__, 'ywctm_plugin_activation' );
100
 
modules/yith-woocommerce-catalog-mode/plugin-options/settings-options.php CHANGED
@@ -21,7 +21,7 @@ $videobox = defined( 'YWCTM_PREMIUM' ) ? '' : array(
21
  'title_first_column' => __( 'Discover the Advanced Features', 'ywctm' ),
22
  'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit from all features!', 'ywctm' ),
23
  'video' => array(
24
- 'video_id' => '118792418',
25
  'video_image_url' => YWCTM_ASSETS_URL.'/images/yith-woocommerce-catalog-mode.jpg',
26
  'video_description' => __( 'YITH WooCommerce Catalog Mode', 'ywctm' ),
27
  ),
21
  'title_first_column' => __( 'Discover the Advanced Features', 'ywctm' ),
22
  'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WooCommerce Catalog Mode to benefit from all features!', 'ywctm' ),
23
  'video' => array(
24
+ 'video_id' => '120697979',
25
  'video_image_url' => YWCTM_ASSETS_URL.'/images/yith-woocommerce-catalog-mode.jpg',
26
  'video_description' => __( 'YITH WooCommerce Catalog Mode', 'ywctm' ),
27
  ),
modules/yith-woocommerce-colors-labels-variations/assets/js/frontend.js CHANGED
@@ -174,6 +174,8 @@
174
  form.removeData('last_change');
175
  });
176
 
 
 
177
  });
178
 
179
  })(jQuery, window, document);
174
  form.removeData('last_change');
175
  });
176
 
177
+ select.trigger('focusin');
178
+
179
  });
180
 
181
  })(jQuery, window, document);
modules/yith-woocommerce-colors-labels-variations/assets/js/frontend.min.js CHANGED
@@ -2,4 +2,4 @@
2
  e=b(this),c=b("<div/>",{"class":c}).data("value",b(this).attr("value")).data("option",e.clone(!0)).appendTo(d).off("click").on("click",function(c){b(this).hasClass("selected")?a.val("").change():(c.preventDefault(),a.val(e.val()).change())});"colorpicker"==g?c.append(b("<span/>",{css:{background:f}})):"image"==g?c.append(b("<img/>",{src:f})):"label"==g&&c.append(b("<span/>",{text:f}))}})}).filter(function(){return"select"!=b(this).data("type")}).hide();return a};this.onSelect=function(){c.each(function(){var a=
3
  b(this).val(),c=b(this).siblings(".select_box").find(".select_option").removeClass("selected");a&&c.filter(function(){return b(this).data("value")==a}).addClass("selected")});return a};this.updateOptions=function(){"undefined"==typeof yith_wccl_arg||yith_wccl_arg.is_wc24||a.find(".variations select").each(function(a,c){var d=b(this),e=d.val(),f=d.data("active_options")?d.data("active_options"):d.data("attribute_options");if(!f)return!1;""!=e?b.each(f,function(a,b){d.append(b)}):d.data("active_options",
4
  d.find("option").get())});return a};return this.updateOptions().clean().generateOutput().onSelect()};jQuery(function(a){var b=a(".variations_form"),h=b.find(".variations select");a(e).on("yith_wccl_change check_variations",b,function(){a(this).yith_wccl()}).trigger("yith_wccl_change");a(e).on("change",h,function(){b.data("last_change",a(this).attr("name"));a(this).data("last_content",a(this).siblings(".select_box").clone(!0))});a(e).on("click",".reset_variations",function(){h.removeData("last_content");
5
- b.removeData("last_change")})})})(jQuery,window,document);
2
  e=b(this),c=b("<div/>",{"class":c}).data("value",b(this).attr("value")).data("option",e.clone(!0)).appendTo(d).off("click").on("click",function(c){b(this).hasClass("selected")?a.val("").change():(c.preventDefault(),a.val(e.val()).change())});"colorpicker"==g?c.append(b("<span/>",{css:{background:f}})):"image"==g?c.append(b("<img/>",{src:f})):"label"==g&&c.append(b("<span/>",{text:f}))}})}).filter(function(){return"select"!=b(this).data("type")}).hide();return a};this.onSelect=function(){c.each(function(){var a=
3
  b(this).val(),c=b(this).siblings(".select_box").find(".select_option").removeClass("selected");a&&c.filter(function(){return b(this).data("value")==a}).addClass("selected")});return a};this.updateOptions=function(){"undefined"==typeof yith_wccl_arg||yith_wccl_arg.is_wc24||a.find(".variations select").each(function(a,c){var d=b(this),e=d.val(),f=d.data("active_options")?d.data("active_options"):d.data("attribute_options");if(!f)return!1;""!=e?b.each(f,function(a,b){d.append(b)}):d.data("active_options",
4
  d.find("option").get())});return a};return this.updateOptions().clean().generateOutput().onSelect()};jQuery(function(a){var b=a(".variations_form"),h=b.find(".variations select");a(e).on("yith_wccl_change check_variations",b,function(){a(this).yith_wccl()}).trigger("yith_wccl_change");a(e).on("change",h,function(){b.data("last_change",a(this).attr("name"));a(this).data("last_content",a(this).siblings(".select_box").clone(!0))});a(e).on("click",".reset_variations",function(){h.removeData("last_content");
5
+ b.removeData("last_change")});h.trigger("focusin")})})(jQuery,window,document);
modules/yith-woocommerce-colors-labels-variations/changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  === 1.1.9 ===
2
  Added: ITA Language
3
  Fixed: Error with attributes created directly from edit product page
1
+ === 1.2.1 ===
2
+ Fixed: Issue with default variation attributes
3
+
4
+ === 1.2.0 ===
5
+ Fixed: Error with WooCommerce 2.3.x
6
+
7
  === 1.1.9 ===
8
  Added: ITA Language
9
  Fixed: Error with attributes created directly from edit product page
modules/yith-woocommerce-colors-labels-variations/class.yith-wccl-frontend.php CHANGED
@@ -43,6 +43,8 @@ if( !class_exists( 'YITH_WCCL_Frontend' ) ) {
43
 
44
  // YITH WCCL Loaded
45
  do_action( 'yith_wccl_loaded' );
 
 
46
  }
47
 
48
 
@@ -148,5 +150,39 @@ if( !class_exists( 'YITH_WCCL_Frontend' ) ) {
148
  }
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
152
  }
43
 
44
  // YITH WCCL Loaded
45
  do_action( 'yith_wccl_loaded' );
46
+
47
+ add_action( 'woocommerce_single_variation', array( $this, 'single_variation' ) );
48
  }
49
 
50
 
150
  }
151
  }
152
 
153
+ /**
154
+ * single variation template for variable_wccl
155
+ *
156
+ * @since 1.2
157
+ * @author Francesco Licandro
158
+ */
159
+ public function single_variation() {
160
+
161
+ global $product, $woocommerce;
162
+
163
+ if( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.4', '>=' ) ) {
164
+ return;
165
+ }
166
+
167
+ ob_start();
168
+
169
+ ?>
170
+
171
+ <div class="single_variation"></div>
172
+ <div class="variations_button">
173
+
174
+ <?php woocommerce_quantity_input(); ?>
175
+ <button type="submit" class="single_add_to_cart_button button alt"><?php echo apply_filters('single_add_to_cart_text', __( 'Add to cart', 'woocommerce' ), $product->product_type); ?></button>
176
+ </div>
177
+
178
+ <input type="hidden" name="add-to-cart" value="<?php echo $product->id; ?>" />
179
+ <input type="hidden" name="product_id" value="<?php echo esc_attr( $product->ID ); ?>" />
180
+ <input type="hidden" name="variation_id" class="variation_id" value="" />
181
+
182
+ <?php
183
+
184
+ echo ob_get_clean();
185
+ }
186
+
187
  }
188
  }
modules/yith-woocommerce-colors-labels-variations/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Colors and Labels Variations
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Colors and Labels Variations replaces the dropdown select of your variable products with Colors and Labels
6
- * Version: 1.1.9
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywcl
@@ -11,7 +11,7 @@
11
  *
12
  * @author Yithemes
13
  * @package YITH WooCommerce Colors and Labels Variations
14
- * @version 1.1.9
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -64,7 +64,7 @@ function yith_wccl_constructor() {
64
  define( 'YITH_WCCL', true );
65
  define( 'YITH_WCCL_URL', plugin_dir_url( __FILE__ ) );
66
  define( 'YITH_WCCL_DIR', plugin_dir_path( __FILE__ ) );
67
- define( 'YITH_WCCL_VERSION', '1.1.9' );
68
 
69
  // Load required classes and functions
70
  require_once('functions.yith-wccl.php');
3
  * Plugin Name: YITH WooCommerce Colors and Labels Variations
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Colors and Labels Variations replaces the dropdown select of your variable products with Colors and Labels
6
+ * Version: 1.2.1
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywcl
11
  *
12
  * @author Yithemes
13
  * @package YITH WooCommerce Colors and Labels Variations
14
+ * @version 1.2.1
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
64
  define( 'YITH_WCCL', true );
65
  define( 'YITH_WCCL_URL', plugin_dir_url( __FILE__ ) );
66
  define( 'YITH_WCCL_DIR', plugin_dir_path( __FILE__ ) );
67
+ define( 'YITH_WCCL_VERSION', '1.2.1' );
68
 
69
  // Load required classes and functions
70
  require_once('functions.yith-wccl.php');
modules/yith-woocommerce-colors-labels-variations/templates/single-product/add-to-cart/variable-wccl.php CHANGED
@@ -58,7 +58,17 @@ $attribute_keys = array_keys( $attributes );
58
  <?php
59
  if ( ! empty( $options ) ) {
60
 
61
- $selected_value = isset( $_REQUEST[ 'attribute_' . sanitize_title( $name ) ] ) ? wc_clean( $_REQUEST[ 'attribute_' . sanitize_title( $name ) ] ) : $product->get_variation_default_attribute( $name );
 
 
 
 
 
 
 
 
 
 
62
 
63
  // Get terms if this is a taxonomy - ordered
64
  if ( $product && taxonomy_exists( $name ) ) {
@@ -107,6 +117,7 @@ $attribute_keys = array_keys( $attributes );
107
 
108
  /**
109
  * woocommerce_single_variation hook. Used to output the cart button and placeholder for variation data.
 
110
  * @since 2.4.0
111
  * @hooked woocommerce_single_variation - 10 Empty div for variation data.
112
  * @hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
58
  <?php
59
  if ( ! empty( $options ) ) {
60
 
61
+ if ( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.4', '<' ) ) {
62
+ if ( isset( $_REQUEST[ 'attribute_' . sanitize_title( $name ) ] ) ) {
63
+ $selected_value = $_REQUEST[ 'attribute_' . sanitize_title( $name ) ];
64
+ } elseif ( isset( $selected_attributes[ sanitize_title( $name ) ] ) ) {
65
+ $selected_value = $selected_attributes[ sanitize_title( $name ) ];
66
+ } else {
67
+ $selected_value = '';
68
+ }
69
+ } else {
70
+ $selected_value = isset( $_REQUEST[ 'attribute_' . sanitize_title( $name ) ] ) ? wc_clean( $_REQUEST[ 'attribute_' . sanitize_title( $name ) ] ) : $product->get_variation_default_attribute( $name );
71
+ }
72
 
73
  // Get terms if this is a taxonomy - ordered
74
  if ( $product && taxonomy_exists( $name ) ) {
117
 
118
  /**
119
  * woocommerce_single_variation hook. Used to output the cart button and placeholder for variation data.
120
+ *
121
  * @since 2.4.0
122
  * @hooked woocommerce_single_variation - 10 Empty div for variation data.
123
  * @hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-admin.php CHANGED
@@ -100,7 +100,7 @@ if ( ! class_exists( 'YITH_Vendors_Admin' ) ) {
100
  add_action( 'pre_get_posts', array( $this, 'filter_vendor_linked_products' ), 10, 1 );
101
 
102
  /* Vendor media management */
103
- add_filter( 'pre_get_posts', array( $this, 'remove_attachments' ), 10, 1 );
104
 
105
  /* Vendor menu */
106
  add_action( 'admin_menu', array( $this, 'menu_items' ) );
@@ -268,7 +268,7 @@ if ( ! class_exists( 'YITH_Vendors_Admin' ) ) {
268
  }
269
 
270
  /**
271
- * Remove the 'Unattached' media
272
  *
273
  * @param array $query The Query
274
  *
@@ -276,48 +276,18 @@ if ( ! class_exists( 'YITH_Vendors_Admin' ) ) {
276
  * @return array Modified views
277
  * @since 1.0
278
  */
279
- public function remove_attachments( $query = array() ) {
280
  $vendor = yith_get_vendor( 'current', 'user' );
281
 
282
- if ( $vendor->is_super_user() || ! $vendor->is_user_admin() ) {
283
- return;
284
- }
285
-
286
- global $pagenow, $wpdb;
287
-
288
- $mode = isset( $_GET['mode'] ) ? $_GET['mode'] : false;
289
- $restrict = false;
290
- $is_attachment_page = isset( $_GET['attachment_id'] ) ? true : false;
291
-
292
- /**
293
- * Request Media Gallery List View by query string
294
- */
295
- if ( $mode && 'list' == $mode && 'upload.php' == $pagenow ) {
296
- $restrict = true;
297
- }
298
-
299
- /**
300
- * If not set $_GET['mode']:
301
- *
302
- * 1. Grid View Requested by query string
303
- * 2. Last used View ( grid or list )
304
- */
305
- if ( ! $mode && ! $is_attachment_page ) {
306
 
307
- $wp_list_table = _get_list_table( 'WP_Media_List_Table', array( 'screen' => 'upload' ) );
308
-
309
- if ( 'query-attachments' == $wp_list_table->current_action() || 'upload.php' == $pagenow ) {
310
- $restrict = true;
311
- }
312
- }
313
-
314
- if ( $restrict ) {
315
- $vendor_admin_ids = $vendor->get_admins();
316
 
317
- if ( ! empty( $vendor_admin_ids ) ) {
318
- $query->set( 'author__in', $vendor_admin_ids );
319
- }
320
- }
321
  }
322
 
323
  /**
100
  add_action( 'pre_get_posts', array( $this, 'filter_vendor_linked_products' ), 10, 1 );
101
 
102
  /* Vendor media management */
103
+ add_filter( 'ajax_query_attachments_args', array( $this, 'filter_vendor_media' ), 10, 1 );
104
 
105
  /* Vendor menu */
106
  add_action( 'admin_menu', array( $this, 'menu_items' ) );
268
  }
269
 
270
  /**
271
+ * Filter the vendor media library
272
  *
273
  * @param array $query The Query
274
  *
276
  * @return array Modified views
277
  * @since 1.0
278
  */
279
+ public function filter_vendor_media( $query = array() ) {
280
  $vendor = yith_get_vendor( 'current', 'user' );
281
 
282
+ if ( $vendor->is_valid() && $vendor->has_limited_access() ) {
283
+ $vendor_admin_ids = $vendor->get_admins();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
 
285
+ if ( ! empty( $vendor_admin_ids ) ) {
286
+ $query['author__in'] = $vendor_admin_ids;
287
+ }
 
 
 
 
 
 
288
 
289
+ }
290
+ return $query;
 
 
291
  }
292
 
293
  /**
modules/yith-woocommerce-product-vendors/init.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-product-vendors/
5
  Description: YITH WooCommerce Multi Vendor is a plugin explicitly developed to switch your website into a platform hosting more than one shop.
6
  Author: yithemes
7
  Text Domain: yith_wc_product_vendors
8
- Version: 1.5.1
9
  Author URI: http://yithemes.com/
10
  */
11
 
@@ -46,7 +46,7 @@ if ( ! function_exists( 'WC' ) ) {
46
  if ( defined( 'YITH_WPV_VERSION' ) ) {
47
  return;
48
  } else {
49
- define( 'YITH_WPV_VERSION', '1.5.1' );
50
  }
51
 
52
  /* Load YWCM text domain */
5
  Description: YITH WooCommerce Multi Vendor is a plugin explicitly developed to switch your website into a platform hosting more than one shop.
6
  Author: yithemes
7
  Text Domain: yith_wc_product_vendors
8
+ Version: 1.5.2
9
  Author URI: http://yithemes.com/
10
  */
11
 
46
  if ( defined( 'YITH_WPV_VERSION' ) ) {
47
  return;
48
  } else {
49
+ define( 'YITH_WPV_VERSION', '1.5.2' );
50
  }
51
 
52
  /* Load YWCM text domain */
modules/yith-woocommerce-quick-view/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Quick View
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Quick View allows your users to have a quick look about products.
6
- * Version: 1.0.7
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-wcqv
@@ -11,7 +11,7 @@
11
  *
12
  * @author Yithemes
13
  * @package YITH WooCommerce Quick View
14
- * @version 1.0.7
15
  */
16
  /* Copyright 2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -59,7 +59,7 @@ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
59
 
60
 
61
  if ( ! defined( 'YITH_WCQV_VERSION' ) ){
62
- define( 'YITH_WCQV_VERSION', '1.0.7' );
63
  }
64
 
65
  if ( ! defined( 'YITH_WCQV_FREE_INIT' ) ) {
3
  * Plugin Name: YITH WooCommerce Quick View
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Quick View allows your users to have a quick look about products.
6
+ * Version: 1.0.8
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-wcqv
11
  *
12
  * @author Yithemes
13
  * @package YITH WooCommerce Quick View
14
+ * @version 1.0.8
15
  */
16
  /* Copyright 2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
59
 
60
 
61
  if ( ! defined( 'YITH_WCQV_VERSION' ) ){
62
+ define( 'YITH_WCQV_VERSION', '1.0.8' );
63
  }
64
 
65
  if ( ! defined( 'YITH_WCQV_FREE_INIT' ) ) {
modules/yith-woocommerce-quick-view/templates/yith-quick-view-content.php CHANGED
@@ -10,7 +10,7 @@
10
 
11
  while ( have_posts() ) : the_post(); ?>
12
 
13
- '<div class="product">
14
 
15
  <div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?>" id="product-<?php the_ID(); ?>" <?php post_class('product'); ?>>
16
 
@@ -19,7 +19,7 @@ while ( have_posts() ) : the_post(); ?>
19
  <div class="summary entry-summary">
20
  <div class="summary-content">
21
  <?php do_action( 'yith_wcqv_product_summary' ); ?>
22
- <div>
23
  </div>
24
 
25
  </div>
10
 
11
  while ( have_posts() ) : the_post(); ?>
12
 
13
+ <div class="product">
14
 
15
  <div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?>" id="product-<?php the_ID(); ?>" <?php post_class('product'); ?>>
16
 
19
  <div class="summary entry-summary">
20
  <div class="summary-content">
21
  <?php do_action( 'yith_wcqv_product_summary' ); ?>
22
+ </div>
23
  </div>
24
 
25
  </div>
modules/yith-woocommerce-review-reminder/class.yith-woocommerce-review-reminder.php CHANGED
@@ -112,6 +112,8 @@ if ( !class_exists( 'YWRR_Review_Reminder' ) ) {
112
  add_filter( 'set-screen-option', 'YWRR_Blocklist_Table::set_options', 10, 3 );
113
 
114
  add_action( 'woocommerce_admin_field_customtext', 'YWRR_Custom_Textarea::output' );
 
 
115
  add_action( 'ywrr_blocklist', 'YWRR_Blocklist_Table::output' );
116
  add_action( 'current_screen', 'YWRR_Blocklist_Table::add_options' );
117
  add_action( 'admin_notices', array( $this, 'ywrr_protect_unsubscribe_page_notice' ) );
@@ -170,6 +172,29 @@ if ( !class_exists( 'YWRR_Review_Reminder' ) ) {
170
 
171
  }
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  /**
174
  * Get the email header.
175
  *
@@ -449,74 +474,6 @@ if ( !class_exists( 'YWRR_Review_Reminder' ) ) {
449
  }
450
  }
451
 
452
- /**
453
- * Creates database table for blocklist e scheduling
454
- *
455
- * @since 1.0.0
456
- * @return void
457
- * @author Alberto Ruggiero
458
- */
459
- static function ywrr_create_tables() {
460
- global $wpdb;
461
-
462
- $wpdb->hide_errors();
463
-
464
- $collate = '';
465
-
466
- if ( $wpdb->has_cap( 'collation' ) ) {
467
- if ( !empty( $wpdb->charset ) ) {
468
- $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
469
- }
470
- if ( !empty( $wpdb->collate ) ) {
471
- $collate .= " COLLATE $wpdb->collate";
472
- }
473
- }
474
-
475
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
476
-
477
- $ywrr_tables = "
478
- CREATE TABLE {$wpdb->prefix}ywrr_email_blocklist (
479
- id int NOT NULL AUTO_INCREMENT,
480
- customer_email longtext NOT NULL,
481
- customer_id bigint(20) NOT NULL DEFAULT 0,
482
- PRIMARY KEY (id)
483
- ) $collate;
484
- CREATE TABLE {$wpdb->prefix}ywrr_email_schedule (
485
- id int NOT NULL AUTO_INCREMENT,
486
- order_id bigint(20) NOT NULL,
487
- order_date date NOT NULL DEFAULT '0000-00-00',
488
- scheduled_date date NOT NULL DEFAULT '0000-00-00',
489
- request_items longtext NOT NULL DEFAULT '',
490
- mail_status varchar(15) NOT NULL DEFAULT 'pending',
491
- PRIMARY KEY (id)
492
- ) $collate;
493
- ";
494
-
495
- dbDelta( $ywrr_tables );
496
- }
497
-
498
- /**
499
- * Creates a cron job to handle daily mail send
500
- *
501
- * @since 1.0.0
502
- * @return void
503
- * @author Alberto Ruggiero
504
- */
505
- static function ywrr_create_schedule_job() {
506
- wp_schedule_event( time(), 'daily', 'ywrr_daily_send_mail_job' );
507
- }
508
-
509
- /**
510
- * Removes cron job
511
- *
512
- * @since 1.0.0
513
- * @return void
514
- * @author Alberto Ruggiero
515
- */
516
- static function ywrr_create_unschedule_job() {
517
- wp_clear_scheduled_hook( 'ywrr_daily_send_mail_job' );
518
- }
519
-
520
  /**
521
  * FRONTEND FUNCTIONS
522
  */
@@ -652,7 +609,7 @@ if ( !class_exists( 'YWRR_Review_Reminder' ) ) {
652
  * @author Alberto Ruggiero
653
  */
654
  public function get_premium_landing_uri() {
655
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
656
  }
657
 
658
  }
112
  add_filter( 'set-screen-option', 'YWRR_Blocklist_Table::set_options', 10, 3 );
113
 
114
  add_action( 'woocommerce_admin_field_customtext', 'YWRR_Custom_Textarea::output' );
115
+ add_filter( 'woocommerce_admin_settings_sanitize_option', array( $this, 'save_ywrr_textarea' ), 10, 3 );
116
+
117
  add_action( 'ywrr_blocklist', 'YWRR_Blocklist_Table::output' );
118
  add_action( 'current_screen', 'YWRR_Blocklist_Table::add_options' );
119
  add_action( 'admin_notices', array( $this, 'ywrr_protect_unsubscribe_page_notice' ) );
172
 
173
  }
174
 
175
+ /**
176
+ * Saves custom textarea content
177
+ *
178
+ * @since 1.0.6
179
+ *
180
+ * @param $value
181
+ * @param $option
182
+ * @param $raw_value
183
+ *
184
+ * @return string
185
+ * @author Alberto ruggiero
186
+ */
187
+ public function save_ywrr_textarea( $value, $option, $raw_value ) {
188
+
189
+ if ( $option['type'] == 'customtext' ) {
190
+ $value = wp_kses_post( trim( $raw_value ) );
191
+
192
+ }
193
+
194
+ return $value;
195
+
196
+ }
197
+
198
  /**
199
  * Get the email header.
200
  *
474
  }
475
  }
476
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  /**
478
  * FRONTEND FUNCTIONS
479
  */
609
  * @author Alberto Ruggiero
610
  */
611
  public function get_premium_landing_uri() {
612
+ return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing .'?refer_id=1030585';
613
  }
614
 
615
  }
modules/yith-woocommerce-review-reminder/includes/admin/class-yith-custom-table.php CHANGED
@@ -8,15 +8,16 @@
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
- if ( ! class_exists( 'WP_List_Table' ) ) {
16
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
17
  }
18
 
19
- if ( ! class_exists( 'YITH_Custom_Table' ) ) {
 
20
  /**
21
  * Shows a custom table
22
  *
@@ -43,50 +44,68 @@ if ( ! class_exists( 'YITH_Custom_Table' ) ) {
43
  * @author Alberto Ruggiero
44
  * @see WP_List_Table
45
  */
46
- function __construct( $args ) {
47
  global $status, $page;
48
 
49
  parent::__construct( $args );
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * Default column renderer
54
  *
 
 
55
  * @param $item array the row
56
  * @param $column_name string the column name
57
  *
58
- * @since 1.0.0
59
- * @author Alberto Ruggiero
60
  * @return string
 
61
  */
62
- function column_default( $item, $column_name ) {
63
  return $item[$column_name];
64
  }
65
 
66
  /**
67
  * Checkbox column renderer
68
  *
 
 
69
  * @param $item array the row
70
  *
71
- * @since 1.0.0
72
- * @author Alberto Ruggiero
73
  * @return string
 
 
74
  */
75
- function column_cb( $item ) {
 
76
  return sprintf(
77
  '<input type="checkbox" name="id[]" value="%s" />',
78
  $item[$this->options['key_column']]
79
  );
 
80
  }
81
 
82
  /**
83
  * Return array of bulk options
84
  *
85
  * @since 1.0.0
86
- * @author Alberto Ruggiero
87
  * @return array
 
88
  */
89
- function get_bulk_actions() {
90
  return $this->options['bulk_actions']['actions'];
91
  }
92
 
@@ -94,22 +113,23 @@ if ( ! class_exists( 'YITH_Custom_Table' ) ) {
94
  * Return array of sortable columns
95
  *
96
  * @since 1.0.0
 
97
  * @author Alberto Ruggiero
98
- * @return array
99
  */
100
- function get_sortable_columns()
101
- {
102
  return $this->options['sortable_columns'];
 
103
  }
104
 
105
  /**
106
  * Processes bulk actions
107
  *
108
  * @since 1.0.0
109
- * @author Alberto Ruggiero
110
  * @return void
 
111
  */
112
- function process_bulk_action() {
113
 
114
  $action = 'function_' . $this->current_action();
115
 
@@ -125,10 +145,10 @@ if ( ! class_exists( 'YITH_Custom_Table' ) ) {
125
  * It will get rows from database and prepare them to be showed in table
126
  *
127
  * @since 1.0.0
128
- * @author Alberto Ruggiero
129
  * @return void
 
130
  */
131
- function prepare_items() {
132
  global $wpdb;
133
 
134
  $select_table = $this->options['select_table'];
@@ -140,7 +160,7 @@ if ( ! class_exists( 'YITH_Custom_Table' ) ) {
140
  $count_table = $this->options['count_table'];
141
  $count_where = $this->options['count_where'] != '' ? 'WHERE ' . $this->options['count_where'] : '';
142
 
143
- $view_columns = $this->options['view_columns'];
144
  $hidden_columns = $this->options['hidden_columns'];
145
  $sortable_columns = $this->get_sortable_columns();
146
 
@@ -158,7 +178,7 @@ if ( ! class_exists( 'YITH_Custom_Table' ) ) {
158
  $orderby = ( isset( $_GET['orderby'] ) && in_array( $_GET['orderby'], array_keys( $this->get_sortable_columns() ) ) ) ? $_GET['orderby'] : $this->options['select_order'];
159
 
160
  $order_dir = ( $this->options['select_order_dir'] != '' ) ? $this->options['select_order_dir'] : 'asc';
161
- $order = ( isset( $_GET['order'] ) && in_array( $_GET['order'], array( 'asc', 'desc' ) ) ) ? $_GET['order'] : $order_dir;
162
 
163
  $this->items = $wpdb->get_results( $wpdb->prepare( "
164
  SELECT $select_columns
@@ -170,21 +190,21 @@ if ( ! class_exists( 'YITH_Custom_Table' ) ) {
170
  ", $select_limit, $paged ), ARRAY_A );
171
 
172
  $this->set_pagination_args( array(
173
- 'total_items' => $total_items,
174
- 'per_page' => $select_limit,
175
- 'total_pages' => ceil( $total_items / $select_limit )
176
- ) );
177
  }
178
 
179
  /**
180
  * Generates the columns for a single row of the table; overrides original class function
181
  *
 
 
182
  * @param $item array the row
183
  *
184
- * @since 1.0.0
185
- * @author Alberto Ruggiero
186
  * @return string
187
- * @see WP_List_Table
188
  */
189
  protected function single_row_columns( $item ) {
190
  list( $columns, $hidden ) = $this->get_column_info();
8
  * http://www.gnu.org/licenses/gpl-3.0.txt
9
  */
10
 
11
+ if ( !defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
 
15
+ if ( !class_exists( 'WP_List_Table' ) ) {
16
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
17
  }
18
 
19
+ if ( !class_exists( 'YITH_Custom_Table' ) ) {
20
+
21
  /**
22
  * Shows a custom table
23
  *
44
  * @author Alberto Ruggiero
45
  * @see WP_List_Table
46
  */
47
+ public function __construct( $args ) {
48
  global $status, $page;
49
 
50
  parent::__construct( $args );
51
  }
52
 
53
+ /**
54
+ * Get a list of columns.
55
+ *
56
+ * @since 1.0.0
57
+ * @return array
58
+ * @author Alberto Ruggiero
59
+ */
60
+ public function get_columns() {
61
+
62
+ return $this->options['view_columns'];
63
+
64
+ }
65
+
66
  /**
67
  * Default column renderer
68
  *
69
+ * @since 1.0.0
70
+ *
71
  * @param $item array the row
72
  * @param $column_name string the column name
73
  *
 
 
74
  * @return string
75
+ * @author Alberto Ruggiero
76
  */
77
+ protected function column_default( $item, $column_name ) {
78
  return $item[$column_name];
79
  }
80
 
81
  /**
82
  * Checkbox column renderer
83
  *
84
+ * @since 1.0.0
85
+ *
86
  * @param $item array the row
87
  *
 
 
88
  * @return string
89
+ * @author Alberto Ruggiero
90
+ *
91
  */
92
+ protected function column_cb( $item ) {
93
+
94
  return sprintf(
95
  '<input type="checkbox" name="id[]" value="%s" />',
96
  $item[$this->options['key_column']]
97
  );
98
+
99
  }
100
 
101
  /**
102
  * Return array of bulk options
103
  *
104
  * @since 1.0.0
 
105
  * @return array
106
+ * @author Alberto Ruggiero
107
  */
108
+ protected function get_bulk_actions() {
109
  return $this->options['bulk_actions']['actions'];
110
  }
111
 
113
  * Return array of sortable columns
114
  *
115
  * @since 1.0.0
116
+ * @return array
117
  * @author Alberto Ruggiero
 
118
  */
119
+ protected function get_sortable_columns() {
120
+
121
  return $this->options['sortable_columns'];
122
+
123
  }
124
 
125
  /**
126
  * Processes bulk actions
127
  *
128
  * @since 1.0.0
 
129
  * @return void
130
+ * @author Alberto Ruggiero
131
  */
132
+ public function process_bulk_action() {
133
 
134
  $action = 'function_' . $this->current_action();
135
 
145
  * It will get rows from database and prepare them to be showed in table
146
  *
147
  * @since 1.0.0
 
148
  * @return void
149
+ * @author Alberto Ruggiero
150
  */
151
+ public function prepare_items() {
152
  global $wpdb;
153
 
154
  $select_table = $this->options['select_table'];
160
  $count_table = $this->options['count_table'];
161
  $count_where = $this->options['count_where'] != '' ? 'WHERE ' . $this->options['count_where'] : '';
162
 
163
+ $view_columns = $this->get_columns();
164
  $hidden_columns = $this->options['hidden_columns'];
165
  $sortable_columns = $this->get_sortable_columns();
166
 
178
  $orderby = ( isset( $_GET['orderby'] ) && in_array( $_GET['orderby'], array_keys( $this->get_sortable_columns() ) ) ) ? $_GET['orderby'] : $this->options['select_order'];
179
 
180
  $order_dir = ( $this->options['select_order_dir'] != '' ) ? $this->options['select_order_dir'] : 'asc';
181
+ $order = ( isset( $_GET['order'] ) && in_array( $_GET['order'], array( 'asc', 'desc' ) ) ) ? $_GET['order'] : $order_dir;
182
 
183
  $this->items = $wpdb->get_results( $wpdb->prepare( "
184
  SELECT $select_columns
190
  ", $select_limit, $paged ), ARRAY_A );
191
 
192
  $this->set_pagination_args( array(
193
+ 'total_items' => $total_items,
194
+ 'per_page' => $select_limit,
195
+ 'total_pages' => ceil( $total_items / $select_limit )
196
+ ) );
197
  }
198
 
199
  /**
200
  * Generates the columns for a single row of the table; overrides original class function
201
  *
202
+ * @since 1.0.0
203
+ *
204
  * @param $item array the row
205
  *
 
 
206
  * @return string
207
+ * @author Alberto Ruggiero
208
  */
209
  protected function single_row_columns( $item ) {
210
  list( $columns, $hidden ) = $this->get_column_info();
modules/yith-woocommerce-review-reminder/init.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder
5
  Description: Send a review reminder to the customers over WooCommerce.
6
  Author: Yithemes
7
  Text Domain: ywrr
8
- Version: 1.0.4
9
  Author URI: http://yithemes.com/
10
  */
11
 
@@ -34,7 +34,7 @@ function ywrr_install_free_admin_notice() {
34
  }
35
 
36
  if ( !defined( 'YWRR_VERSION' ) ) {
37
- define( 'YWRR_VERSION', '1.0.4' );
38
  }
39
 
40
  if ( !defined( 'YWRR_FREE_INIT' ) ) {
@@ -74,6 +74,8 @@ add_action( 'ywrr_init', 'ywrr_init' );
74
 
75
  function ywrr_install() {
76
 
 
 
77
  if ( !function_exists( 'WC' ) ) {
78
  add_action( 'admin_notices', 'ywrr_install_woocommerce_admin_notice' );
79
  }
@@ -95,9 +97,87 @@ if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
95
  require_once 'plugin-fw/yit-plugin-registration-hook.php';
96
  }
97
 
98
- require_once( YWRR_DIR . 'class.yith-woocommerce-review-reminder.php' );
99
 
100
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
101
- register_activation_hook( __FILE__, array( 'YWRR_Review_Reminder', 'ywrr_create_tables' ) );
102
- register_activation_hook( __FILE__, array( 'YWRR_Review_Reminder', 'ywrr_create_schedule_job' ) );
103
- register_deactivation_hook( __FILE__, array( 'YWRR_Review_Reminder', 'ywrr_create_unschedule_job' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  Description: Send a review reminder to the customers over WooCommerce.
6
  Author: Yithemes
7
  Text Domain: ywrr
8
+ Version: 1.0.8
9
  Author URI: http://yithemes.com/
10
  */
11
 
34
  }
35
 
36
  if ( !defined( 'YWRR_VERSION' ) ) {
37
+ define( 'YWRR_VERSION', '1.0.8' );
38
  }
39
 
40
  if ( !defined( 'YWRR_FREE_INIT' ) ) {
74
 
75
  function ywrr_install() {
76
 
77
+ require_once( YWRR_DIR . 'class.yith-woocommerce-review-reminder.php' );
78
+
79
  if ( !function_exists( 'WC' ) ) {
80
  add_action( 'admin_notices', 'ywrr_install_woocommerce_admin_notice' );
81
  }
97
  require_once 'plugin-fw/yit-plugin-registration-hook.php';
98
  }
99
 
 
100
 
101
  register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
102
+ register_activation_hook( __FILE__, 'ywrr_create_tables' );
103
+ register_activation_hook( __FILE__, 'ywrr_create_schedule_job' );
104
+ register_deactivation_hook( __FILE__, 'ywrr_create_unschedule_job' );
105
+
106
+ if ( !function_exists( 'ywrr_create_tables' ) ) {
107
+
108
+ /**
109
+ * Creates database table for blocklist e scheduling
110
+ *
111
+ * @since 1.0.0
112
+ * @return void
113
+ * @author Alberto Ruggiero
114
+ */
115
+ function ywrr_create_tables() {
116
+ global $wpdb;
117
+
118
+ $wpdb->hide_errors();
119
+
120
+ $collate = '';
121
+
122
+ if ( $wpdb->has_cap( 'collation' ) ) {
123
+ if ( !empty( $wpdb->charset ) ) {
124
+ $collate .= "DEFAULT CHARACTER SET $wpdb->charset";
125
+ }
126
+ if ( !empty( $wpdb->collate ) ) {
127
+ $collate .= " COLLATE $wpdb->collate";
128
+ }
129
+ }
130
+
131
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
132
+
133
+ $ywrr_tables = "
134
+ CREATE TABLE {$wpdb->prefix}ywrr_email_blocklist (
135
+ id int NOT NULL AUTO_INCREMENT,
136
+ customer_email longtext NOT NULL,
137
+ customer_id bigint(20) NOT NULL DEFAULT 0,
138
+ PRIMARY KEY (id)
139
+ ) $collate;
140
+ CREATE TABLE {$wpdb->prefix}ywrr_email_schedule (
141
+ id int NOT NULL AUTO_INCREMENT,
142
+ order_id bigint(20) NOT NULL,
143
+ order_date date NOT NULL DEFAULT '0000-00-00',
144
+ scheduled_date date NOT NULL DEFAULT '0000-00-00',
145
+ request_items longtext NOT NULL DEFAULT '',
146
+ mail_status varchar(15) NOT NULL DEFAULT 'pending',
147
+ PRIMARY KEY (id)
148
+ ) $collate;
149
+ ";
150
+
151
+ dbDelta( $ywrr_tables );
152
+ }
153
+ }
154
+
155
+ if ( !function_exists( 'ywrr_create_schedule_job' ) ) {
156
+
157
+ /**
158
+ * Creates a cron job to handle daily mail send
159
+ *
160
+ * @since 1.0.0
161
+ * @return void
162
+ * @author Alberto Ruggiero
163
+ */
164
+ function ywrr_create_schedule_job() {
165
+ wp_schedule_event( time(), 'daily', 'ywrr_daily_send_mail_job' );
166
+ }
167
+
168
+ }
169
+
170
+ if ( !function_exists( 'ywrr_create_unschedule_job' ) ) {
171
+
172
+ /**
173
+ * Removes cron job
174
+ *
175
+ * @since 1.0.0
176
+ * @return void
177
+ * @author Alberto Ruggiero
178
+ */
179
+ function ywrr_create_unschedule_job() {
180
+ wp_clear_scheduled_hook( 'ywrr_daily_send_mail_job' );
181
+ }
182
+
183
+ }
modules/yith-woocommerce-review-reminder/plugin-options/mail-options.php CHANGED
@@ -28,14 +28,6 @@ $custom_template = !defined( 'YWRR_PREMIUM' ) ? '' : array(
28
  'id' => 'ywrr_mail_template'
29
  );
30
 
31
- $email_templates_enable = !defined( 'YWRR_PREMIUM' ) && !defined( 'YITH_WCET_PREMIUM' ) ? '' : array(
32
- 'name' => __( 'Use YITH WooCommerce Email Templates', 'ywrr' ),
33
- 'type' => 'checkbox',
34
- 'desc' => '',
35
- 'id' => 'ywrr_mail_template_enable',
36
- 'default' => 'no',
37
- );
38
-
39
  $item_link = !defined( 'YWRR_PREMIUM' ) ? '' : array(
40
  'name' => __( 'Set Destination', 'ywrr' ),
41
  'type' => 'select',
@@ -56,6 +48,13 @@ $item_link_hash = !defined( 'YWRR_PREMIUM' ) ? '' : array(
56
  'id' => 'ywrr_mail_item_link_hash',
57
  );
58
 
 
 
 
 
 
 
 
59
 
60
  $videobox = defined( 'YWRR_PREMIUM' ) ? '' : array(
61
  'name' => __( 'Upgrade to the PREMIUM VERSION', 'ywrr' ),
@@ -87,10 +86,9 @@ return array(
87
  'name' => __( 'General Settings', 'ywrr' ),
88
  'type' => 'title',
89
  'desc' => '',
90
- 'id' => 'ywrr_general_title',
91
  ),
92
  'review_reminder_general_enable_plugin' => array(
93
- 'name' => __( 'Enable YITH WooCommerce Product Countdown', 'ywrr' ),
94
  'type' => 'checkbox',
95
  'desc' => '',
96
  'id' => 'ywrr_enable_plugin',
@@ -98,13 +96,11 @@ return array(
98
  ),
99
  'review_reminder_general_end' => array(
100
  'type' => 'sectionend',
101
- 'id' => 'ywrr_general_end'
102
  ),
103
  'review_reminder_mail_section_title' => array(
104
  'name' => __( 'Mail Settings', 'ywrr' ),
105
  'type' => 'title',
106
  'desc' => '',
107
- 'id' => 'ywrr_mail_settings_title',
108
  ),
109
  'review_reminder_mail_type' => array(
110
  'name' => __( 'Email type', 'ywrr' ),
@@ -173,7 +169,6 @@ Much appreciated,
173
  ),
174
  'review_reminder_mail_section_end' => array(
175
  'type' => 'sectionend',
176
- 'id' => 'ywrr_mail_settings_end'
177
  )
178
  )
179
 
28
  'id' => 'ywrr_mail_template'
29
  );
30
 
 
 
 
 
 
 
 
 
31
  $item_link = !defined( 'YWRR_PREMIUM' ) ? '' : array(
32
  'name' => __( 'Set Destination', 'ywrr' ),
33
  'type' => 'select',
48
  'id' => 'ywrr_mail_item_link_hash',
49
  );
50
 
51
+ $email_templates_enable = ( defined( 'YWRR_PREMIUM' ) && defined( 'YITH_WCET_PREMIUM' ) ) ? array(
52
+ 'name' => __( 'Use YITH WooCommerce Email Templates', 'ywrr' ),
53
+ 'type' => 'checkbox',
54
+ 'desc' => '',
55
+ 'id' => 'ywrr_mail_template_enable',
56
+ 'default' => 'no',
57
+ ) : '';
58
 
59
  $videobox = defined( 'YWRR_PREMIUM' ) ? '' : array(
60
  'name' => __( 'Upgrade to the PREMIUM VERSION', 'ywrr' ),
86
  'name' => __( 'General Settings', 'ywrr' ),
87
  'type' => 'title',
88
  'desc' => '',
 
89
  ),
90
  'review_reminder_general_enable_plugin' => array(
91
+ 'name' => __( 'Enable YITH WooCommerce Review Reminder', 'ywrr' ),
92
  'type' => 'checkbox',
93
  'desc' => '',
94
  'id' => 'ywrr_enable_plugin',
96
  ),
97
  'review_reminder_general_end' => array(
98
  'type' => 'sectionend',
 
99
  ),
100
  'review_reminder_mail_section_title' => array(
101
  'name' => __( 'Mail Settings', 'ywrr' ),
102
  'type' => 'title',
103
  'desc' => '',
 
104
  ),
105
  'review_reminder_mail_type' => array(
106
  'name' => __( 'Email type', 'ywrr' ),
169
  ),
170
  'review_reminder_mail_section_end' => array(
171
  'type' => 'sectionend',
 
172
  )
173
  )
174
 
modules/yith-woocommerce-review-reminder/templates/admin/premium.php CHANGED
@@ -225,30 +225,28 @@
225
  <div class="landing-container">
226
  <div class="premium-cta">
227
  <p>
228
- Upgrade to the <span class="highlight">premium version</span>
229
- of <span class="highlight">YITH WooCommerce Review Reminder</span> to benefit from all features!
230
  </p>
231
  <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
232
- <span class="highlight">UPGRADE</span>
233
- <span>to the premium version</span>
234
  </a>
235
  </div>
236
  </div>
237
  </div>
238
  <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
239
- <h1>Premium Features</h1>
240
 
241
  <div class="landing-container">
242
  <div class="col-1">
243
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/01.png" alt="Review Title" />
244
  </div>
245
  <div class="col-2">
246
  <div class="section-title">
247
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/01-icon.png" alt="Review Title" />
248
 
249
- <h2>SELECTION OF THE PRODUCTS TO REVIEW</h2>
250
  </div>
251
- <p>Choose to ask users the review of every purchased product, or only a part of them.</p>
252
  </div>
253
  </div>
254
  </div>
@@ -256,29 +254,29 @@
256
  <div class="landing-container">
257
  <div class="col-2">
258
  <div class="section-title">
259
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/02-icon.png" alt="Attachment List" />
260
 
261
- <h2>DEADLINE FOR EMAIL DISPATCHING</h2>
262
  </div>
263
- <p>Set how many days have to pass before sending the email to request a review, after the order has been marked as "Completed".</p>
264
  </div>
265
  <div class="col-1">
266
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/02.png" alt="Attachment List" />
267
  </div>
268
  </div>
269
  </div>
270
  <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/03-bg.png) no-repeat #fff; background-position: 85% 100%">
271
  <div class="landing-container">
272
  <div class="col-1">
273
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/03.png" alt="Vote the review" />
274
  </div>
275
  <div class="col-2">
276
  <div class="section-title">
277
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/03-icon.png" alt="Vote the review" />
278
 
279
- <h2>BLOCKLIST</h2>
280
  </div>
281
- <p>Add to the blocklist all the users' emails that don't want to review any product of your e-commerce.</p>
282
  </div>
283
  </div>
284
  </div>
@@ -286,14 +284,44 @@
286
  <div class="landing-container">
287
  <div class="col-2">
288
  <div class="section-title">
289
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/04-icon.png" alt="Number" />
290
 
291
- <h2>EMAIL TEMPLATE</h2>
292
  </div>
293
- <p>Select the layout you want for your email choosing among the four possibilities we offer you.</p>
294
  </div>
295
  <div class="col-1">
296
- <img src="<?php echo YWRR_ASSETS_URL ?>/images/04.png" alt="Number" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  </div>
298
  </div>
299
  </div>
@@ -301,14 +329,13 @@
301
  <div class="landing-container">
302
  <div class="premium-cta">
303
  <p>
304
- Upgrade to the <span class="highlight">premium version</span>
305
- of <span class="highlight">YITH WooCommerce Review Reminder</span> to benefit from all features!
306
  </p>
307
  <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
308
- <span class="highlight">UPGRADE</span>
309
- <span>to the premium version</span>
310
  </a>
311
  </div>
312
  </div>
313
  </div>
 
314
  </div>
225
  <div class="landing-container">
226
  <div class="premium-cta">
227
  <p>
228
+ <?php echo sprintf(__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Review Reminder%2$s to benefit from all features!','ywrr'),'<span class="highlight">','</span>');?>
 
229
  </p>
230
  <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
231
+ <?php echo sprintf(__('%1$sUPGRADE%2$s %3$sto the premium%2$s','ywrr'),'<span class="highlight">','</span>','<span>');?>
 
232
  </a>
233
  </div>
234
  </div>
235
  </div>
236
  <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/01-bg.png) no-repeat #fff; background-position: 85% 75%">
237
+ <h1><?php _e('Premium Features','ywrr');?></h1>
238
 
239
  <div class="landing-container">
240
  <div class="col-1">
241
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/01.png" alt="<?php _e('SELECTION TO REVIEW','ywrr');?>" />
242
  </div>
243
  <div class="col-2">
244
  <div class="section-title">
245
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/01-icon.png" alt=icon-01 />
246
 
247
+ <h2><?php _e('SELECTION OF THE PRODUCTS TO REVIEW','ywrr');?></h2>
248
  </div>
249
+ <p><?php echo sprintf (__('%1$sChoose to ask users%2$s the review of every purchased product, or only a part of them.','ywrr'),'<b>','</b>');?></p>
250
  </div>
251
  </div>
252
  </div>
254
  <div class="landing-container">
255
  <div class="col-2">
256
  <div class="section-title">
257
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/02-icon.png" alt="icon-02" />
258
 
259
+ <h2><?php _e('DEADLINE FOR EMAIL DISPATCHING','ywrr');?></h2>
260
  </div>
261
+ <p><?php echo sprintf (__('Set %1$show many days have to pass%2$s before sending the email to request a review, after the order has been marked as "Completed".','ywrr'),'<b>','</b>');?></p>
262
  </div>
263
  <div class="col-1">
264
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/02.png" alt="<?php _e('DEADLINE','ywrr');?>" />
265
  </div>
266
  </div>
267
  </div>
268
  <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/03-bg.png) no-repeat #fff; background-position: 85% 100%">
269
  <div class="landing-container">
270
  <div class="col-1">
271
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/03.png" alt="<?php _e('BLOCKLIST','ywrr');?>" />
272
  </div>
273
  <div class="col-2">
274
  <div class="section-title">
275
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/03-icon.png" alt="icon-03" />
276
 
277
+ <h2><?php _e('BLOCKLIST','ywrr');?></h2>
278
  </div>
279
+ <p><?php echo sprintf (__('%1$sAdd to the blocklist%2$s all the users emails that don\'t want to review any product of your e-commerce.','ywrr'),'<b>','</b>');?></p>
280
  </div>
281
  </div>
282
  </div>
284
  <div class="landing-container">
285
  <div class="col-2">
286
  <div class="section-title">
287
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/04-icon.png" alt="icon-04" />
288
 
289
+ <h2><?php _e('EMAIL TEMPLATE','ywrr');?></h2>
290
  </div>
291
+ <p><?php echo sprintf (__('Select the %1$slayout you want%2$s for your email choosing among the four possibilities we offer you.','ywrr'),'<b>','</b>');?></p>
292
  </div>
293
  <div class="col-1">
294
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/04.png" alt="<?php _e('EMAIL TEMPLATE','ywrr');?>" />
295
+ </div>
296
+ </div>
297
+ </div>
298
+ <div class="section section-even clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/05-bg.png) no-repeat #fff; background-position: 85% 75%">
299
+ <div class="landing-container">
300
+ <div class="col-1">
301
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/05.png" alt="<?php _e('MANDRILL','ywrr');?>" />
302
+ </div>
303
+ <div class="col-2">
304
+ <div class="section-title">
305
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/05-icon.png" alt=icon-05 />
306
+
307
+ <h2><?php _e('USE MANDRILL TO MANAGE YOUR EMAILS','ywrr');?></h2>
308
+ </div>
309
+ <p><?php echo sprintf (__('%1$sMake creation of custom%2$s reminders automatic in a few clicks.','ywrr'),'<b>','</b>');?></p>
310
+ </div>
311
+ </div>
312
+ </div>
313
+ <div class="section section-odd clear" style="background: url(<?php echo YWRR_ASSETS_URL ?>/images/06-bg.png) no-repeat #f1f1f1; background-position: 15% 100%">
314
+ <div class="landing-container">
315
+ <div class="col-2">
316
+ <div class="section-title">
317
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/06-icon.png" alt="icon-06" />
318
+
319
+ <h2><?php _e('SCHEDULE LIST','ywrr');?></h2>
320
+ </div>
321
+ <p><?php echo sprintf (__('See all reminders you have scheduled %1$s(past and present)%2$s in one tab only and delete them from this page without having to move anywhere else.','ywrr'),'<b>','</b>');?></p>
322
+ </div>
323
+ <div class="col-1">
324
+ <img src="<?php echo YWRR_ASSETS_URL ?>/images/06.png" alt="<?php _e('SCHEDULE LIST','ywrr');?>" />
325
  </div>
326
  </div>
327
  </div>
329
  <div class="landing-container">
330
  <div class="premium-cta">
331
  <p>
332
+ <?php echo sprintf (__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Review Reminder%2$s to benefit from all features!','ywrr'),'<span class="highlight">','</span>');?>
 
333
  </p>
334
  <a href="http://yithemes.com/themes/plugins/yith-woocommerce-review-reminder/" target="_blank" class="premium-cta-button button btn">
335
+ <?php echo sprintf (__('%1$sUPGRADE%2$s %3$sto the premium version%2$s','ywrr'),'<span class="highlight">','</span>','<span>');?>
 
336
  </a>
337
  </div>
338
  </div>
339
  </div>
340
+
341
  </div>
modules/yith-woocommerce-zoom-magnifier/assets/css/frontend.css CHANGED
@@ -57,3 +57,9 @@ span.onsale {
57
  z-index: 10000
58
  }
59
 
 
 
 
 
 
 
57
  z-index: 10000
58
  }
59
 
60
+ div.pp_woocommerce a.pp_expand {
61
+ display: inline;
62
+ bottom: 10px;
63
+ top: initial;
64
+ left: 10px;
65
+ }
modules/yith-woocommerce-zoom-magnifier/assets/images/yith-woocommerce-zoom-magnifier-video.jpg ADDED
Binary file
modules/yith-woocommerce-zoom-magnifier/assets/js/frontend.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
- * @version 1.1.2
7
  */
8
  jQuery(document).ready(function ($) {
9
 
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Zoom Magnifier
6
+ * @version 1.2.9
7
  */
8
  jQuery(document).ready(function ($) {
9
 
modules/yith-woocommerce-zoom-magnifier/assets/js/yith_magnifier.js CHANGED
@@ -7,8 +7,7 @@
7
  * MIT License.
8
  */
9
 
10
- ;
11
- (function (window, $, undefined) {
12
  'use strict';
13
 
14
  //include imagesLoaded plugin
@@ -23,8 +22,7 @@
23
  /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
24
  /*global jQuery: false */
25
 
26
- ;
27
- (function ($, undefined) {
28
  'use strict';
29
 
30
  // blank image data-uri bypasses webkit log warning (thx doug jones)
@@ -203,6 +201,8 @@
203
  _init: function (options) {
204
  var self = this;
205
 
 
 
206
  $.each($.yith_magnifier.defaults.elements, function (i, v) {
207
  var el = $.yith_magnifier.defaults.elements;
208
  el[i] = $(v, self);
@@ -217,6 +217,8 @@
217
  self._initZoom();
218
  self._initGallery();
219
  });
 
 
220
  },
221
 
222
 
@@ -254,7 +256,8 @@
254
  //gallery.filter(':first').trigger('click');
255
 
256
  if (self.options.enableSlider) {
257
- gallery.parents('ul')[self.options.slider](self.options.sliderOptions);
 
258
  }
259
 
260
  } else {
@@ -280,11 +283,13 @@
280
  if (this.mouseTrap === undefined) {
281
  var w = this.options.elements.zoom.width();
282
 
283
- $('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
284
- 'width': w,
285
- 'text-align': 'center',
286
- opacity: .5
287
- }).appendTo(this.options.elements.zoom.parent());
 
 
288
  }
289
  },
290
 
@@ -749,7 +754,7 @@
749
  var instance = $.data(this, 'yith_magnifier');
750
  if (!instance) {
751
  $.error("cannot call methods on yith_magnifier prior to initialization; " +
752
- "attempted to call method '" + options + "'");
753
  return;
754
  }
755
  if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
7
  * MIT License.
8
  */
9
 
10
+ ;(function (window, $, undefined) {
 
11
  'use strict';
12
 
13
  //include imagesLoaded plugin
22
  /*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
23
  /*global jQuery: false */
24
 
25
+ ;(function ($, undefined) {
 
26
  'use strict';
27
 
28
  // blank image data-uri bypasses webkit log warning (thx doug jones)
201
  _init: function (options) {
202
  var self = this;
203
 
204
+ $(document).trigger('yith_magnifier_before_init');
205
+
206
  $.each($.yith_magnifier.defaults.elements, function (i, v) {
207
  var el = $.yith_magnifier.defaults.elements;
208
  el[i] = $(v, self);
217
  self._initZoom();
218
  self._initGallery();
219
  });
220
+
221
+ $(document).trigger('yith_magnifier_after_init');
222
  },
223
 
224
 
256
  //gallery.filter(':first').trigger('click');
257
 
258
  if (self.options.enableSlider) {
259
+ gallery.closest('ul').trigger('yith_magnifier_slider_destroy');
260
+ gallery.closest('ul')[self.options.slider](self.options.sliderOptions);
261
  }
262
 
263
  } else {
283
  if (this.mouseTrap === undefined) {
284
  var w = this.options.elements.zoom.width();
285
 
286
+ if (this.options.loadingLabel) {
287
+ $('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
288
+ 'width': w,
289
+ 'text-align': 'center',
290
+ opacity: .5
291
+ }).appendTo(this.options.elements.zoom.parent());
292
+ }
293
  }
294
  },
295
 
754
  var instance = $.data(this, 'yith_magnifier');
755
  if (!instance) {
756
  $.error("cannot call methods on yith_magnifier prior to initialization; " +
757
+ "attempted to call method '" + options + "'");
758
  return;
759
  }
760
  if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
modules/yith-woocommerce-zoom-magnifier/assets/js/yith_magnifier.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,i,o){"use strict";i.fn.imagesLoaded===o&&!function(t,i){var o="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.fn.imagesLoaded=function(e){function n(){var i=t(c),o=t(d);h&&(d.length?h.reject(l,i,o):h.resolve(l)),t.isFunction(e)&&e.call(r,l,i,o)}function s(t){a(t.target,"error"===t.type)}function a(i,e){i.src!==o&&-1===t.inArray(i,u)&&(u.push(i),e?d.push(i):c.push(i),t.data(i,"imagesLoaded",{isBroken:e,src:i.src}),m&&h.notifyWith(t(i),[e,l,t(c),t(d)]),l.length===u.length&&(setTimeout(n),l.unbind(".imagesLoaded",s)))}var r=this,h=t.isFunction(t.Deferred)?t.Deferred():0,m=t.isFunction(h.notify),l=r.find("img").add(r.filter("img")),u=[],c=[],d=[];return t.isPlainObject(e)&&t.each(e,function(t,i){"callback"===t?e=i:h&&h[t](i)}),l.length?l.bind("load.imagesLoaded error.imagesLoaded",s).each(function(e,n){var s=n.src,r=t.data(n,"imagesLoaded");return r&&r.src===s?void a(n,r.isBroken):n.complete&&n.naturalWidth!==i?void a(n,0===n.naturalWidth||0===n.naturalHeight):void((n.readyState||n.complete)&&(n.src=o,n.src=s))}):n(),h?h.promise(r):r}}(jQuery),i.yith_magnifier=function(t,o){this.t=o,this.element=i(o),this._init(t)},i.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:i(".yith_magnifier_zoom"),zoomImage:i(".yith_magnifier_zoom img"),gallery:i(".yith_magnifier_gallery li a")}},i.yith_magnifier.prototype={_init:function(t){var o=this;i.each(i.yith_magnifier.defaults.elements,function(t,e){var n=i.yith_magnifier.defaults.elements;n[t]=i(e,o)}),o.options=i.extend(!0,{},i.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()})},_initGallery:function(){var t=this,o=t.options.elements,e=o.gallery,n=o.zoom,s=o.zoomImage;e.length>0?(e.on("click",function(o){o.preventDefault();var e=i(this);t.destroy(),n.attr("href",this.href),s.attr("src",e.data("small")).attr("srcset",e.data("small")).attr("src-orig",e.data("small")).attr("title","").attr("title",e.attr("title")),i.data(t.t,"yith_magnifier",new i.yith_magnifier(t.options,t.element))}),t.options.enableSlider&&e.parents("ul")[t.options.slider](t.options.sliderOptions)):e.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&i(document).on("contextmenu",function(){return!1}),this.mouseTrap===o){var t=this.options.elements.zoom.width();i('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var t=this;t.zoom=t.options.elements.zoom,t.zoomImage=t.options.elements.zoomImage,t.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>'),t.IMG_zoomImage=new Image,t.IMG_zoomImage.src=t.zoom.attr("href"),t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initTrap()})},_initTrap:function(){{var t=this,o=t.IMG_zoomImage;t.IMG_smallImage}t.mx=0,t.my=0,t.controlTimer=0,t.lens=null,t.tint=null,t.softFocus=null,t.zoomDiv=null,t.cw=0,t.ch=0,t.zw=0,t.destU=0,t.destV=0,t.currU=0,t.currV=0,t.mouseTrap=null;var e=t.options.elements.zoom,n=t.options.elements.zoomImage;i(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=i('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent());var s="ontouchstart"in document.documentElement?!0:!1,a="touchmove mousemove",r="touchend mouseleave",h="touchstart mouseenter",m="touchstart click";this.mouseTrap.on(a,this,function(i){t.options.onMove(),t.mx="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageX:i.pageX,t.my="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageY:i.pageY}).on(r,this,function(){return clearTimeout(t.controlTimer),t.lens&&t.lens.fadeOut(299),t.tint&&t.tint.fadeOut(299),t.softFocus&&t.softFocus.fadeOut(299),t.zoomDiv.fadeOut(300,function(){t._onLeave()}),!1}).on(m,this,function(){t.options.onClick()}).on(h,this,function(a){t.options.onEnter(),s&&a.preventDefault(),t.mx="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageX:a.pageX,t.my="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageY:a.pageY,t.zw=a.data,t.zoomDiv&&(t.zoomDiv.stop(!0,!1),t.zoomDiv.remove());var r=t.options.adjustX,h=t.options.adjustY,m=n.outerWidth(),l=n.outerHeight(),u=t.options.zoomWidth,c=t.options.zoomHeight;"auto"==t.options.zoomWidth&&(u=m),"auto"==t.options.zoomHeight&&(c=l);var d=e.parent();switch(t.options.position){case"top":h-=c;break;case"right":r+=m;break;case"bottom":h+=l;break;case"left":r-=u;break;case"inside":u=m,c=l;break;default:d=i("#"+t.options.position),d.length?(u=d.innerWidth(),c=d.innerHeight()):(d=e,r+=m,h+=l)}t.isPhone&&"inside"==t.options.phoneBehavior&&(u=m,c=l,r=0,h=0),t.zoomDiv=i('<div class="yith_magnifier_zoom_magnifier" />').css({left:r,top:h,width:u,height:c,"background-repeat":"no-repeat",backgroundImage:"url("+o.src+")"}).appendTo(d),n.attr("title")&&t.options.showTitle&&i('<div class="yith_magnifier_title">'+n.attr("title")+"</div>").appendTo(t.zoomDiv),t.isPhone?"disable"!=t.options.phoneBehavior?t.zoomDiv.fadeIn(500):t.lens.fadeOut(299):t.zoomDiv.fadeIn(500),t.lens&&(t.lens.remove(),t.lens=null),t.cw=o.width<=1?n.outerWidth()/o.naturalWidth*t.zoomDiv.width():n.outerWidth()/o.width*t.zoomDiv.width(),t.ch=o.height<=1?n.outerHeight()/o.naturalHeight*t.zoomDiv.height():n.outerHeight()/o.height*t.zoomDiv.height(),t.lens=i('<div class="yith_magnifier_lens" />').css({width:t.cw,height:t.ch}).appendTo(e),t.mouseTrap.css("cursor",t.lens.css("cursor"));var g=!1;t.options.tint&&(t.tint=i("<div />").css({display:"none",position:"absolute",left:0,top:0,width:n.outerWidth(),height:n.outerHeight(),backgroundColor:t.options.tint,opacity:t.options.tintOpacity}).appendTo(e),t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.tint.fadeIn(500)),t.options.softFocus&&(t.softFocus=i("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:n.outerWidth(),height:n.outerHeight(),opacity:.5}).appendTo(e),t.softFocus.append(i("<img />",{src:n.attr("src")})),0==t.lens.find("img").length&&t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.softFocus.fadeIn(500)),g||t.lens.css("opacity",t.options.lensOpacity),"inside"!==t.options.position&&t.lens.fadeIn(500),t.zw._controlLoop()})},_controlLoop:function(){var t=this;if(this.lens){var i=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,o=this.my-this.zoomImage.offset().top-.5*this.ch>>0;0>i?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),0>o?o=0:o>this.zoomImage.outerHeight()-this.ch&&(o=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:i-2,top:o-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-i+"px ",marginTop:-o+"px"}),this.destU=this.IMG_zoomImage.width<=1?i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.destV=this.IMG_zoomImage.height<=1?o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:o/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+(-(this.currV>>0)+"px"))}this.controlTimer=setTimeout(function(){t._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),this.element.find(".yith_magnifier_loading").length>0&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&i(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},i.fn.yith_magnifier=function(t){if("string"==typeof t){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var e=i.data(this,"yith_magnifier");return e?i.isFunction(e[t])&&"_"!==t.charAt(0)?void e[t].apply(e,o):void i.error("no such method '"+t+"' for yith_magnifier instance"):void i.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+t+"'")})}else this.each(function(){var o=i.data(this,"yith_magnifier");o?i.error("yith_magnifier already istantiated."):i.data(this,"yith_magnifier",new i.yith_magnifier(t,this))});return this}}(window,jQuery);
1
+ !function(t,i,e){"use strict";i.fn.imagesLoaded===e&&!function(t,i){var e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.fn.imagesLoaded=function(o){function n(){var i=t(c),e=t(d);h&&(d.length?h.reject(l,i,e):h.resolve(l)),t.isFunction(o)&&o.call(r,l,i,e)}function s(t){a(t.target,"error"===t.type)}function a(i,o){i.src!==e&&-1===t.inArray(i,u)&&(u.push(i),o?d.push(i):c.push(i),t.data(i,"imagesLoaded",{isBroken:o,src:i.src}),m&&h.notifyWith(t(i),[o,l,t(c),t(d)]),l.length===u.length&&(setTimeout(n),l.unbind(".imagesLoaded",s)))}var r=this,h=t.isFunction(t.Deferred)?t.Deferred():0,m=t.isFunction(h.notify),l=r.find("img").add(r.filter("img")),u=[],c=[],d=[];return t.isPlainObject(o)&&t.each(o,function(t,i){"callback"===t?o=i:h&&h[t](i)}),l.length?l.bind("load.imagesLoaded error.imagesLoaded",s).each(function(o,n){var s=n.src,r=t.data(n,"imagesLoaded");return r&&r.src===s?void a(n,r.isBroken):n.complete&&n.naturalWidth!==i?void a(n,0===n.naturalWidth||0===n.naturalHeight):void((n.readyState||n.complete)&&(n.src=e,n.src=s))}):n(),h?h.promise(r):r}}(jQuery),i.yith_magnifier=function(t,e){this.t=e,this.element=i(e),this._init(t)},i.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:i(".yith_magnifier_zoom"),zoomImage:i(".yith_magnifier_zoom img"),gallery:i(".yith_magnifier_gallery li a")}},i.yith_magnifier.prototype={_init:function(t){var e=this;i(document).trigger("yith_magnifier_before_init"),i.each(i.yith_magnifier.defaults.elements,function(t,o){var n=i.yith_magnifier.defaults.elements;n[t]=i(o,e)}),e.options=i.extend(!0,{},i.yith_magnifier.defaults,t),e.isPhone=e._isPhone(),e._loading(),e.element.imagesLoaded(function(){e.options.onLoad(),e._initZoom(),e._initGallery()}),i(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var t=this,e=t.options.elements,o=e.gallery,n=e.zoom,s=e.zoomImage;o.length>0?(o.on("click",function(e){e.preventDefault();var o=i(this);t.destroy(),n.attr("href",this.href),s.attr("src",o.data("small")).attr("srcset",o.data("small")).attr("src-orig",o.data("small")).attr("title","").attr("title",o.attr("title")),i.data(t.t,"yith_magnifier",new i.yith_magnifier(t.options,t.element))}),t.options.enableSlider&&(o.closest("ul").trigger("yith_magnifier_slider_destroy"),o.closest("ul")[t.options.slider](t.options.sliderOptions))):o.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&i(document).on("contextmenu",function(){return!1}),this.mouseTrap===e){var t=this.options.elements.zoom.width();this.options.loadingLabel&&i('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var t=this;t.zoom=t.options.elements.zoom,t.zoomImage=t.options.elements.zoomImage,t.zoom.wrap('<div class="yith_magnifier_zoom_wrap"></div>'),t.IMG_zoomImage=new Image,t.IMG_zoomImage.src=t.zoom.attr("href"),t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initTrap()})},_initTrap:function(){{var t=this,e=t.IMG_zoomImage;t.IMG_smallImage}t.mx=0,t.my=0,t.controlTimer=0,t.lens=null,t.tint=null,t.softFocus=null,t.zoomDiv=null,t.cw=0,t.ch=0,t.zw=0,t.destU=0,t.destV=0,t.currU=0,t.currV=0,t.mouseTrap=null;var o=t.options.elements.zoom,n=t.options.elements.zoomImage;i(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=i('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(o.parent());var s="ontouchstart"in document.documentElement?!0:!1,a="touchmove mousemove",r="touchend mouseleave",h="touchstart mouseenter",m="touchstart click";this.mouseTrap.on(a,this,function(i){t.options.onMove(),t.mx="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageX:i.pageX,t.my="undefined"!=typeof i.originalEvent.touches?i.originalEvent.touches[0].pageY:i.pageY}).on(r,this,function(){return clearTimeout(t.controlTimer),t.lens&&t.lens.fadeOut(299),t.tint&&t.tint.fadeOut(299),t.softFocus&&t.softFocus.fadeOut(299),t.zoomDiv.fadeOut(300,function(){t._onLeave()}),!1}).on(m,this,function(){t.options.onClick()}).on(h,this,function(a){t.options.onEnter(),s&&a.preventDefault(),t.mx="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageX:a.pageX,t.my="undefined"!=typeof a.originalEvent.touches?a.originalEvent.touches[0].pageY:a.pageY,t.zw=a.data,t.zoomDiv&&(t.zoomDiv.stop(!0,!1),t.zoomDiv.remove());var r=t.options.adjustX,h=t.options.adjustY,m=n.outerWidth(),l=n.outerHeight(),u=t.options.zoomWidth,c=t.options.zoomHeight;"auto"==t.options.zoomWidth&&(u=m),"auto"==t.options.zoomHeight&&(c=l);var d=o.parent();switch(t.options.position){case"top":h-=c;break;case"right":r+=m;break;case"bottom":h+=l;break;case"left":r-=u;break;case"inside":u=m,c=l;break;default:d=i("#"+t.options.position),d.length?(u=d.innerWidth(),c=d.innerHeight()):(d=o,r+=m,h+=l)}t.isPhone&&"inside"==t.options.phoneBehavior&&(u=m,c=l,r=0,h=0),t.zoomDiv=i('<div class="yith_magnifier_zoom_magnifier" />').css({left:r,top:h,width:u,height:c,"background-repeat":"no-repeat",backgroundImage:"url("+e.src+")"}).appendTo(d),n.attr("title")&&t.options.showTitle&&i('<div class="yith_magnifier_title">'+n.attr("title")+"</div>").appendTo(t.zoomDiv),t.isPhone?"disable"!=t.options.phoneBehavior?t.zoomDiv.fadeIn(500):t.lens.fadeOut(299):t.zoomDiv.fadeIn(500),t.lens&&(t.lens.remove(),t.lens=null),t.cw=e.width<=1?n.outerWidth()/e.naturalWidth*t.zoomDiv.width():n.outerWidth()/e.width*t.zoomDiv.width(),t.ch=e.height<=1?n.outerHeight()/e.naturalHeight*t.zoomDiv.height():n.outerHeight()/e.height*t.zoomDiv.height(),t.lens=i('<div class="yith_magnifier_lens" />').css({width:t.cw,height:t.ch}).appendTo(o),t.mouseTrap.css("cursor",t.lens.css("cursor"));var g=!1;t.options.tint&&(t.tint=i("<div />").css({display:"none",position:"absolute",left:0,top:0,width:n.outerWidth(),height:n.outerHeight(),backgroundColor:t.options.tint,opacity:t.options.tintOpacity}).appendTo(o),t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.tint.fadeIn(500)),t.options.softFocus&&(t.softFocus=i("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:n.outerWidth(),height:n.outerHeight(),opacity:.5}).appendTo(o),t.softFocus.append(i("<img />",{src:n.attr("src")})),0==t.lens.find("img").length&&t.lens.append(i("<img />",{src:n.attr("src")})),g=!0,t.softFocus.fadeIn(500)),g||t.lens.css("opacity",t.options.lensOpacity),"inside"!==t.options.position&&t.lens.fadeIn(500),t.zw._controlLoop()})},_controlLoop:function(){var t=this;if(this.lens){var i=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,e=this.my-this.zoomImage.offset().top-.5*this.ch>>0;0>i?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),0>e?e=0:e>this.zoomImage.outerHeight()-this.ch&&(e=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:i-2,top:e-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-i+"px ",marginTop:-e+"px"}),this.destU=this.IMG_zoomImage.width<=1?i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.destV=this.IMG_zoomImage.height<=1?e/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:e/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+(-(this.currV>>0)+"px"))}this.controlTimer=setTimeout(function(){t._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),this.element.find(".yith_magnifier_loading").length>0&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&i(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},i.fn.yith_magnifier=function(t){if("string"==typeof t){var e=Array.prototype.slice.call(arguments,1);this.each(function(){var o=i.data(this,"yith_magnifier");return o?i.isFunction(o[t])&&"_"!==t.charAt(0)?void o[t].apply(o,e):void i.error("no such method '"+t+"' for yith_magnifier instance"):void i.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+t+"'")})}else this.each(function(){var e=i.data(this,"yith_magnifier");e?i.error("yith_magnifier already istantiated."):i.data(this,"yith_magnifier",new i.yith_magnifier(t,this))});return this}}(window,jQuery);
modules/yith-woocommerce-zoom-magnifier/class.yith-wcmg-admin.php CHANGED
@@ -8,172 +8,170 @@
8
  */
9
 
10
  if ( ! defined( 'YITH_WCMG' ) ) {
11
- exit;
12
  } // Exit if accessed directly
13
 
14
  if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the admin behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCMG_Admin {
22
- /**
23
- * Plugin options
24
- *
25
- * @var array
26
- * @access public
27
- * @since 1.0.0
28
- */
29
- public $options = array();
30
-
31
- /**
32
- * Plugin version
33
- *
34
- * @var string
35
- * @since 1.0.0
36
- */
37
- public $version;
38
-
39
- /**
40
- * Various links
41
- *
42
- * @var string
43
- * @access public
44
- * @since 1.0.0
45
- */
46
- public $banner_url = 'http://cdn.yithemes.com/plugins/yith_magnifier.php?url';
47
- public $banner_img = 'http://cdn.yithemes.com/plugins/yith_magnifier.php';
48
- public $doc_url = 'http://yithemes.com/docs-plugins/yith_magnifier/';
49
-
50
- /**
51
- * Constructor
52
- *
53
- * @access public
54
- * @since 1.0.0
55
- */
56
- public function __construct( $version ) {
57
- $this->version = $version;
58
-
59
- //Actions
60
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
61
-
62
- add_action( 'woocommerce_update_options_yith_wcmg', array( $this, 'update_options' ) );
63
-
64
- add_action( 'woocommerce_admin_field_banner', array( $this, 'admin_fields_banner' ) );
65
- add_action( 'admin_print_footer_scripts', array( $this, 'admin_fields_image_deps' ) );
66
-
67
- add_filter( 'woocommerce_catalog_settings', array( $this, 'add_catalog_image_size' ) );
68
-
69
- //Apply filters
70
- $this->banner_url = apply_filters( 'yith_wcmg_banner_url', $this->banner_url );
71
-
72
- // YITH WCMG Loaded
73
- do_action( 'yith_wcmg_loaded' );
74
- }
75
-
76
-
77
- /**
78
- * Add Zoom Image size to Woocommerce -> Catalog
79
- *
80
- * @access public
81
- *
82
- * @param array $settings
83
- *
84
- * @return array
85
- */
86
- public function add_catalog_image_size( $settings ) {
87
- $tmp = $settings[ count( $settings ) - 1 ];
88
- unset( $settings[ count( $settings ) - 1 ] );
89
-
90
- $settings[] = array(
91
- 'name' => __( 'Image Size', 'yit' ),
92
- 'desc' => __( 'The size of the images used within the magnifier box', 'yit' ),
93
- 'id' => 'woocommerce_magnifier_image',
94
- 'css' => '',
95
- 'type' => 'image_width',
96
- 'default' => array(
97
- 'width' => 600,
98
- 'height' => 600,
99
- 'crop' => true
100
- ),
101
- 'std' => array(
102
- 'width' => 600,
103
- 'height' => 600,
104
- 'crop' => true
105
- ),
106
- 'desc_tip' => true
107
- );
108
- $settings[] = $tmp;
109
-
110
- return $settings;
111
- }
112
-
113
- /**
114
- * Create new Woocommerce admin field: image deps
115
- *
116
- * @access public
117
- *
118
- * @param array $value
119
- *
120
- * @return void
121
- * @since 1.0.0
122
- */
123
- public function admin_fields_image_deps( $value ) {
124
- global $woocommerce;
125
-
126
- $force = get_option( 'yith_wcmg_force_sizes' ) == 'yes';
127
-
128
- if ( $force ) {
129
- $value['desc'] = 'These values ??are automatically calculated based on the values ??of the Single product. If you\'d like to customize yourself the values, please disable the "Forcing Zoom Image sizes" in "Magnifier" tab.';
130
- }
131
-
132
- if ( $force && isset( $_GET['page'] ) && isset( $_GET['tab'] ) && ( $_GET['page'] == 'woocommerce_settings' || $_GET['page'] == 'wc-settings' ) && $_GET['tab'] == 'catalog' ): ?>
133
- <script>
134
- jQuery(document).ready(function ($) {
135
- $('#woocommerce_magnifier_image-width, #woocommerce_magnifier_image-height, #woocommerce_magnifier_image-crop').attr('disabled', 'disabled');
136
-
137
- $('#shop_single_image_size-width, #shop_single_image_size-height').on('keyup', function () {
138
- var value = parseInt($(this).val());
139
- var input = (this.id).indexOf('width') >= 0 ? 'width' : 'height';
140
-
141
- if (!isNaN(value)) {
142
- $('#woocommerce_magnifier_image-' + input).val(value * 2);
143
- }
144
- });
145
-
146
- $('#shop_single_image_size-crop').on('change', function () {
147
- if ($(this).is(':checked')) {
148
- $('#woocommerce_magnifier_image-crop').attr('checked', 'checked');
149
- } else {
150
- $('#woocommerce_magnifier_image-crop').removeAttr('checked');
151
- }
152
- });
153
-
154
- $('#mainform').on('submit', function () {
155
- $(':disabled').removeAttr('disabled');
156
- });
157
- });
158
- </script>
159
- <?php endif;
160
- }
161
-
162
-
163
- /**
164
- * Enqueue admin styles and scripts
165
- *
166
- * @access public
167
- * @return void
168
- * @since 1.0.0
169
- */
170
- public function enqueue_styles_scripts() {
171
- wp_enqueue_script( 'jquery-ui' );
172
- wp_enqueue_script( 'jquery-ui-core' );
173
- wp_enqueue_script( 'jquery-ui-mouse' );
174
- wp_enqueue_script( 'jquery-ui-slider' );
175
-
176
- wp_enqueue_style( 'yith_wcmg_admin', YITH_WCMG_URL . 'assets/css/admin.css' );
177
- }
178
- }
179
  }
8
  */
9
 
10
  if ( ! defined( 'YITH_WCMG' ) ) {
11
+ exit;
12
  } // Exit if accessed directly
13
 
14
  if ( ! class_exists( 'YITH_WCMG_Admin' ) ) {
15
+ /**
16
+ * Admin class.
17
+ * The class manage all the admin behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCMG_Admin {
22
+ /**
23
+ * Plugin options
24
+ *
25
+ * @var array
26
+ * @access public
27
+ * @since 1.0.0
28
+ */
29
+ public $options = array();
30
+
31
+ /**
32
+ * Plugin version
33
+ *
34
+ * @var string
35
+ * @since 1.0.0
36
+ */
37
+ public $version;
38
+
39
+ /**
40
+ * Various links
41
+ *
42
+ * @var string
43
+ * @access public
44
+ * @since 1.0.0
45
+ */
46
+ public $banner_url = 'http://cdn.yithemes.com/plugins/yith_magnifier.php?url';
47
+ public $banner_img = 'http://cdn.yithemes.com/plugins/yith_magnifier.php';
48
+ public $doc_url = 'http://yithemes.com/docs-plugins/yith_magnifier/';
49
+
50
+ /**
51
+ * Constructor
52
+ *
53
+ * @access public
54
+ * @since 1.0.0
55
+ */
56
+ public function __construct( $version ) {
57
+ $this->version = $version;
58
+
59
+ //Actions
60
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
61
+
62
+ add_action( 'woocommerce_update_options_yith_wcmg', array( $this, 'update_options' ) );
63
+
64
+ add_action( 'woocommerce_admin_field_banner', array( $this, 'admin_fields_banner' ) );
65
+ add_action( 'admin_print_footer_scripts', array( $this, 'admin_fields_image_deps' ) );
66
+
67
+ add_filter( 'woocommerce_catalog_settings', array( $this, 'add_catalog_image_size' ) );
68
+
69
+ //Apply filters
70
+ $this->banner_url = apply_filters( 'yith_wcmg_banner_url', $this->banner_url );
71
+
72
+ // YITH WCMG Loaded
73
+ do_action( 'yith_wcmg_loaded' );
74
+ }
75
+
76
+ /**
77
+ * Add Zoom Image size to Woocommerce -> Catalog
78
+ *
79
+ * @access public
80
+ *
81
+ * @param array $settings
82
+ *
83
+ * @return array
84
+ */
85
+ public function add_catalog_image_size( $settings ) {
86
+ $tmp = $settings[count( $settings ) - 1];
87
+ unset( $settings[count( $settings ) - 1] );
88
+
89
+ $settings[] = array(
90
+ 'name' => __( 'Image Size', 'ywzm' ),
91
+ 'desc' => __( 'The size of the images used within the magnifier box', 'ywzm' ),
92
+ 'id' => 'woocommerce_magnifier_image',
93
+ 'css' => '',
94
+ 'type' => 'image_width',
95
+ 'default' => array(
96
+ 'width' => 600,
97
+ 'height' => 600,
98
+ 'crop' => true
99
+ ),
100
+ 'std' => array(
101
+ 'width' => 600,
102
+ 'height' => 600,
103
+ 'crop' => true
104
+ ),
105
+ 'desc_tip' => true
106
+ );
107
+ $settings[] = $tmp;
108
+ return $settings;
109
+ }
110
+
111
+ /**
112
+ * Create new Woocommerce admin field: image deps
113
+ *
114
+ * @access public
115
+ *
116
+ * @param array $value
117
+ *
118
+ * @return void
119
+ * @since 1.0.0
120
+ */
121
+ public function admin_fields_image_deps( $value ) {
122
+ global $woocommerce;
123
+
124
+ $force = get_option( 'yith_wcmg_force_sizes' ) == 'yes';
125
+
126
+ if ( $force ) {
127
+ $value['desc'] = 'These values ??are automatically calculated based on the values ??of the Single product. If you\'d like to customize yourself the values, please disable the "Forcing Zoom Image sizes" in "Magnifier" tab.';
128
+ }
129
+
130
+ if ( $force && isset( $_GET['page'] ) && isset( $_GET['tab'] ) && ( $_GET['page'] == 'woocommerce_settings' || $_GET['page'] == 'wc-settings' ) && $_GET['tab'] == 'catalog' ): ?>
131
+ <script>
132
+ jQuery(document).ready(function ($) {
133
+ $('#woocommerce_magnifier_image-width, #woocommerce_magnifier_image-height, #woocommerce_magnifier_image-crop').attr('disabled', 'disabled');
134
+
135
+ $('#shop_single_image_size-width, #shop_single_image_size-height').on('keyup', function () {
136
+ var value = parseInt($(this).val());
137
+ var input = (this.id).indexOf('width') >= 0 ? 'width' : 'height';
138
+
139
+ if (!isNaN(value)) {
140
+ $('#woocommerce_magnifier_image-' + input).val(value * 2);
141
+ }
142
+ });
143
+
144
+ $('#shop_single_image_size-crop').on('change', function () {
145
+ if ($(this).is(':checked')) {
146
+ $('#woocommerce_magnifier_image-crop').attr('checked', 'checked');
147
+ } else {
148
+ $('#woocommerce_magnifier_image-crop').removeAttr('checked');
149
+ }
150
+ });
151
+
152
+ $('#mainform').on('submit', function () {
153
+ $(':disabled').removeAttr('disabled');
154
+ });
155
+ });
156
+ </script>
157
+ <?php endif;
158
+ }
159
+
160
+
161
+ /**
162
+ * Enqueue admin styles and scripts
163
+ *
164
+ * @access public
165
+ * @return void
166
+ * @since 1.0.0
167
+ */
168
+ public function enqueue_styles_scripts() {
169
+ wp_enqueue_script( 'jquery-ui' );
170
+ wp_enqueue_script( 'jquery-ui-core' );
171
+ wp_enqueue_script( 'jquery-ui-mouse' );
172
+ wp_enqueue_script( 'jquery-ui-slider' );
173
+
174
+ wp_enqueue_style( 'yith_wcmg_admin', YITH_WCMG_URL . 'assets/css/admin.css' );
175
+ }
176
+ }
 
 
177
  }
modules/yith-woocommerce-zoom-magnifier/class.yith-wcmg-frontend.php CHANGED
@@ -7,152 +7,151 @@
7
  * @version 1.1.2
8
  */
9
 
10
- if ( ! defined( 'YITH_WCMG' ) ) {
11
- exit;
12
  } // Exit if accessed directly
13
 
14
- if ( ! class_exists( 'YITH_WCMG_Frontend' ) ) {
15
- /**
16
- * Admin class.
17
- * The class manage all the Frontend behaviors.
18
- *
19
- * @since 1.0.0
20
- */
21
- class YITH_WCMG_Frontend {
22
- /**
23
- * Plugin version
24
- *
25
- * @var string
26
- * @since 1.0.0
27
- */
28
- public $version;
29
-
30
- /**
31
- * Constructor
32
- *
33
- * @access public
34
- * @since 1.0.0
35
- */
36
- public function __construct( $version ) {
37
- $this->version = $version;
38
-
39
- // add the action only when the loop is initializate
40
- add_action( 'template_redirect', array( $this, 'render' ) );
41
- }
42
-
43
- public function render() {
44
- if ( yith_wcmg_is_enabled() && ! $this->is_video_featured_enabled() ) {
45
- //change the templates
46
- remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
47
- remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
48
- add_action( 'woocommerce_before_single_product_summary', array( $this, 'show_product_images' ), 20 );
49
- add_action( 'woocommerce_product_thumbnails', array( $this, 'show_product_thumbnails' ), 20 );
50
-
51
- //custom styles and javascripts
52
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
53
-
54
- //add attributes to product variations
55
- add_filter( 'woocommerce_available_variation', array( $this, 'available_variation' ), 10, 3 );
56
- }
57
- }
58
-
59
-
60
- /**
61
- * Change product-single.php template
62
- *
63
- * @access public
64
- * @return void
65
- * @since 1.0.0
66
- */
67
- public function show_product_images() {
68
-
69
- /** FIX WOO 2.1 */
70
- $wc_get_template = function_exists( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
71
-
72
- $wc_get_template( 'single-product/product-image-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
73
- }
74
-
75
-
76
- /**
77
- * Change product-thumbnails.php template
78
- *
79
- * @access public
80
- * @return void
81
- * @since 1.0.0
82
- */
83
- public function show_product_thumbnails() {
84
-
85
- /** FIX WOO 2.1 */
86
- $wc_get_template = function_exists( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
87
-
88
- $wc_get_template( 'single-product/product-thumbnails-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
89
- }
90
-
91
-
92
- /**
93
- * Enqueue styles and scripts
94
- *
95
- * @access public
96
- * @return void
97
- * @since 1.0.0
98
- */
99
- public function enqueue_styles_scripts() {
100
- global $post;
101
-
102
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
103
-
104
- wp_register_script( 'yith-magnifier-slider', YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix . '.js', array(
105
- 'jquery',
106
- 'jquery-migrate'
107
- ), '6.2.1', true );
108
-
109
- if ( is_product() || ( ! empty( $post->post_content ) && strstr( $post->post_content, '[product_page' ) ) ) {
110
- wp_enqueue_script( 'yith-magnifier-slider' );
111
- wp_enqueue_script( 'yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix . '.js', array( 'jquery' ), $this->version, true );
112
- wp_enqueue_script( 'yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix . '.js', array(
113
- 'jquery',
114
- 'yith-magnifier'
115
- ), $this->version, true );
116
- wp_enqueue_style( 'yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
117
-
118
- $css = file_exists( get_stylesheet_directory() . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri() . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
119
- wp_enqueue_style( 'yith_wcmg_frontend', $css );
120
- }
121
- }
122
-
123
-
124
- /**
125
- * Add attributes to product variations
126
- *
127
- * @access public
128
- * @return void
129
- * @since 1.0.0
130
- */
131
- public function available_variation( $data, $wc_prod, $variation ) {
132
-
133
- $attachment_id = get_post_thumbnail_id( $variation->get_variation_id() );
134
- $attachment = wp_get_attachment_image_src( $attachment_id, 'shop_magnifier' );
135
-
136
- $data['image_magnifier'] = $attachment ? current( $attachment ) : '';
137
-
138
- return $data;
139
- }
140
-
141
- /**
142
- * Detect if the featured video is enabled
143
- */
144
- public function is_video_featured_enabled() {
145
- global $post;
146
- if ( ! isset( $post->ID ) ) {
147
- return;
148
- }
149
-
150
- $featured_video = get_post_meta( $post->ID, '_video_url', true );
151
- if ( ! empty( $featured_video ) ) {
152
- return true;
153
- } else {
154
- return false;
155
- }
156
- }
157
- }
158
  }
7
  * @version 1.1.2
8
  */
9
 
10
+ if (!defined('YITH_WCMG')) {
11
+ exit;
12
  } // Exit if accessed directly
13
 
14
+ if (!class_exists('YITH_WCMG_Frontend')) {
15
+ /**
16
+ * Admin class.
17
+ * The class manage all the Frontend behaviors.
18
+ *
19
+ * @since 1.0.0
20
+ */
21
+ class YITH_WCMG_Frontend {
22
+ /**
23
+ * Plugin version
24
+ *
25
+ * @var string
26
+ * @since 1.0.0
27
+ */
28
+ public $version;
29
+
30
+ /**
31
+ * Constructor
32
+ *
33
+ * @access public
34
+ * @since 1.0.0
35
+ */
36
+ public function __construct($version) {
37
+ $this->version = $version;
38
+
39
+ // add the action only when the loop is initializate
40
+ add_action('template_redirect', array($this, 'render'));
41
+ }
42
+
43
+ public function render() {
44
+ if (yith_wcmg_is_enabled() && !$this->is_video_featured_enabled()) {
45
+ //change the templates
46
+ remove_action('woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20);
47
+ remove_action('woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20);
48
+ add_action('woocommerce_before_single_product_summary', array($this, 'show_product_images'), 20);
49
+ add_action('woocommerce_product_thumbnails', array($this, 'show_product_thumbnails'), 20);
50
+
51
+ //custom styles and javascripts
52
+ add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_scripts'));
53
+
54
+ //add attributes to product variations
55
+ add_filter('woocommerce_available_variation', array($this, 'available_variation'), 10, 3);
56
+ }
57
+ }
58
+
59
+
60
+ /**
61
+ * Change product-single.php template
62
+ *
63
+ * @access public
64
+ * @return void
65
+ * @since 1.0.0
66
+ */
67
+ public function show_product_images() {
68
+
69
+ /** FIX WOO 2.1 */
70
+ $wc_get_template = function_exists('wc_get_template') ? 'wc_get_template' : 'woocommerce_get_template';
71
+ $wc_get_template('single-product/product-image-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/');
72
+ }
73
+
74
+
75
+ /**
76
+ * Change product-thumbnails.php template
77
+ *
78
+ * @access public
79
+ * @return void
80
+ * @since 1.0.0
81
+ */
82
+ public function show_product_thumbnails() {
83
+
84
+ /** FIX WOO 2.1 */
85
+ $wc_get_template = function_exists('wc_get_template') ? 'wc_get_template' : 'woocommerce_get_template';
86
+
87
+ $wc_get_template('single-product/product-thumbnails-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/');
88
+ }
89
+
90
+
91
+ /**
92
+ * Enqueue styles and scripts
93
+ *
94
+ * @access public
95
+ * @return void
96
+ * @since 1.0.0
97
+ */
98
+ public function enqueue_styles_scripts() {
99
+ global $post;
100
+
101
+ $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
102
+
103
+ wp_register_script('yith-magnifier-slider', YITH_WCMG_URL . 'assets/js/jquery.carouFredSel' . $suffix . '.js', array(
104
+ 'jquery',
105
+ 'jquery-migrate'
106
+ ), '6.2.1', true);
107
+
108
+ if (is_product() || (!empty($post->post_content) && strstr($post->post_content, '[product_page'))) {
109
+ wp_enqueue_script('yith-magnifier-slider');
110
+ wp_enqueue_script('yith-magnifier', YITH_WCMG_URL . 'assets/js/yith_magnifier' . $suffix . '.js', array('jquery'), $this->version, true);
111
+ wp_enqueue_script('yith_wcmg_frontend', YITH_WCMG_URL . 'assets/js/frontend' . $suffix . '.js', array(
112
+ 'jquery',
113
+ 'yith-magnifier'
114
+ ), $this->version, true);
115
+ wp_enqueue_style('yith-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css');
116
+
117
+ $css = file_exists(get_stylesheet_directory() . '/woocommerce/yith_magnifier.css') ? get_stylesheet_directory_uri() . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
118
+ wp_enqueue_style('yith_wcmg_frontend', $css);
119
+ }
120
+ }
121
+
122
+
123
+ /**
124
+ * Add attributes to product variations
125
+ *
126
+ * @access public
127
+ * @return void
128
+ * @since 1.0.0
129
+ */
130
+ public function available_variation($data, $wc_prod, $variation) {
131
+
132
+ $attachment_id = get_post_thumbnail_id($variation->get_variation_id());
133
+ $attachment = wp_get_attachment_image_src($attachment_id, 'shop_magnifier');
134
+
135
+ $data['image_magnifier'] = $attachment ? current($attachment) : '';
136
+
137
+ return $data;
138
+ }
139
+
140
+ /**
141
+ * Detect if the featured video is enabled
142
+ */
143
+ public function is_video_featured_enabled() {
144
+ global $post;
145
+ if (!isset($post->ID)) {
146
+ return;
147
+ }
148
+
149
+ $featured_video = get_post_meta($post->ID, '_video_url', true);
150
+ if (!empty($featured_video)) {
151
+ return true;
152
+ } else {
153
+ return false;
154
+ }
155
+ }
156
+ }
 
157
  }
modules/yith-woocommerce-zoom-magnifier/class.yith-wcmg.php CHANGED
@@ -22,7 +22,7 @@ if( !class_exists( 'YITH_WCMG' ) ) {
22
  * @var string
23
  * @since 1.0.0
24
  */
25
- public $version = '1.1.5';
26
 
27
  /**
28
  * Plugin object
22
  * @var string
23
  * @since 1.0.0
24
  */
25
+ public $version = '1.2.9';
26
 
27
  /**
28
  * Plugin object
modules/yith-woocommerce-zoom-magnifier/functions.yith-wcmg.php CHANGED
@@ -7,58 +7,69 @@
7
  * @version 1.1.2
8
  */
9
 
10
- if ( !defined( 'YITH_WCMG' ) ) { exit; } // Exit if accessed directly
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- if( !function_exists( 'yith_wcmg_is_enabled' ) ) {
13
- /**
14
- * Locate the templates and return the path of the file found
15
- *
16
- * @param string $path
17
- * @param array $var
18
- * @return void
19
- * @since 1.0.0
20
- */
21
- function yith_wcmg_is_enabled() {
22
- return get_option('yith_wcmg_enable_plugin') == 'yes';
23
  }
24
  }
25
 
26
- if( !function_exists( 'yit_shop_single_w' ) ) {
27
- /**
28
- * Return the shop_single image width
29
- *
30
- * @return integer
31
- * @since 1.0.0
32
- */
33
- function yit_shop_single_w() {
34
- global $woocommerce;
35
- $size = yit_get_image_size('shop_single');
36
- return $size['width'];
37
- }
 
38
  }
39
 
40
- if( !function_exists( 'yit_shop_thumbnail_w' ) ) {
41
- /**
42
- * Return the shop_thumbnail image width
43
- *
44
- * @return integer
45
- * @since 1.0.0
46
- */
47
- function yit_shop_thumbnail_w() {
48
- global $woocommerce;
49
- $size = yit_get_image_size('shop_thumbnail');
50
- return $size['width'];
51
- }
 
52
  }
53
 
54
  /* FIX TO WOOCOMMERCE 2.1 */
55
- if( !function_exists( 'yit_get_image_size' ) ){
56
- function yit_get_image_size( $size ){
57
- if( function_exists('wc_get_image_size')){
58
- return wc_get_image_size( $size );
59
- }else{
60
- global $woocommerce;
61
- return $woocommerce->get_image_size( $size );
62
- }
63
- }
 
64
  }
7
  * @version 1.1.2
8
  */
9
 
10
+ if ( ! defined( 'YITH_WCMG' ) ) {
11
+ exit;
12
+ } // Exit if accessed directly
13
+
14
+ if ( ! function_exists( 'yith_wcmg_is_enabled' ) ) {
15
+ /**
16
+ * Check if the plugin is enabled for the current context
17
+ *
18
+ * @param string $path
19
+ * @param array $var
20
+ *
21
+ * @return void
22
+ * @since 1.0.0
23
+ */
24
+ function yith_wcmg_is_enabled() {
25
+ if ( wp_is_mobile() ) {
26
+ return ( 'yes' == get_option( 'yith_wcmg_enable_mobile' ) );
27
+ }
28
+
29
+ return get_option( 'yith_wcmg_enable_plugin' ) == 'yes';
30
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
32
  }
33
 
34
+ if ( ! function_exists( 'yit_shop_single_w' ) ) {
35
+ /**
36
+ * Return the shop_single image width
37
+ *
38
+ * @return integer
39
+ * @since 1.0.0
40
+ */
41
+ function yit_shop_single_w() {
42
+ global $woocommerce;
43
+ $size = yit_get_image_size( 'shop_single' );
44
+
45
+ return $size['width'];
46
+ }
47
  }
48
 
49
+ if ( ! function_exists( 'yit_shop_thumbnail_w' ) ) {
50
+ /**
51
+ * Return the shop_thumbnail image width
52
+ *
53
+ * @return integer
54
+ * @since 1.0.0
55
+ */
56
+ function yit_shop_thumbnail_w() {
57
+ global $woocommerce;
58
+ $size = yit_get_image_size( 'shop_thumbnail' );
59
+
60
+ return $size['width'];
61
+ }
62
  }
63
 
64
  /* FIX TO WOOCOMMERCE 2.1 */
65
+ if ( ! function_exists( 'yit_get_image_size' ) ) {
66
+ function yit_get_image_size( $size ) {
67
+ if ( function_exists( 'wc_get_image_size' ) ) {
68
+ return wc_get_image_size( $size );
69
+ } else {
70
+ global $woocommerce;
71
+
72
+ return $woocommerce->get_image_size( $size );
73
+ }
74
+ }
75
  }
modules/yith-woocommerce-zoom-magnifier/init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
- * Version: 1.2.6
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywzm
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
- * @version 1.2.6
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -65,7 +65,7 @@ if ( ! defined( 'YITH_YWZM_FREE_INIT' ) ) {
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
- define( 'YITH_YWZM_VERSION', '1.2.6' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
3
  * Plugin Name: YITH WooCommerce Zoom Magnifier
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
5
  * Description: YITH WooCommerce Zoom Magnifier enables you to add a zoom effect to product images and a thumbnail slider for the product image gallery.
6
+ * Version: 1.2.9
7
  * Author: Yithemes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: ywzm
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Magnifier
14
+ * @version 1.2.9
15
  */
16
  /* Copyright 2013-2015 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
65
  }
66
 
67
  if ( ! defined( 'YITH_YWZM_VERSION' ) ) {
68
+ define( 'YITH_YWZM_VERSION', '1.2.9' );
69
  }
70
 
71
  if ( ! defined( 'YITH_YWZM_FILE' ) ) {
modules/yith-woocommerce-zoom-magnifier/languages/ywzm-it_IT.mo CHANGED
Binary file
modules/yith-woocommerce-zoom-magnifier/languages/ywzm-it_IT.po CHANGED
@@ -1,15 +1,15 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Zoom Magnifier\n"
4
- "POT-Creation-Date: 2015-07-23 15:49+0200\n"
5
- "PO-Revision-Date: 2015-07-23 15:49+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language: it_IT\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.3\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=n!=1;\n"
15
  "X-Poedit-KeywordsList: __ ;_e;_n:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
@@ -18,11 +18,11 @@ msgstr ""
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
20
 
21
- #: class.yith-wcmg-admin.php:91
22
  msgid "Image Size"
23
  msgstr "Dimensioni Immagine"
24
 
25
- #: class.yith-wcmg-admin.php:92 plugin-options/general-options.php:17
26
  msgid "The size of the images used within the magnifier box"
27
  msgstr "La dimensione delle immagini utilizzata nel riquadro di zoom"
28
 
@@ -42,7 +42,7 @@ msgstr ""
42
  "Non è possibile attivare la versione gratuita di YITH WooCommerce Zoom "
43
  "Magnifier mentre si utilizza quella premium."
44
 
45
- #: lib/class.yith-ywzm-custom-types.php:179
46
  msgid "Do you want to hard crop the image?"
47
  msgstr "Vuoi ritagliare l'immagine?"
48
 
@@ -80,7 +80,7 @@ msgid "Premium version"
80
  msgstr "Versione premium"
81
 
82
  #: lib/class.yith-ywzm-plugin-fw-loader.php:237
83
- #: plugin-options/general-options.php:214
84
  msgid "YITH WooCommerce Zoom Magnifier"
85
  msgstr "YITH WooCommerce Zoom Magnifier"
86
 
@@ -103,22 +103,28 @@ msgid "General Settings"
103
  msgstr "Impostazioni generali"
104
 
105
  #: plugin-options/general-options.php:42
106
- msgid "Activate YITH Magnifier"
107
- msgstr "Attiva YITH Magnifier"
108
 
109
  #: plugin-options/general-options.php:43
110
  msgid "Activate the plugin or use the WooCommerce default product image."
111
  msgstr "Attiva il plugin o usa le immagini prodotto di default di WooCommerce."
112
 
113
  #: plugin-options/general-options.php:50
114
- msgid "Activate the plugin on mobile device"
115
- msgstr "Attiva il plugin su dispositivi mobili"
 
 
 
 
 
 
116
 
117
- #: plugin-options/general-options.php:57
118
  msgid "Forced Image Size"
119
  msgstr "Dimensioni Immagini Forzate"
120
 
121
- #: plugin-options/general-options.php:58
122
  msgid ""
123
  "If disabled, you will able to customize the sizes of the zoomed images. "
124
  "Disable it at your own risk; the magnifier could not properly work with "
@@ -128,100 +134,100 @@ msgstr ""
128
  "delle immagini zoomate. Disabilitare a proprio rischio: lo zoom potrebbe non "
129
  "funzionare correttamente con immagini sproporzionate."
130
 
131
- #: plugin-options/general-options.php:72
132
  msgid "Magnifier Settings"
133
  msgstr "Impostazioni Zoom"
134
 
135
- #: plugin-options/general-options.php:78
136
  msgid "Zoom Box Width"
137
  msgstr "Larghezza Riquadro Zoom"
138
 
139
- #: plugin-options/general-options.php:79
140
  msgid "The width of the magnifier box (default: auto)"
141
  msgstr "La larghezza del riquadro di zoom (default: auto)"
142
 
143
- #: plugin-options/general-options.php:86
144
  msgid "Zoom Box Height"
145
  msgstr "Altezza Riquadro Zoom"
146
 
147
- #: plugin-options/general-options.php:87
148
  msgid "The height of the magnifier box (default: auto)"
149
  msgstr "L'altezza del riquadro di zoom (default: auto)"
150
 
151
- #: plugin-options/general-options.php:95
152
  msgid "Zoom Box Position"
153
  msgstr "Posizione Riquadro Zoom"
154
 
155
- #: plugin-options/general-options.php:96
156
  msgid "The magnifier position"
157
  msgstr "Dove apparirà la finestra di zoom"
158
 
159
- #: plugin-options/general-options.php:102
160
  msgid "Right"
161
  msgstr "Destra"
162
 
163
- #: plugin-options/general-options.php:103
164
- #: plugin-options/general-options.php:115
165
  msgid "Inside"
166
  msgstr "Interno"
167
 
168
- #: plugin-options/general-options.php:107
169
  msgid "Zoom Box Position for mobile devices"
170
  msgstr "Posizione Riquadro Zoom su dispositivi mobili"
171
 
172
- #: plugin-options/general-options.php:108
173
  msgid "The magnifier position for the mobile devices (iPhone, Android, etc.)"
174
  msgstr ""
175
  "Dove apparirà la finestra di zoom sui dispositivi mobili (iPhone, Android, "
176
  "etc.)"
177
 
178
- #: plugin-options/general-options.php:114
179
  msgid "Default"
180
  msgstr "Default"
181
 
182
- #: plugin-options/general-options.php:116
183
  msgid "Disable"
184
  msgstr "Disattiva"
185
 
186
- #: plugin-options/general-options.php:120
187
  msgid "Loading label"
188
  msgstr "Etichetta di caricamento"
189
 
190
- #: plugin-options/general-options.php:123
191
- #: plugin-options/general-options.php:124
192
  msgid "Loading..."
193
  msgstr "Caricamento..."
194
 
195
- #: plugin-options/general-options.php:128
196
  msgid "Lens Opacity"
197
  msgstr "Opacità Lenti"
198
 
199
- #: plugin-options/general-options.php:139
200
  msgid "Blur"
201
  msgstr "Sfocatura"
202
 
203
- #: plugin-options/general-options.php:140
204
  msgid "Add a blur effect to the small image on mouse hover."
205
  msgstr ""
206
  "Aggiungi un effetto di sfocatura all'immagine piccola al passaggio del mouse."
207
 
208
- #: plugin-options/general-options.php:151
209
  msgid "Slider Settings"
210
  msgstr "Impostazioni Slider"
211
 
212
- #: plugin-options/general-options.php:157
213
  msgid "Activate Slider"
214
  msgstr "Attiva Slider"
215
 
216
- #: plugin-options/general-options.php:158
217
  msgid "Activate Thumbnail Slider."
218
  msgstr "Attiva lo slider con anteprime."
219
 
220
- #: plugin-options/general-options.php:165
221
  msgid "Activate Responsive Slider"
222
  msgstr "Attiva Slider Responsive"
223
 
224
- #: plugin-options/general-options.php:166
225
  msgid ""
226
  "This option fits the thumbnails within the available space. Disable it if "
227
  "you want to manage freely the thumbnails (eg. add margins, paddings, etc.)"
@@ -230,27 +236,27 @@ msgstr ""
230
  "vuoi gestire liberamente le anteprime (per esempio aggiungere margini, "
231
  "padding, ecc.)"
232
 
233
- #: plugin-options/general-options.php:173
234
  msgid "Items"
235
  msgstr "Elementi"
236
 
237
- #: plugin-options/general-options.php:174
238
  msgid "Number of items to show"
239
  msgstr "Numero di elementi da mostrare"
240
 
241
- #: plugin-options/general-options.php:184
242
  msgid "Circular carousel"
243
  msgstr "Carosello circolare"
244
 
245
- #: plugin-options/general-options.php:185
246
  msgid "It defines whether the carousel should be circular."
247
  msgstr "Imposta se il carosello deve essere circolare."
248
 
249
- #: plugin-options/general-options.php:192
250
  msgid "Infinite carousel"
251
  msgstr "Carosello infinito"
252
 
253
- #: plugin-options/general-options.php:193
254
  msgid ""
255
  "It defines whether the carousel should be infinite. Note: It is possible to "
256
  "create a non-circular, infinite carousel, but it is not possible to create a "
@@ -260,15 +266,15 @@ msgstr ""
260
  "un carosello infinito non circolare, ma non puoi creare un carosello "
261
  "circolare non infinito."
262
 
263
- #: plugin-options/general-options.php:211
264
  msgid "Upgrade to the PREMIUM VERSION"
265
  msgstr "Aggiorna alla VERSIONE PREMIUM"
266
 
267
- #: plugin-options/general-options.php:215
268
  msgid "Discover The Advanced Features"
269
  msgstr "Scopri le caratteristiche avanzate"
270
 
271
- #: plugin-options/general-options.php:216
272
  msgid ""
273
  "Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit "
274
  "from all features!"
@@ -276,7 +282,7 @@ msgstr ""
276
  "Aggiorna alla VERSIONE PREMIUM di YITH WOOCOMMERCE ZOOM MAGNIFIER per "
277
  "usufruire di tutte le caratteristiche!"
278
 
279
- #: plugin-options/general-options.php:220
280
  msgid ""
281
  "See YITH WooCommerce Zoom Magnifier plugin with full premium features in "
282
  "action"
@@ -284,14 +290,14 @@ msgstr ""
284
  "Guarda il plugin YITH WooCommerce Zoom Magnifier con tutte le "
285
  "caratteristiche premium in azione"
286
 
287
- #: plugin-options/general-options.php:222
288
  msgid "Get Support and Pro Features"
289
  msgstr "Ottieni il supporto e le caratteristiche premium"
290
 
291
- #: plugin-options/general-options.php:223
292
  msgid ""
293
  "Purchasing the premium version of the plugin, you will take advantage of the "
294
- "advanced features of the product and you will get one year of free updates "
295
  "and support through our platform available 24h/24."
296
  msgstr ""
297
  "Acquistando la versione premium del plugin potrai usufruire delle "
@@ -299,66 +305,161 @@ msgstr ""
299
  "aggiornamenti gratuiti e di supporto attraverso la nostra piattaforma "
300
  "disponibile 24h/24."
301
 
302
- #: yit-common/yith-panel.php:424
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  msgid "Select a date"
304
  msgstr "Scegli una data"
305
 
306
- #: yit-common/yith-panel.php:425
307
  msgid "Hours"
308
  msgstr "Ore"
309
 
310
- #: yit-common/yith-panel.php:426 yit-common/yith-panel.php:427
311
  msgid "Minutes"
312
  msgstr "Minuti"
313
 
314
- #: yit-common/yith-panel.php:435
315
  msgid "Upload"
316
  msgstr "Carica"
317
 
318
- #: yit-common/yith-panel.php:472
319
  msgid "px"
320
  msgstr "px"
321
 
322
- #: yit-common/yith-panel.php:474
323
  msgid "em"
324
  msgstr "em"
325
 
326
- #: yit-common/yith-panel.php:476
327
  msgid "pt"
328
  msgstr "pt"
329
 
330
- #: yit-common/yith-panel.php:478
331
  msgid "rem"
332
  msgstr "rem"
333
 
334
- #: yit-common/yith-panel.php:490
335
  msgid "Select a font family"
336
  msgstr "Scegli una famiglia di caratteri"
337
 
338
- #: yit-common/yith-panel.php:500
339
  msgid "Regular"
340
  msgstr "Normale"
341
 
342
- #: yit-common/yith-panel.php:502
343
  msgid "Bold"
344
  msgstr "Grassetto"
345
 
346
- #: yit-common/yith-panel.php:504
347
  msgid "Extra bold"
348
  msgstr "Grassetto extra"
349
 
350
- #: yit-common/yith-panel.php:506
351
  msgid "Italic"
352
  msgstr "Corsivo"
353
 
354
- #: yit-common/yith-panel.php:508
355
  msgid "Italic bold"
356
  msgstr "Corsivo E Grassetto"
357
 
358
- #: yit-common/yith-panel.php:524
359
  msgid "Click to preview"
360
  msgstr "Premi per visualizzare l'anteprima"
361
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  #~ msgid "product"
363
  #~ msgstr "prodotto"
364
 
@@ -419,25 +520,3 @@ msgstr "Premi per visualizzare l'anteprima"
419
 
420
  #~ msgid "Left"
421
  #~ msgstr "Sinistra"
422
-
423
- #~ msgid "Activate YITH WooCommerce Zoom Magnifier"
424
- #~ msgstr "Attiva YITH WooCommerce Zoom Magnifier"
425
-
426
- #~ msgid "Activate on mobile device"
427
- #~ msgstr "Attiva su dispositivi mobili"
428
-
429
- #~ msgid ""
430
- #~ "Set if zoom and slider functionalities should be shown also on mobile "
431
- #~ "devices."
432
- #~ msgstr ""
433
- #~ "Decidi se mostrare lo zoom e lo slider anche sui dispositivi mobili."
434
-
435
- #~ msgid ""
436
- #~ "Purchasing the premium version of the plugin, you will take advantage of "
437
- #~ "the advanced features of the product, and you will get one year of free "
438
- #~ "updates and support through our platform available 24h/24."
439
- #~ msgstr ""
440
- #~ "Acquistando la versione premium del plugin potrai usufruire delle "
441
- #~ "caratteristiche avanzate del prodotto, oltre a ottenere un anno di "
442
- #~ "aggiornamenti gratuiti e di supporto attraverso la nostra piattaforma "
443
- #~ "disponibile 24h/24."
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Zoom Magnifier\n"
4
+ "POT-Creation-Date: 2015-09-02 15:20+0200\n"
5
+ "PO-Revision-Date: 2015-09-02 15:38+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language: it_IT\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.4\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "Plural-Forms: nplurals=2; plural=n!=1;\n"
15
  "X-Poedit-KeywordsList: __ ;_e;_n:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
20
 
21
+ #: class.yith-wcmg-admin.php:90
22
  msgid "Image Size"
23
  msgstr "Dimensioni Immagine"
24
 
25
+ #: class.yith-wcmg-admin.php:91 plugin-options/general-options.php:17
26
  msgid "The size of the images used within the magnifier box"
27
  msgstr "La dimensione delle immagini utilizzata nel riquadro di zoom"
28
 
42
  "Non è possibile attivare la versione gratuita di YITH WooCommerce Zoom "
43
  "Magnifier mentre si utilizza quella premium."
44
 
45
+ #: lib/class.yith-ywzm-custom-types.php:159
46
  msgid "Do you want to hard crop the image?"
47
  msgstr "Vuoi ritagliare l'immagine?"
48
 
80
  msgstr "Versione premium"
81
 
82
  #: lib/class.yith-ywzm-plugin-fw-loader.php:237
83
+ #: plugin-options/general-options.php:216
84
  msgid "YITH WooCommerce Zoom Magnifier"
85
  msgstr "YITH WooCommerce Zoom Magnifier"
86
 
103
  msgstr "Impostazioni generali"
104
 
105
  #: plugin-options/general-options.php:42
106
+ msgid "Activate YITH WooCommerce Zoom Magnifier"
107
+ msgstr "Attiva YITH WooCommerce Zoom Magnifier"
108
 
109
  #: plugin-options/general-options.php:43
110
  msgid "Activate the plugin or use the WooCommerce default product image."
111
  msgstr "Attiva il plugin o usa le immagini prodotto di default di WooCommerce."
112
 
113
  #: plugin-options/general-options.php:50
114
+ msgid "Activate on mobile device"
115
+ msgstr "Attiva su dispositivi mobili"
116
+
117
+ #: plugin-options/general-options.php:51
118
+ msgid ""
119
+ "Set if zoom and slider functionalities should be shown also on mobile "
120
+ "devices."
121
+ msgstr "Decidi se mostrare lo zoom e lo slider anche sui dispositivi mobili."
122
 
123
+ #: plugin-options/general-options.php:59
124
  msgid "Forced Image Size"
125
  msgstr "Dimensioni Immagini Forzate"
126
 
127
+ #: plugin-options/general-options.php:60
128
  msgid ""
129
  "If disabled, you will able to customize the sizes of the zoomed images. "
130
  "Disable it at your own risk; the magnifier could not properly work with "
134
  "delle immagini zoomate. Disabilitare a proprio rischio: lo zoom potrebbe non "
135
  "funzionare correttamente con immagini sproporzionate."
136
 
137
+ #: plugin-options/general-options.php:74
138
  msgid "Magnifier Settings"
139
  msgstr "Impostazioni Zoom"
140
 
141
+ #: plugin-options/general-options.php:80
142
  msgid "Zoom Box Width"
143
  msgstr "Larghezza Riquadro Zoom"
144
 
145
+ #: plugin-options/general-options.php:81
146
  msgid "The width of the magnifier box (default: auto)"
147
  msgstr "La larghezza del riquadro di zoom (default: auto)"
148
 
149
+ #: plugin-options/general-options.php:88
150
  msgid "Zoom Box Height"
151
  msgstr "Altezza Riquadro Zoom"
152
 
153
+ #: plugin-options/general-options.php:89
154
  msgid "The height of the magnifier box (default: auto)"
155
  msgstr "L'altezza del riquadro di zoom (default: auto)"
156
 
157
+ #: plugin-options/general-options.php:97
158
  msgid "Zoom Box Position"
159
  msgstr "Posizione Riquadro Zoom"
160
 
161
+ #: plugin-options/general-options.php:98
162
  msgid "The magnifier position"
163
  msgstr "Dove apparirà la finestra di zoom"
164
 
165
+ #: plugin-options/general-options.php:104
166
  msgid "Right"
167
  msgstr "Destra"
168
 
169
+ #: plugin-options/general-options.php:105
170
+ #: plugin-options/general-options.php:117
171
  msgid "Inside"
172
  msgstr "Interno"
173
 
174
+ #: plugin-options/general-options.php:109
175
  msgid "Zoom Box Position for mobile devices"
176
  msgstr "Posizione Riquadro Zoom su dispositivi mobili"
177
 
178
+ #: plugin-options/general-options.php:110
179
  msgid "The magnifier position for the mobile devices (iPhone, Android, etc.)"
180
  msgstr ""
181
  "Dove apparirà la finestra di zoom sui dispositivi mobili (iPhone, Android, "
182
  "etc.)"
183
 
184
+ #: plugin-options/general-options.php:116
185
  msgid "Default"
186
  msgstr "Default"
187
 
188
+ #: plugin-options/general-options.php:118
189
  msgid "Disable"
190
  msgstr "Disattiva"
191
 
192
+ #: plugin-options/general-options.php:122
193
  msgid "Loading label"
194
  msgstr "Etichetta di caricamento"
195
 
196
+ #: plugin-options/general-options.php:125
197
+ #: plugin-options/general-options.php:126
198
  msgid "Loading..."
199
  msgstr "Caricamento..."
200
 
201
+ #: plugin-options/general-options.php:130
202
  msgid "Lens Opacity"
203
  msgstr "Opacità Lenti"
204
 
205
+ #: plugin-options/general-options.php:141
206
  msgid "Blur"
207
  msgstr "Sfocatura"
208
 
209
+ #: plugin-options/general-options.php:142
210
  msgid "Add a blur effect to the small image on mouse hover."
211
  msgstr ""
212
  "Aggiungi un effetto di sfocatura all'immagine piccola al passaggio del mouse."
213
 
214
+ #: plugin-options/general-options.php:153
215
  msgid "Slider Settings"
216
  msgstr "Impostazioni Slider"
217
 
218
+ #: plugin-options/general-options.php:159
219
  msgid "Activate Slider"
220
  msgstr "Attiva Slider"
221
 
222
+ #: plugin-options/general-options.php:160
223
  msgid "Activate Thumbnail Slider."
224
  msgstr "Attiva lo slider con anteprime."
225
 
226
+ #: plugin-options/general-options.php:167
227
  msgid "Activate Responsive Slider"
228
  msgstr "Attiva Slider Responsive"
229
 
230
+ #: plugin-options/general-options.php:168
231
  msgid ""
232
  "This option fits the thumbnails within the available space. Disable it if "
233
  "you want to manage freely the thumbnails (eg. add margins, paddings, etc.)"
236
  "vuoi gestire liberamente le anteprime (per esempio aggiungere margini, "
237
  "padding, ecc.)"
238
 
239
+ #: plugin-options/general-options.php:175
240
  msgid "Items"
241
  msgstr "Elementi"
242
 
243
+ #: plugin-options/general-options.php:176
244
  msgid "Number of items to show"
245
  msgstr "Numero di elementi da mostrare"
246
 
247
+ #: plugin-options/general-options.php:186
248
  msgid "Circular carousel"
249
  msgstr "Carosello circolare"
250
 
251
+ #: plugin-options/general-options.php:187
252
  msgid "It defines whether the carousel should be circular."
253
  msgstr "Imposta se il carosello deve essere circolare."
254
 
255
+ #: plugin-options/general-options.php:194
256
  msgid "Infinite carousel"
257
  msgstr "Carosello infinito"
258
 
259
+ #: plugin-options/general-options.php:195
260
  msgid ""
261
  "It defines whether the carousel should be infinite. Note: It is possible to "
262
  "create a non-circular, infinite carousel, but it is not possible to create a "
266
  "un carosello infinito non circolare, ma non puoi creare un carosello "
267
  "circolare non infinito."
268
 
269
+ #: plugin-options/general-options.php:213
270
  msgid "Upgrade to the PREMIUM VERSION"
271
  msgstr "Aggiorna alla VERSIONE PREMIUM"
272
 
273
+ #: plugin-options/general-options.php:217
274
  msgid "Discover The Advanced Features"
275
  msgstr "Scopri le caratteristiche avanzate"
276
 
277
+ #: plugin-options/general-options.php:218
278
  msgid ""
279
  "Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit "
280
  "from all features!"
282
  "Aggiorna alla VERSIONE PREMIUM di YITH WOOCOMMERCE ZOOM MAGNIFIER per "
283
  "usufruire di tutte le caratteristiche!"
284
 
285
+ #: plugin-options/general-options.php:222
286
  msgid ""
287
  "See YITH WooCommerce Zoom Magnifier plugin with full premium features in "
288
  "action"
290
  "Guarda il plugin YITH WooCommerce Zoom Magnifier con tutte le "
291
  "caratteristiche premium in azione"
292
 
293
+ #: plugin-options/general-options.php:224
294
  msgid "Get Support and Pro Features"
295
  msgstr "Ottieni il supporto e le caratteristiche premium"
296
 
297
+ #: plugin-options/general-options.php:225
298
  msgid ""
299
  "Purchasing the premium version of the plugin, you will take advantage of the "
300
+ "advanced features of the product, and you will get one year of free updates "
301
  "and support through our platform available 24h/24."
302
  msgstr ""
303
  "Acquistando la versione premium del plugin potrai usufruire delle "
305
  "aggiornamenti gratuiti e di supporto attraverso la nostra piattaforma "
306
  "disponibile 24h/24."
307
 
308
+ #: templates/admin/premium.php:193
309
+ #, php-format
310
+ msgid ""
311
+ "Upgrade to the %1$s premium version %2$s of %1$s YITH WooCommerce Zoom "
312
+ "Magnifier %2$s to benefit from all features!"
313
+ msgstr ""
314
+ "Aggiorna alla %1$s versione premium %2$s di %1$s YITH WooCommerce Zoom "
315
+ "Magnifier %2$s per usufruire di tutte le funzionalità!"
316
+
317
+ #: templates/admin/premium.php:196
318
+ #, php-format
319
+ msgid "%1$sUPGRADE%2$s%3$sto the premium version%2$s"
320
+ msgstr "%1$sAGGIORNA%2$s%3$salla versione premium%2$s "
321
+
322
+ #: templates/admin/premium.php:202
323
+ #, php-format
324
+ msgid "%1$sPremium Features%2$s"
325
+ msgstr "%1$sFunzionalità premium%2$s"
326
+
327
+ #: templates/admin/premium.php:210
328
+ msgid "ZOOM BOX POSITION"
329
+ msgstr "POSIZIONE RIQUADRO ZOOM"
330
+
331
+ #: templates/admin/premium.php:213
332
+ #, php-format
333
+ msgid ""
334
+ "Choose where you want to show the %1$szoomed version%2$s of the image of "
335
+ "your products. Place it above or below the original image, on its left or "
336
+ "its right, or you can even place it over it.$2$s"
337
+ msgstr ""
338
+ "Scegli dove far apparire la %1$sversione ingrandita%2$s dell’immagine dei "
339
+ "tuoi prodotti. Posizionala in alto o in basso rispetto all’immagine "
340
+ "originale, alla sua destra o alla sua sinistra, o fa’ sì che si sovrapponga "
341
+ "ad essa.$2$s"
342
+
343
+ #: templates/admin/premium.php:223
344
+ msgid "ENLARGE THE IMAGES"
345
+ msgstr "ESPANDI L’IMMAGINE"
346
+
347
+ #: templates/admin/premium.php:225
348
+ msgid ""
349
+ "Just one click and the product image will appear in a bigger size in a modal "
350
+ "window. A further chance to let users analyze in a better way what you sell."
351
+ msgstr ""
352
+ "Un clic e l’immagine del prodotto apparirà a dimensioni maggiori e "
353
+ "all’interno di una finestra modale. Una possibilità in più per mettere "
354
+ "l’utente nelle condizioni di valutare al meglio ciò che vede."
355
+
356
+ #: templates/admin/premium.php:240
357
+ msgid "EXCLUDE PRODUCTS"
358
+ msgstr "ESCLUSIONE PRODOTTI"
359
+
360
+ #: templates/admin/premium.php:242
361
+ msgid ""
362
+ "Tailored options to limit the plugin features only to certain products. Some "
363
+ "of these could have too small images to be zoomed, or maybe being part of "
364
+ "categories that do not imply zoomed images. Select the products and the "
365
+ "categories to exclude and delete all your problems"
366
+ msgstr ""
367
+ "Opzioni su misura per limitare le funzionalità del plugin solo a determinati "
368
+ "prodotti. Alcuni di questi possono avere immagini troppo piccole per essere "
369
+ "zoomate o appartenere a categorie in cui lo zoom immagine non è necessario. "
370
+ "Seleziona i prodotti e le categorie da escludere e risolvi questo tipo di "
371
+ "problemi."
372
+
373
+ #: templates/admin/premium.php:251
374
+ #, php-format
375
+ msgid ""
376
+ "Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Zoom Magnifier"
377
+ "%2$s to benefit from all features!"
378
+ msgstr ""
379
+ "Aggiorna alla %1$sversione premium%2$s di %1$s YITH WooCommerce Zoom "
380
+ "Magnifier %2$s per usufruire di tutte le funzionalità!"
381
+
382
+ #: templates/admin/premium.php:254
383
+ #, php-format
384
+ msgid "%1$sUPGRADE%2$s %3$sto the premium version%2$s"
385
+ msgstr "%1$sAGGIORNA%2$s %3$salla versione premium%2$s "
386
+
387
+ #: yit-common/yith-panel.php:418
388
  msgid "Select a date"
389
  msgstr "Scegli una data"
390
 
391
+ #: yit-common/yith-panel.php:419
392
  msgid "Hours"
393
  msgstr "Ore"
394
 
395
+ #: yit-common/yith-panel.php:420 yit-common/yith-panel.php:421
396
  msgid "Minutes"
397
  msgstr "Minuti"
398
 
399
+ #: yit-common/yith-panel.php:429
400
  msgid "Upload"
401
  msgstr "Carica"
402
 
403
+ #: yit-common/yith-panel.php:466
404
  msgid "px"
405
  msgstr "px"
406
 
407
+ #: yit-common/yith-panel.php:468
408
  msgid "em"
409
  msgstr "em"
410
 
411
+ #: yit-common/yith-panel.php:470
412
  msgid "pt"
413
  msgstr "pt"
414
 
415
+ #: yit-common/yith-panel.php:472
416
  msgid "rem"
417
  msgstr "rem"
418
 
419
+ #: yit-common/yith-panel.php:484
420
  msgid "Select a font family"
421
  msgstr "Scegli una famiglia di caratteri"
422
 
423
+ #: yit-common/yith-panel.php:494
424
  msgid "Regular"
425
  msgstr "Normale"
426
 
427
+ #: yit-common/yith-panel.php:496
428
  msgid "Bold"
429
  msgstr "Grassetto"
430
 
431
+ #: yit-common/yith-panel.php:498
432
  msgid "Extra bold"
433
  msgstr "Grassetto extra"
434
 
435
+ #: yit-common/yith-panel.php:500
436
  msgid "Italic"
437
  msgstr "Corsivo"
438
 
439
+ #: yit-common/yith-panel.php:502
440
  msgid "Italic bold"
441
  msgstr "Corsivo E Grassetto"
442
 
443
+ #: yit-common/yith-panel.php:518
444
  msgid "Click to preview"
445
  msgstr "Premi per visualizzare l'anteprima"
446
 
447
+ #~ msgid "Activate YITH Magnifier"
448
+ #~ msgstr "Attiva YITH Magnifier"
449
+
450
+ #~ msgid "Activate the plugin on mobile device"
451
+ #~ msgstr "Attiva il plugin su dispositivi mobili"
452
+
453
+ #~ msgid ""
454
+ #~ "Purchasing the premium version of the plugin, you will take advantage of "
455
+ #~ "the advanced features of the product and you will get one year of free "
456
+ #~ "updates and support through our platform available 24h/24."
457
+ #~ msgstr ""
458
+ #~ "Acquistando la versione premium del plugin potrai usufruire delle "
459
+ #~ "caratteristiche avanzate del prodotto, oltre a ottenere un anno di "
460
+ #~ "aggiornamenti gratuiti e di supporto attraverso la nostra piattaforma "
461
+ #~ "disponibile 24h/24."
462
+
463
  #~ msgid "product"
464
  #~ msgstr "prodotto"
465
 
520
 
521
  #~ msgid "Left"
522
  #~ msgstr "Sinistra"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/yith-woocommerce-zoom-magnifier/languages/ywzm.pot CHANGED
@@ -2,7 +2,7 @@
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Order Tracking\n"
5
- "POT-Creation-Date: 2015-05-22 12:47+0100\n"
6
  "PO-Revision-Date: 2015-04-22 12:25+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
@@ -10,7 +10,7 @@ msgstr ""
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 1.8\n"
14
  "X-Poedit-Basepath: ..\\\n"
15
  "Plural-Forms: nplurals=2; plural=n!=1;\n"
16
  "X-Poedit-KeywordsList: __ ;_e;_n:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
@@ -19,18 +19,18 @@ msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
21
 
22
- #: class.yith-wcmg-admin.php:91
23
  msgid "Image Size"
24
  msgstr ""
25
 
26
- #: class.yith-wcmg-admin.php:92 plugin-options/general-options.php:17
27
  msgid "The size of the images used within the magnifier box"
28
  msgstr ""
29
 
30
  #: init.php:43
31
  msgid ""
32
  "YITH WooCommerce Zoom Magnifier is enabled but not effective. It requires "
33
- "Woocommerce in order to work."
34
  msgstr ""
35
 
36
  #: init.php:52
@@ -39,7 +39,7 @@ msgid ""
39
  "you are using the premium one."
40
  msgstr ""
41
 
42
- #: lib/class.yith-ywzm-custom-types.php:179
43
  msgid "Do you want to hard crop the image?"
44
  msgstr ""
45
 
@@ -75,7 +75,7 @@ msgid "Premium version"
75
  msgstr ""
76
 
77
  #: lib/class.yith-ywzm-plugin-fw-loader.php:237
78
- #: plugin-options/general-options.php:214
79
  msgid "YITH WooCommerce Zoom Magnifier"
80
  msgstr ""
81
 
@@ -95,7 +95,7 @@ msgid "General Settings"
95
  msgstr ""
96
 
97
  #: plugin-options/general-options.php:42
98
- msgid "Activate YITH Magnifier"
99
  msgstr ""
100
 
101
  #: plugin-options/general-options.php:43
@@ -103,230 +103,236 @@ msgid "Activate the plugin or use the WooCommerce default product image."
103
  msgstr ""
104
 
105
  #: plugin-options/general-options.php:50
106
- msgid "Activate the plugin on mobile device"
 
 
 
 
 
 
107
  msgstr ""
108
 
109
- #: plugin-options/general-options.php:57
110
  msgid "Forced Image Size"
111
  msgstr ""
112
 
113
- #: plugin-options/general-options.php:58
114
  msgid ""
115
  "If disabled, you will able to customize the sizes of the zoomed images. "
116
  "Disable it at your own risk; the magnifier could not properly work with "
117
  "images out of proportion."
118
  msgstr ""
119
 
120
- #: plugin-options/general-options.php:72
121
  msgid "Magnifier Settings"
122
  msgstr ""
123
 
124
- #: plugin-options/general-options.php:78
125
  msgid "Zoom Box Width"
126
  msgstr ""
127
 
128
- #: plugin-options/general-options.php:79
129
  msgid "The width of the magnifier box (default: auto)"
130
  msgstr ""
131
 
132
- #: plugin-options/general-options.php:86
133
  msgid "Zoom Box Height"
134
  msgstr ""
135
 
136
- #: plugin-options/general-options.php:87
137
  msgid "The height of the magnifier box (default: auto)"
138
  msgstr ""
139
 
140
- #: plugin-options/general-options.php:95
141
  msgid "Zoom Box Position"
142
  msgstr ""
143
 
144
- #: plugin-options/general-options.php:96
145
  msgid "The magnifier position"
146
  msgstr ""
147
 
148
- #: plugin-options/general-options.php:102
149
  msgid "Right"
150
  msgstr ""
151
 
152
- #: plugin-options/general-options.php:103
153
- #: plugin-options/general-options.php:115
154
  msgid "Inside"
155
  msgstr ""
156
 
157
- #: plugin-options/general-options.php:107
158
  msgid "Zoom Box Position for mobile devices"
159
  msgstr ""
160
 
161
- #: plugin-options/general-options.php:108
162
  msgid "The magnifier position for the mobile devices (iPhone, Android, etc.)"
163
  msgstr ""
164
 
165
- #: plugin-options/general-options.php:114
166
  msgid "Default"
167
  msgstr ""
168
 
169
- #: plugin-options/general-options.php:116
170
  msgid "Disable"
171
  msgstr ""
172
 
173
- #: plugin-options/general-options.php:120
174
  msgid "Loading label"
175
  msgstr ""
176
 
177
- #: plugin-options/general-options.php:123
178
- #: plugin-options/general-options.php:124
179
  msgid "Loading..."
180
  msgstr ""
181
 
182
- #: plugin-options/general-options.php:128
183
  msgid "Lens Opacity"
184
  msgstr ""
185
 
186
- #: plugin-options/general-options.php:139
187
  msgid "Blur"
188
  msgstr ""
189
 
190
- #: plugin-options/general-options.php:140
191
  msgid "Add a blur effect to the small image on mouse hover."
192
  msgstr ""
193
 
194
- #: plugin-options/general-options.php:151
195
  msgid "Slider Settings"
196
  msgstr ""
197
 
198
- #: plugin-options/general-options.php:157
199
  msgid "Activate Slider"
200
  msgstr ""
201
 
202
- #: plugin-options/general-options.php:158
203
  msgid "Activate Thumbnail Slider."
204
  msgstr ""
205
 
206
- #: plugin-options/general-options.php:165
207
  msgid "Activate Responsive Slider"
208
  msgstr ""
209
 
210
- #: plugin-options/general-options.php:166
211
  msgid ""
212
  "This option fits the thumbnails within the available space. Disable it if "
213
  "you want to manage freely the thumbnails (eg. add margins, paddings, etc.)"
214
  msgstr ""
215
 
216
- #: plugin-options/general-options.php:173
217
  msgid "Items"
218
  msgstr ""
219
 
220
- #: plugin-options/general-options.php:174
221
  msgid "Number of items to show"
222
  msgstr ""
223
 
224
- #: plugin-options/general-options.php:184
225
  msgid "Circular carousel"
226
  msgstr ""
227
 
228
- #: plugin-options/general-options.php:185
229
  msgid "It defines whether the carousel should be circular."
230
  msgstr ""
231
 
232
- #: plugin-options/general-options.php:192
233
  msgid "Infinite carousel"
234
  msgstr ""
235
 
236
- #: plugin-options/general-options.php:193
237
  msgid ""
238
  "It defines whether the carousel should be infinite. Note: It is possible to "
239
  "create a non-circular, infinite carousel, but it is not possible to create a "
240
  "circular, non-infinite carousel."
241
  msgstr ""
242
 
243
- #: plugin-options/general-options.php:211
244
  msgid "Upgrade to the PREMIUM VERSION"
245
  msgstr ""
246
 
247
- #: plugin-options/general-options.php:215
248
  msgid "Discover The Advanced Features"
249
  msgstr ""
250
 
251
- #: plugin-options/general-options.php:216
252
  msgid ""
253
  "Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit "
254
  "from all features!"
255
  msgstr ""
256
 
257
- #: plugin-options/general-options.php:220
258
  msgid ""
259
  "See YITH WooCommerce Zoom Magnifier plugin with full premium features in "
260
  "action"
261
  msgstr ""
262
 
263
- #: plugin-options/general-options.php:222
264
  msgid "Get Support and Pro Features"
265
  msgstr ""
266
 
267
- #: plugin-options/general-options.php:223
268
  msgid ""
269
  "Purchasing the premium version of the plugin, you will take advantage of the "
270
- "advanced features of the product and you will get one year of free updates "
271
  "and support through our platform available 24h/24."
272
  msgstr ""
273
 
274
- #: yit-common/yith-panel.php:424
275
  msgid "Select a date"
276
  msgstr ""
277
 
278
- #: yit-common/yith-panel.php:425
279
  msgid "Hours"
280
  msgstr ""
281
 
282
- #: yit-common/yith-panel.php:426 yit-common/yith-panel.php:427
283
  msgid "Minutes"
284
  msgstr ""
285
 
286
- #: yit-common/yith-panel.php:435
287
  msgid "Upload"
288
  msgstr ""
289
 
290
- #: yit-common/yith-panel.php:472
291
  msgid "px"
292
  msgstr ""
293
 
294
- #: yit-common/yith-panel.php:474
295
  msgid "em"
296
  msgstr ""
297
 
298
- #: yit-common/yith-panel.php:476
299
  msgid "pt"
300
  msgstr ""
301
 
302
- #: yit-common/yith-panel.php:478
303
  msgid "rem"
304
  msgstr ""
305
 
306
- #: yit-common/yith-panel.php:490
307
  msgid "Select a font family"
308
  msgstr ""
309
 
310
- #: yit-common/yith-panel.php:500
311
  msgid "Regular"
312
  msgstr ""
313
 
314
- #: yit-common/yith-panel.php:502
315
  msgid "Bold"
316
  msgstr ""
317
 
318
- #: yit-common/yith-panel.php:504
319
  msgid "Extra bold"
320
  msgstr ""
321
 
322
- #: yit-common/yith-panel.php:506
323
  msgid "Italic"
324
  msgstr ""
325
 
326
- #: yit-common/yith-panel.php:508
327
  msgid "Italic bold"
328
  msgstr ""
329
 
330
- #: yit-common/yith-panel.php:524
331
  msgid "Click to preview"
332
  msgstr ""
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: YITH WooCommerce Order Tracking\n"
5
+ "POT-Creation-Date: 2015-09-01 14:07+0100\n"
6
  "PO-Revision-Date: 2015-04-22 12:25+0100\n"
7
  "Last-Translator: \n"
8
  "Language-Team: Your Inspiration Themes <plugins@yithemes.com>\n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.1\n"
14
  "X-Poedit-Basepath: ..\\\n"
15
  "Plural-Forms: nplurals=2; plural=n!=1;\n"
16
  "X-Poedit-KeywordsList: __ ;_e;_n:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Poedit-SearchPathExcluded-0: plugin-fw\n"
21
 
22
+ #: class.yith-wcmg-admin.php:90
23
  msgid "Image Size"
24
  msgstr ""
25
 
26
+ #: class.yith-wcmg-admin.php:91 plugin-options/general-options.php:17
27
  msgid "The size of the images used within the magnifier box"
28
  msgstr ""
29
 
30
  #: init.php:43
31
  msgid ""
32
  "YITH WooCommerce Zoom Magnifier is enabled but not effective. It requires "
33
+ "WooCommerce in order to work."
34
  msgstr ""
35
 
36
  #: init.php:52
39
  "you are using the premium one."
40
  msgstr ""
41
 
42
+ #: lib/class.yith-ywzm-custom-types.php:159
43
  msgid "Do you want to hard crop the image?"
44
  msgstr ""
45
 
75
  msgstr ""
76
 
77
  #: lib/class.yith-ywzm-plugin-fw-loader.php:237
78
+ #: plugin-options/general-options.php:216
79
  msgid "YITH WooCommerce Zoom Magnifier"
80
  msgstr ""
81
 
95
  msgstr ""
96
 
97
  #: plugin-options/general-options.php:42
98
+ msgid "Activate YITH WooCommerce Zoom Magnifier"
99
  msgstr ""
100
 
101
  #: plugin-options/general-options.php:43
103
  msgstr ""
104
 
105
  #: plugin-options/general-options.php:50
106
+ msgid "Activate on mobile device"
107
+ msgstr ""
108
+
109
+ #: plugin-options/general-options.php:51
110
+ msgid ""
111
+ "Set if zoom and slider functionalities should be shown also on mobile "
112
+ "devices."
113
  msgstr ""
114
 
115
+ #: plugin-options/general-options.php:59
116
  msgid "Forced Image Size"
117
  msgstr ""
118
 
119
+ #: plugin-options/general-options.php:60
120
  msgid ""
121
  "If disabled, you will able to customize the sizes of the zoomed images. "
122
  "Disable it at your own risk; the magnifier could not properly work with "
123
  "images out of proportion."
124
  msgstr ""
125
 
126
+ #: plugin-options/general-options.php:74
127
  msgid "Magnifier Settings"
128
  msgstr ""
129
 
130
+ #: plugin-options/general-options.php:80
131
  msgid "Zoom Box Width"
132
  msgstr ""
133
 
134
+ #: plugin-options/general-options.php:81
135
  msgid "The width of the magnifier box (default: auto)"
136
  msgstr ""
137
 
138
+ #: plugin-options/general-options.php:88
139
  msgid "Zoom Box Height"
140
  msgstr ""
141
 
142
+ #: plugin-options/general-options.php:89
143
  msgid "The height of the magnifier box (default: auto)"
144
  msgstr ""
145
 
146
+ #: plugin-options/general-options.php:97
147
  msgid "Zoom Box Position"
148
  msgstr ""
149
 
150
+ #: plugin-options/general-options.php:98
151
  msgid "The magnifier position"
152
  msgstr ""
153
 
154
+ #: plugin-options/general-options.php:104
155
  msgid "Right"
156
  msgstr ""
157
 
158
+ #: plugin-options/general-options.php:105
159
+ #: plugin-options/general-options.php:117
160
  msgid "Inside"
161
  msgstr ""
162
 
163
+ #: plugin-options/general-options.php:109
164
  msgid "Zoom Box Position for mobile devices"
165
  msgstr ""
166
 
167
+ #: plugin-options/general-options.php:110
168
  msgid "The magnifier position for the mobile devices (iPhone, Android, etc.)"
169
  msgstr ""
170
 
171
+ #: plugin-options/general-options.php:116
172
  msgid "Default"
173
  msgstr ""
174
 
175
+ #: plugin-options/general-options.php:118
176
  msgid "Disable"
177
  msgstr ""
178
 
179
+ #: plugin-options/general-options.php:122
180
  msgid "Loading label"
181
  msgstr ""
182
 
183
+ #: plugin-options/general-options.php:125
184
+ #: plugin-options/general-options.php:126
185
  msgid "Loading..."
186
  msgstr ""
187
 
188
+ #: plugin-options/general-options.php:130
189
  msgid "Lens Opacity"
190
  msgstr ""
191
 
192
+ #: plugin-options/general-options.php:141
193
  msgid "Blur"
194
  msgstr ""
195
 
196
+ #: plugin-options/general-options.php:142
197
  msgid "Add a blur effect to the small image on mouse hover."
198
  msgstr ""
199
 
200
+ #: plugin-options/general-options.php:153
201
  msgid "Slider Settings"
202
  msgstr ""
203
 
204
+ #: plugin-options/general-options.php:159
205
  msgid "Activate Slider"
206
  msgstr ""
207
 
208
+ #: plugin-options/general-options.php:160
209
  msgid "Activate Thumbnail Slider."
210
  msgstr ""
211
 
212
+ #: plugin-options/general-options.php:167
213
  msgid "Activate Responsive Slider"
214
  msgstr ""
215
 
216
+ #: plugin-options/general-options.php:168
217
  msgid ""
218
  "This option fits the thumbnails within the available space. Disable it if "
219
  "you want to manage freely the thumbnails (eg. add margins, paddings, etc.)"
220
  msgstr ""
221
 
222
+ #: plugin-options/general-options.php:175
223
  msgid "Items"
224
  msgstr ""
225
 
226
+ #: plugin-options/general-options.php:176
227
  msgid "Number of items to show"
228
  msgstr ""
229
 
230
+ #: plugin-options/general-options.php:186
231
  msgid "Circular carousel"
232
  msgstr ""
233
 
234
+ #: plugin-options/general-options.php:187
235
  msgid "It defines whether the carousel should be circular."
236
  msgstr ""
237
 
238
+ #: plugin-options/general-options.php:194
239
  msgid "Infinite carousel"
240
  msgstr ""
241
 
242
+ #: plugin-options/general-options.php:195
243
  msgid ""
244
  "It defines whether the carousel should be infinite. Note: It is possible to "
245
  "create a non-circular, infinite carousel, but it is not possible to create a "
246
  "circular, non-infinite carousel."
247
  msgstr ""
248
 
249
+ #: plugin-options/general-options.php:213
250
  msgid "Upgrade to the PREMIUM VERSION"
251
  msgstr ""
252
 
253
+ #: plugin-options/general-options.php:217
254
  msgid "Discover The Advanced Features"
255
  msgstr ""
256
 
257
+ #: plugin-options/general-options.php:218
258
  msgid ""
259
  "Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit "
260
  "from all features!"
261
  msgstr ""
262
 
263
+ #: plugin-options/general-options.php:222
264
  msgid ""
265
  "See YITH WooCommerce Zoom Magnifier plugin with full premium features in "
266
  "action"
267
  msgstr ""
268
 
269
+ #: plugin-options/general-options.php:224
270
  msgid "Get Support and Pro Features"
271
  msgstr ""
272
 
273
+ #: plugin-options/general-options.php:225
274
  msgid ""
275
  "Purchasing the premium version of the plugin, you will take advantage of the "
276
+ "advanced features of the product, and you will get one year of free updates "
277
  "and support through our platform available 24h/24."
278
  msgstr ""
279
 
280
+ #: yit-common/yith-panel.php:418
281
  msgid "Select a date"
282
  msgstr ""
283
 
284
+ #: yit-common/yith-panel.php:419
285
  msgid "Hours"
286
  msgstr ""
287
 
288
+ #: yit-common/yith-panel.php:420 yit-common/yith-panel.php:421
289
  msgid "Minutes"
290
  msgstr ""
291
 
292
+ #: yit-common/yith-panel.php:429
293
  msgid "Upload"
294
  msgstr ""
295
 
296
+ #: yit-common/yith-panel.php:466
297
  msgid "px"
298
  msgstr ""
299
 
300
+ #: yit-common/yith-panel.php:468
301
  msgid "em"
302
  msgstr ""
303
 
304
+ #: yit-common/yith-panel.php:470
305
  msgid "pt"
306
  msgstr ""
307
 
308
+ #: yit-common/yith-panel.php:472
309
  msgid "rem"
310
  msgstr ""
311
 
312
+ #: yit-common/yith-panel.php:484
313
  msgid "Select a font family"
314
  msgstr ""
315
 
316
+ #: yit-common/yith-panel.php:494
317
  msgid "Regular"
318
  msgstr ""
319
 
320
+ #: yit-common/yith-panel.php:496
321
  msgid "Bold"
322
  msgstr ""
323
 
324
+ #: yit-common/yith-panel.php:498
325
  msgid "Extra bold"
326
  msgstr ""
327
 
328
+ #: yit-common/yith-panel.php:500
329
  msgid "Italic"
330
  msgstr ""
331
 
332
+ #: yit-common/yith-panel.php:502
333
  msgid "Italic bold"
334
  msgstr ""
335
 
336
+ #: yit-common/yith-panel.php:518
337
  msgid "Click to preview"
338
  msgstr ""
modules/yith-woocommerce-zoom-magnifier/lib/class.yith-woocommerce-zoom-magnifier.php CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'YITH_WooCommerce_Zoom_Magnifier' ) ) {
25
  * @var string
26
  * @since 1.0.0
27
  */
28
- public $version = '1.1.5';
29
 
30
  /**
31
  * Plugin object
25
  * @var string
26
  * @since 1.0.0
27
  */
28
+ public $version = '1.2.9';
29
 
30
  /**
31
  * Plugin object
modules/yith-woocommerce-zoom-magnifier/lib/class.yith-ywzm-custom-types.php CHANGED
@@ -1,211 +1,181 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit; // Exit if accessed directly
4
  }
5
 
6
- if ( ! class_exists( 'YITH_YWZM_Custom_Types' ) ) {
7
-
8
- /**
9
- * custom types fields
10
- *
11
- * @class YITH_YWZM_Custom_Types
12
- * @package Yithemes
13
- * @since 1.0.0
14
- * @author Your Inspiration Themes
15
- */
16
- class YITH_YWZM_Custom_Types {
17
-
18
- /**
19
- * Single instance of the class
20
- *
21
- * @since 1.0.0
22
- */
23
- protected static $instance;
24
-
25
- /**
26
- * Returns single instance of the class
27
- *
28
- * @since 1.0.0
29
- */
30
- public static function get_instance() {
31
- if ( is_null( self::$instance ) ) {
32
- self::$instance = new self();
33
- }
34
-
35
- return self::$instance;
36
- }
37
-
38
- public function __construct() {
39
- /**
40
- * Register actions and filters for custom types used on the current plugin
41
- */
42
-
43
- /** Custom types : slider */
44
- add_action( 'woocommerce_admin_field_slider', array( $this, 'admin_fields_slider' ) );
45
- add_action( 'woocommerce_update_option_slider', array( $this, 'admin_update_option' ) );
46
-
47
- /** Custom types : picker */
48
- add_action( 'woocommerce_admin_field_picker', array( $this, 'admin_fields_picker' ) );
49
- add_action( 'woocommerce_update_option_picker', array( $this, 'admin_update_option' ) );
50
-
51
- add_action( 'woocommerce_admin_field_yith_ywzm_image_width', array(
52
- $this,
53
- 'admin_fields_yith_ywzm_image_width'
54
- ) );
55
- add_action( 'woocommerce_update_option_yith_ywzm_image_width', array( $this, 'yit_upload_update' ), 10, 1 );
56
- }
57
-
58
- /**
59
- * Create new Woocommerce admin field: slider
60
- *
61
- * @access public
62
- *
63
- * @param array $value
64
- *
65
- * @return void
66
- * @since 1.0.0
67
- */
68
- public function admin_fields_slider( $value ) {
69
- $slider_value = ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) ?
70
- esc_attr( stripslashes( get_option( $value['id'] ) ) ) :
71
- esc_attr( $value['std'] );
72
-
73
- ?>
74
- <tr valign="top">
75
- <th scope="row" class="titledesc">
76
- <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
77
- </th>
78
- <td class="forminp">
79
- <div id="<?php echo esc_attr( $value['id'] ); ?>_slider" class="yith_woocommerce_slider" style="width: 300px; float: left;"></div>
80
- <div id="<?php echo esc_attr( $value['id'] ); ?>_value" class="yith_woocommerce_slider_value ui-state-default ui-corner-all"><?php echo $slider_value ?></div>
81
- <input name="<?php echo esc_attr( $value['id'] ); ?>" id="<?php echo esc_attr( $value['id'] ); ?>" type="hidden" value="<?php echo $slider_value ?>" /> <?php echo $value['desc']; ?>
82
- </td>
83
- </tr>
84
-
85
-
86
-
87
- <script>
88
- jQuery(document).ready(function ($) {
89
- $('#<?php echo esc_attr( $value['id'] ); ?>_slider').slider({
90
- min : <?php echo $value['min'] ?>,
91
- max : <?php echo $value['max'] ?>,
92
- step : <?php echo $value['step'] ?>,
93
- value: <?php echo $slider_value ?>,
94
- slide: function (event, ui) {
95
- $("#<?php echo esc_attr( $value['id'] ); ?>").val(ui.value);
96
- $("#<?php echo esc_attr( $value['id'] ); ?>_value").text(ui.value);
97
- }
98
- });
99
- });
100
- </script>
101
-
102
- <?php
103
- }
104
-
105
- /**
106
- * Save the admin field: slider
107
- *
108
- * @access public
109
- *
110
- * @param mixed $value
111
- *
112
- * @return void
113
- * @since 1.0.0
114
- */
115
- public function admin_update_option( $value ) {
116
- global $woocommerce;
117
-
118
- if ( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.1', '<' ) ) {
119
- $wc_clean = 'woocommerce_clean';
120
- }
121
- else {
122
- $wc_clean = 'wc_clean';
123
- }
124
-
125
- update_option( $value['id'], woocommerce_clean( $_POST[$value['id']] ) );
126
- }
127
-
128
- /**
129
- * Create new Woocommerce admin field: picker
130
- *
131
- * @access public
132
- *
133
- * @param array $value
134
- *
135
- * @return void
136
- * @since 1.0.0
137
- */
138
- public function admin_fields_picker( $value ) {
139
- $picker_value = ( get_option( $value['id'] ) !== false && get_option( $value['id'] ) !== null ) ?
140
- esc_attr( stripslashes( get_option( $value['id'] ) ) ) :
141
- esc_attr( $value['std'] );
142
-
143
- ?>
144
- <tr valign="top">
145
- <th scope="row" class="titledesc">
146
- <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo $value['name']; ?></label>
147
- </th>
148
- <td class="forminp">
149
- <div class="color_box"><strong><?php echo $value['name']; ?></strong>
150
- <input name="<?php echo esc_attr( $value['id'] ) ?>" id="<?php echo esc_attr( $value['id'] ) ?>" type="text" value="<?php echo $picker_value ?>" class="colorpick" />
151
-
152
- <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ) ?>" class="colorpickdiv"></div>
153
- </div> <?php echo $value['desc']; ?></td>
154
- </tr>
155
- <?php
156
- }
157
-
158
- /**
159
- * Create new Woocommerce admin field: yith_ywzm_image_width
160
- *
161
- * @access public
162
- * @param array $value
163
- * @return void
164
- * @since 1.1.3
165
- */
166
- public function admin_fields_yith_ywzm_image_width( $value ){
167
-
168
- $width = WC_Admin_Settings::get_option( $value['id'] . '[width]', $value['default']['width'] );
169
- $height = WC_Admin_Settings::get_option( $value['id'] . '[height]', $value['default']['height'] );
170
- $crop = WC_Admin_Settings::get_option( $value['id'] . '[crop]' );
171
- $crop = ( $crop == 'on' || $crop == '1' ) ? 1 : 0;
172
- $crop = checked( 1, $crop, false );
173
-
174
- ?><tr valign="top">
175
- <th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?></th>
176
- <td class="forminp image_width_settings">
177
- <input name="<?php echo esc_attr( $value['id'] ); ?>[width]" id="<?php echo esc_attr( $value['id'] ); ?>-width" type="text" size="3" value="<?php echo $width; ?>" /> &times; <input name="<?php echo esc_attr( $value['id'] ); ?>[height]" id="<?php echo esc_attr( $value['id'] ); ?>-height" type="text" size="3" value="<?php echo $height; ?>" />px <span class="description"><?php echo $value['desc'] ?></span>
178
- <br>
179
- <label><input name="<?php echo esc_attr( $value['id'] ); ?>[crop]" id="<?php echo esc_attr( $value['id'] ); ?>-crop" type="checkbox" <?php echo $crop; ?> /> <?php _e( 'Do you want to hard crop the image?', 'woocommerce' ); ?></label>
180
-
181
- </td>
182
- </tr><?php
183
-
184
- }
185
-
186
- /**
187
- * Update plugin options.
188
- *
189
- * @return void
190
- * @since 1.0.0
191
- */
192
- public function update_options() {
193
- foreach ( $this->options as $option ) {
194
- woocommerce_update_options( $option );
195
- }
196
- }
197
-
198
- /**
199
- * Show a input fields to upload images
200
- *
201
- *
202
- * @return void
203
- * @since 1.0
204
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
205
- */
206
-
207
- public function yit_upload_update( $option_value ) {
208
- return $option_value;
209
- }
210
- }
211
  }
1
  <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit; // Exit if accessed directly
4
  }
5
 
6
+ if (!class_exists('YITH_YWZM_Custom_Types')) {
7
+
8
+ /**
9
+ * custom types fields
10
+ *
11
+ * @class YITH_YWZM_Custom_Types
12
+ * @package Yithemes
13
+ * @since 1.0.0
14
+ * @author Your Inspiration Themes
15
+ */
16
+ class YITH_YWZM_Custom_Types
17
+ {
18
+
19
+ /**
20
+ * Single instance of the class
21
+ *
22
+ * @since 1.0.0
23
+ */
24
+ protected static $instance;
25
+
26
+ /**
27
+ * Returns single instance of the class
28
+ *
29
+ * @since 1.0.0
30
+ */
31
+ public static function get_instance()
32
+ {
33
+ if (is_null(self::$instance)) {
34
+ self::$instance = new self();
35
+ }
36
+
37
+ return self::$instance;
38
+ }
39
+
40
+ public function __construct()
41
+ {
42
+ /**
43
+ * Register actions and filters for custom types used on the current plugin
44
+ */
45
+
46
+ /** Custom types : slider */
47
+ add_action('woocommerce_admin_field_slider', array($this, 'admin_fields_slider'));
48
+
49
+ add_action('woocommerce_admin_field_yith_ywzm_image_width', array(
50
+ $this,
51
+ 'admin_fields_yith_ywzm_image_width'
52
+ ));
53
+ }
54
+
55
+ /**
56
+ * Create new Woocommerce admin field: slider
57
+ *
58
+ * @access public
59
+ *
60
+ * @param array $value
61
+ *
62
+ * @return void
63
+ * @since 1.0.0
64
+ */
65
+ public function admin_fields_slider($value)
66
+ {
67
+ $slider_value = (get_option($value['id']) !== false && get_option($value['id']) !== null) ?
68
+ esc_attr(stripslashes(get_option($value['id']))) :
69
+ esc_attr($value['std']);
70
+
71
+ ?>
72
+ <tr valign="top">
73
+ <th scope="row" class="titledesc">
74
+ <label for="<?php echo esc_attr($value['id']); ?>"><?php echo $value['name']; ?></label>
75
+ </th>
76
+ <td class="forminp">
77
+ <div id="<?php echo esc_attr($value['id']); ?>_slider" class="yith_woocommerce_slider"
78
+ style="width: 300px; float: left;"></div>
79
+ <div id="<?php echo esc_attr($value['id']); ?>_value"
80
+ class="yith_woocommerce_slider_value ui-state-default ui-corner-all"><?php echo $slider_value ?></div>
81
+ <input name="<?php echo esc_attr($value['id']); ?>" id="<?php echo esc_attr($value['id']); ?>"
82
+ type="hidden" value="<?php echo $slider_value ?>"/> <?php echo $value['desc']; ?>
83
+ </td>
84
+ </tr>
85
+
86
+
87
+ <script>
88
+ jQuery(document).ready(function ($) {
89
+ $('#<?php echo esc_attr( $value['id'] ); ?>_slider').slider({
90
+ min: <?php echo $value['min'] ?>,
91
+ max: <?php echo $value['max'] ?>,
92
+ step: <?php echo $value['step'] ?>,
93
+ value: <?php echo $slider_value ?>,
94
+ slide: function (event, ui) {
95
+ $("#<?php echo esc_attr( $value['id'] ); ?>").val(ui.value);
96
+ $("#<?php echo esc_attr( $value['id'] ); ?>_value").text(ui.value);
97
+ }
98
+ });
99
+ });
100
+ </script>
101
+
102
+ <?php
103
+ }
104
+
105
+ /**
106
+ * Save the admin field: slider
107
+ *
108
+ * @access public
109
+ *
110
+ * @param mixed $value
111
+ *
112
+ * @return void
113
+ * @since 1.0.0
114
+ */
115
+ public function admin_update_option($value)
116
+ {
117
+ global $woocommerce;
118
+
119
+ if (version_compare(preg_replace('/-beta-([0-9]+)/', '', $woocommerce->version), '2.1', '<')) {
120
+ $wc_clean = 'woocommerce_clean';
121
+ } else {
122
+ $wc_clean = 'wc_clean';
123
+ }
124
+
125
+ update_option($value['id'], woocommerce_clean($_POST[$value['id']]));
126
+ }
127
+
128
+
129
+ /**
130
+ * Create new Woocommerce admin field: yith_ywzm_image_width
131
+ *
132
+ * @access public
133
+ * @param array $value
134
+ * @return void
135
+ * @since 1.1.3
136
+ */
137
+ public function admin_fields_yith_ywzm_image_width($value)
138
+ {
139
+
140
+ $width = WC_Admin_Settings::get_option($value['id'] . '[width]', $value['default']['width']);
141
+ $height = WC_Admin_Settings::get_option($value['id'] . '[height]', $value['default']['height']);
142
+ $crop = WC_Admin_Settings::get_option($value['id'] . '[crop]');
143
+ $crop = ($crop == 'on' || $crop == '1') ? 1 : 0;
144
+ $crop = checked(1, $crop, false);
145
+
146
+ ?>
147
+ <tr valign="top">
148
+ <th scope="row" class="titledesc"><?php echo esc_html($value['title']) ?></th>
149
+ <td class="forminp image_width_settings">
150
+ <input name="<?php echo esc_attr($value['id']); ?>[width]"
151
+ id="<?php echo esc_attr($value['id']); ?>-width" type="text" size="3"
152
+ value="<?php echo $width; ?>"/> &times; <input
153
+ name="<?php echo esc_attr($value['id']); ?>[height]"
154
+ id="<?php echo esc_attr($value['id']); ?>-height" type="text" size="3"
155
+ value="<?php echo $height; ?>"/>px <span class="description"><?php echo $value['desc'] ?></span>
156
+ <br>
157
+ <label><input name="<?php echo esc_attr($value['id']); ?>[crop]"
158
+ id="<?php echo esc_attr($value['id']); ?>-crop"
159
+ type="checkbox" <?php echo $crop; ?> /> <?php _e('Do you want to hard crop the image?', 'woocommerce'); ?>
160
+ </label>
161
+
162
+ </td>
163
+ </tr><?php
164
+
165
+ }
166
+
167
+ /**
168
+ * Update plugin options.
169
+ *
170
+ * @return void
171
+ * @since 1.0.0
172
+ */
173
+ public function update_options()
174
+ {
175
+ foreach ($this->options as $option) {
176
+ woocommerce_update_options($option);
177
+ }
178
+ }
179
+
180
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
modules/yith-woocommerce-zoom-magnifier/lib/class.yith-ywzm-plugin-fw-loader.php CHANGED
@@ -252,7 +252,7 @@ if ( ! class_exists( 'YITH_YWZM_Plugin_FW_Loader' ) ) {
252
  * @return string The premium landing link
253
  */
254
  public function get_premium_landing_uri() {
255
- return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
256
  }
257
 
258
  //region **** licence related methods ****
252
  * @return string The premium landing link
253
  */
254
  public function get_premium_landing_uri() {
255
+ return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing . '?refer_id=1030585';
256
  }
257
 
258
  //region **** licence related methods ****
modules/yith-woocommerce-zoom-magnifier/plugin-options/general-options.php CHANGED
@@ -13,8 +13,8 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  } // Exit if accessed directly
14
 
15
  $image_size = array(
16
- 'name' => __( 'Image size', 'yit' ),
17
- 'desc' => __( 'The size of the images used within the magnifier box', 'yit' ),
18
  'id' => 'woocommerce_magnifier_image',
19
  'css' => '',
20
  'type' => 'yith_ywzm_image_width',
@@ -33,29 +33,31 @@ $image_size = array(
33
 
34
  $general_settings = array(
35
  array(
36
- 'name' => __( 'General Settings', 'yit' ),
37
  'type' => 'title',
38
  'desc' => '',
39
  'id' => 'yith_wcmg_general'
40
  ),
41
  array(
42
- 'name' => __( 'Activate YITH Magnifier', 'yit' ),
43
- 'desc' => __( 'Activate the plugin or use the WooCommerce default product image.', 'yit' ),
44
  'id' => 'yith_wcmg_enable_plugin',
45
  'std' => 'yes',
46
  'default' => 'yes',
47
  'type' => 'checkbox'
48
  ),
49
  array(
50
- 'name' => __( 'Activate the plugin on mobile device', 'yit' ),
 
 
51
  'id' => 'yith_wcmg_enable_mobile',
52
  'std' => 'yes',
53
  'default' => 'yes',
54
  'type' => 'checkbox'
55
  ),
56
  array(
57
- 'name' => __( 'Forced Image Size', 'yit' ),
58
- 'desc' => __( 'If disabled, you will able to customize the sizes of the zoomed images. Disable it at your own risk; the magnifier could not properly work with images out of proportion.', 'yit' ),
59
  'id' => 'yith_wcmg_force_sizes',
60
  'std' => 'yes',
61
  'default' => 'yes',
@@ -69,22 +71,22 @@ $general_settings = array(
69
 
70
  $magnifier_settings = array(
71
  array(
72
- 'name' => __( 'Magnifier Settings', 'yit' ),
73
  'type' => 'title',
74
  'desc' => '',
75
  'id' => 'yith_wcmg_magnifier'
76
  ),
77
  'zoom_box_width' => array(
78
- 'name' => __( 'Zoom Box Width', 'yit' ),
79
- 'desc' => __( 'The width of the magnifier box (default: auto)', 'yit' ),
80
  'id' => 'yith_wcmg_zoom_width',
81
  'std' => 'auto',
82
  'default' => 'auto',
83
  'type' => 'text',
84
  ),
85
  array(
86
- 'name' => __( 'Zoom Box Height', 'yit' ),
87
- 'desc' => __( 'The height of the magnifier box (default: auto)', 'yit' ),
88
  'id' => 'yith_wcmg_zoom_height',
89
  'std' => 'auto',
90
  'default' => 'auto',
@@ -92,40 +94,40 @@ $magnifier_settings = array(
92
  ),
93
  $image_size,
94
  'zoom_box_position' => array(
95
- 'name' => __( 'Zoom Box Position', 'yit' ),
96
- 'desc' => __( 'The magnifier position', 'yit' ),
97
  'id' => 'yith_wcmg_zoom_position',
98
  'std' => 'right',
99
  'default' => 'right',
100
  'type' => 'select',
101
  'options' => array(
102
- 'right' => __( 'Right', 'yit' ),
103
- 'inside' => __( 'Inside', 'yit' )
104
  )
105
  ),
106
  array(
107
- 'name' => __( 'Zoom Box Position for mobile devices', 'yit' ),
108
- 'desc' => __( 'The magnifier position for the mobile devices (iPhone, Android, etc.)', 'yit' ),
109
  'id' => 'yith_wcmg_zoom_mobile_position',
110
  'std' => 'default',
111
  'default' => 'inside',
112
  'type' => 'select',
113
  'options' => array(
114
- 'default' => __( 'Default', 'yit' ),
115
- 'inside' => __( 'Inside', 'yit' ),
116
- 'disable' => __( 'Disable', 'yit' )
117
  )
118
  ),
119
  array(
120
- 'name' => __( 'Loading label', 'yit' ),
121
  'desc' => '',
122
  'id' => 'yith_wcmg_loading_label',
123
- 'std' => __( 'Loading...', 'yit' ),
124
- 'default' => __( 'Loading...', 'yit' ),
125
  'type' => 'text',
126
  ),
127
  array(
128
- 'name' => __( 'Lens Opacity', 'yit' ),
129
  'desc' => '',
130
  'id' => 'yith_wcmg_lens_opacity',
131
  'std' => 0.5,
@@ -136,8 +138,8 @@ $magnifier_settings = array(
136
  'step' => .1
137
  ),
138
  array(
139
- 'name' => __( 'Blur', 'yit' ),
140
- 'desc' => __( 'Add a blur effect to the small image on mouse hover.', 'yit' ),
141
  'id' => 'yith_wcmg_softfocus',
142
  'std' => 'no',
143
  'default' => 'no',
@@ -148,30 +150,30 @@ $magnifier_settings = array(
148
 
149
  $slider_settings = array(
150
  array(
151
- 'name' => __( 'Slider Settings', 'yit' ),
152
  'type' => 'title',
153
  'desc' => '',
154
  'id' => 'yith_wcmg_slider'
155
  ),
156
  array(
157
- 'name' => __( 'Activate Slider', 'yit' ),
158
- 'desc' => __( 'Activate Thumbnail Slider.', 'yit' ),
159
  'id' => 'yith_wcmg_enableslider',
160
  'std' => 'yes',
161
  'default' => 'yes',
162
  'type' => 'checkbox'
163
  ),
164
  array(
165
- 'name' => __( 'Activate Responsive Slider', 'yit' ),
166
- 'desc' => __( 'This option fits the thumbnails within the available space. Disable it if you want to manage freely the thumbnails (eg. add margins, paddings, etc.)', 'yit' ),
167
  'id' => 'yith_wcmg_slider_responsive',
168
  'std' => 'yes',
169
  'default' => 'yes',
170
  'type' => 'checkbox'
171
  ),
172
  array(
173
- 'name' => __( 'Items', 'yit' ),
174
- 'desc' => __( 'Number of items to show', 'yit' ),
175
  'id' => 'yith_wcmg_slider_items',
176
  'std' => 3,
177
  'default' => 3,
@@ -181,16 +183,16 @@ $slider_settings = array(
181
  'step' => 1
182
  ),
183
  array(
184
- 'name' => __( 'Circular carousel', 'yit' ),
185
- 'desc' => __( 'It defines whether the carousel should be circular.', 'yit' ),
186
  'id' => 'yith_wcmg_slider_circular',
187
  'std' => 'yes',
188
  'default' => 'yes',
189
  'type' => 'checkbox'
190
  ),
191
  array(
192
- 'name' => __( 'Infinite carousel', 'yit' ),
193
- 'desc' => __( 'It defines whether the carousel should be infinite. Note: It is possible to create a non-circular, infinite carousel, but it is not possible to create a circular, non-infinite carousel.', 'yit' ),
194
  'id' => 'yith_wcmg_slider_infinite',
195
  'std' => 'yes',
196
  'default' => 'yes',
@@ -208,19 +210,19 @@ $options['general'] = array();
208
  if ( ! defined( 'YITH_YWZM_PREMIUM' ) ) {
209
  $intro_tab = array(
210
  'section_general_settings_videobox' => array(
211
- 'name' => __( 'Upgrade to the PREMIUM VERSION', 'yit' ),
212
  'type' => 'videobox',
213
  'default' => array(
214
- 'plugin_name' => __( 'YITH WooCommerce Zoom Magnifier', 'yit' ),
215
- 'title_first_column' => __( 'Discover The Advanced Features', 'yit' ),
216
- 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit from all features!', 'yit' ),
217
  'video' => array(
218
  'video_id' => '122436840',
219
- 'video_image_url' => YITH_YWZM_ASSETS_IMAGES_URL . 'yith-woocommerce-zoom-magnifier.jpg',
220
- 'video_description' => __( 'See YITH WooCommerce Zoom Magnifier plugin with full premium features in action', 'yit' ),
221
  ),
222
- 'title_second_column' => __( 'Get Support and Pro Features', 'yit' ),
223
- 'description_second_column' => __( 'Purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'yit' ),
224
  'button' => array(
225
  'href' => YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(),
226
  'title' => 'Get Support and Pro Features'
@@ -235,5 +237,4 @@ if ( ! defined( 'YITH_YWZM_PREMIUM' ) ) {
235
 
236
  $options['general'] = array_merge( $options['general'], $general_settings, $magnifier_settings, $slider_settings );
237
 
238
- return apply_filters( 'yith_wcmg_tab_options', $options );
239
-
13
  } // Exit if accessed directly
14
 
15
  $image_size = array(
16
+ 'name' => __( 'Image size', 'ywzm' ),
17
+ 'desc' => __( 'The size of the images used within the magnifier box', 'ywzm' ),
18
  'id' => 'woocommerce_magnifier_image',
19
  'css' => '',
20
  'type' => 'yith_ywzm_image_width',
33
 
34
  $general_settings = array(
35
  array(
36
+ 'name' => __( 'General Settings', 'ywzm' ),
37
  'type' => 'title',
38
  'desc' => '',
39
  'id' => 'yith_wcmg_general'
40
  ),
41
  array(
42
+ 'name' => __( 'Activate YITH WooCommerce Zoom Magnifier', 'ywzm' ),
43
+ 'desc' => __( 'Activate the plugin or use the WooCommerce default product image.', 'ywzm' ),
44
  'id' => 'yith_wcmg_enable_plugin',
45
  'std' => 'yes',
46
  'default' => 'yes',
47
  'type' => 'checkbox'
48
  ),
49
  array(
50
+ 'name' => __( 'Activate on mobile device', 'ywzm' ),
51
+ 'desc' => __( 'Set if zoom and slider functionalities should be shown also on mobile devices.', 'ywzm' ),
52
+
53
  'id' => 'yith_wcmg_enable_mobile',
54
  'std' => 'yes',
55
  'default' => 'yes',
56
  'type' => 'checkbox'
57
  ),
58
  array(
59
+ 'name' => __( 'Forced Image Size', 'ywzm' ),
60
+ 'desc' => __( 'If disabled, you will able to customize the sizes of the zoomed images. Disable it at your own risk; the magnifier could not properly work with images out of proportion.', 'ywzm' ),
61
  'id' => 'yith_wcmg_force_sizes',
62
  'std' => 'yes',
63
  'default' => 'yes',
71
 
72
  $magnifier_settings = array(
73
  array(
74
+ 'name' => __( 'Magnifier Settings', 'ywzm' ),
75
  'type' => 'title',
76
  'desc' => '',
77
  'id' => 'yith_wcmg_magnifier'
78
  ),
79
  'zoom_box_width' => array(
80
+ 'name' => __( 'Zoom Box Width', 'ywzm' ),
81
+ 'desc' => __( 'The width of the magnifier box (default: auto)', 'ywzm' ),
82
  'id' => 'yith_wcmg_zoom_width',
83
  'std' => 'auto',
84
  'default' => 'auto',
85
  'type' => 'text',
86
  ),
87
  array(
88
+ 'name' => __( 'Zoom Box Height', 'ywzm' ),
89
+ 'desc' => __( 'The height of the magnifier box (default: auto)', 'ywzm' ),
90
  'id' => 'yith_wcmg_zoom_height',
91
  'std' => 'auto',
92
  'default' => 'auto',
94
  ),
95
  $image_size,
96
  'zoom_box_position' => array(
97
+ 'name' => __( 'Zoom Box Position', 'ywzm' ),
98
+ 'desc' => __( 'The magnifier position', 'ywzm' ),
99
  'id' => 'yith_wcmg_zoom_position',
100
  'std' => 'right',
101
  'default' => 'right',
102
  'type' => 'select',
103
  'options' => array(
104
+ 'right' => __( 'Right', 'ywzm' ),
105
+ 'inside' => __( 'Inside', 'ywzm' )
106
  )
107
  ),
108
  array(
109
+ 'name' => __( 'Zoom Box Position for mobile devices', 'ywzm' ),
110
+ 'desc' => __( 'The magnifier position for the mobile devices (iPhone, Android, etc.)', 'ywzm' ),
111
  'id' => 'yith_wcmg_zoom_mobile_position',
112
  'std' => 'default',
113
  'default' => 'inside',
114
  'type' => 'select',
115
  'options' => array(
116
+ 'default' => __( 'Default', 'ywzm' ),
117
+ 'inside' => __( 'Inside', 'ywzm' ),
118
+ 'disable' => __( 'Disable', 'ywzm' )
119
  )
120
  ),
121
  array(
122
+ 'name' => __( 'Loading label', 'ywzm' ),
123
  'desc' => '',
124
  'id' => 'yith_wcmg_loading_label',
125
+ 'std' => __( 'Loading...', 'ywzm' ),
126
+ 'default' => __( 'Loading...', 'ywzm' ),
127
  'type' => 'text',
128
  ),
129
  array(
130
+ 'name' => __( 'Lens Opacity', 'ywzm' ),
131
  'desc' => '',
132
  'id' => 'yith_wcmg_lens_opacity',
133
  'std' => 0.5,
138
  'step' => .1
139
  ),
140
  array(
141
+ 'name' => __( 'Blur', 'ywzm' ),
142
+ 'desc' => __( 'Add a blur effect to the small image on mouse hover.', 'ywzm' ),
143
  'id' => 'yith_wcmg_softfocus',
144
  'std' => 'no',
145
  'default' => 'no',
150
 
151
  $slider_settings = array(
152
  array(
153
+ 'name' => __( 'Slider Settings', 'ywzm' ),
154
  'type' => 'title',
155
  'desc' => '',
156
  'id' => 'yith_wcmg_slider'
157
  ),
158
  array(
159
+ 'name' => __( 'Activate Slider', 'ywzm' ),
160
+ 'desc' => __( 'Activate Thumbnail Slider.', 'ywzm' ),
161
  'id' => 'yith_wcmg_enableslider',
162
  'std' => 'yes',
163
  'default' => 'yes',
164
  'type' => 'checkbox'
165
  ),
166
  array(
167
+ 'name' => __( 'Activate Responsive Slider', 'ywzm' ),
168
+ 'desc' => __( 'This option fits the thumbnails within the available space. Disable it if you want to manage freely the thumbnails (eg. add margins, paddings, etc.)', 'ywzm' ),
169
  'id' => 'yith_wcmg_slider_responsive',
170
  'std' => 'yes',
171
  'default' => 'yes',
172
  'type' => 'checkbox'
173
  ),
174
  array(
175
+ 'name' => __( 'Items', 'ywzm' ),
176
+ 'desc' => __( 'Number of items to show', 'ywzm' ),
177
  'id' => 'yith_wcmg_slider_items',
178
  'std' => 3,
179
  'default' => 3,
183
  'step' => 1
184
  ),
185
  array(
186
+ 'name' => __( 'Circular carousel', 'ywzm' ),
187
+ 'desc' => __( 'It defines whether the carousel should be circular.', 'ywzm' ),
188
  'id' => 'yith_wcmg_slider_circular',
189
  'std' => 'yes',
190
  'default' => 'yes',
191
  'type' => 'checkbox'
192
  ),
193
  array(
194
+ 'name' => __( 'Infinite carousel', 'ywzm' ),
195
+ 'desc' => __( 'It defines whether the carousel should be infinite. Note: It is possible to create a non-circular, infinite carousel, but it is not possible to create a circular, non-infinite carousel.', 'ywzm' ),
196
  'id' => 'yith_wcmg_slider_infinite',
197
  'std' => 'yes',
198
  'default' => 'yes',
210
  if ( ! defined( 'YITH_YWZM_PREMIUM' ) ) {
211
  $intro_tab = array(
212
  'section_general_settings_videobox' => array(
213
+ 'name' => __( 'Upgrade to the PREMIUM VERSION', 'ywzm' ),
214
  'type' => 'videobox',
215
  'default' => array(
216
+ 'plugin_name' => __( 'YITH WooCommerce Zoom Magnifier', 'ywzm' ),
217
+ 'title_first_column' => __( 'Discover The Advanced Features', 'ywzm' ),
218
+ 'description_first_column' => __( 'Upgrade to the PREMIUM VERSION of YITH WOOCOMMERCE ZOOM MAGNIFIER to benefit from all features!', 'ywzm' ),
219
  'video' => array(
220
  'video_id' => '122436840',
221
+ 'video_image_url' => YITH_YWZM_ASSETS_IMAGES_URL . 'yith-woocommerce-zoom-magnifier-video.jpg',
222
+ 'video_description' => __( 'See YITH WooCommerce Zoom Magnifier plugin with full premium features in action', 'ywzm' ),
223
  ),
224
+ 'title_second_column' => __( 'Get Support and Pro Features', 'ywzm' ),
225
+ 'description_second_column' => __( 'Purchasing the premium version of the plugin, you will take advantage of the advanced features of the product, and you will get one year of free updates and support through our platform available 24h/24.', 'ywzm' ),
226
  'button' => array(
227
  'href' => YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(),
228
  'title' => 'Get Support and Pro Features'
237
 
238
  $options['general'] = array_merge( $options['general'], $general_settings, $magnifier_settings, $slider_settings );
239
 
240
+ return apply_filters( 'yith_wcmg_tab_options', $options );
 
modules/yith-woocommerce-zoom-magnifier/templates/admin/premium.php CHANGED
@@ -190,18 +190,16 @@
190
  <div class="landing-container">
191
  <div class="premium-cta">
192
  <p>
193
- Upgrade to the <span class="highlight">premium version</span>
194
- of <span class="highlight">YITH WooCommerce Zoom Magnifier</span> to benefit from all features!
195
  </p>
196
  <a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
197
- <span class="highlight">UPGRADE</span>
198
- <span>to the premium version</span>
199
  </a>
200
  </div>
201
  </div>
202
  </div>
203
  <div class="section section-even clear" style="background: url(<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-bg.png) no-repeat #fff; background-position: 85% 75%">
204
- <h1>Premium Features</h1>
205
  <div class="landing-container">
206
  <div class="col-1">
207
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01.png" alt="Review Title" />
@@ -209,9 +207,11 @@
209
  <div class="col-2">
210
  <div class="section-title">
211
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-icon.png" alt="Review Title"/>
212
- <h2>ZOOM BOX POSITION</h2>
213
  </div>
214
- <p>Choose where you want to show the zoomed version of the image of your products. Place it above or below the original image, on its left or its right, or you can even place it over it.</p>
 
 
215
  </div>
216
  </div>
217
  </div>
@@ -220,9 +220,9 @@
220
  <div class="col-2">
221
  <div class="section-title">
222
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02-icon.png" alt="Attachment List" />
223
- <h2>ENLARGE THE IMAGES</h2>
224
  </div>
225
- <p>Just one click and the product image will appear in a bigger size in a modal window. A further chance to let users analyze in a better way what you sell.</p>
226
  </div>
227
  <div class="col-1">
228
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02.png" alt="Attachment List" />
@@ -237,9 +237,9 @@
237
  <div class="col-2">
238
  <div class="section-title">
239
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>03-icon.png" alt="Vote the review" />
240
- <h2>EXCLUDE PRODUCTS</h2>
241
  </div>
242
- <p>Tailored options to limit the plugin features only to certain products. Some of these could have too small images to be zoomed, or maybe being part of categories that do not imply zoomed images. Select the products and the categories to exclude and delete all your problems.</p>
243
  </div>
244
  </div>
245
  </div>
@@ -248,12 +248,10 @@
248
  <div class="landing-container">
249
  <div class="premium-cta">
250
  <p>
251
- Upgrade to the <span class="highlight">premium version</span>
252
- of <span class="highlight">YITH WooCommerce Zoom Magnifier</span> to benefit from all features!
253
  </p>
254
  <a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
255
- <span class="highlight">UPGRADE</span>
256
- <span>to the premium version</span>
257
  </a>
258
  </div>
259
  </div>
190
  <div class="landing-container">
191
  <div class="premium-cta">
192
  <p>
193
+ <?php echo sprintf(__('Upgrade to the %1$s premium version %2$s of %1$s YITH WooCommerce Zoom Magnifier %2$s to benefit from all features!','ywzm'),'<span class="highlight">','</span>' );?>
 
194
  </p>
195
  <a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
196
+ <?php echo sprintf(__('%1$sUPGRADE%2$s%3$sto the premium version%2$s','ywzm'),'<span class="highlight">','</span>','<span>');?>
 
197
  </a>
198
  </div>
199
  </div>
200
  </div>
201
  <div class="section section-even clear" style="background: url(<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-bg.png) no-repeat #fff; background-position: 85% 75%">
202
+ <?php echo sprintf(__('%1$sPremium Features%2$s','ywzm'),'<h1>','</h1>');?>
203
  <div class="landing-container">
204
  <div class="col-1">
205
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01.png" alt="Review Title" />
207
  <div class="col-2">
208
  <div class="section-title">
209
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>01-icon.png" alt="Review Title"/>
210
+ <h2><?php _e('ZOOM BOX POSITION','ywzm');?></h2>
211
  </div>
212
+ <p>
213
+ <?php echo sprintf(__('Choose where you want to show the %1$szoomed version%2$s of the image of your products. Place it above or below the original image, on its left or its right, or you can even place it over it.$2$s','ywzm'),'<b>','</b>');?>
214
+ </p>
215
  </div>
216
  </div>
217
  </div>
220
  <div class="col-2">
221
  <div class="section-title">
222
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02-icon.png" alt="Attachment List" />
223
+ <h2><?php _e('ENLARGE THE IMAGES','ywzm');?></h2>
224
  </div>
225
+ <p><?php _e('Just one click and the product image will appear in a bigger size in a modal window. A further chance to let users analyze in a better way what you sell.','ywzm');?></p>
226
  </div>
227
  <div class="col-1">
228
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>02.png" alt="Attachment List" />
237
  <div class="col-2">
238
  <div class="section-title">
239
  <img src="<?php echo YITH_YWZM_ASSETS_IMAGES_URL ?>03-icon.png" alt="Vote the review" />
240
+ <h2><?php _e('EXCLUDE PRODUCTS','ywzm');?></h2>
241
  </div>
242
+ <p><?php _e('Tailored options to limit the plugin features only to certain products. Some of these could have too small images to be zoomed, or maybe being part of categories that do not imply zoomed images. Select the products and the categories to exclude and delete all your problems','ywzm');?></p>
243
  </div>
244
  </div>
245
  </div>
248
  <div class="landing-container">
249
  <div class="premium-cta">
250
  <p>
251
+ <?php echo sprintf(__('Upgrade to the %1$spremium version%2$s of %1$sYITH WooCommerce Zoom Magnifier%2$s to benefit from all features!','ywzm'),'<span class="highlight">','</span>');?>
 
252
  </p>
253
  <a href="<?php echo YITH_YWZM_Plugin_FW_Loader::get_instance()->get_premium_landing_uri(); ?>" target="_blank" class="premium-cta-button button btn">
254
+ <?php echo sprintf(__('%1$sUPGRADE%2$s %3$sto the premium version%2$s','ywzm'),'<span class="highlight">','</span>','<span>');?>
 
255
  </a>
256
  </div>
257
  </div>
modules/yith-woocommerce-zoom-magnifier/templates/single-product/product-thumbnails-magnifier.php CHANGED
@@ -14,8 +14,12 @@ global $post, $product, $woocommerce;
14
  $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
15
 
16
  $attachment_ids = $product->get_gallery_attachment_ids();
 
17
  if ( ! empty( $attachment_ids ) ) array_unshift( $attachment_ids, get_post_thumbnail_id() );
18
 
 
 
 
19
  if ( $attachment_ids ) {
20
  ?>
21
  <div class="thumbnails <?php echo $enable_slider ? 'slider' : 'noslider' ?>">
14
  $enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
15
 
16
  $attachment_ids = $product->get_gallery_attachment_ids();
17
+
18
  if ( ! empty( $attachment_ids ) ) array_unshift( $attachment_ids, get_post_thumbnail_id() );
19
 
20
+ // make sure attachments ids are unique
21
+ $attachment_ids = array_unique($attachment_ids);
22
+
23
  if ( $attachment_ids ) {
24
  ?>
25
  <div class="thumbnails <?php echo $enable_slider ? 'slider' : 'noslider' ?>">
modules/yith-woocommerce-zoom-magnifier/yit-common/yith-panel.php CHANGED
@@ -287,15 +287,9 @@ if ( ! class_exists( 'YITH_Panel' ) ) {
287
  * @access protected
288
  */
289
  public function _get_tab() {
290
- if ( isset( $_POST['panel_page'] ) && $_POST['panel_page'] != '' ) {
291
- return $_POST['panel_page'];
292
- } elseif ( isset( $_GET['panel_page'] ) && $_GET['panel_page'] != '' ) {
293
- return $_GET['panel_page'];
294
- } else {
295
- $tabs = array_keys( $this->options );
296
-
297
- return $tabs[0];
298
- }
299
  }
300
 
301
  /**
287
  * @access protected
288
  */
289
  public function _get_tab() {
290
+ $panel_page = ! empty( $_REQUEST['panel_page'] ) ? sanitize_title_for_query( $_REQUEST['panel_page'] ) : '';
291
+ $tabs = array_keys( $this->options );
292
+ return ! empty( $panel_page ) ? $panel_page : $tabs[0];
 
 
 
 
 
 
293
  }
294
 
295
  /**
plugin-fw/assets/js/yit-cpt-unlimited.js CHANGED
@@ -12,7 +12,7 @@
12
  // Author code here
13
 
14
  // open media box
15
- $('.wrap h2').on( 'click', 'a.multi-uploader', function(event){
16
  event.preventDefault();
17
 
18
  var file_frame,
12
  // Author code here
13
 
14
  // open media box
15
+ $('.wrap h1, .wrap h2').on( 'click', 'a.multi-uploader', function(event){
16
  event.preventDefault();
17
 
18
  var file_frame,
plugin-fw/assets/js/yit-cpt-unlimited.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(c){c(".wrap h2").on("click","a.multi-uploader",function(f){f.preventDefault();var a,b=c(this),d=!1;b.next("span.spinner").css("display","inline-block");a||(a=wp.media.frames.file_frame=wp.media({title:b.data("uploader_title"),button:{text:b.data("uploader_button_text")},library:{type:"image"},multiple:!0}),a.on("select",function(){var e=[];a.state().get("selection").map(function(a){a=a.toJSON();e.push({id:a.id,url:a.url,title:a.title})});c.post(ajaxurl,{images:e,post_type:typenow,action:"yit_cptu_multiuploader"},
2
  function(a){location.reload()});b.next("span.spinner").css("display","inline-block");d=!0}),a.on("close",function(){d||b.next("span.spinner").hide()}));a.open()})})(jQuery);
1
+ (function(c){c(".wrap h1, .wrap h2").on("click","a.multi-uploader",function(f){f.preventDefault();var a,b=c(this),d=!1;b.next("span.spinner").css("display","inline-block");a||(a=wp.media.frames.file_frame=wp.media({title:b.data("uploader_title"),button:{text:b.data("uploader_button_text")},library:{type:"image"},multiple:!0}),a.on("select",function(){var e=[];a.state().get("selection").map(function(a){a=a.toJSON();e.push({id:a.id,url:a.url,title:a.title})});c.post(ajaxurl,{images:e,post_type:typenow,action:"yit_cptu_multiuploader"},
2
  function(a){location.reload()});b.next("span.spinner").css("display","inline-block");d=!0}),a.on("close",function(){d||b.next("span.spinner").hide()}));a.open()})})(jQuery);
plugin-fw/lib/yit-cpt-unlimited.php CHANGED
@@ -1637,7 +1637,7 @@ class YIT_CPT_Unlimited {
1637
  style: 'float: none;'
1638
  });
1639
 
1640
- button.appendTo('.wrap h2').after(spinner);
1641
 
1642
  })(jQuery);
1643
  </script>
1637
  style: 'float: none;'
1638
  });
1639
 
1640
+ button.appendTo('.wrap h2, .wrap h1').after(spinner);
1641
 
1642
  })(jQuery);
1643
  </script>
plugin-fw/lib/yit-video.php CHANGED
@@ -57,7 +57,7 @@ if ( ! class_exists( 'YIT_Video' ) ) {
57
  return;
58
  }
59
 
60
- if( ! $echo ) ob_start();
61
 
62
  $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
63
  $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
@@ -67,7 +67,11 @@ if ( ! class_exists( 'YIT_Video' ) ) {
67
  </div>
68
 
69
  <?php
70
- if( ! $echo ) return ob_get_clean();
 
 
 
 
71
  }
72
 
73
  /**
@@ -97,7 +101,7 @@ if ( ! class_exists( 'YIT_Video' ) ) {
97
  $id = self::video_id_by_url( $url );
98
  }
99
 
100
- if( ! $echo ) ob_start();
101
 
102
  $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
103
  $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
@@ -107,7 +111,11 @@ if ( ! class_exists( 'YIT_Video' ) ) {
107
  </div>
108
 
109
  <?php
110
- if( ! $echo ) return ob_get_clean();
 
 
 
 
111
  }
112
 
113
  /**
57
  return;
58
  }
59
 
60
+ ob_start();
61
 
62
  $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
63
  $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
67
  </div>
68
 
69
  <?php
70
+ $html = apply_filters( 'yit_video_youtube', ob_get_clean() );
71
+
72
+ if( $echo ) echo $html;
73
+
74
+ return $html;
75
  }
76
 
77
  /**
101
  $id = self::video_id_by_url( $url );
102
  }
103
 
104
+ ob_start();
105
 
106
  $id = preg_replace( '/[&|&amp;]feature=([\w\-]*)/', '', $id );
107
  $id = preg_replace( '/(youtube|vimeo):/', '', $id ); ?>
111
  </div>
112
 
113
  <?php
114
+ $html = apply_filters( 'yit_video_vimeo', ob_get_clean() );
115
+
116
+ if( $echo ) echo $html;
117
+
118
+ return $html;
119
  }
120
 
121
  /**
plugin-fw/yit-functions.php CHANGED
@@ -634,9 +634,14 @@ if ( ! function_exists( 'yit_check_plugin_support' ) ) {
634
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
635
  */
636
  function yit_check_plugin_support() {
 
637
  $headers['core'] = wp_get_theme()->get( 'Core Framework Version' );
638
  $headers['author'] = wp_get_theme()->get( 'Author' );
639
 
 
 
 
 
640
  if ( ( ! empty( $headers['core'] ) && version_compare( $headers['core'], '2.0.0', '<=' ) ) || $headers['author'] != 'Your Inspiration Themes' ) {
641
  return true;
642
  }
634
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
635
  */
636
  function yit_check_plugin_support() {
637
+
638
  $headers['core'] = wp_get_theme()->get( 'Core Framework Version' );
639
  $headers['author'] = wp_get_theme()->get( 'Author' );
640
 
641
+ if( ! $headers['core'] && defined( 'YIT_CORE_VERSION' ) ) {
642
+ $headers['core'] = YIT_CORE_VERSION;
643
+ }
644
+
645
  if ( ( ! empty( $headers['core'] ) && version_compare( $headers['core'], '2.0.0', '<=' ) ) || $headers['author'] != 'Your Inspiration Themes' ) {
646
  return true;
647
  }
templates/yith-single-plugin.php CHANGED
@@ -68,7 +68,7 @@ else {
68
  $active_class = '';
69
  }
70
 
71
- $action_links[] = '<a class="activate-now button '.$active_class.'" data-slug="' . $plugin['slug'] . '" href="' . $url . '" aria-label="' . sprintf( __( 'activate %s now', 'yith-jetpack' ), $plugin['slug'] ) . '" data-name="' . $plugin['name'] . '">' . __( 'Activate', 'yith-jetpack' ) . '</a>';
72
  }
73
 
74
  if( ! $is_yith_repository ) {
68
  $active_class = '';
69
  }
70
 
71
+ $action_links[] = '<a class="activate-now button '.$active_class.'" data-slug="' . $plugin['slug'] . '" href="' . $url . '" aria-label="' . sprintf( __( 'activate %s now', 'yith-jetpack' ), $plugin['slug'] ) . '" data-name="' . $plugin['name'] . '" target="_blank">' . __( 'Activate', 'yith-jetpack' ) . '</a>';
72
  }
73
 
74
  if( ! $is_yith_repository ) {
yith-jetpack.php CHANGED
@@ -18,6 +18,8 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
18
 
19
  const MODULES_LIST_QUERY_VALUE = 'yith-jetpack-modules';
20
 
 
 
21
  /** @var array plugin path */
22
  protected $_plugin_path = '';
23
 
@@ -25,6 +27,14 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
25
 
26
  protected $_activate_module_option_name = null;
27
 
 
 
 
 
 
 
 
 
28
  /** @var array All modules to active */
29
  protected $_modules = null;
30
 
@@ -41,7 +51,12 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
41
  $this->_plugin_path = $path;
42
  $this->_menu_title = $title;
43
  $this->_activate_module_option_name = self::ACTIVATED_MODULES_OPTION_BASE_NAME.$index;
 
 
 
 
44
 
 
45
  $this->plugin_fw_loader();
46
  $this->load_modules();
47
 
@@ -53,6 +68,7 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
53
  add_action( 'admin_init', array( $this, 'deactivate_module_action' ) );
54
  add_action( 'admin_init', array( $this, 'deactivate_modules_after_premium_installed' ) );
55
  add_action( 'activate_plugin', array( $this, 'deactivate_modules_after_premium_installed' ) );
 
56
  add_action( 'admin_menu', array( $this, 'add_admin_modules_page' ), 100 );
57
 
58
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
@@ -65,6 +81,104 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
65
  'action_links'
66
  ) );
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
  /**
@@ -97,7 +211,7 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
97
  */
98
  public function action_links( $links ) {
99
 
100
- $links[] = '<a href="' . esc_url( admin_url( "admin.php?page=".self::MODULES_LIST_QUERY_VALUE ) ) . '">' . __( 'Plugins List', 'yith-jetpack' ) . '</a>';
101
 
102
  return $links;
103
  }
@@ -412,15 +526,21 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
412
  $title .= '<span class="awaiting-mod count-2"><span class="pending-count">'.( $new_plugins_count ).'</span></span>';
413
  }
414
 
415
- add_submenu_page( 'yit_plugin_panel', $title, $title, 'install_plugins', self::MODULES_LIST_QUERY_VALUE, array( $this, 'admin_modules_page' ) );
416
  }
417
 
418
  public function get_new_added_plugin(){
419
  $modules = $this->get_modules();
420
  $modules_count = count( $modules );
421
- $modules_inserted_count = count( get_option( self::MODULE_LIST_OPTION_NAME , array() ) );
 
 
 
 
422
 
423
- return $modules_count - $modules_inserted_count;
 
 
424
  }
425
 
426
  /**
@@ -428,14 +548,13 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
428
  *
429
  */
430
  function new_added_plugin_admin_notice() {
431
- global $wp_db_version;
432
  if ( !is_super_admin() )
433
  return false;
434
 
435
  $new_plugins_count = $this->get_new_added_plugin();
436
 
437
  if( $new_plugins_count > 0 ) {
438
- echo "<div class='update-nag'>" . sprintf( __( 'There are new plugins available on <b>%s</b>, <a href="%s">take a look at them</a> !' , 'yith-jetpack' ), $this->_menu_title, esc_url( admin_url( "admin.php?page=".self::MODULES_LIST_QUERY_VALUE."&plugin_status=inactive" ) ) ) . "</div>";
439
  }
440
  }
441
 
@@ -475,7 +594,7 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
475
  * @since 1.0.0
476
  */
477
  public function activate_module_action() {
478
- if ( empty( $_GET['page'] ) || $_GET['page'] != self::MODULES_LIST_QUERY_VALUE || ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'activate-yit-plugin' ) ) {
479
  return;
480
  }
481
 
@@ -507,7 +626,7 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
507
  * @since 1.0.0
508
  */
509
  public function deactivate_module_action() {
510
- if ( empty( $_GET['page'] ) || $_GET['page'] != self::MODULES_LIST_QUERY_VALUE || ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'deactivate-yit-plugin' ) ) {
511
  return;
512
  }
513
 
@@ -539,7 +658,7 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
539
  * @since 1.0.0
540
  */
541
  public function deactivate_singular_plugins() {
542
- if ( get_option( self::DEACTIVATED_PLUGIN_OPTION_NAME ) ) {
543
  return;
544
  }
545
 
@@ -556,7 +675,7 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
556
  }
557
  }
558
 
559
- update_option( self::DEACTIVATED_PLUGIN_OPTION_NAME, true );
560
 
561
  wp_safe_redirect( wp_unslash( $_SERVER['REQUEST_URI'] ) );
562
  exit();
@@ -572,7 +691,7 @@ if ( ! class_exists( 'YITH_JetPack' ) ) {
572
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
573
  */
574
  public function admin_enqueue_scripts() {
575
- if( isset($_GET['page']) && $_GET['page']=='yith-jetpack-modules') {
576
  wp_enqueue_style( 'yit-layout', YJP_ASSETS_URL . '/css/list-layout.css' );
577
  }
578
  }
18
 
19
  const MODULES_LIST_QUERY_VALUE = 'yith-jetpack-modules';
20
 
21
+ const PLUGIN_LIST_HIDE_NOTICE_OPTION_NAME = 'yith_jetpack_m_hide_notice';
22
+
23
  /** @var array plugin path */
24
  protected $_plugin_path = '';
25
 
27
 
28
  protected $_activate_module_option_name = null;
29
 
30
+ protected $_deactivated_plugin_option_name = null;
31
+
32
+ protected $_module_list_option_name = null;
33
+
34
+ protected $_modules_list_query_value = null;
35
+
36
+ protected $_plugin_list_hide_notice_option_name = null;
37
+
38
  /** @var array All modules to active */
39
  protected $_modules = null;
40
 
51
  $this->_plugin_path = $path;
52
  $this->_menu_title = $title;
53
  $this->_activate_module_option_name = self::ACTIVATED_MODULES_OPTION_BASE_NAME.$index;
54
+ $this->_deactivated_plugin_option_name = self::DEACTIVATED_PLUGIN_OPTION_NAME.$index;
55
+ $this->_module_list_option_name = self::MODULE_LIST_OPTION_NAME.$index;
56
+ $this->_modules_list_query_value = self::MODULES_LIST_QUERY_VALUE.$index;
57
+ $this->_plugin_list_hide_notice_option_name = self::PLUGIN_LIST_HIDE_NOTICE_OPTION_NAME.$index;
58
 
59
+ $this->load_plugin_textdomain();
60
  $this->plugin_fw_loader();
61
  $this->load_modules();
62
 
68
  add_action( 'admin_init', array( $this, 'deactivate_module_action' ) );
69
  add_action( 'admin_init', array( $this, 'deactivate_modules_after_premium_installed' ) );
70
  add_action( 'activate_plugin', array( $this, 'deactivate_modules_after_premium_installed' ) );
71
+ add_action( 'deactivate_plugin', array( $this, 'reset_yith_jetpack_option' ) );
72
  add_action( 'admin_menu', array( $this, 'add_admin_modules_page' ), 100 );
73
 
74
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
81
  'action_links'
82
  ) );
83
 
84
+ // filter list of plugin
85
+ add_filter( 'all_plugins', array( $this, 'remove_modules' ), 10, 1 );
86
+ // add notice
87
+ add_action( 'admin_notices', array( $this, 'notice' ), 20 );
88
+ // hide notice
89
+ add_action( 'admin_init', array( $this, 'hide_notice' ) );
90
+
91
+ }
92
+
93
+ /**
94
+ * Remove modules from plugins list.
95
+ *
96
+ * @param array $plugins
97
+ * @return mixed
98
+ * @author Andrea Frascaspata
99
+ */
100
+ public function remove_modules( $plugins ) {
101
+
102
+ $modules = $this->get_modules();
103
+
104
+ foreach ( $modules as $module => $args ) {
105
+ if ( ! is_plugin_active( $module . '/' . $args['file'] ) ) {
106
+ $unset = $module . '/' . $args['file'];
107
+ unset( $plugins[ $unset ] );
108
+ }
109
+ }
110
+
111
+ return $plugins;
112
+ }
113
+
114
+ /**
115
+ * Add admin notice
116
+ *
117
+ * @author Andrea Frascaspata
118
+ */
119
+ public function notice() {
120
+
121
+ global $pagenow;
122
+
123
+ if( $pagenow != 'plugins.php' || get_option( $this->_plugin_list_hide_notice_option_name ) ) {
124
+ return;
125
+ }
126
+
127
+ $modules = $this->get_modules();
128
+ if( count( $modules ) < 2 ) return;
129
+
130
+ $i=0;
131
+ $plugin_info = array();
132
+ foreach( $modules as $module ) {
133
+ $plugin_info[] = $module['name'];
134
+ $i++;
135
+ if( $i == 2 ) break;
136
+ }
137
+ ?>
138
+ <div id="yit-framework-notice" class="update-nag settings-error notice is-dismissible">
139
+ <p><?php
140
+ $url = menu_page_url( $this->_modules_list_query_value, false );
141
+ printf( __( 'Some plugins as %s, %s , etc.. have been removed from this plugins list. You can activate or deactive it from <a href="%s">%s</a> panel.', 'yith-jetpack' ), $plugin_info[0] , $plugin_info[1] , $url , $this->_menu_title );
142
+ ?></p>
143
+ <div class="action-link">
144
+ <a class="dismiss-notice" href="<?php echo esc_url( add_query_arg( $this->_plugin_list_hide_notice_option_name, 1 ) ); ?>"><?php _e( 'Dismiss this notice', 'yit' ); ?></a>
145
+ </div>
146
+ </div>
147
+ <?php
148
+
149
+ $notice = ob_get_clean();
150
+
151
+ echo apply_filters( 'yith_jetpack_framework_modules_notice', $notice );
152
+ }
153
+
154
+ /**
155
+ * Hide notice
156
+ *
157
+ * @author Andrea Frascaspata
158
+ */
159
+ public function hide_notice() {
160
+ if( ! isset( $_GET[ $this->_plugin_list_hide_notice_option_name ] ) || ! $_GET[ $this->_plugin_list_hide_notice_option_name ] ) {
161
+ return;
162
+ }
163
+
164
+ update_option( $this->_plugin_list_hide_notice_option_name , true );
165
+ }
166
+
167
+ /**
168
+ * Reset YIT_Framework option
169
+ *
170
+ * @since 1.0.0
171
+ * @author Andrea Frascaspata
172
+ */
173
+ public function reset_yith_jetpack_option( $plugin ) {
174
+
175
+ if ( $plugin == plugin_basename( $this->_plugin_path ) ) {
176
+ delete_option( $this->_activate_module_option_name );
177
+ delete_option( $this->_deactivated_plugin_option_name );
178
+ delete_option( $this->_module_list_option_name );
179
+ delete_option( $this->_plugin_list_hide_notice_option_name );
180
+ }
181
+
182
  }
183
 
184
  /**
211
  */
212
  public function action_links( $links ) {
213
 
214
+ $links[] = '<a href="' . esc_url( admin_url( "admin.php?page=".$this->_modules_list_query_value ) ) . '">' . __( 'Plugins List', 'yith-jetpack' ) . '</a>';
215
 
216
  return $links;
217
  }
526
  $title .= '<span class="awaiting-mod count-2"><span class="pending-count">'.( $new_plugins_count ).'</span></span>';
527
  }
528
 
529
+ add_submenu_page( 'yit_plugin_panel', $title, $title, 'install_plugins', $this->_modules_list_query_value , array( $this, 'admin_modules_page' ) );
530
  }
531
 
532
  public function get_new_added_plugin(){
533
  $modules = $this->get_modules();
534
  $modules_count = count( $modules );
535
+ $modules_inserted_count = count( get_option( $this->_module_list_option_name , array() ) );
536
+
537
+ if ( $modules_inserted_count > 0 ) {
538
+ return $modules_count - $modules_inserted_count;
539
+ }
540
 
541
+ else {
542
+ return 0;
543
+ }
544
  }
545
 
546
  /**
548
  *
549
  */
550
  function new_added_plugin_admin_notice() {
 
551
  if ( !is_super_admin() )
552
  return false;
553
 
554
  $new_plugins_count = $this->get_new_added_plugin();
555
 
556
  if( $new_plugins_count > 0 ) {
557
+ echo "<div class='update-nag'>" . sprintf( __( 'There are new plugins available on <b>%s</b>, <a href="%s">take a look at them</a> !' , 'yith-jetpack' ), $this->_menu_title, esc_url( admin_url( "admin.php?page=".$this->_modules_list_query_value."&plugin_status=inactive" ) ) ) . "</div>";
558
  }
559
  }
560
 
594
  * @since 1.0.0
595
  */
596
  public function activate_module_action() {
597
+ if ( empty( $_GET['page'] ) || $_GET['page'] != $this->_modules_list_query_value || ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'activate-yit-plugin' ) ) {
598
  return;
599
  }
600
 
626
  * @since 1.0.0
627
  */
628
  public function deactivate_module_action() {
629
+ if ( empty( $_GET['page'] ) || $_GET['page'] != $this->_modules_list_query_value || ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], 'deactivate-yit-plugin' ) ) {
630
  return;
631
  }
632
 
658
  * @since 1.0.0
659
  */
660
  public function deactivate_singular_plugins() {
661
+ if ( get_option( $this->_deactivated_plugin_option_name ) ) {
662
  return;
663
  }
664
 
675
  }
676
  }
677
 
678
+ update_option( $this->_deactivated_plugin_option_name, true );
679
 
680
  wp_safe_redirect( wp_unslash( $_SERVER['REQUEST_URI'] ) );
681
  exit();
691
  * @author Emanuela Castorina <emanuela.castorina@yithemes.it>
692
  */
693
  public function admin_enqueue_scripts() {
694
+ if( isset($_GET['page']) && $_GET['page']==$this->_modules_list_query_value) {
695
  wp_enqueue_style( 'yit-layout', YJP_ASSETS_URL . '/css/list-layout.css' );
696
  }
697
  }