WP Product Review Lite - Version 3.0.0

Version Description

  • 2017-08-23
Download this release

Release Info

Developer codeinwp
Plugin Icon WP Product Review Lite
Version 3.0.0
Comparing to
See all releases

Code changes from version 2.9.8 to 3.0.0

Files changed (167) hide show
  1. CHANGELOG.md +9 -1
  2. LICENSE.txt +339 -0
  3. README.md +342 -0
  4. admin/functions.php +0 -7
  5. admin/inc/adminOptionsValidator.php +0 -194
  6. admin/inc/adminSanitizer.php +0 -139
  7. admin/inc/config.php +0 -326
  8. admin/inc/loader.php +0 -414
  9. admin/inc/render.php +0 -608
  10. admin/layout/css/main_page.css +0 -1144
  11. admin/layout/js/admin.js +0 -150
  12. admin/layout/js/custom-bar-icon.js +0 -49
  13. admin/layout/js/tipsy.js +0 -259
  14. admin/layout/main_page.php +0 -85
  15. admin/layout/pro.php +0 -58
  16. assets/css/admin.css +164 -0
  17. {css → assets/css}/cwppos-widget-admin.css +5 -5
  18. assets/css/cwppos-widget-rating.css +19 -0
  19. assets/css/cwppos-widget-style1.css +69 -0
  20. assets/css/cwppos-widget.css +137 -0
  21. assets/css/dashboard_styles.css +429 -0
  22. assets/css/editor.css +128 -0
  23. {css → assets/css}/font-awesome.min.css +551 -551
  24. {css → assets/css}/fonts/FontAwesome.otf +0 -0
  25. {css → assets/css}/fonts/fontawesome-webfont.eot +0 -0
  26. {css → assets/css}/fonts/fontawesome-webfont.svg +0 -0
  27. {css → assets/css}/fonts/fontawesome-webfont.ttf +0 -0
  28. {css → assets/css}/fonts/fontawesome-webfont.woff +0 -0
  29. {css → assets/css}/frontpage.css +646 -696
  30. assets/css/jquery-ui.css +1918 -0
  31. assets/css/lightbox.css +202 -0
  32. {css → assets/css}/pro_dashboard_styles.css +3 -3
  33. assets/css/upsell.css +176 -0
  34. {images → assets/img}/amazon-cart.png +0 -0
  35. {images → assets/img}/cart-icon-hover.png +0 -0
  36. {images → assets/img}/cart-icon.png +0 -0
  37. {img → assets/img}/close.png +0 -0
  38. {images → assets/img}/comparison-table.gif +0 -0
  39. {images → assets/img}/customize-icons.gif +0 -0
  40. assets/{default.png → img/default.png} +0 -0
  41. {img → assets/img}/loading.gif +0 -0
  42. {admin/layout → assets}/img/logo.png +0 -0
  43. {img → assets/img}/next.png +0 -0
  44. {images → assets/img}/preload.png +0 -0
  45. {img → assets/img}/prev.png +0 -0
  46. {images → assets/img}/single.png +0 -0
  47. assets/{style1.png → img/style1.png} +0 -0
  48. {images → assets/img}/wppr-amazon-integration-and-support.jpg +0 -0
  49. {images → assets/img}/wppr-import.jpg +0 -0
  50. {admin/layout → assets}/img/wppr-logo.png +0 -0
  51. {images → assets/img}/wppr-review-comparison.jpg +0 -0
  52. {images → assets/img}/wppr-shortcodes.jpg +0 -0
  53. assets/js/admin-review.js +52 -0
  54. assets/js/admin.js +49 -0
  55. assets/js/cwp-pointers.js +30 -0
  56. {javascript → assets/js}/lightbox.min.js +0 -0
  57. {javascript → assets/js}/lightbox.min.map +0 -0
  58. assets/js/main.js +102 -0
  59. assets/js/pie-chart.js +401 -0
  60. assets/js/tipsy.js +267 -0
  61. assets/js/widget-latest.js +51 -0
  62. assets/js/widget-top.js +51 -0
  63. class-wppr-autoloader.php +184 -0
  64. css/cwppos-widget-rating.css +0 -34
  65. css/cwppos-widget-style1.css +0 -56
  66. css/cwppos-widget.css +0 -75
  67. css/dashboard_styles.css +0 -418
  68. css/jquery-ui.css +0 -10
  69. css/lightbox.css +0 -192
  70. inc/abtesting/abtesting.php +0 -48
  71. inc/cwp_comment.php +0 -157
  72. inc/cwp_frontpage.php +0 -20
  73. inc/cwp_js_preloader.php +0 -181
  74. inc/cwp_latest_products_widget.php +0 -371
  75. inc/cwp_metabox.php +0 -368
  76. inc/cwp_top_products_widget.php +0 -369
  77. inc/images/ajaxload.gif +0 -0
  78. inc/widget-layouts/default.php +0 -67
  79. inc/widget-layouts/style 1.php +0 -76
  80. inc/wppr-filters.php +0 -143
  81. inc/wppr-main.php +0 -509
  82. includes/admin/class-wppr-admin.php +188 -0
  83. includes/admin/class-wppr-editor.php +149 -0
  84. includes/admin/class-wppr-global-settings.php +368 -0
  85. includes/admin/controllers/class-wppr-admin-render-controller.php +126 -0
  86. includes/admin/helpers/class-wppr-html-fields.php +239 -0
  87. includes/admin/helpers/class-wppr-logger.php +71 -0
  88. includes/admin/index.php +13 -0
  89. includes/admin/layouts/css/settings.css +4 -0
  90. includes/admin/layouts/editor-default-tpl.php +348 -0
  91. includes/admin/layouts/header-part.php +24 -0
  92. includes/admin/layouts/settings-tpl.php +62 -0
  93. includes/admin/layouts/upsell-tpl.php +71 -0
  94. includes/admin/layouts/widget-admin-tpl.php +80 -0
  95. includes/admin/models/abstract/class-wppr-model-abstract.php +145 -0
  96. includes/admin/models/class-wppr-editor-model.php +267 -0
  97. includes/admin/models/class-wppr-options-model.php +27 -0
  98. includes/admin/models/class-wppr-query-model.php +388 -0
  99. includes/admin/models/class-wppr-review-model.php +935 -0
  100. includes/admin/widgets/abstract/class-wppr-widget-abstract.php +149 -0
  101. includes/admin/widgets/class-wppr-latest-products-widget.php +116 -0
  102. includes/admin/widgets/class-wppr-top-products-widget.php +134 -0
  103. includes/class-wppr-activator.php +35 -0
  104. includes/class-wppr-deactivator.php +35 -0
  105. includes/class-wppr-i18n.php +46 -0
  106. includes/class-wppr-loader.php +128 -0
  107. includes/class-wppr.php +207 -0
  108. includes/index.php +13 -0
  109. includes/public/class-wppr-public.php +498 -0
  110. includes/public/index.php +13 -0
  111. includes/public/layouts/default-tpl.php +128 -0
  112. includes/public/layouts/rating-tpl.php +57 -0
  113. includes/public/layouts/rich-json-ld.php +42 -0
  114. includes/public/layouts/score-tpl.php +12 -0
  115. includes/public/layouts/widget/default.php +54 -0
  116. includes/public/layouts/widget/style 1.php +83 -0
  117. index.php +13 -0
  118. javascript/admin-review.js +0 -63
  119. javascript/custom-bar-icon.js +0 -49
  120. javascript/cwp-pointers.js +0 -30
  121. javascript/main.js +0 -106
  122. javascript/pie-chart.js +0 -404
  123. javascript/widget-latest.js +0 -48
  124. javascript/widget-top.js +0 -48
  125. languages/wp-product-review.pot +558 -0
  126. readme.txt +68 -28
  127. screenshot-1.png +0 -0
  128. screenshot-2.png +0 -0
  129. screenshot-3.png +0 -0
  130. screenshot-4.png +0 -0
  131. uninstall.php +30 -0
  132. vendor/autoload.php +7 -0
  133. vendor/autoload_52.php +7 -0
  134. vendor/codeinwp/themeisle-sdk/LICENSE +674 -0
  135. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-deactivate.php +470 -0
  136. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-factory.php +50 -0
  137. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-review.php +185 -0
  138. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback.php +90 -0
  139. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php +710 -0
  140. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php +88 -0
  141. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-logger.php +211 -0
  142. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-notification-manager.php +119 -0
  143. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-product.php +401 -0
  144. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php +374 -0
  145. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget.php +50 -0
  146. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widgets-factory.php +37 -0
  147. vendor/codeinwp/themeisle-sdk/composer.json +24 -0
  148. vendor/codeinwp/themeisle-sdk/index.php +5 -0
  149. vendor/codeinwp/themeisle-sdk/load.php +35 -0
  150. vendor/codeinwp/themeisle-sdk/start.php +35 -0
  151. vendor/composer/ClassLoader.php +413 -0
  152. vendor/composer/ClassLoader52.php +271 -0
  153. vendor/composer/LICENSE +21 -0
  154. vendor/composer/autoload_classmap.php +9 -0
  155. vendor/composer/autoload_files.php +11 -0
  156. vendor/composer/autoload_namespaces.php +10 -0
  157. vendor/composer/autoload_psr4.php +9 -0
  158. vendor/composer/autoload_real.php +59 -0
  159. vendor/composer/autoload_real_52.php +47 -0
  160. vendor/composer/installed.json +78 -0
  161. vendor/xrstf/composer-php52/LICENSE +19 -0
  162. vendor/xrstf/composer-php52/README.md +37 -0
  163. vendor/xrstf/composer-php52/composer.json +26 -0
  164. vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php +346 -0
  165. vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php +271 -0
  166. vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php +39 -0
  167. wp-product-review.php +83 -51
CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
 
 
 
 
 
 
 
 
 
 
2
 
3
 
4
 
5
- Development
1
 
2
+ ### v3.0.0 - 2017-08-23
3
+ **Changes:**
4
+
5
+ ### v3.0.0 - 2017-08-23
6
+ **Changes:**
7
+ * Major code refactor ( Please test before update )
8
+ * Added JSON-LD support
9
+ * Improved compatibility with themes
10
+
11
 
12
 
13
 
 
LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
README.md ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WP Product Review Lite
2
+
3
+ **Contributors:** codeinwp,marius2012,marius_codeinwp,hardeepasrani,themeisle,Madalin_ThemeIsle
4
+
5
+ **Tags:** review, rating, posts, widget, review blogger, review blogging, affiliate, product reviews,plugin, google rating, product review, rating, review, star rating, user rating, wp rating, wp review, google, hreview,rich snippets,seo,snippet
6
+
7
+ **Author URI:** http://themeisle.com
8
+
9
+ **Requires at least:** 3.5
10
+
11
+ **Tested up to:** 4.7.3
12
+
13
+ **Stable tag:** trunk
14
+
15
+ **License:** GPLv2 or later
16
+
17
+ **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
18
+
19
+
20
+ Easily turn your basic posts into in-depth reviews with ratings, pros and cons, affiliate links, rich snippets and user reviews.
21
+ ## Description
22
+ > If you want to see a live demo of the review plugin + rich snippets you can check <a href="http://demo.themeisle.com/parallax-one/wp-product-review/">http://demo.themeisle.com/parallax-one/wp-product-review/</a>.
23
+
24
+
25
+ ### Why to get the PRO add-ons ?
26
+
27
+ Using the add-ons you will unleash the most important functionality : SHORTCODE . Using something like : [P_REVIEW post_id=3067 visual='full'] you are able to display the review box anywhere in the post, or you can even display 5 boxes in the same page (different products).
28
+
29
+ Other notable features :
30
+
31
+ * Custom Review Icons
32
+ * Preloader functionality
33
+ * Unlimited Options
34
+ * PROs/ Cons
35
+
36
+ ### Knowledgebase
37
+
38
+ 1. How to change the html format of the review name -> http://docs.themeisle.com/article/130-how-to-change-the-html-format-of-the-review-name
39
+ 2. How to change dynamically the name of the review -> http://docs.themeisle.com/article/131-how-to-change-dynamically-the-name-of-the-review
40
+ 3. How to change dynamically the option name format -> http://docs.themeisle.com/article/132-how-to-change-dynamically-the-option-name-format
41
+ 4. How to change dynamically the pros/cons heading text -> http://docs.themeisle.com/article/133-how-to-change-dynamically-the-pros-cons-heading-text
42
+ 5. How to change dynamically the image size for review -> http://docs.themeisle.com/article/135-how-to-change-dynamically-the-image-size-for-review
43
+
44
+
45
+ ### User Review Enabled
46
+
47
+ 1. This review plugin helps you to interact with your users with improved comments, you can expose your reviews in a easier to read way and will help you generate money by adding a buy now button in your post. Rich snippets are also supported.
48
+
49
+ 1. After you install the plugin, go on a post admin page and you should be able to see a checkbox called : "Is this post a review ?", once this is checked you can add review details and those will appear on the post page.
50
+
51
+ 1. If you want to to edit the colors, enable/disable the affiliate button, change icons go on the plugin options page.
52
+
53
+ 1. All the plugin settings/colors are fully customizable, and you can read more about it <a rel="nofollow" href="https://themeisle.com/plugins/wp-product-review-lite/?utm_source=wpreadme&utm_medium=readme&utm_campaign=wporg">here</a>
54
+
55
+ 1. For updates follow https://twitter.com/themeisle.
56
+
57
+ If you wanna learn more about the <a href="http://www.codeinwp.com/blog/fastest-wordpress-hosting/" rel="nofollow">fastest WordPress hosting</a> or which <a href="http://www.codeinwp.com/blog/15-best-wordpress-review-themes/" rel="nofollow">review themes</a> are playing nice with WP Product review, checkout our blog.
58
+
59
+
60
+ **Fortcoming**
61
+
62
+ - Direct amazon integration
63
+
64
+
65
+ **WP Product Review provides following features**
66
+
67
+ - Create a top products review widget
68
+ - Easily update all the colors of the widget from theme options
69
+ - Add a download button in the posts
70
+ - Add an awesome wrap-up widget at the end of your articles
71
+ - Add specific user review options to wordpress comments
72
+ - Add rich snippet ( schema ) to your posts
73
+
74
+ = Translations =
75
+
76
+ * sk_SK translation by Patrik Žec (PATWIST) of http://patwist.com
77
+ * fr_FR translation by Jacques Soule of http://wordpress-pour-vous.com/
78
+
79
+ == Changelog ==
80
+
81
+ **New in 2.9.8**
82
+
83
+ - Added more features page
84
+
85
+ **New in 2.9.6**
86
+
87
+ - Fixed undefined notices
88
+ - Fixed sanitization issues
89
+
90
+ **New in 2.9.5**
91
+
92
+ - Added amazon integration support
93
+ - Fixed some design issue with review
94
+
95
+ **New in 2.9.3**
96
+
97
+ - Added dashes for pro/cons list
98
+ - Added filters for nofollow links in widgets area
99
+
100
+ **New in 2.9.2**
101
+
102
+ - Fixed shortcode compatibility with pro version
103
+
104
+ **New in 2.9.1**
105
+
106
+ - Fixed undefined notice on plugin activation
107
+ - Removed review buttons on links when the values are empty for widgets
108
+
109
+ **New in 2.9.0**
110
+
111
+ - Added shortcode support on all review fields
112
+ - Removed addons page
113
+
114
+
115
+ **New in 2.8.7**
116
+
117
+ - Fixed img tag closing tag issue
118
+ - Fixed rich snippet problem when comment influence is off
119
+
120
+ **New in 2.8.6**
121
+
122
+ - Added compatibility with new pro addons
123
+ - Fixed layout issues with the review
124
+ - Fixed responsiveness bugs
125
+
126
+ **New in 2.8.1**
127
+
128
+ - Added different style for widgets
129
+ - Fixed some layout bugs for widgets
130
+
131
+ **New in 2.8.0**
132
+
133
+ - Added a filter for price issues
134
+
135
+ **New in 2.7.9**
136
+
137
+ - Added support for amazon import in the pro version
138
+
139
+ **New in 2.7.8**
140
+
141
+ - Fixed price issues when . is present
142
+
143
+ **New in 2.7.7**
144
+
145
+ - Re-worked rich snippets (Added main Thing Object as Product, added Offers and improved review / aggregateRating)
146
+
147
+ **New in 2.7.6**
148
+
149
+ - Fixed empty inputs on comments and saving of non-reviews post metas
150
+ - Fixed circles widget issue
151
+
152
+ **New in 2.7.5**
153
+
154
+ - Fixed WP_query issue in the wp backed
155
+ - Added a minium content_width, since some themes set this wrong
156
+ - Fixed responsive issues when content_width is set
157
+ - Fixed circles widget issue
158
+
159
+ **New in 2.7.3**
160
+
161
+ - Improved layout based on $content_width so make sure this is set correctly
162
+ - Improved some settings description
163
+ - Fixed lightbox image logic
164
+ - Open image affiliate link in new tab
165
+ - Fixed various issues with comment sliders
166
+ - Pre-fill features from the latest edited post in the same category
167
+ - Pre-fill image settings and aff_button text from latest edited post in the same category
168
+ - Optimize the space on post review metaboxes
169
+
170
+ **New in 2.7.2**
171
+
172
+ - Fixed design issues in comments slider
173
+ - Fixed enque of media files when review is not available
174
+ - Fixed alt tags for images in the widgets
175
+
176
+ **New in 2.7.1**
177
+
178
+ - Fixed some design issues.
179
+ - Fixed rating problem on some instalation when display the numerator greater than denominator
180
+ - Added wppr_review_image_size for filter the image size;
181
+
182
+
183
+ **New in 2.7**
184
+
185
+ - Fixed responsive design bugs.
186
+ - Fixed border color and width customization for the review box
187
+
188
+ **New in 2.6.9**
189
+
190
+ - Improved design of the featured image
191
+ - Added filters heading tags for review name, option name, pros headings and cons headings.
192
+
193
+ **New in 2.6.8**
194
+
195
+ - Improved responsive design of the review
196
+
197
+ **New in 2.6.7**
198
+
199
+ - Fixed issue with rating value when visitator influence is off
200
+ - Fixed issue with auto optimization plugins
201
+
202
+
203
+ **New in v.2.6.6**
204
+
205
+ - Added option to remove loading of Font Awesome for websites that already enque it.
206
+ - Fixed microtags when is 0% visitator influence.
207
+ - Fixed multiple display of review where <!--nextpage--> quick tag is used.
208
+
209
+
210
+ **New in v.2.6.4**
211
+
212
+ - Fixed layout problem with widgets on some themes
213
+ - Added new image size for widgets 'wppr_widget_image' for 50x50. ( Requires thumbnail regeneration to use it )
214
+
215
+ **New in v.2.6.3**
216
+
217
+ - Fixed custom icons bug
218
+ - Fixed sorting order to top products widget
219
+ - Added 100% influence on visitators rating
220
+ - Added rel="nofollow" for img link
221
+ - Fixed bug for password protected reviews.
222
+ - Fixed long text for product titles in widgets
223
+ - Removed unecessary css
224
+
225
+
226
+ **New in v.2.6.2**
227
+
228
+ - Added thumbnails for reviews
229
+ - Fixed bug when no image is set for reviews
230
+ - Fixed reset button for product options
231
+ - Added option to disable lightbox for review image
232
+
233
+
234
+
235
+ **New in v.2.6.1**
236
+
237
+ - Fixed rich snippet bug
238
+ - Fixed loading of the assets files where the plugin is not used
239
+
240
+
241
+ **New in v2.5.2**
242
+
243
+ - Added multiple addons including ranking chart
244
+ - Fixed image in post issue
245
+ - Improved preloader logic
246
+
247
+ - Fixed issue with more than 5 options
248
+ - Added ability to modify the chart color
249
+
250
+ **New in v2.4.7**
251
+
252
+ - Fixed issue with more than 5 options
253
+ - Added ability to modify the chart color
254
+
255
+ **New in v2.4.5**
256
+
257
+ - Fixed the image affiliate link issue
258
+ - Improved responsive for the review box
259
+ - Now you can place the review box manually using php or shortcode
260
+
261
+ **New in v2.4.3**
262
+
263
+ - Added multiple options/ pros/ cons
264
+ - Fixed rich snippet issue
265
+ - Improved image linking
266
+ - Removed sticky posts
267
+ - Fixed Aff button2 link/text
268
+ - Fixed js errors
269
+
270
+ **New in v2.4.2**
271
+
272
+ - Fixed latest widget issue
273
+ - Added possibility of having 2 affiliate buttons
274
+
275
+ - Fixed js errors
276
+
277
+ **New in v2.4.1**
278
+
279
+ - Fixed division by zero
280
+
281
+ **New in v2.4**
282
+
283
+ - Added image and product title options in widget
284
+ - Added lightbox on product review image, that preload image from the featured image
285
+ - User is now able to select in admin how much user reviews will influence the main rating
286
+ - Added [P_REVIEW post_id=3067 visual="yes"] shortcode in the PRO version, without visual attribute only the rating is displayed
287
+
288
+ **New in v2.3**
289
+
290
+ - Fixed js errors
291
+
292
+ **New in v2.29**
293
+
294
+ - Fixed upgrade to pro issue
295
+
296
+ **New in v2.28**
297
+
298
+ - Fixed translation issues
299
+ - Added custom icons
300
+ - Added price attribute
301
+
302
+ ## Installation
303
+
304
+ Following are the steps to install the WP Product Review
305
+
306
+ 1. Download the latest version of the WP Product Review to your computer from here.
307
+ 2. With an FTP program, access your site?s server.
308
+ 3. Upload (copy) the Plugin file(s) or folder to the /wp-content/plugins folder.
309
+ 4. In your WordPress Administration Panels, click on Plugins from the menu.
310
+ 5. You should see WP Product Review Plugin listed. If not, with your FTP program, check the folder to see if it is installed. If it isn?t, upload the file(s) again. If it is, delete the files and upload them again.
311
+ 6. To turn the WP Product Review on, click Activate.
312
+ 7. Check your Administration Panels or WordPress blog to see if the Plugin is working.
313
+ 8. You can change the plugin options from Tweet Old Posts under settings menu.
314
+
315
+ Alternatively you can also follow the following steps to install the WP Product Review plugin
316
+
317
+ 1. In your WordPress Administration Panels, click on Add New option under Plugins from the menu.
318
+ 2. Click on upload at the top.
319
+ 3. Browse the location and select the WP Product Review Plugin and click install now.
320
+ 4. To turn the WP Product Review Plugin on, click Activate.
321
+ 5. Check your Administration Panels or WordPress blog to see if the Plugin is working.
322
+ 6. You can change the plugin options from Tweet Old Posts under settings menu.
323
+
324
+ ## Frequently Asked Questions
325
+
326
+ 1. How to activate user reviews ?
327
+
328
+ By default user reviews are disabled since not all the themes are compatible with this option due to different designs for the comment box. You can easily activate them from General Settings
329
+
330
+ If you have any questions please get in touch with us at,
331
+ https://themeisle.com/contact
332
+
333
+ ### Screenshots
334
+
335
+ 1. Screenshot 1 Wrap-up review widget that is added at the end of the posts
336
+ 2. Screenshot 2 User Review Options added to wp comments
337
+ 3. Screenshot 3 Fully configurable theme options
338
+ 4. Screenshot 4 Rich Snippets displayed in Google
339
+
340
+ for more you can check out
341
+
342
+ https://themeisle.com/plugins/wp-product-review-lite/
admin/functions.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- require( plugin_dir_path( __FILE__ ) . 'inc/config.php' );
4
- require( plugin_dir_path( __FILE__ ) . 'inc/adminOptionsValidator.php' );
5
- require( plugin_dir_path( __FILE__ ) . 'inc/adminSanitizer.php' );
6
- require( plugin_dir_path( __FILE__ ) . 'inc/render.php' );
7
- require( plugin_dir_path( __FILE__ ) . 'inc/loader.php' );
 
 
 
 
 
 
 
admin/inc/adminOptionsValidator.php DELETED
@@ -1,194 +0,0 @@
1
- <?php
2
-
3
- class cwpposOptionsValidator {
4
- public function __construct() {
5
-
6
- $sanitizer = new cwpposSanitizer();
7
- add_filter( 'cwppos_sanitize_color', array( $sanitizer, 'sanitize_hex' ),10,2 );
8
- add_filter( 'cwppos_sanitize_textarea', array( $sanitizer, 'sanitize_textarea' ),10,2 );
9
- add_filter( 'cwppos_sanitize_array', array( $sanitizer, 'sanitize_array' ),10,3 );
10
- add_filter( 'cwppos_sanitize_enum', array( $sanitizer, 'sanitize_enum' ),10,3 );
11
- add_filter( 'cwppos_sanitaze_typography', array( $sanitizer, 'sanitize_typography' ),10,2 );
12
- add_filter( 'cwppos_sanitize_url', array( $sanitizer, 'sanitize_imageurl' ),10,2 );
13
- add_filter( 'cwppos_sanitize_number', array( $sanitizer, 'sanitize_number' ),10,2 );
14
- add_filter( 'cwppos_sanitize_background', array( $sanitizer, 'sanitize_background' ),10,2 );
15
- add_filter( 'cwppos_sanitize_textarea_html', array( $sanitizer, 'sanitize_html' ),10,2 );
16
- add_filter( 'cwppos_sanitize_change_icon', array( $sanitizer, 'sanitize_change_icon' ), 10, 2 );
17
- }
18
- public function validate_defaults() {
19
- $ninput = array();
20
- $defaults = $this->get_default_options();
21
- foreach ( $defaults as $k => $i ) {
22
- switch ( $i['type'] ) {
23
- case 'textarea':
24
- case 'editor':
25
-
26
- case 'input_text':
27
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_textarea',$i['default'] );
28
- break;
29
- case 'textarea_html':
30
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_textarea_html',$i['default'] );
31
- break;
32
-
33
- case 'radio':
34
- case 'select':
35
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_enum',$i['default'],$k );
36
-
37
- break;
38
- case 'color':
39
-
40
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_color',$i['default'] );
41
- break;
42
- case 'image':
43
-
44
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_url',$i['default'] );
45
- break;
46
- case 'background':
47
-
48
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_background',$i['default'] );
49
- break;
50
- case 'typography':
51
-
52
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_typography',$i['default'] );
53
- break;
54
- case 'input_number':
55
-
56
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_number',$i['default'] );
57
- break;
58
- case 'checkbox':
59
- case 'multiselect':
60
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_array',$i['default'],$k );
61
- break;
62
-
63
- case 'change_icon':
64
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_change_icon',$i['default'],$k );
65
- break;
66
-
67
- }
68
- }
69
- return $ninput;
70
- }
71
- public function validate( $input ) {
72
-
73
- $ninput = array();
74
-
75
- $options = $this->get_options_data();
76
-
77
- foreach ( $input as $k => $i ) {
78
- switch ( $options[ $k ]['type'] ) {
79
- case 'textarea':
80
- case 'editor':
81
-
82
- case 'input_text':
83
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_textarea',$i,$options[ $k ]['default'] );
84
-
85
- break;
86
- case 'textarea_html':
87
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_textarea_html',$i,$options[ $k ]['default'] );
88
- break;
89
- case 'radio':
90
- case 'select':
91
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_enum',$i,$k,$options[ $k ]['default'] );
92
-
93
- break;
94
- case 'color':
95
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_color',$i,$options[ $k ]['default'] );
96
- break;
97
- case 'image':
98
-
99
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_url',$i,$options[ $k ]['default'] );
100
- break;
101
- case 'background':
102
-
103
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_background',$i,$options[ $k ]['default'] );
104
- break;
105
- case 'typography':
106
-
107
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_typography',$i,$options[ $k ]['default'] );
108
- break;
109
- case 'input_number':
110
-
111
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_number',$i,$options[ $k ]['default'] );
112
- break;
113
- case 'checkbox':
114
- case 'multiselect':
115
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_array',$i,$k,$options[ $k ]['default'] );
116
- break;
117
-
118
- case 'change_icon':
119
- $ninput[ $k ] = apply_filters( 'cwppos_sanitize_change_icon',$i,$k,$options[ $k ]['default'] );
120
- break;
121
-
122
- }
123
- }
124
- return $ninput;
125
- }
126
- public function get_default_options() {
127
- $structure = cwpposConfig::$structure;
128
- $options = cwppos_get_config_defaults( $structure );
129
- $data = array();
130
- foreach ( $structure as $k => $fields ) {
131
-
132
- if ( $fields['type'] == 'tab' ) {
133
-
134
- foreach ( $fields['options'] as $r => $field ) {
135
-
136
- if ( $field['type'] == 'group' ) {
137
-
138
- foreach ( $field['options'] as $m => $gfield ) {
139
- if ( $gfield['type'] != 'title' ) {
140
- $data[ $gfield['id'] ] = array(
141
- 'default' => $options[ $gfield['id'] ],
142
- 'type' => $gfield['type'],
143
- ); }
144
- }
145
- } else {
146
- if ( $field['type'] != 'title' ) {
147
-
148
- $data[ $field['id'] ] = array(
149
- 'default' => $options[ $field['id'] ],
150
- 'type' => $field['type'],
151
- ); }
152
- }
153
- }
154
- }
155
- }
156
- return $data;
157
- }
158
- public function get_options_data( $options = 0 ) {
159
- $structure = cwpposConfig::$structure;
160
- $defaults = cwppos_get_config_defaults( $structure );
161
- $option = get_option( cwppos_config( 'menu_slug' ) );
162
- $options = array_merge( $defaults,is_array( $option ) ? $option : array() );
163
-
164
- $data = array();
165
- foreach ( $structure as $k => $fields ) {
166
-
167
- if ( $fields['type'] == 'tab' ) {
168
-
169
- foreach ( $fields['options'] as $r => $field ) {
170
-
171
- if ( $field['type'] == 'group' ) {
172
-
173
- foreach ( $field['options'] as $m => $gfield ) {
174
- if ( $gfield['type'] != 'title' ) {
175
- $data[ $gfield['id'] ] = array(
176
- 'default' => $options[ $gfield['id'] ],
177
- 'type' => $gfield['type'],
178
- ); }
179
- }
180
- } else {
181
- if ( $field['type'] != 'title' ) {
182
-
183
- $data[ $field['id'] ] = array(
184
- 'default' => $options[ $field['id'] ],
185
- 'type' => $field['type'],
186
- ); }
187
- }
188
- }
189
- }
190
- }
191
- return $data;
192
- }
193
- // adauga aici noile functii pentru submeniu daca pagina este in meniul principal
194
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/inc/adminSanitizer.php DELETED
@@ -1,139 +0,0 @@
1
- <?php
2
- class cwpposSanitizer {
3
-
4
- public function sanitize_hex( $hex, $default = '' ) {
5
-
6
- if ( $this->validate_hex( $hex ) ) {
7
- return $hex;
8
- }
9
- return $default;
10
-
11
- }
12
- public function sanitize_textarea( $input, $default = '' ) {
13
- $output = esc_html( esc_attr( wp_kses_data( $input ) ) );
14
-
15
- return $output;
16
-
17
- }
18
- public function sanitize_html( $input, $default = '' ) {
19
- $output = wp_kses_data( $input );
20
- return $output;
21
-
22
- }
23
- public function sanitize_number( $input, $default = 0 ) {
24
- $number = floatval( $input );
25
- if ( empty( $number ) ) { return $default; }
26
- return $number;
27
- }
28
- public function sanitize_imageurl( $input, $default = '' ) {
29
-
30
- $filetype = wp_check_filetype( $input );
31
- if ( $filetype['ext'] ) {
32
- return $input;
33
- }
34
- $filetype = wp_check_filetype( $default );
35
- if ( $filetype['ext'] ) {
36
- return $default;
37
- }
38
- return '';
39
- }
40
- public function sanitize_background( $input, $default = array( 'bgcolor' => '', 'bgimage' => '', 'bgrepeat' => 'no-repeat', 'bgposition' => 'center center', 'bgattachment' => 'scroll' ) ) {
41
- $render = new cwpposRenderView();
42
- $repeat = $render->get_bg_repeat();
43
- $repeat = array_keys( $repeat );
44
- $position = $render->get_bg_position();
45
- $position = array_keys( $position );
46
- $att = $render->get_bg_attachment();
47
- $att = array_keys( $att );
48
- $input['bgcolor'] = apply_filters( 'pos_sanitize_color',$input['bgcolor'],$default['bgcolor'] );
49
- $input['bgimage'] = apply_filters( 'pos_sanitize_url',$input['bgimage'],$default['bgimage'] );
50
- if ( ! in_array( $input['bgrepeat'],$repeat ) ) {
51
- $input['bgrepeat'] = $default['bgrepeat']; }
52
- if ( ! in_array( $input['bgposition'],$position ) ) {
53
- $input['bgposition'] = $default['bgposition']; }
54
- if ( ! in_array( $input['bgattachment'],$repeat ) ) {
55
- $input['bgattachment'] = $default['bgattachment']; }
56
- return $input;
57
- }
58
- public function sanitize_typography( $input, $default = array( 'color' => '', 'size' => 12, 'style' => 'normal', 'font' => 'arial' ) ) {
59
- $render = new cwpposRenderView();
60
- $fonts = $render->get_fonts();
61
- $fonts = array_keys( $fonts );
62
- $styles = $render->get_font_styles();
63
- $styles = array_keys( $styles );
64
- $sizes = $render->get_font_sizes();
65
- $input['color'] = apply_filters( 'cwppos_sanitize_color',$input['color'],$default['color'] );
66
- if ( ! in_array( $input['size'],$sizes ) ) {
67
- $input['size'] = $default['size']; }
68
- if ( ! in_array( $input['style'],$styles ) ) {
69
- $input['style'] = $default['style']; }
70
- if ( ! in_array( $input['font'],$fonts ) ) {
71
- $input['font'] = $default['font']; }
72
- return $input;
73
- }
74
- public function get_config_option( $name ) {
75
- $structure = cwpposConfig::$structure;
76
- foreach ( $structure as $k => $fields ) {
77
-
78
- if ( $fields['type'] == 'tab' ) {
79
-
80
- foreach ( $fields['options'] as $r => $field ) {
81
-
82
- if ( $field['type'] == 'group' ) {
83
-
84
- foreach ( $field['options'] as $m => $gfield ) {
85
- if ( $gfield['type'] != 'title' && $gfield['id'] == $name ) {
86
- return $gfield['options']; }
87
- }
88
- } else {
89
- if ( $field['type'] != 'title' && $field['id'] == $name ) {
90
- return $field['options']; }
91
- }
92
- }
93
- }
94
- }
95
-
96
- }
97
-
98
- public function sanitize_change_icon( $input, $name, $default = array() ) {
99
- return wp_kses_data( $input );
100
- }
101
-
102
- public function sanitize_array( $input, $name, $default = array() ) {
103
-
104
- $options = $this->get_config_option( $name );
105
- if ( is_array( $input ) ) {
106
- foreach ( $input as $key => $value ) {
107
-
108
- $output[ $key ] = sanitize_text_field( $value );
109
- }
110
- $kop = array_keys( $options );
111
- $dif = array_diff( $output,$kop );
112
-
113
- if ( empty( $dif ) ) {
114
- return $output; }
115
- return $default;
116
- }
117
- return $default;
118
- }
119
- public function sanitize_enum( $input, $name, $default = '' ) {
120
- $options = $this->get_config_option( $name );
121
-
122
- if ( in_array( $input,array_keys( $options ) ) ) {
123
- return apply_filters( 'cwppos_sanitize_textarea',$input ); }
124
- return $default;
125
- }
126
- public function validate_hex( $hex ) {
127
- $hex = trim( $hex );
128
- if ( 0 === strpos( $hex, '#' ) ) {
129
- $hex = substr( $hex, 1 );
130
- } elseif ( 0 === strpos( $hex, '%23' ) ) {
131
- $hex = substr( $hex, 3 );
132
- }
133
- if ( 0 === preg_match( '/^[0-9a-fA-F]{6}$/', $hex ) ) {
134
- return false;
135
- } else {
136
- return true;
137
- }
138
- }
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/inc/config.php DELETED
@@ -1,326 +0,0 @@
1
- <?php
2
-
3
- class cwpposConfig {
4
-
5
- public static $admin_page_menu_name;
6
-
7
- public static $admin_page_title;
8
-
9
- public static $admin_page_header;
10
-
11
- public static $admin_template_directory;
12
-
13
- public static $admin_template_directory_uri;
14
-
15
- public static $admin_uri;
16
-
17
- public static $admin_path;
18
-
19
- public static $menu_slug;
20
-
21
- public static $structure;
22
-
23
- public static $review_categories_array;
24
-
25
- public static $categories_array;
26
-
27
- public static $shortname;
28
-
29
- public static $all_review_categories_array;
30
-
31
- public static $all_categories_array;
32
-
33
- public static $categories_ids;
34
-
35
- public static $pro_page_menu_name;
36
-
37
- public static $pro_page_title;
38
-
39
- public static function init() {
40
- self::$admin_page_menu_name = 'Product Review';
41
- self::$admin_page_title = 'WP Product Review Options';
42
- self::$admin_page_header = 'WP Product Review Options';
43
- self::$shortname = 'cwppos';
44
- self::$admin_template_directory_uri = plugins_url( '../layout', __FILE__ );
45
- self::$admin_template_directory = plugins_url( '../layout', __FILE__ );
46
- self::$admin_uri = plugins_url( '../', __FILE__ );
47
- self::$admin_path = plugins_url( '../', __FILE__ );
48
- self::$menu_slug = 'cwppos_options';
49
- self::$all_categories_array = array();
50
- self::$all_review_categories_array = array();
51
- self::$categories_array = array();
52
- self::$pro_page_menu_name = 'More Features <span class="dashicons
53
- dashicons-star-filled"
54
- style="vertical-align:-5px; padding-left:2px; color:#FFCA54;"></span>';
55
- self::$pro_page_title = 'Go Premium';
56
- self::$structure = array(
57
- array(
58
- 'type' => 'tab',
59
- 'name' => 'General settings',
60
- 'options' => array(
61
- array(
62
- 'type' => 'select',
63
- 'name' => 'Position of the review box',
64
- 'description' => "You can choose manually and use : <?php echo cwppos_show_review('postid'); ?> or you can get the Product in post add-on and use :[P_REVIEW post_id=3067 visual='full']",
65
- 'id' => 'cwppos_show_reviewbox',
66
- 'options' => array(
67
- 'yes' => 'After content',
68
- 'no' => 'Before content',
69
- 'manual' => 'Manually',
70
- ),
71
- 'default' => 'yes',
72
- ),
73
- array(
74
- 'type' => 'select',
75
- 'name' => 'Show review comment',
76
- 'description' => 'Activate comment review user',
77
- 'id' => 'cwppos_show_userreview',
78
- 'options' => array( 'yes' => 'Yes', 'no' => 'No' ),
79
- 'default' => 'no',
80
- ),
81
- array(
82
- 'type' => 'select',
83
- 'name' => 'Visitor Review Influence',
84
- 'description' => 'Select how much visitors rating will affect the main one.',
85
- 'id' => 'cwppos_infl_userreview',
86
- 'options' => array(
87
- '0' => 'No influence',
88
- '10' => '10%',
89
- '20' => '20%',
90
- '30' => '30%',
91
- '40' => '40%',
92
- '50' => '50%',
93
- '60' => '60%',
94
- '70' => '70%',
95
- '80' => '80%',
96
- '90' => '90%',
97
- '100' => '100%',
98
- ),
99
- 'default' => '0',
100
- ),
101
- array(
102
- 'type' => 'change_icon',
103
- 'name' => 'Change Default Rating Icon',
104
- 'description' => 'Choose which icon would you like to use for the rating bar.',
105
- 'id' => 'cwppos_change_bar_icon',
106
- 'default' => '',
107
- ),
108
- array(
109
- 'type' => 'select',
110
- 'name' => 'Number of options/pros/cons',
111
- 'description' => 'You can select the default number of options / pros/ cons (3-10)',
112
- 'id' => 'cwppos_option_nr',
113
- 'options' => array(
114
- 3 => '3',
115
- 4 => '4',
116
- 5 => '5',
117
- 6 => '6',
118
- 7 => '7',
119
- 8 => '8',
120
- 9 => '9',
121
- 10 => '10',
122
- ),
123
- 'default' => 5,
124
- ),
125
- array(
126
- 'type' => 'input_text',
127
- 'name' => 'Content width',
128
- 'description' => 'Write your content width in pixels in this format : 600 if you want to limit the review box width.',
129
- 'id' => 'cwppos_widget_size',
130
- 'default' => '',
131
- ),
132
- array(
133
- 'type' => 'select',
134
- 'name' => 'Disable Lighbox images',
135
- 'description' => 'Disable lightbox effect on product images (increase loading speed)',
136
- 'id' => 'cwppos_lighbox',
137
- 'options' => array( 'yes' => 'Yes', 'no' => 'No' ),
138
- 'default' => 'no',
139
- ),
140
- array(
141
- 'type' => 'select',
142
- 'name' => 'Disable Font Awesome',
143
- 'description' => 'Disable Font Awesome for websites that already are including it (increase loading speed)',
144
- 'id' => 'cwppos_fontawesome',
145
- 'options' => array( 'yes' => 'Yes', 'no' => 'No' ),
146
- 'default' => 'no',
147
- ),
148
- ),
149
- ),
150
- array(
151
- 'type' => 'tab',
152
- 'name' => 'Rating colors',
153
- 'options' => array(
154
- array(
155
- 'type' => 'title',
156
- 'name' => 'Rating Colors',
157
- ),
158
- array(
159
- 'type' => 'color',
160
- 'name' => 'Rating options default color',
161
- 'description' => 'Select the color to be used by default on rating.',
162
- 'id' => 'cwppos_rating_default',
163
- 'default' => '#E1E2E0',
164
- ),
165
- array(
166
- 'type' => 'color',
167
- 'name' => 'Rating chart default color',
168
- 'description' => 'Select the color to be used by default on rating chart.',
169
- 'id' => 'cwppos_rating_chart_default',
170
- 'default' => '#ebebeb',
171
- ),
172
- array(
173
- 'type' => 'color',
174
- 'name' => 'Weak rating',
175
- 'description' => 'Select the color to be used when the rating is weak. ( < 2.5)',
176
- 'id' => 'cwppos_rating_weak',
177
- 'default' => '#FF7F66',
178
- ),
179
- array(
180
- 'type' => 'color',
181
- 'name' => 'Not bad rating',
182
- 'description' => 'Select the color to be used when the rating is not bad. ( > 2.5 and < 5)',
183
- 'id' => 'cwppos_rating_notbad',
184
- 'default' => '#FFCE55',
185
- ),
186
- array(
187
- 'type' => 'color',
188
- 'name' => 'Good rating',
189
- 'description' => 'Select the color to be used when the rating is good. ( >5 and <7.5)',
190
- 'id' => 'cwppos_rating_good',
191
- 'default' => '#50C1E9',
192
- ),
193
- array(
194
- 'type' => 'color',
195
- 'name' => 'Very good rating',
196
- 'description' => 'Select the color to be used when the rating is very good. ( 7.5 < and <10)',
197
- 'id' => 'cwppos_rating_very_good',
198
- 'default' => '#8DC153',
199
- ),
200
- ),
201
- ),
202
- array(
203
- 'type' => 'tab',
204
- 'name' => 'Typography',
205
- 'options' => array(
206
- array(
207
- 'type' => 'title',
208
- 'name' => 'Typography options',
209
- ),
210
- array(
211
- 'type' => 'color',
212
- 'name' => 'Font color',
213
- 'description' => 'Select the color to be used on the font.',
214
- 'id' => 'cwppos_font_color',
215
- 'default' => '#3D3D3D',
216
- ),
217
- array(
218
- 'type' => 'color',
219
- 'name' => "'Pros' text color",
220
- 'description' => "Select the color to be used on the 'Pros' text.",
221
- 'id' => 'cwppos_pros_color',
222
- 'default' => '#8DC153',
223
- ),
224
- array(
225
- 'type' => 'color',
226
- 'name' => "'Cons' text color",
227
- 'description' => "Select the color to be used on the 'Cons' text.",
228
- 'id' => 'cwppos_cons_color',
229
- 'default' => '#C15353',
230
- ),
231
- array(
232
- 'type' => 'input_text',
233
- 'name' => 'Pros text',
234
- 'description' => 'Specify text for pros heading',
235
- 'id' => 'cwppos_pros_text',
236
- 'default' => 'Pros',
237
- ),
238
- array(
239
- 'type' => 'input_text',
240
- 'name' => 'Cons text',
241
- 'description' => 'Specify text for cons heading',
242
- 'id' => 'cwppos_cons_text',
243
- 'default' => 'Cons',
244
- ),
245
- array(
246
- 'type' => 'color',
247
- 'name' => 'Review box border',
248
- 'description' => 'Select the border color to be used on the review box',
249
- 'id' => 'cwppos_reviewboxbd_color',
250
- 'default' => '#3BAEDA',
251
- ),
252
- array(
253
- 'type' => 'input_text',
254
- 'name' => 'Review box border width',
255
- 'description' => 'Select the width in pixels of the top border of the review box',
256
- 'id' => 'cwppos_reviewboxbd_width',
257
- 'default' => '5',
258
- ),
259
- ),
260
- ),
261
- array(
262
- 'type' => 'tab',
263
- 'name' => 'Buy button',
264
- 'options' => array(
265
- array(
266
- 'type' => 'title',
267
- 'name' => 'Buy button options',
268
- ),
269
- array(
270
- 'type' => 'select',
271
- 'name' => 'Show button icon',
272
- 'description' => 'Show icon on the cart icon on button.',
273
- 'id' => 'cwppos_show_icon',
274
- 'options' => array( 'yes' => 'Yes', 'no' => 'No' ),
275
- 'default' => 'yes',
276
- ),
277
- array(
278
- 'type' => 'color',
279
- 'name' => 'Button border',
280
- 'description' => 'Select the border color to be used on the buy button for the default state',
281
- 'id' => 'cwppos_buttonbd_color',
282
- 'default' => '#3BAEDA',
283
- ),
284
- array(
285
- 'type' => 'color',
286
- 'name' => 'Button border hover',
287
- 'description' => 'Select the border color to be used on the buy button for the hover state',
288
- 'id' => 'cwppos_buttonbh_color',
289
- 'default' => '#3BAEDA',
290
- ),
291
- array(
292
- 'type' => 'color',
293
- 'name' => 'Button background',
294
- 'description' => 'Select the background color to be used on the buy button for the default state',
295
- 'id' => 'cwppos_buttonbkd_color',
296
- 'default' => '#ffffff',
297
- ),
298
- array(
299
- 'type' => 'color',
300
- 'name' => 'Button background hover',
301
- 'description' => 'Select the background color to be used on the buy button for the hover state',
302
- 'id' => 'cwppos_buttonbkh_color',
303
- 'default' => '#3BAEDA',
304
- ),
305
- array(
306
- 'type' => 'color',
307
- 'name' => 'Button text color',
308
- 'description' => 'Select the text color to be used on the buy button for the default state',
309
- 'id' => 'cwppos_buttontxtd_color',
310
- 'default' => '#3BAEDA',
311
- ),
312
- array(
313
- 'type' => 'color',
314
- 'name' => 'Button text color hover',
315
- 'description' => 'Select the text color to be used on the buy button for the hover state',
316
- 'id' => 'cwppos_buttontxth_color',
317
- 'default' => '#FFFFFF',
318
- ),
319
- ),
320
- ),
321
- );
322
-
323
- }
324
-
325
- }
326
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/inc/loader.php DELETED
@@ -1,414 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- add_action( 'admin_menu', 'cwppos_options_add_page' );
6
-
7
- function cwppos_options_add_page() {
8
-
9
- $render = new cwpposRenderView();
10
- add_menu_page( __( cwppos_config( 'admin_page_title' ), 'cwppos' ), __( cwppos_config( 'admin_page_menu_name' ), 'cwppos' ), 'manage_options', cwppos_config( 'menu_slug' ), array( $render, 'show' ), 'dashicons-star-half' ,'99.87414' );
11
- if ( ! class_exists( 'CWP_PR_PRO_Core' ) ) {
12
- add_submenu_page( cwppos_config("menu_slug"), __( cwppos_config("pro_page_title"), 'cwppos' ), __( cwppos_config("pro_page_menu_name"), 'cwppos' ), 'manage_options', "cwppos_pro", array($render, 'pro'));
13
- }
14
- }
15
-
16
- function cwppos_pro_features() {
17
- include_once WPPR_PATH . '/admin/layout/pro.php';
18
- }
19
-
20
- function cwppos_config( $config_name, $echo = 0 ) {
21
-
22
- $return = '';
23
- cwpposConfig::init();
24
- $return = cwpposConfig::$$config_name;
25
- if ( $echo ) {
26
- echo $return; } else { return $return; }
27
- }
28
-
29
- function cwppos_get_options() {
30
- $error = cwppos_check_config();
31
- if ( ! empty( $error ) ) { return false; }
32
- $options = get_option( cwppos_config( 'menu_slug' ) );
33
- $default = cwpposConfig::$structure;
34
- }
35
-
36
- function cwppos_check_element( $field, $tab ) {
37
- $errors = array();
38
- $group_fields = array( 'type','name','options' );
39
- $input_text = array( 'type','name','description','id','default' );
40
- $input_number = array_merge( $input_text,array( 'max', 'min', 'step' ) );
41
- $select = $mselect = $checkbox = $radio = array_merge( $input_text,array( 'options' ) );
42
-
43
- $textarea = $editor = $color = $image = $typo = $bg = $input_text;
44
-
45
- switch ( $field['type'] ) {
46
- case 'input_text':
47
-
48
- $keys = array_keys( $field );
49
- $dif = array_diff( $input_text,$keys );
50
- if ( ! empty( $dif ) ) {
51
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
52
- break;
53
- }
54
-
55
- break;
56
- case 'input_number':
57
-
58
- $keys = array_keys( $field );
59
- $dif = array_diff( $input_number,$keys );
60
-
61
- if ( ! empty( $dif ) ) {
62
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
63
- break;
64
- }
65
-
66
- break;
67
- case 'textarea':
68
-
69
- $keys = array_keys( $field );
70
- $dif = array_diff( $input_text,$keys );
71
- if ( ! empty( $dif ) ) {
72
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
73
- break;
74
- }
75
-
76
- break;
77
- case 'textarea_html':
78
-
79
- $keys = array_keys( $field );
80
- $dif = array_diff( $input_text,$keys );
81
- if ( ! empty( $dif ) ) {
82
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
83
- break;
84
- }
85
-
86
- break;
87
- case 'editor':
88
-
89
- $keys = array_keys( $field );
90
- $dif = array_diff( $input_text,$keys );
91
- if ( ! empty( $dif ) ) {
92
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
93
- break;
94
- }
95
-
96
- break;
97
- case 'color':
98
-
99
- $keys = array_keys( $field );
100
- $dif = array_diff( $input_text,$keys );
101
- if ( ! empty( $dif ) ) {
102
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
103
- break;
104
- }
105
-
106
- break;
107
- case 'image':
108
-
109
- $keys = array_keys( $field );
110
- $dif = array_diff( $input_text,$keys );
111
- if ( ! empty( $dif ) ) {
112
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
113
- break;
114
- }
115
-
116
- break;
117
- case 'typography':
118
-
119
- $keys = array_keys( $field );
120
- $dif = array_diff( $input_text,$keys );
121
- if ( ! empty( $dif ) ) {
122
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
123
- break;
124
- }
125
- $defaults = array( 'font','color','style','size' );
126
- $kkeys = array_keys( $field['default'] );
127
-
128
- $ddif = array_diff( $defaults,$kkeys );
129
- if ( ! empty( $ddif ) ) {
130
- $errors[] = 'You have not added the ' . implode( ',',$ddif ) . ' keys for the ' . $field['nume'] . ' in tab ' . $tab . ' on option no.: ' . $r;
131
- break;
132
- }
133
-
134
- break;
135
- case 'background':
136
-
137
- $keys = array_keys( $field );
138
- $dif = array_diff( $input_text,$keys );
139
- if ( ! empty( $dif ) ) {
140
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
141
- break;
142
- }
143
- $defaults = array( 'bgcolor','bgimage','bgposition','bgrepeat','bgattachment' );
144
- $kkeys = array_keys( $field['default'] );
145
- $ddif = array_diff( $defaults,$kkeys );
146
-
147
- if ( ! empty( $ddif ) ) {
148
- $errors[] = 'You have not added the ' . implode( ',',$ddif ) . ' keys for the ' . $field['name'] . ' in tab ' . $tab . ' tab ';
149
- break;
150
- }
151
-
152
- break;
153
- case 'input_number':
154
- $keys = array_keys( $field );
155
- $dif = array_diff( $input_number,$keys );
156
- if ( ! empty( $dif ) ) {
157
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
158
- break;
159
- }
160
- break;
161
- case 'select':
162
- $keys = array_keys( $field );
163
- $dif = array_diff( $select,$keys );
164
- if ( ! empty( $dif ) ) {
165
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
166
- break;
167
- }
168
- $no = array();
169
- foreach ( $field['options'] as $ov => $op ) {
170
- $no[ esc_attr( $ov ) ] = esc_html( $op );
171
- }
172
- $kno = array_keys( $no );
173
- if ( ! in_array( $field['default'],$kno ) ) {
174
- $errors[] = 'The default value for the select ' . $field['name'] . ' in tab ' . $tab . ' is not in the allowed values. ';
175
- break;
176
- }
177
- break;
178
- case 'radio':
179
- $keys = array_keys( $field );
180
- $dif = array_diff( $select,$keys );
181
- if ( ! empty( $dif ) ) {
182
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
183
- break;
184
- }
185
- $no = array();
186
- foreach ( $field['options'] as $ov => $op ) {
187
- $no[ esc_attr( $ov ) ] = esc_html( $op );
188
- }
189
- $kno = array_keys( $no );
190
- if ( ! in_array( $field['default'],$kno ) ) {
191
- $errors[] = 'The default value for the radio ' . $field['name'] . ' in tab ' . $tab . ' is not in the allowed values. ';
192
- break;
193
- }
194
- break;
195
- case 'multiselect':
196
- $keys = array_keys( $field );
197
- $dif = array_diff( $select,$keys );
198
- if ( ! empty( $dif ) ) {
199
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
200
- break;
201
- }
202
- if ( ! is_array( $field['default'] ) ) {
203
-
204
- $errors[] = 'The default value for the multiselect ' . $field['name'] . ' in tab ' . $tab . ' must be an array. ';
205
- break;
206
- }
207
- $no = array();
208
- foreach ( $field['options'] as $ov => $op ) {
209
- $no[ esc_attr( $ov ) ] = esc_html( $op );
210
- }
211
- $kno = array_keys( $no );
212
- $ddif = array_diff( $field['default'],$kno );
213
-
214
- if ( ! empty( $ddif ) ) {
215
-
216
- $errors[] = 'The default values for the multiselect ' . $field['name'] . ' in tab ' . $tab . ' are not in the allowed values (' . implode( ',',$ddif ) . ') ';
217
- break;
218
- }
219
-
220
- break;
221
- case 'checkbox':
222
- $keys = array_keys( $field );
223
- $dif = array_diff( $select,$keys );
224
- if ( ! empty( $dif ) ) {
225
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $tab . ' tab on .: ' . $field['name'];
226
- break;
227
- }
228
- if ( ! is_array( $field['default'] ) ) {
229
-
230
- $errors[] = 'The default value for the checkbox ' . $field['name'] . ' in tab ' . $tab . ' must be an array. ';
231
- break;
232
- }
233
- $no = array();
234
- foreach ( $field['options'] as $ov => $op ) {
235
- $no[ esc_attr( $ov ) ] = esc_html( $op );
236
- }
237
- $kno = array_keys( $no );
238
- $ddif = array_diff( $field['default'],$kno );
239
-
240
- if ( ! empty( $ddif ) ) {
241
-
242
- $errors[] = 'The default values for the checkbox ' . $field['name'] . ' in tab ' . $tab . ' are not in the allowed values (' . implode( ',',$ddif ) . ') ';
243
- break;
244
- }
245
-
246
- break;
247
-
248
- }
249
- return $errors;
250
- }
251
-
252
-
253
- function cwppos_check_config() {
254
- $errors = array();
255
- $config = cwpposConfig::$structure;
256
-
257
- $tab_fields = array( 'type','name','options' );
258
- $titles = array( 'name','type' );
259
- $title = array_merge( $titles,array( 'default' ) );
260
- foreach ( $config as $k => $fields ) {
261
-
262
- $keys = array_keys( $fields );
263
- $dif = array_diff( $tab_fields,$keys );
264
-
265
- if ( ! empty( $dif ) ) {
266
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for first level item on key : ' . $k;
267
- break;
268
- }
269
-
270
- if ( $fields['type'] == 'tab' ) {
271
-
272
- } else {
273
- $errors[] = 'All first level items from structure must be tabs';
274
- break;
275
- }
276
- foreach ( $fields['options'] as $r => $field ) {
277
- $keys = array_keys( $field );
278
-
279
- $dif = array_diff( $titles,$keys );
280
- if ( ! empty( $dif ) ) {
281
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $fields['name'] . ' tab on option no.: ' . $r;
282
- break;
283
- }
284
- if ( ! isset( $field['default'] ) && ( $field['type'] != 'title' && $field['type'] != 'group' ) ) {
285
- $errors[] = 'You have not added the default key for the ' . $fields['name'] . ' tab on option no.: ' . $r;
286
- break;
287
-
288
- }
289
- if ( $field['type'] == 'group' ) {
290
- if ( ! isset( $field['options'] ) ) {
291
- $errors[] = 'You have not added the option key for the ' . $field['name'] . ' group in ' . $fields['name'] . ' tab on option no.: ' . $r;
292
- break;
293
- }
294
- if ( empty( $field['options'] ) ) {
295
- $errors[] = 'The option array is empty for the ' . $field['name'] . ' group in ' . $fields['name'] . ' tab on option no.: ' . $r;
296
- break;
297
-
298
- }
299
- foreach ( $field['options'] as $m => $gfield ) {
300
- $keys = array_keys( $gfield );
301
- $dif = array_diff( $title,$keys );
302
- if ( ! empty( $dif ) ) {
303
- $errors[] = 'You have not added the ' . implode( ',',$dif ) . ' keys for the ' . $fields['name'] . ' tab on option no.: ' . $m;
304
- break;
305
- }
306
-
307
- $errors = array_merge( cwppos_check_element( $gfield,$fields['name'] ),$errors );
308
- }
309
- } else {
310
- $errors = array_merge( cwppos_check_element( $field,$fields['name'] ),$errors );
311
- }
312
- }
313
- if ( ! empty( $errors ) ) { break; }
314
- }
315
-
316
- return $errors;
317
- }
318
-
319
- function cwppos_get_config_defaults( $structure ) {
320
- $defaults = array();
321
- foreach ( $structure as $k => $fields ) {
322
-
323
- if ( $fields['type'] == 'tab' ) {
324
-
325
- foreach ( $fields['options'] as $r => $field ) {
326
-
327
- if ( $field['type'] == 'group' ) {
328
-
329
- foreach ( $field['options'] as $m => $gfield ) {
330
- if ( $gfield['type'] != 'title' ) {
331
- $defaults[ $gfield['id'] ] = $gfield['default']; }
332
- }
333
- } else {
334
- if ( $field['type'] != 'title' ) {
335
- $defaults[ $field['id'] ] = $field['default']; }
336
- }
337
- }
338
- }
339
- }
340
- return $defaults;
341
- }
342
-
343
- function cwppos_admin_notice() {
344
-
345
- $errors = cwppos_check_config();
346
- if ( ! empty( $errors ) ) {
347
- foreach ( $errors as $error ) {
348
- ?>
349
- <div id="message" class="error"> <p><strong><?php echo $error; ?></strong></p></div>
350
-
351
- <?php
352
- }
353
- }
354
- }
355
-
356
- function cwppos_check_options() {
357
- $option = get_option( cwppos_config( 'menu_slug' ) );
358
- if ( $option === false ) { cwppos_add_options(); }
359
- }
360
-
361
-
362
- function cwppos_add_options() {
363
- /*
364
- $errors = cwppos_check_config();
365
- if(!empty($errors)) return false; */
366
- $validator = new cwpposOptionsValidator();
367
- $option = get_option( cwppos_config( 'menu_slug' ) );
368
- $structure = cwpposConfig::$structure;
369
- $defaults = cwppos_get_config_defaults( $structure );
370
- $defaults = $validator->validate_defaults();
371
- $options = array_merge( $defaults,is_array( $option ) ? $option : array() );
372
-
373
- if ( ! is_array( $option ) ) {
374
- add_option( cwppos_config( 'menu_slug' ),$options,'','no' ); } else { update_option( cwppos_config( 'menu_slug' ),$options ); }
375
- if ( function_exists( 'register_setting' ) ) {
376
- register_setting( cwppos_config( 'menu_slug' ), cwppos_config( 'menu_slug' ), array( $validator, 'validate' ) );
377
- }
378
- }
379
-
380
-
381
- function cwppos_load_defaults_callback() {
382
- $errors = cwppos_check_config();
383
- if ( ! empty( $errors ) ) { return false; }
384
- delete_option( cwppos_config( 'menu_slug' ) );
385
- $validator = new cwpposOptionsValidator();
386
- $structure = cwpposConfig::$structure;
387
- $defaults = cwppos_get_config_defaults( $structure );
388
- $defaults = $validator->validate_defaults();
389
-
390
- add_option( cwppos_config( 'menu_slug' ),$defaults,'','no' );
391
-
392
- die();
393
- }
394
-
395
- function cwppos( $name = '' ) {
396
- $op = get_option( cwppos_config( 'menu_slug' ) );
397
- if ( empty( $name ) ) {
398
- return $op; }
399
-
400
- if ( isset( $op[ $name ] ) ) {
401
- return $op[ $name ];
402
- }
403
- return null;
404
- }
405
-
406
-
407
-
408
- add_action( 'admin_init','cwppos_add_options',999999 );
409
- add_action( 'init','cwppos_check_options' );
410
- add_action( 'admin_notices', 'cwppos_admin_notice' );
411
- add_action( 'wp_ajax_cwp_load_defaults', 'cwppos_load_defaults_callback' );
412
-
413
-
414
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/inc/render.php DELETED
@@ -1,608 +0,0 @@
1
- <?php
2
-
3
- class cwpposRenderView {
4
- public $data = array();
5
- private $css = array();
6
- private $js = array();
7
- public $tabs = array();
8
- public $options = array();
9
- public function __construct() {
10
-
11
- $css_path = cwppos_config( 'admin_template_directory_uri' ) . '/css/';
12
- $js_path = cwppos_config( 'admin_template_directory_uri' ) . '/js/';
13
- $this->add_css( 'main_page_css',$css_path . 'main_page.css' );
14
- $this->add_js( 'wp_product_review_main_page_js',$js_path . 'admin.js' );
15
- $this->add_js( 'typsy',$js_path . 'tipsy.js' );
16
- $this->add_js( 'jquery' );
17
- // $this->add_js("media" );
18
- $this->options = get_option( cwppos_config( 'menu_slug' ) );
19
-
20
- $this->add_js( 'wp-color-picker' );
21
- $this->add_css( 'wp-color-picker' );
22
-
23
- }
24
-
25
- public function add_element( $tabid, $field ) {
26
-
27
- switch ( $field['type'] ) {
28
- case 'input_text':
29
-
30
- $this->add_input_text( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
31
-
32
- break;
33
- case 'input_number':
34
-
35
- $this->add_input_number( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
36
-
37
- break;
38
- case 'textarea':
39
-
40
- $this->add_textarea( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
41
-
42
- break;
43
- case 'textarea_html':
44
- if ( current_user_can( 'unfiltered_html' ) ) {
45
- $this->add_textarea( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) ); } else { $this->add_restriction( $tabid,esc_html( $field['name'] ) ); }
46
-
47
- break;
48
- case 'editor':
49
-
50
- $this->add_editor( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
51
-
52
- break;
53
- case 'color':
54
-
55
- $this->add_color( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
56
-
57
- break;
58
- case 'image':
59
-
60
- $this->add_image( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
61
-
62
- break;
63
- case 'button':
64
-
65
- $this->add_button( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
66
-
67
- break;
68
- case 'typography':
69
-
70
- $this->add_typography( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
71
- break;
72
- case 'background':
73
-
74
- $this->add_background( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
75
- break;
76
- case 'select':
77
-
78
- $no = array();
79
- foreach ( $field['options'] as $ov => $op ) {
80
- $no[ esc_attr( $ov ) ] = esc_html( $op );
81
- }
82
- $this->add_select( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ),$no );
83
- break;
84
- case 'radio':
85
-
86
- $no = array();
87
- foreach ( $field['options'] as $ov => $op ) {
88
- $no[ esc_attr( $ov ) ] = esc_html( $op );
89
- }
90
- $this->add_radio( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ),$no );
91
- break;
92
- case 'multiselect':
93
-
94
- $no = array();
95
- foreach ( $field['options'] as $ov => $op ) {
96
- $no[ esc_attr( $ov ) ] = esc_html( $op );
97
- }
98
-
99
- $this->add_multiselect( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ),$no );
100
- break;
101
- case 'checkbox':
102
-
103
- $no = array();
104
- foreach ( $field['options'] as $ov => $op ) {
105
- $no[ esc_attr( $ov ) ] = esc_html( $op );
106
- }
107
-
108
- $this->add_checkbox( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ),$no );
109
- break;
110
- case 'title':
111
- $this->add_title( $tabid,esc_html( $field['name'] ) );
112
- break;
113
-
114
- case 'change_icon':
115
- $this->change_review_icon( $tabid,esc_html( $field['name'] ),esc_html( $field['description'] ),esc_attr( $field['id'] ) );
116
- break;
117
-
118
- }
119
- if ( isset( $errors ) ) { return $errors; }
120
- }
121
- public function show() {
122
- $structure = cwpposConfig::$structure;
123
- $errors = cwppos_check_config();
124
- if ( ! empty( $errors ) ) { return false; }
125
- foreach ( $structure as $k => $fields ) {
126
-
127
- if ( $fields['type'] == 'tab' ) {
128
- $tname = esc_html( $fields['name'] );
129
- $tabid = $this->add_tab( $tname );
130
-
131
- foreach ( $fields['options'] as $r => $field ) {
132
-
133
- if ( $field['type'] == 'group' ) {
134
-
135
- $this->start_group( $tabid,esc_html( $field['name'] ) );
136
- foreach ( $field['options'] as $m => $gfield ) {
137
-
138
- $this->add_element( $tabid,$gfield );
139
- }
140
-
141
- $this->end_group( $tabid );
142
- } else {
143
- $this->add_element( $tabid,$field );
144
- }
145
- }
146
- }
147
- }
148
- $this->render_view( 'main_page' );
149
-
150
- }
151
- public function pro() {
152
- $this->render_view( 'pro' );
153
-
154
- }
155
- public function add_css( $name, $location = '' ) {
156
- if ( $location != '' ) {
157
- wp_register_style( $name, $location, array(), '201306' ); }
158
- $this->css[] = $name;
159
- }
160
- public function add_js( $name, $location = '', $deps = array() ) {
161
-
162
- if ( $location != '' ) {
163
- wp_register_script( $name, $location, $deps, '201306', true ); }
164
- $this->js[] = $name;
165
-
166
- }
167
-
168
- public function render_view( $name ) {
169
- $this->data['tabs'] = $this->tabs;
170
- foreach ( $this->data as $k => $v ) {
171
- $$k = $v;
172
- }
173
- foreach ( $this->css as $file ) {
174
- wp_enqueue_style( $file );
175
- }
176
- foreach ( $this->js as $file ) {
177
- if ( $file == 'media' ) {
178
-
179
- wp_enqueue_media();
180
- }
181
- wp_enqueue_script( $file );
182
- }
183
- include( plugin_dir_path( dirname( __FILE__ ) ) . 'layout/' . $name . '.php' );
184
- }
185
- public function add_tab( $name ) {
186
- $id = strtolower( preg_replace( '/[^a-zA-Z0-9]|\s/', '_',$name ) );
187
- $this->tabs[] =
188
- array(
189
- 'name' => $name,
190
- 'id' => $id,
191
- 'elements' => array(),
192
- );
193
-
194
- return count( $this->tabs ) - 1;
195
- }
196
- public function add_input_text( $tabid, $name, $description, $id, $class = '' ) {
197
- $html = '
198
- <div class="controls ' . $class . '">
199
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p> <input class="cwp_input " placeholder="' . $name . '" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . ']" type="text" value="' . $this->options[ $id ] . '"></div>';
200
-
201
- $this->tabs[ $tabid ]['elements'][] = array(
202
- 'type' => 'input_text',
203
- 'html' => $html,
204
- );
205
-
206
- }
207
-
208
-
209
- public function change_review_icon( $tabid, $name, $description, $id, $class = '' ) {
210
-
211
- $html = "<div class='controls'>
212
- <div class='explain'>$name</div>
213
- <p class='field_description'>$description</p>";
214
-
215
- $html .= '<li>';
216
-
217
- if ( cwppos( 'cwppos_show_poweredby' ) == 'yes' || function_exists( 'wppr_ci_custom_bar_icon' ) ) {
218
-
219
- wp_enqueue_script( 'cwp-custom-bar-icon', WPPR_URL . '/admin/layout/js/custom-bar-icon.js', false, WPPR_LITE_VERSION, 'all' );
220
- if ( cwppos( 'cwppos_fontawesome' ) === 'no' ) {
221
- wp_enqueue_style( 'font-awesome-cdn', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' );
222
- }
223
-
224
- $html .= "<button id='cwp_select_bar_icon'>Select Bar Icon</button>";
225
- $html .= "<input type='hidden' id='cwp_bar_icon_field' name='" . cwppos_config( 'menu_slug' ) . '[' . $id . "][]' value='";
226
- if ( isset( $this->options[ $id ] ) ) {
227
- $html .= (isset( $this->options[ $id ][0] )) ? $this->options[ $id ][0] : $this->options[ $id ];
228
- }
229
-
230
- $html .= "'/> <span class='current_bar_icon'>";
231
- if ( ! empty( $this->options[ $id ][0] ) ) {
232
- // var_dump($this->options[$id][0]);
233
- if ( $this->options[ $id ][0] === '#' ) {
234
-
235
- $code = $this->options[ $id ];
236
- } else { $code = $this->options[ $id ][0]; }
237
-
238
- $html .= "<i class='fa fa-fw'>&" . $code . "</i> <a href='#' class='useDefault'>Use Default Styling</a>";
239
- } else {
240
- $html .= '* Currently set to the default styling</span>';
241
- }
242
- } else {
243
- $html .= '<span style="color:red;">' . __( 'You need the PRO <a style="color:red;" href="http://bit.ly/2bhylar" target="_blank" >add-on</a> in order to change the review icons.','cwppos' ) . '</span>';
244
- }
245
- $html .= '</li>';
246
-
247
- $html .= '</div>';
248
-
249
- $this->tabs[ $tabid ]['elements'][] = array( 'type' => 'change_icon', 'html' => $html );
250
- }
251
-
252
-
253
-
254
-
255
- public function get_fonts() {
256
- return array(
257
- 'arial' => 'Arial',
258
- 'verdana' => 'Verdana, Geneva',
259
- 'trebuchet' => 'Trebuchet',
260
- 'georgia' => 'Georgia',
261
- 'times' => 'Times New Roman',
262
- 'tahoma' => 'Tahoma, Geneva',
263
- 'palatino' => 'Palatino',
264
- 'helvetica' => 'Helvetica*',
265
- );
266
- }
267
- public function get_font_styles() {
268
- return array(
269
- 'normal' => __( 'Normal', 'cwppos' ),
270
- 'italic' => __( 'Italic', 'cwppos' ),
271
- 'bold' => __( 'Bold', 'cwppos' ),
272
- 'bold italic' => __( 'Bold Italic', 'cwppos' ),
273
- );
274
- }
275
- public function get_font_sizes() {
276
- $sizes = range( 9, 71 );
277
- $sizes = array_map( 'absint', $sizes );
278
- return $sizes;
279
- }
280
- public function add_typography( $tabid, $name, $description, $id, $class = '' ) {
281
- $fonts = $this->get_fonts();
282
- $style = $this->get_font_styles();
283
- $sizes = $this->get_font_sizes();
284
- $html = '
285
- <div class="controls ' . $class . '">
286
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p> <div class="cwp_typo">
287
-
288
- <input type="hidden" id="' . $id . '_color" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][color]" value="' . $this->options[ $id ]['color'] . '"/>
289
- <input type="text" name="" class="subo-color-picker" id="' . $id . '_color_selector" value="' . $this->options[ $id ]['color'] . '" />
290
-
291
- <select class="cwp_select cwp_tipsy" original-title="Font family" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][font]" > ';
292
- foreach ( $fonts as $k => $v ) {
293
-
294
- $html .= "<option value='" . $k . "' " . ($this->options[ $id ]['font'] == $k ? 'selected' : '') . '>' . $v . '</option>';
295
- }
296
-
297
- $html .= '</select>
298
- <select class="cwp_select cwp_tipsy" original-title="Font style" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][style]" > ';
299
- foreach ( $style as $k => $v ) {
300
-
301
- $html .= "<option value='" . $k . "' " . ($this->options[ $id ]['style'] == $k ? 'selected' : '') . '>' . $v . '</option>';
302
- }
303
-
304
- $html .= '</select>
305
- <select class="cwp_select cwp_tipsy" original-title="Font size" " name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][size]" > ';
306
- foreach ( $sizes as $v ) {
307
-
308
- $html .= "<option value='" . $v . "' " . ($this->options[ $id ]['size'] == $v ? 'selected' : '') . '>' . $v . 'px</option>';
309
- }
310
-
311
- $html .= '</select>
312
-
313
- </div></div>';
314
-
315
- $this->tabs[ $tabid ]['elements'][] = array(
316
- 'type' => 'typography',
317
- 'html' => $html,
318
- );
319
-
320
- }
321
-
322
- public function get_bg_repeat() {
323
-
324
- return array(
325
- 'no-repeat' => __( 'No Repeat', 'cwppos' ),
326
- 'repeat-x' => __( 'Repeat Horizontally', 'cwppos' ),
327
- 'repeat-y' => __( 'Repeat Vertically', 'cwppos' ),
328
- 'repeat' => __( 'Repeat All', 'cwppos' ),
329
- );
330
- }
331
- public function get_bg_position() {
332
- return array(
333
- 'top left' => __( 'Top Left', 'cwppos' ),
334
- 'top center' => __( 'Top Center', 'cwppos' ),
335
- 'top right' => __( 'Top Right', 'cwppos' ),
336
- 'center left' => __( 'Middle Left', 'cwppos' ),
337
- 'center center' => __( 'Middle Center', 'cwppos' ),
338
- 'center right' => __( 'Middle Right', 'cwppos' ),
339
- 'bottom left' => __( 'Bottom Left', 'cwppos' ),
340
- 'bottom center' => __( 'Bottom Center', 'cwppos' ),
341
- 'bottom right' => __( 'Bottom Right', 'cwppos' ),
342
- );
343
- }
344
- public function get_bg_attachment() {
345
- return array(
346
- 'scroll' => __( 'Scroll Normally', 'cwppos' ),
347
- 'fixed' => __( 'Fixed in Place', 'cwppos' ),
348
- );
349
-
350
- }
351
- public function add_background( $tabid, $name, $description, $id, $class = '' ) {
352
- $repeats = $this->get_bg_repeat();
353
- $positions = $this->get_bg_position();
354
- $attachments = $this->get_bg_attachment();
355
- $html = '
356
- <div class="controls ' . $class . '">
357
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p><div class="cwp_background">
358
- <div class="cwp_bgstyle">
359
- <div class="cwp_bgimage">
360
- <input type="hidden" id="' . $id . '" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][bgimage]" value="' . $this->options[ $id ]['bgimage'] . '"/>
361
- <img src="' . $this->options[ $id ]['bgimage'] . '" id="' . $id . '_image" class="image-preview-input"/><br/>
362
- <a id="' . $id . '_button" class="selector-image button" >Select Image</a>
363
-
364
- <a id="' . $id . '_buttonclear" class="clear-image button" >Clear image</a>
365
- </div>
366
- <div class="cwp_bgcolor">
367
- <input type="hidden" id="' . $id . '_color" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][bgcolor]" value="' . $this->options[ $id ]['bgcolor'] . '"/> <br/>
368
- <input type="text" name="" class="subo-color-picker" id="' . $id . '_color_selector" value="' . $this->options[ $id ]['bgcolor'] . '" />
369
- </div><div class="clear"></div>
370
- </div>
371
- <div class="cwp_bgformat">
372
-
373
- <select class="cwp_select cwp_tipsy" original-title="Background repeat" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][bgrepeat]" > ';
374
- foreach ( $repeats as $k => $v ) {
375
-
376
- $html .= "<option value='" . $k . "' " . ($this->options[ $id ]['bgrepeat'] == $k ? 'selected' : '') . '>' . $v . '</option>';
377
- }
378
-
379
- $html .= '</select>
380
- <select class="cwp_select cwp_tipsy" original-title="Background position" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][bgposition]" > ';
381
- foreach ( $positions as $k => $v ) {
382
-
383
- $html .= "<option value='" . $k . "' " . ($this->options[ $id ]['bgposition'] == $k ? 'selected' : '') . '>' . $v . '</option>';
384
- }
385
-
386
- $html .= '</select>
387
- <select class="cwp_select cwp_tipsy" original-title="Background attachament" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][bgattachment]" > ';
388
- foreach ( $attachments as $k => $v ) {
389
-
390
- $html .= "<option value='" . $k . "' " . ($this->options[ $id ]['bgattachment'] == $k ? 'selected' : '') . '>' . $v . '</option>';
391
- }
392
-
393
- $html .= '</select>
394
- </div>
395
-
396
- </div>
397
-
398
-
399
- </div>';
400
-
401
- $this->tabs[ $tabid ]['elements'][] = array(
402
- 'type' => 'textarea',
403
- 'html' => $html,
404
- );
405
-
406
- }
407
- public function add_textarea( $tabid, $name, $description, $id, $class = '' ) {
408
-
409
- $html = '
410
- <div class="controls ' . $class . '">
411
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p> <textarea class="cwp_textarea " placeholder="' . $name . '" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . ']" >' . $this->options[ $id ] . '</textarea></div>';
412
-
413
- $this->tabs[ $tabid ]['elements'][] = array(
414
- 'type' => 'textarea',
415
- 'html' => $html,
416
- );
417
-
418
- }
419
- public function add_restriction( $tabid, $name ) {
420
-
421
- $html = '
422
- <div class="controls ' . $class . '">
423
- <div class="explain">' . $name . '</div><p class="field_description">You need to have the capability to add HTML in order to use this feature !</p></div>';
424
-
425
- $this->tabs[ $tabid ]['elements'][] = array(
426
- 'type' => 'textarea_html',
427
- 'html' => $html,
428
- );
429
-
430
- }
431
- public function add_editor( $tabid, $name, $description, $id, $class = '' ) {
432
- ob_start();
433
-
434
- wp_editor( $this->options[ $id ], cwppos_config( 'menu_slug' ) . '[' . $id . ']' );
435
-
436
- $editor_contents = ob_get_clean();
437
-
438
- $html = '
439
- <div class="controls ' . $class . '">
440
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p>' . $editor_contents . '</div>';
441
-
442
- $this->tabs[ $tabid ]['elements'][] = array(
443
- 'type' => 'editor',
444
- 'html' => $html,
445
- );
446
-
447
- }
448
- public function add_input_number( $tabid, $name, $description, $id, $min = false, $max = false, $step = false, $class = '' ) {
449
- $html = '
450
- <div class="controls ' . $class . '">
451
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p> <input placeholder="' . $name . '" type="number" class="cwp_input" value="' . $this->options[ $id ] . '" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . ']"
452
- ' . ($min === false ? '' : ' min = "' . $min . '" ') . '
453
- ' . ($max === false ? '' : ' max = "' . $max . '" ') . '
454
- ' . ($step === false ? '' : ' step = "' . $step . '" ') . '
455
- > </div>';
456
-
457
- $this->tabs[ $tabid ]['elements'][] = array(
458
- 'type' => 'input_number',
459
- 'html' => $html,
460
- );
461
-
462
- }
463
-
464
- public function add_select( $tabid, $name, $description, $id, $options, $class = '' ) {
465
-
466
- $html = '
467
- <div class="controls ' . $class . '">
468
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p>';
469
-
470
- $html .= '<select class=" cwp_select" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . ']" > ';
471
-
472
- foreach ( $options as $k => $v ) {
473
-
474
- $html .= "<option value='" . $k . "' " . ($this->options[ $id ] == $k ? 'selected' : '') . '>' . $v . '</option>';
475
- }
476
-
477
- $html .= '</select></div>';
478
-
479
- $this->tabs[ $tabid ]['elements'][] = array(
480
- 'type' => 'select',
481
- 'html' => $html,
482
- );
483
- }
484
- public function add_multiselect( $tabid, $name, $description, $id, $options, $class = '' ) {
485
-
486
- $html = '
487
- <div class="controls ' . $class . '">
488
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p> <select name="' . cwppos_config( 'menu_slug' ) . '[' . $id . '][]" class="cwp_multiselect" multiple > ';
489
- foreach ( $options as $k => $v ) {
490
-
491
- $html .= "<option value='" . $k . "' " . (in_array( $k,$this->options[ $id ] ) ? 'selected' : '') . '>' . $v . '</option>';
492
- }
493
-
494
- $html .= '</select></div>';
495
- $this->tabs[ $tabid ]['elements'][] = array(
496
- 'type' => 'multiselect',
497
- 'html' => $html,
498
- );
499
- }
500
- public function add_checkbox( $tabid, $name, $description, $id, $options, $class = '' ) {
501
-
502
- $html = '
503
- <div class="controls ' . $class . '">
504
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p> ';
505
- foreach ( $options as $k => $v ) {
506
-
507
- $html .= "<label class='cwp_label'><input class='cwp_checkbox' type=\"checkbox\" name='" . cwppos_config( 'menu_slug' ) . '[' . $id . "][]' value='" . $k . "' " . (in_array( $k,$this->options[ $id ] ) ? 'checked' : '') . ' >' . $v . '</label>';
508
- }
509
-
510
- $html .= '</div>';
511
- $this->tabs[ $tabid ]['elements'][] = array(
512
- 'type' => 'checkbox',
513
- 'html' => $html,
514
- );
515
- }
516
-
517
-
518
-
519
- public function add_radio( $tabid, $name, $description, $id, $options, $class = '' ) {
520
-
521
- $html = '
522
- <div class="controls ' . $class . '">
523
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p> ';
524
- foreach ( $options as $k => $v ) {
525
-
526
- $html .= "<label class='cwp_label'><input class='cwp_radio' type=\"radio\" name='" . cwppos_config( 'menu_slug' ) . '[' . $id . "]' value='" . $k . "' " . ($this->options[ $id ] == $k ? 'checked' : '') . '>' . $v . '</label>';
527
- }
528
-
529
- $html .= '</div>';
530
- $this->tabs[ $tabid ]['elements'][] = array(
531
- 'type' => 'radio',
532
- 'html' => $html,
533
- );
534
- }
535
-
536
-
537
-
538
- public function add_image( $tabid, $name, $description, $id, $class = '' ) {
539
- $html = '
540
- <div class="controls ' . $class . '">
541
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p>
542
- <input type="hidden" id="' . $id . '" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . ']" value="' . $this->options[ $id ] . '"/>
543
- <img src="' . $this->options[ $id ] . '" id="' . $id . '_image" class="image-preview-input"/><br/>
544
- <a id="' . $id . '_button" class="selector-image button" >Select Image</a>
545
- <a id="' . $id . '_buttonclear" class="clear-image button" >Clear image</a>
546
-
547
- </div>';
548
-
549
- $this->tabs[ $tabid ]['elements'][] = array(
550
- 'type' => 'image',
551
- 'html' => $html,
552
- );
553
- }
554
-
555
- public function add_button( $tabid, $name, $description, $id, $class = '' ) {
556
- $html = '
557
- <div class="controls ' . $class . ' ">
558
- <div class="explain">' . $name . '</div>
559
- <a href="https://themeisle.com/plugins/wp-product-review-pro-add-on/" class="button" style="color:red; text-decoration: none; ">' . $name . '</a>
560
- </div></div>';
561
- $this->tabs[ $tabid ]['elements'][] = array(
562
- 'type' => 'button',
563
- 'html' => $html,
564
- );
565
- }
566
-
567
- public function add_color( $tabid, $name, $description, $id, $class = '' ) {
568
-
569
- $html = '
570
- <div class="controls ' . $class . ' ">
571
- <div class="explain">' . $name . '</div><p class="field_description">' . $description . '</p>
572
- <input type="hidden" id="' . $id . '_color" name="' . cwppos_config( 'menu_slug' ) . '[' . $id . ']" value="' . $this->options[ $id ] . '"/> </br>
573
- <input type="text" name="" class="subo-color-picker" id="' . $id . '_color_selector" value="' . $this->options[ $id ] . '" /> <br/>
574
- </div>';
575
-
576
- $this->tabs[ $tabid ]['elements'][] = array(
577
- 'type' => 'color',
578
- 'html' => $html,
579
- );
580
- }
581
- public function add_title( $tabid, $name ) {
582
- $html = '<h1 class="tab-title-area">' . $name . '</h1>';
583
- $this->tabs[ $tabid ]['elements'][] = array(
584
- 'type' => 'title',
585
- 'html' => $html,
586
- );
587
-
588
- }
589
-
590
- public function start_group( $tabid, $name ) {
591
- $html = '<div class="group-in-tab">
592
- <p class="group-name">' . $name . '</p>
593
- <div class="group-content">
594
- ';
595
- $this->tabs[ $tabid ]['elements'][] = array(
596
- 'type' => 'group_start',
597
- 'html' => $html,
598
- );
599
- }
600
- public function end_group( $tabid ) {
601
- $html = '</div></div>
602
- ';
603
- $this->tabs[ $tabid ]['elements'][] = array(
604
- 'type' => 'end',
605
- 'html' => $html,
606
- );
607
- }
608
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/layout/css/main_page.css DELETED
@@ -1,1144 +0,0 @@
1
- -----------------------------------------------------------------------------------
2
- /* Admin styles
3
- /*-----------------------------------------------------------------------------------*/
4
-
5
- .updated, .error {
6
- display:none!important
7
- } /* disable the admin notices */
8
- #cwp_container {
9
- margin: 15px;
10
- position:relative;
11
- z-index: 0
12
- }
13
- #cwp_container #header {
14
- height: 70px;
15
- background:#f9f9f9;
16
- border: 1px solid #ccc;
17
- border-radius: 6px 6px 0 0;
18
- -webkit-box-shadow: inset 0 1px 0 #fff;
19
- box-shadow: inset 0 1px 0 #fff;
20
- }
21
- #cwp_container #header .logo {
22
- float: left;
23
- margin:10px 20px;
24
- }
25
- #cwp_container #js-warning {
26
- color: red;
27
- float: left;
28
- margin: 20px 10px;
29
- width: 330px;
30
- }
31
- #cwp_container ul,#cwp_container ol {margin: 0;}
32
- .js #cwp_container #js-warning {
33
- display: none;
34
- }
35
-
36
- #cwp_container #header .logo .cwp_h2 {
37
- display:inline-block;
38
- font-style:normal;
39
- padding-right:5px;
40
- }
41
- #cwp_container #header .logo span {
42
- color:#888888;
43
- }
44
- #cwp_container #header .icon-option {
45
- float: right;
46
- height: 32px;
47
- width: 32px;
48
- background: url(../images/icon_option.png) no-repeat;
49
- margin:20px 30px 0;
50
- }
51
-
52
- #cwp_container #info_bar {
53
- background: #f3f3f3;
54
- border:solid #d8d8d8;
55
- border-bottom:1px solid #D8D8D8;
56
- border-width:0 1px 1px 1px;
57
- padding: 6px 20px 0 6px;
58
- height: 31px;
59
- text-align: right;
60
- -webkit-box-shadow: inset 0 1px 0 #fcfcfc;
61
- box-shadow: inset 0 1px 0 #fcfcfc;
62
- }
63
-
64
- #cwp_container #expand_options{
65
- cursor: pointer;
66
- display: block;
67
- height: 22px;
68
- width: 21px;
69
- float: left;
70
- font-size:0;
71
- text-indent: -9999px;
72
- margin: 0 0 0 10px;
73
- border: 1px solid #bbb;
74
- border-radius: 2px;
75
- }
76
- #cwp_container #info_bar .expand { background: url(../images/toggle_tabs.png) no-repeat -2px -1px; }
77
- #cwp_container #info_bar .close { background: url(../images/toggle_tabs.png) no-repeat -2px -26px; }
78
- #cwp_container #expand_options:hover {
79
- cursor: pointer;
80
- border-color: #888;
81
- }
82
- #cwp_container #main {
83
- background-color: #f1f1f1;
84
- border-left: 1px solid #d8d8d8;
85
- border-right: 1px solid #d8d8d8;
86
- border-bottom: 1px solid #d8d8d8;
87
- }
88
- #cwp_container #cwp_nav {
89
- float: left;
90
- position: relative;
91
- z-index: 9999;
92
- width: 20%;
93
- }
94
- #cwp_container #cwp_nav ul {
95
- margin:0;
96
- }
97
- #cwp_container #cwp_nav li {
98
- margin-bottom:0;
99
- -webkit-box-shadow: inset 0 1px 0 #f9f9f9;
100
- box-shadow: inset 0 1px 0 #f9f9f9;
101
- margin-right: 1px;
102
- border-bottom: 1px solid #d8d8d8;
103
- }
104
-
105
- #cwp_container #cwp_nav li:last-child {
106
- -webkit-box-shadow: inset 0 1px 0 #f9f9f9, 0 1px 0 #f9f9f9;
107
- box-shadow: inset 0 1px 0 #f9f9f9, 0 1px 0 #f9f9f9;
108
- }
109
-
110
- #cwp_container #cwp_nav li.current {
111
- margin-right: 0;
112
- }
113
-
114
- #cwp_container #cwp_nav li a, #cwp_container #cwp_nav ul li a:link, #cwp_nav ul li a:visited {
115
- display: block;
116
- padding: 10px 10px 10px 40px;
117
- background: no-repeat 16px 10px;
118
- font-weight:bold;
119
- font-size: 12px;
120
- text-decoration: none;
121
- color: #555;
122
- opacity: 0.5;
123
- }
124
- #cwp_container #cwp_nav ul li.current a {
125
- background-color: #fcfcfc;
126
- color: #797979;
127
- opacity: 1;
128
- }
129
-
130
- #cwp_container #cwp_nav ul li a:hover {
131
- color: #d54e21;
132
- opacity: 1;
133
- }
134
-
135
- /*menu icons - customize to your liking*/
136
- #cwp_container #cwp_nav li.logoandmenu a{ background-image:url(../images/icon-header.png);}
137
- #cwp_container #cwp_nav li.footer a{ background-image:url(../images/icon-footer.png);}
138
- #cwp_container #cwp_nav li.stylingoptions a{ background-image:url(../images/icon-paint.png);}
139
- #cwp_container #cwp_nav li.portfolio a{ background-image:url(../images/icon-portfolio.png);}
140
- #cwp_container #cwp_nav li.portfoliopost a{ background-image:url(../images/icon-portfolio_post.png);}
141
- #cwp_container #cwp_nav li.portfoliosidebar a{ background-image:url(../images/icon-portfolio_sidebar.png);}
142
- #cwp_container #cwp_nav li.topline a{ background-image:url(../images/icon-top_line.png);}
143
- #cwp_container #cwp_nav li.backupoptions a {background: url(../images/icon-backup.png) no-repeat;}
144
- #cwp_container #cwp_nav li.tagline a {background: url(../images/icon-tag_line.png) no-repeat;}
145
- #cwp_container #cwp_nav li.generalsettings a{ background-image:url(../images/icon-general_settings.png);}
146
- #cwp_container #cwp_nav li.bottomline a{ background-image:url(../images/icon-bottom_line.png);}
147
- #cwp_container #cwp_nav li.blog a{ background-image:url(../images/icon-blog.png);}
148
- #cwp_container #cwp_nav li.blogpost a{ background-image:url(../images/icon-blog_post.png);}
149
- #cwp_container #cwp_nav li.blogsidebar a{ background-image:url(../images/icon-blog_sidebar.png);}
150
- #cwp_container #cwp_nav li.themeupdate a{ background-image:url(../images/icon-update.png);}
151
- #cwp_container #cwp_nav li.pagesidebar a{ background-image:url(../images/icon-sidebar.png);}
152
- #cwp_container #cwp_nav li.pagination a{ background-image:url(../images/icon-pagination.png);}
153
- #cwp_container #cwp_nav li.preparedstyles a{ background-image:url(../images/icon-preparedstyles.png);}
154
-
155
- #cwp_container #content {
156
- float: left;
157
- min-height: 900px;
158
- width: 75%;
159
- margin-left: -1px;
160
- padding: 0 14px;
161
- font-family: "Lucida Grande", Sans-serif;
162
- background-color: #FCFCFC;
163
- border-left: 1px solid #d8d8d8;
164
- -webkit-box-shadow: inset 0 1px 0 #fff;
165
- box-shadow: inset 0 1px 0 #fff;
166
- }
167
- #cwp_container #content .section {
168
- margin-bottom: 10px;
169
- overflow-y : hidden;
170
- }
171
- #cwp_container #content .section h3.heading {
172
- font-family:;
173
- margin: 9px 0 9px 0;
174
- padding: 7px 0;
175
- border-bottom: 1px solid #e7e7e7;
176
- color:#EC5923
177
- }
178
- #cwp_container #content .section .controls {
179
- float: left;
180
- width: 345px;
181
- margin: 0 15px 0 0;
182
- }
183
- #cwp_container #content .section .explain {
184
- float: left;
185
- width: 225px;
186
- padding: 0 10px 0 0;
187
- font-size: 11px;
188
- color: #999999;
189
- }
190
- #cwp_container #content .section-checkbox .controls {
191
- width:25px
192
- }
193
-
194
- #cwp_container #content .section-multicheck .controls input.checkbox {
195
- margin-top:9px;
196
- }
197
-
198
- #cwp_container #content .section-checkbox .explain {
199
- max-width:93%;
200
- }
201
- #cwp_container #content .section-color .controls {
202
- width:105px
203
- }
204
- #cwp_container #content .section-color .explain {
205
- width:440px
206
- }
207
- #cwp_container #content .section-info h3.heading {
208
- display:none;
209
- }
210
- #cwp_container #content .section-info .controls {
211
- margin: 20px 0 0;
212
- float:none;
213
- width: auto;
214
- }
215
- #cwp_container #content .section-info .controls .cwp_info{
216
- padding: 15px 10px;
217
- line-height: 1.5em;
218
- font-size: 12px;
219
- background-color: #EFF9FF;
220
- border: 1px solid #D6F0FF;
221
- color:#777;
222
- }
223
-
224
- #cwp_container #content .section-info .controls .cwp_info ._icon {
225
- height:16px; width:16px;
226
- margin: 0 10px 0 0;
227
- float: left;
228
- }
229
- #cwp_container #content .section-info .controls small {
230
- font-size: 12px
231
- }
232
- #cwp_container #content .section-info h3.heading {
233
- border-radius: 3px 3px 0 0;
234
- }
235
- #cwp_container #content .section-info .controls {
236
- border-radius: 0 0 3px 3px;
237
- }
238
- #cwp_container .sorter {margin-right: -20px;}
239
- #cwp_container .sorter ul {
240
- background: #F9F9F9;
241
- border: 1px dashed #E3E3E3;
242
- min-height: 40px;
243
- padding: 10px 10px 0;
244
- width: 145px;
245
- float: left;
246
- margin: 0 15px 0 0;
247
- }
248
- #cwp_container .sorter ul h3 {
249
- margin: 0 0 10px;
250
- text-align: center;
251
- color: #777;
252
- text-transform: capitalize;
253
- }
254
- #cwp_container .sorter ul li {
255
- border: 1px solid #DFDFDF;
256
- cursor: move;
257
- font-weight: bold;
258
- margin-bottom:10px;
259
- padding:0 10px;
260
- height: 40px;
261
- line-height: 40px;
262
- background-color: #F1F1F1;
263
- background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));
264
- background-image: -webkit-linear-gradient(top,#f9f9f9,#ececec);
265
- background-image: -webkit-gradient(linear,left top, left bottom,from(#f9f9f9),to(#ececec));
266
- background-image: linear-gradient(top,#f9f9f9,#ececec);
267
- overflow: hidden;
268
- border-radius: 3px;
269
- -webkit-box-shadow: inset 0 1px 0 #fff;
270
- box-shadow: inset 0 1px 0 #fff;
271
- text-align:center;
272
- }
273
-
274
-
275
- #cwp_container #content .section-sorter li.placeholder {
276
- background:#f9f9f9;
277
- border: 1px dashed;
278
- height:40px;}
279
-
280
- #cwp_container #content .section-slider li.placeholder {
281
- background:#f9f9f9;
282
- border: 1px dashed;
283
- height:33px;}
284
-
285
-
286
- #cwp_container .cwp_textarea, #cwp_container .cwp_input, #cwp_container .cwp_select, #cwp_container .cwp_button{
287
- border-radius: 3px;
288
- border: 1px solid;
289
- }
290
- #cwp_container .controls .cwp_input, #cwp_container .controls .cwp_select, #cwp_container .controls .cwp_textarea {
291
-
292
- background-color: #f1f1f1;
293
- border: 1px solid;
294
- border-color: #ccc #e6e6e6 #e6e6e6 #ccc;
295
- width: 340px;
296
- padding: 4px;
297
- font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif;
298
- font-size: 12px;
299
- }
300
- #cwp_container .controls input:hover, #cwp_container .controls textarea:hover {
301
- background-color: #f9f9f9;
302
- }
303
-
304
- #cwp_container .controls input:focus, #cwp_container .controls textarea:focus {
305
- background-color: #fff;
306
- border-color: #ccc #e6e6e6 #e6e6e6 #ccc;
307
- outline:0;
308
- }
309
-
310
- #cwp_container .controls .upload {
311
- width: 340px;
312
- }
313
-
314
-
315
- #cwp_container .controls select {
316
- height: 28px;
317
- padding: 4px 5px;
318
- width: 340px
319
- }
320
- #cwp_container .controls .cwp_textarea {
321
- width: 435px;
322
- }
323
- #cwp_container input[type=text] {
324
- width: 340px;
325
- }
326
- #cwp_container input.checkbox {
327
- width: 30px;
328
- margin-top:3px;
329
- }
330
- #cwp_container input.cwp_radio {
331
- width: 30px;
332
- }
333
- label.radio, label.multicheck {
334
- position: relative;
335
- bottom: 9px;
336
- }
337
- #cwp_container .controls .input-text-small {
338
- width: 60px;
339
- margin-right:10px
340
- }
341
- #cwp_container .meta-two {
342
- margin-right:10px
343
- }
344
- #cwp_container .controls .cwp_color {
345
- float:left;
346
- width: 70px;
347
- margin-left:5px; /* font-size:20px; height:34px;*/
348
- }
349
- #cwp_container #content .section-typography .controls {
350
- width:440px
351
- }
352
- #cwp_container #content .section-typography .explain {
353
- width:130px
354
- }
355
- #cwp_container .controls .cwp_typography-size {
356
- width:70px;
357
- float:left
358
- }
359
- #cwp_container .controls .cwp_typography-unit {
360
- width:60px;
361
- float:left
362
- }
363
- #cwp_container .controls .cwp_typography-face {
364
- width:145px;
365
- float:left
366
- }
367
- #cwp_container .controls .cwp_typography-style {
368
- width:95px;
369
- float:left
370
- }
371
- #cwp_container .controls .cwp_radio-img-img {
372
- border:3px solid #fff;
373
- margin:0 5px 10px 0;
374
- display:none;
375
- cursor:pointer;
376
- float:left;
377
- }
378
- #cwp_container .controls .cwp_radio-img-selected {
379
- border:3px solid #ccc
380
- }
381
- #cwp_container .controls .cwp_radio-img-img:hover {
382
- opacity:.8;
383
- }
384
-
385
- #cwp_container .controls .cwp_radio-tile-img {
386
- width:40px;
387
- height:40px;
388
- border:3px solid #f9f9f9;
389
- margin:0 2px 4px 0;
390
- display:none;
391
- cursor:pointer;
392
- float:left;
393
- }
394
- #cwp_container .controls .cwp_radio-tile-selected {
395
- border:3px solid #ccc
396
- }
397
- #cwp_container .controls .cwp_radio-tile-img:hover {
398
- opacity:.8;
399
- }
400
-
401
- #cwp_container .controls .cwp_border-width {
402
- width:70px;
403
- float:left
404
- }
405
- #cwp_container .controls .cwp_border-style {
406
- width:95px;
407
- float:left
408
- }
409
- #cwp_container .group {
410
- display:none;
411
- padding-bottom:20px;
412
- }
413
- #cwp_container .group h2 {
414
- display:none;
415
- border-bottom:3px solid #e7e7e7
416
- }
417
- #cwp_container .controls input:focus, #cwp_container select:focus, #cwp_container textarea:focus {
418
- background:#fff;
419
- }
420
-
421
- #cwp_container .accept {
422
- background: #DBF6BE no-repeat 10px center;
423
- border: solid #9BBF65;
424
- border-width: 0 1px 1px 1px;
425
- color: #060;
426
- font-weight: bold;
427
- padding: 10px;
428
- text-align: center;
429
- }
430
- #cwp_container .warning {
431
- background: #ffeeee no-repeat 10px center;
432
- ;
433
- border: solid #dfbfbf;
434
- border-width: 0 1px 1px 1px;
435
- color: #333;
436
- font-weight: bold;
437
- padding: 10px;
438
- text-align: center;
439
- }
440
- #cwp_container .update_available {
441
- background: #FFFEEB no-repeat 10px center;
442
- border: solid #CCCCCC;
443
- border-width: 0 1px 1px 1px;
444
- color: #333;
445
- font-weight: bold;
446
- padding: 10px;
447
- text-align: center;
448
- }
449
- #cwp_container .cwp_save-popup {
450
- position:absolute;
451
- background:rgba(0, 0, 0, 0.5);
452
- color:#fff;
453
- font-size:24px;
454
- text-align:center;
455
- display:none;
456
- border-radius: 12px;
457
- }
458
-
459
- #cwp_container .cwp_save-popup div{
460
- background: no-repeat 20px 50%;
461
- padding:30px 30px 30px 60px;
462
- }
463
- #cwp_container .cwp_save-save {
464
- background-image: url(../images/button_check.png);
465
- }
466
- #cwp_container .cwp_save-reset {
467
- background-image: url(../images/sign_warning.png);
468
- }
469
- #cwp_container .cwp_save-fail {
470
- background-image:url(../images/stop.png);
471
- }
472
-
473
- #cwp_container .accept,
474
- #cwp_container .warning,
475
- #cwp_container .update_available,
476
- #cwp_container .cwp_save-popup {
477
- z-index: 9999;
478
- }
479
-
480
- #cwp_container .upload_button_div {
481
- margin-top:7px;
482
- margin-bottom: 15px;
483
- }
484
-
485
- #cwp_container .button {
486
- border-radius: 3px;
487
- border: 1px solid #dfdfdf;
488
- background-color: #fff;
489
- margin:4px 0 4px;
490
- }
491
-
492
-
493
- #cwp_container .button:hover,#cwp_container .button_hover {
494
- border-color: #bbb;
495
- color: #464646;
496
- }
497
-
498
- #cwp_container .button_active {
499
- background:#eee url(../../images/white-grad-active.png) repeat-x scroll left top;
500
- }
501
-
502
- #cwp_container .upload_button_div .button {
503
- padding:4px 7px;
504
- }
505
- #cwp_container .image_reset_button, #cwp_container .mlu_remove_button {
506
- margin-left:10px;
507
- color:#ef521d;
508
- }
509
-
510
- #cwp_container .image_reset_button:hover, #cwp_container .mlu_remove_button:hover {
511
- color:red;
512
- }
513
-
514
- #cwp_container .upload-error {
515
- float:left;
516
- color:#666;
517
- font-size:10px;
518
- font-weight:bold;
519
- text-decoration:none;
520
- text-shadow:1px 1px 0 #FFFFFF;
521
- margin: 0 10px 0 0;
522
- padding:3px 10px;
523
- background:#FFDFEC;
524
- border-radius: 4px;
525
- }
526
- #cwp_container .reset-button {
527
- font-family:Arial,Verdana,sans-serif;
528
- float:left;
529
- padding: 0 7px;
530
- height: 23px;
531
- line-height: 23px;
532
- margin:0 ;
533
- color: #ef521d;
534
- border-color: #bbb;
535
- }
536
-
537
- #cwp_container .reset-button:hover { color: #ef521d; border-color: #888}
538
-
539
- #cwp_container .slide_add_button { float:right; margin-top:10px; }
540
-
541
-
542
- #cwp_container .save_bar {
543
- background: #f3f3f3;
544
- border:solid #ccc;
545
- border-width:0 1px 1px 1px;
546
- padding: 10px 20px 0 20px;
547
- height: 35px;
548
- text-align: right;
549
- border-radius: 0 0 3px 3px;
550
- -webkit-box-shadow: inset 0 1px 0 #fff;
551
- box-shadow: inset 0 1px 0 #fff;
552
- }
553
-
554
- #cwp_save {
555
- font-family: Arial,Verdana,sans-serif;
556
- padding: 0 7px;
557
- height: 23px;
558
- line-height: 23px;
559
- border:1px solid #0a6d9b !important;
560
- float:right;
561
- }
562
-
563
- #cwp_save:hover {
564
- border:1px solid #111 !important;
565
- }
566
-
567
- #cwp_container .hide {
568
- display:none
569
- }
570
- #cwp_container .ajax-loading-img-top {
571
- margin: 5px 4px 0;
572
- float:left
573
- }
574
- #cwp_container .ajax-loading-img-bottom {
575
- margin: 5px 4px 0;
576
- }
577
- #cwp_container .ajax-reset-loading-img {
578
- display: block;
579
- margin-left: 100px;
580
- }
581
-
582
- #cwp_container .screenshot {
583
- max-width:340px;
584
- margin-bottom:9px;
585
- }
586
-
587
- #cwp_container .cwp_uploaded-image {
588
-
589
- }
590
-
591
- #cwp_container .cwp_option-image {
592
- max-width:340px;
593
- padding: 5px;
594
- border:1px solid #e3e3e3;
595
- background:#f7f7f7;
596
- border-radius: 3px;
597
- }
598
- #cwp_container .select_wrapper {
599
- border-radius: 4px;
600
- font-family: "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;
601
- font-size: 12px;
602
- background: #F1F1F1 url(../images/select.png) no-repeat right center;
603
- border-color: #CCC #E6E6E6 #E6E6E6 #CCC;;
604
- border-style: solid;
605
- border-width: 1px;
606
- float: left;
607
- height: 26px;
608
- width: 344px;
609
- margin: 0;
610
- margin-bottom: 9px !important;
611
- width: 340px;
612
- display: block;
613
- color: #888;
614
- position:relative;
615
- }
616
-
617
- #cwp_container .select_wrapper:hover {background-color:#f9f9f9;}
618
-
619
- #cwp_container .mini .controls select, #cwp_container #content .section .mini .controls, #cwp_container .controls .typography-size, #cwp_container .controls .border-width,#cwp_container .controls .mini,#cwp_container .mini .controls input, #cwp_container #content .mini .controls {width: 70px;}
620
- #cwp_container .controls .typography-face {width: 145px;}
621
- #cwp_container .controls .typography-style, #cwp_container .controls .border-style {width: 95px;}
622
- #cwp_container .controls .typography-size,#cwp_container .controls .typography-face,#cwp_container .controls .typography-style, #cwp_container .controls .border-width, #cwp_container .controls .border-style {margin-right:5px;}
623
-
624
- #cwp_container #content .mini .explain {
625
- width:500px;
626
- }
627
- #cwp_container .cwp_notice {
628
- background: #ffd1d1;
629
- border:1px solid #DFDFDF;
630
- -moz-border-radius:8px;
631
- text-align: center;
632
- margin-bottom: 15px
633
- }
634
-
635
- #cwp_container .slider li {
636
- width: 345px;
637
- border: 1px solid #dfdfdf;
638
- background:#f9f9f9;
639
- overflow:hidden;
640
- border-radius: 3px;
641
- -webkit-box-shadow: inset 0 1px 0 #fff;
642
- box-shadow: inset 0 1px 0 #fff;
643
- }
644
-
645
- #cwp_container .slide_header {
646
- cursor:move;
647
- height:32px;
648
- padding-left:10px;
649
- padding-right:20px;
650
- line-height:32px;
651
- background-color: #F1F1F1;
652
- margin: 1px 0 -1px 0;
653
- border-bottom: 1px solid #dfdfdf;
654
- background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));
655
- background-image: -webkit-linear-gradient(top,#f9f9f9,#ececec);
656
- background-image: -webkit-gradient(linear,left top, left bottom,from(#f9f9f9),to(#ececec));
657
- background-image: linear-gradient(top,#f9f9f9,#ececec);
658
- overflow:hidden;
659
- position: relative;
660
- }
661
-
662
- #cwp_container .slide_body {
663
- display:none;
664
- padding:10px 10px 10px 11px;
665
- }
666
-
667
-
668
- #cwp_container .slider li input,#cwp_container .slider li textarea,#cwp_container .slider li .screenshot,#cwp_container .slider li .cwp_option-image {
669
- width:311px;
670
- }
671
-
672
- #cwp_container a.slide_edit_button, #cwp_container a.slide_delete_button {
673
- text-indent:-9999px;
674
- font-size:0;
675
- }
676
- #cwp_container a.slide_edit_button {
677
- position: absolute;
678
- right: 0;
679
- top: 0;
680
- width:32px;
681
- height:32px;
682
- background: url(../images/dropdown-arrow.png) no-repeat 9px -28px;
683
- }
684
- #cwp_container a:hover.slide_edit_button {
685
- background: url(../images/dropdown-arrow.png) no-repeat 9px 11px;}
686
-
687
- #cwp_container a.slide_delete_button {
688
- float: right;
689
- margin: 0 0 0 7px;
690
- width:16px;
691
- height:16px;
692
- background: url(../images/icon-delete.png) no-repeat
693
- }
694
-
695
- #cwp_container .select_wrapper span {
696
- height: 26px;
697
- line-height: 26px;
698
- z-index: 2;
699
- padding-left: 6px;
700
- position:absolute;
701
- left:0;
702
- }
703
-
704
- #cwp_container .select_wrapper .select {
705
- cursor: pointer;
706
- height: 28px;
707
- margin: 0;
708
- -moz-opacity: 0;
709
- filter: alpha(opacity: 0);
710
- opacity: 0;
711
- padding: 0;
712
- position: relative;
713
- width: inherit;
714
- z-index: 4;
715
- }
716
-
717
- #cwp_backup {
718
- margin: 40px 20px;
719
- width: 600px;
720
- }
721
- #cwp_backup textarea {
722
- margin-bottom: 9px !important;
723
- background-color: #F1F1F1;
724
- border: 1px solid;
725
- width: 100%;
726
- padding: 4px;
727
- font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif;
728
- font-size: 12px;
729
- border-color: #CCC #E6E6E6 #E6E6E6 #CCC;
730
- }
731
-
732
- #cwp_container #content .section-backup .controls { width: 80%}
733
- #cwp_container #content .section-backup .explain {
734
- display:none
735
- }
736
- #cwp_container #content .section-backup .backup-box {
737
- margin: 0 0 20px;
738
- }
739
-
740
- #cwp_container #content .section-backup .instructions {
741
- margin: 0 0 10px;
742
- color: #777;
743
- }
744
- #cwp_container #content .section-backup .button, #cwp_container #content .section-transfer .button {
745
- padding: 5px;
746
- margin: 0 25px 0 0;
747
- line-height: 30px
748
- }
749
-
750
- .temphide {display:none;}
751
- /*-------------------------------------------------------------------------------------------*/
752
- /* GENERAL STYLES */
753
- /*-------------------------------------------------------------------------------------------*/
754
-
755
- /* http://sonspring.com/journal/clearing-floats */
756
-
757
- html body * span.clear, html body * div.clear, html body * li.clear, html body * dd.clear {
758
- background: none;
759
- border: 0;
760
- clear: both;
761
- display: block;
762
- float: none;
763
- font-size: 0;
764
- list-style: none;
765
- margin: 0;
766
- padding: 0;
767
- overflow: hidden;
768
- visibility: hidden;
769
- width: 0;
770
- height: 0;
771
- }
772
-
773
-
774
- /*-------------------------------------------------------------------------------------------*/
775
- /* Tipsy
776
- /*-------------------------------------------------------------------------------------------*/
777
- .tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; }
778
- .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; }
779
-
780
- /* Rounded corners */
781
- .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
782
-
783
- /* Uncomment for shadow */
784
- /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/
785
-
786
- .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
787
-
788
- /* Rules to colour arrows */
789
- .tipsy-arrow-n { border-bottom-color: #000; }
790
- .tipsy-arrow-s { border-top-color: #000; }
791
- .tipsy-arrow-e { border-left-color: #000; }
792
- .tipsy-arrow-w { border-right-color: #000; }
793
-
794
- .tipsy-n .tipsy-arrow { top: 0; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
795
- .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
796
- .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
797
- .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
798
- .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
799
- .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
800
- .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
801
- .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }
802
-
803
- .image-preview-input{
804
- max-width: 270px;
805
- padding: 5px;
806
- border: 1px solid #E3E3E3;
807
- background: #F7F7F7;
808
- border-radius: 3px;
809
- }
810
- .tab-section{
811
- display:none;
812
- }
813
- .image-selector-wrapper{
814
- display:block;
815
- }
816
- .controls .explain {
817
- font-size:14px;
818
- font-weight:bold;
819
- margin-bottom:10px;
820
- }
821
- .controls {
822
- padding-bottom:10px;
823
- }
824
- .controls img[src = '']{
825
- display:none;
826
- }
827
- .text-format-element p {
828
- margin:2px;
829
- }
830
- .text-format-element {
831
- display:block;
832
- float:left;
833
- margin-left:10px;
834
- }
835
- .text-format-element select.select_sizes{
836
- width:80px !important;
837
- }
838
- .text-format-element select.select_fonts{
839
- width:150px !important;
840
- }
841
- .text-format-element select.select_weights{
842
- width:80px !important;
843
- }
844
- .color-select-format{
845
- width : 135px;
846
- }
847
- .controls .explain{
848
- display:block;
849
- width:100%;
850
- margin-top:10px;
851
- padding: 7px 0;
852
- border-bottom: 1px solid #E7E7E7;
853
- color: #EC5923;
854
- }
855
- .grouped-controls .explain{
856
- float:left;
857
-
858
- }
859
- .tab-title-area{
860
-
861
- margin-top:10px;
862
- padding: 7px 0;
863
- color: #21759B;
864
- font-size:24px;
865
- }
866
- .wp-color-picker{
867
-
868
- margin-bottom:0 !important;
869
- width:70px !important;
870
- }
871
- .wp-picker-clear{
872
- margin: 0px 0px 0px 6px !important;
873
- width:inherit!important;
874
- padding: 0px 5px !important;
875
-
876
- }
877
-
878
- .group-in-tab .group-name:hover{
879
-
880
- background:#21759B;
881
- color:#ffffff;
882
- }
883
- .group-in-tab .group-content{
884
- display:none;
885
- }
886
-
887
-
888
-
889
- .group-in-tab .group-name{
890
- font-weight:bold;
891
- width:90%;
892
- background:#ffffff;
893
- cursor:pointer;
894
- padding:10px;
895
- color:#21759B;
896
- text-transform:uppercase;
897
- font-size:17px;
898
- }
899
-
900
- .group-in-tab .group-name:after { }
901
-
902
- .grouped-controls + .controls .explain{
903
- float:left;
904
- }
905
- #cwp_container .field_description{
906
- margin: 0px 0px 5px;
907
- font-size:12px;
908
- }
909
- #cwp_container .cwp_textarea{
910
- height:140px;
911
- }
912
- #cwp_container .controls .cwp_multiselect{
913
- height:auto;
914
- }
915
- #cwp_container .controls .cwp_label{
916
- width:100%;
917
- display:block;
918
- margin-top:5px;
919
- margin-bottom:5px;
920
- }
921
- #cwp_container .controls .cwp_checkbox{
922
- width:20px;
923
- }
924
- #cwp_container .controls .cwp_typo{
925
- width:100%;
926
- margin:10px;
927
- }
928
- #cwp_container .controls .cwp_typo .cwp_select{
929
- width:100px;
930
- }
931
- #cwp_container .controls .cwp_bgformat{
932
- margin-top:20px;
933
- }
934
- #cwp_container .controls .cwp_bgformat .cwp_select{
935
- width:30%;
936
- }
937
- #cwp_container .controls .cwp_typo .wp-picker-container, #cwp_container .controls .cwp_bgcolor .wp-picker-container{
938
- line-height:33px;
939
- }
940
- #cwp_container .controls .cwp_bgcolor .wp-picker-container{
941
- line-height:35px;
942
-
943
- }
944
- #cwp_container .controls .cwp_background, #cwp_container .controls .cwp_bgstyle, #cwp_container .controls .cwp_bgformat{
945
- width:100%;
946
-
947
- }
948
- #cwp_container .controls .cwp_bgcolor,#cwp_container .controls .cwp_bgimage{
949
- width:50%;
950
- float:left;
951
- }
952
- #cwp_container {
953
- display:none;
954
- }
955
- .spinner-reset{
956
- float:left;
957
- }
958
-
959
- .adminLink {
960
- float: left;
961
- margin-right: 15px;
962
- padding-top: 25px;
963
- }
964
-
965
- .cwpred {
966
- color:red;
967
- }
968
- #wpfooter {
969
- display:none;
970
- }
971
-
972
- #pro-features .pro-features-header {
973
- background: #fff;
974
- border-top: 5px solid #252b37;
975
- padding: 20px 10px;
976
- }
977
-
978
- #pro-features .logo {
979
- display: inline-block;
980
- margin: 0 0 0 20px;
981
- padding: 0 0 0 70px;
982
- color: #3c3c3c;
983
- background: url(../img/wppr-logo.png) no-repeat left center;
984
- font-family: "Open Sans", sans-serif;
985
- font-size: 2em;
986
- font-weight: 700;
987
- line-height: 60px;
988
- letter-spacing: -1px;
989
- }
990
-
991
- #pro-features .slogan {
992
- display: inline-block;
993
- margin: 0 0 0 5px;
994
- padding: 0;
995
- color: #858585;
996
- font-family: "Open Sans", sans-serif;
997
- font-size: 17px;
998
- line-height: 3.5;
999
- }
1000
-
1001
- #pro-features .slogan a {
1002
- color: #858585;
1003
- font-weight: 600;
1004
- font-style: italic;
1005
- text-decoration: none;
1006
- -webkit-transition: all 0.250s ease-in-out;
1007
- transition: all 0.250s ease-in-out;
1008
- }
1009
-
1010
- #pro-features .slogan a:hover {
1011
- color: #ff6160;
1012
- }
1013
-
1014
- #pro-features .slogan a:focus {
1015
- outline: none;
1016
- -webkit-box-shadow: none;
1017
- box-shadow: none;
1018
- }
1019
-
1020
- #pro-features .header-btns {
1021
- float: right;
1022
- margin: 7px 20px;
1023
- text-align: right;
1024
- }
1025
-
1026
- #pro-features .header-btns .buy-now {
1027
- background: #e33b3f;
1028
- border-radius: 3px;
1029
- border-radius: 3px;
1030
- color: #fff;
1031
- display: inline-block;
1032
- font-family: "Open Sans", sans-serif;
1033
- font-size: 18px;
1034
- font-weight: bold;
1035
- margin-right: 5px;
1036
- margin-top: 2px;
1037
- padding: 15px 25px;
1038
- text-decoration: none;
1039
- text-transform: uppercase;
1040
- -webkit-transition: all 0.250s ease-in-out;
1041
- transition: all 0.250s ease-in-out;
1042
- }
1043
-
1044
- #pro-features .header-btns .buy-now:hover {
1045
- background: #252b37;
1046
- }
1047
-
1048
- #pro-features .header-btns .buy-now .dashicons {
1049
- padding-right: 3px;
1050
- }
1051
-
1052
- #pro-features .pro-features-header,
1053
- #pro-features .pro-feature{
1054
- background-color: #fff;
1055
- -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
1056
- box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
1057
- display: block;
1058
- margin: 30px 15px 0;
1059
- }
1060
-
1061
- #pro-features .pro-feature .pro-feature-features,
1062
- #pro-features .pro-feature .pro-feature-image{
1063
- display: table-cell;
1064
- margin: 0;
1065
- vertical-align: middle;
1066
- }
1067
-
1068
- #pro-features .pro-feature .pro-feature-features {
1069
- -webkit-box-sizing: border-box;
1070
- box-sizing: border-box;
1071
- padding: 30px;
1072
- }
1073
-
1074
- #pro-features .pro-feature .pro-feature-image {
1075
- width: 470px;
1076
- }
1077
-
1078
- #pro-features .pro-feature .pro-feature-features h2 {
1079
- font-size: 28px;
1080
- margin: 0 0 20px;
1081
- }
1082
-
1083
- #pro-features .pro-feature .pro-feature-features h4 {
1084
- font-size: 20px;
1085
- margin: 0 0 10px;
1086
- }
1087
-
1088
- #pro-features .pro-feature .pro-feature-features p {
1089
- font-size: 16px;
1090
- line-height: 1.5;
1091
- margin: 0 0 15px;
1092
- }
1093
-
1094
- #pro-features .pro-feature .pro-feature-image img {
1095
- height: auto;
1096
- width: 100%;
1097
- }
1098
-
1099
- @media screen and (max-width: 1200px) {
1100
- #pro-features .pro-feature .pro-feature-features,
1101
- #pro-features .pro-feature .pro-feature-image{
1102
- display: block;
1103
- }
1104
- #pro-features .pro-feature .pro-feature-image {
1105
- margin: 0 auto 20px;
1106
- text-align: center;
1107
- width: 470px;
1108
- }
1109
- #pro-features .slogan {
1110
- display: none;
1111
- }
1112
- }
1113
-
1114
- @media screen and (max-width: 1100px) {
1115
- #pro-features {
1116
- text-align: center;
1117
- }
1118
-
1119
- #pro-features .logo {
1120
- margin-left: 0;
1121
- }
1122
-
1123
- #pro-features .header-btns {
1124
- display: block;
1125
- float: none;
1126
- margin|: 0 0 10px 0;
1127
- text-align: center;
1128
- }
1129
- }
1130
-
1131
- @media screen and (max-width: 782px) {
1132
- #cwp_form #header .button {
1133
- font-size: 11px !important;
1134
- padding: 0 4px 1px !important;
1135
- }
1136
-
1137
- #cwp_form #header .logo h2 {
1138
- margin: 0 !important;
1139
- padding: 0 !important;
1140
- }
1141
- #pro-features .pro-feature .pro-feature-image {
1142
- width: 100%;
1143
- }
1144
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/layout/js/admin.js DELETED
@@ -1,150 +0,0 @@
1
- /* jshint ignore:start */
2
- jQuery("document").ready(function() {
3
-
4
-
5
- jQuery("#cwp_container").fadeIn(200);
6
-
7
- var _custom_media = true;
8
-
9
-
10
- jQuery('.clear-image').click(function(e) {
11
- var button = jQuery(this);
12
- var id = button.attr('id').replace('_buttonclear', '');
13
-
14
- jQuery("#"+id).val('');
15
- jQuery("#"+id+"_image").attr("src",'').hide();
16
- return false;
17
- });
18
-
19
-
20
-
21
- jQuery(".subo-color-picker").wpColorPicker({ change: function(event, ui){
22
- var color = ui.color.toCSS();
23
-
24
- var id = jQuery(this).attr('id').replace('_color_selector', '');
25
-
26
-
27
- jQuery("#"+id+"_color").val(color);
28
- }} );
29
-
30
- jQuery('.add_media').on('click', function(){
31
-
32
- _custom_media = false;
33
-
34
- });
35
- jQuery(".tab-section:first").show();
36
- jQuery("#cwp_nav li a").live("click",function(){
37
- var show = jQuery(this).attr("href");
38
- jQuery(".tab-section:visible").fadeOut(200,function(){
39
- jQuery( show).fadeIn(300);
40
-
41
- });
42
- return false;
43
- });
44
-
45
- jQuery(".group-in-tab .group-name").live("click",function(){
46
- jQuery(".active-tab").slideUp(200);
47
- var cnt = jQuery(this).parent().find(".group-content");
48
- cnt.addClass("active-tab");
49
-
50
- if(cnt.is(":hidden"))
51
- cnt.slideDown(1000);
52
- else
53
- cnt.slideUp(200);
54
- return false;
55
- });
56
-
57
-
58
- jQuery(".cwp_save").live("click",function(){
59
- var b = jQuery("#cwp_form").serialize();
60
- jQuery(".cwp_save").addClass("button-primary-disabled");
61
- jQuery(".cwp_reset").addClass("button-disabled");
62
- jQuery(".spinner").show();
63
- jQuery.post( 'options.php', b ).error(
64
- function() {
65
- jQuery(".spinner").hide();
66
- jQuery(".cwp_reset").removeClass("button-disabled");
67
- jQuery(".cwp_save").removeClass("button-primary-disabled");
68
- }).success( function() {
69
- jQuery(".spinner").hide();
70
- jQuery(".cwp_reset").removeClass("button-disabled");
71
- jQuery(".cwp_save").removeClass("button-primary-disabled");
72
- });
73
-
74
- });
75
-
76
- jQuery(".cwp_reset").live("click",function(){
77
- jQuery(".cwp_reset").addClass("button-disabled");
78
- jQuery(".cwp_save").addClass("button-primary-disabled");
79
- jQuery(".spinner ").show();
80
- jQuery.post( ajaxurl,{action:"cwp_load_defaults"} ).error(
81
- function() {
82
- jQuery(".spinner").hide();
83
- jQuery(".cwp_reset").removeClass("button-disabled");
84
- jQuery(".cwp_save").removeClass("button-primary-disabled");
85
- locatino.reload();
86
- }).success( function() {
87
-
88
- jQuery(".spinner").hide();
89
- jQuery(".cwp_reset").removeClass("button-disabled");
90
- jQuery(".cwp_save").removeClass("button-primary-disabled");
91
- location.reload();
92
- });
93
-
94
- });
95
-
96
- jQuery(".cwp_tipsy ").tipsy();
97
-
98
- jQuery("#cwp_select_bar_icon").click(function(a) {
99
- a.preventDefault();
100
- a.stopPropagation();
101
- //var b = [ "&#xf042", "&#xf170", "&#xf037", "&#xf039", "&#xf036", "&#xf038", "&#xf0f9", "&#xf13d", "&#xf17b", "&#xf103", "&#xf100", "&#xf101", "&#xf102", "&#xf107", "&#xf104", "&#xf105", "&#xf106", "&#xf179", "&#xf187", "&#xf0ab", "&#xf0a8", "&#xf01a", "&#xf190", "&#xf18e", "&#xf01b", "&#xf0a9", "&#xf0aa", "&#xf063", "&#xf060", "&#xf061", "&#xf062", "&#xf047", "&#xf0b2", "&#xf07e", "&#xf07d", "&#xf069", "&#xf1b9", "&#xf04a", "&#xf05e", "&#xf19c", "&#xf080", "&#xf02a", "&#xf0c9", "&#xf0fc", "&#xf1b4", "&#xf1b5", "&#xf0f3", "&#xf0a2", "&#xf171", "&#xf172", "&#xf15a", "&#xf032", "&#xf0e7", "&#xf1e2", "&#xf02d", "&#xf02e", "&#xf097", "&#xf0b1", "&#xf15a", "&#xf188", "&#xf1ad", "&#xf0f7", "&#xf0a1", "&#xf140", "&#xf1ba", "&#xf073", "&#xf133", "&#xf030", "&#xf083", "&#xf1b9", "&#xf0d7", "&#xf0d9", "&#xf0da", "&#xf150", "&#xf191", "&#xf152", "&#xf151", "&#xf0d8", "&#xf0a3", "&#xf0c1", "&#xf127", "&#xf00c", "&#xf058", "&#xf05d", "&#xf14a", "&#xf046", "&#xf13a", "&#xf137", "&#xf138", "&#xf139", "&#xf078", "&#xf053", "&#xf054", "&#xf077", "&#xf1ae", "&#xf111", "&#xf10c", "&#xf1ce", "&#xf1db", "&#xf0ea", "&#xf017", "&#xf0c2", "&#xf0ed", "&#xf0ee", "&#xf157", "&#xf121", "&#xf126", "&#xf1cb", "&#xf0f4", "&#xf013", "&#xf085", "&#xf0db", "&#xf075", "&#xf0e5", "&#xf086", "&#xf0e6", "&#xf14e", "&#xf066", "&#xf0c5", "&#xf09d", "&#xf125", "&#xf05b", "&#xf13c", "&#xf1b2", "&#xf1b3", "&#xf0c4", "&#xf0f5", "&#xf0e4", "&#xf1c0", "&#xf03b", "&#xf1a5", "&#xf108", "&#xf1bd", "&#xf1a6", "&#xf155", "&#xf192", "&#xf019", "&#xf17d", "&#xf16b", "&#xf1a9", "&#xf044", "&#xf052", "&#xf141", "&#xf142", "&#xf1d1", "&#xf0e0", "&#xf003", "&#xf199", "&#xf12d", "&#xf153", "&#xf153", "&#xf0ec", "&#xf12a", "&#xf06a", "&#xf071", "&#xf065", "&#xf08e", "&#xf14c", "&#xf06e", "&#xf070", "&#xf09a", "&#xf082", "&#xf049", "&#xf050", "&#xf1ac", "&#xf182", "&#xf0fb", "&#xf15b", "&#xf1c6", "&#xf1c7", "&#xf1c9", "&#xf1c3", "&#xf1c5", "&#xf1c8", "&#xf016", "&#xf1c1", "&#xf1c5", "&#xf1c5", "&#xf1c4", "&#xf1c7", "&#xf15c", "&#xf0f6", "&#xf1c8", "&#xf1c2", "&#xf1c6", "&#xf0c5", "&#xf008", "&#xf0b0", "&#xf06d", "&#xf134", "&#xf024", "&#xf11e", "&#xf11d", "&#xf0e7", "&#xf0c3", "&#xf16e", "&#xf0c7", "&#xf07b", "&#xf114", "&#xf07c", "&#xf115", "&#xf031", "&#xf04e", "&#xf180", "&#xf119", "&#xf11b", "&#xf0e3", "&#xf154", "&#xf1d1", "&#xf013", "&#xf085", "&#xf06b", "&#xf1d3", "&#xf1d2", "&#xf09b", "&#xf113", "&#xf092", "&#xf184", "&#xf000", "&#xf0ac", "&#xf1a0", "&#xf0d5", "&#xf0d4", "&#xf19d", "&#xf0c0", "&#xf0fd", "&#xf1d4", "&#xf0a7", "&#xf0a5", "&#xf0a4", "&#xf0a6", "&#xf0a0", "&#xf1dc", "&#xf025", "&#xf004", "&#xf08a", "&#xf1da", "&#xf015", "&#xf0f8", "&#xf13b", "&#xf03e", "&#xf01c", "&#xf03c", "&#xf129", "&#xf05a", "&#xf156", "&#xf16d", "&#xf19c", "&#xf033", "&#xf1aa", "&#xf157", "&#xf1cc", "&#xf084", "&#xf11c", "&#xf159", "&#xf1ab", "&#xf109", "&#xf06c", "&#xf0e3", "&#xf094", "&#xf149", "&#xf148", "&#xf1cd", "&#xf1cd", "&#xf1cd", "&#xf0eb", "&#xf0c1", "&#xf0e1", "&#xf08c", "&#xf17c", "&#xf03a", "&#xf022", "&#xf0cb", "&#xf0ca", "&#xf124", "&#xf023", "&#xf175", "&#xf177", "&#xf178", "&#xf176", "&#xf0d0", "&#xf076", "&#xf064", "&#xf112", "&#xf122", "&#xf183", "&#xf041", "&#xf136", "&#xf0fa", "&#xf11a", "&#xf130", "&#xf131", "&#xf068", "&#xf056", "&#xf146", "&#xf147", "&#xf10b", "&#xf10b", "&#xf0d6", "&#xf186", "&#xf19d", "&#xf001", "&#xf0c9", "&#xf19b", "&#xf03b", "&#xf18c", "&#xf1d8", "&#xf1d9", "&#xf0c6", "&#xf1dd", "&#xf0ea", "&#xf04c", "&#xf1b0", "&#xf040", "&#xf14b", "&#xf044", "&#xf095", "&#xf098", "&#xf03e", "&#xf03e", "&#xf1a7", "&#xf1a8", "&#xf1a7", "&#xf0d2", "&#xf0d3", "&#xf072", "&#xf04b", "&#xf144", "&#xf01d", "&#xf067", "&#xf055", "&#xf0fe", "&#xf196", "&#xf011", "&#xf02f", "&#xf12e", "&#xf1d6", "&#xf029", "&#xf128", "&#xf059", "&#xf10d", "&#xf10e", "&#xf1d0", "&#xf074", "&#xf1d0", "&#xf1b8", "&#xf1a1", "&#xf1a2", "&#xf021", "&#xf18b", "&#xf0c9", "&#xf01e", "&#xf112", "&#xf122", "&#xf079", "&#xf157", "&#xf018", "&#xf135", "&#xf0e2", "&#xf01e", "&#xf158", "&#xf09e", "&#xf143", "&#xf158", "&#xf158", "&#xf156", "&#xf0c7", "&#xf0c4", "&#xf002", "&#xf010", "&#xf00e", "&#xf1d8", "&#xf1d9", "&#xf064", "&#xf1e0", "&#xf1e1", "&#xf14d", "&#xf045", "&#xf132", "&#xf07a", "&#xf090", "&#xf08b", "&#xf012", "&#xf0e8", "&#xf17e", "&#xf198", "&#xf1de", "&#xf118", "&#xf0dc", "&#xf15d", "&#xf15e", "&#xf160", "&#xf161", "&#xf0de", "&#xf0dd", "&#xf0dd", "&#xf162", "&#xf163", "&#xf0de", "&#xf1be", "&#xf197", "&#xf110", "&#xf1b1", "&#xf1bc", "&#xf0c8", "&#xf096", "&#xf18d", "&#xf16c", "&#xf005", "&#xf089", "&#xf123", "&#xf123", "&#xf123", "&#xf006", "&#xf1b6", "&#xf1b7", "&#xf048", "&#xf051", "&#xf0f1", "&#xf04d", "&#xf0cc", "&#xf1a4", "&#xf1a3", "&#xf12c", "&#xf0f2", "&#xf185", "&#xf12b", "&#xf1cd", "&#xf0ce", "&#xf10a", "&#xf0e4", "&#xf02b", "&#xf02c", "&#xf0ae", "&#xf1ba", "&#xf1d5", "&#xf120", "&#xf034", "&#xf035", "&#xf00a", "&#xf009", "&#xf00b", "&#xf08d", "&#xf165", "&#xf088", "&#xf087", "&#xf164", "&#xf145", "&#xf00d", "&#xf057", "&#xf05c", "&#xf043", "&#xf150", "&#xf191", "&#xf152", "&#xf151", "&#xf014", "&#xf1bb", "&#xf181", "&#xf091", "&#xf0d1", "&#xf195", "&#xf173", "&#xf174", "&#xf195", "&#xf099", "&#xf081", "&#xf0e9", "&#xf0cd", "&#xf0e2", "&#xf19c", "&#xf127", "&#xf09c", "&#xf13e", "&#xf0dc", "&#xf093", "&#xf155", "&#xf007", "&#xf0f0", "&#xf0c0", "&#xf03d", "&#xf194", "&#xf1ca", "&#xf189", "&#xf027", "&#xf026", "&#xf028", "&#xf071", "&#xf1d7", "&#xf18a", "&#xf1d7", "&#xf193", "&#xf17a", "&#xf159", "&#xf19a", "&#xf0ad", "&#xf168", "&#xf169", "&#xf19e", "&#xf157", "&#xf167", "&#xf16a", "&#xf166" ];
102
- var b = [
103
- "&#xf005",
104
- "&#xf155"
105
- ];
106
- if (0 != jQuery("#bar-icon-elements").length) jQuery("#bar-icon-elements").addClass("active").show(); else insertIconContainer(b);
107
- });
108
-
109
- function insertIconContainer(a) {
110
- jQuery("#cwp_container").append("<div id='bar-icon-elements' class='active'></div>");
111
- a.forEach(function(a) {
112
- iC = a.substring(1);
113
- var b = "<i id='" + iC + "' class='fa icon fa-fw'>" + a + "</i>";
114
- jQuery("#bar-icon-elements").append(b);
115
- });
116
- jQuery("#bar-icon-elements").append("<span class='closeModal'><i class='fa fa-times'></i></span>");
117
- jQuery("#bar-icon-elements .closeModal").click(function(a) {
118
- a.preventDefault();
119
- d();
120
- });
121
- }
122
-
123
- function d() {
124
- jQuery("#bar-icon-elements").removeClass("active").hide();
125
-
126
- }
127
-
128
- function r() {
129
- jQuery(".current_bar_icon").html("").text("* Currently set to the default styling.");
130
- jQuery("input[type='hidden']#cwp_bar_icon_field").val("");
131
- }
132
-
133
- jQuery("#cwp_container").on("click", "#bar-icon-elements i.icon", function(a) {
134
- a.preventDefault();
135
- var b = jQuery(this).attr("id");
136
- var uD = "<a href='#' class='useDefault'>Use Default Styling</a>";
137
- jQuery("#bar-icon-elements i.active").removeClass("active");
138
- jQuery(this).addClass("active");
139
- jQuery(".current_bar_icon").text("").append("<i class='fa fa-fw'>&" + b + "</i>" + uD);
140
- jQuery("input[type='hidden']#cwp_bar_icon_field").val(b);
141
- d();
142
- });
143
-
144
- jQuery(".review-settings-group").on("click", ".useDefault", function(a){
145
- a.preventDefault();
146
- a.stopPropagation();
147
- r();
148
- });
149
-
150
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/layout/js/custom-bar-icon.js DELETED
@@ -1,49 +0,0 @@
1
- /* jshint ignore:start */
2
- jQuery("#cwp_select_bar_icon").click(function(a) {
3
- a.preventDefault();
4
- a.stopPropagation();
5
- var b = ["&#xf096","&#xf08a","&#xf11b","&#xf06d","&#xf1b2","&#xf005","&#xf155","&#xf1db","&#xf006","&#xf0c8","&#xf02d","&#xf135","&#xf013","&#xf0fa",];
6
- if (0 != jQuery("#bar-icon-elements").length){
7
- jQuery("#bar-icon-elements").addClass("active").show(); } else { insertIconContainer(b); }
8
- });
9
-
10
- function insertIconContainer(a) {
11
- jQuery("#cwp_form").append("<div id='bar-icon-elements' class='active'></div>");
12
- a.forEach(function(a) {
13
- iC = a.substring(1);
14
- var b = "<i id='" + iC + "' class='fa icon fa-fw'>" + a + "</i>";
15
- jQuery("#bar-icon-elements").append(b);
16
- });
17
- jQuery("#bar-icon-elements").append("<span class='closeModal'><i class='fa fa-times'></i></span>");
18
- jQuery("#bar-icon-elements .closeModal").click(function(x) {
19
- jQuery("#bar-icon-elements").removeClass("active").hide();
20
- return;
21
- });
22
- }
23
-
24
- function r() {
25
- jQuery(".current_bar_icon").html("").text("* Currently set to the default styling.");
26
- jQuery("input[type='hidden']#cwp_bar_icon_field").val("");
27
- }
28
-
29
- jQuery(".useDefault").click(function(a) {
30
- a.preventDefault();
31
- a.stopPropagation();
32
- r();
33
- });
34
-
35
- function d() {
36
- jQuery("#bar-icon-elements").removeClass("active").hide();
37
- return;
38
- }
39
-
40
- jQuery("#cwp_form").on("click", "#bar-icon-elements i.icon", function(a) {
41
- a.preventDefault();
42
- var b = jQuery(this).attr("id");
43
- var uD = "<a href='#' class='useDefault'>Use Default Styling</a>";
44
- jQuery("#bar-icon-elements i.active").removeClass("active");
45
- jQuery(this).addClass("active");
46
- jQuery(".current_bar_icon").text("").append("<i class='fa icon fa-fw'>&" + b + "</i>" + uD);
47
- jQuery("input[type='hidden']#cwp_bar_icon_field").val(b);
48
- d();
49
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/layout/js/tipsy.js DELETED
@@ -1,259 +0,0 @@
1
- /* jshint ignore:start */
2
- // tipsy, facebook style tooltips for jquery
3
- // version 1.0.0a
4
- // (c) 2008-2010 jason frame [jason@onehackoranother.com]
5
- // released under the MIT license
6
-
7
- (function($) {
8
-
9
- function maybeCall(thing, ctx) {
10
- return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
11
- };
12
-
13
- function isElementInDOM(ele) {
14
- while (ele = ele.parentNode) {
15
- if (ele == document) return true;
16
- }
17
- return false;
18
- };
19
-
20
- function Tipsy(element, options) {
21
- this.$element = $(element);
22
- this.options = options;
23
- this.enabled = true;
24
- this.fixTitle();
25
- };
26
-
27
- Tipsy.prototype = {
28
- show: function() {
29
- var title = this.getTitle();
30
- if (title && this.enabled) {
31
- var $tip = this.tip();
32
-
33
- $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
34
- $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
35
- $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
36
-
37
- var pos = $.extend({}, this.$element.offset(), {
38
- width: this.$element[0].offsetWidth,
39
- height: this.$element[0].offsetHeight
40
- });
41
-
42
- var actualWidth = $tip[0].offsetWidth,
43
- actualHeight = $tip[0].offsetHeight,
44
- gravity = maybeCall(this.options.gravity, this.$element[0]);
45
-
46
- var tp;
47
- switch (gravity.charAt(0)) {
48
- case 'n':
49
- tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
50
- break;
51
- case 's':
52
- tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
53
- break;
54
- case 'e':
55
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
56
- break;
57
- case 'w':
58
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
59
- break;
60
- }
61
-
62
- if (gravity.length == 2) {
63
- if (gravity.charAt(1) == 'w') {
64
- tp.left = pos.left + pos.width / 2 - 15;
65
- } else {
66
- tp.left = pos.left + pos.width / 2 - actualWidth + 15;
67
- }
68
- }
69
-
70
- $tip.css(tp).addClass('tipsy-' + gravity);
71
- $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
72
- if (this.options.className) {
73
- $tip.addClass(maybeCall(this.options.className, this.$element[0]));
74
- }
75
-
76
- if (this.options.fade) {
77
- $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
78
- } else {
79
- $tip.css({visibility: 'visible', opacity: this.options.opacity});
80
- }
81
- }
82
- },
83
-
84
- hide: function() {
85
- if (this.options.fade) {
86
- this.tip().stop().fadeOut(function() { $(this).remove(); });
87
- } else {
88
- this.tip().remove();
89
- }
90
- },
91
-
92
- fixTitle: function() {
93
- var $e = this.$element;
94
- if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
95
- $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
96
- }
97
- },
98
-
99
- getTitle: function() {
100
- var title, $e = this.$element, o = this.options;
101
- this.fixTitle();
102
- var title, o = this.options;
103
- if (typeof o.title == 'string') {
104
- title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
105
- } else if (typeof o.title == 'function') {
106
- title = o.title.call($e[0]);
107
- }
108
- title = ('' + title).replace(/(^\s*|\s*$)/, "");
109
- return title || o.fallback;
110
- },
111
-
112
- tip: function() {
113
- if (!this.$tip) {
114
- this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
115
- this.$tip.data('tipsy-pointee', this.$element[0]);
116
- }
117
- return this.$tip;
118
- },
119
-
120
- validate: function() {
121
- if (!this.$element[0].parentNode) {
122
- this.hide();
123
- this.$element = null;
124
- this.options = null;
125
- }
126
- },
127
-
128
- enable: function() { this.enabled = true; },
129
- disable: function() { this.enabled = false; },
130
- toggleEnabled: function() { this.enabled = !this.enabled; }
131
- };
132
-
133
- $.fn.tipsy = function(options) {
134
-
135
- if (options === true) {
136
- return this.data('tipsy');
137
- } else if (typeof options == 'string') {
138
- var tipsy = this.data('tipsy');
139
- if (tipsy) tipsy[options]();
140
- return this;
141
- }
142
-
143
- options = $.extend({}, $.fn.tipsy.defaults, options);
144
-
145
- function get(ele) {
146
- var tipsy = $.data(ele, 'tipsy');
147
- if (!tipsy) {
148
- tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
149
- $.data(ele, 'tipsy', tipsy);
150
- }
151
- return tipsy;
152
- }
153
-
154
- function enter() {
155
- var tipsy = get(this);
156
- tipsy.hoverState = 'in';
157
- if (options.delayIn == 0) {
158
- tipsy.show();
159
- } else {
160
- tipsy.fixTitle();
161
- setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
162
- }
163
- };
164
-
165
- function leave() {
166
- var tipsy = get(this);
167
- tipsy.hoverState = 'out';
168
- if (options.delayOut == 0) {
169
- tipsy.hide();
170
- } else {
171
- setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
172
- }
173
- };
174
-
175
- if (!options.live) this.each(function() { get(this); });
176
-
177
- if (options.trigger != 'manual') {
178
- var binder = options.live ? 'live' : 'bind',
179
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
180
- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
181
- this[binder](eventIn, enter)[binder](eventOut, leave);
182
- }
183
-
184
- return this;
185
-
186
- };
187
-
188
- $.fn.tipsy.defaults = {
189
- className: null,
190
- delayIn: 0,
191
- delayOut: 0,
192
- fade: false,
193
- fallback: '',
194
- gravity: 'n',
195
- html: false,
196
- live: false,
197
- offset: 0,
198
- opacity: 0.8,
199
- title: 'title',
200
- trigger: 'hover'
201
- };
202
-
203
- $.fn.tipsy.revalidate = function() {
204
- $('.tipsy').each(function() {
205
- var pointee = $.data(this, 'tipsy-pointee');
206
- if (!pointee || !isElementInDOM(pointee)) {
207
- $(this).remove();
208
- }
209
- });
210
- };
211
-
212
- // Overwrite this method to provide options on a per-element basis.
213
- // For example, you could store the gravity in a 'tipsy-gravity' attribute:
214
- // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
215
- // (remember - do not modify 'options' in place!)
216
- $.fn.tipsy.elementOptions = function(ele, options) {
217
- return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
218
- };
219
-
220
- $.fn.tipsy.autoNS = function() {
221
- return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
222
- };
223
-
224
- $.fn.tipsy.autoWE = function() {
225
- return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
226
- };
227
-
228
- /**
229
- * yields a closure of the supplied parameters, producing a function that takes
230
- * no arguments and is suitable for use as an autogravity function like so:
231
- *
232
- * @param margin (int) - distance from the viewable region edge that an
233
- * element should be before setting its tooltip's gravity to be away
234
- * from that edge.
235
- * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
236
- * if there are no viewable region edges effecting the tooltip's
237
- * gravity. It will try to vary from this minimally, for example,
238
- * if 'sw' is preferred and an element is near the right viewable
239
- * region edge, but not the top edge, it will set the gravity for
240
- * that element's tooltip to be 'se', preserving the southern
241
- * component.
242
- */
243
- $.fn.tipsy.autoBounds = function(margin, prefer) {
244
- return function() {
245
- var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
246
- boundTop = $(document).scrollTop() + margin,
247
- boundLeft = $(document).scrollLeft() + margin,
248
- $this = $(this);
249
-
250
- if ($this.offset().top < boundTop) dir.ns = 'n';
251
- if ($this.offset().left < boundLeft) dir.ew = 'w';
252
- if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
253
- if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
254
-
255
- return dir.ns + (dir.ew ? dir.ew : '');
256
- }
257
- };
258
-
259
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/layout/main_page.php DELETED
@@ -1,85 +0,0 @@
1
- <div id="cwp_container" style="display:none">
2
- <form id="cwp_form" method="post" action="#" enctype="multipart/form-data">
3
- <?php settings_fields( cwppos_config( 'menu_slug' ) ); ?>
4
-
5
- <div id="header">
6
-
7
- <div class="logo ">
8
- <h2>
9
-
10
- <img class="theme_options_logo" src="<?php echo plugins_url( 'img/logo.png' , __FILE__ ) . ''; ?>" alt="<?php echo cwppos_config( 'admin_page_header' ); ?>">
11
-
12
- <?php if ( ! class_exists( 'CWP_PR_PRO_Core' ) ) { ?><a href="http://themeisle.com/plugins/wp-product-review/" class="read_docs button" target="_blank" style="color:red;text-decoration: none;"><?php _e( 'Buy the PRO Add-on', 'cwppos' ); ?></a><?php } ?>
13
-
14
- <a href="https://themeisle.com/allthemes" class="read_docs button" target="_blank" style=" text-decoration: none; "><?php _e( 'Recommended Review Themes', 'cwppos' ); ?></a>
15
-
16
- <a href="http://themeisle.com/contact/" target="_blank" class="read_docs button" style="text-decoration: none;"><?php _e( 'Contact us', 'cwppos' ); ?></a>
17
-
18
- </h2>
19
- </div>
20
-
21
- <div class="clear"></div>
22
-
23
- </div>
24
-
25
- <div id="info_bar">
26
-
27
- <span class="spinner" ></span>
28
-
29
- <button type="button" class="button-primary cwp_save">
30
- <?php _e( 'Save All Changes','cwppos' ); ?> </button>
31
-
32
- <span class="spinner spinner-reset" ></span>
33
- <button type="button" class="button submit-button reset-button cwp_reset"><?php _e( 'Options Reset','cwppos' ); ?></button>
34
- </div><!--.info_bar-->
35
-
36
- <div id="main">
37
-
38
- <div id="cwp_nav">
39
- <ul>
40
- <?php foreach ( $tabs as $tab ) { ?>
41
-
42
-
43
- <li ><a href="#tab-<?php echo $tab['id']; ?>"><?php echo $tab['name']; ?></a></li>
44
-
45
- <?php } ?></ul>
46
- </div>
47
-
48
- <div id="content">
49
-
50
- <?php foreach ( $tabs as $tab ) { ?>
51
- <div id="tab-<?php echo $tab['id']; ?>" class="tab-section">
52
- <h2><?php echo $tab['name']; ?></h2>
53
-
54
- <?php foreach ( $tab['elements'] as $element ) { ?>
55
- <?php echo $element['html']; ?>
56
- <?php } ?>
57
-
58
- </div>
59
-
60
-
61
- <?php } ?>
62
-
63
- <div class="clear"></div>
64
- </div>
65
-
66
-
67
- <div style="clear:both;"></div>
68
- </div>
69
-
70
- <div class="save_bar">
71
- <span class="spinner " ></span>
72
- <button type="button" class="button-primary cwp_save">
73
- <?php _e( 'Save All Changes','cwppos' ); ?> </button>
74
-
75
- <span class="spinner spinner-reset" ></span>
76
- <button type="button" class="button submit-button reset-button cwp_reset"><?php _e( 'Options Reset','cwppos' ); ?></button>
77
-
78
-
79
- </div>
80
-
81
- <div style="clear:both;"></div>
82
- </form>
83
-
84
- <div style="clear:both;"></div>
85
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/layout/pro.php DELETED
@@ -1,58 +0,0 @@
1
- <div id="pro-features">
2
-
3
- <div class="pro-features-header">
4
- <p class="logo">WP Product Reviews</p>
5
- <span class="slogan">by <a
6
- href="https://themeisle.com/">ThemeIsle</a></span>
7
- <div class="header-btns">
8
-
9
- <a target="_blank" href="https://themeisle.com/plugins/wp-product-review/" class="buy-now"><span class="dashicons dashicons-cart"></span> Buy now</a>
10
- </div>
11
- <div class="clear"></div>
12
- </div>
13
-
14
- <div class="pro-feature">
15
- <div class="pro-feature-features">
16
- <h2>Amazon Integration</h2>
17
- <h4>Connects your site with Amazon in just a click</h4>
18
- <p>If you want the Amazon data to be imported to your site, you don't have to do it manually. Add the product ID and, by just clicking a button, the name, image, affiliate link, and price will be transferred. Saves a lot of time.</p>
19
- <h4>Synchronizes the prices with Amazon</h4>
20
- <p>The add-on automatically synchronizes the prices with the ones from Amazon, so you won't have to do it manually everytime they change. Because prices vary all the time and you probably have better stuff to do instead of tracking them.</p>
21
- </div>
22
- <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/images/wppr-amazon-integration-and-support.jpg"></div>
23
- <div class="clear"></div>
24
- </div>
25
- <div class="clear"></div>
26
-
27
- <div class="pro-feature">
28
- <div class="pro-feature-features">
29
- <h2>Shortcodes</h2>
30
- <p>Position the review box anywhere in the post with the help of shortcodes. Add as many reviews as you want in the same page.</p>
31
-
32
- </div>
33
- <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/images/wppr-shortcodes.jpg"></div>
34
- <div class="clear"></div>
35
- </div>
36
- <div class="clear"></div>
37
-
38
- <div class="pro-feature">
39
- <div class="pro-feature-features">
40
- <h2>Comparison Table</h2>
41
- <p>Our powerful ranking table add-on is also included in the bundle and by using it you can automatically generate comparison landing pages or enhance your review articles even more</p>
42
- </div>
43
- <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/images/wppr-review-comparison.jpg"></div>
44
- <div class="clear"></div>
45
- </div>
46
- <div class="clear"></div>
47
-
48
- <div class="pro-feature">
49
- <div class="pro-feature-features">
50
- <h2>Import</h2>
51
- <p>No need to set up each product review separately. You can import options from other reviews you’ve previously built</p>
52
-
53
- </div>
54
- <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/images/wppr-import.jpg"></div>
55
- <div class="clear"></div>
56
- </div>
57
- <div class="clear"></div>
58
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin.css ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wppr_top_tabs a {
2
+ text-decoration: none;
3
+ }
4
+
5
+ #wppr_top_tabs a:focus {
6
+ outline: none;
7
+ -webkit-box-shadow: none;
8
+ box-shadow: none;
9
+ }
10
+
11
+ #wppr-admin {
12
+ margin-top: 20px;
13
+ margin-right: 20px;
14
+ }
15
+
16
+ /* Tabbed Nav */
17
+ #wppr_top_tabs ul#tabs_menu {
18
+ margin: 0;
19
+ }
20
+
21
+ #wppr_top_tabs ul#tabs_menu li.wppr-nav-tab {
22
+ border-top: 2px solid #52aae2;
23
+ }
24
+
25
+ #wppr_top_tabs ul#tabs_menu li {
26
+ display: inline-block;
27
+ margin: 0;
28
+ padding: 15px;
29
+ border-bottom: none;
30
+ border-radius: 2px 2px 0 0;
31
+ background: rgb(245, 250, 250);
32
+ font-family: "Roboto",sans-serif;
33
+ font-size: 13px;
34
+ font-weight: 700;
35
+ line-height: 1;
36
+ }
37
+
38
+ #wppr_top_tabs ul#tabs_menu li.active,
39
+ #wppr_top_tabs ul#tabs_menu li:hover {
40
+ background: none repeat scroll 0 0 #fff;
41
+ cursor: pointer;
42
+ }
43
+
44
+ #wppr_top_tabs div.wppr-tab {
45
+ display: none;
46
+ float: left;
47
+ width: 100%;
48
+ border: 1px solid #eaeaea;
49
+ border-bottom: 0;
50
+ background: #fff;
51
+ }
52
+
53
+ .wppr-tab .wppr_top_tabs_vertical .wppr-tab-vertical {
54
+ float: left;
55
+ width: 85%;
56
+ }
57
+
58
+ #wppr_top_tabs div.wppr-tab.active {
59
+ display: block;
60
+ }
61
+
62
+ #wppr_top_tabs ul#tabs_menu li:hover:after,
63
+ #wppr_top_tabs ul#tabs_menu li.active:after {
64
+ display: block;
65
+ position: absolute;
66
+ bottom: -5px;
67
+ left: -1px;
68
+ width: 100%;
69
+ height: 5px;
70
+ border-right: 1px solid #fff;
71
+ border-left: 1px solid #fff;
72
+ background: #fff;
73
+ content: "\00A0";
74
+ }
75
+
76
+ #wppr_top_tabs {
77
+ margin-top: 10px;
78
+ }
79
+
80
+ #wppr_top_tabs ul#tabs_menu li.wppr-nav-tab.active a,
81
+ #wppr_top_tabs ul#tabs_menu li.wppr-nav-tab a:hover {
82
+ color: #f17052;
83
+ }
84
+
85
+ #wppr_top_tabs ul#tabs_menu li.wppr-nav-tab.active,
86
+ #wppr_top_tabs ul#tabs_menu li.wppr-nav-tab:hover {
87
+ position: relative;
88
+ border-top: 2px #f16848 solid;
89
+ color: #f17052;
90
+ }
91
+
92
+ #wppr_top_tabs ul#tabs_menu li.wppr-nav-tab:hover a {
93
+ color: #f17052;
94
+ }
95
+
96
+ .wppr-tab-content {
97
+ display: none;
98
+ }
99
+
100
+ #wppr-settings {
101
+ padding: 10px;
102
+ background: #fff;
103
+ }
104
+
105
+ #wppr-settings .controls {
106
+ display: table;
107
+ }
108
+
109
+ #wppr-settings .explain,
110
+ #wppr-settings .controls-content {
111
+ display: table-cell;
112
+ }
113
+
114
+ #wppr-settings .explain {
115
+ width: 200px;
116
+ padding: 1em 20px 1em 0;
117
+ }
118
+
119
+ #wppr-settings .explain h4 {
120
+ margin: 0;
121
+ }
122
+
123
+ #wppr-settings .controls-content p {
124
+ margin: 7px 0 1em;
125
+ color: #666;
126
+ font-size: 12px;
127
+ font-style: italic;
128
+ }
129
+
130
+ #wppr-settings .controls-content .wp-picker-container {
131
+ margin-top: -12px;
132
+ }
133
+
134
+ @media screen and (max-width: 1100px) {
135
+ #wppr-settings .explain,
136
+ #wppr-settings .controls-content {
137
+ text-align: left;
138
+ }
139
+ }
140
+
141
+ @media screen and (max-width: 992px) {
142
+ #wppr_top_tabs ul#tabs_menu li:hover:after,
143
+ #wppr_top_tabs ul#tabs_menu li.active:after {
144
+ display: none;
145
+ }
146
+ }
147
+
148
+ @media screen and (max-width: 480px) {
149
+ #wppr-settings .explain {
150
+ width: 150px;
151
+ }
152
+ }
153
+
154
+ #wppr-settings #info_bar .spinner {
155
+ float: none;
156
+ }
157
+
158
+ #wppr-settings label.wppr-upsell-label {
159
+ display: block;
160
+ padding: 10px;
161
+ background: #cae9ff;
162
+ line-height: 7px;
163
+ text-align: center;
164
+ }
{css → assets/css}/cwppos-widget-admin.css RENAMED
@@ -1,11 +1,11 @@
1
- span.wppr-styleimg{
2
- position: relative;
3
  display: none;
 
4
  width: 100%;
5
  }
6
 
7
- span.wppr-styleimg img{
8
  position: absolute;
9
  left: 10px;
10
- border:1px solid #000;
11
- }
1
+ span.wppr-styleimg {
 
2
  display: none;
3
+ position: relative;
4
  width: 100%;
5
  }
6
 
7
+ span.wppr-styleimg img {
8
  position: absolute;
9
  left: 10px;
10
+ border: 1px solid #000;
11
+ }
assets/css/cwppos-widget-rating.css ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wppr-prodlist .wppr-rating {
2
+ display: block;
3
+ width: 80px;
4
+ height: 16px;
5
+ margin: 0;
6
+ background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFRoZSBpY29uIGNhbiBiZSB1c2VkIGZyZWVseSBpbiBib3RoIHBlcnNvbmFsIGFuZCBjb21tZXJjaWFsIHByb2plY3RzIHdpdGggbm8gYXR0cmlidXRpb24gcmVxdWlyZWQsIGJ1dCBhbHdheXMgYXBwcmVjaWF0ZWQuIFlvdSBtYXkgTk9UIHN1Yi1saWNlbnNlLCByZXNlbGwsIHJlbnQsIHJlZGlzdHJpYnV0ZSBvciBvdGhlcndpc2UgdHJhbnNmZXIgdGhlIGljb24gd2l0aG91dCBleHByZXNzIHdyaXR0ZW4gcGVybWlzc2lvbiBmcm9tIGljb25tb25zdHIuY29tIC0tPjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Igkgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gaWQ9InN0YXItaWNvbiIgZmlsbD0iI0Q5RDlEOSIgcG9pbnRzPSIyNTYsNjAuMDgyIDMwNC42MywyMDkuNzUgNDYyLDIwOS43NSAzMzQuNjg2LDMwMi4yNSAzODMuMzE1LDQ1MS45MTggMjU2LDM1OS40MTggMTI4LjY4NSw0NTEuOTE4IAkxNzcuMzE1LDMwMi4yNSA1MCwyMDkuNzUgMjA3LjM3LDIwOS43NSAiLz48L3N2Zz4=);
7
+ background-size: contain;
8
+ }
9
+
10
+ .wppr-prodlist .wppr-rating div {
11
+ display: block;
12
+ overflow: hidden;
13
+ max-width: 100%;
14
+ height: 16px;
15
+ background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFRoZSBpY29uIGNhbiBiZSB1c2VkIGZyZWVseSBpbiBib3RoIHBlcnNvbmFsIGFuZCBjb21tZXJjaWFsIHByb2plY3RzIHdpdGggbm8gYXR0cmlidXRpb24gcmVxdWlyZWQsIGJ1dCBhbHdheXMgYXBwcmVjaWF0ZWQuIFlvdSBtYXkgTk9UIHN1Yi1saWNlbnNlLCByZXNlbGwsIHJlbnQsIHJlZGlzdHJpYnV0ZSBvciBvdGhlcndpc2UgdHJhbnNmZXIgdGhlIGljb24gd2l0aG91dCBleHByZXNzIHdyaXR0ZW4gcGVybWlzc2lvbiBmcm9tIGljb25tb25zdHIuY29tIC0tPjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB2ZXJzaW9uPSIxLjEiIGZpbGw9IiNGRjdFMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Igkgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gaWQ9InN0YXItaWNvbiIgcG9pbnRzPSIyNTYsNjAuMDgyIDMwNC42MywyMDkuNzUgNDYyLDIwOS43NSAzMzQuNjg2LDMwMi4yNSAzODMuMzE1LDQ1MS45MTggMjU2LDM1OS40MTggMTI4LjY4NSw0NTEuOTE4IAkxNzcuMzE1LDMwMi4yNSA1MCwyMDkuNzUgMjA3LjM3LDIwOS43NSAiLz48L3N2Zz4=);
16
+ background-size: contain;
17
+ white-space: nowrap;
18
+ text-indent: 100%;
19
+ }
assets/css/cwppos-widget-style1.css ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wppr-prodlist .wppr-prodrow {
2
+ width: 100%;
3
+ padding: 20px 0;
4
+ }
5
+
6
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowleft {
7
+ float: left;
8
+ width: 30%;
9
+ }
10
+
11
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowright {
12
+ float: left;
13
+ }
14
+
15
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowrightadjust {
16
+ width: 65%;
17
+ }
18
+
19
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowright .wppr-rating {
20
+ margin-top: 5px;
21
+ }
22
+
23
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowright p {
24
+ margin: 0 0 0 0;
25
+ line-height: 18px;
26
+ }
27
+
28
+ .clear {
29
+ clear: both;
30
+ }
31
+
32
+ .cwp-review-chart.relative {
33
+ position: relative;
34
+ }
35
+
36
+ .cwp-review-chart.absolute {
37
+ position: absolute;
38
+ }
39
+
40
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowright .wppr-bttn:first-child {
41
+ margin-right: 10px;
42
+ }
43
+
44
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowright p.wppr-style1-buttons {
45
+ display: block;
46
+ overflow: hidden;
47
+ height: 32px;
48
+ margin-top: 10px;
49
+ }
50
+
51
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowright .wppr-bttn {
52
+ padding: 6px 9px;
53
+ border-radius: 3px;
54
+ color: #fff !important;
55
+ background-color: #3baeda;
56
+ font-family: "Helvetica Neue", HelveticaNeue, Helvetica, Lato, Arial, sans-serif;
57
+ font-size: 12px;
58
+ font-weight: bold;
59
+ line-height: 36px;
60
+ white-space: nowrap;
61
+ text-decoration: none;
62
+ text-transform: uppercase;
63
+ -webkit-transition: all 0.5s ease;
64
+ transition: all 0.5s ease;
65
+ }
66
+
67
+ .wppr-prodlist .wppr-prodrow .wppr-prodrowright .bttn:hover {
68
+ opacity: 0.8;
69
+ }
assets/css/cwppos-widget.css ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Sidebar Popular Reviews Widget */
2
+
3
+ .cwp-popular-review {
4
+ position: relative;
5
+ margin: 0;
6
+ padding: 15px 0 !important;
7
+ border-bottom: 1px solid #ddd;
8
+ list-style: none;
9
+ }
10
+
11
+ .cwp-popular-review .cwp-review-chart canvas,
12
+ .cwp-popular-review .cwp-review-chart span {
13
+ width: 40px!important;
14
+ height: 40px!important;
15
+ line-height: 2.3;
16
+ }
17
+
18
+ .cwp-popular-review .cwp-review-chart .cwp-review-percentage {
19
+ top: -1px;
20
+ left: -1px;
21
+ width: 40px!important;
22
+ height: 40px !important;
23
+ }
24
+
25
+ .cwp-popular-review .cwp-review-chart {
26
+ top: 56%;
27
+ width: 40px;
28
+ height: 40px;
29
+ margin-top: -22px;
30
+ border: 0 solid #fff;
31
+ }
32
+
33
+ /* Review Pie Chart Styles */
34
+ .cwp-review-chart {
35
+ float: left;
36
+ position: absolute;
37
+ top: 0;
38
+ right: 0;
39
+ margin: 10px 0 10px 10px;
40
+ border: 3px solid #fff;
41
+ border-radius: 50%;
42
+ }
43
+
44
+ .cwp-review-percentage span {
45
+ display: block;
46
+ border-radius: 50%;
47
+ background: #fff;
48
+ font-family: "Lato";
49
+ font-size: 17px;
50
+ font-weight: 900;
51
+ }
52
+
53
+ .cwp_easyPieChart {
54
+ position: relative;
55
+ text-align: center;
56
+ }
57
+
58
+ .cwp_easyPieChart canvas {
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ }
63
+
64
+ .cwp-popular-review .cwp_easyPieChart span {
65
+ text-align: center;
66
+ }
67
+
68
+ .cwp-popular-review:before {
69
+ content: ""!important;
70
+ }
71
+
72
+ .cwp-popular-review .cwp_rev_image {
73
+ max-width: 50px!important;
74
+ max-height: 50px!important;
75
+ margin-right: 10px;
76
+ border-radius: 3px;
77
+ vertical-align: middle;
78
+ }
79
+
80
+ .widget_cwp_top_products_widget ul,
81
+ .widget_cwp_latest_products_widget ul {
82
+ margin-left: 0 !important;
83
+ padding-left: 0 !important;
84
+ }
85
+
86
+ .widget_cwp_top_products_widget li,
87
+ .widget_cwp_latest_products_widget li {
88
+ margin-left: 0 !important;
89
+ background-image: none;
90
+ list-style: none!important;
91
+ }
92
+
93
+ .widget_cwp_top_products_widget li a,
94
+ .widget_cwp_latest_products_widget li a {
95
+ padding: 0 !important;
96
+ border: none!important;
97
+ }
98
+
99
+ .wppr-cols-2 > div.wppr-col,
100
+ .wppr-cols-3 > div.wppr-col {
101
+ width: 15%;
102
+ }
103
+
104
+ .wppr-cols-2 > a.wppr-col,
105
+ .wppr-cols-3 > a.wppr-col {
106
+ overflow: hidden;
107
+ width: 66%;
108
+ white-space: nowrap;
109
+ text-overflow: ellipsis;
110
+ ;
111
+ }
112
+
113
+ .wppr-cols-3 a.wppr-col {
114
+ position: relative;
115
+ top: 40%;
116
+ margin-right: -60px;
117
+ -webkit-transform: translateY(40%);
118
+ -ms-transform: translateY(40%);
119
+ transform: translateY(40%);
120
+ }
121
+
122
+ .wppr-cols-2 .wppr-col,
123
+ .wppr-cols-3 .wppr-col {
124
+ float: left;
125
+ }
126
+
127
+ .wppr-cols-3:after,
128
+ .wppr-cols-2:after {
129
+ display: table;
130
+ clear: both;
131
+ position: relative !important;
132
+ content: "";
133
+ }
134
+
135
+ .widget_cwp_top_products_widget {
136
+ overflow: hidden;
137
+ }
assets/css/dashboard_styles.css ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* #Clearing
2
+
3
+ ================================================== */
4
+ /* Self Clearing Goodness
5
+ .preload_result, #cwp_review_meta_box,#cwp_container,.cwp_addons_wrap{*/
6
+
7
+ /* <div class="rowf1f1f1*/
8
+ .cwpr_clearfix:before,
9
+ .cwpr_clearfix:after {
10
+ display: block;
11
+ visibility: hidden;
12
+ overflow: hidden;
13
+ width: 0;
14
+ height: 0;
15
+ content: "\0020";
16
+ }
17
+
18
+ .cwpr_clearfix:after {
19
+ clear: both;
20
+ }
21
+
22
+ .cwpr_clearfix {
23
+ zoom: 1;
24
+ }
25
+
26
+ .product-review-meta-Yes .review-settings-notice {
27
+ display: block !important;
28
+ }
29
+
30
+ .product-review-meta-Yes .review-settings-group {
31
+ display: block !important;
32
+ }
33
+ .product-review-meta-No {
34
+ display: none;
35
+ }
36
+
37
+ .preloadInfo {
38
+ width: 89%;
39
+ }
40
+
41
+ .review-settings-notice h4 {
42
+ margin: 0 !important;
43
+ }
44
+
45
+ .review-settings-group .review-settings-group-option {
46
+ margin: 5px 0;
47
+ }
48
+
49
+ .review-settings-group input {
50
+ padding: 4px;
51
+ }
52
+
53
+ .review-settings-notice {
54
+ padding: 5px 10px;
55
+ border: 1px solid #ddd;
56
+ border-radius: 3px 3px 0 0;
57
+ background: #fff;
58
+ }
59
+
60
+ .review-settings-group {
61
+ margin-bottom: 5px;
62
+ padding: 10px;
63
+ border: 1px solid #ddd;
64
+ border-top: none;
65
+ border-radius: 0 0 3px 3px;
66
+ background: #fff;
67
+ }
68
+
69
+ .review-settings-group label.option_label {
70
+ display: block;
71
+ float: left;
72
+ margin: 1px -1px 1px 1px;
73
+ padding: 4.5px 7px;
74
+ border-radius: 3px 0 0 3px;
75
+ background: #e7e7e7;
76
+ font-weight: 700;
77
+ }
78
+
79
+ .review-settings-group .option_grade {
80
+ width: 55px;
81
+ margin-left: -3px;
82
+ border-left: none;
83
+ border-radius: 0 3px 3px 0;
84
+ text-align: center;
85
+ }
86
+
87
+ .review-settings-group .option_content {
88
+ margin-right: 0;
89
+ border-radius: 3px 0 0 3px;
90
+ }
91
+
92
+ .review-settings-group #option_overall_score {
93
+ width: 50px;
94
+ border-radius: 0 3px 3px 0;
95
+ }
96
+
97
+ .review-settings-group ul li label {
98
+ display: block;
99
+ float: left;
100
+ width: 140px;
101
+ font-weight: 700;
102
+ line-height: 2.3;
103
+ }
104
+
105
+ .review-settings-group ul li input {
106
+ width: 200px;
107
+ }
108
+
109
+ .cwp_image_link label {
110
+ display: inline !important;
111
+ float: none !important;
112
+ }
113
+
114
+ .review-settings-group ul li input[type=radio] {
115
+ width: 10px;
116
+ }
117
+
118
+ img.theme_options_logo {
119
+ margin-top: -5px;
120
+ margin-right: 20px;
121
+ }
122
+
123
+ .preload_result {
124
+ display: none;
125
+ position: absolute;
126
+ z-index: 9999 !important;
127
+ top: 0 !important;
128
+ right: 0;
129
+ bottom: 0 !important;
130
+ left: 0;
131
+ background: rgba(0, 0, 0, 0.3);
132
+ }
133
+
134
+ .preload_result .preload_inner {
135
+ position: fixed;
136
+ top: 50%;
137
+ left: 50%;
138
+ min-width: 600px;
139
+ height: 500px;
140
+ margin-top: -250px;
141
+ margin-left: -300px;
142
+ background: #fff;
143
+ -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
144
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
145
+ }
146
+
147
+ .preload_result .preload_inner > header {
148
+ position: relative;
149
+ padding: 10px 20px;
150
+ border-bottom: 1px solid #ddd;
151
+ }
152
+
153
+ .preload_result .preload_inner > header h2 {
154
+ margin: 0;
155
+ padding: 10px 0;
156
+ line-height: 1;
157
+ }
158
+
159
+ .preload_result .preload_inner .preload_close {
160
+ position: absolute;
161
+ top: 20px;
162
+ right: 20px;
163
+ width: 20px;
164
+ height: 20px;
165
+ border-radius: 5px;
166
+ background: #ddd;
167
+ }
168
+
169
+ .preload_result .preload_inner .preload_close:before {
170
+ font: 400 20px/1 dashicons !important;
171
+ content: "\f158";
172
+ }
173
+
174
+ .preload_result .preload_inner .preload_close:hover {
175
+ opacity: 0.5;
176
+ cursor: pointer;
177
+ }
178
+
179
+ .preload_result .ajax_load_icon {
180
+ position: absolute;
181
+ top: 50%;
182
+ left: 50%;
183
+ width: 40px;
184
+ height: 40px;
185
+ margin-top: -20px;
186
+ margin-left: -20px;
187
+ }
188
+
189
+ .preload_result .preload_list {
190
+ overflow-y: scroll;
191
+ height: 400px;
192
+ }
193
+
194
+ .preload_result .preload_list .cwp_preloaded_item {
195
+ width: 98%;
196
+ margin: 0 2% 0 0;
197
+ padding: 5px;
198
+ border-bottom: 1px solid #ddd;
199
+ }
200
+
201
+ .preload_result .preload_list .cwp_preloaded_item:first-child {
202
+ border-top: 1px solid #ddd;
203
+ }
204
+
205
+ .preload_result .preload_list .cwp_preloaded_item header .cwp_p_title {
206
+ float: left;
207
+ width: 80%;
208
+ margin: 0;
209
+ padding: 0;
210
+ font-size: 13px;
211
+ line-height: 2;
212
+ }
213
+
214
+ .preload_result .preload_list .cwp_preloaded_item header .cwp_p_title:hover {
215
+ color: #2ea1cd;
216
+ cursor: pointer;
217
+ }
218
+
219
+ .preload_result .preload_list .cwp_preloaded_item header .cwp_p_title:before {
220
+ color: #ddd;
221
+ font: 400 13px/1 dashicons !important;
222
+ content: "\f139";
223
+ }
224
+
225
+ .preload_result .preload_list .cwp_preloaded_item header button.preload {
226
+ float: right;
227
+ width: 5%;
228
+ margin: 0;
229
+ padding: 3px 0 5px;
230
+ border: 1px solid #63a62f;
231
+ border-bottom: 1px solid #5b992b;
232
+ border-radius: 3px;
233
+ color: #fff;
234
+ background-color: #7fbf4d;
235
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7fbf4d), color-stop(100%, #63a62f));
236
+ background-image: -webkit-linear-gradient(top, #7fbf4d, #63a62f);
237
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#7fbf4d), to(#63a62f));
238
+ background-image: -webkit-gradient( linear, left bottom, left top, from(#7fbf4d), to(#63a62f));
239
+ background-image: -webkit-linear-gradient( bottom, #7fbf4d, #63a62f);
240
+ background-image: linear-gradient( to top, #7fbf4d, #63a62f);
241
+ -webkit-box-shadow: inset 0 1px 0 0 #96ca6d;
242
+ box-shadow: inset 0 1px 0 0 #96ca6d;
243
+ text-shadow: 0 -1px 0 #4c9021;
244
+ font: bold 20px/1;
245
+ text-align: center;
246
+ }
247
+
248
+ .preload_result .preload_list .cwp_preloaded_item header button.preload:hover {
249
+ background-color: #76b347;
250
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76b347), color-stop(100%, #5e9e2e));
251
+ background-image: -webkit-linear-gradient(top, #76b347, #5e9e2e);
252
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#76b347), to(#5e9e2e));
253
+ background-image: -webkit-gradient( linear, left bottom, left top, from(#76b347), to(#5e9e2e));
254
+ background-image: -webkit-linear-gradient( bottom, #76b347, #5e9e2e);
255
+ background-image: linear-gradient( to top, #76b347, #5e9e2e);
256
+ -webkit-box-shadow: inset 0 1px 0 0 #8dbf67;
257
+ box-shadow: inset 0 1px 0 0 #8dbf67;
258
+ cursor: pointer;
259
+ }
260
+
261
+ .preload_result .cwp_preloaded_item .cwp_pitem_info {
262
+ display: none;
263
+ float: left;
264
+ width: 100%;
265
+ margin-top: 5px;
266
+ }
267
+
268
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul {
269
+ float: left;
270
+ width: 30.66%;
271
+ margin: 0 4% 10px 0;
272
+ }
273
+
274
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul:last-of-type {
275
+ margin-right: 0 !important;
276
+ }
277
+
278
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul li {
279
+ padding-left: 10px;
280
+ border: 1px solid #f1f1f1;
281
+ border-bottom: none;
282
+ font-size: 10px;
283
+ -webkit-transition: all 0.2s ease-in-out;
284
+ transition: all 0.2s ease-in-out;
285
+ }
286
+
287
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul li:hover {
288
+ color: #fff;
289
+ background: #7fbf4d;
290
+ cursor: pointer;
291
+ }
292
+
293
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul li:last-of-type {
294
+ border-bottom: 1px solid #f1f1f1;
295
+ }
296
+
297
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul li,
298
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul h4 {
299
+ margin: 0;
300
+ }
301
+
302
+ .preload_result .cwp_preloaded_item .cwp_pitem_info ul h4 {
303
+ margin: 0;
304
+ padding: 3px 0;
305
+ border-radius: 3px 3px 0 0;
306
+ background: #f1f1f1;
307
+ text-align: center;
308
+ }
309
+
310
+ a.preload_info,
311
+ a.preload_info_upsell {
312
+ float: right;
313
+ margin-top: -14px;
314
+ padding: 5px 10px;
315
+ border: 1px solid #63a62f;
316
+ border-bottom: 1px solid #5b992b;
317
+ border-radius: 3px;
318
+ color: #fff;
319
+ background-color: #7fbf4d;
320
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7fbf4d), color-stop(100%, #63a62f));
321
+ background-image: -webkit-linear-gradient(to top, #7fbf4d, #63a62f);
322
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#7fbf4d), to(#63a62f));
323
+ background-image: -webkit-linear-gradient(top, #7fbf4d, #63a62f);
324
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#7fbf4d), to(#63a62f));
325
+ background-image: -webkit-linear-gradient(bottom, #7fbf4d, #63a62f);
326
+ background-image: linear-gradient(to top, #7fbf4d, #63a62f);
327
+ -webkit-box-shadow: inset 0 1px 0 0 #96ca6d;
328
+ box-shadow: inset 0 1px 0 0 #96ca6d;
329
+ text-shadow: 0 -1px 0 #4c9021;
330
+ font: bold 20px/1;
331
+ text-align: center;
332
+ text-decoration: none;
333
+ }
334
+
335
+ a.preload_info:hover,
336
+ a.preload_info_upsell:hover {
337
+ background-color: #76b347;
338
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76b347), color-stop(100%, #5e9e2e));
339
+ background-image: -webkit-linear-gradient(to top, #76b347, #5e9e2e);
340
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#76b347), to(#5e9e2e));
341
+ background-image: -webkit-linear-gradient(top, #76b347, #5e9e2e);
342
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#76b347), to(#5e9e2e));
343
+ background-image: -webkit-linear-gradient(bottom, #76b347, #5e9e2e);
344
+ background-image: linear-gradient(to top, #76b347, #5e9e2e);
345
+ -webkit-box-shadow: inset 0 1px 0 0 #8dbf67;
346
+ box-shadow: inset 0 1px 0 0 #8dbf67;
347
+ cursor: pointer;
348
+ }
349
+
350
+ /**
351
+ * Custom Icon
352
+ */
353
+ #bar-icon-elements {
354
+ display: none;
355
+ }
356
+
357
+ #bar-icon-elements.active {
358
+ display: block;
359
+ position: fixed;
360
+ top: 10%;
361
+ left: 50%;
362
+ width: 400px;
363
+ height: 200px;
364
+ margin-left: -200px;
365
+ padding: 20px;
366
+ border-radius: 3px;
367
+ background: #fff;
368
+ -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
369
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
370
+ }
371
+
372
+ #bar-icon-elements i,
373
+ .current_bar_icon i {
374
+ display: inline-block;
375
+ width: 25px;
376
+ height: 25px;
377
+ margin: 3px;
378
+ border: 1px solid #ddd;
379
+ border-radius: 3px;
380
+ color: #858585;
381
+ font-size: 15px;
382
+ line-height: 26px;
383
+ }
384
+
385
+ #bar-icon-elements i:hover {
386
+ border: 1px solid #ff9300;
387
+ color: #ff9300;
388
+ cursor: pointer;
389
+ }
390
+
391
+ #bar-icon-elements .closeModal {
392
+ position: absolute;
393
+ top: -10px;
394
+ right: -10px;
395
+ }
396
+
397
+ #bar-icon-elements .closeModal:hover i,
398
+ #bar-icon-elements i.active {
399
+ color: #fff;
400
+ background: #ff9300;
401
+ }
402
+
403
+ #bar-icon-elements .closeModal i {
404
+ border: none;
405
+ border-radius: 50%;
406
+ color: #fff;
407
+ background: #000;
408
+ line-height: 25px;
409
+ text-align: center;
410
+ }
411
+
412
+ #tab-general_settings li {
413
+ margin-left: 0;
414
+ padding: 0;
415
+ list-style: none;
416
+ }
417
+
418
+ #cwp_add_button {
419
+ margin-left: 5px;
420
+ font-size: 20px;
421
+ text-decoration: none;
422
+ }
423
+ .cwp_hide_button2 {
424
+ display: none;
425
+ }
426
+ .cwp_proscons {
427
+ display: inline-block;
428
+ width: 49.8%;
429
+ }
assets/css/editor.css ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wppr-review-yes,
2
+ #wppr-review-no {
3
+ margin-left: 10px;
4
+ }
5
+
6
+ #wppr-meta-yes {
7
+ display: block;
8
+ }
9
+
10
+ #wppr-meta-no {
11
+ display: none;
12
+ }
13
+
14
+ .wppr-review-section p,
15
+ h4 {
16
+ margin: 0;
17
+ }
18
+
19
+ .wppr-review-section label[for="wppr-editor-link-show"],
20
+ .wppr-review-section label[for="wppr-editor-link-open"] {
21
+ font-weight: normal;
22
+ }
23
+
24
+ .wppr-review-section span {
25
+ padding-bottom: 10px;
26
+ font-weight: bold;
27
+ }
28
+
29
+ #wppr-editor-link-show {
30
+ margin-left: 11px;
31
+ }
32
+
33
+ .wppr-review-section input[type="text"] {
34
+ width: 200px;
35
+ }
36
+
37
+ .wppr-review-section li {
38
+ margin-bottom: 12px;
39
+ }
40
+
41
+ #wppr-editor-image-button {
42
+ margin-left: 5px;
43
+ }
44
+
45
+ .wppr-review-section small {
46
+ display: inline-block;
47
+ width: 100%;
48
+ padding-bottom: 10px;
49
+ padding-left: 144px;
50
+ }
51
+
52
+ #wppr-editor-new-link {
53
+ font-size: 20px;
54
+ font-weight: bold;
55
+ cursor: pointer;
56
+ }
57
+
58
+ .wppr-review-section h4,
59
+ .wppr-review-section p,
60
+ .wppr-review-section .wppr-review-fieldset {
61
+ padding: 3px 10px;
62
+ }
63
+
64
+ .wppr-review-fieldset {
65
+ border-top: 1px solid #ddd;
66
+ }
67
+
68
+ .wppr-review-section {
69
+ margin-bottom: 10px;
70
+ border: 1px solid #ddd;
71
+ border-radius: 3px 3px 0 0;
72
+ }
73
+
74
+ .wppr-review-section label {
75
+ display: inline-block;
76
+ width: 140px;
77
+ font-weight: bold;
78
+ }
79
+
80
+ .wppr-review-options-list input {
81
+ margin: 0;
82
+ }
83
+
84
+ .wppr-review-options-list label,
85
+ input {
86
+ height: 30px;
87
+ }
88
+
89
+ .wppr-review-section .wppr-review-options-list .wppr-option-number {
90
+ width: 60px;
91
+ }
92
+
93
+ .wppr-review-options-list label {
94
+ width: 30px;
95
+ height: 30px;
96
+ margin-right: -4px;
97
+ border-radius: 3px 0 0 3px;
98
+ background: #ddd;
99
+ line-height: 30px;
100
+ text-align: center;
101
+ vertical-align: top;
102
+ }
103
+
104
+ .wppr-review-pros,
105
+ .wppr-review-cons {
106
+ width: 49%;
107
+ }
108
+
109
+ .wppr-review-pros {
110
+ float: left;
111
+ }
112
+
113
+ .wppr-review-cons {
114
+ float: right;
115
+ }
116
+
117
+ label.wppr-upsell-label {
118
+ display: block;
119
+ width: 98%;
120
+ padding: 1%;
121
+ background: #cae9ff;
122
+ text-align: center;
123
+ }
124
+
125
+ .wppr-review-options a.preload_info {
126
+ margin-top: -42px;
127
+ margin-right: 10px;
128
+ }
{css → assets/css}/font-awesome.min.css RENAMED
@@ -5,1562 +5,1562 @@
5
  /* FONT PATH
6
  * -------------------------- */
7
  @font-face {
8
- font-family: 'FontAwesome';
9
- src: url('fonts/fontawesome-webfont.eot?v=4.1.0');
10
- src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
11
- font-weight: normal;
12
- font-style: normal;
13
  }
14
  .fa {
15
- display: inline-block;
16
- font-family: FontAwesome;
17
- font-style: normal;
18
- font-weight: normal;
19
- line-height: 1;
20
- -webkit-font-smoothing: antialiased;
21
- -moz-osx-font-smoothing: grayscale;
22
  }
23
  /* makes the font 33% larger relative to the icon container */
24
  .fa-lg {
25
- font-size: 1.33333333em;
26
- line-height: 0.75em;
27
- vertical-align: -15%;
28
  }
29
  .fa-2x {
30
- font-size: 2em;
31
  }
32
  .fa-3x {
33
- font-size: 3em;
34
  }
35
  .fa-4x {
36
- font-size: 4em;
37
  }
38
  .fa-5x {
39
- font-size: 5em;
40
  }
41
  .fa-fw {
42
- width: 1.28571429em;
43
- text-align: center;
44
  }
45
  .fa-ul {
46
- padding-left: 0;
47
- margin-left: 2.14285714em;
48
- list-style-type: none;
49
  }
50
  .fa-ul > li {
51
- position: relative;
52
  }
53
  .fa-li {
54
- position: absolute;
55
- left: -2.14285714em;
56
- width: 2.14285714em;
57
- top: 0.14285714em;
58
- text-align: center;
59
  }
60
  .fa-li.fa-lg {
61
- left: -1.85714286em;
62
  }
63
  .fa-border {
64
- padding: .2em .25em .15em;
65
- border: solid 0.08em #eeeeee;
66
- border-radius: .1em;
67
  }
68
  .pull-right {
69
- float: right;
70
  }
71
  .pull-left {
72
- float: left;
73
  }
74
  .fa.pull-left {
75
- margin-right: .3em;
76
  }
77
  .fa.pull-right {
78
- margin-left: .3em;
79
  }
80
  .fa-spin {
81
- -webkit-animation: spin 2s infinite linear;
82
- -moz-animation: spin 2s infinite linear;
83
- -o-animation: spin 2s infinite linear;
84
- animation: spin 2s infinite linear;
85
  }
86
  @-moz-keyframes spin {
87
- 0% {
88
- -moz-transform: rotate(0deg);
89
- }
90
- 100% {
91
- -moz-transform: rotate(359deg);
92
- }
93
  }
94
  @-webkit-keyframes spin {
95
- 0% {
96
- -webkit-transform: rotate(0deg);
97
- }
98
- 100% {
99
- -webkit-transform: rotate(359deg);
100
- }
101
  }
102
  @-o-keyframes spin {
103
- 0% {
104
- -o-transform: rotate(0deg);
105
- }
106
- 100% {
107
- -o-transform: rotate(359deg);
108
- }
109
  }
110
  @keyframes spin {
111
- 0% {
112
- -webkit-transform: rotate(0deg);
113
- transform: rotate(0deg);
114
- }
115
- 100% {
116
- -webkit-transform: rotate(359deg);
117
- transform: rotate(359deg);
118
- }
119
  }
120
  .fa-rotate-90 {
121
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
122
- -webkit-transform: rotate(90deg);
123
- -moz-transform: rotate(90deg);
124
- -ms-transform: rotate(90deg);
125
- -o-transform: rotate(90deg);
126
- transform: rotate(90deg);
127
  }
128
  .fa-rotate-180 {
129
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
130
- -webkit-transform: rotate(180deg);
131
- -moz-transform: rotate(180deg);
132
- -ms-transform: rotate(180deg);
133
- -o-transform: rotate(180deg);
134
- transform: rotate(180deg);
135
  }
136
  .fa-rotate-270 {
137
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
138
- -webkit-transform: rotate(270deg);
139
- -moz-transform: rotate(270deg);
140
- -ms-transform: rotate(270deg);
141
- -o-transform: rotate(270deg);
142
- transform: rotate(270deg);
143
  }
144
  .fa-flip-horizontal {
145
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
146
- -webkit-transform: scale(-1, 1);
147
- -moz-transform: scale(-1, 1);
148
- -ms-transform: scale(-1, 1);
149
- -o-transform: scale(-1, 1);
150
- transform: scale(-1, 1);
151
  }
152
  .fa-flip-vertical {
153
- filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
154
- -webkit-transform: scale(1, -1);
155
- -moz-transform: scale(1, -1);
156
- -ms-transform: scale(1, -1);
157
- -o-transform: scale(1, -1);
158
- transform: scale(1, -1);
159
  }
160
  .fa-stack {
161
- position: relative;
162
- display: inline-block;
163
- width: 2em;
164
- height: 2em;
165
- line-height: 2em;
166
- vertical-align: middle;
167
  }
168
  .fa-stack-1x,
169
  .fa-stack-2x {
170
- position: absolute;
171
- left: 0;
172
- width: 100%;
173
- text-align: center;
174
  }
175
  .fa-stack-1x {
176
- line-height: inherit;
177
  }
178
  .fa-stack-2x {
179
- font-size: 2em;
180
  }
181
  .fa-inverse {
182
- color: #ffffff;
183
  }
184
  /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
185
  readers do not read off random characters that represent icons */
186
  .fa-glass:before {
187
- content: "\f000";
188
  }
189
  .fa-music:before {
190
- content: "\f001";
191
  }
192
  .fa-search:before {
193
- content: "\f002";
194
  }
195
  .fa-envelope-o:before {
196
- content: "\f003";
197
  }
198
  .fa-heart:before {
199
- content: "\f004";
200
  }
201
  .fa-star:before {
202
- content: "\f005";
203
  }
204
  .fa-star-o:before {
205
- content: "\f006";
206
  }
207
  .fa-user:before {
208
- content: "\f007";
209
  }
210
  .fa-film:before {
211
- content: "\f008";
212
  }
213
  .fa-th-large:before {
214
- content: "\f009";
215
  }
216
  .fa-th:before {
217
- content: "\f00a";
218
  }
219
  .fa-th-list:before {
220
- content: "\f00b";
221
  }
222
  .fa-check:before {
223
- content: "\f00c";
224
  }
225
  .fa-times:before {
226
- content: "\f00d";
227
  }
228
  .fa-search-plus:before {
229
- content: "\f00e";
230
  }
231
  .fa-search-minus:before {
232
- content: "\f010";
233
  }
234
  .fa-power-off:before {
235
- content: "\f011";
236
  }
237
  .fa-signal:before {
238
- content: "\f012";
239
  }
240
  .fa-gear:before,
241
  .fa-cog:before {
242
- content: "\f013";
243
  }
244
  .fa-trash-o:before {
245
- content: "\f014";
246
  }
247
  .fa-home:before {
248
- content: "\f015";
249
  }
250
  .fa-file-o:before {
251
- content: "\f016";
252
  }
253
  .fa-clock-o:before {
254
- content: "\f017";
255
  }
256
  .fa-road:before {
257
- content: "\f018";
258
  }
259
  .fa-download:before {
260
- content: "\f019";
261
  }
262
  .fa-arrow-circle-o-down:before {
263
- content: "\f01a";
264
  }
265
  .fa-arrow-circle-o-up:before {
266
- content: "\f01b";
267
  }
268
  .fa-inbox:before {
269
- content: "\f01c";
270
  }
271
  .fa-play-circle-o:before {
272
- content: "\f01d";
273
  }
274
  .fa-rotate-right:before,
275
  .fa-repeat:before {
276
- content: "\f01e";
277
  }
278
  .fa-refresh:before {
279
- content: "\f021";
280
  }
281
  .fa-list-alt:before {
282
- content: "\f022";
283
  }
284
  .fa-lock:before {
285
- content: "\f023";
286
  }
287
  .fa-flag:before {
288
- content: "\f024";
289
  }
290
  .fa-headphones:before {
291
- content: "\f025";
292
  }
293
  .fa-volume-off:before {
294
- content: "\f026";
295
  }
296
  .fa-volume-down:before {
297
- content: "\f027";
298
  }
299
  .fa-volume-up:before {
300
- content: "\f028";
301
  }
302
  .fa-qrcode:before {
303
- content: "\f029";
304
  }
305
  .fa-barcode:before {
306
- content: "\f02a";
307
  }
308
  .fa-tag:before {
309
- content: "\f02b";
310
  }
311
  .fa-tags:before {
312
- content: "\f02c";
313
  }
314
  .fa-book:before {
315
- content: "\f02d";
316
  }
317
  .fa-bookmark:before {
318
- content: "\f02e";
319
  }
320
  .fa-print:before {
321
- content: "\f02f";
322
  }
323
  .fa-camera:before {
324
- content: "\f030";
325
  }
326
  .fa-font:before {
327
- content: "\f031";
328
  }
329
  .fa-bold:before {
330
- content: "\f032";
331
  }
332
  .fa-italic:before {
333
- content: "\f033";
334
  }
335
  .fa-text-height:before {
336
- content: "\f034";
337
  }
338
  .fa-text-width:before {
339
- content: "\f035";
340
  }
341
  .fa-align-left:before {
342
- content: "\f036";
343
  }
344
  .fa-align-center:before {
345
- content: "\f037";
346
  }
347
  .fa-align-right:before {
348
- content: "\f038";
349
  }
350
  .fa-align-justify:before {
351
- content: "\f039";
352
  }
353
  .fa-list:before {
354
- content: "\f03a";
355
  }
356
  .fa-dedent:before,
357
  .fa-outdent:before {
358
- content: "\f03b";
359
  }
360
  .fa-indent:before {
361
- content: "\f03c";
362
  }
363
  .fa-video-camera:before {
364
- content: "\f03d";
365
  }
366
  .fa-photo:before,
367
  .fa-image:before,
368
  .fa-picture-o:before {
369
- content: "\f03e";
370
  }
371
  .fa-pencil:before {
372
- content: "\f040";
373
  }
374
  .fa-map-marker:before {
375
- content: "\f041";
376
  }
377
  .fa-adjust:before {
378
- content: "\f042";
379
  }
380
  .fa-tint:before {
381
- content: "\f043";
382
  }
383
  .fa-edit:before,
384
  .fa-pencil-square-o:before {
385
- content: "\f044";
386
  }
387
  .fa-share-square-o:before {
388
- content: "\f045";
389
  }
390
  .fa-check-square-o:before {
391
- content: "\f046";
392
  }
393
  .fa-arrows:before {
394
- content: "\f047";
395
  }
396
  .fa-step-backward:before {
397
- content: "\f048";
398
  }
399
  .fa-fast-backward:before {
400
- content: "\f049";
401
  }
402
  .fa-backward:before {
403
- content: "\f04a";
404
  }
405
  .fa-play:before {
406
- content: "\f04b";
407
  }
408
  .fa-pause:before {
409
- content: "\f04c";
410
  }
411
  .fa-stop:before {
412
- content: "\f04d";
413
  }
414
  .fa-forward:before {
415
- content: "\f04e";
416
  }
417
  .fa-fast-forward:before {
418
- content: "\f050";
419
  }
420
  .fa-step-forward:before {
421
- content: "\f051";
422
  }
423
  .fa-eject:before {
424
- content: "\f052";
425
  }
426
  .fa-chevron-left:before {
427
- content: "\f053";
428
  }
429
  .fa-chevron-right:before {
430
- content: "\f054";
431
  }
432
  .fa-plus-circle:before {
433
- content: "\f055";
434
  }
435
  .fa-minus-circle:before {
436
- content: "\f056";
437
  }
438
  .fa-times-circle:before {
439
- content: "\f057";
440
  }
441
  .fa-check-circle:before {
442
- content: "\f058";
443
  }
444
  .fa-question-circle:before {
445
- content: "\f059";
446
  }
447
  .fa-info-circle:before {
448
- content: "\f05a";
449
  }
450
  .fa-crosshairs:before {
451
- content: "\f05b";
452
  }
453
  .fa-times-circle-o:before {
454
- content: "\f05c";
455
  }
456
  .fa-check-circle-o:before {
457
- content: "\f05d";
458
  }
459
  .fa-ban:before {
460
- content: "\f05e";
461
  }
462
  .fa-arrow-left:before {
463
- content: "\f060";
464
  }
465
  .fa-arrow-right:before {
466
- content: "\f061";
467
  }
468
  .fa-arrow-up:before {
469
- content: "\f062";
470
  }
471
  .fa-arrow-down:before {
472
- content: "\f063";
473
  }
474
  .fa-mail-forward:before,
475
  .fa-share:before {
476
- content: "\f064";
477
  }
478
  .fa-expand:before {
479
- content: "\f065";
480
  }
481
  .fa-compress:before {
482
- content: "\f066";
483
  }
484
  .fa-plus:before {
485
- content: "\f067";
486
  }
487
  .fa-minus:before {
488
- content: "\f068";
489
  }
490
  .fa-asterisk:before {
491
- content: "\f069";
492
  }
493
  .fa-exclamation-circle:before {
494
- content: "\f06a";
495
  }
496
  .fa-gift:before {
497
- content: "\f06b";
498
  }
499
  .fa-leaf:before {
500
- content: "\f06c";
501
  }
502
  .fa-fire:before {
503
- content: "\f06d";
504
  }
505
  .fa-eye:before {
506
- content: "\f06e";
507
  }
508
  .fa-eye-slash:before {
509
- content: "\f070";
510
  }
511
  .fa-warning:before,
512
  .fa-exclamation-triangle:before {
513
- content: "\f071";
514
  }
515
  .fa-plane:before {
516
- content: "\f072";
517
  }
518
  .fa-calendar:before {
519
- content: "\f073";
520
  }
521
  .fa-random:before {
522
- content: "\f074";
523
  }
524
  .fa-comment:before {
525
- content: "\f075";
526
  }
527
  .fa-magnet:before {
528
- content: "\f076";
529
  }
530
  .fa-chevron-up:before {
531
- content: "\f077";
532
  }
533
  .fa-chevron-down:before {
534
- content: "\f078";
535
  }
536
  .fa-retweet:before {
537
- content: "\f079";
538
  }
539
  .fa-shopping-cart:before {
540
- content: "\f07a";
541
  }
542
  .fa-folder:before {
543
- content: "\f07b";
544
  }
545
  .fa-folder-open:before {
546
- content: "\f07c";
547
  }
548
  .fa-arrows-v:before {
549
- content: "\f07d";
550
  }
551
  .fa-arrows-h:before {
552
- content: "\f07e";
553
  }
554
  .fa-bar-chart-o:before {
555
- content: "\f080";
556
  }
557
  .fa-twitter-square:before {
558
- content: "\f081";
559
  }
560
  .fa-facebook-square:before {
561
- content: "\f082";
562
  }
563
  .fa-camera-retro:before {
564
- content: "\f083";
565
  }
566
  .fa-key:before {
567
- content: "\f084";
568
  }
569
  .fa-gears:before,
570
  .fa-cogs:before {
571
- content: "\f085";
572
  }
573
  .fa-comments:before {
574
- content: "\f086";
575
  }
576
  .fa-thumbs-o-up:before {
577
- content: "\f087";
578
  }
579
  .fa-thumbs-o-down:before {
580
- content: "\f088";
581
  }
582
  .fa-star-half:before {
583
- content: "\f089";
584
  }
585
  .fa-heart-o:before {
586
- content: "\f08a";
587
  }
588
  .fa-sign-out:before {
589
- content: "\f08b";
590
  }
591
  .fa-linkedin-square:before {
592
- content: "\f08c";
593
  }
594
  .fa-thumb-tack:before {
595
- content: "\f08d";
596
  }
597
  .fa-external-link:before {
598
- content: "\f08e";
599
  }
600
  .fa-sign-in:before {
601
- content: "\f090";
602
  }
603
  .fa-trophy:before {
604
- content: "\f091";
605
  }
606
  .fa-github-square:before {
607
- content: "\f092";
608
  }
609
  .fa-upload:before {
610
- content: "\f093";
611
  }
612
  .fa-lemon-o:before {
613
- content: "\f094";
614
  }
615
  .fa-phone:before {
616
- content: "\f095";
617
  }
618
  .fa-square-o:before {
619
- content: "\f096";
620
  }
621
  .fa-bookmark-o:before {
622
- content: "\f097";
623
  }
624
  .fa-phone-square:before {
625
- content: "\f098";
626
  }
627
  .fa-twitter:before {
628
- content: "\f099";
629
  }
630
  .fa-facebook:before {
631
- content: "\f09a";
632
  }
633
  .fa-github:before {
634
- content: "\f09b";
635
  }
636
  .fa-unlock:before {
637
- content: "\f09c";
638
  }
639
  .fa-credit-card:before {
640
- content: "\f09d";
641
  }
642
  .fa-rss:before {
643
- content: "\f09e";
644
  }
645
  .fa-hdd-o:before {
646
- content: "\f0a0";
647
  }
648
  .fa-bullhorn:before {
649
- content: "\f0a1";
650
  }
651
  .fa-bell:before {
652
- content: "\f0f3";
653
  }
654
  .fa-certificate:before {
655
- content: "\f0a3";
656
  }
657
  .fa-hand-o-right:before {
658
- content: "\f0a4";
659
  }
660
  .fa-hand-o-left:before {
661
- content: "\f0a5";
662
  }
663
  .fa-hand-o-up:before {
664
- content: "\f0a6";
665
  }
666
  .fa-hand-o-down:before {
667
- content: "\f0a7";
668
  }
669
  .fa-arrow-circle-left:before {
670
- content: "\f0a8";
671
  }
672
  .fa-arrow-circle-right:before {
673
- content: "\f0a9";
674
  }
675
  .fa-arrow-circle-up:before {
676
- content: "\f0aa";
677
  }
678
  .fa-arrow-circle-down:before {
679
- content: "\f0ab";
680
  }
681
  .fa-globe:before {
682
- content: "\f0ac";
683
  }
684
  .fa-wrench:before {
685
- content: "\f0ad";
686
  }
687
  .fa-tasks:before {
688
- content: "\f0ae";
689
  }
690
  .fa-filter:before {
691
- content: "\f0b0";
692
  }
693
  .fa-briefcase:before {
694
- content: "\f0b1";
695
  }
696
  .fa-arrows-alt:before {
697
- content: "\f0b2";
698
  }
699
  .fa-group:before,
700
  .fa-users:before {
701
- content: "\f0c0";
702
  }
703
  .fa-chain:before,
704
  .fa-link:before {
705
- content: "\f0c1";
706
  }
707
  .fa-cloud:before {
708
- content: "\f0c2";
709
  }
710
  .fa-flask:before {
711
- content: "\f0c3";
712
  }
713
  .fa-cut:before,
714
  .fa-scissors:before {
715
- content: "\f0c4";
716
  }
717
  .fa-copy:before,
718
  .fa-files-o:before {
719
- content: "\f0c5";
720
  }
721
  .fa-paperclip:before {
722
- content: "\f0c6";
723
  }
724
  .fa-save:before,
725
  .fa-floppy-o:before {
726
- content: "\f0c7";
727
  }
728
  .fa-square:before {
729
- content: "\f0c8";
730
  }
731
  .fa-navicon:before,
732
  .fa-reorder:before,
733
  .fa-bars:before {
734
- content: "\f0c9";
735
  }
736
  .fa-list-ul:before {
737
- content: "\f0ca";
738
  }
739
  .fa-list-ol:before {
740
- content: "\f0cb";
741
  }
742
  .fa-strikethrough:before {
743
- content: "\f0cc";
744
  }
745
  .fa-underline:before {
746
- content: "\f0cd";
747
  }
748
  .fa-table:before {
749
- content: "\f0ce";
750
  }
751
  .fa-magic:before {
752
- content: "\f0d0";
753
  }
754
  .fa-truck:before {
755
- content: "\f0d1";
756
  }
757
  .fa-pinterest:before {
758
- content: "\f0d2";
759
  }
760
  .fa-pinterest-square:before {
761
- content: "\f0d3";
762
  }
763
  .fa-google-plus-square:before {
764
- content: "\f0d4";
765
  }
766
  .fa-google-plus:before {
767
- content: "\f0d5";
768
  }
769
  .fa-money:before {
770
- content: "\f0d6";
771
  }
772
  .fa-caret-down:before {
773
- content: "\f0d7";
774
  }
775
  .fa-caret-up:before {
776
- content: "\f0d8";
777
  }
778
  .fa-caret-left:before {
779
- content: "\f0d9";
780
  }
781
  .fa-caret-right:before {
782
- content: "\f0da";
783
  }
784
  .fa-columns:before {
785
- content: "\f0db";
786
  }
787
  .fa-unsorted:before,
788
  .fa-sort:before {
789
- content: "\f0dc";
790
  }
791
  .fa-sort-down:before,
792
  .fa-sort-desc:before {
793
- content: "\f0dd";
794
  }
795
  .fa-sort-up:before,
796
  .fa-sort-asc:before {
797
- content: "\f0de";
798
  }
799
  .fa-envelope:before {
800
- content: "\f0e0";
801
  }
802
  .fa-linkedin:before {
803
- content: "\f0e1";
804
  }
805
  .fa-rotate-left:before,
806
  .fa-undo:before {
807
- content: "\f0e2";
808
  }
809
  .fa-legal:before,
810
  .fa-gavel:before {
811
- content: "\f0e3";
812
  }
813
  .fa-dashboard:before,
814
  .fa-tachometer:before {
815
- content: "\f0e4";
816
  }
817
  .fa-comment-o:before {
818
- content: "\f0e5";
819
  }
820
  .fa-comments-o:before {
821
- content: "\f0e6";
822
  }
823
  .fa-flash:before,
824
  .fa-bolt:before {
825
- content: "\f0e7";
826
  }
827
  .fa-sitemap:before {
828
- content: "\f0e8";
829
  }
830
  .fa-umbrella:before {
831
- content: "\f0e9";
832
  }
833
  .fa-paste:before,
834
  .fa-clipboard:before {
835
- content: "\f0ea";
836
  }
837
  .fa-lightbulb-o:before {
838
- content: "\f0eb";
839
  }
840
  .fa-exchange:before {
841
- content: "\f0ec";
842
  }
843
  .fa-cloud-download:before {
844
- content: "\f0ed";
845
  }
846
  .fa-cloud-upload:before {
847
- content: "\f0ee";
848
  }
849
  .fa-user-md:before {
850
- content: "\f0f0";
851
  }
852
  .fa-stethoscope:before {
853
- content: "\f0f1";
854
  }
855
  .fa-suitcase:before {
856
- content: "\f0f2";
857
  }
858
  .fa-bell-o:before {
859
- content: "\f0a2";
860
  }
861
  .fa-coffee:before {
862
- content: "\f0f4";
863
  }
864
  .fa-cutlery:before {
865
- content: "\f0f5";
866
  }
867
  .fa-file-text-o:before {
868
- content: "\f0f6";
869
  }
870
  .fa-building-o:before {
871
- content: "\f0f7";
872
  }
873
  .fa-hospital-o:before {
874
- content: "\f0f8";
875
  }
876
  .fa-ambulance:before {
877
- content: "\f0f9";
878
  }
879
  .fa-medkit:before {
880
- content: "\f0fa";
881
  }
882
  .fa-fighter-jet:before {
883
- content: "\f0fb";
884
  }
885
  .fa-beer:before {
886
- content: "\f0fc";
887
  }
888
  .fa-h-square:before {
889
- content: "\f0fd";
890
  }
891
  .fa-plus-square:before {
892
- content: "\f0fe";
893
  }
894
  .fa-angle-double-left:before {
895
- content: "\f100";
896
  }
897
  .fa-angle-double-right:before {
898
- content: "\f101";
899
  }
900
  .fa-angle-double-up:before {
901
- content: "\f102";
902
  }
903
  .fa-angle-double-down:before {
904
- content: "\f103";
905
  }
906
  .fa-angle-left:before {
907
- content: "\f104";
908
  }
909
  .fa-angle-right:before {
910
- content: "\f105";
911
  }
912
  .fa-angle-up:before {
913
- content: "\f106";
914
  }
915
  .fa-angle-down:before {
916
- content: "\f107";
917
  }
918
  .fa-desktop:before {
919
- content: "\f108";
920
  }
921
  .fa-laptop:before {
922
- content: "\f109";
923
  }
924
  .fa-tablet:before {
925
- content: "\f10a";
926
  }
927
  .fa-mobile-phone:before,
928
  .fa-mobile:before {
929
- content: "\f10b";
930
  }
931
  .fa-circle-o:before {
932
- content: "\f10c";
933
  }
934
  .fa-quote-left:before {
935
- content: "\f10d";
936
  }
937
  .fa-quote-right:before {
938
- content: "\f10e";
939
  }
940
  .fa-spinner:before {
941
- content: "\f110";
942
  }
943
  .fa-circle:before {
944
- content: "\f111";
945
  }
946
  .fa-mail-reply:before,
947
  .fa-reply:before {
948
- content: "\f112";
949
  }
950
  .fa-github-alt:before {
951
- content: "\f113";
952
  }
953
  .fa-folder-o:before {
954
- content: "\f114";
955
  }
956
  .fa-folder-open-o:before {
957
- content: "\f115";
958
  }
959
  .fa-smile-o:before {
960
- content: "\f118";
961
  }
962
  .fa-frown-o:before {
963
- content: "\f119";
964
  }
965
  .fa-meh-o:before {
966
- content: "\f11a";
967
  }
968
  .fa-gamepad:before {
969
- content: "\f11b";
970
  }
971
  .fa-keyboard-o:before {
972
- content: "\f11c";
973
  }
974
  .fa-flag-o:before {
975
- content: "\f11d";
976
  }
977
  .fa-flag-checkered:before {
978
- content: "\f11e";
979
  }
980
  .fa-terminal:before {
981
- content: "\f120";
982
  }
983
  .fa-code:before {
984
- content: "\f121";
985
  }
986
  .fa-mail-reply-all:before,
987
  .fa-reply-all:before {
988
- content: "\f122";
989
  }
990
  .fa-star-half-empty:before,
991
  .fa-star-half-full:before,
992
  .fa-star-half-o:before {
993
- content: "\f123";
994
  }
995
  .fa-location-arrow:before {
996
- content: "\f124";
997
  }
998
  .fa-crop:before {
999
- content: "\f125";
1000
  }
1001
  .fa-code-fork:before {
1002
- content: "\f126";
1003
  }
1004
  .fa-unlink:before,
1005
  .fa-chain-broken:before {
1006
- content: "\f127";
1007
  }
1008
  .fa-question:before {
1009
- content: "\f128";
1010
  }
1011
  .fa-info:before {
1012
- content: "\f129";
1013
  }
1014
  .fa-exclamation:before {
1015
- content: "\f12a";
1016
  }
1017
  .fa-superscript:before {
1018
- content: "\f12b";
1019
  }
1020
  .fa-subscript:before {
1021
- content: "\f12c";
1022
  }
1023
  .fa-eraser:before {
1024
- content: "\f12d";
1025
  }
1026
  .fa-puzzle-piece:before {
1027
- content: "\f12e";
1028
  }
1029
  .fa-microphone:before {
1030
- content: "\f130";
1031
  }
1032
  .fa-microphone-slash:before {
1033
- content: "\f131";
1034
  }
1035
  .fa-shield:before {
1036
- content: "\f132";
1037
  }
1038
  .fa-calendar-o:before {
1039
- content: "\f133";
1040
  }
1041
  .fa-fire-extinguisher:before {
1042
- content: "\f134";
1043
  }
1044
  .fa-rocket:before {
1045
- content: "\f135";
1046
  }
1047
  .fa-maxcdn:before {
1048
- content: "\f136";
1049
  }
1050
  .fa-chevron-circle-left:before {
1051
- content: "\f137";
1052
  }
1053
  .fa-chevron-circle-right:before {
1054
- content: "\f138";
1055
  }
1056
  .fa-chevron-circle-up:before {
1057
- content: "\f139";
1058
  }
1059
  .fa-chevron-circle-down:before {
1060
- content: "\f13a";
1061
  }
1062
  .fa-html5:before {
1063
- content: "\f13b";
1064
  }
1065
  .fa-css3:before {
1066
- content: "\f13c";
1067
  }
1068
  .fa-anchor:before {
1069
- content: "\f13d";
1070
  }
1071
  .fa-unlock-alt:before {
1072
- content: "\f13e";
1073
  }
1074
  .fa-bullseye:before {
1075
- content: "\f140";
1076
  }
1077
  .fa-ellipsis-h:before {
1078
- content: "\f141";
1079
  }
1080
  .fa-ellipsis-v:before {
1081
- content: "\f142";
1082
  }
1083
  .fa-rss-square:before {
1084
- content: "\f143";
1085
  }
1086
  .fa-play-circle:before {
1087
- content: "\f144";
1088
  }
1089
  .fa-ticket:before {
1090
- content: "\f145";
1091
  }
1092
  .fa-minus-square:before {
1093
- content: "\f146";
1094
  }
1095
  .fa-minus-square-o:before {
1096
- content: "\f147";
1097
  }
1098
  .fa-level-up:before {
1099
- content: "\f148";
1100
  }
1101
  .fa-level-down:before {
1102
- content: "\f149";
1103
  }
1104
  .fa-check-square:before {
1105
- content: "\f14a";
1106
  }
1107
  .fa-pencil-square:before {
1108
- content: "\f14b";
1109
  }
1110
  .fa-external-link-square:before {
1111
- content: "\f14c";
1112
  }
1113
  .fa-share-square:before {
1114
- content: "\f14d";
1115
  }
1116
  .fa-compass:before {
1117
- content: "\f14e";
1118
  }
1119
  .fa-toggle-down:before,
1120
  .fa-caret-square-o-down:before {
1121
- content: "\f150";
1122
  }
1123
  .fa-toggle-up:before,
1124
  .fa-caret-square-o-up:before {
1125
- content: "\f151";
1126
  }
1127
  .fa-toggle-right:before,
1128
  .fa-caret-square-o-right:before {
1129
- content: "\f152";
1130
  }
1131
  .fa-euro:before,
1132
  .fa-eur:before {
1133
- content: "\f153";
1134
  }
1135
  .fa-gbp:before {
1136
- content: "\f154";
1137
  }
1138
  .fa-dollar:before,
1139
  .fa-usd:before {
1140
- content: "\f155";
1141
  }
1142
  .fa-rupee:before,
1143
  .fa-inr:before {
1144
- content: "\f156";
1145
  }
1146
  .fa-cny:before,
1147
  .fa-rmb:before,
1148
  .fa-yen:before,
1149
  .fa-jpy:before {
1150
- content: "\f157";
1151
  }
1152
  .fa-ruble:before,
1153
  .fa-rouble:before,
1154
  .fa-rub:before {
1155
- content: "\f158";
1156
  }
1157
  .fa-won:before,
1158
  .fa-krw:before {
1159
- content: "\f159";
1160
  }
1161
  .fa-bitcoin:before,
1162
  .fa-btc:before {
1163
- content: "\f15a";
1164
  }
1165
  .fa-file:before {
1166
- content: "\f15b";
1167
  }
1168
  .fa-file-text:before {
1169
- content: "\f15c";
1170
  }
1171
  .fa-sort-alpha-asc:before {
1172
- content: "\f15d";
1173
  }
1174
  .fa-sort-alpha-desc:before {
1175
- content: "\f15e";
1176
  }
1177
  .fa-sort-amount-asc:before {
1178
- content: "\f160";
1179
  }
1180
  .fa-sort-amount-desc:before {
1181
- content: "\f161";
1182
  }
1183
  .fa-sort-numeric-asc:before {
1184
- content: "\f162";
1185
  }
1186
  .fa-sort-numeric-desc:before {
1187
- content: "\f163";
1188
  }
1189
  .fa-thumbs-up:before {
1190
- content: "\f164";
1191
  }
1192
  .fa-thumbs-down:before {
1193
- content: "\f165";
1194
  }
1195
  .fa-youtube-square:before {
1196
- content: "\f166";
1197
  }
1198
  .fa-youtube:before {
1199
- content: "\f167";
1200
  }
1201
  .fa-xing:before {
1202
- content: "\f168";
1203
  }
1204
  .fa-xing-square:before {
1205
- content: "\f169";
1206
  }
1207
  .fa-youtube-play:before {
1208
- content: "\f16a";
1209
  }
1210
  .fa-dropbox:before {
1211
- content: "\f16b";
1212
  }
1213
  .fa-stack-overflow:before {
1214
- content: "\f16c";
1215
  }
1216
  .fa-instagram:before {
1217
- content: "\f16d";
1218
  }
1219
  .fa-flickr:before {
1220
- content: "\f16e";
1221
  }
1222
  .fa-adn:before {
1223
- content: "\f170";
1224
  }
1225
  .fa-bitbucket:before {
1226
- content: "\f171";
1227
  }
1228
  .fa-bitbucket-square:before {
1229
- content: "\f172";
1230
  }
1231
  .fa-tumblr:before {
1232
- content: "\f173";
1233
  }
1234
  .fa-tumblr-square:before {
1235
- content: "\f174";
1236
  }
1237
  .fa-long-arrow-down:before {
1238
- content: "\f175";
1239
  }
1240
  .fa-long-arrow-up:before {
1241
- content: "\f176";
1242
  }
1243
  .fa-long-arrow-left:before {
1244
- content: "\f177";
1245
  }
1246
  .fa-long-arrow-right:before {
1247
- content: "\f178";
1248
  }
1249
  .fa-apple:before {
1250
- content: "\f179";
1251
  }
1252
  .fa-windows:before {
1253
- content: "\f17a";
1254
  }
1255
  .fa-android:before {
1256
- content: "\f17b";
1257
  }
1258
  .fa-linux:before {
1259
- content: "\f17c";
1260
  }
1261
  .fa-dribbble:before {
1262
- content: "\f17d";
1263
  }
1264
  .fa-skype:before {
1265
- content: "\f17e";
1266
  }
1267
  .fa-foursquare:before {
1268
- content: "\f180";
1269
  }
1270
  .fa-trello:before {
1271
- content: "\f181";
1272
  }
1273
  .fa-female:before {
1274
- content: "\f182";
1275
  }
1276
  .fa-male:before {
1277
- content: "\f183";
1278
  }
1279
  .fa-gittip:before {
1280
- content: "\f184";
1281
  }
1282
  .fa-sun-o:before {
1283
- content: "\f185";
1284
  }
1285
  .fa-moon-o:before {
1286
- content: "\f186";
1287
  }
1288
  .fa-archive:before {
1289
- content: "\f187";
1290
  }
1291
  .fa-bug:before {
1292
- content: "\f188";
1293
  }
1294
  .fa-vk:before {
1295
- content: "\f189";
1296
  }
1297
  .fa-weibo:before {
1298
- content: "\f18a";
1299
  }
1300
  .fa-renren:before {
1301
- content: "\f18b";
1302
  }
1303
  .fa-pagelines:before {
1304
- content: "\f18c";
1305
  }
1306
  .fa-stack-exchange:before {
1307
- content: "\f18d";
1308
  }
1309
  .fa-arrow-circle-o-right:before {
1310
- content: "\f18e";
1311
  }
1312
  .fa-arrow-circle-o-left:before {
1313
- content: "\f190";
1314
  }
1315
  .fa-toggle-left:before,
1316
  .fa-caret-square-o-left:before {
1317
- content: "\f191";
1318
  }
1319
  .fa-dot-circle-o:before {
1320
- content: "\f192";
1321
  }
1322
  .fa-wheelchair:before {
1323
- content: "\f193";
1324
  }
1325
  .fa-vimeo-square:before {
1326
- content: "\f194";
1327
  }
1328
  .fa-turkish-lira:before,
1329
  .fa-try:before {
1330
- content: "\f195";
1331
  }
1332
  .fa-plus-square-o:before {
1333
- content: "\f196";
1334
  }
1335
  .fa-space-shuttle:before {
1336
- content: "\f197";
1337
  }
1338
  .fa-slack:before {
1339
- content: "\f198";
1340
  }
1341
  .fa-envelope-square:before {
1342
- content: "\f199";
1343
  }
1344
  .fa-wordpress:before {
1345
- content: "\f19a";
1346
  }
1347
  .fa-openid:before {
1348
- content: "\f19b";
1349
  }
1350
  .fa-institution:before,
1351
  .fa-bank:before,
1352
  .fa-university:before {
1353
- content: "\f19c";
1354
  }
1355
  .fa-mortar-board:before,
1356
  .fa-graduation-cap:before {
1357
- content: "\f19d";
1358
  }
1359
  .fa-yahoo:before {
1360
- content: "\f19e";
1361
  }
1362
  .fa-google:before {
1363
- content: "\f1a0";
1364
  }
1365
  .fa-reddit:before {
1366
- content: "\f1a1";
1367
  }
1368
  .fa-reddit-square:before {
1369
- content: "\f1a2";
1370
  }
1371
  .fa-stumbleupon-circle:before {
1372
- content: "\f1a3";
1373
  }
1374
  .fa-stumbleupon:before {
1375
- content: "\f1a4";
1376
  }
1377
  .fa-delicious:before {
1378
- content: "\f1a5";
1379
  }
1380
  .fa-digg:before {
1381
- content: "\f1a6";
1382
  }
1383
  .fa-pied-piper-square:before,
1384
  .fa-pied-piper:before {
1385
- content: "\f1a7";
1386
  }
1387
  .fa-pied-piper-alt:before {
1388
- content: "\f1a8";
1389
  }
1390
  .fa-drupal:before {
1391
- content: "\f1a9";
1392
  }
1393
  .fa-joomla:before {
1394
- content: "\f1aa";
1395
  }
1396
  .fa-language:before {
1397
- content: "\f1ab";
1398
  }
1399
  .fa-fax:before {
1400
- content: "\f1ac";
1401
  }
1402
  .fa-building:before {
1403
- content: "\f1ad";
1404
  }
1405
  .fa-child:before {
1406
- content: "\f1ae";
1407
  }
1408
  .fa-paw:before {
1409
- content: "\f1b0";
1410
  }
1411
  .fa-spoon:before {
1412
- content: "\f1b1";
1413
  }
1414
  .fa-cube:before {
1415
- content: "\f1b2";
1416
  }
1417
  .fa-cubes:before {
1418
- content: "\f1b3";
1419
  }
1420
  .fa-behance:before {
1421
- content: "\f1b4";
1422
  }
1423
  .fa-behance-square:before {
1424
- content: "\f1b5";
1425
  }
1426
  .fa-steam:before {
1427
- content: "\f1b6";
1428
  }
1429
  .fa-steam-square:before {
1430
- content: "\f1b7";
1431
  }
1432
  .fa-recycle:before {
1433
- content: "\f1b8";
1434
  }
1435
  .fa-automobile:before,
1436
  .fa-car:before {
1437
- content: "\f1b9";
1438
  }
1439
  .fa-cab:before,
1440
  .fa-taxi:before {
1441
- content: "\f1ba";
1442
  }
1443
  .fa-tree:before {
1444
- content: "\f1bb";
1445
  }
1446
  .fa-spotify:before {
1447
- content: "\f1bc";
1448
  }
1449
  .fa-deviantart:before {
1450
- content: "\f1bd";
1451
  }
1452
  .fa-soundcloud:before {
1453
- content: "\f1be";
1454
  }
1455
  .fa-database:before {
1456
- content: "\f1c0";
1457
  }
1458
  .fa-file-pdf-o:before {
1459
- content: "\f1c1";
1460
  }
1461
  .fa-file-word-o:before {
1462
- content: "\f1c2";
1463
  }
1464
  .fa-file-excel-o:before {
1465
- content: "\f1c3";
1466
  }
1467
  .fa-file-powerpoint-o:before {
1468
- content: "\f1c4";
1469
  }
1470
  .fa-file-photo-o:before,
1471
  .fa-file-picture-o:before,
1472
  .fa-file-image-o:before {
1473
- content: "\f1c5";
1474
  }
1475
  .fa-file-zip-o:before,
1476
  .fa-file-archive-o:before {
1477
- content: "\f1c6";
1478
  }
1479
  .fa-file-sound-o:before,
1480
  .fa-file-audio-o:before {
1481
- content: "\f1c7";
1482
  }
1483
  .fa-file-movie-o:before,
1484
  .fa-file-video-o:before {
1485
- content: "\f1c8";
1486
  }
1487
  .fa-file-code-o:before {
1488
- content: "\f1c9";
1489
  }
1490
  .fa-vine:before {
1491
- content: "\f1ca";
1492
  }
1493
  .fa-codepen:before {
1494
- content: "\f1cb";
1495
  }
1496
  .fa-jsfiddle:before {
1497
- content: "\f1cc";
1498
  }
1499
  .fa-life-bouy:before,
1500
  .fa-life-saver:before,
1501
  .fa-support:before,
1502
  .fa-life-ring:before {
1503
- content: "\f1cd";
1504
  }
1505
  .fa-circle-o-notch:before {
1506
- content: "\f1ce";
1507
  }
1508
  .fa-ra:before,
1509
  .fa-rebel:before {
1510
- content: "\f1d0";
1511
  }
1512
  .fa-ge:before,
1513
  .fa-empire:before {
1514
- content: "\f1d1";
1515
  }
1516
  .fa-git-square:before {
1517
- content: "\f1d2";
1518
  }
1519
  .fa-git:before {
1520
- content: "\f1d3";
1521
  }
1522
  .fa-hacker-news:before {
1523
- content: "\f1d4";
1524
  }
1525
  .fa-tencent-weibo:before {
1526
- content: "\f1d5";
1527
  }
1528
  .fa-qq:before {
1529
- content: "\f1d6";
1530
  }
1531
  .fa-wechat:before,
1532
  .fa-weixin:before {
1533
- content: "\f1d7";
1534
  }
1535
  .fa-send:before,
1536
  .fa-paper-plane:before {
1537
- content: "\f1d8";
1538
  }
1539
  .fa-send-o:before,
1540
  .fa-paper-plane-o:before {
1541
- content: "\f1d9";
1542
  }
1543
  .fa-history:before {
1544
- content: "\f1da";
1545
  }
1546
  .fa-circle-thin:before {
1547
- content: "\f1db";
1548
  }
1549
  .fa-header:before {
1550
- content: "\f1dc";
1551
  }
1552
  .fa-paragraph:before {
1553
- content: "\f1dd";
1554
  }
1555
  .fa-sliders:before {
1556
- content: "\f1de";
1557
  }
1558
  .fa-share-alt:before {
1559
- content: "\f1e0";
1560
  }
1561
  .fa-share-alt-square:before {
1562
- content: "\f1e1";
1563
  }
1564
  .fa-bomb:before {
1565
- content: "\f1e2";
1566
- }
5
  /* FONT PATH
6
  * -------------------------- */
7
  @font-face {
8
+ font-family: 'FontAwesome';
9
+ src: url('fonts/fontawesome-webfont.eot?v=4.1.0');
10
+ src: url('fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
11
+ font-weight: normal;
12
+ font-style: normal;
13
  }
14
  .fa {
15
+ display: inline-block;
16
+ font-family: FontAwesome;
17
+ font-style: normal;
18
+ font-weight: normal;
19
+ line-height: 1;
20
+ -webkit-font-smoothing: antialiased;
21
+ -moz-osx-font-smoothing: grayscale;
22
  }
23
  /* makes the font 33% larger relative to the icon container */
24
  .fa-lg {
25
+ font-size: 1.33333333em;
26
+ line-height: 0.75em;
27
+ vertical-align: -15%;
28
  }
29
  .fa-2x {
30
+ font-size: 2em;
31
  }
32
  .fa-3x {
33
+ font-size: 3em;
34
  }
35
  .fa-4x {
36
+ font-size: 4em;
37
  }
38
  .fa-5x {
39
+ font-size: 5em;
40
  }
41
  .fa-fw {
42
+ width: 1.28571429em;
43
+ text-align: center;
44
  }
45
  .fa-ul {
46
+ padding-left: 0;
47
+ margin-left: 2.14285714em;
48
+ list-style-type: none;
49
  }
50
  .fa-ul > li {
51
+ position: relative;
52
  }
53
  .fa-li {
54
+ position: absolute;
55
+ left: -2.14285714em;
56
+ width: 2.14285714em;
57
+ top: 0.14285714em;
58
+ text-align: center;
59
  }
60
  .fa-li.fa-lg {
61
+ left: -1.85714286em;
62
  }
63
  .fa-border {
64
+ padding: .2em .25em .15em;
65
+ border: solid 0.08em #eeeeee;
66
+ border-radius: .1em;
67
  }
68
  .pull-right {
69
+ float: right;
70
  }
71
  .pull-left {
72
+ float: left;
73
  }
74
  .fa.pull-left {
75
+ margin-right: .3em;
76
  }
77
  .fa.pull-right {
78
+ margin-left: .3em;
79
  }
80
  .fa-spin {
81
+ -webkit-animation: spin 2s infinite linear;
82
+ -moz-animation: spin 2s infinite linear;
83
+ -o-animation: spin 2s infinite linear;
84
+ animation: spin 2s infinite linear;
85
  }
86
  @-moz-keyframes spin {
87
+ 0% {
88
+ -moz-transform: rotate(0deg);
89
+ }
90
+ 100% {
91
+ -moz-transform: rotate(359deg);
92
+ }
93
  }
94
  @-webkit-keyframes spin {
95
+ 0% {
96
+ -webkit-transform: rotate(0deg);
97
+ }
98
+ 100% {
99
+ -webkit-transform: rotate(359deg);
100
+ }
101
  }
102
  @-o-keyframes spin {
103
+ 0% {
104
+ -o-transform: rotate(0deg);
105
+ }
106
+ 100% {
107
+ -o-transform: rotate(359deg);
108
+ }
109
  }
110
  @keyframes spin {
111
+ 0% {
112
+ -webkit-transform: rotate(0deg);
113
+ transform: rotate(0deg);
114
+ }
115
+ 100% {
116
+ -webkit-transform: rotate(359deg);
117
+ transform: rotate(359deg);
118
+ }
119
  }
120
  .fa-rotate-90 {
121
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
122
+ -webkit-transform: rotate(90deg);
123
+ -moz-transform: rotate(90deg);
124
+ -ms-transform: rotate(90deg);
125
+ -o-transform: rotate(90deg);
126
+ transform: rotate(90deg);
127
  }
128
  .fa-rotate-180 {
129
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
130
+ -webkit-transform: rotate(180deg);
131
+ -moz-transform: rotate(180deg);
132
+ -ms-transform: rotate(180deg);
133
+ -o-transform: rotate(180deg);
134
+ transform: rotate(180deg);
135
  }
136
  .fa-rotate-270 {
137
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
138
+ -webkit-transform: rotate(270deg);
139
+ -moz-transform: rotate(270deg);
140
+ -ms-transform: rotate(270deg);
141
+ -o-transform: rotate(270deg);
142
+ transform: rotate(270deg);
143
  }
144
  .fa-flip-horizontal {
145
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
146
+ -webkit-transform: scale(-1, 1);
147
+ -moz-transform: scale(-1, 1);
148
+ -ms-transform: scale(-1, 1);
149
+ -o-transform: scale(-1, 1);
150
+ transform: scale(-1, 1);
151
  }
152
  .fa-flip-vertical {
153
+ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
154
+ -webkit-transform: scale(1, -1);
155
+ -moz-transform: scale(1, -1);
156
+ -ms-transform: scale(1, -1);
157
+ -o-transform: scale(1, -1);
158
+ transform: scale(1, -1);
159
  }
160
  .fa-stack {
161
+ position: relative;
162
+ display: inline-block;
163
+ width: 2em;
164
+ height: 2em;
165
+ line-height: 2em;
166
+ vertical-align: middle;
167
  }
168
  .fa-stack-1x,
169
  .fa-stack-2x {
170
+ position: absolute;
171
+ left: 0;
172
+ width: 100%;
173
+ text-align: center;
174
  }
175
  .fa-stack-1x {
176
+ line-height: inherit;
177
  }
178
  .fa-stack-2x {
179
+ font-size: 2em;
180
  }
181
  .fa-inverse {
182
+ color: #ffffff;
183
  }
184
  /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
185
  readers do not read off random characters that represent icons */
186
  .fa-glass:before {
187
+ content: "\f000";
188
  }
189
  .fa-music:before {
190
+ content: "\f001";
191
  }
192
  .fa-search:before {
193
+ content: "\f002";
194
  }
195
  .fa-envelope-o:before {
196
+ content: "\f003";
197
  }
198
  .fa-heart:before {
199
+ content: "\f004";
200
  }
201
  .fa-star:before {
202
+ content: "\f005";
203
  }
204
  .fa-star-o:before {
205
+ content: "\f006";
206
  }
207
  .fa-user:before {
208
+ content: "\f007";
209
  }
210
  .fa-film:before {
211
+ content: "\f008";
212
  }
213
  .fa-th-large:before {
214
+ content: "\f009";
215
  }
216
  .fa-th:before {
217
+ content: "\f00a";
218
  }
219
  .fa-th-list:before {
220
+ content: "\f00b";
221
  }
222
  .fa-check:before {
223
+ content: "\f00c";
224
  }
225
  .fa-times:before {
226
+ content: "\f00d";
227
  }
228
  .fa-search-plus:before {
229
+ content: "\f00e";
230
  }
231
  .fa-search-minus:before {
232
+ content: "\f010";
233
  }
234
  .fa-power-off:before {
235
+ content: "\f011";
236
  }
237
  .fa-signal:before {
238
+ content: "\f012";
239
  }
240
  .fa-gear:before,
241
  .fa-cog:before {
242
+ content: "\f013";
243
  }
244
  .fa-trash-o:before {
245
+ content: "\f014";
246
  }
247
  .fa-home:before {
248
+ content: "\f015";
249
  }
250
  .fa-file-o:before {
251
+ content: "\f016";
252
  }
253
  .fa-clock-o:before {
254
+ content: "\f017";
255
  }
256
  .fa-road:before {
257
+ content: "\f018";
258
  }
259
  .fa-download:before {
260
+ content: "\f019";
261
  }
262
  .fa-arrow-circle-o-down:before {
263
+ content: "\f01a";
264
  }
265
  .fa-arrow-circle-o-up:before {
266
+ content: "\f01b";
267
  }
268
  .fa-inbox:before {
269
+ content: "\f01c";
270
  }
271
  .fa-play-circle-o:before {
272
+ content: "\f01d";
273
  }
274
  .fa-rotate-right:before,
275
  .fa-repeat:before {
276
+ content: "\f01e";
277
  }
278
  .fa-refresh:before {
279
+ content: "\f021";
280
  }
281
  .fa-list-alt:before {
282
+ content: "\f022";
283
  }
284
  .fa-lock:before {
285
+ content: "\f023";
286
  }
287
  .fa-flag:before {
288
+ content: "\f024";
289
  }
290
  .fa-headphones:before {
291
+ content: "\f025";
292
  }
293
  .fa-volume-off:before {
294
+ content: "\f026";
295
  }
296
  .fa-volume-down:before {
297
+ content: "\f027";
298
  }
299
  .fa-volume-up:before {
300
+ content: "\f028";
301
  }
302
  .fa-qrcode:before {
303
+ content: "\f029";
304
  }
305
  .fa-barcode:before {
306
+ content: "\f02a";
307
  }
308
  .fa-tag:before {
309
+ content: "\f02b";
310
  }
311
  .fa-tags:before {
312
+ content: "\f02c";
313
  }
314
  .fa-book:before {
315
+ content: "\f02d";
316
  }
317
  .fa-bookmark:before {
318
+ content: "\f02e";
319
  }
320
  .fa-print:before {
321
+ content: "\f02f";
322
  }
323
  .fa-camera:before {
324
+ content: "\f030";
325
  }
326
  .fa-font:before {
327
+ content: "\f031";
328
  }
329
  .fa-bold:before {
330
+ content: "\f032";
331
  }
332
  .fa-italic:before {
333
+ content: "\f033";
334
  }
335
  .fa-text-height:before {
336
+ content: "\f034";
337
  }
338
  .fa-text-width:before {
339
+ content: "\f035";
340
  }
341
  .fa-align-left:before {
342
+ content: "\f036";
343
  }
344
  .fa-align-center:before {
345
+ content: "\f037";
346
  }
347
  .fa-align-right:before {
348
+ content: "\f038";
349
  }
350
  .fa-align-justify:before {
351
+ content: "\f039";
352
  }
353
  .fa-list:before {
354
+ content: "\f03a";
355
  }
356
  .fa-dedent:before,
357
  .fa-outdent:before {
358
+ content: "\f03b";
359
  }
360
  .fa-indent:before {
361
+ content: "\f03c";
362
  }
363
  .fa-video-camera:before {
364
+ content: "\f03d";
365
  }
366
  .fa-photo:before,
367
  .fa-image:before,
368
  .fa-picture-o:before {
369
+ content: "\f03e";
370
  }
371
  .fa-pencil:before {
372
+ content: "\f040";
373
  }
374
  .fa-map-marker:before {
375
+ content: "\f041";
376
  }
377
  .fa-adjust:before {
378
+ content: "\f042";
379
  }
380
  .fa-tint:before {
381
+ content: "\f043";
382
  }
383
  .fa-edit:before,
384
  .fa-pencil-square-o:before {
385
+ content: "\f044";
386
  }
387
  .fa-share-square-o:before {
388
+ content: "\f045";
389
  }
390
  .fa-check-square-o:before {
391
+ content: "\f046";
392
  }
393
  .fa-arrows:before {
394
+ content: "\f047";
395
  }
396
  .fa-step-backward:before {
397
+ content: "\f048";
398
  }
399
  .fa-fast-backward:before {
400
+ content: "\f049";
401
  }
402
  .fa-backward:before {
403
+ content: "\f04a";
404
  }
405
  .fa-play:before {
406
+ content: "\f04b";
407
  }
408
  .fa-pause:before {
409
+ content: "\f04c";
410
  }
411
  .fa-stop:before {
412
+ content: "\f04d";
413
  }
414
  .fa-forward:before {
415
+ content: "\f04e";
416
  }
417
  .fa-fast-forward:before {
418
+ content: "\f050";
419
  }
420
  .fa-step-forward:before {
421
+ content: "\f051";
422
  }
423
  .fa-eject:before {
424
+ content: "\f052";
425
  }
426
  .fa-chevron-left:before {
427
+ content: "\f053";
428
  }
429
  .fa-chevron-right:before {
430
+ content: "\f054";
431
  }
432
  .fa-plus-circle:before {
433
+ content: "\f055";
434
  }
435
  .fa-minus-circle:before {
436
+ content: "\f056";
437
  }
438
  .fa-times-circle:before {
439
+ content: "\f057";
440
  }
441
  .fa-check-circle:before {
442
+ content: "\f058";
443
  }
444
  .fa-question-circle:before {
445
+ content: "\f059";
446
  }
447
  .fa-info-circle:before {
448
+ content: "\f05a";
449
  }
450
  .fa-crosshairs:before {
451
+ content: "\f05b";
452
  }
453
  .fa-times-circle-o:before {
454
+ content: "\f05c";
455
  }
456
  .fa-check-circle-o:before {
457
+ content: "\f05d";
458
  }
459
  .fa-ban:before {
460
+ content: "\f05e";
461
  }
462
  .fa-arrow-left:before {
463
+ content: "\f060";
464
  }
465
  .fa-arrow-right:before {
466
+ content: "\f061";
467
  }
468
  .fa-arrow-up:before {
469
+ content: "\f062";
470
  }
471
  .fa-arrow-down:before {
472
+ content: "\f063";
473
  }
474
  .fa-mail-forward:before,
475
  .fa-share:before {
476
+ content: "\f064";
477
  }
478
  .fa-expand:before {
479
+ content: "\f065";
480
  }
481
  .fa-compress:before {
482
+ content: "\f066";
483
  }
484
  .fa-plus:before {
485
+ content: "\f067";
486
  }
487
  .fa-minus:before {
488
+ content: "\f068";
489
  }
490
  .fa-asterisk:before {
491
+ content: "\f069";
492
  }
493
  .fa-exclamation-circle:before {
494
+ content: "\f06a";
495
  }
496
  .fa-gift:before {
497
+ content: "\f06b";
498
  }
499
  .fa-leaf:before {
500
+ content: "\f06c";
501
  }
502
  .fa-fire:before {
503
+ content: "\f06d";
504
  }
505
  .fa-eye:before {
506
+ content: "\f06e";
507
  }
508
  .fa-eye-slash:before {
509
+ content: "\f070";
510
  }
511
  .fa-warning:before,
512
  .fa-exclamation-triangle:before {
513
+ content: "\f071";
514
  }
515
  .fa-plane:before {
516
+ content: "\f072";
517
  }
518
  .fa-calendar:before {
519
+ content: "\f073";
520
  }
521
  .fa-random:before {
522
+ content: "\f074";
523
  }
524
  .fa-comment:before {
525
+ content: "\f075";
526
  }
527
  .fa-magnet:before {
528
+ content: "\f076";
529
  }
530
  .fa-chevron-up:before {
531
+ content: "\f077";
532
  }
533
  .fa-chevron-down:before {
534
+ content: "\f078";
535
  }
536
  .fa-retweet:before {
537
+ content: "\f079";
538
  }
539
  .fa-shopping-cart:before {
540
+ content: "\f07a";
541
  }
542
  .fa-folder:before {
543
+ content: "\f07b";
544
  }
545
  .fa-folder-open:before {
546
+ content: "\f07c";
547
  }
548
  .fa-arrows-v:before {
549
+ content: "\f07d";
550
  }
551
  .fa-arrows-h:before {
552
+ content: "\f07e";
553
  }
554
  .fa-bar-chart-o:before {
555
+ content: "\f080";
556
  }
557
  .fa-twitter-square:before {
558
+ content: "\f081";
559
  }
560
  .fa-facebook-square:before {
561
+ content: "\f082";
562
  }
563
  .fa-camera-retro:before {
564
+ content: "\f083";
565
  }
566
  .fa-key:before {
567
+ content: "\f084";
568
  }
569
  .fa-gears:before,
570
  .fa-cogs:before {
571
+ content: "\f085";
572
  }
573
  .fa-comments:before {
574
+ content: "\f086";
575
  }
576
  .fa-thumbs-o-up:before {
577
+ content: "\f087";
578
  }
579
  .fa-thumbs-o-down:before {
580
+ content: "\f088";
581
  }
582
  .fa-star-half:before {
583
+ content: "\f089";
584
  }
585
  .fa-heart-o:before {
586
+ content: "\f08a";
587
  }
588
  .fa-sign-out:before {
589
+ content: "\f08b";
590
  }
591
  .fa-linkedin-square:before {
592
+ content: "\f08c";
593
  }
594
  .fa-thumb-tack:before {
595
+ content: "\f08d";
596
  }
597
  .fa-external-link:before {
598
+ content: "\f08e";
599
  }
600
  .fa-sign-in:before {
601
+ content: "\f090";
602
  }
603
  .fa-trophy:before {
604
+ content: "\f091";
605
  }
606
  .fa-github-square:before {
607
+ content: "\f092";
608
  }
609
  .fa-upload:before {
610
+ content: "\f093";
611
  }
612
  .fa-lemon-o:before {
613
+ content: "\f094";
614
  }
615
  .fa-phone:before {
616
+ content: "\f095";
617
  }
618
  .fa-square-o:before {
619
+ content: "\f096";
620
  }
621
  .fa-bookmark-o:before {
622
+ content: "\f097";
623
  }
624
  .fa-phone-square:before {
625
+ content: "\f098";
626
  }
627
  .fa-twitter:before {
628
+ content: "\f099";
629
  }
630
  .fa-facebook:before {
631
+ content: "\f09a";
632
  }
633
  .fa-github:before {
634
+ content: "\f09b";
635
  }
636
  .fa-unlock:before {
637
+ content: "\f09c";
638
  }
639
  .fa-credit-card:before {
640
+ content: "\f09d";
641
  }
642
  .fa-rss:before {
643
+ content: "\f09e";
644
  }
645
  .fa-hdd-o:before {
646
+ content: "\f0a0";
647
  }
648
  .fa-bullhorn:before {
649
+ content: "\f0a1";
650
  }
651
  .fa-bell:before {
652
+ content: "\f0f3";
653
  }
654
  .fa-certificate:before {
655
+ content: "\f0a3";
656
  }
657
  .fa-hand-o-right:before {
658
+ content: "\f0a4";
659
  }
660
  .fa-hand-o-left:before {
661
+ content: "\f0a5";
662
  }
663
  .fa-hand-o-up:before {
664
+ content: "\f0a6";
665
  }
666
  .fa-hand-o-down:before {
667
+ content: "\f0a7";
668
  }
669
  .fa-arrow-circle-left:before {
670
+ content: "\f0a8";
671
  }
672
  .fa-arrow-circle-right:before {
673
+ content: "\f0a9";
674
  }
675
  .fa-arrow-circle-up:before {
676
+ content: "\f0aa";
677
  }
678
  .fa-arrow-circle-down:before {
679
+ content: "\f0ab";
680
  }
681
  .fa-globe:before {
682
+ content: "\f0ac";
683
  }
684
  .fa-wrench:before {
685
+ content: "\f0ad";
686
  }
687
  .fa-tasks:before {
688
+ content: "\f0ae";
689
  }
690
  .fa-filter:before {
691
+ content: "\f0b0";
692
  }
693
  .fa-briefcase:before {
694
+ content: "\f0b1";
695
  }
696
  .fa-arrows-alt:before {
697
+ content: "\f0b2";
698
  }
699
  .fa-group:before,
700
  .fa-users:before {
701
+ content: "\f0c0";
702
  }
703
  .fa-chain:before,
704
  .fa-link:before {
705
+ content: "\f0c1";
706
  }
707
  .fa-cloud:before {
708
+ content: "\f0c2";
709
  }
710
  .fa-flask:before {
711
+ content: "\f0c3";
712
  }
713
  .fa-cut:before,
714
  .fa-scissors:before {
715
+ content: "\f0c4";
716
  }
717
  .fa-copy:before,
718
  .fa-files-o:before {
719
+ content: "\f0c5";
720
  }
721
  .fa-paperclip:before {
722
+ content: "\f0c6";
723
  }
724
  .fa-save:before,
725
  .fa-floppy-o:before {
726
+ content: "\f0c7";
727
  }
728
  .fa-square:before {
729
+ content: "\f0c8";
730
  }
731
  .fa-navicon:before,
732
  .fa-reorder:before,
733
  .fa-bars:before {
734
+ content: "\f0c9";
735
  }
736
  .fa-list-ul:before {
737
+ content: "\f0ca";
738
  }
739
  .fa-list-ol:before {
740
+ content: "\f0cb";
741
  }
742
  .fa-strikethrough:before {
743
+ content: "\f0cc";
744
  }
745
  .fa-underline:before {
746
+ content: "\f0cd";
747
  }
748
  .fa-table:before {
749
+ content: "\f0ce";
750
  }
751
  .fa-magic:before {
752
+ content: "\f0d0";
753
  }
754
  .fa-truck:before {
755
+ content: "\f0d1";
756
  }
757
  .fa-pinterest:before {
758
+ content: "\f0d2";
759
  }
760
  .fa-pinterest-square:before {
761
+ content: "\f0d3";
762
  }
763
  .fa-google-plus-square:before {
764
+ content: "\f0d4";
765
  }
766
  .fa-google-plus:before {
767
+ content: "\f0d5";
768
  }
769
  .fa-money:before {
770
+ content: "\f0d6";
771
  }
772
  .fa-caret-down:before {
773
+ content: "\f0d7";
774
  }
775
  .fa-caret-up:before {
776
+ content: "\f0d8";
777
  }
778
  .fa-caret-left:before {
779
+ content: "\f0d9";
780
  }
781
  .fa-caret-right:before {
782
+ content: "\f0da";
783
  }
784
  .fa-columns:before {
785
+ content: "\f0db";
786
  }
787
  .fa-unsorted:before,
788
  .fa-sort:before {
789
+ content: "\f0dc";
790
  }
791
  .fa-sort-down:before,
792
  .fa-sort-desc:before {
793
+ content: "\f0dd";
794
  }
795
  .fa-sort-up:before,
796
  .fa-sort-asc:before {
797
+ content: "\f0de";
798
  }
799
  .fa-envelope:before {
800
+ content: "\f0e0";
801
  }
802
  .fa-linkedin:before {
803
+ content: "\f0e1";
804
  }
805
  .fa-rotate-left:before,
806
  .fa-undo:before {
807
+ content: "\f0e2";
808
  }
809
  .fa-legal:before,
810
  .fa-gavel:before {
811
+ content: "\f0e3";
812
  }
813
  .fa-dashboard:before,
814
  .fa-tachometer:before {
815
+ content: "\f0e4";
816
  }
817
  .fa-comment-o:before {
818
+ content: "\f0e5";
819
  }
820
  .fa-comments-o:before {
821
+ content: "\f0e6";
822
  }
823
  .fa-flash:before,
824
  .fa-bolt:before {
825
+ content: "\f0e7";
826
  }
827
  .fa-sitemap:before {
828
+ content: "\f0e8";
829
  }
830
  .fa-umbrella:before {
831
+ content: "\f0e9";
832
  }
833
  .fa-paste:before,
834
  .fa-clipboard:before {
835
+ content: "\f0ea";
836
  }
837
  .fa-lightbulb-o:before {
838
+ content: "\f0eb";
839
  }
840
  .fa-exchange:before {
841
+ content: "\f0ec";
842
  }
843
  .fa-cloud-download:before {
844
+ content: "\f0ed";
845
  }
846
  .fa-cloud-upload:before {
847
+ content: "\f0ee";
848
  }
849
  .fa-user-md:before {
850
+ content: "\f0f0";
851
  }
852
  .fa-stethoscope:before {
853
+ content: "\f0f1";
854
  }
855
  .fa-suitcase:before {
856
+ content: "\f0f2";
857
  }
858
  .fa-bell-o:before {
859
+ content: "\f0a2";
860
  }
861
  .fa-coffee:before {
862
+ content: "\f0f4";
863
  }
864
  .fa-cutlery:before {
865
+ content: "\f0f5";
866
  }
867
  .fa-file-text-o:before {
868
+ content: "\f0f6";
869
  }
870
  .fa-building-o:before {
871
+ content: "\f0f7";
872
  }
873
  .fa-hospital-o:before {
874
+ content: "\f0f8";
875
  }
876
  .fa-ambulance:before {
877
+ content: "\f0f9";
878
  }
879
  .fa-medkit:before {
880
+ content: "\f0fa";
881
  }
882
  .fa-fighter-jet:before {
883
+ content: "\f0fb";
884
  }
885
  .fa-beer:before {
886
+ content: "\f0fc";
887
  }
888
  .fa-h-square:before {
889
+ content: "\f0fd";
890
  }
891
  .fa-plus-square:before {
892
+ content: "\f0fe";
893
  }
894
  .fa-angle-double-left:before {
895
+ content: "\f100";
896
  }
897
  .fa-angle-double-right:before {
898
+ content: "\f101";
899
  }
900
  .fa-angle-double-up:before {
901
+ content: "\f102";
902
  }
903
  .fa-angle-double-down:before {
904
+ content: "\f103";
905
  }
906
  .fa-angle-left:before {
907
+ content: "\f104";
908
  }
909
  .fa-angle-right:before {
910
+ content: "\f105";
911
  }
912
  .fa-angle-up:before {
913
+ content: "\f106";
914
  }
915
  .fa-angle-down:before {
916
+ content: "\f107";
917
  }
918
  .fa-desktop:before {
919
+ content: "\f108";
920
  }
921
  .fa-laptop:before {
922
+ content: "\f109";
923
  }
924
  .fa-tablet:before {
925
+ content: "\f10a";
926
  }
927
  .fa-mobile-phone:before,
928
  .fa-mobile:before {
929
+ content: "\f10b";
930
  }
931
  .fa-circle-o:before {
932
+ content: "\f10c";
933
  }
934
  .fa-quote-left:before {
935
+ content: "\f10d";
936
  }
937
  .fa-quote-right:before {
938
+ content: "\f10e";
939
  }
940
  .fa-spinner:before {
941
+ content: "\f110";
942
  }
943
  .fa-circle:before {
944
+ content: "\f111";
945
  }
946
  .fa-mail-reply:before,
947
  .fa-reply:before {
948
+ content: "\f112";
949
  }
950
  .fa-github-alt:before {
951
+ content: "\f113";
952
  }
953
  .fa-folder-o:before {
954
+ content: "\f114";
955
  }
956
  .fa-folder-open-o:before {
957
+ content: "\f115";
958
  }
959
  .fa-smile-o:before {
960
+ content: "\f118";
961
  }
962
  .fa-frown-o:before {
963
+ content: "\f119";
964
  }
965
  .fa-meh-o:before {
966
+ content: "\f11a";
967
  }
968
  .fa-gamepad:before {
969
+ content: "\f11b";
970
  }
971
  .fa-keyboard-o:before {
972
+ content: "\f11c";
973
  }
974
  .fa-flag-o:before {
975
+ content: "\f11d";
976
  }
977
  .fa-flag-checkered:before {
978
+ content: "\f11e";
979
  }
980
  .fa-terminal:before {
981
+ content: "\f120";
982
  }
983
  .fa-code:before {
984
+ content: "\f121";
985
  }
986
  .fa-mail-reply-all:before,
987
  .fa-reply-all:before {
988
+ content: "\f122";
989
  }
990
  .fa-star-half-empty:before,
991
  .fa-star-half-full:before,
992
  .fa-star-half-o:before {
993
+ content: "\f123";
994
  }
995
  .fa-location-arrow:before {
996
+ content: "\f124";
997
  }
998
  .fa-crop:before {
999
+ content: "\f125";
1000
  }
1001
  .fa-code-fork:before {
1002
+ content: "\f126";
1003
  }
1004
  .fa-unlink:before,
1005
  .fa-chain-broken:before {
1006
+ content: "\f127";
1007
  }
1008
  .fa-question:before {
1009
+ content: "\f128";
1010
  }
1011
  .fa-info:before {
1012
+ content: "\f129";
1013
  }
1014
  .fa-exclamation:before {
1015
+ content: "\f12a";
1016
  }
1017
  .fa-superscript:before {
1018
+ content: "\f12b";
1019
  }
1020
  .fa-subscript:before {
1021
+ content: "\f12c";
1022
  }
1023
  .fa-eraser:before {
1024
+ content: "\f12d";
1025
  }
1026
  .fa-puzzle-piece:before {
1027
+ content: "\f12e";
1028
  }
1029
  .fa-microphone:before {
1030
+ content: "\f130";
1031
  }
1032
  .fa-microphone-slash:before {
1033
+ content: "\f131";
1034
  }
1035
  .fa-shield:before {
1036
+ content: "\f132";
1037
  }
1038
  .fa-calendar-o:before {
1039
+ content: "\f133";
1040
  }
1041
  .fa-fire-extinguisher:before {
1042
+ content: "\f134";
1043
  }
1044
  .fa-rocket:before {
1045
+ content: "\f135";
1046
  }
1047
  .fa-maxcdn:before {
1048
+ content: "\f136";
1049
  }
1050
  .fa-chevron-circle-left:before {
1051
+ content: "\f137";
1052
  }
1053
  .fa-chevron-circle-right:before {
1054
+ content: "\f138";
1055
  }
1056
  .fa-chevron-circle-up:before {
1057
+ content: "\f139";
1058
  }
1059
  .fa-chevron-circle-down:before {
1060
+ content: "\f13a";
1061
  }
1062
  .fa-html5:before {
1063
+ content: "\f13b";
1064
  }
1065
  .fa-css3:before {
1066
+ content: "\f13c";
1067
  }
1068
  .fa-anchor:before {
1069
+ content: "\f13d";
1070
  }
1071
  .fa-unlock-alt:before {
1072
+ content: "\f13e";
1073
  }
1074
  .fa-bullseye:before {
1075
+ content: "\f140";
1076
  }
1077
  .fa-ellipsis-h:before {
1078
+ content: "\f141";
1079
  }
1080
  .fa-ellipsis-v:before {
1081
+ content: "\f142";
1082
  }
1083
  .fa-rss-square:before {
1084
+ content: "\f143";
1085
  }
1086
  .fa-play-circle:before {
1087
+ content: "\f144";
1088
  }
1089
  .fa-ticket:before {
1090
+ content: "\f145";
1091
  }
1092
  .fa-minus-square:before {
1093
+ content: "\f146";
1094
  }
1095
  .fa-minus-square-o:before {
1096
+ content: "\f147";
1097
  }
1098
  .fa-level-up:before {
1099
+ content: "\f148";
1100
  }
1101
  .fa-level-down:before {
1102
+ content: "\f149";
1103
  }
1104
  .fa-check-square:before {
1105
+ content: "\f14a";
1106
  }
1107
  .fa-pencil-square:before {
1108
+ content: "\f14b";
1109
  }
1110
  .fa-external-link-square:before {
1111
+ content: "\f14c";
1112
  }
1113
  .fa-share-square:before {
1114
+ content: "\f14d";
1115
  }
1116
  .fa-compass:before {
1117
+ content: "\f14e";
1118
  }
1119
  .fa-toggle-down:before,
1120
  .fa-caret-square-o-down:before {
1121
+ content: "\f150";
1122
  }
1123
  .fa-toggle-up:before,
1124
  .fa-caret-square-o-up:before {
1125
+ content: "\f151";
1126
  }
1127
  .fa-toggle-right:before,
1128
  .fa-caret-square-o-right:before {
1129
+ content: "\f152";
1130
  }
1131
  .fa-euro:before,
1132
  .fa-eur:before {
1133
+ content: "\f153";
1134
  }
1135
  .fa-gbp:before {
1136
+ content: "\f154";
1137
  }
1138
  .fa-dollar:before,
1139
  .fa-usd:before {
1140
+ content: "\f155";
1141
  }
1142
  .fa-rupee:before,
1143
  .fa-inr:before {
1144
+ content: "\f156";
1145
  }
1146
  .fa-cny:before,
1147
  .fa-rmb:before,
1148
  .fa-yen:before,
1149
  .fa-jpy:before {
1150
+ content: "\f157";
1151
  }
1152
  .fa-ruble:before,
1153
  .fa-rouble:before,
1154
  .fa-rub:before {
1155
+ content: "\f158";
1156
  }
1157
  .fa-won:before,
1158
  .fa-krw:before {
1159
+ content: "\f159";
1160
  }
1161
  .fa-bitcoin:before,
1162
  .fa-btc:before {
1163
+ content: "\f15a";
1164
  }
1165
  .fa-file:before {
1166
+ content: "\f15b";
1167
  }
1168
  .fa-file-text:before {
1169
+ content: "\f15c";
1170
  }
1171
  .fa-sort-alpha-asc:before {
1172
+ content: "\f15d";
1173
  }
1174
  .fa-sort-alpha-desc:before {
1175
+ content: "\f15e";
1176
  }
1177
  .fa-sort-amount-asc:before {
1178
+ content: "\f160";
1179
  }
1180
  .fa-sort-amount-desc:before {
1181
+ content: "\f161";
1182
  }
1183
  .fa-sort-numeric-asc:before {
1184
+ content: "\f162";
1185
  }
1186
  .fa-sort-numeric-desc:before {
1187
+ content: "\f163";
1188
  }
1189
  .fa-thumbs-up:before {
1190
+ content: "\f164";
1191
  }
1192
  .fa-thumbs-down:before {
1193
+ content: "\f165";
1194
  }
1195
  .fa-youtube-square:before {
1196
+ content: "\f166";
1197
  }
1198
  .fa-youtube:before {
1199
+ content: "\f167";
1200
  }
1201
  .fa-xing:before {
1202
+ content: "\f168";
1203
  }
1204
  .fa-xing-square:before {
1205
+ content: "\f169";
1206
  }
1207
  .fa-youtube-play:before {
1208
+ content: "\f16a";
1209
  }
1210
  .fa-dropbox:before {
1211
+ content: "\f16b";
1212
  }
1213
  .fa-stack-overflow:before {
1214
+ content: "\f16c";
1215
  }
1216
  .fa-instagram:before {
1217
+ content: "\f16d";
1218
  }
1219
  .fa-flickr:before {
1220
+ content: "\f16e";
1221
  }
1222
  .fa-adn:before {
1223
+ content: "\f170";
1224
  }
1225
  .fa-bitbucket:before {
1226
+ content: "\f171";
1227
  }
1228
  .fa-bitbucket-square:before {
1229
+ content: "\f172";
1230
  }
1231
  .fa-tumblr:before {
1232
+ content: "\f173";
1233
  }
1234
  .fa-tumblr-square:before {
1235
+ content: "\f174";
1236
  }
1237
  .fa-long-arrow-down:before {
1238
+ content: "\f175";
1239
  }
1240
  .fa-long-arrow-up:before {
1241
+ content: "\f176";
1242
  }
1243
  .fa-long-arrow-left:before {
1244
+ content: "\f177";
1245
  }
1246
  .fa-long-arrow-right:before {
1247
+ content: "\f178";
1248
  }
1249
  .fa-apple:before {
1250
+ content: "\f179";
1251
  }
1252
  .fa-windows:before {
1253
+ content: "\f17a";
1254
  }
1255
  .fa-android:before {
1256
+ content: "\f17b";
1257
  }
1258
  .fa-linux:before {
1259
+ content: "\f17c";
1260
  }
1261
  .fa-dribbble:before {
1262
+ content: "\f17d";
1263
  }
1264
  .fa-skype:before {
1265
+ content: "\f17e";
1266
  }
1267
  .fa-foursquare:before {
1268
+ content: "\f180";
1269
  }
1270
  .fa-trello:before {
1271
+ content: "\f181";
1272
  }
1273
  .fa-female:before {
1274
+ content: "\f182";
1275
  }
1276
  .fa-male:before {
1277
+ content: "\f183";
1278
  }
1279
  .fa-gittip:before {
1280
+ content: "\f184";
1281
  }
1282
  .fa-sun-o:before {
1283
+ content: "\f185";
1284
  }
1285
  .fa-moon-o:before {
1286
+ content: "\f186";
1287
  }
1288
  .fa-archive:before {
1289
+ content: "\f187";
1290
  }
1291
  .fa-bug:before {
1292
+ content: "\f188";
1293
  }
1294
  .fa-vk:before {
1295
+ content: "\f189";
1296
  }
1297
  .fa-weibo:before {
1298
+ content: "\f18a";
1299
  }
1300
  .fa-renren:before {
1301
+ content: "\f18b";
1302
  }
1303
  .fa-pagelines:before {
1304
+ content: "\f18c";
1305
  }
1306
  .fa-stack-exchange:before {
1307
+ content: "\f18d";
1308
  }
1309
  .fa-arrow-circle-o-right:before {
1310
+ content: "\f18e";
1311
  }
1312
  .fa-arrow-circle-o-left:before {
1313
+ content: "\f190";
1314
  }
1315
  .fa-toggle-left:before,
1316
  .fa-caret-square-o-left:before {
1317
+ content: "\f191";
1318
  }
1319
  .fa-dot-circle-o:before {
1320
+ content: "\f192";
1321
  }
1322
  .fa-wheelchair:before {
1323
+ content: "\f193";
1324
  }
1325
  .fa-vimeo-square:before {
1326
+ content: "\f194";
1327
  }
1328
  .fa-turkish-lira:before,
1329
  .fa-try:before {
1330
+ content: "\f195";
1331
  }
1332
  .fa-plus-square-o:before {
1333
+ content: "\f196";
1334
  }
1335
  .fa-space-shuttle:before {
1336
+ content: "\f197";
1337
  }
1338
  .fa-slack:before {
1339
+ content: "\f198";
1340
  }
1341
  .fa-envelope-square:before {
1342
+ content: "\f199";
1343
  }
1344
  .fa-wordpress:before {
1345
+ content: "\f19a";
1346
  }
1347
  .fa-openid:before {
1348
+ content: "\f19b";
1349
  }
1350
  .fa-institution:before,
1351
  .fa-bank:before,
1352
  .fa-university:before {
1353
+ content: "\f19c";
1354
  }
1355
  .fa-mortar-board:before,
1356
  .fa-graduation-cap:before {
1357
+ content: "\f19d";
1358
  }
1359
  .fa-yahoo:before {
1360
+ content: "\f19e";
1361
  }
1362
  .fa-google:before {
1363
+ content: "\f1a0";
1364
  }
1365
  .fa-reddit:before {
1366
+ content: "\f1a1";
1367
  }
1368
  .fa-reddit-square:before {
1369
+ content: "\f1a2";
1370
  }
1371
  .fa-stumbleupon-circle:before {
1372
+ content: "\f1a3";
1373
  }
1374
  .fa-stumbleupon:before {
1375
+ content: "\f1a4";
1376
  }
1377
  .fa-delicious:before {
1378
+ content: "\f1a5";
1379
  }
1380
  .fa-digg:before {
1381
+ content: "\f1a6";
1382
  }
1383
  .fa-pied-piper-square:before,
1384
  .fa-pied-piper:before {
1385
+ content: "\f1a7";
1386
  }
1387
  .fa-pied-piper-alt:before {
1388
+ content: "\f1a8";
1389
  }
1390
  .fa-drupal:before {
1391
+ content: "\f1a9";
1392
  }
1393
  .fa-joomla:before {
1394
+ content: "\f1aa";
1395
  }
1396
  .fa-language:before {
1397
+ content: "\f1ab";
1398
  }
1399
  .fa-fax:before {
1400
+ content: "\f1ac";
1401
  }
1402
  .fa-building:before {
1403
+ content: "\f1ad";
1404
  }
1405
  .fa-child:before {
1406
+ content: "\f1ae";
1407
  }
1408
  .fa-paw:before {
1409
+ content: "\f1b0";
1410
  }
1411
  .fa-spoon:before {
1412
+ content: "\f1b1";
1413
  }
1414
  .fa-cube:before {
1415
+ content: "\f1b2";
1416
  }
1417
  .fa-cubes:before {
1418
+ content: "\f1b3";
1419
  }
1420
  .fa-behance:before {
1421
+ content: "\f1b4";
1422
  }
1423
  .fa-behance-square:before {
1424
+ content: "\f1b5";
1425
  }
1426
  .fa-steam:before {
1427
+ content: "\f1b6";
1428
  }
1429
  .fa-steam-square:before {
1430
+ content: "\f1b7";
1431
  }
1432
  .fa-recycle:before {
1433
+ content: "\f1b8";
1434
  }
1435
  .fa-automobile:before,
1436
  .fa-car:before {
1437
+ content: "\f1b9";
1438
  }
1439
  .fa-cab:before,
1440
  .fa-taxi:before {
1441
+ content: "\f1ba";
1442
  }
1443
  .fa-tree:before {
1444
+ content: "\f1bb";
1445
  }
1446
  .fa-spotify:before {
1447
+ content: "\f1bc";
1448
  }
1449
  .fa-deviantart:before {
1450
+ content: "\f1bd";
1451
  }
1452
  .fa-soundcloud:before {
1453
+ content: "\f1be";
1454
  }
1455
  .fa-database:before {
1456
+ content: "\f1c0";
1457
  }
1458
  .fa-file-pdf-o:before {
1459
+ content: "\f1c1";
1460
  }
1461
  .fa-file-word-o:before {
1462
+ content: "\f1c2";
1463
  }
1464
  .fa-file-excel-o:before {
1465
+ content: "\f1c3";
1466
  }
1467
  .fa-file-powerpoint-o:before {
1468
+ content: "\f1c4";
1469
  }
1470
  .fa-file-photo-o:before,
1471
  .fa-file-picture-o:before,
1472
  .fa-file-image-o:before {
1473
+ content: "\f1c5";
1474
  }
1475
  .fa-file-zip-o:before,
1476
  .fa-file-archive-o:before {
1477
+ content: "\f1c6";
1478
  }
1479
  .fa-file-sound-o:before,
1480
  .fa-file-audio-o:before {
1481
+ content: "\f1c7";
1482
  }
1483
  .fa-file-movie-o:before,
1484
  .fa-file-video-o:before {
1485
+ content: "\f1c8";
1486
  }
1487
  .fa-file-code-o:before {
1488
+ content: "\f1c9";
1489
  }
1490
  .fa-vine:before {
1491
+ content: "\f1ca";
1492
  }
1493
  .fa-codepen:before {
1494
+ content: "\f1cb";
1495
  }
1496
  .fa-jsfiddle:before {
1497
+ content: "\f1cc";
1498
  }
1499
  .fa-life-bouy:before,
1500
  .fa-life-saver:before,
1501
  .fa-support:before,
1502
  .fa-life-ring:before {
1503
+ content: "\f1cd";
1504
  }
1505
  .fa-circle-o-notch:before {
1506
+ content: "\f1ce";
1507
  }
1508
  .fa-ra:before,
1509
  .fa-rebel:before {
1510
+ content: "\f1d0";
1511
  }
1512
  .fa-ge:before,
1513
  .fa-empire:before {
1514
+ content: "\f1d1";
1515
  }
1516
  .fa-git-square:before {
1517
+ content: "\f1d2";
1518
  }
1519
  .fa-git:before {
1520
+ content: "\f1d3";
1521
  }
1522
  .fa-hacker-news:before {
1523
+ content: "\f1d4";
1524
  }
1525
  .fa-tencent-weibo:before {
1526
+ content: "\f1d5";
1527
  }
1528
  .fa-qq:before {
1529
+ content: "\f1d6";
1530
  }
1531
  .fa-wechat:before,
1532
  .fa-weixin:before {
1533
+ content: "\f1d7";
1534
  }
1535
  .fa-send:before,
1536
  .fa-paper-plane:before {
1537
+ content: "\f1d8";
1538
  }
1539
  .fa-send-o:before,
1540
  .fa-paper-plane-o:before {
1541
+ content: "\f1d9";
1542
  }
1543
  .fa-history:before {
1544
+ content: "\f1da";
1545
  }
1546
  .fa-circle-thin:before {
1547
+ content: "\f1db";
1548
  }
1549
  .fa-header:before {
1550
+ content: "\f1dc";
1551
  }
1552
  .fa-paragraph:before {
1553
+ content: "\f1dd";
1554
  }
1555
  .fa-sliders:before {
1556
+ content: "\f1de";
1557
  }
1558
  .fa-share-alt:before {
1559
+ content: "\f1e0";
1560
  }
1561
  .fa-share-alt-square:before {
1562
+ content: "\f1e1";
1563
  }
1564
  .fa-bomb:before {
1565
+ content: "\f1e2";
1566
+ }
{css → assets/css}/fonts/FontAwesome.otf RENAMED
File without changes
{css → assets/css}/fonts/fontawesome-webfont.eot RENAMED
File without changes
{css → assets/css}/fonts/fontawesome-webfont.svg RENAMED
File without changes
{css → assets/css}/fonts/fontawesome-webfont.ttf RENAMED
File without changes
{css → assets/css}/fonts/fontawesome-webfont.woff RENAMED
File without changes
{css → assets/css}/frontpage.css RENAMED
@@ -1,696 +1,646 @@
1
- /*
2
- Version: 2.9.8
3
- */
4
- #review-statistics {
5
-
6
- font-family: FontAwesome;
7
-
8
- width: 100%;
9
-
10
- margin: auto;
11
-
12
- }
13
-
14
- .cwp-item-price {
15
- float: right;
16
- font-size: 1.75em;
17
- font-family: "Lato", Helvetica, sans-serif;
18
- }
19
-
20
- #review-statistics h1,
21
- #review-statistics h2,
22
- #review-statistics h3,
23
- #review-statistics h4,
24
- #review-statistics h5,
25
- #review-statistics h6 {
26
-
27
- font-family: "Lato", Helvetica, sans-serif;
28
-
29
- font-weight: normal;
30
- border: none;
31
- padding: 0;
32
- margin: 0;
33
-
34
- }
35
-
36
- .rev-option h3 {
37
- width: auto !important;
38
- }
39
-
40
- #review-statistics .photo-wrapup {
41
-
42
- width: 100%;
43
-
44
- }
45
-
46
- #review-statistics {
47
-
48
- font-family: FontAwesome;
49
-
50
- }
51
-
52
- #review-statistics .sec-top {
53
- border-top: 1px solid #ddd;
54
- border-bottom: 1px solid #ddd;
55
- margin: 40px 0 20px 0;
56
- }
57
-
58
- #review-statistics .sec-top h2 {
59
- line-height: 0;
60
- margin: 0;
61
- font-family: "Open Sans", Helvetica, Arial, sans-serif;
62
- font-weight: normal;
63
- text-transform: uppercase;
64
- font-style: italic;
65
- font-size: 1.643em;
66
- padding: 20px 0;
67
- letter-spacing: -1px;
68
- border-left: 4px solid #D8D8D8;
69
- border-right: 4px solid #d8d8d8;
70
- padding-left: 20px;
71
- }
72
-
73
- #review-statistics .sec-top h2 i {
74
- color: #d9d9d9;
75
- margin-right: 10px;
76
- }
77
-
78
- #review-statistics .container .edit-article {
79
- padding-right: 35px;
80
- text-align: right;
81
- }
82
-
83
- #review-statistics .container .edit-article a {
84
- text-decoration: none;
85
- text-transform: uppercase;
86
- padding: 5px 10px;
87
- font-size: 12px;
88
- background: #f3f3f3;
89
- border-radius: 4px;
90
- color: #7d7d7d;
91
- }
92
-
93
- #review-statistics .container .edit-article a:hover {
94
- background: #ddd;
95
- }
96
-
97
- #review-statistics .article-meta {
98
- margin: 20px 0 20px 0;
99
- }
100
-
101
- #review-statistics .icon-bar-chart:before {
102
-
103
- content: "\f080";
104
-
105
- }
106
-
107
- #review-statistics .review-wu-right .cons {
108
- margin-top: 15px;
109
- }
110
-
111
- #review-statistics .sec-top h2 i {
112
-
113
- color: #D9D9D9;
114
-
115
- margin-right: 10px;
116
-
117
- }
118
-
119
- #review-statistics .cwpr_clearfix:after {
120
-
121
- content: '\0020';
122
-
123
- display: block;
124
-
125
- overflow: hidden;
126
-
127
- visibility: hidden;
128
-
129
- width: 0;
130
-
131
- height: 0;
132
- }
133
-
134
- #review-statistics .cwpr_clearfix:after {
135
-
136
- clear: both;
137
- }
138
-
139
- #review-statistics .cwpr_clearfix {
140
-
141
- zoom: 1;
142
- }
143
-
144
- #review-statistics .cwp-review-chart {
145
- float: left;
146
- position: relative !important;
147
- top: 0;
148
- right: 0;
149
- border-radius: 50%;
150
- }
151
-
152
- #review-statistics .cwp-review-percentage span {
153
- font-family: "Lato";
154
- font-size: 17px;
155
- font-weight: 900;
156
- background: #fff;
157
- display: block;
158
- border-radius: 50%;
159
- }
160
-
161
- .cwp-review-rating {
162
- line-height: inherit !important;
163
- }
164
-
165
- #review-statistics .cwp_easyPieChart {
166
- position: relative;
167
- text-align: center;
168
- }
169
-
170
- #review-statistics .cwp_easyPieChart canvas {
171
- position: absolute;
172
- top: 0;
173
- left: 0;
174
- }
175
-
176
- #review-statistics .review-wrap-up {
177
- margin-top: 20px;
178
- border: 1px solid #e6e6e6;
179
- border-top: none;
180
- }
181
-
182
- #review-statistics .review-wu-bars h3, .review-wu-bars span {
183
- font-family: "Open Sans";
184
- font-size: 13px !important;
185
- text-transform: uppercase;
186
- font-style: italic;
187
- line-height: 2;
188
- margin: 0;
189
- padding: 0;
190
- }
191
-
192
- #review-statistics .review-wu-bars h3 {
193
- float: left;
194
- }
195
-
196
- #review-statistics .review-wu-bars span {
197
- text-align: right;
198
- float: right;
199
- line-height: 2;
200
- }
201
-
202
- #review-statistics .review-wu-bars {
203
- width: 90%;
204
- padding: 0 5% 10px 5%;
205
- border-right: 1px solid #e6e6e6;
206
- border-top: 1px solid #e6e6e6;
207
- border-left: none;
208
- border-bottom: none;
209
- float: left;
210
- }
211
-
212
- #review-statistics .review-wu-bars ul {
213
- margin: 0;
214
- margin-left: 0 !important;
215
- width: 100% !important;
216
- padding-left: 0 !important;
217
- }
218
-
219
- #review-statistics .review-wu-bars ul li {
220
- display: inline-block;
221
- height: 6px;
222
- margin-right: 2%;
223
- width: 8.2%;
224
- float: left;
225
- }
226
-
227
- #review-statistics .rev-option.customBarIcon ul li {
228
- background: none;
229
- font-size: 15px;
230
- width: 28px;
231
- height: auto !important;
232
- margin: 0;
233
- }
234
-
235
- #review-statistics .rev-option.customBarIcon ul li i {
236
- line-height: 1;
237
- font-style: normal !important;
238
- font-size: 22px;
239
- text-align: center;
240
- }
241
-
242
- #review-statistics .rev-option.customBarIcon h3,
243
- #review-statistics .rev-option.customBarIcon span {
244
- padding: 0 4px;
245
- }
246
-
247
- #review-statistics .review-wu-bars ul li:nth-child(10) {
248
- margin: 0 !important;
249
- }
250
-
251
- #review-statistics .review-wu-bars .rev-option div > * {
252
- display: inline-block;
253
- }
254
-
255
- #review-statistics .review-wrap-up .cwpr-review-top {
256
- padding: 20px;
257
- border-top: 5px solid #3baeda;
258
- border-bottom: 1px solid #e6e6e6;
259
- }
260
-
261
- #review-statistics .review-wrap-up .cwpr-review-top .cwp-item {
262
- font-weight: 400;
263
- line-height: 1;
264
- margin: 0;
265
- padding: 0;
266
- }
267
-
268
- #review-statistics .review-wrap-up .cwpr-review-top h2.cwp-item {
269
- float: left;
270
- width: auto !important;
271
- letter-spacing: 1px;
272
- }
273
-
274
- #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category a {
275
- font-weight: 500;
276
- font-style: italic;
277
- letter-spacing: 1px;
278
- text-decoration: none;
279
- }
280
-
281
- #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category a:hover {
282
- text-decoration: underline;
283
- }
284
-
285
- #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category i {
286
- color: #e3e3e3;
287
- margin-right: 5px;
288
- }
289
-
290
- #review-statistics .review-wrap-up .review-wu-left {
291
- width: 51%;
292
- float: left;
293
- margin-top: 10px;
294
- }
295
-
296
- #review-statistics .review-wrap-up .review-wu-left .rev-wu-image {
297
- text-align: center;
298
- float: left;
299
- width: 40%;
300
- overflow: hidden;
301
- border-top: none;
302
- padding: 0;
303
- margin-left: 5%;
304
- margin-right: 5%;
305
- }
306
-
307
- #review-statistics .review-wrap-up .review-wu-left .rev-wu-image img {
308
- height: auto;
309
- width: 100%;
310
- -webkit-box-shadow: none;
311
- box-shadow: none;
312
- }
313
-
314
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
315
- width: 50%;
316
- -webkit-box-sizing: border-box;
317
- box-sizing: border-box;
318
- text-align: center;
319
- display: block;
320
- float: left;
321
- border: 1px solid #e6e6e6;
322
- border-top: none;
323
- position: relative;
324
- border-bottom: none;
325
- }
326
-
327
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart {
328
- position: relative;
329
- margin: 0px;
330
- float: none;
331
- display: inline-block;
332
- }
333
-
334
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
335
- width: 150px;
336
- }
337
-
338
- #review-statistics .review-wrap-up .review-wu-right {
339
- float: left;
340
- width: 44%;
341
- padding: 2% 2% 2% 3%;
342
- border-top: none;
343
- }
344
-
345
- #review-statistics .review-wrap-up .review-wu-right h2 {
346
- font-family: "Lato";
347
- font-size: 15px;
348
- text-transform: uppercase;
349
- font-weight: 800;
350
- margin-bottom: 0;
351
- }
352
-
353
- #review-statistics .review-wrap-up .review-wu-right ul li {
354
- font-size: 16px;
355
- padding-left: 0;
356
- margin: 0 0 2%;
357
- font-family: "Lato";
358
- line-height: 1;
359
- }
360
-
361
- #review-statistics .review-wrap-up .review-wu-right ul li:before {
362
- content: "-";
363
- margin-right: 5px;
364
- }
365
-
366
- #review-statistics .review-wrap-up .review-wu-right ul li {
367
- }
368
-
369
- .review-wu-right ul li {
370
- background: none !important;
371
- }
372
-
373
- .comment-form-meta-option input {
374
-
375
- background: none !important;
376
-
377
- }
378
-
379
- .rev-wu-image img {
380
-
381
- background: none !important;
382
-
383
- padding: 0 !important;
384
-
385
- margin: 0 !important;
386
-
387
- }
388
-
389
- .rev-option ul li {
390
-
391
- margin-left: 0 !important;
392
-
393
- margin-top: 0 !important;
394
-
395
- margin-bottom: 0 !important;
396
-
397
- padding-left: 0 !important;
398
-
399
- }
400
-
401
- .review-wu-bars, .review-wu-right {
402
-
403
- -webkit-box-sizing: content-box !important;
404
-
405
- box-sizing: content-box !important;
406
- text-align: left;
407
-
408
- }
409
-
410
- #review-statistics .rev-option {
411
-
412
- margin-top: 10px;
413
-
414
- }
415
-
416
- .affiliate-button {
417
- width: 100%;
418
- margin-bottom: 20px;
419
- clear: both;
420
- }
421
-
422
- .affiliate-button2 {
423
- width: 50% !important;
424
- margin-bottom: 20px;
425
- float: left;
426
- clear: none !important;
427
- }
428
-
429
- .affiliate-button a {
430
- display: table;
431
- border: none;
432
- padding: 10px 35px;
433
- margin: 20px auto 0;
434
- border-radius: 5px;
435
- text-decoration: none !important;
436
- }
437
-
438
- .affiliate-button a:hover span {;
439
- text-decoration: none;
440
- }
441
-
442
- .affiliate-button a span {
443
- text-transform: uppercase;
444
- font-family: "Helvetica Neue", HelveticaNeue, Helvetica, Lato, Arial, sans-serif;
445
- font-style: italic;
446
- font-weight: normal;
447
- font-size: 14px;
448
- padding-left: 20px;
449
- margin-left: -10px;
450
- text-decoration: none;
451
- }
452
-
453
- #review-statistics .review-wrap-up .review-wu-right ul {
454
-
455
- margin-top: 10px !important;;
456
-
457
- padding-left: 0 !important;
458
- margin-left: 0;
459
- list-style: none;
460
-
461
- }
462
-
463
- #cwp-slider-comment .comment-form-default label {
464
- }
465
-
466
- #cwp-slider-comment .comment-form-meta-option {
467
- width: 100%;
468
- float: right;
469
- margin-bottom: 12px;
470
- position: relative;
471
- }
472
-
473
- #cwp-slider-comment .comment-form-meta-option label {
474
- float: left;
475
- width: 80%;
476
- display: block;
477
- font-size: 14px;
478
- line-height: 2;
479
- padding: 0px;
480
- margin: 0px;
481
- }
482
-
483
- #cwp-slider-comment .comment-form-meta-option .meta_option_input {
484
- float: right;
485
- width: 12%;
486
- text-align: center;
487
- border: none;
488
- padding: 5px 0px 0px 0px;
489
- font-weight: bold;
490
- line-height: 1.5;
491
- font-size: 14px;
492
- height: 26px;
493
- margin: 0px;
494
- min-width: 0%;
495
- }
496
-
497
- #cwp-slider-comment .comment-form-meta-option .comment_meta_slider {
498
- margin-top: 5px !important;
499
- background: #f3f3f3;
500
- border: none;
501
- height: 7px;
502
- -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
503
- box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
504
- float: left;
505
- width: 100%;
506
- }
507
-
508
- #cwp-slider-comment .comment-form-meta-option .comment_meta_slider .ui-slider-handle {
509
- background: #3baeda;
510
- border: none;
511
- border-radius: 50%;
512
- width: 13px;
513
- height: 13px;
514
- top: -4px;
515
- left: 5px;
516
- }
517
-
518
- #cwp-slider-comment .comment-form-meta-option .comment_meta_slider .ui-slider-handle:hover {
519
- cursor: pointer;
520
- -webkit-box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.3);
521
- box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.3);
522
- }
523
-
524
- #cwp-slider-comment cite.review-info {
525
- font-style: italic !important;
526
- color: #ddd;
527
- }
528
-
529
- /* User Comment Grades Styles */
530
-
531
- .user-comments-grades {
532
- width: 200px;
533
- float: right;
534
- margin-top: 25px;
535
- border: 1px solid #ddd;
536
- padding: 10px;
537
- border-radius: 5px;
538
- margin-left: 15px;
539
- }
540
-
541
- .user-comments-grades * {
542
- margin: 0 !important;
543
- padding: 0 !important;
544
- }
545
-
546
- .user-comments-grades .comment-meta-option-name {
547
- float: left;
548
- text-transform: uppercase;
549
- font-size: 10px;
550
- color: #7d7d7d;
551
- margin-bottom: 3px !important;
552
- }
553
-
554
- .user-comments-grades .comment-meta-option-grade {
555
- float: right;
556
- text-transform: uppercase;
557
- font-size: 10px;
558
- font-weight: bold;
559
- clear: none !important;
560
- }
561
-
562
- .user-comments-grades .comment-meta-option {
563
- margin-bottom: 10px !important;
564
- }
565
-
566
- .user-comments-grades .comment-meta-option:last-of-type {
567
- margin-bottom: 0 !important;
568
- }
569
-
570
- /* Comment Form Meta Options - GRADE BAR */
571
-
572
- .comment-meta-option .comment-meta-grade-bar {
573
- width: 100%;
574
- background: #ebedef;
575
- border-radius: 32px;
576
- height: 5px;
577
- -webkit-box-shadow: none;
578
- box-shadow: none;
579
- overflow: hidden;
580
- }
581
-
582
- .comment-meta-grade {
583
- height: 100%;
584
- }
585
-
586
- #cwp-slider-comment {
587
-
588
- width: 230px;
589
-
590
- display: block;
591
-
592
- margin-bottom: 10px;
593
- margin-top: 10px;
594
-
595
- }
596
-
597
- .comment-form-meta-option {
598
-
599
- width: 100% !important;
600
-
601
- }
602
-
603
- .cwpr_clearfix {
604
-
605
- clear: both !important;
606
-
607
- }
608
-
609
- /* Comment Form Meta Options - GRADE BAR */
610
-
611
- #cwp-slider-comment .comment-meta-option .comment-meta-grade-bar {
612
- width: 100%;
613
- background: #ebedef;
614
- border-radius: 32px;
615
- height: 5px;
616
- -webkit-box-shadow: none;
617
- box-shadow: none;
618
- overflow: hidden;
619
- }
620
-
621
- .review-wu-right ul li {
622
- list-style: none !important;
623
- }
624
-
625
- .cwp-chart-embed {
626
- position: relative !important;
627
- margin: 10px !important;
628
- }
629
-
630
- @media (max-width: 440px) {
631
- #review-statistics .review-wrap-up .review-wu-left {
632
- width: 100%;
633
- }
634
-
635
- #review-statistics .review-wrap-up .review-wu-right {
636
- width: 95%;
637
- padding-left: 5%;
638
- }
639
-
640
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
641
- border-right: none;
642
- }
643
-
644
- #review-statistics .review-wrap-up .review-wu-left .rev-wu-image, #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
645
- height: 130px;
646
- }
647
-
648
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
649
-
650
- margin-top: 10%;
651
- }
652
-
653
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
654
- font-size: 30px;
655
- }
656
- }
657
-
658
- @media (min-width: 440px) and (max-width: 700px) {
659
- #review-statistics .review-wrap-up .review-wu-left .rev-wu-image, #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
660
- height: 100px;
661
- }
662
-
663
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
664
-
665
- margin-top: 10%;
666
- }
667
-
668
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
669
- font-size: 30px;
670
- }
671
- }
672
-
673
- @media (min-width: 700px) and (max-width: 820px) {
674
- #review-statistics .review-wrap-up .review-wu-left .rev-wu-image, #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
675
- height: 130px;
676
- }
677
-
678
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
679
-
680
- margin-top: 10%;
681
- }
682
-
683
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
684
- font-size: 30px;
685
- }
686
- }
687
-
688
- .cwp-review-percentage.cwp_easyPieChart canvas {
689
- position: absolute;
690
- left: 0px;
691
- }
692
-
693
- .cwp-review-percentage.cwp_easyPieChart {
694
- position: relative;
695
- text-align: center;
696
- }
1
+ /*
2
+ Version: 3.0.0
3
+ */
4
+ #review-statistics {
5
+ width: 100%;
6
+ margin: auto;
7
+ font-family: FontAwesome;
8
+ }
9
+
10
+ .cwp-item-price {
11
+ float: right;
12
+ font-family: "Lato", Helvetica, sans-serif;
13
+ font-size: 1.75em;
14
+ }
15
+
16
+ #review-statistics h1,
17
+ #review-statistics h2,
18
+ #review-statistics h3,
19
+ #review-statistics h4,
20
+ #review-statistics h5,
21
+ #review-statistics h6 {
22
+ margin: 0;
23
+ padding: 0;
24
+ border: none;
25
+ font-family: "Lato", Helvetica, sans-serif;
26
+ font-weight: normal;
27
+ }
28
+
29
+ .rev-option h3 {
30
+ width: auto !important;
31
+ }
32
+
33
+ #review-statistics .photo-wrapup {
34
+ width: 100%;
35
+ }
36
+
37
+ #review-statistics {
38
+ font-family: FontAwesome;
39
+ }
40
+
41
+ #review-statistics .sec-top {
42
+ margin: 40px 0 20px 0;
43
+ border-top: 1px solid #ddd;
44
+ border-bottom: 1px solid #ddd;
45
+ }
46
+
47
+ #review-statistics .sec-top h2 {
48
+ margin: 0;
49
+ padding: 20px 0;
50
+ padding-left: 20px;
51
+ border-right: 4px solid #d8d8d8;
52
+ border-left: 4px solid #d8d8d8;
53
+ font-family: "Open Sans", Helvetica, Arial, sans-serif;
54
+ font-size: 1.643em;
55
+ font-weight: normal;
56
+ font-style: italic;
57
+ line-height: 0;
58
+ letter-spacing: -1px;
59
+ text-transform: uppercase;
60
+ }
61
+
62
+ #review-statistics .sec-top h2 i {
63
+ margin-right: 10px;
64
+ color: #d9d9d9;
65
+ }
66
+
67
+ #review-statistics .container .edit-article {
68
+ padding-right: 35px;
69
+ text-align: right;
70
+ }
71
+
72
+ #review-statistics .container .edit-article a {
73
+ padding: 5px 10px;
74
+ border-radius: 4px;
75
+ color: #7d7d7d;
76
+ background: #f3f3f3;
77
+ font-size: 12px;
78
+ text-decoration: none;
79
+ text-transform: uppercase;
80
+ }
81
+
82
+ #review-statistics .container .edit-article a:hover {
83
+ background: #ddd;
84
+ }
85
+
86
+ #review-statistics .article-meta {
87
+ margin: 20px 0 20px 0;
88
+ }
89
+
90
+ #review-statistics .icon-bar-chart:before {
91
+ content: "\f080";
92
+ }
93
+
94
+ #review-statistics .review-wu-right .cons {
95
+ margin-top: 15px;
96
+ }
97
+
98
+ #review-statistics .sec-top h2 i {
99
+ margin-right: 10px;
100
+ color: #d9d9d9;
101
+ }
102
+
103
+ #review-statistics .cwpr_clearfix:after {
104
+ display: block;
105
+ visibility: hidden;
106
+ overflow: hidden;
107
+ width: 0;
108
+ height: 0;
109
+ content: "\0020";
110
+ }
111
+
112
+ #review-statistics .cwpr_clearfix:after {
113
+ clear: both;
114
+ }
115
+
116
+ #review-statistics .cwpr_clearfix {
117
+ zoom: 1;
118
+ }
119
+
120
+ #review-statistics .cwp-review-chart {
121
+ float: left;
122
+ position: relative !important;
123
+ top: 0;
124
+ right: 0;
125
+ border-radius: 50%;
126
+ }
127
+
128
+ #review-statistics .cwp-review-percentage span {
129
+ display: block;
130
+ border-radius: 50%;
131
+ background: #fff;
132
+ font-family: "Lato";
133
+ font-size: 17px;
134
+ font-weight: 900;
135
+ }
136
+
137
+ .cwp-review-rating {
138
+ line-height: inherit !important;
139
+ }
140
+
141
+ #review-statistics .cwp_easyPieChart {
142
+ position: relative;
143
+ text-align: center;
144
+ }
145
+
146
+ #review-statistics .cwp_easyPieChart canvas {
147
+ position: absolute;
148
+ top: 0;
149
+ left: 0;
150
+ }
151
+
152
+ #review-statistics .review-wrap-up {
153
+ margin-top: 20px;
154
+ border: 1px solid #e6e6e6;
155
+ border-top: none;
156
+ }
157
+
158
+ #review-statistics .review-wu-bars h3,
159
+ .review-wu-bars span {
160
+ margin: 0;
161
+ padding: 0;
162
+ font-family: "Open Sans";
163
+ font-size: 13px !important;
164
+ font-style: italic;
165
+ line-height: 2;
166
+ text-transform: uppercase;
167
+ }
168
+
169
+ #review-statistics .review-wu-bars h3 {
170
+ float: left;
171
+ }
172
+
173
+ #review-statistics .review-wu-bars span {
174
+ float: right;
175
+ line-height: 2;
176
+ text-align: right;
177
+ }
178
+
179
+ #review-statistics .review-wu-bars {
180
+ float: left;
181
+ width: 90%;
182
+ padding: 0 5% 10px 5%;
183
+ border-top: 1px solid #e6e6e6;
184
+ border-right: 1px solid #e6e6e6;
185
+ border-bottom: none;
186
+ border-left: none;
187
+ }
188
+
189
+ #review-statistics .review-wu-bars ul {
190
+ width: 100% !important;
191
+ margin: 0;
192
+ margin-left: 0 !important;
193
+ padding-left: 0 !important;
194
+ }
195
+
196
+ #review-statistics .review-wu-bars ul li {
197
+ display: inline-block;
198
+ float: left;
199
+ width: 8.2%;
200
+ height: 6px;
201
+ margin-right: 2%;
202
+ }
203
+
204
+ #review-statistics .rev-option.customBarIcon ul li {
205
+ width: 28px;
206
+ height: auto !important;
207
+ margin: 0;
208
+ background: none;
209
+ font-size: 15px;
210
+ }
211
+
212
+ #review-statistics .rev-option.customBarIcon ul li i {
213
+ font-size: 22px;
214
+ font-style: normal !important;
215
+ line-height: 1;
216
+ text-align: center;
217
+ }
218
+
219
+ #review-statistics .rev-option.customBarIcon h3,
220
+ #review-statistics .rev-option.customBarIcon span {
221
+ padding: 0 4px;
222
+ }
223
+
224
+ #review-statistics .review-wu-bars ul li:nth-child(10) {
225
+ margin: 0 !important;
226
+ }
227
+
228
+ #review-statistics .review-wu-bars .rev-option div > * {
229
+ display: inline-block;
230
+ }
231
+
232
+ #review-statistics .review-wrap-up .cwpr-review-top {
233
+ padding: 20px;
234
+ border-top: 5px solid #3baeda;
235
+ border-bottom: 1px solid #e6e6e6;
236
+ }
237
+
238
+ #review-statistics .review-wrap-up .cwpr-review-top .cwp-item {
239
+ margin: 0;
240
+ padding: 0;
241
+ font-weight: 400;
242
+ line-height: 1;
243
+ }
244
+
245
+ #review-statistics .review-wrap-up .cwpr-review-top h2.cwp-item {
246
+ float: left;
247
+ width: auto !important;
248
+ letter-spacing: 1px;
249
+ }
250
+
251
+ #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category a {
252
+ font-weight: 500;
253
+ font-style: italic;
254
+ text-decoration: none;
255
+ letter-spacing: 1px;
256
+ }
257
+
258
+ #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category a:hover {
259
+ text-decoration: underline;
260
+ }
261
+
262
+ #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category i {
263
+ margin-right: 5px;
264
+ color: #e3e3e3;
265
+ }
266
+
267
+ #review-statistics .review-wrap-up .review-wu-left {
268
+ float: left;
269
+ width: 51%;
270
+ margin-top: 10px;
271
+ }
272
+
273
+ #review-statistics .review-wrap-up .review-wu-left .rev-wu-image {
274
+ float: left;
275
+ overflow: hidden;
276
+ width: 40%;
277
+ margin-right: 5%;
278
+ margin-left: 5%;
279
+ padding: 0;
280
+ border-top: none;
281
+ text-align: center;
282
+ }
283
+
284
+ #review-statistics .review-wrap-up .review-wu-left .rev-wu-image img {
285
+ width: 100%;
286
+ height: auto;
287
+ -webkit-box-shadow: none;
288
+ box-shadow: none;
289
+ }
290
+
291
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
292
+ display: block;
293
+ float: left;
294
+ position: relative;
295
+ -webkit-box-sizing: border-box;
296
+ box-sizing: border-box;
297
+ width: 50%;
298
+ border: 1px solid #e6e6e6;
299
+ border-top: none;
300
+ border-bottom: none;
301
+ text-align: center;
302
+ }
303
+
304
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart {
305
+ display: inline-block;
306
+ float: none;
307
+ position: relative;
308
+ margin: 0;
309
+ }
310
+
311
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
312
+ width: 150px;
313
+ }
314
+
315
+ #review-statistics .review-wrap-up .review-wu-right {
316
+ float: left;
317
+ width: 44%;
318
+ padding: 2% 2% 2% 3%;
319
+ border-top: none;
320
+ }
321
+
322
+ #review-statistics .review-wrap-up .review-wu-right h2 {
323
+ margin-bottom: 0;
324
+ font-family: "Lato";
325
+ font-size: 15px;
326
+ font-weight: 800;
327
+ text-transform: uppercase;
328
+ }
329
+
330
+ #review-statistics .review-wrap-up .review-wu-right ul li {
331
+ margin: 0 0 2%;
332
+ padding-left: 0;
333
+ font-family: "Lato";
334
+ font-size: 16px;
335
+ line-height: 1;
336
+ }
337
+
338
+ #review-statistics .review-wrap-up .review-wu-right ul li:before {
339
+ margin-right: 5px;
340
+ content: "-";
341
+ }
342
+
343
+ .review-wu-right ul li {
344
+ background: none !important;
345
+ }
346
+
347
+ .wppr-comment-form-meta input {
348
+ background: none !important;
349
+ }
350
+
351
+ .rev-wu-image img {
352
+ margin: 0 !important;
353
+ padding: 0 !important;
354
+ background: none !important;
355
+ }
356
+
357
+ .rev-option ul li {
358
+ margin-top: 0 !important;
359
+ margin-bottom: 0 !important;
360
+ margin-left: 0 !important;
361
+ padding-left: 0 !important;
362
+ }
363
+
364
+ .review-wu-bars,
365
+ .review-wu-right {
366
+ -webkit-box-sizing: content-box !important;
367
+ box-sizing: content-box !important;
368
+ text-align: left;
369
+ }
370
+
371
+ #review-statistics .rev-option {
372
+ margin-top: 10px;
373
+ }
374
+
375
+ .affiliate-button {
376
+ clear: both;
377
+ width: 100%;
378
+ margin-bottom: 20px;
379
+ }
380
+
381
+ .affiliate-button2 {
382
+ float: left;
383
+ clear: none !important;
384
+ width: 50% !important;
385
+ margin-bottom: 20px;
386
+ }
387
+
388
+ .affiliate-button a {
389
+ display: table;
390
+ margin: 20px auto 0;
391
+ padding: 10px 35px;
392
+ border: none;
393
+ border-radius: 5px;
394
+ text-decoration: none !important;
395
+ }
396
+
397
+ .affiliate-button a:hover span {
398
+ text-decoration: none;;
399
+ }
400
+
401
+ .affiliate-button a span {
402
+ margin-left: -10px;
403
+ padding-left: 20px;
404
+ font-family: "Helvetica Neue", HelveticaNeue, Helvetica, Lato, Arial, sans-serif;
405
+ font-size: 14px;
406
+ font-weight: normal;
407
+ font-style: italic;
408
+ text-decoration: none;
409
+ text-transform: uppercase;
410
+ }
411
+
412
+ #review-statistics .review-wrap-up .review-wu-right ul {
413
+ margin-top: 10px !important;
414
+ margin-left: 0;
415
+ padding-left: 0 !important;
416
+ list-style: none;;
417
+ }
418
+
419
+ #wppr-slider-comment .wppr-comment-form-meta {
420
+ float: right;
421
+ position: relative;
422
+ width: 100%;
423
+ margin-bottom: 12px;
424
+ }
425
+
426
+ #wppr-slider-comment .wppr-comment-form-meta label {
427
+ display: block;
428
+ float: left;
429
+ width: 80%;
430
+ margin: 0;
431
+ padding: 0;
432
+ font-size: 14px;
433
+ line-height: 2;
434
+ }
435
+
436
+ #wppr-slider-comment .wppr-comment-form-meta .meta_option_input {
437
+ float: right;
438
+ width: 12%;
439
+ min-width: 0;
440
+ height: 26px;
441
+ margin: 0;
442
+ padding: 5px 0 0 0;
443
+ border: none;
444
+ font-size: 14px;
445
+ font-weight: bold;
446
+ line-height: 1.5;
447
+ text-align: center;
448
+ }
449
+
450
+ #wppr-slider-comment .wppr-comment-form-meta .wppr-comment-meta-slider {
451
+ float: left;
452
+ width: 100%;
453
+ height: 7px;
454
+ margin-top: 5px !important;
455
+ border: none;
456
+ background: #f3f3f3;
457
+ -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
458
+ box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
459
+ }
460
+
461
+ #wppr-slider-comment .wppr-comment-form-meta .wppr-comment-meta-slider .ui-slider-handle {
462
+ top: -4px;
463
+ left: 5px;
464
+ width: 13px;
465
+ height: 13px;
466
+ border: none;
467
+ border-radius: 50%;
468
+ background: #3baeda;
469
+ }
470
+
471
+ #wppr-slider-comment .wppr-comment-form-meta .wppr-comment-meta-slider .ui-slider-handle:hover {
472
+ -webkit-box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.3);
473
+ box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.3);
474
+ cursor: pointer;
475
+ }
476
+
477
+ #wppr-slider-comment cite.review-info {
478
+ color: #ddd;
479
+ font-style: italic !important;
480
+ }
481
+
482
+ /* User Comment Grades Styles */
483
+
484
+ .user-comments-grades {
485
+ float: right;
486
+ width: 200px;
487
+ margin-top: 25px;
488
+ margin-left: 15px;
489
+ padding: 10px;
490
+ border: 1px solid #ddd;
491
+ border-radius: 5px;
492
+ }
493
+
494
+ .user-comments-grades * {
495
+ margin: 0 !important;
496
+ padding: 0 !important;
497
+ }
498
+
499
+ .user-comments-grades .comment-meta-option-name {
500
+ float: left;
501
+ margin-bottom: 3px !important;
502
+ color: #7d7d7d;
503
+ font-size: 10px;
504
+ text-transform: uppercase;
505
+ }
506
+
507
+ .user-comments-grades .comment-meta-option-grade {
508
+ float: right;
509
+ clear: none !important;
510
+ font-size: 10px;
511
+ font-weight: bold;
512
+ text-transform: uppercase;
513
+ }
514
+
515
+ .user-comments-grades .comment-meta-option {
516
+ margin-bottom: 10px !important;
517
+ }
518
+
519
+ .user-comments-grades .comment-meta-option:last-of-type {
520
+ margin-bottom: 0 !important;
521
+ }
522
+
523
+ /* Comment Form Meta Options - GRADE BAR */
524
+
525
+ .comment-meta-option .comment-meta-grade-bar {
526
+ overflow: hidden;
527
+ width: 100%;
528
+ height: 5px;
529
+ border-radius: 32px;
530
+ background: #ebedef;
531
+ -webkit-box-shadow: none;
532
+ box-shadow: none;
533
+ }
534
+
535
+ .comment-meta-grade {
536
+ height: 100%;
537
+ }
538
+
539
+ #wppr-slider-comment {
540
+ display: block;
541
+ width: 230px;
542
+ margin-top: 10px;
543
+ margin-bottom: 10px;
544
+ }
545
+
546
+ .wppr-comment-form-meta {
547
+ width: 100% !important;
548
+ }
549
+
550
+ .cwpr_clearfix {
551
+ clear: both !important;
552
+ }
553
+
554
+ /* Comment Form Meta Options - GRADE BAR */
555
+
556
+ #wppr-slider-comment .comment-meta-option .comment-meta-grade-bar {
557
+ overflow: hidden;
558
+ width: 100%;
559
+ height: 5px;
560
+ border-radius: 32px;
561
+ background: #ebedef;
562
+ -webkit-box-shadow: none;
563
+ box-shadow: none;
564
+ }
565
+
566
+ .review-wu-right ul li {
567
+ list-style: none !important;
568
+ }
569
+
570
+ .cwp-chart-embed {
571
+ position: relative !important;
572
+ margin: 10px !important;
573
+ }
574
+
575
+ @media (max-width: 440px) {
576
+ #review-statistics .review-wrap-up .review-wu-left {
577
+ width: 100%;
578
+ }
579
+
580
+ #review-statistics .review-wrap-up .review-wu-right {
581
+ width: 95%;
582
+ padding-left: 5%;
583
+ }
584
+
585
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
586
+ border-right: none;
587
+ }
588
+
589
+ #review-statistics .review-wrap-up .review-wu-left .rev-wu-image,
590
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
591
+ height: 130px;
592
+ }
593
+
594
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
595
+ margin-top: 10%;
596
+ }
597
+
598
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
599
+ font-size: 30px;
600
+ }
601
+ }
602
+
603
+ @media (min-width: 440px) and (max-width: 700px) {
604
+ #review-statistics .review-wrap-up .review-wu-left .rev-wu-image,
605
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
606
+ height: 100px;
607
+ }
608
+
609
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
610
+ margin-top: 10%;
611
+ }
612
+
613
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
614
+ font-size: 30px;
615
+ }
616
+ }
617
+
618
+ @media (min-width: 700px) and (max-width: 820px) {
619
+ #review-statistics .review-wrap-up .review-wu-left .rev-wu-image,
620
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
621
+ height: 130px;
622
+ }
623
+
624
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
625
+ margin-top: 10%;
626
+ }
627
+
628
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
629
+ font-size: 30px;
630
+ }
631
+ }
632
+
633
+ .cwp-review-percentage.cwp_easyPieChart canvas {
634
+ position: absolute;
635
+ left: 0;
636
+ }
637
+
638
+ .cwp-review-percentage.cwp_easyPieChart {
639
+ position: relative;
640
+ text-align: center;
641
+ }
642
+
643
+ .review-wu-grade .cwp-review-chart {
644
+ float: none;
645
+ position: relative;
646
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/jquery-ui.css ADDED
@@ -0,0 +1,1918 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.3 - 2013-05-03
2
+
3
+ * http://jqueryui.com
4
+
5
+ * Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
6
+
7
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
8
+
9
+ * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
10
+
11
+
12
+ /* Layout helpers
13
+
14
+ ----------------------------------*/
15
+
16
+ .ui-helper-hidden {
17
+ display: none;
18
+ }
19
+
20
+ .ui-helper-hidden-accessible {
21
+ overflow: hidden;
22
+ clip: rect(0 0 0 0);
23
+ position: absolute;
24
+ width: 1px;
25
+ height: 1px;
26
+ margin: -1px;
27
+ padding: 0;
28
+ border: 0;
29
+ }
30
+
31
+ .ui-helper-reset {
32
+ margin: 0;
33
+ padding: 0;
34
+ border: 0;
35
+ outline: 0;
36
+ font-size: 100%;
37
+ line-height: 1.3;
38
+ text-decoration: none;
39
+ list-style: none;
40
+ }
41
+
42
+ .ui-helper-cwpr_clearfix:before,
43
+ .ui-helper-cwpr_clearfix:after {
44
+ display: table;
45
+ border-collapse: collapse;
46
+ content: "";
47
+ }
48
+
49
+ .ui-helper-cwpr_clearfix:after {
50
+ clear: both;
51
+ }
52
+
53
+ .ui-helper-cwpr_clearfix {
54
+ min-height: 0;
55
+ /* support: IE7 */
56
+ }
57
+
58
+ .ui-helper-zfix {
59
+ position: absolute;
60
+ top: 0;
61
+ left: 0;
62
+ width: 100%;
63
+ height: 100%;
64
+ opacity: 0;
65
+
66
+ filter: Alpha(Opacity=0);
67
+ }
68
+
69
+ .ui-front {
70
+ z-index: 100;
71
+ }
72
+
73
+
74
+ /* Interaction Cues
75
+
76
+ ----------------------------------*/
77
+
78
+ .ui-state-disabled {
79
+ cursor: default !important;
80
+ }
81
+
82
+
83
+ /* Icons
84
+
85
+ ----------------------------------*/
86
+
87
+ /* states and images */
88
+
89
+ .ui-icon {
90
+ display: block;
91
+ overflow: hidden;
92
+ background-repeat: no-repeat;
93
+ text-indent: -99999px;
94
+ }
95
+
96
+
97
+ /* Misc visuals
98
+
99
+ ----------------------------------*/
100
+
101
+ /* Overlays */
102
+
103
+ .ui-widget-overlay {
104
+ position: fixed;
105
+ top: 0;
106
+ left: 0;
107
+ width: 100%;
108
+ height: 100%;
109
+ }
110
+
111
+ .ui-accordion .ui-accordion-header {
112
+ display: block;
113
+ position: relative;
114
+ min-height: 0;
115
+ margin-top: 2px;
116
+ padding: 0.5em 0.5em 0.5em 0.7em;
117
+ cursor: pointer;
118
+ /* support: IE7 */
119
+ }
120
+
121
+ .ui-accordion .ui-accordion-icons {
122
+ padding-left: 2.2em;
123
+ }
124
+
125
+ .ui-accordion .ui-accordion-noicons {
126
+ padding-left: 0.7em;
127
+ }
128
+
129
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons {
130
+ padding-left: 2.2em;
131
+ }
132
+
133
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
134
+ position: absolute;
135
+ top: 50%;
136
+ left: 0.5em;
137
+ margin-top: -8px;
138
+ }
139
+
140
+ .ui-accordion .ui-accordion-content {
141
+ overflow: auto;
142
+ padding: 1em 2.2em;
143
+ border-top: 0;
144
+ }
145
+
146
+ .ui-autocomplete {
147
+ position: absolute;
148
+ top: 0;
149
+ left: 0;
150
+ cursor: default;
151
+ }
152
+
153
+ .ui-button {
154
+ display: inline-block;
155
+ overflow: visible;
156
+ position: relative;
157
+ margin-right: 0.1em;
158
+ padding: 0;
159
+ line-height: normal;
160
+ text-align: center;
161
+ vertical-align: middle;
162
+ cursor: pointer;
163
+ /* removes extra width in IE */
164
+ }
165
+
166
+ .ui-button,
167
+ .ui-button:link,
168
+ .ui-button:visited,
169
+ .ui-button:hover,
170
+ .ui-button:active {
171
+ text-decoration: none;
172
+ }
173
+
174
+ /* to make room for the icon, a width needs to be set here */
175
+
176
+ .ui-button-icon-only {
177
+ width: 2.2em;
178
+ }
179
+
180
+ /* button elements seem to need a little more width */
181
+
182
+ button.ui-button-icon-only {
183
+ width: 2.4em;
184
+ }
185
+
186
+ .ui-button-icons-only {
187
+ width: 3.4em;
188
+ }
189
+
190
+ button.ui-button-icons-only {
191
+ width: 3.7em;
192
+ }
193
+
194
+ /* button text element */
195
+
196
+ .ui-button .ui-button-text {
197
+ display: block;
198
+ line-height: normal;
199
+ }
200
+
201
+ .ui-button-text-only .ui-button-text {
202
+ padding: 0.4em 1em;
203
+ }
204
+
205
+ .ui-button-icon-only .ui-button-text,
206
+ .ui-button-icons-only .ui-button-text {
207
+ padding: 0.4em;
208
+ text-indent: -9999999px;
209
+ }
210
+
211
+ .ui-button-text-icon-primary .ui-button-text,
212
+ .ui-button-text-icons .ui-button-text {
213
+ padding: 0.4em 1em 0.4em 2.1em;
214
+ }
215
+
216
+ .ui-button-text-icon-secondary .ui-button-text,
217
+ .ui-button-text-icons .ui-button-text {
218
+ padding: 0.4em 2.1em 0.4em 1em;
219
+ }
220
+
221
+ .ui-button-text-icons .ui-button-text {
222
+ padding-right: 2.1em;
223
+ padding-left: 2.1em;
224
+ }
225
+
226
+ /* no icon support for input elements, provide padding by default */
227
+
228
+ input.ui-button {
229
+ padding: 0.4em 1em;
230
+ }
231
+
232
+ /* button icon element(s) */
233
+
234
+ .ui-button-icon-only .ui-icon,
235
+ .ui-button-text-icon-primary .ui-icon,
236
+ .ui-button-text-icon-secondary .ui-icon,
237
+ .ui-button-text-icons .ui-icon,
238
+ .ui-button-icons-only .ui-icon {
239
+ position: absolute;
240
+ top: 50%;
241
+ margin-top: -8px;
242
+ }
243
+
244
+ .ui-button-icon-only .ui-icon {
245
+ left: 50%;
246
+ margin-left: -8px;
247
+ }
248
+
249
+ .ui-button-text-icon-primary .ui-button-icon-primary,
250
+ .ui-button-text-icons .ui-button-icon-primary,
251
+ .ui-button-icons-only .ui-button-icon-primary {
252
+ left: 0.5em;
253
+ }
254
+
255
+ .ui-button-text-icon-secondary .ui-button-icon-secondary,
256
+ .ui-button-text-icons .ui-button-icon-secondary,
257
+ .ui-button-icons-only .ui-button-icon-secondary {
258
+ right: 0.5em;
259
+ }
260
+
261
+ /* button sets */
262
+
263
+ .ui-buttonset {
264
+ margin-right: 7px;
265
+ }
266
+
267
+ .ui-buttonset .ui-button {
268
+ margin-right: -0.3em;
269
+ margin-left: 0;
270
+ }
271
+
272
+ /* workarounds */
273
+
274
+ /* reset extra padding in Firefox, see h5bp.com/l */
275
+
276
+ input.ui-button::-moz-focus-inner,
277
+ button.ui-button::-moz-focus-inner {
278
+ padding: 0;
279
+ border: 0;
280
+ }
281
+
282
+ .ui-datepicker {
283
+ display: none;
284
+ width: 17em;
285
+ padding: 0.2em 0.2em 0;
286
+ }
287
+
288
+ .ui-datepicker .ui-datepicker-header {
289
+ position: relative;
290
+ padding: 0.2em 0;
291
+ }
292
+
293
+ .ui-datepicker .ui-datepicker-prev,
294
+ .ui-datepicker .ui-datepicker-next {
295
+ position: absolute;
296
+ top: 2px;
297
+ width: 1.8em;
298
+ height: 1.8em;
299
+ }
300
+
301
+ .ui-datepicker .ui-datepicker-prev-hover,
302
+ .ui-datepicker .ui-datepicker-next-hover {
303
+ top: 1px;
304
+ }
305
+
306
+ .ui-datepicker .ui-datepicker-prev {
307
+ left: 2px;
308
+ }
309
+
310
+ .ui-datepicker .ui-datepicker-next {
311
+ right: 2px;
312
+ }
313
+
314
+ .ui-datepicker .ui-datepicker-prev-hover {
315
+ left: 1px;
316
+ }
317
+
318
+ .ui-datepicker .ui-datepicker-next-hover {
319
+ right: 1px;
320
+ }
321
+
322
+ .ui-datepicker .ui-datepicker-prev span,
323
+ .ui-datepicker .ui-datepicker-next span {
324
+ display: block;
325
+ position: absolute;
326
+ top: 50%;
327
+ left: 50%;
328
+ margin-top: -8px;
329
+ margin-left: -8px;
330
+ }
331
+
332
+ .ui-datepicker .ui-datepicker-title {
333
+ margin: 0 2.3em;
334
+ line-height: 1.8em;
335
+ text-align: center;
336
+ }
337
+
338
+ .ui-datepicker .ui-datepicker-title select {
339
+ margin: 1px 0;
340
+ font-size: 1em;
341
+ }
342
+
343
+ .ui-datepicker select.ui-datepicker-month-year {
344
+ width: 100%;
345
+ }
346
+
347
+ .ui-datepicker select.ui-datepicker-month,
348
+ .ui-datepicker select.ui-datepicker-year {
349
+ width: 49%;
350
+ }
351
+
352
+ .ui-datepicker table {
353
+ width: 100%;
354
+ margin: 0 0 0.4em;
355
+ border-collapse: collapse;
356
+ font-size: 0.9em;
357
+ }
358
+
359
+ .ui-datepicker th {
360
+ padding: 0.7em 0.3em;
361
+ border: 0;
362
+ font-weight: bold;
363
+ text-align: center;
364
+ }
365
+
366
+ .ui-datepicker td {
367
+ padding: 1px;
368
+ border: 0;
369
+ }
370
+
371
+ .ui-datepicker td span,
372
+ .ui-datepicker td a {
373
+ display: block;
374
+ padding: 0.2em;
375
+ text-align: right;
376
+ text-decoration: none;
377
+ }
378
+
379
+ .ui-datepicker .ui-datepicker-buttonpane {
380
+ margin: 0.7em 0 0 0;
381
+ padding: 0 0.2em;
382
+ border-right: 0;
383
+ border-bottom: 0;
384
+ border-left: 0;
385
+ background-image: none;
386
+ }
387
+
388
+ .ui-datepicker .ui-datepicker-buttonpane button {
389
+ float: right;
390
+ overflow: visible;
391
+ width: auto;
392
+ margin: 0.5em 0.2em 0.4em;
393
+ padding: 0.2em 0.6em 0.3em 0.6em;
394
+ cursor: pointer;
395
+ }
396
+
397
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
398
+ float: left;
399
+ }
400
+
401
+ /* with multiple calendars */
402
+
403
+ .ui-datepicker.ui-datepicker-multi {
404
+ width: auto;
405
+ }
406
+
407
+ .ui-datepicker-multi .ui-datepicker-group {
408
+ float: left;
409
+ }
410
+
411
+ .ui-datepicker-multi .ui-datepicker-group table {
412
+ width: 95%;
413
+ margin: 0 auto 0.4em;
414
+ }
415
+
416
+ .ui-datepicker-multi-2 .ui-datepicker-group {
417
+ width: 50%;
418
+ }
419
+
420
+ .ui-datepicker-multi-3 .ui-datepicker-group {
421
+ width: 33.3%;
422
+ }
423
+
424
+ .ui-datepicker-multi-4 .ui-datepicker-group {
425
+ width: 25%;
426
+ }
427
+
428
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
429
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
430
+ border-left-width: 0;
431
+ }
432
+
433
+ .ui-datepicker-multi .ui-datepicker-buttonpane {
434
+ clear: left;
435
+ }
436
+
437
+ .ui-datepicker-row-break {
438
+ clear: both;
439
+ width: 100%;
440
+ font-size: 0;
441
+ }
442
+
443
+ /* RTL support */
444
+
445
+ .ui-datepicker-rtl {
446
+ direction: rtl;
447
+ }
448
+
449
+ .ui-datepicker-rtl .ui-datepicker-prev {
450
+ right: 2px;
451
+ left: auto;
452
+ }
453
+
454
+ .ui-datepicker-rtl .ui-datepicker-next {
455
+ right: auto;
456
+ left: 2px;
457
+ }
458
+
459
+ .ui-datepicker-rtl .ui-datepicker-prev:hover {
460
+ right: 1px;
461
+ left: auto;
462
+ }
463
+
464
+ .ui-datepicker-rtl .ui-datepicker-next:hover {
465
+ right: auto;
466
+ left: 1px;
467
+ }
468
+
469
+ .ui-datepicker-rtl .ui-datepicker-buttonpane {
470
+ clear: right;
471
+ }
472
+
473
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button {
474
+ float: left;
475
+ }
476
+
477
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
478
+ .ui-datepicker-rtl .ui-datepicker-group {
479
+ float: right;
480
+ }
481
+
482
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
483
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
484
+ border-right-width: 0;
485
+ border-left-width: 1px;
486
+ }
487
+
488
+ .ui-dialog {
489
+ position: absolute;
490
+ top: 0;
491
+ left: 0;
492
+ padding: 0.2em;
493
+ outline: 0;
494
+ }
495
+
496
+ .ui-dialog .ui-dialog-titlebar {
497
+ position: relative;
498
+ padding: 0.4em 1em;
499
+ }
500
+
501
+ .ui-dialog .ui-dialog-title {
502
+ float: left;
503
+ overflow: hidden;
504
+ width: 90%;
505
+ margin: 0.1em 0;
506
+ white-space: nowrap;
507
+ text-overflow: ellipsis;
508
+ }
509
+
510
+ .ui-dialog .ui-dialog-titlebar-close {
511
+ position: absolute;
512
+ top: 50%;
513
+ right: 0.3em;
514
+ width: 21px;
515
+ height: 20px;
516
+ margin: -10px 0 0 0;
517
+ padding: 1px;
518
+ }
519
+
520
+ .ui-dialog .ui-dialog-content {
521
+ overflow: auto;
522
+ position: relative;
523
+ padding: 0.5em 1em;
524
+ border: 0;
525
+ background: none;
526
+ }
527
+
528
+ .ui-dialog .ui-dialog-buttonpane {
529
+ margin-top: 0.5em;
530
+ padding: 0.3em 1em 0.5em 0.4em;
531
+ border-width: 1px 0 0 0;
532
+ background-image: none;
533
+ text-align: left;
534
+ }
535
+
536
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
537
+ float: right;
538
+ }
539
+
540
+ .ui-dialog .ui-dialog-buttonpane button {
541
+ margin: 0.5em 0.4em 0.5em 0;
542
+ cursor: pointer;
543
+ }
544
+
545
+ .ui-dialog .ui-resizable-se {
546
+ right: -5px;
547
+ bottom: -5px;
548
+ width: 12px;
549
+ height: 12px;
550
+ background-position: 16px 16px;
551
+ }
552
+
553
+ .ui-draggable .ui-dialog-titlebar {
554
+ cursor: move;
555
+ }
556
+
557
+ .ui-menu {
558
+ display: block;
559
+ margin: 0;
560
+ padding: 2px;
561
+ outline: none;
562
+ list-style: none;
563
+ }
564
+
565
+ .ui-menu .ui-menu {
566
+ position: absolute;
567
+ margin-top: -3px;
568
+ }
569
+
570
+ .ui-menu .ui-menu-item {
571
+ width: 100%;
572
+ margin: 0;
573
+ padding: 0;
574
+ /* support: IE10, see #8844 */
575
+ list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP//yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
576
+ }
577
+
578
+ .ui-menu .ui-menu-divider {
579
+ height: 0;
580
+ margin: 5px -2px 5px -2px;
581
+ border-width: 1px 0 0 0;
582
+ font-size: 0;
583
+ line-height: 0;
584
+ }
585
+
586
+ .ui-menu .ui-menu-item a {
587
+ display: block;
588
+ min-height: 0;
589
+ padding: 2px 0.4em;
590
+ /* support: IE7 */
591
+ font-weight: normal;
592
+ line-height: 1.5;
593
+ text-decoration: none;
594
+ }
595
+
596
+ .ui-menu .ui-menu-item a.ui-state-focus,
597
+ .ui-menu .ui-menu-item a.ui-state-active {
598
+ margin: -1px;
599
+ font-weight: normal;
600
+ }
601
+
602
+ .ui-menu .ui-state-disabled {
603
+ margin: 0.4em 0 0.2em;
604
+ font-weight: normal;
605
+ line-height: 1.5;
606
+ }
607
+
608
+ .ui-menu .ui-state-disabled a {
609
+ cursor: default;
610
+ }
611
+
612
+ /* icon support */
613
+
614
+ .ui-menu-icons {
615
+ position: relative;
616
+ }
617
+
618
+ .ui-menu-icons .ui-menu-item a {
619
+ position: relative;
620
+ padding-left: 2em;
621
+ }
622
+
623
+ /* left-aligned */
624
+
625
+ .ui-menu .ui-icon {
626
+ position: absolute;
627
+ top: 0.2em;
628
+ left: 0.2em;
629
+ }
630
+
631
+ /* right-aligned */
632
+
633
+ .ui-menu .ui-menu-icon {
634
+ float: right;
635
+ position: static;
636
+ }
637
+
638
+ .ui-progressbar {
639
+ overflow: hidden;
640
+ height: 2em;
641
+ text-align: left;
642
+ }
643
+
644
+ .ui-progressbar .ui-progressbar-value {
645
+ height: 100%;
646
+ margin: -1px;
647
+ }
648
+
649
+ .ui-progressbar .ui-progressbar-overlay {
650
+ height: 100%;
651
+ opacity: 0.25;
652
+ background: url("images/animated-overlay.gif");
653
+
654
+ filter: alpha(opacity=25);
655
+ }
656
+
657
+ .ui-progressbar-indeterminate .ui-progressbar-value {
658
+ background-image: none;
659
+ }
660
+
661
+ .ui-resizable {
662
+ position: relative;
663
+ }
664
+
665
+ .ui-resizable-handle {
666
+ display: block;
667
+ position: absolute;
668
+ font-size: 0.1px;
669
+ }
670
+
671
+ .ui-resizable-disabled .ui-resizable-handle,
672
+ .ui-resizable-autohide .ui-resizable-handle {
673
+ display: none;
674
+ }
675
+
676
+ .ui-resizable-n {
677
+ top: -5px;
678
+ left: 0;
679
+ width: 100%;
680
+ height: 7px;
681
+ cursor: n-resize;
682
+ }
683
+
684
+ .ui-resizable-s {
685
+ bottom: -5px;
686
+ left: 0;
687
+ width: 100%;
688
+ height: 7px;
689
+ cursor: s-resize;
690
+ }
691
+
692
+ .ui-resizable-e {
693
+ top: 0;
694
+ right: -5px;
695
+ width: 7px;
696
+ height: 100%;
697
+ cursor: e-resize;
698
+ }
699
+
700
+ .ui-resizable-w {
701
+ top: 0;
702
+ left: -5px;
703
+ width: 7px;
704
+ height: 100%;
705
+ cursor: w-resize;
706
+ }
707
+
708
+ .ui-resizable-se {
709
+ right: 1px;
710
+ bottom: 1px;
711
+ width: 12px;
712
+ height: 12px;
713
+ cursor: se-resize;
714
+ }
715
+
716
+ .ui-resizable-sw {
717
+ bottom: -5px;
718
+ left: -5px;
719
+ width: 9px;
720
+ height: 9px;
721
+ cursor: sw-resize;
722
+ }
723
+
724
+ .ui-resizable-nw {
725
+ top: -5px;
726
+ left: -5px;
727
+ width: 9px;
728
+ height: 9px;
729
+ cursor: nw-resize;
730
+ }
731
+
732
+ .ui-resizable-ne {
733
+ top: -5px;
734
+ right: -5px;
735
+ width: 9px;
736
+ height: 9px;
737
+ cursor: ne-resize;
738
+ }
739
+
740
+ .ui-selectable-helper {
741
+ position: absolute;
742
+ z-index: 100;
743
+ border: 1px dotted black;
744
+ }
745
+
746
+ .ui-slider {
747
+ position: relative;
748
+ text-align: left;
749
+ }
750
+
751
+ .ui-slider .ui-slider-handle {
752
+ position: absolute;
753
+ z-index: 2;
754
+ width: 1.2em;
755
+ height: 1.2em;
756
+ cursor: default;
757
+ }
758
+
759
+ .ui-slider .ui-slider-range {
760
+ display: block;
761
+ position: absolute;
762
+ z-index: 1;
763
+ border: 0;
764
+ background-position: 0 0;
765
+ font-size: 0.7em;
766
+ }
767
+
768
+ /* For IE8 - See #6727 */
769
+
770
+ .ui-slider.ui-state-disabled .ui-slider-handle,
771
+ .ui-slider.ui-state-disabled .ui-slider-range {
772
+ -webkit-filter: inherit;
773
+ filter: inherit;
774
+ }
775
+
776
+ .ui-slider-horizontal {
777
+ height: 0.8em;
778
+ }
779
+
780
+ .ui-slider-horizontal .ui-slider-handle {
781
+ top: -0.3em;
782
+ margin-left: -0.6em;
783
+ }
784
+
785
+ .ui-slider-horizontal .ui-slider-range {
786
+ top: 0;
787
+ height: 100%;
788
+ }
789
+
790
+ .ui-slider-horizontal .ui-slider-range-min {
791
+ left: 0;
792
+ }
793
+
794
+ .ui-slider-horizontal .ui-slider-range-max {
795
+ right: 0;
796
+ }
797
+
798
+ .ui-slider-vertical {
799
+ width: 0.8em;
800
+ height: 100px;
801
+ }
802
+
803
+ .ui-slider-vertical .ui-slider-handle {
804
+ left: -0.3em;
805
+ margin-bottom: -0.6em;
806
+ margin-left: 0;
807
+ }
808
+
809
+ .ui-slider-vertical .ui-slider-range {
810
+ left: 0;
811
+ width: 100%;
812
+ }
813
+
814
+ .ui-slider-vertical .ui-slider-range-min {
815
+ bottom: 0;
816
+ }
817
+
818
+ .ui-slider-vertical .ui-slider-range-max {
819
+ top: 0;
820
+ }
821
+
822
+ .ui-spinner {
823
+ display: inline-block;
824
+ overflow: hidden;
825
+ position: relative;
826
+ padding: 0;
827
+ vertical-align: middle;
828
+ }
829
+
830
+ .ui-spinner-input {
831
+ margin: 0.2em 22px 0.2em 0.4em;
832
+ padding: 0;
833
+ border: none;
834
+ color: inherit;
835
+ background: none;
836
+ vertical-align: middle;
837
+ }
838
+
839
+ .ui-spinner-button {
840
+ display: block;
841
+ overflow: hidden;
842
+ position: absolute;
843
+ right: 0;
844
+ width: 16px;
845
+ height: 50%;
846
+ margin: 0;
847
+ padding: 0;
848
+ font-size: 0.5em;
849
+ text-align: center;
850
+ cursor: default;
851
+ }
852
+
853
+ /* more specificity required here to overide default borders */
854
+
855
+ .ui-spinner a.ui-spinner-button {
856
+ border-top: none;
857
+ border-right: none;
858
+ border-bottom: none;
859
+ }
860
+
861
+ /* vertical centre icon */
862
+
863
+ .ui-spinner .ui-icon {
864
+ position: absolute;
865
+ top: 50%;
866
+ left: 0;
867
+ margin-top: -8px;
868
+ }
869
+
870
+ .ui-spinner-up {
871
+ top: 0;
872
+ }
873
+
874
+ .ui-spinner-down {
875
+ bottom: 0;
876
+ }
877
+
878
+ /* TR overrides */
879
+
880
+ .ui-spinner .ui-icon-triangle-1-s {
881
+ /* need to fix icons sprite */
882
+ background-position: -65px -16px;
883
+ }
884
+
885
+ .ui-tabs {
886
+ position: relative;
887
+ /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
888
+ padding: 0.2em;
889
+ }
890
+
891
+ .ui-tabs .ui-tabs-nav {
892
+ margin: 0;
893
+ padding: 0.2em 0.2em 0;
894
+ }
895
+
896
+ .ui-tabs .ui-tabs-nav li {
897
+ float: left;
898
+ position: relative;
899
+ top: 0;
900
+ margin: 1px 0.2em 0 0;
901
+ padding: 0;
902
+ border-bottom-width: 0;
903
+ white-space: nowrap;
904
+ list-style: none;
905
+ }
906
+
907
+ .ui-tabs .ui-tabs-nav li a {
908
+ float: left;
909
+ padding: 0.5em 1em;
910
+ text-decoration: none;
911
+ }
912
+
913
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active {
914
+ margin-bottom: -1px;
915
+ padding-bottom: 1px;
916
+ }
917
+
918
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active a,
919
+ .ui-tabs .ui-tabs-nav li.ui-state-disabled a,
920
+ .ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
921
+ cursor: text;
922
+ }
923
+
924
+ .ui-tabs .ui-tabs-nav li a,
925
+ /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
926
+
927
+ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
928
+ cursor: pointer;
929
+ }
930
+
931
+ .ui-tabs .ui-tabs-panel {
932
+ display: block;
933
+ padding: 1em 1.4em;
934
+ border-width: 0;
935
+ background: none;
936
+ }
937
+
938
+ .ui-tooltip {
939
+ position: absolute;
940
+ z-index: 9999;
941
+ max-width: 300px;
942
+ padding: 8px;
943
+ -webkit-box-shadow: 0 0 5px #aaa;
944
+ box-shadow: 0 0 5px #aaa;
945
+ }
946
+
947
+ body .ui-tooltip {
948
+ border-width: 2px;
949
+ }
950
+
951
+
952
+ /* Component containers
953
+
954
+ ----------------------------------*/
955
+
956
+ .ui-widget {
957
+ font-family: Verdana,Arial,sans-serif;
958
+ font-size: 1.1em;
959
+ }
960
+
961
+ .ui-widget .ui-widget {
962
+ font-size: 1em;
963
+ }
964
+
965
+ .ui-widget input,
966
+ .ui-widget select,
967
+ .ui-widget textarea,
968
+ .ui-widget button {
969
+ font-family: Verdana,Arial,sans-serif;
970
+ font-size: 1em;
971
+ }
972
+
973
+ .ui-widget-content {
974
+ border: 1px solid #aaa;
975
+ color: #222;
976
+ background: #fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
977
+ }
978
+
979
+ .ui-widget-content a {
980
+ color: #222;
981
+ }
982
+
983
+ .ui-widget-header {
984
+ border: 1px solid #aaa;
985
+ color: #222;
986
+ background: #ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
987
+ font-weight: bold;
988
+ }
989
+
990
+ .ui-widget-header a {
991
+ color: #222;
992
+ }
993
+
994
+
995
+ /* Interaction states
996
+
997
+ ----------------------------------*/
998
+
999
+ .ui-state-default,
1000
+ .ui-widget-content .ui-state-default,
1001
+ .ui-widget-header .ui-state-default {
1002
+ border: 1px solid #d3d3d3;
1003
+ color: #555;
1004
+ background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
1005
+ font-weight: normal;
1006
+ }
1007
+
1008
+ .ui-state-default a,
1009
+ .ui-state-default a:link,
1010
+ .ui-state-default a:visited {
1011
+ color: #555;
1012
+ text-decoration: none;
1013
+ }
1014
+
1015
+ .ui-state-hover,
1016
+ .ui-widget-content .ui-state-hover,
1017
+ .ui-widget-header .ui-state-hover,
1018
+ .ui-state-focus,
1019
+ .ui-widget-content .ui-state-focus,
1020
+ .ui-widget-header .ui-state-focus {
1021
+ border: 1px solid #999;
1022
+ color: #212121;
1023
+ background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
1024
+ font-weight: normal;
1025
+ }
1026
+
1027
+ .ui-state-hover a,
1028
+ .ui-state-hover a:hover,
1029
+ .ui-state-hover a:link,
1030
+ .ui-state-hover a:visited {
1031
+ color: #212121;
1032
+ text-decoration: none;
1033
+ }
1034
+
1035
+ .ui-state-active,
1036
+ .ui-widget-content .ui-state-active,
1037
+ .ui-widget-header .ui-state-active {
1038
+ border: 1px solid #aaa;
1039
+ color: #212121;
1040
+ background: #fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
1041
+ font-weight: normal;
1042
+ }
1043
+
1044
+ .ui-state-active a,
1045
+ .ui-state-active a:link,
1046
+ .ui-state-active a:visited {
1047
+ color: #212121;
1048
+ text-decoration: none;
1049
+ }
1050
+
1051
+
1052
+ /* Interaction Cues
1053
+
1054
+ ----------------------------------*/
1055
+
1056
+ .ui-state-highlight,
1057
+ .ui-widget-content .ui-state-highlight,
1058
+ .ui-widget-header .ui-state-highlight {
1059
+ border: 1px solid #fcefa1;
1060
+ color: #363636;
1061
+ background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
1062
+ }
1063
+
1064
+ .ui-state-highlight a,
1065
+ .ui-widget-content .ui-state-highlight a,
1066
+ .ui-widget-header .ui-state-highlight a {
1067
+ color: #363636;
1068
+ }
1069
+
1070
+ .ui-state-error,
1071
+ .ui-widget-content .ui-state-error,
1072
+ .ui-widget-header .ui-state-error {
1073
+ border: 1px solid #cd0a0a;
1074
+ color: #cd0a0a;
1075
+ background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
1076
+ }
1077
+
1078
+ .ui-state-error a,
1079
+ .ui-widget-content .ui-state-error a,
1080
+ .ui-widget-header .ui-state-error a {
1081
+ color: #cd0a0a;
1082
+ }
1083
+
1084
+ .ui-state-error-text,
1085
+ .ui-widget-content .ui-state-error-text,
1086
+ .ui-widget-header .ui-state-error-text {
1087
+ color: #cd0a0a;
1088
+ }
1089
+
1090
+ .ui-priority-primary,
1091
+ .ui-widget-content .ui-priority-primary,
1092
+ .ui-widget-header .ui-priority-primary {
1093
+ font-weight: bold;
1094
+ }
1095
+
1096
+ .ui-priority-secondary,
1097
+ .ui-widget-content .ui-priority-secondary,
1098
+ .ui-widget-header .ui-priority-secondary {
1099
+ opacity: 0.7;
1100
+ font-weight: normal;
1101
+
1102
+ filter: Alpha(Opacity=70);
1103
+ }
1104
+
1105
+ .ui-state-disabled,
1106
+ .ui-widget-content .ui-state-disabled,
1107
+ .ui-widget-header .ui-state-disabled {
1108
+ opacity: 0.35;
1109
+ background-image: none;
1110
+
1111
+ filter: Alpha(Opacity=35);
1112
+ }
1113
+
1114
+ .ui-state-disabled .ui-icon {
1115
+ filter: Alpha(Opacity=35);
1116
+ /* For IE8 - See #6059 */
1117
+ }
1118
+
1119
+
1120
+ /* Icons
1121
+
1122
+ ----------------------------------*/
1123
+
1124
+ /* states and images */
1125
+
1126
+ .ui-icon {
1127
+ width: 16px;
1128
+ height: 16px;
1129
+ }
1130
+
1131
+ .ui-icon,
1132
+ .ui-widget-content .ui-icon {
1133
+ background-image: url(images/ui-icons_222222_256x240.png);
1134
+ }
1135
+
1136
+ .ui-widget-header .ui-icon {
1137
+ background-image: url(images/ui-icons_222222_256x240.png);
1138
+ }
1139
+
1140
+ .ui-state-default .ui-icon {
1141
+ background-image: url(images/ui-icons_888888_256x240.png);
1142
+ }
1143
+
1144
+ .ui-state-hover .ui-icon,
1145
+ .ui-state-focus .ui-icon {
1146
+ background-image: url(images/ui-icons_454545_256x240.png);
1147
+ }
1148
+
1149
+ .ui-state-active .ui-icon {
1150
+ background-image: url(images/ui-icons_454545_256x240.png);
1151
+ }
1152
+
1153
+ .ui-state-highlight .ui-icon {
1154
+ background-image: url(images/ui-icons_2e83ff_256x240.png);
1155
+ }
1156
+
1157
+ .ui-state-error .ui-icon,
1158
+ .ui-state-error-text .ui-icon {
1159
+ background-image: url(images/ui-icons_cd0a0a_256x240.png);
1160
+ }
1161
+
1162
+ /* positioning */
1163
+
1164
+ .ui-icon-blank {
1165
+ background-position: 16px 16px;
1166
+ }
1167
+
1168
+ .ui-icon-carat-1-n {
1169
+ background-position: 0 0;
1170
+ }
1171
+
1172
+ .ui-icon-carat-1-ne {
1173
+ background-position: -16px 0;
1174
+ }
1175
+
1176
+ .ui-icon-carat-1-e {
1177
+ background-position: -32px 0;
1178
+ }
1179
+
1180
+ .ui-icon-carat-1-se {
1181
+ background-position: -48px 0;
1182
+ }
1183
+
1184
+ .ui-icon-carat-1-s {
1185
+ background-position: -64px 0;
1186
+ }
1187
+
1188
+ .ui-icon-carat-1-sw {
1189
+ background-position: -80px 0;
1190
+ }
1191
+
1192
+ .ui-icon-carat-1-w {
1193
+ background-position: -96px 0;
1194
+ }
1195
+
1196
+ .ui-icon-carat-1-nw {
1197
+ background-position: -112px 0;
1198
+ }
1199
+
1200
+ .ui-icon-carat-2-n-s {
1201
+ background-position: -128px 0;
1202
+ }
1203
+
1204
+ .ui-icon-carat-2-e-w {
1205
+ background-position: -144px 0;
1206
+ }
1207
+
1208
+ .ui-icon-triangle-1-n {
1209
+ background-position: 0 -16px;
1210
+ }
1211
+
1212
+ .ui-icon-triangle-1-ne {
1213
+ background-position: -16px -16px;
1214
+ }
1215
+
1216
+ .ui-icon-triangle-1-e {
1217
+ background-position: -32px -16px;
1218
+ }
1219
+
1220
+ .ui-icon-triangle-1-se {
1221
+ background-position: -48px -16px;
1222
+ }
1223
+
1224
+ .ui-icon-triangle-1-s {
1225
+ background-position: -64px -16px;
1226
+ }
1227
+
1228
+ .ui-icon-triangle-1-sw {
1229
+ background-position: -80px -16px;
1230
+ }
1231
+
1232
+ .ui-icon-triangle-1-w {
1233
+ background-position: -96px -16px;
1234
+ }
1235
+
1236
+ .ui-icon-triangle-1-nw {
1237
+ background-position: -112px -16px;
1238
+ }
1239
+
1240
+ .ui-icon-triangle-2-n-s {
1241
+ background-position: -128px -16px;
1242
+ }
1243
+
1244
+ .ui-icon-triangle-2-e-w {
1245
+ background-position: -144px -16px;
1246
+ }
1247
+
1248
+ .ui-icon-arrow-1-n {
1249
+ background-position: 0 -32px;
1250
+ }
1251
+
1252
+ .ui-icon-arrow-1-ne {
1253
+ background-position: -16px -32px;
1254
+ }
1255
+
1256
+ .ui-icon-arrow-1-e {
1257
+ background-position: -32px -32px;
1258
+ }
1259
+
1260
+ .ui-icon-arrow-1-se {
1261
+ background-position: -48px -32px;
1262
+ }
1263
+
1264
+ .ui-icon-arrow-1-s {
1265
+ background-position: -64px -32px;
1266
+ }
1267
+
1268
+ .ui-icon-arrow-1-sw {
1269
+ background-position: -80px -32px;
1270
+ }
1271
+
1272
+ .ui-icon-arrow-1-w {
1273
+ background-position: -96px -32px;
1274
+ }
1275
+
1276
+ .ui-icon-arrow-1-nw {
1277
+ background-position: -112px -32px;
1278
+ }
1279
+
1280
+ .ui-icon-arrow-2-n-s {
1281
+ background-position: -128px -32px;
1282
+ }
1283
+
1284
+ .ui-icon-arrow-2-ne-sw {
1285
+ background-position: -144px -32px;
1286
+ }
1287
+
1288
+ .ui-icon-arrow-2-e-w {
1289
+ background-position: -160px -32px;
1290
+ }
1291
+
1292
+ .ui-icon-arrow-2-se-nw {
1293
+ background-position: -176px -32px;
1294
+ }
1295
+
1296
+ .ui-icon-arrowstop-1-n {
1297
+ background-position: -192px -32px;
1298
+ }
1299
+
1300
+ .ui-icon-arrowstop-1-e {
1301
+ background-position: -208px -32px;
1302
+ }
1303
+
1304
+ .ui-icon-arrowstop-1-s {
1305
+ background-position: -224px -32px;
1306
+ }
1307
+
1308
+ .ui-icon-arrowstop-1-w {
1309
+ background-position: -240px -32px;
1310
+ }
1311
+
1312
+ .ui-icon-arrowthick-1-n {
1313
+ background-position: 0 -48px;
1314
+ }
1315
+
1316
+ .ui-icon-arrowthick-1-ne {
1317
+ background-position: -16px -48px;
1318
+ }
1319
+
1320
+ .ui-icon-arrowthick-1-e {
1321
+ background-position: -32px -48px;
1322
+ }
1323
+
1324
+ .ui-icon-arrowthick-1-se {
1325
+ background-position: -48px -48px;
1326
+ }
1327
+
1328
+ .ui-icon-arrowthick-1-s {
1329
+ background-position: -64px -48px;
1330
+ }
1331
+
1332
+ .ui-icon-arrowthick-1-sw {
1333
+ background-position: -80px -48px;
1334
+ }
1335
+
1336
+ .ui-icon-arrowthick-1-w {
1337
+ background-position: -96px -48px;
1338
+ }
1339
+
1340
+ .ui-icon-arrowthick-1-nw {
1341
+ background-position: -112px -48px;
1342
+ }
1343
+
1344
+ .ui-icon-arrowthick-2-n-s {
1345
+ background-position: -128px -48px;
1346
+ }
1347
+
1348
+ .ui-icon-arrowthick-2-ne-sw {
1349
+ background-position: -144px -48px;
1350
+ }
1351
+
1352
+ .ui-icon-arrowthick-2-e-w {
1353
+ background-position: -160px -48px;
1354
+ }
1355
+
1356
+ .ui-icon-arrowthick-2-se-nw {
1357
+ background-position: -176px -48px;
1358
+ }
1359
+
1360
+ .ui-icon-arrowthickstop-1-n {
1361
+ background-position: -192px -48px;
1362
+ }
1363
+
1364
+ .ui-icon-arrowthickstop-1-e {
1365
+ background-position: -208px -48px;
1366
+ }
1367
+
1368
+ .ui-icon-arrowthickstop-1-s {
1369
+ background-position: -224px -48px;
1370
+ }
1371
+
1372
+ .ui-icon-arrowthickstop-1-w {
1373
+ background-position: -240px -48px;
1374
+ }
1375
+
1376
+ .ui-icon-arrowreturnthick-1-w {
1377
+ background-position: 0 -64px;
1378
+ }
1379
+
1380
+ .ui-icon-arrowreturnthick-1-n {
1381
+ background-position: -16px -64px;
1382
+ }
1383
+
1384
+ .ui-icon-arrowreturnthick-1-e {
1385
+ background-position: -32px -64px;
1386
+ }
1387
+
1388
+ .ui-icon-arrowreturnthick-1-s {
1389
+ background-position: -48px -64px;
1390
+ }
1391
+
1392
+ .ui-icon-arrowreturn-1-w {
1393
+ background-position: -64px -64px;
1394
+ }
1395
+
1396
+ .ui-icon-arrowreturn-1-n {
1397
+ background-position: -80px -64px;
1398
+ }
1399
+
1400
+ .ui-icon-arrowreturn-1-e {
1401
+ background-position: -96px -64px;
1402
+ }
1403
+
1404
+ .ui-icon-arrowreturn-1-s {
1405
+ background-position: -112px -64px;
1406
+ }
1407
+
1408
+ .ui-icon-arrowrefresh-1-w {
1409
+ background-position: -128px -64px;
1410
+ }
1411
+
1412
+ .ui-icon-arrowrefresh-1-n {
1413
+ background-position: -144px -64px;
1414
+ }
1415
+
1416
+ .ui-icon-arrowrefresh-1-e {
1417
+ background-position: -160px -64px;
1418
+ }
1419
+
1420
+ .ui-icon-arrowrefresh-1-s {
1421
+ background-position: -176px -64px;
1422
+ }
1423
+
1424
+ .ui-icon-arrow-4 {
1425
+ background-position: 0 -80px;
1426
+ }
1427
+
1428
+ .ui-icon-arrow-4-diag {
1429
+ background-position: -16px -80px;
1430
+ }
1431
+
1432
+ .ui-icon-extlink {
1433
+ background-position: -32px -80px;
1434
+ }
1435
+
1436
+ .ui-icon-newwin {
1437
+ background-position: -48px -80px;
1438
+ }
1439
+
1440
+ .ui-icon-refresh {
1441
+ background-position: -64px -80px;
1442
+ }
1443
+
1444
+ .ui-icon-shuffle {
1445
+ background-position: -80px -80px;
1446
+ }
1447
+
1448
+ .ui-icon-transfer-e-w {
1449
+ background-position: -96px -80px;
1450
+ }
1451
+
1452
+ .ui-icon-transferthick-e-w {
1453
+ background-position: -112px -80px;
1454
+ }
1455
+
1456
+ .ui-icon-folder-collapsed {
1457
+ background-position: 0 -96px;
1458
+ }
1459
+
1460
+ .ui-icon-folder-open {
1461
+ background-position: -16px -96px;
1462
+ }
1463
+
1464
+ .ui-icon-document {
1465
+ background-position: -32px -96px;
1466
+ }
1467
+
1468
+ .ui-icon-document-b {
1469
+ background-position: -48px -96px;
1470
+ }
1471
+
1472
+ .ui-icon-note {
1473
+ background-position: -64px -96px;
1474
+ }
1475
+
1476
+ .ui-icon-mail-closed {
1477
+ background-position: -80px -96px;
1478
+ }
1479
+
1480
+ .ui-icon-mail-open {
1481
+ background-position: -96px -96px;
1482
+ }
1483
+
1484
+ .ui-icon-suitcase {
1485
+ background-position: -112px -96px;
1486
+ }
1487
+
1488
+ .ui-icon-comment {
1489
+ background-position: -128px -96px;
1490
+ }
1491
+
1492
+ .ui-icon-person {
1493
+ background-position: -144px -96px;
1494
+ }
1495
+
1496
+ .ui-icon-print {
1497
+ background-position: -160px -96px;
1498
+ }
1499
+
1500
+ .ui-icon-trash {
1501
+ background-position: -176px -96px;
1502
+ }
1503
+
1504
+ .ui-icon-locked {
1505
+ background-position: -192px -96px;
1506
+ }
1507
+
1508
+ .ui-icon-unlocked {
1509
+ background-position: -208px -96px;
1510
+ }
1511
+
1512
+ .ui-icon-bookmark {
1513
+ background-position: -224px -96px;
1514
+ }
1515
+
1516
+ .ui-icon-tag {
1517
+ background-position: -240px -96px;
1518
+ }
1519
+
1520
+ .ui-icon-home {
1521
+ background-position: 0 -112px;
1522
+ }
1523
+
1524
+ .ui-icon-flag {
1525
+ background-position: -16px -112px;
1526
+ }
1527
+
1528
+ .ui-icon-calendar {
1529
+ background-position: -32px -112px;
1530
+ }
1531
+
1532
+ .ui-icon-cart {
1533
+ background-position: -48px -112px;
1534
+ }
1535
+
1536
+ .ui-icon-pencil {
1537
+ background-position: -64px -112px;
1538
+ }
1539
+
1540
+ .ui-icon-clock {
1541
+ background-position: -80px -112px;
1542
+ }
1543
+
1544
+ .ui-icon-disk {
1545
+ background-position: -96px -112px;
1546
+ }
1547
+
1548
+ .ui-icon-calculator {
1549
+ background-position: -112px -112px;
1550
+ }
1551
+
1552
+ .ui-icon-zoomin {
1553
+ background-position: -128px -112px;
1554
+ }
1555
+
1556
+ .ui-icon-zoomout {
1557
+ background-position: -144px -112px;
1558
+ }
1559
+
1560
+ .ui-icon-search {
1561
+ background-position: -160px -112px;
1562
+ }
1563
+
1564
+ .ui-icon-wrench {
1565
+ background-position: -176px -112px;
1566
+ }
1567
+
1568
+ .ui-icon-gear {
1569
+ background-position: -192px -112px;
1570
+ }
1571
+
1572
+ .ui-icon-heart {
1573
+ background-position: -208px -112px;
1574
+ }
1575
+
1576
+ .ui-icon-star {
1577
+ background-position: -224px -112px;
1578
+ }
1579
+
1580
+ .ui-icon-link {
1581
+ background-position: -240px -112px;
1582
+ }
1583
+
1584
+ .ui-icon-cancel {
1585
+ background-position: 0 -128px;
1586
+ }
1587
+
1588
+ .ui-icon-plus {
1589
+ background-position: -16px -128px;
1590
+ }
1591
+
1592
+ .ui-icon-plusthick {
1593
+ background-position: -32px -128px;
1594
+ }
1595
+
1596
+ .ui-icon-minus {
1597
+ background-position: -48px -128px;
1598
+ }
1599
+
1600
+ .ui-icon-minusthick {
1601
+ background-position: -64px -128px;
1602
+ }
1603
+
1604
+ .ui-icon-close {
1605
+ background-position: -80px -128px;
1606
+ }
1607
+
1608
+ .ui-icon-closethick {
1609
+ background-position: -96px -128px;
1610
+ }
1611
+
1612
+ .ui-icon-key {
1613
+ background-position: -112px -128px;
1614
+ }
1615
+
1616
+ .ui-icon-lightbulb {
1617
+ background-position: -128px -128px;
1618
+ }
1619
+
1620
+ .ui-icon-scissors {
1621
+ background-position: -144px -128px;
1622
+ }
1623
+
1624
+ .ui-icon-clipboard {
1625
+ background-position: -160px -128px;
1626
+ }
1627
+
1628
+ .ui-icon-copy {
1629
+ background-position: -176px -128px;
1630
+ }
1631
+
1632
+ .ui-icon-contact {
1633
+ background-position: -192px -128px;
1634
+ }
1635
+
1636
+ .ui-icon-image {
1637
+ background-position: -208px -128px;
1638
+ }
1639
+
1640
+ .ui-icon-video {
1641
+ background-position: -224px -128px;
1642
+ }
1643
+
1644
+ .ui-icon-script {
1645
+ background-position: -240px -128px;
1646
+ }
1647
+
1648
+ .ui-icon-alert {
1649
+ background-position: 0 -144px;
1650
+ }
1651
+
1652
+ .ui-icon-info {
1653
+ background-position: -16px -144px;
1654
+ }
1655
+
1656
+ .ui-icon-notice {
1657
+ background-position: -32px -144px;
1658
+ }
1659
+
1660
+ .ui-icon-help {
1661
+ background-position: -48px -144px;
1662
+ }
1663
+
1664
+ .ui-icon-check {
1665
+ background-position: -64px -144px;
1666
+ }
1667
+
1668
+ .ui-icon-bullet {
1669
+ background-position: -80px -144px;
1670
+ }
1671
+
1672
+ .ui-icon-radio-on {
1673
+ background-position: -96px -144px;
1674
+ }
1675
+
1676
+ .ui-icon-radio-off {
1677
+ background-position: -112px -144px;
1678
+ }
1679
+
1680
+ .ui-icon-pin-w {
1681
+ background-position: -128px -144px;
1682
+ }
1683
+
1684
+ .ui-icon-pin-s {
1685
+ background-position: -144px -144px;
1686
+ }
1687
+
1688
+ .ui-icon-play {
1689
+ background-position: 0 -160px;
1690
+ }
1691
+
1692
+ .ui-icon-pause {
1693
+ background-position: -16px -160px;
1694
+ }
1695
+
1696
+ .ui-icon-seek-next {
1697
+ background-position: -32px -160px;
1698
+ }
1699
+
1700
+ .ui-icon-seek-prev {
1701
+ background-position: -48px -160px;
1702
+ }
1703
+
1704
+ .ui-icon-seek-end {
1705
+ background-position: -64px -160px;
1706
+ }
1707
+
1708
+ .ui-icon-seek-start {
1709
+ background-position: -80px -160px;
1710
+ }
1711
+
1712
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1713
+
1714
+ .ui-icon-seek-first {
1715
+ background-position: -80px -160px;
1716
+ }
1717
+
1718
+ .ui-icon-stop {
1719
+ background-position: -96px -160px;
1720
+ }
1721
+
1722
+ .ui-icon-eject {
1723
+ background-position: -112px -160px;
1724
+ }
1725
+
1726
+ .ui-icon-volume-off {
1727
+ background-position: -128px -160px;
1728
+ }
1729
+
1730
+ .ui-icon-volume-on {
1731
+ background-position: -144px -160px;
1732
+ }
1733
+
1734
+ .ui-icon-power {
1735
+ background-position: 0 -176px;
1736
+ }
1737
+
1738
+ .ui-icon-signal-diag {
1739
+ background-position: -16px -176px;
1740
+ }
1741
+
1742
+ .ui-icon-signal {
1743
+ background-position: -32px -176px;
1744
+ }
1745
+
1746
+ .ui-icon-battery-0 {
1747
+ background-position: -48px -176px;
1748
+ }
1749
+
1750
+ .ui-icon-battery-1 {
1751
+ background-position: -64px -176px;
1752
+ }
1753
+
1754
+ .ui-icon-battery-2 {
1755
+ background-position: -80px -176px;
1756
+ }
1757
+
1758
+ .ui-icon-battery-3 {
1759
+ background-position: -96px -176px;
1760
+ }
1761
+
1762
+ .ui-icon-circle-plus {
1763
+ background-position: 0 -192px;
1764
+ }
1765
+
1766
+ .ui-icon-circle-minus {
1767
+ background-position: -16px -192px;
1768
+ }
1769
+
1770
+ .ui-icon-circle-close {
1771
+ background-position: -32px -192px;
1772
+ }
1773
+
1774
+ .ui-icon-circle-triangle-e {
1775
+ background-position: -48px -192px;
1776
+ }
1777
+
1778
+ .ui-icon-circle-triangle-s {
1779
+ background-position: -64px -192px;
1780
+ }
1781
+
1782
+ .ui-icon-circle-triangle-w {
1783
+ background-position: -80px -192px;
1784
+ }
1785
+
1786
+ .ui-icon-circle-triangle-n {
1787
+ background-position: -96px -192px;
1788
+ }
1789
+
1790
+ .ui-icon-circle-arrow-e {
1791
+ background-position: -112px -192px;
1792
+ }
1793
+
1794
+ .ui-icon-circle-arrow-s {
1795
+ background-position: -128px -192px;
1796
+ }
1797
+
1798
+ .ui-icon-circle-arrow-w {
1799
+ background-position: -144px -192px;
1800
+ }
1801
+
1802
+ .ui-icon-circle-arrow-n {
1803
+ background-position: -160px -192px;
1804
+ }
1805
+
1806
+ .ui-icon-circle-zoomin {
1807
+ background-position: -176px -192px;
1808
+ }
1809
+
1810
+ .ui-icon-circle-zoomout {
1811
+ background-position: -192px -192px;
1812
+ }
1813
+
1814
+ .ui-icon-circle-check {
1815
+ background-position: -208px -192px;
1816
+ }
1817
+
1818
+ .ui-icon-circlesmall-plus {
1819
+ background-position: 0 -208px;
1820
+ }
1821
+
1822
+ .ui-icon-circlesmall-minus {
1823
+ background-position: -16px -208px;
1824
+ }
1825
+
1826
+ .ui-icon-circlesmall-close {
1827
+ background-position: -32px -208px;
1828
+ }
1829
+
1830
+ .ui-icon-squaresmall-plus {
1831
+ background-position: -48px -208px;
1832
+ }
1833
+
1834
+ .ui-icon-squaresmall-minus {
1835
+ background-position: -64px -208px;
1836
+ }
1837
+
1838
+ .ui-icon-squaresmall-close {
1839
+ background-position: -80px -208px;
1840
+ }
1841
+
1842
+ .ui-icon-grip-dotted-vertical {
1843
+ background-position: 0 -224px;
1844
+ }
1845
+
1846
+ .ui-icon-grip-dotted-horizontal {
1847
+ background-position: -16px -224px;
1848
+ }
1849
+
1850
+ .ui-icon-grip-solid-vertical {
1851
+ background-position: -32px -224px;
1852
+ }
1853
+
1854
+ .ui-icon-grip-solid-horizontal {
1855
+ background-position: -48px -224px;
1856
+ }
1857
+
1858
+ .ui-icon-gripsmall-diagonal-se {
1859
+ background-position: -64px -224px;
1860
+ }
1861
+
1862
+ .ui-icon-grip-diagonal-se {
1863
+ background-position: -80px -224px;
1864
+ }
1865
+
1866
+
1867
+ /* Misc visuals
1868
+
1869
+ ----------------------------------*/
1870
+
1871
+ /* Corner radius */
1872
+
1873
+ .ui-corner-all,
1874
+ .ui-corner-top,
1875
+ .ui-corner-left,
1876
+ .ui-corner-tl {
1877
+ border-top-left-radius: 4px;
1878
+ }
1879
+
1880
+ .ui-corner-all,
1881
+ .ui-corner-top,
1882
+ .ui-corner-right,
1883
+ .ui-corner-tr {
1884
+ border-top-right-radius: 4px;
1885
+ }
1886
+
1887
+ .ui-corner-all,
1888
+ .ui-corner-bottom,
1889
+ .ui-corner-left,
1890
+ .ui-corner-bl {
1891
+ border-bottom-left-radius: 4px;
1892
+ }
1893
+
1894
+ .ui-corner-all,
1895
+ .ui-corner-bottom,
1896
+ .ui-corner-right,
1897
+ .ui-corner-br {
1898
+ border-bottom-right-radius: 4px;
1899
+ }
1900
+
1901
+ /* Overlays */
1902
+
1903
+ .ui-widget-overlay {
1904
+ opacity: 0.3;
1905
+ background: #aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1906
+
1907
+ filter: Alpha(Opacity=30);
1908
+ }
1909
+
1910
+ .ui-widget-shadow {
1911
+ margin: -8px 0 0 -8px;
1912
+ padding: 8px;
1913
+ border-radius: 8px;
1914
+ opacity: 0.3;
1915
+ background: #aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
1916
+
1917
+ filter: Alpha(Opacity=30);
1918
+ }
assets/css/lightbox.css ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Preload images */
2
+ body:after {
3
+ display: none;
4
+ content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png);
5
+ }
6
+
7
+ .lightboxOverlay {
8
+ display: none;
9
+ position: absolute;
10
+ z-index: 9999;
11
+ top: 0;
12
+ left: 0;
13
+ opacity: 0.8;
14
+ background-color: black;
15
+
16
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
17
+ }
18
+
19
+ .lightbox {
20
+ position: absolute;
21
+ z-index: 10000;
22
+ left: 0;
23
+ width: 100%;
24
+ font-weight: normal;
25
+ line-height: 0;
26
+ text-align: center;
27
+ }
28
+
29
+ .lightbox .lb-image {
30
+ display: block;
31
+ max-width: inherit;
32
+ height: auto;
33
+ border-radius: 3px;
34
+ }
35
+
36
+ .lightbox a img {
37
+ border: none;
38
+ }
39
+
40
+ .lb-outerContainer {
41
+ position: relative;
42
+ width: 250px;
43
+ height: 250px;
44
+ margin: 0 auto;
45
+ border-radius: 4px;
46
+ background-color: white;
47
+
48
+ *zoom: 1;
49
+ }
50
+
51
+ .lb-outerContainer:after {
52
+ display: table;
53
+ clear: both;
54
+ content: "";
55
+ }
56
+
57
+ .lb-container {
58
+ padding: 4px;
59
+ }
60
+
61
+ .lb-loader {
62
+ position: absolute;
63
+ top: 43%;
64
+ left: 0;
65
+ width: 100%;
66
+ height: 25%;
67
+ line-height: 0;
68
+ text-align: center;
69
+ }
70
+
71
+ .lb-cancel {
72
+ display: block;
73
+ width: 32px;
74
+ height: 32px;
75
+ margin: 0 auto;
76
+ background: url(../img/loading.gif) no-repeat;
77
+ }
78
+
79
+ .lb-nav {
80
+ position: absolute;
81
+ z-index: 10;
82
+ top: 0;
83
+ left: 0;
84
+ width: 100%;
85
+ height: 100%;
86
+ }
87
+
88
+ .lb-container > .nav {
89
+ left: 0;
90
+ }
91
+
92
+ .lb-nav a {
93
+ outline: none;
94
+ background-image: url("data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==");
95
+ }
96
+
97
+ .lb-prev,
98
+ .lb-next {
99
+ display: block;
100
+ height: 100%;
101
+ cursor: pointer;
102
+ }
103
+
104
+ .lb-nav a.lb-prev {
105
+ float: left;
106
+ left: 0;
107
+ width: 34%;
108
+ opacity: 0;
109
+ background: url(../img/prev.png) left 48% no-repeat;
110
+ -webkit-transition: opacity 0.6s;
111
+ transition: opacity 0.6s;
112
+
113
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
114
+ }
115
+
116
+ .lb-nav a.lb-prev:hover {
117
+ opacity: 1;
118
+
119
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
120
+ }
121
+
122
+ .lb-nav a.lb-next {
123
+ float: right;
124
+ right: 0;
125
+ width: 64%;
126
+ opacity: 0;
127
+ background: url(../img/next.png) right 48% no-repeat;
128
+ -webkit-transition: opacity 0.6s;
129
+ transition: opacity 0.6s;
130
+
131
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
132
+ }
133
+
134
+ .lb-nav a.lb-next:hover {
135
+ opacity: 1;
136
+
137
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
138
+ }
139
+
140
+ .lb-dataContainer {
141
+ width: 100%;
142
+ margin: 0 auto;
143
+ padding-top: 5px;
144
+ border-bottom-right-radius: 4px;
145
+ border-bottom-left-radius: 4px;
146
+
147
+ *zoom: 1;
148
+ }
149
+
150
+ .lb-dataContainer:after {
151
+ display: table;
152
+ clear: both;
153
+ content: "";
154
+ }
155
+
156
+ .lb-data {
157
+ padding: 0 4px;
158
+ color: #ccc;
159
+ }
160
+
161
+ .lb-data .lb-details {
162
+ float: left;
163
+ width: 85%;
164
+ line-height: 1.1em;
165
+ text-align: left;
166
+ }
167
+
168
+ .lb-data .lb-caption {
169
+ font-size: 13px;
170
+ font-weight: bold;
171
+ line-height: 1em;
172
+ }
173
+
174
+ .lb-data .lb-number {
175
+ display: block;
176
+ clear: left;
177
+ padding-bottom: 1em;
178
+ color: #999;
179
+ font-size: 12px;
180
+ }
181
+
182
+ .lb-data .lb-close {
183
+ display: block;
184
+ float: right;
185
+ width: 30px;
186
+ height: 30px;
187
+ outline: none;
188
+ opacity: 0.7;
189
+ background: url(../img/close.png) top right no-repeat;
190
+ text-align: right;
191
+ -webkit-transition: opacity 0.2s;
192
+ transition: opacity 0.2s;
193
+
194
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
195
+ }
196
+
197
+ .lb-data .lb-close:hover {
198
+ opacity: 1;
199
+ cursor: pointer;
200
+
201
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
202
+ }
{css → assets/css}/pro_dashboard_styles.css RENAMED
@@ -1,7 +1,7 @@
1
  .cwp-cta {
2
- display:none!important;
3
  }
4
 
5
  .cwp_addons_wrap .announcement {
6
- display:none;
7
- }
1
  .cwp-cta {
2
+ display: none!important;
3
  }
4
 
5
  .cwp_addons_wrap .announcement {
6
+ display: none;
7
+ }
assets/css/upsell.css ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wppr-admin .pro-features-header {
2
+ padding: 20px 10px;
3
+ border-top: 5px solid #252b37;
4
+ background: #fff;
5
+ }
6
+
7
+ #wppr-admin .logo {
8
+ display: inline-block;
9
+ margin: 0 0 0 20px;
10
+ padding: 0 0 0 70px;
11
+ color: #3c3c3c;
12
+ background: url(../img/wppr-logo.png) no-repeat left center;
13
+ font-family: "Open Sans", sans-serif;
14
+ font-size: 2em;
15
+ font-weight: 700;
16
+ line-height: 60px;
17
+ letter-spacing: -1px;
18
+ }
19
+
20
+ #wppr-admin .slogan {
21
+ display: inline-block;
22
+ margin: 0 0 0 5px;
23
+ padding: 0;
24
+ color: #858585;
25
+ font-family: "Open Sans", sans-serif;
26
+ font-size: 17px;
27
+ line-height: 3.5;
28
+ }
29
+
30
+ #wppr-admin .slogan a {
31
+ color: #858585;
32
+ font-weight: 600;
33
+ font-style: italic;
34
+ text-decoration: none;
35
+ -webkit-transition: all 0.250s ease-in-out;
36
+ transition: all 0.250s ease-in-out;
37
+ }
38
+
39
+ #wppr-admin .slogan a:hover {
40
+ color: #ff6160;
41
+ }
42
+
43
+ #wppr-admin .slogan a:focus {
44
+ outline: none;
45
+ -webkit-box-shadow: none;
46
+ box-shadow: none;
47
+ }
48
+
49
+ #wppr-admin .header-btns {
50
+ float: right;
51
+ margin: 7px 20px;
52
+ text-align: right;
53
+ }
54
+
55
+ #wppr-admin .header-btns .buy-now {
56
+ display: inline-block;
57
+ margin-top: 2px;
58
+ margin-right: 5px;
59
+ padding: 15px 25px;
60
+ border-radius: 3px;
61
+ border-radius: 3px;
62
+ color: #fff;
63
+ background: #e33b3f;
64
+ font-family: "Open Sans", sans-serif;
65
+ font-size: 18px;
66
+ font-weight: bold;
67
+ text-decoration: none;
68
+ text-transform: uppercase;
69
+ -webkit-transition: all 0.250s ease-in-out;
70
+ transition: all 0.250s ease-in-out;
71
+ }
72
+
73
+ #wppr-admin .header-btns .buy-now:hover {
74
+ background: #252b37;
75
+ }
76
+
77
+ #wppr-admin .header-btns .buy-now .dashicons {
78
+ padding-right: 3px;
79
+ }
80
+
81
+ #wppr-admin .pro-features-header,
82
+ #wppr-admin .pro-feature {
83
+ display: block;
84
+ margin: 10px;
85
+ background-color: #fff;
86
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
87
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
88
+ }
89
+
90
+ #wppr-admin .pro-feature .pro-feature-features,
91
+ #wppr-admin .pro-feature .pro-feature-image {
92
+ display: table-cell;
93
+ margin: 0;
94
+ vertical-align: middle;
95
+ }
96
+
97
+ #wppr-admin .pro-feature .pro-feature-features {
98
+ -webkit-box-sizing: border-box;
99
+ box-sizing: border-box;
100
+ padding: 30px;
101
+ }
102
+
103
+ #wppr-admin .pro-feature .pro-feature-image {
104
+ width: 470px;
105
+ }
106
+
107
+ #wppr-admin .pro-feature .pro-feature-features h2 {
108
+ margin: 0 0 20px;
109
+ font-size: 28px;
110
+ }
111
+
112
+ #wppr-admin .pro-feature .pro-feature-features h4 {
113
+ margin: 0 0 10px;
114
+ font-size: 20px;
115
+ }
116
+
117
+ #wppr-admin .pro-feature .pro-feature-features p {
118
+ margin: 0 0 15px;
119
+ font-size: 16px;
120
+ line-height: 1.5;
121
+ }
122
+
123
+ #wppr-admin .pro-feature .pro-feature-image img {
124
+ width: 100%;
125
+ height: auto;
126
+ }
127
+
128
+ @media screen and (max-width: 1200px) {
129
+ #wppr-admin .pro-feature .pro-feature-features,
130
+ #wppr-admin .pro-feature .pro-feature-image {
131
+ display: block;
132
+ }
133
+
134
+ #wppr-admin .pro-feature .pro-feature-image {
135
+ width: 470px;
136
+ margin: 0 auto 20px;
137
+ text-align: center;
138
+ }
139
+
140
+ #wppr-admin .slogan {
141
+ display: none;
142
+ }
143
+ }
144
+
145
+ @media screen and (max-width: 1100px) {
146
+ #wppr-admin {
147
+ text-align: center;
148
+ }
149
+
150
+ #wppr-admin .logo {
151
+ margin-left: 0;
152
+ }
153
+
154
+ #wppr-admin .header-btns {
155
+ display: block;
156
+ float: none;
157
+ margin: 0 0 10px 0;
158
+ text-align: center;
159
+ }
160
+ }
161
+
162
+ @media screen and (max-width: 782px) {
163
+ #cwp_form #header .button {
164
+ padding: 0 4px 1px !important;
165
+ font-size: 11px !important;
166
+ }
167
+
168
+ #cwp_form #header .logo h2 {
169
+ margin: 0 !important;
170
+ padding: 0 !important;
171
+ }
172
+
173
+ #wppr-admin .pro-feature .pro-feature-image {
174
+ width: 100%;
175
+ }
176
+ }
{images → assets/img}/amazon-cart.png RENAMED
File without changes
{images → assets/img}/cart-icon-hover.png RENAMED
File without changes
{images → assets/img}/cart-icon.png RENAMED
File without changes
{img → assets/img}/close.png RENAMED
File without changes
{images → assets/img}/comparison-table.gif RENAMED
File without changes
{images → assets/img}/customize-icons.gif RENAMED
File without changes
assets/{default.png → img/default.png} RENAMED
File without changes
{img → assets/img}/loading.gif RENAMED
File without changes
{admin/layout → assets}/img/logo.png RENAMED
File without changes
{img → assets/img}/next.png RENAMED
File without changes
{images → assets/img}/preload.png RENAMED
File without changes
{img → assets/img}/prev.png RENAMED
File without changes
{images → assets/img}/single.png RENAMED
File without changes
assets/{style1.png → img/style1.png} RENAMED
File without changes
{images → assets/img}/wppr-amazon-integration-and-support.jpg RENAMED
File without changes
{images → assets/img}/wppr-import.jpg RENAMED
File without changes
{admin/layout → assets}/img/wppr-logo.png RENAMED
File without changes
{images → assets/img}/wppr-review-comparison.jpg RENAMED
File without changes
{images → assets/img}/wppr-shortcodes.jpg RENAMED
File without changes
assets/js/admin-review.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+ jQuery( document ).ready(function(){
3
+
4
+ var meta_image_frame;
5
+
6
+ jQuery( '#wppr-editor-image-button' ).click(function(e){
7
+
8
+ e.preventDefault();
9
+
10
+ if ( meta_image_frame ) {
11
+ wp.media.frame.open();
12
+ return;
13
+ }
14
+ var mtitle = "Add a product image to the review";
15
+ var mbutton = "Attach the image ";
16
+
17
+ meta_image_frame = wp.media.frames.meta_image_frame = wp.media({
18
+ title: mtitle,
19
+ button: { text: mbutton },
20
+ library: { type: 'image' }
21
+ });
22
+
23
+ meta_image_frame.on('select', function(){
24
+
25
+ var media_attachment = meta_image_frame.state().get( 'selection' ).first().toJSON();
26
+
27
+ jQuery( '#wppr-editor-image' ).val( media_attachment.url );
28
+ });
29
+
30
+ wp.media.frame.open();
31
+ });
32
+
33
+ jQuery( 'input:radio[name="wppr-review-status"]' ).change(function(){
34
+ var value = jQuery( this ).val();
35
+ if (value === "yes") {
36
+
37
+ jQuery( "#wppr-meta-yes" ).show();
38
+ jQuery( "#wppr-meta-no" ).show();
39
+ } else {
40
+ jQuery( "#wppr-meta-yes" ).hide();
41
+ jQuery( "#wppr-meta-no" ).hide();
42
+ }
43
+ });
44
+
45
+ jQuery( '#wppr-editor-new-link' ).click(function(e){
46
+ e.preventDefault();
47
+ jQuery( '.hidden_fields' ).show();
48
+ jQuery( this ).hide();
49
+ return false;
50
+ })
51
+
52
+ });
assets/js/admin.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+ jQuery( document ).ready(function ($) {
3
+
4
+ jQuery("#cwp_container").fadeIn(200);
5
+
6
+ jQuery(".subo-color-picker").wpColorPicker({ change: function(event, ui){
7
+ var color = ui.color.toCSS();
8
+
9
+ var id = jQuery(this).attr('id').replace('_color_selector', '');
10
+
11
+
12
+ jQuery("#"+id+"_color").val(color);
13
+ }} );
14
+
15
+ update_nav( $( "#wppr_top_tabs .wppr-nav-tab:first" ) );
16
+ $( "#wppr_top_tabs" ).on('click', '.wppr-nav-tab', function () {
17
+ update_nav( $( this ) );
18
+ return false;
19
+ })
20
+ function update_nav(obj) {
21
+
22
+ var tab = obj.attr( 'data-tab' );
23
+ var id = obj.find( 'a' ).attr( 'href' );
24
+ $( '.wppr-nav-tab' ).removeClass( 'active' );
25
+ obj.addClass( 'active' );
26
+ $( '.wppr-tab-content' ).hide();
27
+ $( id ).show();
28
+ }
29
+ });
30
+
31
+ jQuery( "document" ).ready(function() {
32
+
33
+ jQuery( '.cwp_save' ).on('click', function(){
34
+ var $btn = jQuery(this);
35
+ $btn.parent().find( '.spinner' ).addClass( 'is-active' );
36
+ $btn.addClass('disabled');
37
+ var form_data = jQuery( '#wppr-settings' ).serializeArray()
38
+ var data = {
39
+ 'action': 'update_options',
40
+ 'cwppos_options': form_data
41
+ };
42
+
43
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
44
+ jQuery.post(ajaxurl, data, function(response) {
45
+ $btn.parent().find( '.spinner' ).removeClass( 'is-active' );
46
+ $btn.removeClass('disabled');
47
+ });
48
+ });
49
+ });
assets/js/cwp-pointers.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+ (function ($, cwpp){
3
+
4
+ $( document ).ready( function() {
5
+
6
+ var timeout;
7
+
8
+ $( "#cwp_product_affiliate_link" ).on("keyup", function(e){
9
+ if ($( this ).val().indexOf( "amazon" ) != -1) {
10
+ $( "#wppr_product_affiliate_link_upsell" ).show();
11
+ timeout = setTimeout( function(){wppr_open_pointer( 0 );}, 1000 );
12
+ }
13
+ });
14
+
15
+ function wppr_open_pointer(i) {
16
+ pointer = cwpp.pointers.pointers[i];
17
+ options = $.extend( pointer.options, {
18
+ close: function() {
19
+ $.post( ajaxurl, {
20
+ pointer: pointer.pointer_id,
21
+ action: 'wppr-dismiss-amazon-link'
22
+ });
23
+ }
24
+ });
25
+
26
+ $( pointer.target ).pointer( options ).pointer( 'open' );
27
+ clearTimeout( timeout );
28
+ }
29
+ });
30
+ })(jQuery, cwpp)
{javascript → assets/js}/lightbox.min.js RENAMED
File without changes
{javascript → assets/js}/lightbox.min.map RENAMED
File without changes
assets/js/main.js ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+ /**
3
+ * Main JavaScript File
4
+ */
5
+ jQuery( document ).ready(function($) {
6
+
7
+ var initPieChart = function() {
8
+ returnColor = function(percent) {
9
+ if (percent > 0 && percent <= 25) {
10
+ return c1;
11
+ } else if (percent > 25 && percent <= 50) {
12
+ return c2;
13
+ } else if (percent > 50 && percent <= 75) {
14
+ return c3;
15
+ } else if (percent > 75) {
16
+ return c4;
17
+ }
18
+ };
19
+ if (typeof trackcolor != 'undefined') {
20
+ trackColorRight = trackcolor.toUpperCase();
21
+ } else {
22
+ trackColorRight = '#ebebeb';
23
+ }
24
+
25
+ p_image_width = $( '.review-wrap-up .rev-wu-image' ).width();
26
+ if (p_image_width == 0 || p_image_width == null) { p_image_width = 50;
27
+ }
28
+ $( '.cwp-review-percentage' ).cwp_easyPieChart({
29
+ barColor: function(percent) {
30
+ return returnColor( percent );
31
+ },
32
+ trackColor: trackColorRight,
33
+ scaleColor: false,
34
+ lineCap: 'butt',
35
+ rotate: 0,
36
+ lineWidth: 15 * Math.min( p_image_width,150 ) / 140,
37
+ animate: 1,
38
+ size : Math.min( p_image_width,150 ) * 0.8,
39
+ onStep: function(value) {
40
+ var c = returnColor( value );
41
+
42
+ this.$el.find( 'span' ).text( ~~value / 10 );
43
+ this.$el.find( 'span' ).css({
44
+ color: c
45
+ });
46
+ }
47
+ });
48
+ };
49
+
50
+ initPieChart();
51
+
52
+ function wuReview() {
53
+
54
+ if ( ! (typeof(cwpCustomBarIcon) === "undefined") && ! (cwpCustomBarIcon === "") && isSetToPro) {
55
+ $( ".rev-option" ).each(function() {
56
+ var grade = $( this ).attr( "data-value" );
57
+ $( this ).addClass( "customBarIcon" );
58
+ var x = 10;
59
+ if ($( this ).children( "ul" ).find( "li" ).length == 0) {
60
+ for (var i = 0; i < x; i++) {
61
+ $( this ).children( "ul" ).append( "<li><i class='fa fa-fw'>&" + cwpCustomBarIcon + "</i></li>" );
62
+ }
63
+ }
64
+ $( this ).children( "ul" ).children( "li:nth-child(-n+" + Math.ceil( grade / 10 ) + ")" ).css( "color", returnColor( grade ) );
65
+ $( this ).children( "div" ).children( "span" ).text( grade / 10 + "/10" );
66
+ });
67
+ } else {
68
+ $( ".rev-option" ).each(function() {
69
+ var grade = $( this ).attr( "data-value" );
70
+ var x = 10;
71
+ if ($( this ).children( "ul" ).find( "li" ).length == 0) {
72
+ for (var i = 0; i < x; i++) {
73
+ $( this ).children( "ul" ).append( "<li style='margin-right: 2%;'></li>" );
74
+ }
75
+ }
76
+ $( this ).children( "ul" ).children( "li:nth-child(-n+" + Math.ceil( grade / 10 ) + ")" ).css( "background", returnColor( grade ) );
77
+ $( this ).children( "div" ).children( "span" ).text( grade / 10 + "/10" );
78
+ });
79
+ }
80
+
81
+ }
82
+
83
+ $( ".comment-meta-option .comment-meta-grade" ).each(function() {
84
+ var theBarWidth = (100 * parseFloat( $( this ).css( 'width' ) ) / parseFloat( $( this ).parent().css( 'width' ) ));
85
+ $( this ).css( "background", returnColor( theBarWidth ) );
86
+ });
87
+
88
+ wuReview();
89
+
90
+ $( ".wppr-comment-meta-slider" ).each(function() {
91
+ var comm_meta_input = $( this ).parent( ".wppr-comment-form-meta" ).children( "input" );
92
+ $( this ).slider({
93
+ min: 0,
94
+ max: 100,
95
+ value: 4,
96
+ slide: function(event, ui) {
97
+ $( comm_meta_input ).val( ui.value / 10 );
98
+ }
99
+ });
100
+ });
101
+
102
+ });
assets/js/pie-chart.js ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+
3
+ /*
4
+
5
+ Easy pie chart is a jquery plugin to display simple animated pie charts for only one value
6
+
7
+
8
+
9
+ Dual licensed under the MIT (http:
10
+
11
+ and GPL (http:
12
+
13
+
14
+
15
+ Built on top of the jQuery library (http:
16
+
17
+
18
+
19
+ @source: http:
20
+
21
+ @autor: Robert Fleischmann
22
+
23
+ @version: 1.2.5
24
+
25
+
26
+
27
+ Inspired by: http:
28
+
29
+ Thanks to Philip Thrasher for the jquery plugin boilerplate for coffee script
30
+
31
+ */
32
+
33
+
34
+
35
+ (function($) {
36
+
37
+ $.cwp_easyPieChart = function(el, options) {
38
+
39
+ var addScaleLine, animateLine, drawLine, easeInOutQuad, rAF, renderBackground, renderScale, renderTrack,
40
+
41
+ _this = this;
42
+
43
+ this.el = el;
44
+
45
+ this.$el = $( el );
46
+
47
+ this.$el.data( "cwp_easyPieChart", this );
48
+
49
+ this.init = function() {
50
+
51
+ var percent, scaleBy;
52
+
53
+ _this.options = $.extend( {}, $.cwp_easyPieChart.defaultOptions, options );
54
+
55
+ percent = parseInt( _this.$el.data( 'percent' ), 10 );
56
+
57
+ _this.percentage = 0;
58
+
59
+ _this.canvas = $( "<canvas width='" + _this.options.size + "' height='" + _this.options.size + "'></canvas>" ).get( 0 );
60
+
61
+ _this.$el.append( _this.canvas );
62
+
63
+ if (typeof G_vmlCanvasManager !== "undefined" && G_vmlCanvasManager !== null) {
64
+
65
+ G_vmlCanvasManager.initElement( _this.canvas );
66
+
67
+ }
68
+
69
+ _this.ctx = _this.canvas.getContext( '2d' );
70
+
71
+ if (window.devicePixelRatio > 1) {
72
+
73
+ scaleBy = window.devicePixelRatio;
74
+
75
+ $( _this.canvas ).css({
76
+
77
+ width: _this.options.size,
78
+
79
+ height: _this.options.size
80
+
81
+ });
82
+
83
+ _this.canvas.width *= scaleBy;
84
+
85
+ _this.canvas.height *= scaleBy;
86
+
87
+ _this.ctx.scale( scaleBy, scaleBy );
88
+
89
+ _this.ctx.imageSmoothingEnabled = true;
90
+
91
+ }
92
+
93
+ _this.ctx.translate( _this.options.size / 2, _this.options.size / 2 );
94
+
95
+ _this.ctx.rotate( _this.options.rotate * Math.PI / 180 );
96
+
97
+ _this.$el.addClass( 'cwp_easyPieChart' );
98
+
99
+ _this.$el.css({
100
+
101
+ width: _this.options.size,
102
+
103
+ height: _this.options.size,
104
+
105
+ lineHeight: "" + _this.options.size + "px"
106
+
107
+ });
108
+
109
+ _this.update( percent );
110
+
111
+ return _this;
112
+
113
+ };
114
+
115
+ this.update = function(percent) {
116
+
117
+ percent = parseFloat( percent ) || 0;
118
+
119
+ if (_this.options.animate === false) {
120
+
121
+ drawLine( percent );
122
+
123
+ } else {
124
+
125
+ if (_this.options.delay) {
126
+
127
+ animateLine( _this.percentage, 0 );
128
+
129
+ setTimeout(function() {
130
+
131
+ return animateLine( _this.percentage, percent );
132
+
133
+ }, _this.options.delay);
134
+
135
+ } else {
136
+
137
+ animateLine( _this.percentage, percent );
138
+
139
+ }
140
+
141
+ }
142
+
143
+ return _this;
144
+
145
+ };
146
+
147
+ renderScale = function() {
148
+
149
+ var i, _i, _results;
150
+
151
+ _this.ctx.fillStyle = _this.options.scaleColor;
152
+
153
+ _this.ctx.lineWidth = 1;
154
+
155
+ _results = [];
156
+
157
+ for (i = _i = 0; _i <= 24; i = ++_i) {
158
+
159
+ _results.push( addScaleLine( i ) );
160
+
161
+ }
162
+
163
+ return _results;
164
+
165
+ };
166
+
167
+ addScaleLine = function(i) {
168
+
169
+ var offset;
170
+
171
+ offset = i % 6 === 0 ? 0 : _this.options.size * 0.017;
172
+
173
+ _this.ctx.save();
174
+
175
+ _this.ctx.rotate( i * Math.PI / 12 );
176
+
177
+ _this.ctx.fillRect( _this.options.size / 2 - offset, 0, -_this.options.size * 0.05 + offset, 1 );
178
+
179
+ _this.ctx.restore();
180
+
181
+ };
182
+
183
+ renderTrack = function() {
184
+
185
+ var offset;
186
+
187
+ offset = _this.options.size / 2 - _this.options.lineWidth / 2;
188
+
189
+ if (_this.options.scaleColor !== false) {
190
+
191
+ offset -= _this.options.size * 0.08;
192
+
193
+ }
194
+
195
+ _this.ctx.beginPath();
196
+
197
+ _this.ctx.arc( 0, 0, offset, 0, Math.PI * 2, true );
198
+
199
+ _this.ctx.closePath();
200
+
201
+ _this.ctx.strokeStyle = _this.options.trackColor;
202
+
203
+ _this.ctx.lineWidth = _this.options.lineWidth;
204
+
205
+ _this.ctx.stroke();
206
+
207
+ };
208
+
209
+ renderBackground = function() {
210
+
211
+ if (_this.options.scaleColor !== false) {
212
+
213
+ renderScale();
214
+
215
+ }
216
+
217
+ if (_this.options.trackColor !== false) {
218
+
219
+ renderTrack();
220
+
221
+ }
222
+
223
+ };
224
+
225
+ drawLine = function(percent) {
226
+
227
+ var offset;
228
+
229
+ renderBackground();
230
+
231
+ _this.ctx.strokeStyle = $.isFunction( _this.options.barColor ) ? _this.options.barColor( percent ) : _this.options.barColor;
232
+
233
+ _this.ctx.lineCap = _this.options.lineCap;
234
+
235
+ _this.ctx.lineWidth = _this.options.lineWidth;
236
+
237
+ offset = _this.options.size / 2 - _this.options.lineWidth / 2;
238
+
239
+ if (_this.options.scaleColor !== false) {
240
+
241
+ offset -= _this.options.size * 0.08;
242
+
243
+ }
244
+
245
+ _this.ctx.save();
246
+
247
+ _this.ctx.rotate( -Math.PI / 2 );
248
+
249
+ _this.ctx.beginPath();
250
+
251
+ _this.ctx.arc( 0, 0, offset, 0, Math.PI * 2 * percent / 100, false );
252
+
253
+ _this.ctx.stroke();
254
+
255
+ _this.ctx.restore();
256
+
257
+ };
258
+
259
+ rAF = (function() {
260
+
261
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
262
+
263
+ return window.setTimeout( callback, 1000 / 60 );
264
+
265
+ };
266
+
267
+ })();
268
+
269
+ animateLine = function(from, to) {
270
+
271
+ var anim, startTime;
272
+
273
+ _this.options.onStart.call( _this );
274
+
275
+ _this.percentage = to;
276
+
277
+ Date.now || (Date.now = function() {
278
+
279
+ return + (new Date);
280
+
281
+ });
282
+
283
+ startTime = Date.now();
284
+
285
+ anim = function() {
286
+
287
+ var currentValue, process;
288
+
289
+ process = Math.min( Date.now() - startTime, _this.options.animate );
290
+
291
+ _this.ctx.clearRect( -_this.options.size / 2, -_this.options.size / 2, _this.options.size, _this.options.size );
292
+
293
+ renderBackground.call( _this );
294
+
295
+ currentValue = [easeInOutQuad( process, from, to - from, _this.options.animate )];
296
+
297
+ _this.options.onStep.call( _this, currentValue );
298
+
299
+ drawLine.call( _this, currentValue );
300
+
301
+ if (process >= _this.options.animate) {
302
+
303
+ return _this.options.onStop.call( _this, currentValue, to );
304
+
305
+ } else {
306
+
307
+ return rAF( anim );
308
+
309
+ }
310
+
311
+ };
312
+
313
+ rAF( anim );
314
+
315
+ };
316
+
317
+ easeInOutQuad = function(t, b, c, d) {
318
+
319
+ var easeIn, easing;
320
+
321
+ easeIn = function(t) {
322
+
323
+ return Math.pow( t, 2 );
324
+
325
+ };
326
+
327
+ easing = function(t) {
328
+
329
+ if (t < 1) {
330
+
331
+ return easeIn( t );
332
+
333
+ } else {
334
+
335
+ return 2 - easeIn( (t / 2) * -2 + 2 );
336
+
337
+ }
338
+
339
+ };
340
+
341
+ t /= d / 2;
342
+
343
+ return c / 2 * easing( t ) + b;
344
+
345
+ };
346
+
347
+ return this.init();
348
+
349
+ };
350
+
351
+ $.cwp_easyPieChart.defaultOptions = {
352
+
353
+ barColor: '#ef1e25',
354
+
355
+ trackColor: '#f2f2f2',
356
+
357
+ scaleColor: '#dfe0e0',
358
+
359
+ lineCap: 'round',
360
+
361
+ rotate: 0,
362
+
363
+ size: 110,
364
+
365
+ lineWidth: 3,
366
+
367
+ animate: false,
368
+
369
+ delay: false,
370
+
371
+ onStart: $.noop,
372
+
373
+ onStop: $.noop,
374
+
375
+ onStep: $.noop
376
+
377
+ };
378
+
379
+ $.fn.cwp_easyPieChart = function(options) {
380
+
381
+ return $.each(this, function(i, el) {
382
+
383
+ var $el, instanceOptions;
384
+
385
+ $el = $( el );
386
+
387
+ if ( ! $el.data( 'cwp_easyPieChart' )) {
388
+
389
+ instanceOptions = $.extend( {}, options, $el.data() );
390
+
391
+ return $el.data( 'cwp_easyPieChart', new $.cwp_easyPieChart( el, instanceOptions ) );
392
+
393
+ }
394
+
395
+ });
396
+
397
+ };
398
+
399
+ return void 0;
400
+
401
+ })(jQuery);
assets/js/tipsy.js ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+ // tipsy, facebook style tooltips for jquery
3
+ // version 1.0.0a
4
+ // (c) 2008-2010 jason frame [jason@onehackoranother.com]
5
+ // released under the MIT license
6
+ (function($) {
7
+
8
+ function maybeCall(thing, ctx) {
9
+ return (typeof thing == 'function') ? (thing.call( ctx )) : thing;
10
+ };
11
+
12
+ function isElementInDOM(ele) {
13
+ while (ele = ele.parentNode) {
14
+ if (ele == document) { return true;
15
+ }
16
+ }
17
+ return false;
18
+ };
19
+
20
+ function Tipsy(element, options) {
21
+ this.$element = $( element );
22
+ this.options = options;
23
+ this.enabled = true;
24
+ this.fixTitle();
25
+ };
26
+
27
+ Tipsy.prototype = {
28
+ show: function() {
29
+ var title = this.getTitle();
30
+ if (title && this.enabled) {
31
+ var $tip = this.tip();
32
+
33
+ $tip.find( '.tipsy-inner' )[this.options.html ? 'html' : 'text'](title);
34
+ $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
35
+ $tip.remove().css( {top: 0, left: 0, visibility: 'hidden', display: 'block'} ).prependTo( document.body );
36
+
37
+ var pos = $.extend({}, this.$element.offset(), {
38
+ width: this.$element[0].offsetWidth,
39
+ height: this.$element[0].offsetHeight
40
+ });
41
+
42
+ var actualWidth = $tip[0].offsetWidth,
43
+ actualHeight = $tip[0].offsetHeight,
44
+ gravity = maybeCall( this.options.gravity, this.$element[0] );
45
+
46
+ var tp;
47
+ switch (gravity.charAt( 0 )) {
48
+ case 'n':
49
+ tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
50
+ break;
51
+ case 's':
52
+ tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
53
+ break;
54
+ case 'e':
55
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
56
+ break;
57
+ case 'w':
58
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
59
+ break;
60
+ }
61
+
62
+ if (gravity.length == 2) {
63
+ if (gravity.charAt( 1 ) == 'w') {
64
+ tp.left = pos.left + pos.width / 2 - 15;
65
+ } else {
66
+ tp.left = pos.left + pos.width / 2 - actualWidth + 15;
67
+ }
68
+ }
69
+
70
+ $tip.css( tp ).addClass( 'tipsy-' + gravity );
71
+ $tip.find( '.tipsy-arrow' )[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt( 0 );
72
+ if (this.options.className) {
73
+ $tip.addClass( maybeCall( this.options.className, this.$element[0] ) );
74
+ }
75
+
76
+ if (this.options.fade) {
77
+ $tip.stop().css( {opacity: 0, display: 'block', visibility: 'visible'} ).animate( {opacity: this.options.opacity} );
78
+ } else {
79
+ $tip.css( {visibility: 'visible', opacity: this.options.opacity} );
80
+ }
81
+ }// End if().
82
+ },
83
+
84
+ hide: function() {
85
+ if (this.options.fade) {
86
+ this.tip().stop().fadeOut( function() { $( this ).remove(); } );
87
+ } else {
88
+ this.tip().remove();
89
+ }
90
+ },
91
+
92
+ fixTitle: function() {
93
+ var $e = this.$element;
94
+ if ($e.attr( 'title' ) || typeof($e.attr( 'original-title' )) != 'string') {
95
+ $e.attr( 'original-title', $e.attr( 'title' ) || '' ).removeAttr( 'title' );
96
+ }
97
+ },
98
+
99
+ getTitle: function() {
100
+ var title, $e = this.$element, o = this.options;
101
+ this.fixTitle();
102
+ var title, o = this.options;
103
+ if (typeof o.title == 'string') {
104
+ title = $e.attr( o.title == 'title' ? 'original-title' : o.title );
105
+ } else if (typeof o.title == 'function') {
106
+ title = o.title.call( $e[0] );
107
+ }
108
+ title = ('' + title).replace( /(^\s*|\s*$)/, "" );
109
+ return title || o.fallback;
110
+ },
111
+
112
+ tip: function() {
113
+ if ( ! this.$tip) {
114
+ this.$tip = $( '<div class="tipsy"></div>' ).html( '<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>' );
115
+ this.$tip.data( 'tipsy-pointee', this.$element[0] );
116
+ }
117
+ return this.$tip;
118
+ },
119
+
120
+ validate: function() {
121
+ if ( ! this.$element[0].parentNode) {
122
+ this.hide();
123
+ this.$element = null;
124
+ this.options = null;
125
+ }
126
+ },
127
+
128
+ enable: function() { this.enabled = true; },
129
+ disable: function() { this.enabled = false; },
130
+ toggleEnabled: function() { this.enabled = ! this.enabled; }
131
+ };
132
+
133
+ $.fn.tipsy = function(options) {
134
+
135
+ if (options === true) {
136
+ return this.data( 'tipsy' );
137
+ } else if (typeof options == 'string') {
138
+ var tipsy = this.data( 'tipsy' );
139
+ if (tipsy) { tipsy[options]();
140
+ }
141
+ return this;
142
+ }
143
+
144
+ options = $.extend( {}, $.fn.tipsy.defaults, options );
145
+
146
+ function get(ele) {
147
+ var tipsy = $.data( ele, 'tipsy' );
148
+ if ( ! tipsy) {
149
+ tipsy = new Tipsy( ele, $.fn.tipsy.elementOptions( ele, options ) );
150
+ $.data( ele, 'tipsy', tipsy );
151
+ }
152
+ return tipsy;
153
+ }
154
+
155
+ function enter() {
156
+ var tipsy = get( this );
157
+ tipsy.hoverState = 'in';
158
+ if (options.delayIn == 0) {
159
+ tipsy.show();
160
+ } else {
161
+ tipsy.fixTitle();
162
+ setTimeout( function() { if (tipsy.hoverState == 'in') { tipsy.show();
163
+ } }, options.delayIn );
164
+ }
165
+ };
166
+
167
+ function leave() {
168
+ var tipsy = get( this );
169
+ tipsy.hoverState = 'out';
170
+ if (options.delayOut == 0) {
171
+ tipsy.hide();
172
+ } else {
173
+ setTimeout( function() { if (tipsy.hoverState == 'out') { tipsy.hide();
174
+ } }, options.delayOut );
175
+ }
176
+ };
177
+
178
+ if ( ! options.live) { this.each( function() { get( this ); } );
179
+ }
180
+
181
+ if (options.trigger != 'manual') {
182
+ var binder = options.live ? 'live' : 'bind',
183
+ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
184
+ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
185
+ this[binder](eventIn, enter)[binder](eventOut, leave);
186
+ }
187
+
188
+ return this;
189
+
190
+ };
191
+
192
+ $.fn.tipsy.defaults = {
193
+ className: null,
194
+ delayIn: 0,
195
+ delayOut: 0,
196
+ fade: false,
197
+ fallback: '',
198
+ gravity: 'n',
199
+ html: false,
200
+ live: false,
201
+ offset: 0,
202
+ opacity: 0.8,
203
+ title: 'title',
204
+ trigger: 'hover'
205
+ };
206
+
207
+ $.fn.tipsy.revalidate = function() {
208
+ $( '.tipsy' ).each(function() {
209
+ var pointee = $.data( this, 'tipsy-pointee' );
210
+ if ( ! pointee || ! isElementInDOM( pointee )) {
211
+ $( this ).remove();
212
+ }
213
+ });
214
+ };
215
+
216
+ // Overwrite this method to provide options on a per-element basis.
217
+ // For example, you could store the gravity in a 'tipsy-gravity' attribute:
218
+ // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
219
+ // (remember - do not modify 'options' in place!)
220
+ $.fn.tipsy.elementOptions = function(ele, options) {
221
+ return $.metadata ? $.extend( {}, options, $( ele ).metadata() ) : options;
222
+ };
223
+
224
+ $.fn.tipsy.autoNS = function() {
225
+ return $( this ).offset().top > ($( document ).scrollTop() + $( window ).height() / 2) ? 's' : 'n';
226
+ };
227
+
228
+ $.fn.tipsy.autoWE = function() {
229
+ return $( this ).offset().left > ($( document ).scrollLeft() + $( window ).width() / 2) ? 'e' : 'w';
230
+ };
231
+
232
+ /**
233
+ * yields a closure of the supplied parameters, producing a function that takes
234
+ * no arguments and is suitable for use as an autogravity function like so:
235
+ *
236
+ * @param margin (int) - distance from the viewable region edge that an
237
+ * element should be before setting its tooltip's gravity to be away
238
+ * from that edge.
239
+ * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
240
+ * if there are no viewable region edges effecting the tooltip's
241
+ * gravity. It will try to vary from this minimally, for example,
242
+ * if 'sw' is preferred and an element is near the right viewable
243
+ * region edge, but not the top edge, it will set the gravity for
244
+ * that element's tooltip to be 'se', preserving the southern
245
+ * component.
246
+ */
247
+ $.fn.tipsy.autoBounds = function(margin, prefer) {
248
+ return function() {
249
+ var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
250
+ boundTop = $( document ).scrollTop() + margin,
251
+ boundLeft = $( document ).scrollLeft() + margin,
252
+ $this = $( this );
253
+
254
+ if ($this.offset().top < boundTop) { dir.ns = 'n';
255
+ }
256
+ if ($this.offset().left < boundLeft) { dir.ew = 'w';
257
+ }
258
+ if ($( window ).width() + $( document ).scrollLeft() - $this.offset().left < margin) { dir.ew = 'e';
259
+ }
260
+ if ($( window ).height() + $( document ).scrollTop() - $this.offset().top < margin) { dir.ns = 's';
261
+ }
262
+
263
+ return dir.ns + (dir.ew ? dir.ew : '');
264
+ }
265
+ };
266
+
267
+ })(jQuery);
assets/js/widget-latest.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+ (function($, w){
3
+
4
+ $( document ).ready(function(){
5
+ if ($( ".widget" ).length > 0) {
6
+ $( ".widget" ).each(function(){
7
+ if ($( this ).attr( "id" ).indexOf( w.widgetName.toLowerCase() ) != -1) {
8
+ toggleCustomFields( true, $( this ).attr( "id" ) );
9
+ }
10
+ });
11
+ } else {
12
+ toggleCustomFields( true, "wpcontent" );
13
+ }
14
+ });
15
+
16
+ function toggleCustomFields(deflt, widgetID){
17
+ var val = getWidgetStyle( widgetID );
18
+ if (val == "default.php") {
19
+ $( "#" + widgetID ).find( ".wppr-customField" ).hide();
20
+ } else {
21
+ $( "#" + widgetID ).find( ".wppr-customField" ).show();
22
+ if ( ! deflt) { $( "#" + widgetID ).find( "#" + w.imageCheckbox ).prop( "checked", true );
23
+ }
24
+ }
25
+
26
+ addListeners( widgetID );
27
+ }
28
+
29
+ $( document ).on('widget-updated widget-added', function(e, w){
30
+ toggleCustomFields( true, w[0]["id"] );
31
+ });
32
+
33
+ function addListeners(widgetID){
34
+ $( "#" + widgetID ).find( "input.wppr-stylestyle" ).on("click", function(e){
35
+ toggleCustomFields( false, widgetID );
36
+ });
37
+ $( "#" + widgetID ).find( "label.wppr-stylestyle" ).hover(function(e){
38
+ $( "#" + $( this ).attr( "for" ) + "img" ).show();
39
+ $( "#" + $( this ).attr( "for" ) + "img" ).css('position','absolute');
40
+ $( "#" + $( this ).attr( "for" ) + "img" ).css('width','100%');
41
+ }, function(e){
42
+ $( "#" + $( this ).attr( "for" ) + "img" ).hide();
43
+ });
44
+ }
45
+
46
+ function getWidgetStyle(id){
47
+ var name = $( "#" + id ).find( "input:radio.wppr-stylestyle" ).attr( "name" );
48
+ return $( "input:radio[name='" + name + "']:checked" ).val();
49
+ }
50
+
51
+ })(jQuery, wppr_widget_localized_data);
assets/js/widget-top.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jshint ignore:start */
2
+ (function($, w){
3
+
4
+ $( document ).ready(function(){
5
+ if ($( ".widget" ).length > 0) {
6
+ $( ".widget" ).each(function(){
7
+ if ($( this ).attr( "id" ).indexOf( w.widgetName.toLowerCase() ) != -1) {
8
+ toggleCustomFields( true, $( this ).attr( "id" ) );
9
+ }
10
+ });
11
+ } else {
12
+ toggleCustomFields( true, "wpcontent" );
13
+ }
14
+ });
15
+
16
+ function toggleCustomFields(deflt, widgetID){
17
+ var val = getWidgetStyle( widgetID );
18
+ if (val == "default.php") {
19
+ $( "#" + widgetID ).find( ".wppr-customField" ).hide();
20
+ } else {
21
+ $( "#" + widgetID ).find( ".wppr-customField" ).show();
22
+ if ( ! deflt) { $( "#" + widgetID ).find( "#" + w.imageCheckbox ).prop( "checked", true );
23
+ }
24
+ }
25
+
26
+ addListeners( widgetID );
27
+ }
28
+
29
+ $( document ).on('widget-updated widget-added', function(e, w){
30
+ toggleCustomFields( true, w[0]["id"] );
31
+ });
32
+
33
+ function addListeners(widgetID){
34
+ $( "#" + widgetID ).find( "input.wppr-stylestyle" ).on("click", function(e){
35
+ toggleCustomFields( false, widgetID );
36
+ });
37
+ $( "#" + widgetID ).find( "label.wppr-stylestyle" ).hover(function(e){
38
+ $( "#" + $( this ).attr( "for" ) + "img" ).show();
39
+ $( "#" + $( this ).attr( "for" ) + "img" ).css('position','absolute');
40
+ $( "#" + $( this ).attr( "for" ) + "img" ).css('width','100%');
41
+ }, function(e){
42
+ $( "#" + $( this ).attr( "for" ) + "img" ).hide();
43
+ });
44
+ }
45
+
46
+ function getWidgetStyle(id){
47
+ var name = $( "#" + id ).find( "input:radio.wppr-stylestyle" ).attr( "name" );
48
+ return $( "input:radio[name='" + name + "']:checked" ).val();
49
+ }
50
+
51
+ })(jQuery, wppr_widget_localized_data);
class-wppr-autoloader.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The file that defines autoload class
4
+ *
5
+ * A simple autoloader that loads class files recursively starting in the directory
6
+ * where this class resides. Additional options can be provided to control the naming
7
+ * convention of the class files.
8
+ *
9
+ * @link https://themeisle.com
10
+ * @copyright Copyright (c) 2017, Bogdan Preda
11
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
12
+ *
13
+ * @since 1.0.0
14
+ * @package WPPR
15
+ */
16
+
17
+ /**
18
+ * The WPPR_Autoloader class.
19
+ *
20
+ * @since 3.0.0
21
+ * @package WPPR
22
+ * @author Themeisle <friends@themeisle.com>
23
+ */
24
+ class WPPR_Autoloader {
25
+
26
+ /**
27
+ * File extension as a string. Defaults to ".php".
28
+ *
29
+ * @since 3.0.0
30
+ * @access protected
31
+ * @var string $file_ext The file extension to look for.
32
+ */
33
+ protected static $file_ext = '.php';
34
+
35
+ /**
36
+ * The top level directory where recursion will begin. Defaults to the current
37
+ * directory.
38
+ *
39
+ * @since 3.0.0
40
+ * @access protected
41
+ * @var string $path_top The root directory.
42
+ */
43
+ protected static $path_top = __DIR__;
44
+
45
+ /**
46
+ * Holds an array of namespaces to filter in autoloading if set.
47
+ *
48
+ * @since 3.0.0
49
+ * @access protected
50
+ * @var array $namespaces The namespace array, used if not empty on autoloading.
51
+ */
52
+ protected static $namespaces = array();
53
+
54
+ /**
55
+ * An array of files to exclude when looking to autoload.
56
+ *
57
+ * @since 3.0.0
58
+ * @access protected
59
+ * @var array $excluded_files The excluded files list.
60
+ */
61
+ protected static $excluded_files = array();
62
+
63
+ /**
64
+ * A placeholder to hold the file iterator so that directory traversal is only
65
+ * performed once.
66
+ *
67
+ * @since 3.0.0
68
+ * @access protected
69
+ * @var RecursiveIteratorIterator $file_iterator Holds an instance of the iterator class.
70
+ */
71
+ protected static $file_iterator = null;
72
+
73
+ /**
74
+ * Method to check in allowed namespaces.
75
+ *
76
+ * @since 3.0.0
77
+ * @access protected
78
+ * @param string $class_name the class name to check with the namespaces.
79
+ * @return bool
80
+ */
81
+ protected static function check_namespaces( $class_name ) {
82
+ $found = false;
83
+ foreach ( static::$namespaces as $namespace ) {
84
+ if ( substr( $class_name, 0, strlen( $namespace ) ) == $namespace ) {
85
+ $found = true;
86
+ }
87
+ }
88
+ return $found;
89
+ }
90
+
91
+ /**
92
+ * Autoload function for registration with spl_autoload_register
93
+ *
94
+ * Looks recursively through project directory and loads class files based on
95
+ * filename match.
96
+ *
97
+ * @since 3.0.0
98
+ * @access public
99
+ * @param string $class_name The class name requested.
100
+ * @return mixed
101
+ */
102
+ public static function loader( $class_name ) {
103
+
104
+ if ( ! empty( static::$namespaces ) ) {
105
+ $found = static::check_namespaces( $class_name );
106
+ if ( ! $found ) {
107
+ return $found;
108
+ }
109
+ }
110
+
111
+ $directory = new RecursiveDirectoryIterator( static::$path_top . DIRECTORY_SEPARATOR . 'includes', RecursiveDirectoryIterator::SKIP_DOTS );
112
+
113
+ if ( is_null( static::$file_iterator ) ) {
114
+ $Iterator = new RecursiveIteratorIterator( $directory );
115
+ $Regex = new RegexIterator( $Iterator, '/^.+\.php$/i', RecursiveRegexIterator::MATCH );
116
+ static::$file_iterator = iterator_to_array( $Regex, false );
117
+ }
118
+
119
+ $filename = 'class-' . str_replace( '_', '-', strtolower( $class_name ) ) . static::$file_ext;
120
+ foreach ( static::$file_iterator as $file ) {
121
+ if ( strtolower( $file->getFileName() ) === strtolower( $filename ) && is_readable( $file->getPathName() ) ) {
122
+ require( $file->getPathName() );
123
+ return true;
124
+ }
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Sets the $file_ext property
130
+ *
131
+ * @since 3.0.0
132
+ * @access public
133
+ * @param string $file_ext The file extension used for class files. Default is "php".
134
+ */
135
+ public static function set_file_ext( $file_ext ) {
136
+ static::$file_ext = $file_ext;
137
+ }
138
+
139
+ /**
140
+ * Sets the $plugins_path property
141
+ *
142
+ * @since 3.0.0
143
+ * @access public
144
+ * @param string $path The path representing the top level where recursion should
145
+ * begin for plugins. Defaults to empty ( does not look in plugins ).
146
+ */
147
+ public static function set_plugins_path( $path ) {
148
+ static::$plugins_path = $path;
149
+ }
150
+
151
+ /**
152
+ * Sets the $path property
153
+ *
154
+ * @since 3.0.0
155
+ * @access public
156
+ * @param string $path The path representing the top level where recursion should
157
+ * begin. Defaults to the current directory.
158
+ */
159
+ public static function set_path( $path ) {
160
+ static::$path_top = $path;
161
+ }
162
+
163
+ /**
164
+ * Adds a new file to the exclusion list.
165
+ *
166
+ * @since 3.0.0
167
+ * @access public
168
+ * @param string $file_name The file name to exclude from autoload.
169
+ */
170
+ public static function exclude_file( $file_name ) {
171
+ static::$excluded_files[] = $file_name;
172
+ }
173
+
174
+ /**
175
+ * Sets the namespaces used in autoloading if any.
176
+ *
177
+ * @since 3.0.0
178
+ * @access public
179
+ * @param array $namespaces The namespaces to use.
180
+ */
181
+ public static function define_namespaces( $namespaces = array() ) {
182
+ static::$namespaces = $namespaces;
183
+ }
184
+ }
css/cwppos-widget-rating.css DELETED
@@ -1,34 +0,0 @@
1
- .wppr-prodlist .wppr-rating {
2
-
3
- height: 16px;
4
-
5
- width: 80px;
6
-
7
- margin: 0;
8
-
9
- display: block;
10
-
11
- background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFRoZSBpY29uIGNhbiBiZSB1c2VkIGZyZWVseSBpbiBib3RoIHBlcnNvbmFsIGFuZCBjb21tZXJjaWFsIHByb2plY3RzIHdpdGggbm8gYXR0cmlidXRpb24gcmVxdWlyZWQsIGJ1dCBhbHdheXMgYXBwcmVjaWF0ZWQuIFlvdSBtYXkgTk9UIHN1Yi1saWNlbnNlLCByZXNlbGwsIHJlbnQsIHJlZGlzdHJpYnV0ZSBvciBvdGhlcndpc2UgdHJhbnNmZXIgdGhlIGljb24gd2l0aG91dCBleHByZXNzIHdyaXR0ZW4gcGVybWlzc2lvbiBmcm9tIGljb25tb25zdHIuY29tIC0tPjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Igkgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gaWQ9InN0YXItaWNvbiIgZmlsbD0iI0Q5RDlEOSIgcG9pbnRzPSIyNTYsNjAuMDgyIDMwNC42MywyMDkuNzUgNDYyLDIwOS43NSAzMzQuNjg2LDMwMi4yNSAzODMuMzE1LDQ1MS45MTggMjU2LDM1OS40MTggMTI4LjY4NSw0NTEuOTE4IAkxNzcuMzE1LDMwMi4yNSA1MCwyMDkuNzUgMjA3LjM3LDIwOS43NSAiLz48L3N2Zz4=);
12
-
13
- background-size: contain;
14
-
15
- }
16
-
17
-
18
-
19
- .wppr-prodlist .wppr-rating div{
20
-
21
- background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFRoZSBpY29uIGNhbiBiZSB1c2VkIGZyZWVseSBpbiBib3RoIHBlcnNvbmFsIGFuZCBjb21tZXJjaWFsIHByb2plY3RzIHdpdGggbm8gYXR0cmlidXRpb24gcmVxdWlyZWQsIGJ1dCBhbHdheXMgYXBwcmVjaWF0ZWQuIFlvdSBtYXkgTk9UIHN1Yi1saWNlbnNlLCByZXNlbGwsIHJlbnQsIHJlZGlzdHJpYnV0ZSBvciBvdGhlcndpc2UgdHJhbnNmZXIgdGhlIGljb24gd2l0aG91dCBleHByZXNzIHdyaXR0ZW4gcGVybWlzc2lvbiBmcm9tIGljb25tb25zdHIuY29tIC0tPjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB2ZXJzaW9uPSIxLjEiIGZpbGw9IiNGRjdFMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Igkgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4IiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNTEyIDUxMiIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBvbHlnb24gaWQ9InN0YXItaWNvbiIgcG9pbnRzPSIyNTYsNjAuMDgyIDMwNC42MywyMDkuNzUgNDYyLDIwOS43NSAzMzQuNjg2LDMwMi4yNSAzODMuMzE1LDQ1MS45MTggMjU2LDM1OS40MTggMTI4LjY4NSw0NTEuOTE4IAkxNzcuMzE1LDMwMi4yNSA1MCwyMDkuNzUgMjA3LjM3LDIwOS43NSAiLz48L3N2Zz4=);
22
-
23
- background-size: contain;
24
-
25
- height: 16px;
26
-
27
- display: block;
28
-
29
- max-width: 100%;
30
-
31
- text-indent: 100%;
32
- white-space: nowrap;
33
- overflow: hidden;
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cwppos-widget-style1.css DELETED
@@ -1,56 +0,0 @@
1
- .wppr-prodlist .wppr-prodrow { padding: 20px 0px; width: 100%;}
2
- .wppr-prodlist .wppr-prodrow .wppr-prodrowleft {width: 30%; float: left;}
3
- .wppr-prodlist .wppr-prodrow .wppr-prodrowright {float: left;}
4
- .wppr-prodlist .wppr-prodrow .wppr-prodrowrightadjust {width: 65%;}
5
- .wppr-prodlist .wppr-prodrow .wppr-prodrowright .wppr-rating {margin-top:5px;}
6
- .wppr-prodlist .wppr-prodrow .wppr-prodrowright p {margin: 0px 0px 0px 0px; line-height: 18px;}
7
- .clear {clear: both;}
8
-
9
- .cwp-review-chart.relative {position: relative;}
10
- .cwp-review-chart.absolute {position: absolute;}
11
-
12
- .wppr-prodlist .wppr-prodrow .wppr-prodrowright .wppr-bttn:first-child{
13
- margin-right: 10px;
14
- }
15
- .wppr-prodlist .wppr-prodrow .wppr-prodrowright p.wppr-style1-buttons{
16
- margin-top:10px;
17
- height: 32px;
18
- overflow: hidden;
19
- display: block;
20
- }
21
- .wppr-prodlist .wppr-prodrow .wppr-prodrowright .wppr-bttn{
22
-
23
- font-family: "Helvetica Neue", HelveticaNeue, Helvetica, Lato, Arial, sans-serif;
24
- border-radius: 3px;
25
- padding: 6px 9px;
26
- background-color: #3baeda;
27
-
28
- line-height: 36px;
29
-
30
- font-size: 12px;
31
-
32
- font-weight: bold;
33
-
34
-
35
- color: #fff !important;
36
-
37
- text-transform: uppercase;
38
-
39
- text-decoration: none;
40
-
41
- white-space: nowrap;
42
-
43
- -webkit-transition: all 0.5s ease;
44
-
45
- transition: all 0.5s ease;
46
-
47
-
48
- }
49
-
50
-
51
-
52
- .wppr-prodlist .wppr-prodrow .wppr-prodrowright .bttn:hover{
53
-
54
- opacity: 0.8;
55
-
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/cwppos-widget.css DELETED
@@ -1,75 +0,0 @@
1
- /* Sidebar Popular Reviews Widget */
2
-
3
- .cwp-popular-review { position: relative; border-bottom: 1px solid #ddd; margin: 0; padding: 15px 0 !important;}
4
-
5
- .cwp-popular-review .cwp-review-chart canvas, .cwp-popular-review .cwp-review-chart span { width: 40px!important; height: 40px!important; line-height: 2.3; }
6
- .cwp-popular-review .cwp-review-chart .cwp-review-percentage { top: -1px; left: -1px; width:40px!important;height: 40px !important; }
7
- .cwp-popular-review .cwp-review-chart { border: 0 solid #fff; width: 40px; height: 40px; top: 56%; margin-top: -22px; }
8
- /* Review Pie Chart Styles */
9
- .cwp-review-chart { float: left;
10
- margin: 10px 0 10px 10px;
11
- position: absolute;top: 0;right: 0; border: 3px solid #fff; border-radius: 50%;}
12
- .cwp-review-percentage span { font-family: "Lato"; font-size: 17px; font-weight: 900; background: #fff; display: block;border-radius: 50%; }
13
- .cwp_easyPieChart { position: relative; text-align: center; }
14
- .cwp_easyPieChart canvas { position: absolute; top: 0; left: 0; }
15
- .cwp-popular-review .cwp_easyPieChart span { text-align:center; }
16
- .cwp-popular-review:before {
17
- content:""!important;
18
- }
19
-
20
- .cwp-popular-review .cwp_rev_image {
21
- margin-right:10px;
22
- border-radius: 3px;
23
- max-width: 50px!important;
24
- max-height: 50px!important;
25
- vertical-align: middle;
26
- }
27
-
28
- .widget_cwp_top_products_widget ul, .widget_cwp_latest_products_widget ul {
29
- margin-left:0 !important;
30
- padding-left:0 !important;
31
- }
32
-
33
- .widget_cwp_top_products_widget li, .widget_cwp_latest_products_widget li {
34
- margin-left:0 !important;
35
- list-style:none!important;
36
- background-image:none;
37
- }
38
-
39
- .widget_cwp_top_products_widget li a, .widget_cwp_latest_products_widget li a{
40
- border:none!important;
41
- padding:0 !important;
42
- }
43
- .wppr-cols-2 > div.wppr-col,
44
- .wppr-cols-3 > div.wppr-col{
45
- width:15%;
46
- }
47
- .wppr-cols-2 > a.wppr-col,
48
- .wppr-cols-3 > a.wppr-col{
49
- width:66%;
50
- text-overflow: ellipsis;
51
- overflow: hidden;
52
- white-space: nowrap;;
53
- }
54
- .wppr-cols-3 a.wppr-col{
55
- position: relative;
56
- top: 40%;
57
- -webkit-transform: translateY(40%);
58
- -ms-transform: translateY(40%);
59
- transform: translateY(40%);
60
- margin-right:-60px;
61
- }
62
- .wppr-cols-2 .wppr-col,
63
- .wppr-cols-3 .wppr-col{
64
- float:left;
65
- }
66
- .wppr-cols-3:after,
67
- .wppr-cols-2:after {
68
- content: "";
69
- display: table;
70
- clear: both;
71
- position: relative !important;
72
- }
73
- .widget_cwp_top_products_widget{
74
- overflow:hidden;
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/dashboard_styles.css DELETED
@@ -1,418 +0,0 @@
1
- /* #Clearing
2
-
3
- ================================================== */
4
- /* Self Clearing Goodness
5
- .preload_result, #cwp_review_meta_box,#cwp_container,.cwp_addons_wrap{*/
6
-
7
- /* <div class="rowf1f1f1*/
8
- .cwpr_clearfix:before, .cwpr_clearfix:after {
9
- content: '\0020';
10
- display: block;
11
- overflow: hidden;
12
- visibility: hidden;
13
- width: 0;
14
- height: 0
15
- }
16
-
17
- .cwpr_clearfix:after {
18
- clear: both
19
- }
20
-
21
- .cwpr_clearfix {
22
- zoom: 1
23
- }
24
-
25
-
26
- .product-review-meta-Yes .review-settings-notice {
27
- display: block !important
28
- }
29
-
30
- .isReviewYes {
31
-
32
- }
33
-
34
- .product-review-meta-Yes .review-settings-group {
35
- display: block !important
36
- }
37
- .product-review-meta-No{
38
- display:none;
39
- }
40
-
41
- .preloadInfo {
42
- width: 89%
43
- }
44
-
45
- .review-settings-notice h4 {
46
- margin: 0 !important
47
- }
48
-
49
- .review-settings-group .review-settings-group-option {
50
- margin: 5px 0
51
- }
52
-
53
- .review-settings-group input {
54
- padding: 4px
55
- }
56
-
57
- .review-settings-notice {
58
- background: #fff;
59
- border: 1px solid #ddd;
60
- padding: 5px 10px;
61
- border-radius: 3px 3px 0 0
62
- }
63
-
64
- .review-settings-group {
65
- padding: 10px;
66
- border: 1px solid #ddd;
67
- background: #fff;
68
- border-top: none;
69
- border-radius: 0 0 3px 3px;
70
- margin-bottom: 5px
71
- }
72
-
73
- .review-settings-group label.option_label {
74
- display: block;
75
- float: left;
76
- background: #e7e7e7;
77
- padding: 4.5px 7px;
78
- margin: 1px -1px 1px 1px;
79
- border-radius: 3px 0 0 3px;
80
- font-weight: 700
81
- }
82
-
83
- .review-settings-group .option_grade {
84
- width: 55px;
85
- text-align: center;
86
- border-radius: 0 3px 3px 0;
87
- margin-left: -3px;
88
- border-left: none
89
- }
90
-
91
- .review-settings-group .option_content {
92
- border-radius: 3px 0 0 3px;
93
- margin-right: 0
94
- }
95
-
96
- .review-settings-group #option_overall_score {
97
- width: 50px;
98
- border-radius: 0 3px 3px 0
99
- }
100
-
101
- .review-settings-group ul li label {
102
- display: block;
103
- float: left;
104
- width: 140px;
105
- line-height: 2.3;
106
- font-weight: 700
107
- }
108
-
109
- .review-settings-group ul li input {
110
- width: 200px
111
- }
112
-
113
- .cwp_image_link label {
114
- display: inline !important;
115
- float: none !important;
116
- }
117
-
118
- .review-settings-group ul li input[type=radio] {
119
- width: 10px
120
- }
121
-
122
- img.theme_options_logo {
123
- margin-top: -5px;
124
- margin-right: 20px
125
- }
126
-
127
- .preload_result {
128
- position: absolute;
129
- top: 0 !important;
130
- left: 0;
131
- right: 0;
132
- bottom: 0 !important;
133
- background: rgba(0, 0, 0, 0.3);
134
- z-index: 9999 !important;
135
- display: none
136
- }
137
-
138
- .preload_result .preload_inner {
139
- position: fixed;
140
- background: #fff;
141
- min-width: 600px;
142
- height: 500px;
143
- top: 50%;
144
- margin-top: -250px;
145
- left: 50%;
146
- margin-left: -300px;
147
- -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
148
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3)
149
- }
150
-
151
- .preload_result .preload_inner > header {
152
- border-bottom: 1px solid #ddd;
153
- padding: 10px 20px;
154
- position: relative
155
- }
156
-
157
- .preload_result .preload_inner > header h2 {
158
- margin: 0;
159
- line-height: 1;
160
- padding: 10px 0
161
- }
162
-
163
- .preload_result .preload_inner .preload_close {
164
- position: absolute;
165
- top: 20px;
166
- right: 20px;
167
- background: #ddd;
168
- width: 20px;
169
- height: 20px;
170
- border-radius: 5px
171
- }
172
-
173
- .preload_result .preload_inner .preload_close:before {
174
- font: 400 20px/1 dashicons !important;
175
- content: "\f158"
176
- }
177
-
178
- .preload_result .preload_inner .preload_close:hover {
179
- cursor: pointer;
180
- opacity: .5
181
- }
182
-
183
- .preload_result .ajax_load_icon {
184
- position: absolute;
185
- width: 40px;
186
- height: 40px;
187
- top: 50%;
188
- left: 50%;
189
- margin-left: -20px;
190
- margin-top: -20px
191
- }
192
-
193
- .preload_result .preload_list {
194
- overflow-y: scroll;
195
- height: 400px
196
- }
197
-
198
- .preload_result .preload_list .cwp_preloaded_item {
199
- width: 98%;
200
- border-bottom: 1px solid #ddd;
201
- padding: 5px;
202
- margin: 0 2% 0 0;
203
- }
204
-
205
- .preload_result .preload_list .cwp_preloaded_item:first-child {
206
- border-top: 1px solid #ddd
207
- }
208
-
209
- .preload_result .preload_list .cwp_preloaded_item header .cwp_p_title {
210
- float: left;
211
- width: 80%;
212
- margin: 0;
213
- padding: 0;
214
- font-size: 13px;
215
- line-height: 2
216
- }
217
-
218
- .preload_result .preload_list .cwp_preloaded_item header .cwp_p_title:hover {
219
- cursor: pointer;
220
- color: #2ea1cd
221
- }
222
-
223
- .preload_result .preload_list .cwp_preloaded_item header .cwp_p_title:before {
224
- font: 400 13px/1 dashicons !important;
225
- content: "\f139";
226
- color: #ddd
227
- }
228
-
229
- .preload_result .preload_list .cwp_preloaded_item header button.preload {
230
- width: 5%;
231
- float: right;
232
- margin: 0;
233
- background-color: #7fbf4d;
234
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7fbf4d), color-stop(100%, #63a62f));
235
- background-image: -webkit-linear-gradient(top, #7fbf4d, #63a62f);
236
- background-image: -webkit-gradient(linear, left top, left bottom, from(#7fbf4d), to(#63a62f));
237
- background-image: linear-gradient(top, #7fbf4d, #63a62f);
238
- border: 1px solid #63a62f;
239
- border-bottom: 1px solid #5b992b;
240
- border-radius: 3px;
241
- -webkit-box-shadow: inset 0 1px 0 0 #96ca6d;
242
- box-shadow: inset 0 1px 0 0 #96ca6d;
243
- color: #fff;
244
- font: bold 20px/1;
245
- padding: 3px 0 5px;
246
- text-align: center;
247
- text-shadow: 0 -1px 0 #4c9021
248
- }
249
-
250
- .preload_result .preload_list .cwp_preloaded_item header button.preload:hover {
251
- background-color: #76b347;
252
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76b347), color-stop(100%, #5e9e2e));
253
- background-image: -webkit-linear-gradient(top, #76b347, #5e9e2e);
254
- background-image: -webkit-gradient(linear, left top, left bottom, from(#76b347), to(#5e9e2e));
255
- background-image: linear-gradient(top, #76b347, #5e9e2e);
256
- -webkit-box-shadow: inset 0 1px 0 0 #8dbf67;
257
- box-shadow: inset 0 1px 0 0 #8dbf67;
258
- cursor: pointer
259
- }
260
-
261
- .preload_result .cwp_preloaded_item .cwp_pitem_info {
262
- float: left;
263
- width: 100%;
264
- margin-top: 5px;
265
- display: none
266
- }
267
-
268
- .preload_result .cwp_preloaded_item .cwp_pitem_info ul {
269
- width: 30.66%;
270
- float: left;
271
- margin: 0 4% 10px 0;
272
- }
273
-
274
- .preload_result .cwp_preloaded_item .cwp_pitem_info ul:last-of-type {
275
- margin-right: 0 !important
276
- }
277
-
278
- .preload_result .cwp_preloaded_item .cwp_pitem_info ul li {
279
- border: 1px solid #f1f1f1;
280
- border-bottom: none;
281
- font-size: 10px;
282
- padding-left: 10px;
283
- -webkit-transition: all .2s ease-in-out;
284
- transition: all .2s ease-in-out
285
- }
286
-
287
- .preload_result .cwp_preloaded_item .cwp_pitem_info ul li:hover {
288
- background: #7fbf4d;
289
- color: #fff;
290
- cursor: pointer
291
- }
292
-
293
- .preload_result .cwp_preloaded_item .cwp_pitem_info ul li:last-of-type {
294
- border-bottom: 1px solid #f1f1f1
295
- }
296
-
297
- .preload_result .cwp_preloaded_item .cwp_pitem_info ul li, .preload_result .cwp_preloaded_item .cwp_pitem_info ul h4 {
298
- margin: 0
299
- }
300
-
301
- .preload_result .cwp_preloaded_item .cwp_pitem_info ul h4 {
302
- margin: 0;
303
- text-align: center;
304
- background: #f1f1f1;
305
- padding: 3px 0;
306
- border-radius: 3px 3px 0 0
307
- }
308
-
309
- a.preload_info, a.preload_info_upsell {
310
- background-color: #7fbf4d;
311
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #7fbf4d), color-stop(100%, #63a62f));
312
- background-image: -webkit-linear-gradient(top, #7fbf4d, #63a62f);
313
- background-image: -webkit-gradient(linear, left top, left bottom, from(#7fbf4d), to(#63a62f));
314
- background-image: linear-gradient(top, #7fbf4d, #63a62f);
315
- border: 1px solid #63a62f;
316
- border-bottom: 1px solid #5b992b;
317
- border-radius: 3px;
318
- -webkit-box-shadow: inset 0 1px 0 0 #96ca6d;
319
- box-shadow: inset 0 1px 0 0 #96ca6d;
320
- color: #fff;
321
- font: bold 20px/1;
322
- text-align: center;
323
- text-shadow: 0 -1px 0 #4c9021;
324
- text-decoration: none;
325
- float: right;
326
- margin-top: -14px;
327
- padding: 5px 10px
328
- }
329
-
330
- a.preload_info:hover, a.preload_info_upsell:hover {
331
- background-color: #76b347;
332
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #76b347), color-stop(100%, #5e9e2e));
333
- background-image: -webkit-linear-gradient(top, #76b347, #5e9e2e);
334
- background-image: -webkit-gradient(linear, left top, left bottom, from(#76b347), to(#5e9e2e));
335
- background-image: linear-gradient(top, #76b347, #5e9e2e);
336
- -webkit-box-shadow: inset 0 1px 0 0 #8dbf67;
337
- box-shadow: inset 0 1px 0 0 #8dbf67;
338
- cursor: pointer
339
- }
340
-
341
- /**
342
- * Custom Icon
343
- */
344
- #bar-icon-elements {
345
- display: none
346
- }
347
-
348
- #bar-icon-elements.active {
349
- display: block;
350
- position: fixed;
351
- background: #fff;
352
- border-radius: 3px;
353
- width: 400px;
354
- height: 200px;
355
- top: 10%;
356
- left: 50%;
357
- margin-left: -200px;
358
- padding: 20px;
359
- -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
360
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
361
- }
362
-
363
- #bar-icon-elements i, .current_bar_icon i {
364
- display: inline-block;
365
- font-size: 15px;
366
- margin: 3px;
367
- border: 1px solid #ddd;
368
- border-radius: 3px;
369
- width: 25px;
370
- height: 25px;
371
- line-height: 26px;
372
- color: #858585
373
- }
374
-
375
- #bar-icon-elements i:hover {
376
- cursor: pointer;
377
- border: 1px solid #ff9300;
378
- color: #ff9300
379
- }
380
-
381
- #bar-icon-elements .closeModal {
382
- position: absolute;
383
- top: -10px;
384
- right: -10px
385
- }
386
-
387
- #bar-icon-elements .closeModal:hover i, #bar-icon-elements i.active {
388
- background: #ff9300;
389
- color: #fff
390
- }
391
-
392
- #bar-icon-elements .closeModal i {
393
- line-height: 25px;
394
- border: none;
395
- background: #000;
396
- color: #fff;
397
- text-align: center;
398
- border-radius: 50%
399
- }
400
-
401
- #tab-general_settings li {
402
- list-style: none;
403
- margin-left: 0;
404
- padding: 0;
405
- }
406
-
407
- #cwp_add_button{
408
- font-size:20px;
409
- text-decoration: none;
410
- margin-left:5px;
411
- }
412
- .cwp_hide_button2 {
413
- display:none;
414
- }
415
- .cwp_proscons {
416
- display:inline-block;
417
- width:49.8%;
418
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/jquery-ui.css DELETED
@@ -1 +0,0 @@
1
- /*! jQuery UI - v1.10.3 - 2013-05-03
2
- ---------------------------------*/
3
- ---------------------------------*/
4
- ---------------------------------*/
5
- ---------------------------------*/
6
- ---------------------------------*/
7
- ---------------------------------*/
8
- ---------------------------------*/
9
- ---------------------------------*/
10
- ---------------------------------*/
 
 
 
 
 
 
 
 
 
 
css/lightbox.css DELETED
@@ -1,192 +0,0 @@
1
- /* Preload images */
2
- body:after {
3
- content: url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png);
4
- display: none;
5
- }
6
-
7
- .lightboxOverlay {
8
- position: absolute;
9
- top: 0;
10
- left: 0;
11
- z-index: 9999;
12
- background-color: black;
13
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
14
- opacity: 0.8;
15
- display: none;
16
- }
17
-
18
- .lightbox {
19
- position: absolute;
20
- left: 0;
21
- width: 100%;
22
- z-index: 10000;
23
- text-align: center;
24
- line-height: 0;
25
- font-weight: normal;
26
- }
27
-
28
- .lightbox .lb-image {
29
- display: block;
30
- height: auto;
31
- max-width: inherit;
32
- border-radius: 3px;
33
- }
34
-
35
- .lightbox a img {
36
- border: none;
37
- }
38
-
39
- .lb-outerContainer {
40
- position: relative;
41
- background-color: white;
42
- *zoom: 1;
43
- width: 250px;
44
- height: 250px;
45
- margin: 0 auto;
46
- border-radius: 4px;
47
- }
48
-
49
- .lb-outerContainer:after {
50
- content: "";
51
- display: table;
52
- clear: both;
53
- }
54
-
55
- .lb-container {
56
- padding: 4px;
57
- }
58
-
59
- .lb-loader {
60
- position: absolute;
61
- top: 43%;
62
- left: 0;
63
- height: 25%;
64
- width: 100%;
65
- text-align: center;
66
- line-height: 0;
67
- }
68
-
69
- .lb-cancel {
70
- display: block;
71
- width: 32px;
72
- height: 32px;
73
- margin: 0 auto;
74
- background: url(../img/loading.gif) no-repeat;
75
- }
76
-
77
- .lb-nav {
78
- position: absolute;
79
- top: 0;
80
- left: 0;
81
- height: 100%;
82
- width: 100%;
83
- z-index: 10;
84
- }
85
-
86
- .lb-container > .nav {
87
- left: 0;
88
- }
89
-
90
- .lb-nav a {
91
- outline: none;
92
- background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
93
- }
94
-
95
- .lb-prev, .lb-next {
96
- height: 100%;
97
- cursor: pointer;
98
- display: block;
99
- }
100
-
101
- .lb-nav a.lb-prev {
102
- width: 34%;
103
- left: 0;
104
- float: left;
105
- background: url(../img/prev.png) left 48% no-repeat;
106
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
107
- opacity: 0;
108
- -webkit-transition: opacity 0.6s;
109
- transition: opacity 0.6s;
110
- }
111
-
112
- .lb-nav a.lb-prev:hover {
113
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
114
- opacity: 1;
115
- }
116
-
117
- .lb-nav a.lb-next {
118
- width: 64%;
119
- right: 0;
120
- float: right;
121
- background: url(../img/next.png) right 48% no-repeat;
122
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
123
- opacity: 0;
124
- -webkit-transition: opacity 0.6s;
125
- transition: opacity 0.6s;
126
- }
127
-
128
- .lb-nav a.lb-next:hover {
129
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
130
- opacity: 1;
131
- }
132
-
133
- .lb-dataContainer {
134
- margin: 0 auto;
135
- padding-top: 5px;
136
- *zoom: 1;
137
- width: 100%;
138
- border-bottom-left-radius: 4px;
139
- border-bottom-right-radius: 4px;
140
- }
141
-
142
- .lb-dataContainer:after {
143
- content: "";
144
- display: table;
145
- clear: both;
146
- }
147
-
148
- .lb-data {
149
- padding: 0 4px;
150
- color: #ccc;
151
- }
152
-
153
- .lb-data .lb-details {
154
- width: 85%;
155
- float: left;
156
- text-align: left;
157
- line-height: 1.1em;
158
- }
159
-
160
- .lb-data .lb-caption {
161
- font-size: 13px;
162
- font-weight: bold;
163
- line-height: 1em;
164
- }
165
-
166
- .lb-data .lb-number {
167
- display: block;
168
- clear: left;
169
- padding-bottom: 1em;
170
- font-size: 12px;
171
- color: #999999;
172
- }
173
-
174
- .lb-data .lb-close {
175
- display: block;
176
- float: right;
177
- width: 30px;
178
- height: 30px;
179
- background: url(../img/close.png) top right no-repeat;
180
- text-align: right;
181
- outline: none;
182
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
183
- opacity: 0.7;
184
- -webkit-transition: opacity 0.2s;
185
- transition: opacity 0.2s;
186
- }
187
-
188
- .lb-data .lb-close:hover {
189
- cursor: pointer;
190
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
191
- opacity: 1;
192
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/abtesting/abtesting.php DELETED
@@ -1,48 +0,0 @@
1
- <?php
2
-
3
- class TIABTesting {
4
-
5
- private $config;
6
- private $slug;
7
- private $version;
8
-
9
- public function __construct( $slug, $version ) {
10
- $this->version = str_replace( '.', '_', $version );
11
- $this->loadHooks( $slug );
12
- }
13
-
14
- private function loadHooks( $slug ) {
15
- $this->slug = $slug;
16
- $this->config = apply_filters( $this->slug . '_upsell_config', array() );
17
-
18
- foreach ( $this->config as $section => $values ) {
19
- add_filter( $this->slug . '_' . $section . '_upsell_text', array( $this, 'getUpsellText' ), 10, 2 );
20
- }
21
- }
22
-
23
- public function getUpsellText( $default = '', $escapeHTML = false ) {
24
- $filter = current_filter();
25
- if ( strpos( $filter, $this->slug ) !== false ) {
26
- $section = str_replace( array( $this->slug . '_', '_upsell_text' ), '', $filter );
27
- if ( ! empty( $section ) ) {
28
- if ( array_key_exists( $section, $this->config ) ) {
29
- // check if a value has already been saved against this slug, version, section
30
- $savedVal = get_option( $this->slug . '_' . $this->version . '_' . $section, '' );
31
- if ( ! empty( $savedVal ) ) { return $savedVal; }
32
- $values = $this->config[ $section ];
33
- $html = $values[ rand( 0, count( $values ) - 1 ) ];
34
- $html = $escapeHTML ? esc_html( $html ) : $html;
35
- update_option( $this->slug . '_' . $this->version . '_' . $section, $html );
36
- return $html;
37
- }
38
- }
39
- }
40
- return $default;
41
- }
42
-
43
- public static function writeDebug( $msg ) {
44
- @mkdir( dirname( __FILE__ ) . '/tmp' );
45
- file_put_contents( dirname( __FILE__ ) . '/tmp/log.log', date( 'F j, Y H:i:s', current_time( 'timestamp' ) ) . ' - ' . $msg . "\n", FILE_APPEND );
46
- }
47
-
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp_comment.php DELETED
@@ -1,157 +0,0 @@
1
- <?php
2
-
3
- if ( cwppos( 'cwppos_show_userreview' ) == 'yes' ) :
4
-
5
- add_action( 'comment_form_logged_in_after', 'cwp_additional_fields' );
6
-
7
- add_action( 'comment_form_after_fields', 'cwp_additional_fields' );
8
-
9
- add_filter( 'comment_text', 'cwp_pac_comment_single' );
10
-
11
- add_action( 'comment_post', 'cwp_add_comment_meta_values', 1 );
12
-
13
- else :
14
-
15
-
16
-
17
- remove_action( 'comment_form_logged_in_after', 'cwp_additional_fields' );
18
-
19
- remove_action( 'comment_form_after_fields', 'cwp_additional_fields' );
20
-
21
- remove_filter( 'comment_text', 'cwp_pac_comment_single' );
22
-
23
- remove_action( 'comment_post', 'cwp_add_comment_meta_values', 1 );
24
-
25
- endif ;
26
-
27
-
28
-
29
- function cwp_pac_comment_single( $text ) {
30
-
31
- global $post;
32
-
33
- global $comment;
34
-
35
- $return = '';
36
-
37
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i++ ) {
38
-
39
- $post_options[ $i ] = get_post_meta( $post->ID, "option_{$i}_content", true );
40
-
41
- $comment_meta_options[ "comment-meta-option-{$i}" ] = get_comment_meta( $comment->comment_ID, "meta_option_{$i}", true );
42
-
43
- }
44
-
45
- $filtered_post_options = array_filter( $comment_meta_options );
46
-
47
- if ( ! empty( $filtered_post_options ) ) {
48
-
49
- $return .= "<div class='user-comments-grades'>";
50
-
51
- $k = 1; // keep track
52
-
53
- foreach ( $comment_meta_options as $comment_meta_option => $comment_meta_value ) {
54
-
55
- if ( ! empty( $comment_meta_value ) ) {
56
-
57
- $comment_meta_score = $comment_meta_value * 10;
58
-
59
- $return .= "<div class='comment-meta-option'>
60
-
61
- <p class='comment-meta-option-name'>{$post_options[$k]}</p>
62
-
63
- <p class='comment-meta-option-grade'>$comment_meta_value</p>
64
-
65
- <div class='cwpr_clearfix'></div>
66
-
67
- <div class='comment-meta-grade-bar'>
68
-
69
- <div class='comment-meta-grade' style='width: {$comment_meta_score}%'></div>
70
-
71
- </div><!-- end .comment-meta-grade-bar -->
72
-
73
- </div><!-- end .comment-meta-option -->
74
-
75
- ";
76
-
77
- }
78
-
79
- $k++;
80
-
81
- }
82
-
83
- $return .= '</div><!-- end .user-comments-grades -->';
84
-
85
- }
86
-
87
- return $return . $text . "<div class='cwpr_clearfix'></div>";
88
-
89
- }
90
-
91
- function cwp_additional_fields() {
92
- global $post;
93
- $is_review = get_post_meta( $post->ID, 'cwp_meta_box_check', true );
94
-
95
- if ( $is_review == 'Yes' ) {
96
-
97
- wp_enqueue_style( 'jqueryui', WPPR_URL . '/css/jquery-ui.css',array(),WPPR_LITE_VERSION );
98
- wp_enqueue_script( 'jquery-ui-slider' );
99
-
100
- $meta_options = array();
101
-
102
- for ( $i = 1;$i <= cwppos( 'cwppos_option_nr' );$i++ ) {
103
- $meta_options[ 'meta_option_' . $i ] = get_post_meta( $post->ID, 'option_' . $i . '_content', true );
104
-
105
- }
106
-
107
- foreach ( $meta_options as $k => $value ) {
108
-
109
- if ( $meta_options[ $k ] == '' ) {
110
-
111
- unset( $meta_options[ $k ] );
112
-
113
- }
114
- }
115
-
116
- $sliders = array();
117
-
118
- foreach ( $meta_options as $k => $value ) {
119
-
120
- $sliders[] =
121
-
122
- "<div class='comment-form-meta-option'>
123
-
124
- <label for='$k'>$meta_options[$k]</label>
125
-
126
- <input type='text' id='$k' class='meta_option_input' value='' name='$k' readonly='readonly'>
127
-
128
- <div class='comment_meta_slider'></div>
129
-
130
- <div class='cwpr_clearfix'></div>
131
-
132
- </div>";
133
-
134
- }
135
-
136
- echo "<div id='cwp-slider-comment'>" . implode( '',$sliders ) . "<div class='cwpr_clearfix'></div></div>";
137
- }
138
-
139
- }
140
-
141
-
142
-
143
- function cwp_add_comment_meta_values( $comment_id ) {
144
- for ( $i = 1;$i <= cwppos( 'cwppos_option_nr' );$i++ ) {
145
-
146
- if ( isset( $_POST[ 'meta_option_' . $i ] ) ) {
147
-
148
- ${'meta_option_' . $i} = wp_filter_nohtml_kses( $_POST[ 'meta_option_' . $i ] );
149
-
150
- add_comment_meta( $comment_id, 'meta_option_' . $i, ${'meta_option_' . $i}, false );
151
-
152
- }
153
- }
154
-
155
- }
156
-
157
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp_frontpage.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- function cwp_pac_before_content( $content ) {
3
- global $post;
4
- $cwp_review_stored_meta = get_post_meta( $post->ID );
5
- $return_string = cwppos_show_review();
6
-
7
- global $page;
8
- if ( isset( $cwp_review_stored_meta['cwp_meta_box_check'][0] ) && $cwp_review_stored_meta['cwp_meta_box_check'][0] == 'Yes' && (is_single() || is_page()) && $page === 1 ) {
9
- if ( cwppos( 'cwppos_show_reviewbox' ) == 'yes' ) { return $content . $return_string; }
10
- if ( cwppos( 'cwppos_show_reviewbox' ) == 'no' ) { return $return_string . $content; }
11
- return $content;
12
- } else {
13
- return $content; }
14
- }
15
-
16
- $currentTheme = wp_get_theme();
17
- if ( $currentTheme->get( 'Name' ) !== 'Bookrev' && $currentTheme->get( 'Name' ) !== 'Book Rev Lite' ) {
18
-
19
- add_filter( 'the_content', 'cwp_pac_before_content' );
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp_js_preloader.php DELETED
@@ -1,181 +0,0 @@
1
- <?php
2
-
3
- add_action( 'wp_ajax_cwp_load_preloader', 'cwp_load_preloader' );
4
-
5
- function cwp_load_preloader() {
6
- global $post;
7
-
8
- $args = array(
9
- 'offset' => 0,
10
- 'post_type' => array( 'any' ),
11
- // 'post__not_in' => array($post->ID),
12
- 'meta_query' => array(
13
- array(
14
- 'key' => 'cwp_meta_box_check',
15
- 'value' => 'Yes',
16
- ),
17
- ),
18
- );
19
-
20
- $cwp_query = new WP_Query( $args );
21
- // var_dump($cwp_query);
22
- while ( $cwp_query->have_posts() ) : $cwp_query->the_post();
23
- // var_dump($post);
24
- $post_id = $post->ID;
25
- $preloaded_info = array();
26
- $preloaded_info[ $post_id ] = array();
27
-
28
- ?>
29
- <li class="cwp_preloaded_item cwpr_clearfix">
30
- <header>
31
-
32
- <h3 class="cwp_p_title"><?php the_title(); ?></h3>
33
- <button class="preload" title="Preload all details">&curarr;</button>
34
- </header>
35
- <?php
36
-
37
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i++ ) {
38
- $preloaded_info[ $post_id ][ 'option' . $i ] = array(
39
- 'content' => get_post_meta( $post->ID, 'option_' . $i . '_content', true ),
40
- 'grade' => get_post_meta( $post->ID, 'option_' . $i . '_grade', true ),
41
- 'pro' => get_post_meta( $post->ID, 'cwp_option_' . $i . '_pro', true ),
42
- 'cons' => get_post_meta( $post->ID, 'cwp_option_' . $i . '_cons', true ),
43
- );
44
- }
45
- // var_dump($preloaded_info);
46
- ?>
47
-
48
- <div class="cwp_pitem_info post_<?php echo $post_id; ?>">
49
- <ul class="cwp_pitem_options_content">
50
- <h4><?php _e( 'Options', 'cwppos' ); ?></h4>
51
- <?php
52
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i++ ) {
53
- $pinfo_temp = $preloaded_info[ $post_id ][ 'option' . $i ]['content'];
54
- if ( ! empty( $pinfo_temp ) ) {
55
- echo '<li>' . $pinfo_temp . '</li>';
56
- } else {
57
- echo '<li>-</li>';
58
- }
59
- }
60
- ?>
61
- </ul><!-- end .cwp_pitem_options_content -->
62
-
63
- <ul class="cwp_pitem_options_pros">
64
- <h4><?php _e( 'Pros', 'cwppos' ); ?></h4>
65
- <?php
66
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i++ ) {
67
- $pinfo_temp = $preloaded_info[ $post_id ][ 'option' . $i ]['pro'];
68
- if ( ! empty( $pinfo_temp ) ) {
69
- echo '<li>' . $pinfo_temp . '</li>';
70
- } else {
71
- echo '<li>-</li>';
72
- }
73
- }
74
- ?>
75
- </ul><!-- end .cwp_pitem_options_pros -->
76
-
77
- <ul class="cwp_pitem_options_cons">
78
- <h4><?php _e( 'Cons', 'cwppos' ); ?></h4>
79
- <?php
80
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i++ ) {
81
- $pinfo_temp = $preloaded_info[ $post_id ][ 'option' . $i ]['cons'];
82
- if ( ! empty( $pinfo_temp ) ) {
83
- echo '<li>' . $pinfo_temp . '</li>';
84
- } else {
85
- echo '<li>-</li>';
86
- }
87
- }
88
- ?>
89
- </ul><!-- end .cwp_pitem_options_cons -->
90
- </div><!-- end .cwp_pitem_info -->
91
- </li><!-- end .cwp_preloaded_item -->
92
- <?php endwhile; wp_reset_postdata();
93
-
94
- die(); // this is required to terminate immediately and return a proper response
95
- }
96
-
97
- add_action( 'admin_footer','cwppos_js_preloader' );
98
-
99
- function cwppos_js_preloader() {
100
- ?>
101
- <script type="text/javascript">
102
- jQuery(document).ready(function(){
103
- function cwpPreloadOptions(item) {
104
- for (var i = 1; i <= <?php echo cwppos( 'cwppos_option_nr' );?>; i++) {
105
- var preloadListItem = jQuery(item).parent().parent().children(".cwp_pitem_info").children(".cwp_pitem_options_content").children("li:eq("+(i-1)+")").text();
106
- if(preloadListItem != "-") { jQuery("input#option_" + i + "_content").val(preloadListItem); }
107
- };
108
- }
109
-
110
- function cwpPreloadCons(item)
111
- {
112
- for (var i = 1; i <= <?php echo cwppos( 'cwppos_option_nr' );?>; i++) {
113
- var preloadListItem = jQuery(item).parent().parent().children(".cwp_pitem_info").children(".cwp_pitem_options_pros").children("li:eq("+(i-1)+")").text();
114
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + i + "_pro").val(preloadListItem); }
115
- };
116
- }
117
-
118
- function cwpPreloadPros(item)
119
- {
120
- for (var i = 1; i <= <?php echo cwppos( 'cwppos_option_nr' );?>; i++) {
121
- var preloadListItem = jQuery(item).parent().parent().children(".cwp_pitem_info").children(".cwp_pitem_options_cons").children("li:eq("+(i-1)+")").text();
122
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + i + "_cons").val(preloadListItem); }
123
- };
124
- }
125
-
126
- jQuery(".preload_info").click(function(e){
127
- e.preventDefault();
128
-
129
- var cwpThemeUrl = '<?php echo plugins_url( '', __FILE__ ); ?>';
130
- var ajaxLoad = "<img class='ajax_load_icon' src='" + cwpThemeUrl +"/images/ajaxload.gif' alt='Loading...'/>";
131
-
132
- jQuery("body #wpwrap").append("<div class='preload_result'><div class='preload_inner'><header><h2>Preload Info</h2><div class='preload_close'></div></header><div class='preloader_body'><ul class='preload_list'></ul></div></div></div>");
133
- jQuery(".preload_result").fadeIn();
134
-
135
- jQuery(".preload_close").bind("click", function(){
136
- jQuery(".preload_result").fadeOut();
137
- });
138
- jQuery(".preload_list").html(ajaxLoad);
139
-
140
- jQuery.get(ajaxurl,{'action':'cwp_load_preloader'},
141
- function(response){
142
- jQuery(".preload_list").html(response);
143
- });
144
-
145
- //jQuery(".preload_list").html(ajaxLoad).load(loadUrl);
146
-
147
-
148
- jQuery(".preload_list .cwp_p_title").live("click", function(){
149
- jQuery(this).parent().parent().children(".cwp_pitem_info").slideToggle();
150
- });
151
-
152
- jQuery(".preload_list li button.preload").live("click", function(){
153
- cwpPreloadOptions(this);
154
- cwpPreloadCons(this);
155
- cwpPreloadPros(this);
156
- jQuery(".preload_result").fadeOut();
157
- });
158
-
159
- jQuery(".preload_list .cwp_pitem_options_content li").live("click",function(){
160
- var plIndex = jQuery(this).index();
161
- var preloadListItem = jQuery(this).text();
162
- if(preloadListItem != "-") { jQuery("input#option_" + plIndex + "_content").val(preloadListItem); }
163
- });
164
-
165
- jQuery(".preload_list .cwp_pitem_options_pros li").live("click",function(){
166
- var plIndex = jQuery(this).index();
167
- var preloadListItem = jQuery(this).text();
168
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + plIndex + "_pro").val(preloadListItem); }
169
- });
170
-
171
- jQuery(".preload_list .cwp_pitem_options_cons li").live("click",function(){
172
- var plIndex = jQuery(this).index();
173
- var preloadListItem = jQuery(this).text();
174
- if(preloadListItem != "-") { jQuery("input#cwp_option_" + plIndex + "_cons").val(preloadListItem); }
175
- });
176
-
177
- });
178
- });
179
- </script>
180
- <?php
181
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp_latest_products_widget.php DELETED
@@ -1,371 +0,0 @@
1
- <?php
2
- /**
3
- * CWP - Latest Producs Widget
4
- */
5
-
6
-
7
-
8
- class cwp_latest_products_widget extends WP_Widget {
9
-
10
- const RESTRICT_TITLE_CHARS = 100;
11
-
12
- function __construct() {
13
-
14
- parent::__construct(
15
-
16
- 'cwp_latest_products_widget',
17
- __( 'CWP Latest Products Widget', 'cwppos' ),
18
- // Widget description
19
- array( 'description' => __( 'This widget displays the latest products based on their rating.', 'cwppos' ) )
20
- );
21
-
22
- }
23
-
24
- public function assets() {
25
-
26
- wp_enqueue_style( 'cwp-pac-widget-stylesheet', WPPR_URL . '/css/cwppos-widget.css' );
27
- wp_enqueue_script( 'cwp-pac-main-script', WPPR_URL . '/javascript/main.js',array( 'jquery', 'pie-chart' ),WPPR_LITE_VERSION,true );
28
- wp_enqueue_script( 'pie-chart', WPPR_URL . '/javascript/pie-chart.js',array( 'jquery' ), WPPR_LITE_VERSION,true );
29
-
30
- // Added by Ash/Upwork
31
- wp_enqueue_style( 'cwp-widget-stylesheet1', WPPR_URL . '/css/cwppos-widget-style1.css' );
32
- wp_enqueue_style( 'cwp-widget-rating', WPPR_URL . '/css/cwppos-widget-rating.css' );
33
- // Added by Ash/Upwork
34
- }
35
-
36
- public function widget( $args, $instance ) {
37
- $this->assets();
38
- if ( isset( $instance['title'] ) ) {
39
-
40
- $title = apply_filters( 'widget_title', $instance['title'] ); }
41
-
42
- if ( isset( $instance['no_items'] ) ) {
43
-
44
- $no_items = apply_filters( 'widget_content', $instance['no_items'] ); }
45
-
46
- if ( isset( $instance['cwp_tp_category'] ) ) {
47
-
48
- $cwp_tp_category = apply_filters( 'widget_content', $instance['cwp_tp_category'] ); }
49
-
50
- if ( isset( $instance['title_type'] ) ) {
51
-
52
- $post_type = apply_filters( 'widget_content', $instance['title_type'] ); }
53
-
54
- if ( isset( $instance['show_image'] ) ) {
55
-
56
- $show_image = apply_filters( 'widget_content', $instance['show_image'] ); }
57
-
58
- // before and after widget arguments are defined by themes
59
- // echo "<div id='cwp_latest_products_widget'>";
60
- echo $args['before_widget'];
61
-
62
- if ( ! empty( $title ) ) {
63
-
64
- echo $args['before_title'] . $title . $args['after_title']; }
65
-
66
- if ( $cwp_tp_category == 'All' ) { $cwp_tp_category = ''; }
67
- // Loop to get the most popular posts, ordered by the author's final grade.
68
- $query_args = array(
69
-
70
- 'posts_per_page' => $no_items, // limit it to the specified no of posts
71
- 'post_type' => 'any',
72
- 'post__not_in' => get_option( 'sticky_posts' ),
73
- 'category_name' => $cwp_tp_category, // limit it to the specified category
74
- 'meta_key' => 'option_overall_score',
75
-
76
- 'meta_query' => array(
77
-
78
- array(
79
-
80
- 'key' => 'cwp_meta_box_check',
81
-
82
- 'value' => 'Yes',
83
-
84
- ),
85
-
86
- ),
87
- 'orderby' => 'date',
88
- 'order' => 'DESC',
89
-
90
- );
91
-
92
- $cwp_products_loop = new WP_Query( $query_args );
93
-
94
- // Added by Ash/Upwork
95
- if ( ! isset( $instance['cwp_tp_buynow'] ) ) {
96
- $instance['cwp_tp_buynow'] = __( 'Buy Now', 'cwppos' );
97
- }
98
-
99
- if ( ! isset( $instance['cwp_tp_readreview'] ) ) {
100
- $instance['cwp_tp_readreview'] = __( 'Read Review', 'cwppos' );
101
- }
102
-
103
- if ( ! isset( $instance['cwp_tp_layout'] ) ) {
104
- $instance['cwp_tp_layout'] = 'default.php';
105
- }
106
-
107
- if ( ! isset( $instance['cwp_tp_rating_type'] ) ) {
108
- $instance['cwp_tp_rating_type'] = 'round';
109
- }
110
-
111
- include trailingslashit( dirname( __FILE__ ) ) . '/widget-layouts/' . $instance['cwp_tp_layout'];
112
- // Added by Ash/Upwork
113
- echo $args['after_widget'];
114
-
115
- // echo "</div>"; // end #cwp_latest_products_widget
116
- }
117
-
118
-
119
-
120
- // Widget Backend
121
- // Added by Ash/Upwork
122
- public function adminAssets() {
123
- if ( is_admin() ) {
124
- wp_enqueue_style( 'cwp-widget-admin-css', WPPR_URL . '/css/cwppos-widget-admin.css' );
125
-
126
- wp_register_script( 'cwp-widget-script-latest', WPPR_URL . '/javascript/widget-latest.js' );
127
- wp_localize_script('cwp-widget-script-latest', 'cwpw_latest', array(
128
- 'widgetName' => $this->id_base,
129
- 'imageCheckbox' => $this->get_field_id( 'show_image' ),
130
- 'ratingSelect' => $this->get_field_id( 'cwp_tp_rating_type' ),
131
- ));
132
- wp_enqueue_script( 'cwp-widget-script-latest' );
133
- }
134
- }
135
- // Added by Ash/Upwork
136
- public function form( $instance ) {
137
-
138
- // Added by Ash/Upwork
139
- $this->adminAssets();
140
- // Added by Ash/Upwork
141
- if ( isset( $instance['title'] ) ) {
142
-
143
- $title = $instance['title'];
144
- } else {
145
- $title = __( 'Latest Products', 'cwppos' );
146
- }
147
- if ( isset( $instance['no_items'] ) ) {
148
- $no_items = $instance['no_items'];
149
- } else {
150
- $no_items = __( '10', 'cwppos' );
151
- }
152
- if ( isset( $instance['cwp_tp_category'] ) ) {
153
- $cwp_tp_category = $instance['cwp_tp_category'];} else {
154
- $cwp_tp_category = 'Select Category';
155
- }
156
- if ( isset( $instance['title_type'] ) ) {
157
- $title_type = $instance['title_type'];
158
-
159
- } else {
160
- $title_type = false;
161
- }
162
-
163
- if ( isset( $instance['show_image'] ) ) {
164
- $show_image = $instance['show_image'];
165
-
166
- } else {
167
- $show_image = false;
168
- }
169
-
170
- // Added by Ash/Upwork
171
- $cwp_tp_buynow = __( 'Buy Now', 'cwppos' );
172
- if ( isset( $instance['cwp_tp_buynow'] ) ) {
173
- $cwp_tp_buynow = $instance['cwp_tp_buynow'];
174
- }
175
-
176
- $cwp_tp_readreview = __( 'Read Review', 'cwppos' );
177
- if ( isset( $instance['cwp_tp_readreview'] ) ) {
178
- $cwp_tp_readreview = $instance['cwp_tp_readreview'];
179
- }
180
-
181
- $cwp_tp_layout = 'default.php';
182
- if ( isset( $instance['cwp_tp_layout'] ) ) {
183
- $cwp_tp_layout = $instance['cwp_tp_layout'];
184
- }
185
-
186
- if ( $cwp_tp_layout == 'default.php' ) {
187
- $cwp_tp_rating_type = 'round';
188
- } else {
189
- $cwp_tp_rating_type = 'star';
190
- }
191
- // Added by Ash/Upwork
192
- $cwp_tp_categ_array = get_categories( 'hide_empty=0' );
193
-
194
- foreach ( $cwp_tp_categ_array as $categs ) {
195
-
196
- $cwp_tp_all_categories[ $categs->slug ] = $categs->name;
197
-
198
- }
199
-
200
- // Widget admin form
201
- ?>
202
-
203
- <p>
204
-
205
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'cwppos' ); ?></label>
206
-
207
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
208
-
209
- </p>
210
-
211
-
212
-
213
- <p>
214
-
215
- <label for="<?php echo $this->get_field_id( 'no_items' ); ?>"><?php _e( 'Number of posts to show:', 'cwppos' ); ?></label>
216
-
217
- <input id="<?php echo $this->get_field_id( 'no_items' ); ?>" name="<?php echo $this->get_field_name( 'no_items' ); ?>" size="3" type="text" value="<?php echo esc_attr( $no_items ); ?>" />
218
-
219
- </p>
220
-
221
-
222
-
223
- <p>
224
-
225
- <?php $cwp_tp_selected_categ = esc_attr( $cwp_tp_category ); ?>
226
-
227
- <label for="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>"><?php _e( 'Category:', 'cwppos' ); ?></label>
228
-
229
- <select id="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_category' ); ?>">
230
- <?php echo '<option>All</option>'; ?>
231
-
232
- <?php foreach ( $cwp_tp_all_categories as $categ_slug => $categ_name ) : ?>
233
-
234
- <?php if ( $categ_slug == $cwp_tp_selected_categ ) {
235
-
236
- echo '<option selected>' . $categ_slug . '</option>';
237
-
238
- } elseif ( $categ_slug == '' ) {
239
-
240
- echo '<option>There are no categs</select>';
241
-
242
- } else {
243
-
244
- echo '<option>' . $categ_slug . '</option>';
245
-
246
- } ?>
247
-
248
- <?php endforeach; ?>
249
-
250
- </select>
251
-
252
- </p>
253
-
254
- <?php // Added by Ash/Upwork ?>
255
-
256
- <p>
257
-
258
- <?php $cwp_tp_layout = esc_attr( $cwp_tp_layout ); ?>
259
-
260
- <label for="<?php echo $this->get_field_id( 'cwp_tp_layout' ); ?>"><?php _e( 'Layout:', 'cwppos' ); ?></label>
261
-
262
- <?php
263
-
264
- $layouts = array();
265
- $customLayoutFiles = glob( trailingslashit( dirname( __FILE__ ) ) . 'widget-layouts/*.php' );
266
- foreach ( $customLayoutFiles as $file ) {
267
- $layouts[ basename( $file ) ] = ucwords( basename( $file, '.php' ) );
268
- }
269
-
270
- foreach ( $layouts as $key => $val ) :
271
- $extra = '';
272
- if ( $key == $cwp_tp_layout ) { $extra = 'checked'; }
273
-
274
- $styleName = strtolower( str_replace( ' ', '', $val ) );
275
- $id = $this->get_field_id( $styleName );
276
- ?>
277
- <br>
278
- <input type="radio" name="<?php echo $this->get_field_name( 'cwp_tp_layout' ); ?>" value="<?php echo $key;?>" id="<?php echo $id . 'style'?>" <?php echo $extra;?> class="wppr-stylestyle"><label for="<?php echo $id . 'style';?>" class="wppr-stylestyle"><?php echo $val;?></label>
279
- <span class="wppr-styleimg" id="<?php echo $id . 'style'?>img">
280
- <img src="<?php echo WPPR_URL . '/assets/' . $styleName . '.png';?>">
281
- </span>
282
- <?php
283
- endforeach;
284
- ?>
285
-
286
- </p>
287
-
288
- <p class="wppr-customField" style="display: none">
289
-
290
- <?php $cwp_tp_buynow = esc_attr( $cwp_tp_buynow ); ?>
291
-
292
- <label for="<?php echo $this->get_field_id( 'cwp_tp_buynow' ); ?>"><?php _e( 'Buy Now text:', 'cwppos' ); ?></label>
293
-
294
- <input id="<?php echo $this->get_field_id( 'cwp_tp_buynow' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_buynow' ); ?>" class="widefat" type="text" value="<?php echo $cwp_tp_buynow; ?>" />
295
-
296
- </p>
297
-
298
- <p class="wppr-customField" style="display: none">
299
-
300
- <?php $cwp_tp_readreview = esc_attr( $cwp_tp_readreview ); ?>
301
-
302
- <label for="<?php echo $this->get_field_id( 'cwp_tp_readreview' ); ?>"><?php _e( 'Read Review text:', 'cwppos' ); ?></label>
303
-
304
- <input id="<?php echo $this->get_field_id( 'cwp_tp_readreview' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_readreview' ); ?>" class="widefat" type="text" value="<?php echo $cwp_tp_readreview; ?>" />
305
-
306
- </p>
307
-
308
- <?php // Added by Ash/Upwork ?>
309
-
310
- <p>
311
-
312
- <label for="<?php echo $this->get_field_id( 'title_type' ); ?>"><?php _e( 'Display Product Titles :', 'cwppos' ); ?></label>
313
-
314
- <input id="<?php echo $this->get_field_id( 'title_type' ); ?>" name="<?php echo $this->get_field_name( 'title_type' ); ?>" type="checkbox" <?php checked( $title_type ); ?> />
315
- </p>
316
-
317
- <p>
318
-
319
- <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Display Product Image :', 'cwppos' ); ?></label>
320
-
321
- <input id="<?php echo $this->get_field_id( 'show_image' ); ?>" name="<?php echo $this->get_field_name( 'show_image' ); ?>" type="checkbox" <?php checked( $show_image ); ?> />
322
- </p>
323
-
324
-
325
- <?php }
326
-
327
-
328
-
329
- // Updating widget replacing old instances with new
330
- public function update( $new_instance, $old_instance ) {
331
-
332
- $instance = $old_instance;
333
-
334
- $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
335
-
336
- $instance['no_items'] = ( ! empty( $new_instance['no_items'] ) ) ? strip_tags( $new_instance['no_items'] ) : '';
337
-
338
- $instance['cwp_tp_category'] = ( ! empty( $new_instance['cwp_tp_category'] ) ) ? strip_tags( $new_instance['cwp_tp_category'] ) : '';
339
-
340
- $instance['title_type'] = (bool) $new_instance['title_type'] ;
341
- $instance['show_image'] = (bool) $new_instance['show_image'] ;
342
-
343
- // Added by Ash/Upwork
344
- $instance['cwp_tp_buynow'] = ( ! empty( $new_instance['cwp_tp_buynow'] ) ) ? strip_tags( $new_instance['cwp_tp_buynow'] ) : '';
345
- $instance['cwp_tp_readreview'] = ( ! empty( $new_instance['cwp_tp_readreview'] ) ) ? strip_tags( $new_instance['cwp_tp_readreview'] ) : '';
346
- $instance['cwp_tp_layout'] = ( ! empty( $new_instance['cwp_tp_layout'] ) ) ? strip_tags( $new_instance['cwp_tp_layout'] ) : '';
347
- $instance['cwp_tp_rating_type'] = ( ! empty( $new_instance['cwp_tp_rating_type'] ) ) ? strip_tags( $new_instance['cwp_tp_rating_type'] ) : '';
348
- // Added by Ash/Upwork
349
- return $instance;
350
-
351
- }
352
-
353
-
354
-
355
- } // end Class cwp_latest_products_widget
356
-
357
-
358
-
359
-
360
-
361
- // Register and load the widget
362
- /**
363
- *
364
- */
365
- function cwp_load_latest_products_widget() {
366
-
367
- register_widget( 'cwp_latest_products_widget' );
368
-
369
- }
370
-
371
- add_action( 'widgets_init', 'cwp_load_latest_products_widget' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp_metabox.php DELETED
@@ -1,368 +0,0 @@
1
- <?php
2
- function cwp_review_meta_boxes() {
3
- add_meta_box( 'cwp_review_meta_box', 'Product Review Extra Settings', 'cwp_review_meta_box_callback' );
4
- }
5
-
6
- /*
7
- * Function for rendering the review custom meta boxes.
8
- */
9
- function cwp_review_meta_box_callback( $post ) {
10
- wp_nonce_field( 'cwp_product_review_meta_box_nonce', 'cwp_meta_box_nonce' );
11
- $cwp_review_stored_meta = get_post_meta( $post->ID );
12
- $check = isset( $cwp_review_stored_meta['cwp_meta_box_check'][0] ) ? esc_attr( $cwp_review_stored_meta['cwp_meta_box_check'][0] ) : 'No';
13
- $query_args = array(
14
- 'posts_per_page' => '1', // limit it to the specified no of posts
15
- 'post_type' => 'any',
16
- 'post__not_in' => get_option( 'sticky_posts' ),
17
- 'meta_key' => 'option_overall_score',
18
- 'meta_query' => array(
19
- array(
20
- 'key' => 'cwp_meta_box_check',
21
- 'value' => 'Yes',
22
- ),
23
- ),
24
- 'orderby' => 'date',
25
- 'order' => 'DESC',
26
- );
27
- $cwp_latest_products_loop = get_posts( $query_args );
28
- foreach ( $cwp_latest_products_loop as $w_post ) : setup_postdata( $w_post );
29
- $wppr_id = $w_post->ID;
30
- endforeach;
31
- wp_reset_postdata();
32
- $p_meta = isset( $wppr_id ) ? get_post_meta( $wppr_id ) : array();
33
- if ( isset( $cwp_review_stored_meta['cwp_image_link'][0] ) ) {
34
- $checkset = esc_attr( $cwp_review_stored_meta['cwp_image_link'][0] );
35
- } else {
36
- $checkset = isset( $p_meta['cwp_image_link'][0] ) ? esc_attr( $p_meta['cwp_image_link'][0] ) : 'image';
37
-
38
- }
39
- // $checkset = isset( $cwp_review_stored_meta['cwp_image_link'][0] ) ? ) : "image";
40
- ?>
41
- <p class="isReview<?php echo $check; ?>">
42
- <label for="my_meta_box_check">Is this a review post ? </label>
43
- <input type="radio" id="cwp_meta_box_check_yes" name="cwp_meta_box_check"
44
- value="Yes" <?php checked( $check, 'Yes' ); ?> />
45
- <label for="my_meta_box_check">Yes</label>
46
- <input type="radio" id="cwp_meta_box_check_no" name="cwp_meta_box_check"
47
- value="No" <?php checked( $check, 'No' ); ?> />
48
- <label for="my_meta_box_check" style="margin-right:30px;">No</label>
49
-
50
- </p>
51
- <div class="product-review-meta-<?php echo $check; ?>">
52
-
53
- <div class="review-settings-notice">
54
- <h4><?php _e( 'Product Details', 'cwppos' ); ?></h4>
55
- <p style="margin:0;"><?php _e( 'Specify the general details for the reviewed product.', 'cwppos' ); ?></p>
56
- </div><!-- end .review-settings-notice -->
57
- <div class="review-settings-group">
58
- <div class="review-settings-group-option">
59
- <ul>
60
- <?php
61
- // Added by Ash/Upwork
62
- do_action( 'wppr-amazon-addfields', $cwp_review_stored_meta );
63
- // Added by Ash/Upwork
64
- ?>
65
-
66
- <li>
67
- <label for="cwp_rev_product_name"><?php _e( 'Product Name', 'cwppos' ); ?></label>
68
- <input type="text" name="cwp_rev_product_name" id="cwp_rev_product_name" value="<?php
69
- if ( isset( $cwp_review_stored_meta['cwp_rev_product_name'][0] ) ) {
70
- echo $cwp_review_stored_meta['cwp_rev_product_name'][0];
71
- }
72
- ?>"/>
73
- </li>
74
- <li>
75
- <label for="cwp_rev_product_image"
76
- class="cwp_rev_product_image-title"><?php _e( 'Product Image', 'cwppos' ) ?></label>
77
- <input type="text" name="cwp_rev_product_image" id="cwp_rev_product_image"
78
- value="<?php if ( isset( $cwp_review_stored_meta['cwp_rev_product_image'][0] ) ) {
79
- echo $cwp_review_stored_meta['cwp_rev_product_image'][0];
80
- } ?>"/>
81
- <input type="button" id="cwp_rev_product_image-button" class="button"
82
- value="<?php _e( 'Choose or Upload an Image', 'cwppos' ) ?>"/>
83
- <p><?php _e( '*If no image is provided, featured image is used','cwppos' ); ?>
84
- </li>
85
- <li class="cwp_image_link">
86
- <label for="cwp_image_link_aff">Product Image Click : </label>
87
- <input type="radio" id="cwp_image_link_aff" name="cwp_image_link"
88
- value="image" <?php checked( $checkset, 'image' ); ?> />
89
- <label for="cwp_image_link_image">Show Whole Image</label>
90
- <input type="radio" id="cwp_image_link_image" name="cwp_image_link"
91
- value="link" <?php checked( $checkset, 'link' ); ?> />
92
- <label for="my_meta_box_check">Open Affiliate link</label>
93
- </li>
94
- <li>
95
- <label
96
- for="cwp_product_affiliate_text"><?php _e( 'Affiliate Button Text', 'cwppos' ); ?></label>
97
- <input type="text" name="cwp_product_affiliate_text" id="cwp_product_affiliate_text"
98
- value="<?php
99
- if ( isset( $cwp_review_stored_meta['cwp_product_affiliate_text'][0] ) ) {
100
- echo $cwp_review_stored_meta['cwp_product_affiliate_text'][0];
101
- } else {
102
- if ( isset( $p_meta['cwp_product_affiliate_text'][0] ) ) {
103
- echo $p_meta['cwp_product_affiliate_text'][0];
104
- }
105
- }
106
- ?>"/>
107
- </li>
108
- <li>
109
- <label for="cwp_product_affiliate_link"><?php _e( 'Affiliate Link', 'cwppos' ); ?></label>
110
- <input type="text" name="cwp_product_affiliate_link" id="cwp_product_affiliate_link"
111
- value="<?php
112
- if ( isset( $cwp_review_stored_meta['cwp_product_affiliate_link'][0] ) ) {
113
- echo $cwp_review_stored_meta['cwp_product_affiliate_link'][0];
114
- }
115
- ?>"/>
116
- <span id="wppr_product_affiliate_link_upsell" style="display: none">&nbsp;</span>
117
- <?php
118
- $hide_button2 = false;
119
- if ( ! isset( $cwp_review_stored_meta['cwp_product_affiliate_text2'][0] ) ) {
120
- $hide_button2 = true;
121
- ?>
122
- <a href="#" id="cwp_add_button" title="Add new button">+</a>
123
- <?php } ?>
124
- </li>
125
-
126
- <li class="<?php if ( $hide_button2 ) {
127
- echo 'cwp_hide_button2';
128
- } ?>">
129
- <label
130
- for="cwp_product_affiliate_text2"><?php _e( 'Affiliate Text 2', 'cwppos' ); ?></label>
131
- <input type="text" name="cwp_product_affiliate_text2" id="cwp_product_affiliate_text2"
132
- value="<?php
133
- if ( isset( $cwp_review_stored_meta['cwp_product_affiliate_text2'][0] ) ) {
134
- echo $cwp_review_stored_meta['cwp_product_affiliate_text2'][0];
135
- }
136
- ?>"/>
137
- </li>
138
- <li class="<?php if ( $hide_button2 ) {
139
- echo 'cwp_hide_button2';
140
- } ?>">
141
- <label for="cwp_product_affiliate_link2"><?php _e( 'Affiliate Link 2', 'cwppos' ); ?></label>
142
- <input type="text" name="cwp_product_affiliate_link2" id="cwp_product_affiliate_link2"
143
- value="<?php
144
- if ( isset( $cwp_review_stored_meta['cwp_product_affiliate_link2'][0] ) ) {
145
- echo $cwp_review_stored_meta['cwp_product_affiliate_link2'][0];
146
- }
147
- ?>"/>
148
- </li>
149
-
150
- <li>
151
- <label for="cwp_cwp_rev_price"><?php _e( 'Product Price', 'cwppos' ); ?></label>
152
- <input type="text" name="cwp_rev_price" id="cwp_rev_price" value="<?php
153
- if ( isset( $cwp_review_stored_meta['cwp_rev_price'][0] ) ) {
154
- echo $cwp_review_stored_meta['cwp_rev_price'][0];
155
- }
156
- ?>"/>
157
- </li>
158
-
159
- </ul>
160
- </div><!-- end .review-settings-group option -->
161
- </div><!-- end .review-settings group -->
162
- <div class="review-settings-notice">
163
- <h4><?php _e( 'Product Options Setting', 'cwppos' ); ?></h4>
164
- <?php _e( 'Insert your options and their grades. Grading must be done <b><i>from 0 to 100</i></b>.','cwppos' );
165
- if ( cwppos( 'cwppos_show_poweredby' ) === 'yes' || class_exists( 'CWP_PR_PRO_Core' ) || function_exists( 'wppr_ep_js_preloader' ) ) { ?>
166
- <a href="#" class="preload_info"><?php _e( 'Preload Info', 'cwppos' ); ?></a>
167
- <?php
168
- } else {
169
- $pageURL = admin_url( 'admin.php?page=cwppos_options#tab-upgrade_to_pro' );
170
- $pageURL = str_replace( ':80', '', $pageURL );
171
- echo apply_filters( WPPR_SLUG . '_' . 'preloader' . '_upsell_text', '' );
172
- } ?>
173
- </div><!-- end .review-settings-notice -->
174
- <div class="review-settings-group">
175
- <?php
176
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) { ?>
177
- <div class="review-settings-group-option">
178
- <label for="option_<?php echo $i; ?>_content" class="option_label"><?php echo $i; ?></label>
179
- <input type="text" name="option_<?php echo $i; ?>_content" id="option_<?php echo $i; ?>_content"
180
- class="option_content" placeholder="Option <?php echo $i; ?>" value="<?php
181
- if ( isset( $cwp_review_stored_meta[ 'option_' . $i . '_content' ][0] ) ) {
182
- echo $cwp_review_stored_meta[ 'option_' . $i . '_content' ][0];
183
- } else {
184
- // Get latest modified post from the same category id
185
- if ( isset( $p_meta[ 'option_' . $i . '_content' ][0] ) ) {
186
- echo $p_meta[ 'option_' . $i . '_content' ][0];
187
- }
188
- }
189
- ?>"/>
190
- <input type="text" name="option_<?php echo $i; ?>_grade" class="option_grade" placeholder="Grade"
191
- value="<?php
192
- if ( isset( $cwp_review_stored_meta[ 'option_' . $i . '_grade' ][0] ) ) {
193
- echo $cwp_review_stored_meta[ 'option_' . $i . '_grade' ][0];
194
- }
195
- ?>"/>
196
- </div><!-- end .review-settings-group option -->
197
- <?php } ?>
198
-
199
- </div><!-- end .review-settings group -->
200
- <div class="cwp_proscons">
201
- <div class="review-settings-notice">
202
- <h4><?php _e( 'Pro Features', 'cwppos' ); ?></h4>
203
- <p style="margin:0;"><?php _e( "Insert product's pro features below.", 'cwppos' ); ?></p>
204
- </div><!-- end .review-settings-notice -->
205
- <div class="review-settings-group">
206
- <?php for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) { ?>
207
-
208
- <div class="review-settings-group-option">
209
- <label for="cwp_option_<?php echo $i; ?>_pro" class="option_label"><?php echo $i; ?></label>
210
- <input type="text" name="cwp_option_<?php echo $i; ?>_pro" id="cwp_option_<?php echo $i; ?>_pro"
211
- class="option_content" placeholder="Option <?php echo $i; ?>" value="<?php
212
- if ( isset( $cwp_review_stored_meta[ 'cwp_option_' . $i . '_pro' ][0] ) ) {
213
- echo $cwp_review_stored_meta[ 'cwp_option_' . $i . '_pro' ][0];
214
- }
215
- ?>"/>
216
- </div><!-- end .review-settings-group option -->
217
- <?php } ?>
218
-
219
- </div><!-- end .review-settings group -->
220
- </div>
221
- <div class="cwp_proscons">
222
- <div class="review-settings-notice">
223
- <h4><?php _e( 'Cons Features', 'cwppos' ); ?></h4>
224
- <p style="margin:0;"><?php _e( "Insert product's cons features below.", 'cwppos' ); ?></p>
225
- </div><!-- end .review-settings-notice -->
226
- <div class="review-settings-group">
227
- <?php for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) { ?>
228
-
229
- <div class="review-settings-group-option">
230
- <label for="cwp_option_<?php echo $i; ?>_cons" class="option_label"><?php echo $i; ?></label>
231
- <input type="text" name="cwp_option_<?php echo $i; ?>_cons"
232
- id="cwp_option_<?php echo $i; ?>_cons" class="option_content"
233
- placeholder="Option <?php echo $i; ?>" value="<?php
234
- if ( isset( $cwp_review_stored_meta[ 'cwp_option_' . $i . '_cons' ][0] ) ) {
235
- echo $cwp_review_stored_meta[ 'cwp_option_' . $i . '_cons' ][0];
236
- }
237
- ?>"/>
238
- </div><!-- end .review-settings-group option -->
239
- <?php } ?>
240
-
241
- </div><!-- end .review-settings group -->
242
- </div>
243
- <?php if ( ! shortcode_exists( 'P_REVIEW' ) ) : ?>
244
- <label> You can use the shortcode <b>[P_REVIEW]</b> to show a review you already made or
245
- <b>[wpr_landing]</b> to display a comparision table of them. The shortcodes are available on the <a
246
- target="_blank" href="http://bit.ly/2bpKIlP">Pro Bundle</a><br/><br/></label>
247
- <?php endif; ?>
248
- </div>
249
- <?php
250
- }
251
-
252
- /**
253
- * Function for saving the review custom meta boxes.
254
- */
255
- function cwp_review_meta_boxes_save( $post_id ) {
256
- $is_autosave = wp_is_post_autosave( $post_id );
257
- $is_revision = wp_is_post_revision( $post_id );
258
- $is_valid_nonce = ( isset( $_POST['cwp_meta_box_nonce'] ) && wp_verify_nonce( $_POST['cwp_meta_box_nonce'], 'cwp_product_review_meta_box_nonce' ) ) ? 'true' :
259
- 'false';
260
- if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
261
- return;
262
- }
263
- // Added by Ash/Upwork
264
- do_action( 'wppr-amazon-savefields', $post_id );
265
- // Added by Ash/Upwork
266
- // Moved from inside the if loop to here by Ash/Upwork
267
- if ( isset( $_POST['cwp_meta_box_check'] ) ) {
268
- update_post_meta( $post_id, 'cwp_meta_box_check', sanitize_text_field( $_POST['cwp_meta_box_check'] ) );
269
- }
270
- // Moved from inside the if loop to here by Ash/Upwork
271
- if ( isset( $_POST['cwp_meta_box_check'] ) && $_POST['cwp_meta_box_check'] == 'Yes' ) {
272
- if ( isset( $_POST['cwp_rev_product_name'] ) ) {
273
- update_post_meta( $post_id, 'cwp_rev_product_name', apply_filters( 'wppr_sanitize_product_title', $_POST['cwp_rev_product_name'] ) );
274
- }
275
- if ( isset( $_POST['cwp_rev_price'] ) ) {
276
- update_post_meta( $post_id, 'cwp_rev_price', apply_filters( 'wppr_sanitize_product_price', $_POST['cwp_rev_price'] ) );
277
- }
278
- if ( isset( $_POST['cwp_image_link'] ) ) {
279
- update_post_meta( $post_id, 'cwp_image_link', apply_filters( 'wppr_sanitize_product_image', $_POST['cwp_image_link'] ) );
280
- }
281
- if ( isset( $_POST['cwp_product_affiliate_text'] ) ) {
282
- update_post_meta( $post_id, 'cwp_product_affiliate_text', sanitize_text_field( $_POST['cwp_product_affiliate_text'] ) );
283
- }
284
- if ( isset( $_POST['cwp_product_affiliate_link'] ) ) {
285
- update_post_meta( $post_id, 'cwp_product_affiliate_link', apply_filters( 'wppr_sanitize_link1', $_POST['cwp_product_affiliate_link'] ) );
286
- }
287
- if ( isset( $_POST['cwp_product_affiliate_text2'] ) ) {
288
- update_post_meta( $post_id, 'cwp_product_affiliate_text2', sanitize_text_field( $_POST['cwp_product_affiliate_text2'] ) );
289
- }
290
- if ( isset( $_POST['cwp_product_affiliate_link2'] ) ) {
291
- update_post_meta( $post_id, 'cwp_product_affiliate_link2', apply_filters( 'wppr_sanitize_link2', $_POST['cwp_product_affiliate_link2'] ) );
292
- }
293
- if ( ! empty( $_POST['cwp_bar_icon'] ) ) {
294
- update_post_meta( $post_id, 'cwp_bar_icon', esc_url( $_POST['cwp_bar_icon'] ) );
295
- } else {
296
- update_post_meta( $post_id, 'cwp_bar_icon', '' );
297
- }
298
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
299
- if ( isset( $_POST[ 'option_' . $i . '_content' ] ) ) {
300
- update_post_meta( $post_id, 'option_' . $i . '_content', sanitize_text_field( $_POST[ 'option_' . $i . '_content' ] ) );
301
- }
302
- if ( isset( $_POST[ 'option_' . $i . '_grade' ] ) ) {
303
- update_post_meta( $post_id, 'option_' . $i . '_grade', sanitize_text_field( $_POST[ 'option_' . $i . '_grade' ] ) );
304
- }
305
- }
306
- if ( isset( $_POST['cwp_rev_product_image'] ) ) {
307
- update_post_meta( $post_id, 'cwp_rev_product_image', sanitize_text_field( $_POST['cwp_rev_product_image'] ) );
308
- } elseif ( cwppos( 'cwppos_show_poweredby' ) == 'yes' || class_exists( 'CWP_PR_PRO_Core' ) ) {
309
- $image = '';
310
- if ( strlen( $img = get_the_post_thumbnail( $post_id, array( 150, 150 ) ) ) ) :
311
- $image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'optional-size' );
312
- $image = $image_array[0];
313
- else :
314
- $post = get_post( $post_id );
315
- $image = '';
316
- ob_start();
317
- ob_end_clean();
318
- $output = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches );
319
- // $image = $matches[1][0];
320
- endif;
321
- update_post_meta( $post_id, 'cwp_rev_product_image', $image );
322
- }
323
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
324
- if ( isset( $_POST[ 'cwp_option_' . $i . '_pro' ] ) ) {
325
- update_post_meta( $post_id, 'cwp_option_' . $i . '_pro', sanitize_text_field( $_POST[ 'cwp_option_' . $i . '_pro' ] ) );
326
- }
327
- if ( isset( $_POST[ 'cwp_option_' . $i . '_cons' ] ) ) {
328
- update_post_meta( $post_id, 'cwp_option_' . $i . '_cons', sanitize_text_field( $_POST[ 'cwp_option_' . $i . '_cons' ] ) );
329
- }
330
- }
331
- $overall_score = '';
332
- $iter = 0;
333
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
334
- ${'option' . $i . '_grade'} = get_post_meta( $post_id, 'option_' . $i . '_grade', true );
335
- if ( ! empty( ${'option' . $i . '_grade'} ) || ${'option' . $i . '_grade'} === '0' ) {
336
- $overall_score += ${'option' . $i . '_grade'};
337
- $iter ++;
338
- }
339
- }
340
- if ( $iter == 0 ) {
341
- $overall_score = 0;
342
- } else {
343
- $overall_score = $overall_score / $iter;
344
- }
345
- update_post_meta( $post_id, 'option_overall_score', $overall_score / 10 );
346
- }
347
- }
348
-
349
- function cwp_review_plugin_activation() {
350
- if ( 'yes' != get_option( 'cwp_review_activate' ) ) {
351
- add_option( 'cwp_review_activate', 'yes' );
352
- update_option( 'cwp_review_activate', 'yes' );
353
- $html = '<div class="updated">';
354
- $html .= '<p>';
355
- $html .= __( 'In order to use the WP Product Review plugin, go on and edit a post and set : <strong>Is this a review to yes</strong>.', 'cwppos' );
356
- $html .= '</p>';
357
- $html .= '</div><!-- /.updated -->';
358
- echo $html;
359
-
360
- } // end if
361
- } // end plugin_activation
362
- /**
363
- * Hooks.
364
- */
365
- add_action( 'add_meta_boxes', 'cwp_review_meta_boxes' );
366
- add_action( 'save_post', 'cwp_review_meta_boxes_save' );
367
- add_action( 'admin_notices', 'cwp_review_plugin_activation' );
368
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/cwp_top_products_widget.php DELETED
@@ -1,369 +0,0 @@
1
- <?php
2
- /**
3
- * CWP - Top Producs Widget
4
- */
5
-
6
-
7
-
8
- class cwp_top_products_widget extends WP_Widget {
9
-
10
- const RESTRICT_TITLE_CHARS = 100;
11
-
12
- function __construct() {
13
-
14
- parent::__construct(
15
-
16
- 'cwp_top_products_widget',
17
- __( 'CWP Top Products Widget', 'cwppos' ),
18
- // Widget description
19
- array( 'description' => __( 'This widget displays the top products based on their rating.', 'cwppos' ) )
20
- );
21
-
22
- }
23
-
24
-
25
- public function assets() {
26
-
27
- wp_enqueue_style( 'cwp-pac-widget-stylesheet', WPPR_URL . '/css/cwppos-widget.css' );
28
- wp_enqueue_script( 'cwp-pac-main-script', WPPR_URL . '/javascript/main.js',array( 'jquery', 'pie-chart' ),WPPR_LITE_VERSION,true );
29
- wp_enqueue_script( 'pie-chart', WPPR_URL . '/javascript/pie-chart.js',array( 'jquery' ), WPPR_LITE_VERSION,true );
30
-
31
- // Added by Ash/Upwork
32
- wp_enqueue_style( 'cwp-widget-stylesheet1', WPPR_URL . '/css/cwppos-widget-style1.css' );
33
- wp_enqueue_style( 'cwp-widget-rating', WPPR_URL . '/css/cwppos-widget-rating.css' );
34
- // Added by Ash/Upwork
35
- }
36
-
37
- // Added by Ash/Upwork
38
- public function adminAssets() {
39
- if ( is_admin() ) {
40
- wp_enqueue_style( 'cwp-widget-admin-css', WPPR_URL . '/css/cwppos-widget-admin.css' );
41
-
42
- wp_register_script( 'cwp-widget-script-top', WPPR_URL . '/javascript/widget-top.js' );
43
- wp_localize_script('cwp-widget-script-top', 'cwpw_top', array(
44
- 'widgetName' => $this->id_base,
45
- 'imageCheckbox' => $this->get_field_id( 'show_image' ),
46
- 'ratingSelect' => $this->get_field_id( 'cwp_tp_rating_type' ),
47
- ));
48
- wp_enqueue_script( 'cwp-widget-script-top' );
49
- }
50
- }
51
- // Added by Ash/Upwork
52
- public function custom_order_by( $orderby ) {
53
-
54
- return 'mt1.meta_value DESC, mt2.meta_value+0 DESC';
55
- }
56
- public function widget( $args, $instance ) {
57
- $this->assets();
58
- if ( isset( $instance['title'] ) ) {
59
-
60
- $title = apply_filters( 'widget_title', $instance['title'] ); }
61
-
62
- if ( isset( $instance['no_items'] ) ) {
63
-
64
- $no_items = apply_filters( 'widget_content', $instance['no_items'] ); }
65
-
66
- if ( isset( $instance['cwp_tp_category'] ) ) {
67
-
68
- $cwp_tp_category = apply_filters( 'widget_content', $instance['cwp_tp_category'] ); }
69
-
70
- if ( isset( $instance['title_type'] ) ) {
71
-
72
- $post_type = apply_filters( 'widget_content', $instance['title_type'] ); }
73
-
74
- if ( isset( $instance['show_image'] ) ) {
75
-
76
- $show_image = apply_filters( 'widget_content', $instance['show_image'] ); }
77
-
78
- // before and after widget arguments are defined by themes
79
- // echo "<div id='cwp_top_products_widget'>";
80
- echo $args['before_widget'];
81
-
82
- if ( ! empty( $title ) ) {
83
-
84
- echo $args['before_title'] . $title . $args['after_title']; }
85
-
86
- if ( $cwp_tp_category == 'All' ) { $cwp_tp_category = ''; }
87
- // Loop to get the most popular posts, ordered by the author's final grade.
88
- $query_args = array(
89
-
90
- 'posts_per_page' => $no_items, // limit it to the specified no of posts
91
- 'post_type' => 'any',
92
- 'post__not_in' => get_option( 'sticky_posts' ),
93
- 'category_name' => $cwp_tp_category,
94
- 'meta_key' => 'cwp_meta_box_check',
95
- 'meta_query' => array(
96
- array(
97
- 'key' => 'cwp_meta_box_check',
98
- 'value' => 'Yes',
99
- ),
100
- array(
101
- 'key' => 'option_overall_score',
102
- ),
103
-
104
- ),
105
- );
106
- add_filter( 'posts_orderby',array( $this, 'custom_order_by' ) );
107
- $cwp_products_loop = new WP_Query( $query_args );
108
- remove_filter( 'posts_orderby',array( $this, 'custom_order_by' ) );
109
- // echo $cwp_top_products_loop->request;
110
- // Added by Ash/Upwork
111
- if ( ! isset( $instance['cwp_tp_buynow'] ) ) {
112
- $instance['cwp_tp_buynow'] = __( 'Buy Now', 'cwppos' );
113
- }
114
-
115
- if ( ! isset( $instance['cwp_tp_readreview'] ) ) {
116
- $instance['cwp_tp_readreview'] = __( 'Read Review', 'cwppos' );
117
- }
118
-
119
- if ( ! isset( $instance['cwp_tp_layout'] ) ) {
120
- $instance['cwp_tp_layout'] = 'default.php';
121
- }
122
-
123
- if ( ! isset( $instance['cwp_tp_rating_type'] ) ) {
124
- $instance['cwp_tp_rating_type'] = 'round';
125
- }
126
-
127
- include trailingslashit( dirname( __FILE__ ) ) . '/widget-layouts/' . $instance['cwp_tp_layout'];
128
- // Added by Ash/Upwork
129
- echo $args['after_widget'];
130
-
131
- // echo "</div>"; // end #cwp_top_products_widget
132
- }
133
-
134
-
135
-
136
- // Widget Backend
137
- public function form( $instance ) {
138
-
139
- // Added by Ash/Upwork
140
- $this->adminAssets();
141
- // Added by Ash/Upwork
142
- if ( isset( $instance['title'] ) ) {
143
-
144
- $title = $instance['title'];
145
- } else {
146
- $title = __( 'Top Products', 'cwppos' );
147
- }
148
- if ( isset( $instance['no_items'] ) ) {
149
- $no_items = $instance['no_items'];
150
- } else {
151
- $no_items = __( '10', 'cwppos' );
152
- }
153
- if ( isset( $instance['cwp_tp_category'] ) ) {
154
- $cwp_tp_category = $instance['cwp_tp_category'];} else {
155
- $cwp_tp_category = 'Select Category';
156
- }
157
- if ( isset( $instance['title_type'] ) ) {
158
- $title_type = $instance['title_type'];
159
-
160
- } else {
161
- $title_type = false;
162
- }
163
-
164
- if ( isset( $instance['show_image'] ) ) {
165
- $show_image = $instance['show_image'];
166
-
167
- } else {
168
- $show_image = false;
169
- }
170
-
171
- // Added by Ash/Upwork
172
- $cwp_tp_buynow = __( 'Buy Now', 'cwppos' );
173
- if ( isset( $instance['cwp_tp_buynow'] ) ) {
174
- $cwp_tp_buynow = $instance['cwp_tp_buynow'];
175
- }
176
-
177
- $cwp_tp_readreview = __( 'Read Review', 'cwppos' );
178
- if ( isset( $instance['cwp_tp_readreview'] ) ) {
179
- $cwp_tp_readreview = $instance['cwp_tp_readreview'];
180
- }
181
-
182
- $cwp_tp_layout = 'default.php';
183
- if ( isset( $instance['cwp_tp_layout'] ) ) {
184
- $cwp_tp_layout = $instance['cwp_tp_layout'];
185
- }
186
-
187
- if ( $cwp_tp_layout == 'default.php' ) {
188
- $cwp_tp_rating_type = 'round';
189
- } else {
190
- $cwp_tp_rating_type = 'star';
191
- }
192
- // Added by Ash/Upwork
193
- $cwp_tp_categ_array = get_categories( 'hide_empty=0' );
194
-
195
- foreach ( $cwp_tp_categ_array as $categs ) {
196
-
197
- $cwp_tp_all_categories[ $categs->slug ] = $categs->name;
198
-
199
- }
200
-
201
- // Widget admin form
202
- ?>
203
-
204
- <p>
205
-
206
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'cwppos' ); ?></label>
207
-
208
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
209
-
210
- </p>
211
-
212
-
213
-
214
- <p>
215
-
216
- <label for="<?php echo $this->get_field_id( 'no_items' ); ?>"><?php _e( 'Number of posts to show:', 'cwppos' ); ?></label>
217
-
218
- <input id="<?php echo $this->get_field_id( 'no_items' ); ?>" name="<?php echo $this->get_field_name( 'no_items' ); ?>" size="3" type="text" value="<?php echo esc_attr( $no_items ); ?>" />
219
-
220
- </p>
221
-
222
-
223
-
224
- <p>
225
-
226
- <?php $cwp_tp_selected_categ = esc_attr( $cwp_tp_category ); ?>
227
-
228
- <label for="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>"><?php _e( 'Category:', 'cwppos' ); ?></label>
229
-
230
- <select id="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_category' ); ?>">
231
- <?php echo '<option>All</option>'; ?>
232
-
233
- <?php foreach ( $cwp_tp_all_categories as $categ_slug => $categ_name ) : ?>
234
-
235
- <?php if ( $categ_slug == $cwp_tp_selected_categ ) {
236
-
237
- echo '<option selected>' . $categ_slug . '</option>';
238
-
239
- } elseif ( $categ_slug == '' ) {
240
-
241
- echo '<option>There are no categs</select>';
242
-
243
- } else {
244
-
245
- echo '<option>' . $categ_slug . '</option>';
246
-
247
- } ?>
248
-
249
- <?php endforeach; ?>
250
-
251
- </select>
252
-
253
- </p>
254
-
255
- <?php // Added by Ash/Upwork ?>
256
-
257
- <p>
258
-
259
- <?php $cwp_tp_layout = esc_attr( $cwp_tp_layout ); ?>
260
-
261
- <label for="<?php echo $this->get_field_id( 'cwp_tp_layout' ); ?>"><?php _e( 'Layout:', 'cwppos' ); ?></label>
262
-
263
- <?php
264
-
265
- $layouts = array();
266
- $customLayoutFiles = glob( trailingslashit( dirname( __FILE__ ) ) . 'widget-layouts/*.php' );
267
- foreach ( $customLayoutFiles as $file ) {
268
- $layouts[ basename( $file ) ] = ucwords( basename( $file, '.php' ) );
269
- }
270
-
271
- foreach ( $layouts as $key => $val ) :
272
- $extra = '';
273
- if ( $key == $cwp_tp_layout ) { $extra = 'checked'; }
274
-
275
- $styleName = strtolower( str_replace( ' ', '', $val ) );
276
- $id = $this->get_field_id( $styleName );
277
- ?>
278
- <br>
279
- <input type="radio" name="<?php echo $this->get_field_name( 'cwp_tp_layout' ); ?>" value="<?php echo $key;?>" id="<?php echo $id . 'style'?>" <?php echo $extra;?> class="wppr-stylestyle"><label for="<?php echo $id . 'style';?>" class="wppr-stylestyle"><?php echo $val;?></label>
280
- <span class="wppr-styleimg" id="<?php echo $id . 'style'?>img">
281
- <img src="<?php echo WPPR_URL . '/assets/' . $styleName . '.png';?>">
282
- </span>
283
- <?php
284
- endforeach;
285
- ?>
286
-
287
- </p>
288
-
289
- <p class="wppr-customField" style="display: none">
290
-
291
- <?php $cwp_tp_buynow = esc_attr( $cwp_tp_buynow ); ?>
292
-
293
- <label for="<?php echo $this->get_field_id( 'cwp_tp_buynow' ); ?>"><?php _e( 'Buy Now text:', 'cwppos' ); ?></label>
294
-
295
- <input id="<?php echo $this->get_field_id( 'cwp_tp_buynow' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_buynow' ); ?>" class="widefat" type="text" value="<?php echo $cwp_tp_buynow; ?>" />
296
-
297
- </p>
298
-
299
- <p class="wppr-customField" style="display: none">
300
-
301
- <?php $cwp_tp_readreview = esc_attr( $cwp_tp_readreview ); ?>
302
-
303
- <label for="<?php echo $this->get_field_id( 'cwp_tp_readreview' ); ?>"><?php _e( 'Read Review text:', 'cwppos' ); ?></label>
304
-
305
- <input id="<?php echo $this->get_field_id( 'cwp_tp_readreview' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_readreview' ); ?>" class="widefat" type="text" value="<?php echo $cwp_tp_readreview; ?>" />
306
-
307
- </p>
308
-
309
- <?php // Added by Ash/Upwork ?>
310
-
311
- <p>
312
-
313
- <label for="<?php echo $this->get_field_id( 'title_type' ); ?>"><?php _e( 'Display Product Titles :', 'cwppos' ); ?></label>
314
-
315
- <input id="<?php echo $this->get_field_id( 'title_type' ); ?>" name="<?php echo $this->get_field_name( 'title_type' ); ?>" type="checkbox" <?php checked( $title_type ); ?> />
316
- </p>
317
-
318
- <p>
319
-
320
- <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Display Product Image :', 'cwppos' ); ?></label>
321
-
322
- <input id="<?php echo $this->get_field_id( 'show_image' ); ?>" name="<?php echo $this->get_field_name( 'show_image' ); ?>" type="checkbox" <?php checked( $show_image ); ?> />
323
- </p>
324
-
325
-
326
- <?php }
327
-
328
-
329
-
330
- // Updating widget replacing old instances with new
331
- public function update( $new_instance, $old_instance ) {
332
-
333
- $instance = $old_instance;
334
-
335
- $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
336
-
337
- $instance['no_items'] = ( ! empty( $new_instance['no_items'] ) ) ? strip_tags( $new_instance['no_items'] ) : '';
338
-
339
- $instance['cwp_tp_category'] = ( ! empty( $new_instance['cwp_tp_category'] ) ) ? strip_tags( $new_instance['cwp_tp_category'] ) : '';
340
-
341
- $instance['title_type'] = (bool) $new_instance['title_type'] ;
342
- $instance['show_image'] = (bool) $new_instance['show_image'] ;
343
-
344
- // Added by Ash/Upwork
345
- $instance['cwp_tp_buynow'] = ( ! empty( $new_instance['cwp_tp_buynow'] ) ) ? strip_tags( $new_instance['cwp_tp_buynow'] ) : '';
346
- $instance['cwp_tp_readreview'] = ( ! empty( $new_instance['cwp_tp_readreview'] ) ) ? strip_tags( $new_instance['cwp_tp_readreview'] ) : '';
347
- $instance['cwp_tp_layout'] = ( ! empty( $new_instance['cwp_tp_layout'] ) ) ? strip_tags( $new_instance['cwp_tp_layout'] ) : '';
348
- $instance['cwp_tp_rating_type'] = ( ! empty( $new_instance['cwp_tp_rating_type'] ) ) ? strip_tags( $new_instance['cwp_tp_rating_type'] ) : '';
349
- // Added by Ash/Upwork
350
- return $instance;
351
-
352
- }
353
-
354
-
355
-
356
- } // end Class cwp_top_products_widget
357
-
358
-
359
-
360
-
361
-
362
- // Register and load the widget
363
- function cwp_load_top_products_widget() {
364
-
365
- register_widget( 'cwp_top_products_widget' );
366
-
367
- }
368
-
369
- add_action( 'widgets_init', 'cwp_load_top_products_widget' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/images/ajaxload.gif DELETED
Binary file
inc/widget-layouts/default.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- echo '<ul>';
3
-
4
- while ( $cwp_products_loop->have_posts() ) : $cwp_products_loop->the_post();
5
-
6
- $product_image = wppr_get_image_id( get_the_ID(),get_post_meta( get_the_ID(), 'cwp_rev_product_image', true ),'wppr_widget_image' );
7
- $product_title = ($post_type == true) ? get_post_meta( $cwp_products_loop->post->ID, 'cwp_rev_product_name', true ) : get_the_title();
8
- $product_title_display = $product_title;
9
- if ( strlen( $product_title_display ) > self::RESTRICT_TITLE_CHARS ) {
10
- $product_title_display = substr( $product_title_display, 0, self::RESTRICT_TITLE_CHARS ) . '...';
11
- }
12
- ?>
13
-
14
-
15
-
16
- <li class="cwp-popular-review cwp_top_posts_widget_<?php the_ID(); if ( $show_image == true&& ! empty( $product_image ) ) { echo ' wppr-cols-3'; } else { echo ' wppr-cols-2'; } ?>">
17
- <?php
18
-
19
- if ( $show_image == true&& ! empty( $product_image ) ) {
20
- ?>
21
-
22
- <img class="cwp_rev_image wppr-col" src="<?php echo $product_image;?>" alt="<?php echo $product_title; ?>">
23
- <?php } ?>
24
- <a href="<?php the_permalink(); ?>" class="wppr-col" title="<?php echo $product_title; ?>">
25
-
26
- <?php echo $product_title_display; ?>
27
-
28
- </a>
29
-
30
-
31
-
32
-
33
-
34
- <?php
35
-
36
- for ( $i = 1; $i < 6; $i++ ) {
37
- ${'option' . $i . '_content'} = get_post_meta( $cwp_products_loop->post->ID, 'option_' . $i . '_content', true );
38
- // if(empty(${"option".$i."_content"})) { ${"option".$i."_content"} = __("Default Feature ".$i, "cwppos"); }
39
- }
40
- $review_score = cwppos_calc_overall_rating( $cwp_products_loop->post->ID );
41
- $review_score = $review_score['overall'];
42
-
43
- if ( ! empty( $review_score ) ) { ?>
44
-
45
- <div class="review-grade-widget wppr-col">
46
-
47
- <div class="cwp-review-chart absolute">
48
-
49
- <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>"><span></span></div>
50
-
51
- </div><!-- end .chart -->
52
-
53
- </div>
54
-
55
- <?php } ?>
56
-
57
- </li><!-- end .popular-review -->
58
-
59
-
60
-
61
- <?php endwhile; ?>
62
-
63
- <?php wp_reset_postdata(); // reset the query
64
-
65
-
66
-
67
- echo '</ul>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/widget-layouts/style 1.php DELETED
@@ -1,76 +0,0 @@
1
- <div class="wppr-prodlist">
2
- <?php
3
- while ( $cwp_products_loop->have_posts() ) : $cwp_products_loop->the_post();
4
-
5
- $product_image = wppr_get_image_id( get_the_ID(),get_post_meta( get_the_ID(), 'cwp_rev_product_image', true ),'thumbnail' );
6
- $product_title = ($post_type == true) ? get_post_meta( $cwp_products_loop->post->ID, 'cwp_rev_product_name', true ) : get_the_title();
7
- $product_title_display = $product_title;
8
- if ( strlen( $product_title_display ) > self::RESTRICT_TITLE_CHARS ) {
9
- $product_title_display = substr( $product_title_display, 0, self::RESTRICT_TITLE_CHARS ) . '...';
10
- }
11
- $affiliate_link = get_post_meta( get_the_ID(), 'cwp_product_affiliate_link', true );
12
- $review_link = get_the_permalink();
13
-
14
- $showingImg = $show_image == true&& ! empty( $product_image );
15
- ?>
16
-
17
- <div class="wppr-prodrow">
18
- <?php if ( $showingImg ) { ?>
19
- <div class="wppr-prodrowleft">
20
- <a href="<?php echo $review_link; ?>" class="wppr-col" title="<?php echo $product_title; ?>">
21
- <img class="cwp_rev_image wppr-col" src="<?php echo $product_image;?>" alt="<?php echo $product_title; ?>"/>
22
- </a>
23
- </div>
24
- <?php
25
- }
26
- ?>
27
- <div class="wppr-prodrowright <?php echo $showingImg ? 'wppr-prodrowrightadjust' : ''?>">
28
- <p><strong><?php echo $product_title_display; ?></strong></p>
29
- <?php
30
- for ( $i = 1; $i < 6; $i++ ) {
31
- ${'option' . $i . '_content'} = get_post_meta( $cwp_products_loop->post->ID, 'option_' . $i . '_content', true );
32
- // if(empty(${"option".$i."_content"})) { ${"option".$i."_content"} = __("Default Feature ".$i, "cwppos"); }
33
- }
34
- $review_score = cwppos_calc_overall_rating( $cwp_products_loop->post->ID );
35
- $review_score = $review_score['overall'];
36
-
37
- if ( ! empty( $review_score ) ) {
38
- if ( $instance['cwp_tp_rating_type'] == 'round' ) {
39
- ?>
40
- <div class="review-grade-widget wppr-col">
41
- <div class="cwp-review-chart relative">
42
- <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>"><span></span></div>
43
- </div><!-- end .chart -->
44
- </div>
45
- <div class="clear"></div>
46
- <?php
47
- } else {
48
- ?>
49
- <div class="wppr-rating">
50
- <div style="width:<?php echo $review_score; ?>%;"> <?php echo $review_score; ?></div>
51
- </div>
52
- <?php
53
- }
54
- }
55
- ?>
56
- <p class="wppr-style1-buttons">
57
- <?php
58
- $link = "<a href='{$affiliate_link}' rel='nofollow' target='_blank' class='wppr-bttn'>" . __( $instance['cwp_tp_buynow'], 'cwppos' ) . '</a>';
59
- if ( ! empty( $instance['cwp_tp_buynow'] ) ) {
60
- echo apply_filters( 'wppr_widget_style1_buynow_link', $link, get_the_ID(), $affiliate_link, $instance['cwp_tp_buynow'] );
61
- }
62
-
63
- $link = "<a href='{$review_link}' rel='nofollow' target='_blank' class='wppr-bttn'>" . __( $instance['cwp_tp_readreview'], 'cwppos' ) . '</a>';
64
- if ( ! empty( $instance['cwp_tp_readreview'] ) ) {
65
- echo apply_filters( 'wppr_widget_style1_readreview_link', $link, get_the_ID(), $review_link, $instance['cwp_tp_readreview'] );
66
- }
67
- ?>
68
- </p>
69
- </div>
70
- <div class="clear"></div>
71
- </div>
72
- <?php endwhile; ?>
73
-
74
- <?php wp_reset_postdata(); // reset the query ?>
75
-
76
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/wppr-filters.php DELETED
@@ -1,143 +0,0 @@
1
- <?php
2
- /**
3
- * Filters of WPPR
4
- *
5
- * @package WPPR
6
- * @author ThemeIsle
7
- * @since 2.6.9
8
- */
9
-
10
- add_filter( 'wppr_review_product_name','wppr_review_product_name_filter' );
11
-
12
- /**
13
- * Filter name of the review
14
- *
15
- * @param int $id Id of the review.
16
- * @return string $name Name of the review
17
- * @since 2.6.9
18
- */
19
- function wppr_review_product_name_filter( $id = '' ) {
20
-
21
- $name = get_post_meta( $id, 'cwp_rev_product_name', true );
22
- $name = ( empty( $name ) ) ? get_the_title( $id ) : $name;
23
- return apply_filters( 'wppr_review_product_name_html' , $name );
24
- }
25
-
26
- add_filter( 'wppr_review_product_name_html','wppr_review_product_name_html_filter' );
27
-
28
- /**
29
- * Filter html tag for the review name
30
- *
31
- * @param string $name name of the review.
32
- * @return string $html tag for the title
33
- * @since 2.6.9
34
- */
35
- function wppr_review_product_name_html_filter( $name = '' ) {
36
-
37
- return '<h2 class="cwp-item" itemprop="name" >' . $name . '</h2>';
38
-
39
- }
40
-
41
- add_filter( 'wppr_option_name_html','wppr_option_name_html_filter',10,2 );
42
-
43
- /**
44
- * Filter html tag for the options name
45
- *
46
- * @param int $id Id of the review.
47
- * @param string $name Name of the option.
48
- * @return string $html tag for the option name
49
- * @since 2.6.9
50
- */
51
- function wppr_option_name_html_filter( $id = 0, $name = '' ) {
52
-
53
- return ( ! empty( $name ) ) ? '<h3 >' . $name . '</h3>' : '';
54
-
55
- }
56
-
57
- add_filter( 'wppr_review_pros_text','wppr_review_pros_text_filter',10,2 );
58
-
59
- /**
60
- * Filter html tag for the pros text heading
61
- *
62
- * @param int $id Id of the review.
63
- * @param string $name The pros heading text.
64
- * @return string $html tag for the pros text
65
- * @since 2.6.9
66
- */
67
- function wppr_review_pros_text_filter( $id = 0, $name = '' ) {
68
-
69
- return ( ! empty( $name ) ) ? '<h2>' . $name . '</h2>' : '';
70
-
71
- }
72
-
73
- add_filter( 'wppr_review_cons_text','wppr_review_cons_text_filter',10,2 );
74
-
75
- /**
76
- * Filter html tag for the cons text heading
77
- *
78
- * @param int $id Id of the review.
79
- * @param string $name The cons heading text.
80
- * @return string $html tag for the cons text
81
- * @since 2.6.9
82
- */
83
- function wppr_review_cons_text_filter( $id = 0, $name = '' ) {
84
-
85
- return ( ! empty( $name ) ) ? '<h2>' . $name . '</h2>' : '';
86
-
87
- }
88
-
89
-
90
- /**
91
- * Add pro pointer for the amazon upsell link
92
- *
93
- * @param array $p The pointers array.
94
- * @return array The altered pointers array with amazon upsell.
95
- * @since 2.9.0
96
- */
97
-
98
-
99
- add_filter( 'wppr_admin_pointers-post', 'wppr_admin_pointers' );
100
- function wppr_admin_pointers( $p ) {
101
- $p['amazon_upsell'] = array(
102
- 'target' => '#wppr_product_affiliate_link_upsell',
103
- 'options' => array(
104
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
105
- apply_filters( 'wppr_amazon_title_upsell_text', null ),
106
- apply_filters( 'wppr_amazon_body_upsell_text', null )
107
- ),
108
- 'position' => array( 'edge' => 'left', 'align' => 'left' ),
109
- ),
110
- );
111
- return $p;
112
- }
113
-
114
- /**
115
- * Sanitize links in the options review panel
116
- *
117
- * @param string $text The raw value.
118
- * @return string The sanitized value.
119
- * @since 2.9.6
120
- */
121
- add_filter( 'wppr_sanitize_link1', 'wppr_sanitize_link' );
122
- add_filter( 'wppr_sanitize_link2', 'wppr_sanitize_link' );
123
-
124
- function wppr_sanitize_link( $text ) {
125
- return esc_url( $text );
126
- }
127
-
128
-
129
- /**
130
- * Sanitize texts in the options review panel
131
- *
132
- * @param string $text The raw value.
133
- * @return string The sanitized value.
134
- * @since 2.9.6
135
- */
136
- add_filter( 'wppr_sanitize_product_price', 'wppr_sanitize_text' );
137
- add_filter( 'wppr_sanitize_product_title', 'wppr_sanitize_text' );
138
- add_filter( 'wppr_sanitize_product_image', 'wppr_sanitize_text' );
139
-
140
-
141
- function wppr_sanitize_text( $text ) {
142
- return sanitize_text_field( $text );
143
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/wppr-main.php DELETED
@@ -1,509 +0,0 @@
1
- <?php
2
- /**
3
- * Core functions of WPPR
4
- *
5
- * @package WPPR
6
- * @author ThemeIsle
7
- * @since 1.0.0
8
- */
9
- function cwppos_calc_overall_rating( $id ) {
10
- $options = cwppos();
11
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
12
- ${'option' . $i . '_grade'} = get_post_meta( $id, 'option_' . $i . '_grade', true );
13
- // echo ${"option".$i."_grade"};
14
- ${'comment_meta_option_nr_' . $i} = 0;
15
- ${'comment_meta_option_' . $i} = 0;
16
-
17
- }
18
- $nr_of_comments = 0;
19
- if ( $options['cwppos_show_userreview'] == 'yes' ) {
20
- $args = array(
21
- 'status' => 'approve',
22
- 'post_id' => $id, // use post_id, not post_ID
23
- );
24
- $comments = get_comments( $args );
25
- $nr_of_comments = get_comments_number( $id );
26
- foreach ( $comments as $comment ) :
27
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
28
- if ( get_comment_meta( $comment->comment_ID, "meta_option_{$i}", true ) !== '' ) {
29
- ${'comment_meta_option_nr_' . $i} ++;
30
- ${'comment_meta_option_' . $i} += get_comment_meta( $comment->comment_ID, "meta_option_{$i}", true ) * 10;
31
- }
32
-
33
- // var_dump(${"comment_meta_option_".$i});
34
- }
35
- endforeach;
36
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
37
- if ( ${'comment_meta_option_nr_' . $i} !== 0 ) {
38
- ${'comment_meta_option_' . $i} = ${'comment_meta_option_' . $i} / ${'comment_meta_option_nr_' . $i};
39
- }
40
- }
41
- } else {
42
- $options['cwppos_infl_userreview'] = 0;
43
- }
44
- if ( $nr_of_comments == 0 ) {
45
- $options['cwppos_infl_userreview'] = 0;
46
- }
47
- $overall_score = 0;
48
- $iter = 0;
49
- $rating = array();
50
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
51
- if ( ${'comment_meta_option_nr_' . $i} !== 0 ) {
52
- $infl = $options['cwppos_infl_userreview'];
53
- } else {
54
- $infl = 0;
55
-
56
- }
57
- if ( ! empty( ${'option' . $i . '_grade'} ) || ${'option' . $i . '_grade'} === '0' ) {
58
- // if($infl !== 0 ){
59
- ${'option' . $i . '_grade'} = round( ( ${'option' . $i . '_grade'} * ( 100 - $infl ) + ${'comment_meta_option_' . $i} * $infl ) / 100 );
60
- // }else{
61
- // }
62
- $iter ++;
63
- $rating[ 'option' . $i ] = round( ${'option' . $i . '_grade'} );
64
- $overall_score += ${'option' . $i . '_grade'};
65
- }
66
- }
67
- // $overall_score = ($option1_grade + $option2_grade + $option3_grade + $option4_grade + $option5_grade) / $iter;
68
- if ( $iter !== 0 ) {
69
- $rating['overall'] = $overall_score / $iter;
70
- } else {
71
- $rating['overall'] = 0;
72
- }
73
- update_post_meta( $id, 'option_overall_score', $rating['overall'] );
74
-
75
- return $rating;
76
-
77
- }
78
-
79
- function cwppos_show_review( $id = '', $visual = 'full' ) {
80
- global $post;
81
- if ( (is_null( $post ) && $id == '') || post_password_required( $post ) ) {
82
- return false;
83
- }
84
- if ( $id == '' ) {
85
- $id = $post->ID;
86
- }
87
- $cwp_review_stored_meta = get_post_meta( $id );
88
- $return_string = '';
89
- if ( isset( $cwp_review_stored_meta['cwp_meta_box_check'][0] ) && $cwp_review_stored_meta['cwp_meta_box_check'][0] == 'Yes' ) {
90
- wp_enqueue_style( 'cwp-pac-frontpage-stylesheet', WPPR_URL . '/css/frontpage.css', array(), WPPR_LITE_VERSION );
91
- wp_enqueue_script( 'pie-chart', WPPR_URL . '/javascript/pie-chart.js', array( 'jquery' ), WPPR_LITE_VERSION, true );
92
- wp_enqueue_script( 'cwp-pac-main-script', WPPR_URL . '/javascript/main.js', array(
93
- 'jquery',
94
- 'pie-chart',
95
- ), WPPR_LITE_VERSION, true );
96
- $cwp_price = get_post_meta( $id, 'cwp_rev_price', true );
97
- $p_string = $cwp_price;
98
- $p_name = apply_filters( 'wppr_review_product_name', $id );
99
- if ( $p_string != '' ) {
100
- // Added by Ash/Upwork
101
- $cwp_price = do_shortcode( $cwp_price );
102
- // Added by Ash/Upwork
103
- $p_price = preg_replace( '/[^0-9.,]/', '', $cwp_price );
104
- $p_currency = preg_replace( '/[0-9.,]/', '', $cwp_price );
105
- // Added by Ash/Upwork
106
- $p_disable = apply_filters( 'wppr_disable_price_richsnippet', false );
107
- // Added by Ash/Upwork
108
- if ( ! $p_disable ) {
109
- $p_string = '<span itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span itemprop="priceCurrency">' . $p_currency . '</span><span itemprop="price">' . $p_price . '</span></span>';
110
- }
111
- }
112
- $product_image = do_shortcode( get_post_meta( $id, 'cwp_rev_product_image', true ) );
113
- $imgurl = do_shortcode( get_post_meta( $id, 'cwp_image_link', true ) );
114
- $lightbox = '';
115
- $feat_image = wp_get_attachment_url( get_post_thumbnail_id( $id ) );
116
- if ( ! empty( $product_image ) ) {
117
- $product_image_cropped = wppr_get_image_id( $id, $product_image );
118
- } else {
119
- $product_image_cropped = wppr_get_image_id( $id );
120
- $product_image = $feat_image;
121
- }
122
- if ( $imgurl == 'image' ) {
123
- // no means no disabled
124
- if ( cwppos( 'cwppos_lighbox' ) == 'no' ) {
125
- $lightbox = 'data-lightbox="' . $product_image . '"';
126
- wp_enqueue_script( 'img-lightbox', WPPR_URL . '/javascript/lightbox.min.js', array(), WPPR_LITE_VERSION, array() );
127
- wp_enqueue_style( 'img-lightbox-css', WPPR_URL . '/css/lightbox.css', array(), WPPR_LITE_VERSION );
128
- }
129
- } else {
130
- $product_image = do_shortcode( get_post_meta( $id, 'cwp_product_affiliate_link', true ) );
131
- }
132
- $rating = cwppos_calc_overall_rating( $id );
133
- $divrating = $rating['overall'] / 10;
134
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
135
- ${'option' . $i . '_content'} = do_shortcode( get_post_meta( $id, 'option_' . $i . '_content', true ) );
136
- if ( empty( ${'option' . $i . '_content'} ) ) {
137
- ${'option' . $i . '_content'} = __( 'Default Feature ' . $i, 'cwppos' );
138
- }
139
- }
140
- $commentNr = get_comments_number( $id ) + 1;
141
- if ( $visual == 'full' ) {
142
- $return_string .= '<section id="review-statistics" class="article-section" itemscope itemtype="http://schema.org/Product">
143
- <div class="review-wrap-up cwpr_clearfix" >
144
- <div class="cwpr-review-top cwpr_clearfix">
145
- <span itemprop="name">' . $p_name . '</span>
146
-
147
- <span class="cwp-item-price cwp-item">' . $p_string . '</span>
148
- </div><!-- end .cwpr-review-top -->
149
- <div class="review-wu-left">
150
- <div class="rev-wu-image">
151
- <a href="' . $product_image . '" ' . $lightbox . ' rel="nofollow" target="_blank"><img itemprop="image" src="' . $product_image_cropped . '" alt="' . do_shortcode( get_post_meta( $id, 'cwp_rev_product_name', true ) ) . '" class="photo photo-wrapup wppr-product-image" /></a>
152
- </div><!-- end .rev-wu-image -->
153
- <div class="review-wu-grade">';
154
- }
155
- if ( $visual == 'full' || $visual == 'yes' ) {
156
- $extra_class = $visual == 'yes' ? 'cwp-chart-embed' : '';
157
- $return_string .= '<div class="cwp-review-chart ' . $extra_class . '">
158
- <meta itemprop="datePublished" datetime="' . get_the_time( 'Y-m-d', $id ) . '">';
159
- if ( cwppos( 'cwppos_infl_userreview' ) != 0 && $commentNr > 1 ) {
160
- $return_string .= '<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating" class="cwp-review-percentage" data-percent="';
161
- $return_string .= $rating['overall'] . '"><span itemprop="ratingValue" class="cwp-review-rating">' . $divrating . '</span><meta itemprop="bestRating" content = "10"/>
162
- <meta itemprop="ratingCount" content="' . $commentNr . '"> </div>';
163
-
164
- } else {
165
- $return_string .= '<span itemscope itemtype="http://schema.org/Review"><span itemprop="author" itemscope itemtype="http://schema.org/Person" >
166
- <meta itemprop="name" content="' . get_the_author() . '"/>
167
- </span><span itemprop="itemReviewed" itemscope itemtype="http://schema.org/Product"><meta itemprop="name" content="' . do_shortcode( get_post_meta( $id, 'cwp_rev_product_name', true ) ) . '"/></span><div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" class="cwp-review-percentage" data-percent="';
168
- $return_string .= $rating['overall'] . '"><span itemprop="ratingValue" class="cwp-review-rating">' . $divrating . '</span> <meta itemprop="bestRating" content="10"> </div></span>';
169
- }
170
- $return_string .= '</div><!-- end .chart -->';
171
- }
172
- if ( $visual == 'full' ) {
173
- $return_string .= '</div><!-- end .review-wu-grade -->
174
- <div class="review-wu-bars">';
175
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
176
- if ( ! empty( ${'option' . $i . '_content'} ) && isset( $rating[ 'option' . $i ] ) && ( ! empty( $rating[ 'option' . $i ] ) || $rating[ 'option' . $i ] === '0' ) && strtoupper( ${'option' . $i . '_content'} ) != 'DEFAULT FEATURE ' . $i ) {
177
- $return_string .= '<div class="rev-option" data-value=' . $rating[ 'option' . $i ] . '>
178
- <div class="cwpr_clearfix">
179
- ' . apply_filters( 'wppr_option_name_html', $id, ${'option' . $i . '_content'} ) . '
180
- <span>' . round( $rating[ 'option' . $i ] / 10 ) . '/10</span>
181
- </div>
182
- <ul class="cwpr_clearfix"></ul>
183
- </div>';
184
- }
185
- }
186
- $return_string .= '</div><!-- end .review-wu-bars -->
187
- </div><!-- end .review-wu-left -->
188
- <div class="review-wu-right">
189
- <div class="pros">';
190
- }
191
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
192
- ${'pro_option_' . $i} = do_shortcode( get_post_meta( $id, 'cwp_option_' . $i . '_pro', true ) );
193
- if ( empty( ${'pro_option_' . $i} ) ) {
194
- ${'pro_option_' . $i} = '';
195
- }
196
- }
197
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
198
- ${'cons_option_' . $i} = do_shortcode( get_post_meta( $id, 'cwp_option_' . $i . '_cons', true ) );
199
- if ( empty( ${'cons_option_' . $i} ) ) {
200
- ${'cons_option_' . $i} = '';
201
- }
202
- }
203
- if ( $visual == 'full' ) {
204
- $return_string .= apply_filters( 'wppr_review_pros_text', $id, __( cwppos( 'cwppos_pros_text' ), 'cwppos' ) ) . ' <ul>';
205
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
206
- if ( ! empty( ${'pro_option_' . $i} ) ) {
207
- $return_string .= ' <li>' . ${'pro_option_' . $i} . '</li>';
208
- }
209
- }
210
- $return_string .= ' </ul>
211
- </div><!-- end .pros -->
212
- <div class="cons">';
213
- $return_string .= apply_filters( 'wppr_review_cons_text', $id, __( cwppos( 'cwppos_cons_text' ), 'cwppos' ) ) . ' <ul>';
214
- for ( $i = 1; $i <= cwppos( 'cwppos_option_nr' ); $i ++ ) {
215
- if ( ! empty( ${'cons_option_' . $i} ) ) {
216
- $return_string .= ' <li>' . ${'cons_option_' . $i} . '</li>';
217
- }
218
- }
219
- $return_string .= '
220
- </ul>
221
- </div>
222
- </div><!-- end .review-wu-right -->
223
- </div><!-- end .review-wrap-up -->
224
- </section><!-- end #review-statistics -->';
225
- }
226
- if ( cwppos( 'cwppos_show_poweredby' ) == 'yes' && ! class_exists( 'CWP_PR_PRO_Core' ) ) {
227
- $return_string .= '<div style="font-size:12px;width:100%;float:right"><p style="float:right;">Powered by <a href="http://wordpress.org/plugins/wp-product-review/" target="_blank" rel="nofollow" > WP Product Review</a></p></div>';
228
- }
229
- $affiliate_text = do_shortcode( get_post_meta( $id, 'cwp_product_affiliate_text', true ) );
230
- $affiliate_link = do_shortcode( get_post_meta( $id, 'cwp_product_affiliate_link', true ) );
231
- $affiliate_text2 = do_shortcode( get_post_meta( $id, 'cwp_product_affiliate_text2', true ) );
232
- $affiliate_link2 = do_shortcode( get_post_meta( $id, 'cwp_product_affiliate_link2', true ) );
233
- if ( ! empty( $affiliate_text2 ) && ! empty( $affiliate_link2 ) ) {
234
- $bclass = 'affiliate-button2 affiliate-button';
235
- } else {
236
- $bclass = 'affiliate-button';
237
- }
238
- if ( $visual == 'full' && ! empty( $affiliate_text ) && ! empty( $affiliate_link ) ) {
239
- $return_string .= '<div class="' . $bclass . '">
240
- <a href="' . $affiliate_link . '" rel="nofollow" target="_blank"><span>' . $affiliate_text . '</span> </a>
241
- </div><!-- end .affiliate-button -->';
242
- }
243
- if ( $visual == 'full' && ! empty( $affiliate_text2 ) && ! empty( $affiliate_link2 ) ) {
244
- $return_string .= '<div class="affiliate-button affiliate-button2">
245
- <a href="' . $affiliate_link2 . '" rel="nofollow" target="_blank"><span>' . $affiliate_text2 . '</span> </a>
246
- </div><!-- end .affiliate-button -->';
247
- }
248
- if ( $visual == 'no' ) {
249
- $return_string = round( $divrating );
250
- }
251
- }
252
-
253
- return $return_string;
254
- }
255
-
256
- function cwppos_pac_admin_init() {
257
- wp_enqueue_style( 'cwp-pac-admin-stylesheet', WPPR_URL . '/css/dashboard_styles.css' );
258
- wp_register_script( 'cwp-pac-script', WPPR_URL . '/javascript/admin-review.js', array( 'jquery' ), '20140101', true );
259
- wp_localize_script( 'cwp-pac-script', 'ispro', array( 'value' => class_exists( 'CWP_PR_PRO_Core' ) ) );
260
- wp_enqueue_script( 'cwp-pac-script' );
261
- if ( class_exists( 'CWP_PR_PRO_Core' ) ) {
262
- wp_enqueue_style( 'cwp-pac-pro-admin-stylesheet', WPPR_URL . '/css/pro_dashboard_styles.css' );
263
- }
264
- do_action( 'wppr-amazon-enqueue' );
265
- }
266
-
267
- function wppr_get_image_id( $post_id, $image_url = '', $size = 'thumbnail' ) {
268
- global $wpdb;
269
- // filter for image size;
270
- $size = apply_filters( 'wppr_review_image_size', $size, $post_id );
271
- if ( ! empty( $image_url ) && $image_url !== false ) {
272
- $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ) );
273
- $image_id = isset( $attachment[0] ) ? $attachment[0] : '';
274
- } else {
275
- $image_id = get_post_thumbnail_id( $post_id );
276
-
277
- }
278
- $image_thumb = '';
279
- if ( ! empty( $image_id ) ) {
280
- $image_thumb = wp_get_attachment_image_src( $image_id, $size );
281
- if ( $size !== 'thumbnail' ) {
282
- if ( $image_thumb[0] === $image_url ) {
283
- $image_thumb = wp_get_attachment_image_src( $image_id, 'thumbnail' );
284
- }
285
- }
286
- }
287
-
288
- return isset( $image_thumb[0] ) ? $image_thumb[0] : $image_url;
289
- }
290
-
291
- function custom_bar_icon() {
292
- $options = cwppos();
293
- if ( ( isset( $options['cwppos_show_poweredby'] ) && $options['cwppos_show_poweredby'] == 'yes' ) || function_exists( 'wppr_ci_custom_bar_icon' ) || class_exists( 'CWP_PR_PRO_Core' ) ) {
294
- wp_register_script( 'cwp-custom-bar-icon', WPPR_URL . '/javascript/custom-bar-icon.js', false, '1.0', 'all' );
295
- wp_enqueue_script( 'cwp-custom-bar-icon' );
296
- }
297
- wppr_add_pointers();
298
- }
299
-
300
- function wppr_add_pointers() {
301
- $screen = get_current_screen();
302
- $screen_id = $screen->id;
303
- // Get pointers for this screen
304
- $pointers = apply_filters( 'wppr_admin_pointers-' . $screen_id, array() );
305
- if ( ! $pointers || ! is_array( $pointers ) ) {
306
- return;
307
- }
308
- $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
309
- $valid = array();
310
- foreach ( $pointers as $pointer_id => $pointer ) {
311
- // Sanity check
312
- if ( in_array( $pointer_id, $dismissed ) || empty( $pointer ) || empty( $pointer_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) {
313
- continue;
314
- }
315
- $pointer['pointer_id'] = $pointer_id;
316
- // Add the pointer to $valid_pointers array
317
- $valid['pointers'][] = $pointer;
318
- }
319
- if ( empty( $valid ) ) {
320
- return;
321
- }
322
- // Add pointers style to queue.
323
- wp_enqueue_style( 'wp-pointer', array( 'jquery' ) );
324
- wp_enqueue_script( 'wppr-pointers', WPPR_URL . '/javascript/cwp-pointers.js', array( 'wp-pointer' ), WPPR_LITE_VERSION, true );
325
- wp_localize_script( 'wppr-pointers', 'cwpp', array( 'pointers' => $valid ) );
326
- }
327
-
328
- function cwppos_pac_register() {
329
- add_image_size( 'wppr_widget_image', 50, 50 );
330
- }
331
-
332
- function cwp_def_settings() {
333
- global $post;
334
- $options = cwppos();
335
- if ( function_exists( 'wppr_ci_custom_bar_icon' ) || ( isset( $options['cwppos_show_poweredby'] ) && $options['cwppos_show_poweredby'] == 'yes' ) ) {
336
- $isSetToPro = true;
337
- } else {
338
- $isSetToPro = false;
339
- }
340
- $uni_font = cwppos( 'cwppos_change_bar_icon' );
341
- $track = $options['cwppos_rating_chart_default'];
342
- // if ($uni_font!=="&#")
343
- if ( isset( $uni_font[0] ) ) {
344
- if ( $uni_font[0] == '#' ) {
345
- $uni_font = $uni_font;
346
- } else {
347
- $uni_font = $uni_font[0];
348
- }
349
- } else {
350
- $uni_font = '';
351
- }
352
- if ( ! empty( $uni_font ) ) {
353
- if ( function_exists( 'wppr_ci_custom_bar_icon' ) || cwppos( 'cwppos_show_poweredby' ) == 'yes' ) {
354
- if ( cwppos( 'cwppos_fontawesome' ) === 'no' ) {
355
- wp_enqueue_style( 'cwp-pac-fontawesome-stylesheet', WPPR_URL . '/css/font-awesome.min.css' );
356
- }
357
- }
358
- }
359
- echo "<script type='text/javascript'>
360
- var cwpCustomBarIcon = '" . $uni_font . "';
361
- var isSetToPro = '" . $isSetToPro . "';
362
- var trackcolor = '" . $track . "';
363
- </script>";
364
- }
365
-
366
- function cwppos_pac_print() {
367
- cwp_def_settings();
368
- }
369
-
370
- function cwppos_dynamic_stylesheet() {
371
- $options = cwppos();
372
- // Get theme content width or plugin setting content width
373
- global $content_width;
374
- $c_width = 700;
375
- if ( $options['cwppos_widget_size'] != '' ) {
376
- $c_width = $options['cwppos_widget_size'];
377
- } else {
378
- $c_width = $content_width;
379
- }
380
- if ( $c_width < 200 ) {
381
- $c_width = 600;
382
- }
383
- $f_img_size = min( 180, $c_width * 0.51 * 0.4 );
384
- $h_tleft = $f_img_size + 10;
385
- $chart_size = 0.8 * $f_img_size;
386
- ?>
387
- <style type="text/css">
388
-
389
- @media (min-width: 820px) {
390
- #review-statistics .review-wrap-up .review-wu-left .rev-wu-image, #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
391
- height: <?php echo $h_tleft;?>px;
392
- }
393
-
394
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
395
-
396
- margin-top: <?php echo $f_img_size * 0.1;?>%;
397
- }
398
-
399
- #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
400
- font-size: <?php echo round( 30 * $f_img_size / 140 );?>px;
401
- }
402
-
403
- <?php if ( $options['cwppos_widget_size'] != '' ) { ?>
404
- #review-statistics {
405
- width: <?php echo $options['cwppos_widget_size']; ?>px;
406
- }
407
-
408
- <?php } ?>
409
-
410
- }
411
-
412
- #review-statistics .review-wrap-up div.cwpr-review-top {
413
- border-top: <?php echo $options['cwppos_reviewboxbd_width']; ?>px solid <?php echo $options['cwppos_reviewboxbd_color']; ?>;
414
- }
415
-
416
- .user-comments-grades .comment-meta-grade-bar,
417
- #review-statistics .review-wu-bars ul li {
418
- background: <?php echo $options['cwppos_rating_default']; ?>;
419
- }
420
-
421
- #review-statistics .rev-option.customBarIcon ul li {
422
- color: <?php echo $options['cwppos_rating_default']; ?>;
423
- }
424
-
425
- #review-statistics .review-wrap-up .review-wu-right ul li, #review-statistics .review-wu-bars h3, .review-wu-bars span, #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category a {
426
- color: <?php echo $options['cwppos_font_color']; ?>;
427
- }
428
-
429
- #review-statistics .review-wrap-up .review-wu-right .pros h2 {
430
- color: <?php echo $options['cwppos_pros_color']; ?>;
431
- }
432
-
433
- #review-statistics .review-wrap-up .review-wu-right .cons h2 {
434
- color: <?php echo $options['cwppos_cons_color']; ?>;
435
- }
436
-
437
- div.affiliate-button a {
438
- border: 2px solid <?php echo $options['cwppos_buttonbd_color']; ?>;
439
- }
440
-
441
- div.affiliate-button a:hover {
442
- border: 2px solid <?php echo $options['cwppos_buttonbh_color']; ?>;
443
- }
444
-
445
- div.affiliate-button a {
446
- background: <?php echo $options['cwppos_buttonbkd_color']; ?>;
447
- }
448
-
449
- div.affiliate-button a:hover {
450
- background: <?php echo $options['cwppos_buttonbkh_color']; ?>;
451
- }
452
-
453
- div.affiliate-button a span {
454
- color: <?php echo $options['cwppos_buttontxtd_color']; ?>;
455
- }
456
-
457
- div.affiliate-button a:hover span {
458
- color: <?php echo $options['cwppos_buttontxth_color']; ?>;
459
- }
460
-
461
- <?php if ( $options['cwppos_show_icon'] == 'yes' ) { ?>
462
- div.affiliate-button a span {
463
- background: url("<?php echo WPPR_URL; ?>/images/cart-icon.png") no-repeat left center;
464
- }
465
-
466
- div.affiliate-button a:hover span {
467
- background: url("<?php echo WPPR_URL; ?>/images/cart-icon-hover.png") no-repeat left center;
468
- }
469
-
470
- <?php } ?>
471
-
472
- <?php if ( $options['cwppos_show_userreview'] == 'yes' ) { ?>
473
- .commentlist .comment-body p {
474
- clear: left;
475
- }
476
-
477
- <?php } ?>
478
- </style>
479
- <script type="text/javascript">
480
- var c1 = "<?php echo $options['cwppos_rating_weak']; ?>";
481
- var c2 = "<?php echo $options['cwppos_rating_notbad']; ?>";
482
- var c3 = "<?php echo $options['cwppos_rating_good']; ?>";
483
- var c4 = "<?php echo $options['cwppos_rating_very_good']; ?>";
484
- </script>
485
- <?php
486
- }
487
-
488
- add_action( 'init', 'cwppos_pac_register' );
489
- add_action( 'wp_head', 'cwppos_pac_print' );
490
- add_action( 'wp_footer', 'cwppos_dynamic_stylesheet' );
491
- add_action( 'admin_init', 'cwppos_pac_admin_init' );
492
- add_action( 'admin_enqueue_scripts', 'custom_bar_icon' );
493
- add_action( 'wp_ajax_wppr-dismiss-amazon-link', 'wppr_dismiss_amazon_link' );
494
- function wppr_dismiss_amazon_link() {
495
- $pointer_id = isset( $_POST['pointer'] ) ? $_POST['pointer'] : null;
496
- if ( $pointer_id ) {
497
- $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
498
- if ( ! $dismissed ) {
499
- $dismissed = array();
500
- }
501
- $dismissed[] = $pointer_id;
502
- update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', implode( ',', $dismissed ) );
503
- }
504
- }
505
-
506
- if ( class_exists( 'CWP_PR_PRO_Core' ) ) {
507
- $cwp_pr_pro = new CWP_PR_PRO_Core();
508
- }
509
- load_plugin_textdomain( 'cwppos', false, dirname( plugin_basename( WPPR_PATH ) ) . '/languages/' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin/class-wppr-admin.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The admin-specific functionality of the plugin.
4
+ *
5
+ * @link https://themeisle.com/
6
+ * @since 3.0.0
7
+ *
8
+ * @package WPPR
9
+ * @subpackage WPPR/admin
10
+ */
11
+
12
+ /**
13
+ * The admin-specific functionality of the plugin.
14
+ *
15
+ * Defines the plugin name, version, and two examples hooks for how to
16
+ * enqueue the admin-specific stylesheet and JavaScript.
17
+ *
18
+ * @package WPPR
19
+ * @subpackage WPPR/admin
20
+ * @author ThemeIsle <friends@themeisle.com>
21
+ */
22
+ class WPPR_Admin {
23
+
24
+ /**
25
+ * The ID of this plugin.
26
+ *
27
+ * @since 3.0.0
28
+ * @access private
29
+ * @var string $plugin_name The ID of this plugin.
30
+ */
31
+ private $plugin_name;
32
+
33
+ /**
34
+ * The version of this plugin.
35
+ *
36
+ * @since 3.0.0
37
+ * @access private
38
+ * @var string $version The current version of this plugin.
39
+ */
40
+ private $version;
41
+
42
+ /**
43
+ * Initialize the class and set its properties.
44
+ *
45
+ * @since 3.0.0
46
+ *
47
+ * @param string $plugin_name The name of this plugin.
48
+ * @param string $version The version of this plugin.
49
+ */
50
+ public function __construct( $plugin_name, $version ) {
51
+
52
+ $this->plugin_name = $plugin_name;
53
+ $this->version = $version;
54
+
55
+ }
56
+
57
+ /**
58
+ * Register the stylesheets for the admin area.
59
+ *
60
+ * @since 3.0.0
61
+ * @access public
62
+ *
63
+ * @param string $hook The hook used filter loaded styles.
64
+ */
65
+ public function enqueue_styles( $hook ) {
66
+
67
+ /**
68
+ * This function is provided for demonstration purposes only.
69
+ *
70
+ * An instance of this class should be passed to the run() function
71
+ * defined in WPPR_Loader as all of the hooks are defined
72
+ * in that particular class.
73
+ *
74
+ * The WPPR_Loader will then create the relationship
75
+ * between the defined hooks and the functions defined in this
76
+ * class.
77
+ */
78
+
79
+ if ( $hook == 'toplevel_page_wppr' ) {
80
+ wp_enqueue_style( 'wp-color-picker' );
81
+ wp_enqueue_style( $this->plugin_name . '-dashboard-css', WPPR_URL . '/assets/css/dashboard_styles.css', array(), $this->version );
82
+ wp_enqueue_style( $this->plugin_name . '-admin-css', WPPR_URL . '/assets/css/admin.css', array(), $this->version );
83
+ }
84
+ if ( $hook == 'product-review_page_wppr_pro_upsell' || $hook == 'toplevel_page_wppr' ) {
85
+ wp_enqueue_style( $this->plugin_name . '-upsell-css', WPPR_URL . '/assets/css/upsell.css', array(), $this->version );
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Register the JavaScript for the admin area.
91
+ *
92
+ * @since 3.0.0
93
+ * @access public
94
+ *
95
+ * @param string $hook The hook used filter loaded scripts.
96
+ */
97
+ public function enqueue_scripts( $hook ) {
98
+
99
+ /**
100
+ * This function is provided for demonstration purposes only.
101
+ *
102
+ * An instance of this class should be passed to the run() function
103
+ * defined in WPPR_Loader as all of the hooks are defined
104
+ * in that particular class.
105
+ *
106
+ * The WPPR_Loader will then create the relationship
107
+ * between the defined hooks and the functions defined in this
108
+ * class.
109
+ */
110
+
111
+ if ( $hook == 'toplevel_page_wppr' ) {
112
+ wp_enqueue_script( $this->plugin_name . '-tiplsy-js', WPPR_URL . '/assets/js/tipsy.js', array( 'jquery' ), $this->version );
113
+ wp_enqueue_script(
114
+ $this->plugin_name . '-admin-js', WPPR_URL . '/assets/js/admin.js',
115
+ array(
116
+ 'jquery',
117
+ 'wp-color-picker',
118
+ ),
119
+ $this->version
120
+ );
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Add admin menu items.
126
+ *
127
+ * @since 3.0.0
128
+ * @access public
129
+ */
130
+ public function menu_pages() {
131
+ add_menu_page(
132
+ __( 'WP Product Review', 'wp-product-review' ), __( 'Product Review', 'wp-product-review' ), 'manage_options', 'wppr', array(
133
+ $this,
134
+ 'page_settings',
135
+ ), 'dashicons-star-half', '99.87414'
136
+ );
137
+ if ( ! defined( 'WPPR_PRO_VERSION' ) ) {
138
+ add_submenu_page(
139
+ 'wppr', __( 'More Features', 'wp-product-review' ), __( 'More Features ', 'wp-product-review' ) . '<span class="dashicons
140
+ dashicons-star-filled" style="vertical-align:-5px; padding-left:2px; color:#FFCA54;"></span>', 'manage_options', 'wppr_pro_upsell',
141
+ array(
142
+ $this,
143
+ 'page_upsell',
144
+ )
145
+ );
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Method to render settings page.
151
+ *
152
+ * @since 3.0.0
153
+ * @access public
154
+ */
155
+ public function page_settings() {
156
+ $model = new WPPR_Options_Model();
157
+ $render = new WPPR_Admin_Render_Controller( $this->plugin_name, $this->version );
158
+ $render->retrive_template( 'settings', $model );
159
+ }
160
+
161
+ /**
162
+ * Method to render up-sell page.
163
+ *
164
+ * @since 3.0.0
165
+ * @access public
166
+ */
167
+ public function page_upsell() {
168
+ $render = new WPPR_Admin_Render_Controller( $this->plugin_name, $this->version );
169
+ $render->retrive_template( 'upsell' );
170
+ }
171
+
172
+ /**
173
+ * Method called from AJAX request to update options.
174
+ *
175
+ * @since 3.0.0
176
+ * @access public
177
+ */
178
+ public function update_options() {
179
+ $model = new WPPR_Options_Model();
180
+ $data = $_POST['cwppos_options'];
181
+ foreach ( $data as $option ) {
182
+ $option['value'];
183
+ $model->wppr_set_option( $option['name'], $option['value'] );
184
+ }
185
+ die();
186
+ }
187
+
188
+ }
includes/admin/class-wppr-editor.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Up-sell layout in the admin dashboard.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Admin
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Editor
14
+ */
15
+ class WPPR_Editor {
16
+
17
+ /**
18
+ * The ID of this plugin.
19
+ *
20
+ * @since 3.0.0
21
+ * @access private
22
+ * @var string $plugin_name The ID of this plugin.
23
+ */
24
+ private $plugin_name;
25
+
26
+ /**
27
+ * The version of this plugin.
28
+ *
29
+ * @since 3.0.0
30
+ * @access private
31
+ * @var string $version The current version of this plugin.
32
+ */
33
+ private $version;
34
+
35
+ /**
36
+ * Initialize the class and set its properties.
37
+ *
38
+ * @since 3.0.0
39
+ * @param string $plugin_name The name of this plugin.
40
+ * @param string $version The version of this plugin.
41
+ */
42
+ public function __construct( $plugin_name, $version ) {
43
+
44
+ $this->plugin_name = $plugin_name;
45
+ $this->version = $version;
46
+
47
+ }
48
+
49
+ /**
50
+ * Method to add editor meta box.
51
+ *
52
+ * @since 3.0.0
53
+ * @access public
54
+ */
55
+ public function set_editor() {
56
+ add_meta_box(
57
+ 'wppr_editor_metabox', __( 'Product Review Extra Settings', 'wp-product-review' ), array(
58
+ $this,
59
+ 'render_metabox',
60
+ )
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Method to render editor.
66
+ *
67
+ * @since 3.0.0
68
+ * @access public
69
+ * @param WP_Post $post The post object.
70
+ */
71
+ public function render_metabox( $post ) {
72
+ $editor = $this->get_editor_name( $post );
73
+ wp_nonce_field( 'wppr_editor_save.' . $post->ID, '_wppr_nonce' );
74
+ $render_controller = new WPPR_Admin_Render_Controller( $this->plugin_name, $this->version );
75
+ $render_controller->render_editor_metabox( $editor->get_template(), $editor );
76
+ }
77
+
78
+ /**
79
+ * Method to return editor object.
80
+ *
81
+ * @since 3.0.0
82
+ * @access public
83
+ * @param WP_Post $post The post object.
84
+ * @return WPPR_Editor_Abstract
85
+ */
86
+ private function get_editor_name( $post ) {
87
+ $editor_name = 'WPPR_' . str_replace( '-', '_', ucfirst( $post->post_type ) . '_Editor' );
88
+ if ( class_exists( $editor_name ) ) {
89
+ $editor = new $editor_name ( $post );
90
+ } else {
91
+ $editor = new WPPR_Editor_Model( $post );
92
+ }
93
+
94
+ return $editor;
95
+ }
96
+
97
+ /**
98
+ * Method to load required assets.
99
+ *
100
+ * @since 3.0.0
101
+ * @access public
102
+ * @param WP_Post $post The post object.
103
+ */
104
+ public function load_assets( $post ) {
105
+ global $post;
106
+ if ( is_a( $post, 'WP_Post' ) ) {
107
+ $editor = $this->get_editor_name( $post );
108
+ $assets = $editor->get_assets();
109
+ if ( ! empty( $assets ) ) {
110
+ if ( isset( $assets['js'] ) ) {
111
+ foreach ( $assets['js'] as $handle => $data ) {
112
+ if ( isset( $data['path'] ) ) {
113
+ wp_enqueue_script( 'wppr-' . $handle . '-css', $data['path'], $data['required'], $this->version, true );
114
+ }
115
+ }
116
+ }
117
+
118
+ if ( isset( $assets['css'] ) ) {
119
+ foreach ( $assets['css'] as $handle => $data ) {
120
+ if ( isset( $data['path'] ) ) {
121
+ wp_enqueue_style( 'wppr-' . $handle . '-css', $data['path'], $data['required'], $this->version );
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Method to save options.
131
+ *
132
+ * @since 3.0.0
133
+ * @access public
134
+ * @param int $post_id The post ID.
135
+ */
136
+ public function editor_save( $post_id ) {
137
+ $editor = $this->get_editor_name( get_post( $post_id ) );
138
+
139
+ $is_autosave = wp_is_post_autosave( $post_id );
140
+ $is_revision = wp_is_post_revision( $post_id );
141
+ $nonce = isset( $_REQUEST['_wppr_nonce'] ) ? $_REQUEST['_wppr_nonce'] : '';
142
+ $is_valid_nonce = wp_verify_nonce( $nonce, 'wppr_editor_save.' . $post_id );
143
+
144
+ if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
145
+ return;
146
+ }
147
+ $editor->save();
148
+ }
149
+ }
includes/admin/class-wppr-global-settings.php ADDED
@@ -0,0 +1,368 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main loader file for wppr.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Settings
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ // Exit if accessed directly.
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Class WPPR_Global_Settings for handling global options.
19
+ */
20
+ class WPPR_Global_Settings {
21
+ /**
22
+ * The main instance var.
23
+ *
24
+ * @since 3.0.0
25
+ * @access public
26
+ * @var WPPR_Global_Settings The one WPPR_Global_Settings istance.
27
+ */
28
+ public static $instance;
29
+
30
+ /**
31
+ * Stores the default fields data.
32
+ *
33
+ * @since 3.0.0
34
+ * @access public
35
+ * @var array|mixed|void $fields Options fields.
36
+ */
37
+ public $fields = array();
38
+
39
+ /**
40
+ * Stores the sections for the settings page.
41
+ *
42
+ * @since 3.0.0
43
+ * @access public
44
+ * @var array|mixed|void $sections Sections of the admin page.
45
+ */
46
+ public $sections = array();
47
+
48
+ /**
49
+ * The instance method for the static class.
50
+ * Defines and returns the instance of the static class.
51
+ *
52
+ * @since 3.0.0
53
+ * @access public
54
+ * @return WPPR_Global_Settings
55
+ */
56
+ public static function instance() {
57
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPPR_Global_Settings ) ) {
58
+ self::$instance = new WPPR_Global_Settings;
59
+ self::$instance->sections = apply_filters(
60
+ 'wppr_settings_sections', array(
61
+ 'general' => __( 'General settings', 'wp-product-review' ),
62
+ 'rating' => __( 'Rating colors', 'wp-product-review' ),
63
+ 'typography' => __( 'Typography', 'wp-product-review' ),
64
+ 'buy' => __( 'Buy button', 'wp-product-review' ),
65
+ )
66
+ );
67
+ self::$instance->fields = apply_filters(
68
+ 'wppr_settings_fields', array(
69
+ 'general' => array(
70
+ 'cwppos_show_reviewbox' => array(
71
+ 'id' => 'review_position',
72
+ 'name' => __( 'Position of the review box', 'wp-product-review' ),
73
+ 'description' => __( 'You can choose manually and use : <?php echo cwppos_show_review(\'postid\'); ?> or you can get the Product in post add-on and use :[P_REVIEW post_id=3067 visual=\'full\']', 'wp-product-review' ),
74
+ 'type' => 'select',
75
+ 'options' => array(
76
+ 'yes' => __( 'After content', 'wp-product-review' ),
77
+ 'no' => __( 'Before content', 'wp-product-review' ),
78
+ 'manual' => __( 'Manually placed', 'wp-product-review' ),
79
+ ),
80
+ 'default' => 'yes',
81
+ ),
82
+ 'cwppos_show_userreview' => array(
83
+ 'id' => 'show_review',
84
+ 'name' => __( 'Show review comment', 'wp-product-review' ),
85
+ 'description' => __( 'Activate comment review user', 'wp-product-review' ),
86
+ 'type' => 'select',
87
+ 'options' => array(
88
+ 'yes' => __( 'Yes', 'wp-product-review' ),
89
+ 'no' => __( 'No', 'wp-product-review' ),
90
+ ),
91
+ 'default' => 'no',
92
+ ),
93
+ 'cwppos_infl_userreview' => array(
94
+ 'id' => 'comment_influence',
95
+ 'name' => __( 'Visitor Review Influence', 'wp-product-review' ),
96
+ 'description' => __( 'Select how much visitors rating will affect the main one', 'wp-product-review' ),
97
+ 'type' => 'select',
98
+ 'options' => array(
99
+ '0' => 'No influence',
100
+ '10' => '10%',
101
+ '20' => '20%',
102
+ '30' => '30%',
103
+ '40' => '40%',
104
+ '50' => '50%',
105
+ '60' => '60%',
106
+ '70' => '70%',
107
+ '80' => '80%',
108
+ '90' => '90%',
109
+ '100' => '100%',
110
+ ),
111
+ 'default' => '0',
112
+ ),
113
+ 'cwppos_option_nr' => array(
114
+ 'id' => 'options_no',
115
+ 'name' => __( 'Number of options/pros/cons', 'wp-product-review' ),
116
+ 'description' => __( 'You can select the default number of options / pros/ cons (3-10)', 'wp-product-review' ),
117
+ 'type' => 'select',
118
+ 'options' => array(
119
+ '3' => '3',
120
+ '4' => '4',
121
+ '5' => '5',
122
+ '6' => '6',
123
+ '7' => '7',
124
+ '8' => '8',
125
+ '9' => '9',
126
+ '10' => '10',
127
+ ),
128
+ 'default' => '5',
129
+ ),
130
+ 'cwppos_widget_size' => array(
131
+ 'type' => 'input_text',
132
+ 'name' => __( 'Content width', 'wp-product-review' ),
133
+ 'description' => __( 'Write your content width in pixels in this format : 600 if you want to limit the review box width.', 'wp-product-review' ),
134
+ 'id' => 'widget_size',
135
+ 'default' => '',
136
+ ),
137
+ 'cwppos_lighbox' => array(
138
+ 'type' => 'select',
139
+ 'name' => __( 'Disable Lighbox images', 'wp-product-review' ),
140
+ 'description' => __( 'Disable lightbox effect on product images (increase loading speed)', 'wp-product-review' ),
141
+ 'id' => 'use_lightbox',
142
+ 'options' => array(
143
+ 'yes' => __( 'Yes', 'wp-product-review' ),
144
+ 'no' => __( 'No', 'wp-product-review' ),
145
+ ),
146
+ 'default' => 'no',
147
+ ),
148
+ 'cwppos_fontawesome' => array(
149
+ 'type' => 'select',
150
+ 'name' => __( 'Disable Font Awesome', 'wp-product-review' ),
151
+ 'description' => __( 'Disable Font Awesome for websites that already are including it (increase loading speed)', 'wp-product-review' ),
152
+ 'id' => 'use_fontawesome',
153
+ 'options' => array(
154
+ 'yes' => __( 'Yes', 'wp-product-review' ),
155
+ 'no' => __( 'No', 'wp-product-review' ),
156
+ ),
157
+ 'default' => 'no',
158
+ ),
159
+ 'wppr_rich_snippet' => array(
160
+ 'type' => 'select',
161
+ 'name' => __( 'Enable Rich Snippets', 'wp-product-review' ),
162
+ 'description' => __( 'Enable rich snippets on the product page.', 'wp-product-review' ),
163
+ 'id' => 'use_rich_snippet',
164
+ 'options' => array(
165
+ 'yes' => __( 'Yes', 'wp-product-review' ),
166
+ 'no' => __( 'No', 'wp-product-review' ),
167
+ ),
168
+ 'default' => 'yes',
169
+ ),
170
+ ),
171
+ 'rating' => array(
172
+ 'cwppos_rating_default' => array(
173
+ 'type' => 'color',
174
+ 'name' => __( 'Rating options default color', 'wp-product-review' ),
175
+ 'description' => __( 'Select the color to be used by default on rating.', 'wp-product-review' ),
176
+ 'id' => 'rating_default',
177
+ 'default' => '#E1E2E0',
178
+ ),
179
+ 'cwppos_rating_chart_default' => array(
180
+ 'type' => 'color',
181
+ 'name' => __( 'Rating chart default color', 'wp-product-review' ),
182
+ 'description' => __( 'Select the color to be used by default on rating chart.', 'wp-product-review' ),
183
+ 'id' => 'rating_chart_default',
184
+ 'default' => '#ebebeb',
185
+ ),
186
+ 'cwppos_rating_weak' => array(
187
+ 'type' => 'color',
188
+ 'name' => __( 'Weak rating', 'wp-product-review' ),
189
+ 'description' => __( 'Select the color to be used when the rating is weak. ( < 2.5)', 'wp-product-review' ),
190
+ 'id' => 'rating_weak',
191
+ 'default' => '#FF7F66',
192
+ ),
193
+ 'cwppos_rating_notbad' => array(
194
+ 'type' => 'color',
195
+ 'name' => __( 'Not bad rating', 'wp-product-review' ),
196
+ 'description' => __( 'Select the color to be used when the rating is not bad. ( > 2.5 and < 5)', 'wp-product-review' ),
197
+ 'id' => 'rating_notbad',
198
+ 'default' => '#FFCE55',
199
+ ),
200
+ 'cwppos_rating_good' => array(
201
+ 'type' => 'color',
202
+ 'name' => __( 'Good rating', 'wp-product-review' ),
203
+ 'description' => __( 'Select the color to be used when the rating is good. ( >5 and <7.5)', 'wp-product-review' ),
204
+ 'id' => 'rating_good',
205
+ 'default' => '#50C1E9',
206
+ ),
207
+ 'cwppos_rating_very_good' => array(
208
+ 'type' => 'color',
209
+ 'name' => __( 'Very good rating', 'wp-product-review' ),
210
+ 'description' => __( 'Select the color to be used when the rating is very good. ( 7.5 < and <10)', 'wp-product-review' ),
211
+ 'id' => 'rating_very_good',
212
+ 'default' => '#8DC153',
213
+ ),
214
+
215
+ ),
216
+ 'typography' => array(
217
+ 'cwppos_font_color' => array(
218
+ 'type' => 'color',
219
+ 'name' => __( 'Font color', 'wp-product-review' ),
220
+ 'description' => __( 'Select the color to be used on the font.', 'wp-product-review' ),
221
+ 'id' => 'font_color',
222
+ 'default' => '#3D3D3D',
223
+ ),
224
+ 'cwppos_pros_color' => array(
225
+ 'type' => 'color',
226
+ 'name' => __( 'Pros text color', 'wp-product-review' ),
227
+ 'description' => __( 'Select the color to be used on the \'Pros\' text.', 'wp-product-review' ),
228
+ 'id' => 'pros_color',
229
+ 'default' => '#8DC153',
230
+ ),
231
+ 'cwppos_cons_color' => array(
232
+ 'type' => 'color',
233
+ 'name' => __( 'Cons text color', 'wp-product-review' ),
234
+ 'description' => __( 'Select the color to be used on the Cons text.', 'wp-product-review' ),
235
+ 'id' => 'cons_color',
236
+ 'default' => '#C15353',
237
+ ),
238
+ 'cwppos_pros_text' => array(
239
+ 'type' => 'text',
240
+ 'name' => __( 'Pros text', 'wp-product-review' ),
241
+ 'description' => __( 'Specify text for pros heading', 'wp-product-review' ),
242
+ 'id' => 'pros_text',
243
+ 'default' => 'Pros',
244
+ ),
245
+ 'cwppos_cons_text' => array(
246
+ 'type' => 'text',
247
+ 'name' => __( 'Cons text', 'wp-product-review' ),
248
+ 'description' => __( 'Specify text for cons heading', 'wp-product-review' ),
249
+ 'id' => 'cons_text',
250
+ 'default' => 'Cons',
251
+ ),
252
+ 'cwppos_reviewboxbd_color' => array(
253
+ 'type' => 'color',
254
+ 'name' => __( 'Review box border', 'wp-product-review' ),
255
+ 'description' => __( 'Select the border color to be used on the review box', 'wp-product-review' ),
256
+ 'id' => 'reviewboxbd_color',
257
+ 'default' => '#3BAEDA',
258
+ ),
259
+ 'cwppos_reviewboxbd_width' => array(
260
+ 'type' => 'input_text',
261
+ 'name' => __( 'Review box border width', 'wp-product-review' ),
262
+ 'description' => __( 'Select the width in pixels of the top border of the review box', 'wp-product-review' ),
263
+ 'id' => 'review_box_border_width',
264
+ 'default' => '5',
265
+ ),
266
+ ),
267
+ 'buy' => array(
268
+ 'cwppos_show_icon' => array(
269
+ 'type' => 'select',
270
+ 'name' => __( 'Show button icon', 'wp-product-review' ),
271
+ 'description' => __( 'Show icon on the cart icon on button.', 'wp-product-review' ),
272
+ 'id' => 'show_icon',
273
+ 'options' => array(
274
+ 'yes' => 'Yes',
275
+ 'no' => 'No',
276
+ ),
277
+ 'default' => 'yes',
278
+ ),
279
+ 'cwppos_buttonbd_color' => array(
280
+ 'type' => 'color',
281
+ 'name' => __( 'Button border', 'wp-product-review' ),
282
+ 'description' => __( 'Select the border color to be used on the buy button for the default state', 'wp-product-review' ),
283
+ 'id' => 'buttonbd_color',
284
+ 'default' => '#3BAEDA',
285
+ ),
286
+ 'cwppos_buttonbh_color' => array(
287
+ 'type' => 'color',
288
+ 'name' => __( 'Button border hover', 'wp-product-review' ),
289
+ 'description' => __( 'Select the border color to be used on the buy button for the hover state', 'wp-product-review' ),
290
+ 'id' => 'buttonbh_color',
291
+ 'default' => '#3BAEDA',
292
+ ),
293
+ 'cwppos_buttonbkd_color' => array(
294
+ 'type' => 'color',
295
+ 'name' => __( 'Button background', 'wp-product-review' ),
296
+ 'description' => __( 'Select the background color to be used on the buy button for the default state', 'wp-product-review' ),
297
+ 'id' => 'buttonbkd_color',
298
+ 'default' => '#ffffff',
299
+ ),
300
+ 'cwppos_buttonbkh_color' => array(
301
+ 'type' => 'color',
302
+ 'name' => __( 'Button background hover', 'wp-product-review' ),
303
+ 'description' => __( 'Select the background color to be used on the buy button for the hover state', 'wp-product-review' ),
304
+ 'id' => 'buttonbkh_color',
305
+ 'default' => '#3BAEDA',
306
+ ),
307
+ 'cwppos_buttontxtd_color' => array(
308
+ 'type' => 'color',
309
+ 'name' => __( 'Button text color', 'wp-product-review' ),
310
+ 'description' => __( 'Select the text color to be used on the buy button for the default state', 'wp-product-review' ),
311
+ 'id' => 'buttontxtd_color',
312
+ 'default' => '#3BAEDA',
313
+ ),
314
+ 'cwppos_buttontxth_color' => array(
315
+ 'type' => 'color',
316
+ 'name' => __( 'Button text color hover', 'wp-product-review' ),
317
+ 'description' => __( 'Select the text color to be used on the buy button for the hover state', 'wp-product-review' ),
318
+ 'id' => 'buttontxth_color',
319
+ 'default' => '#FFFFFF',
320
+ ),
321
+ ),
322
+ )
323
+ );
324
+
325
+ }// End if().
326
+
327
+ return self::$instance;
328
+ }
329
+
330
+ /**
331
+ * Return the section array.
332
+ *
333
+ * @since 3.0.0
334
+ * @access public
335
+ * @return array
336
+ */
337
+ public function get_sections() {
338
+ return self::$instance->sections;
339
+ }
340
+
341
+ /**
342
+ * Return the fields array.
343
+ *
344
+ * @since 3.0.0
345
+ * @access public
346
+ * @return array
347
+ */
348
+ public function get_fields() {
349
+ return self::$instance->fields;
350
+ }
351
+
352
+ /**
353
+ * Return a filterd array based on sections value.
354
+ *
355
+ * @since 3.0.0
356
+ * @access public
357
+ * @return array
358
+ */
359
+ public function get_filtered_fields() {
360
+ $fields = array();
361
+ foreach ( self::$instance->sections as $key => $value ) {
362
+ foreach ( self::$instance->fields[ $key ] as $field_key => $field_values ) {
363
+ $fields[ $field_key ] = $field_values;
364
+ }
365
+ }
366
+ return $fields;
367
+ }
368
+ }
includes/admin/controllers/class-wppr-admin-render-controller.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WPPR Admin Render Controller
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Admin
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Admin_Render_Controller for handling page rendering.
14
+ */
15
+ class WPPR_Admin_Render_Controller {
16
+
17
+ /**
18
+ * The ID of this plugin.
19
+ *
20
+ * @since 3.0.0
21
+ * @access private
22
+ * @var string $plugin_name The ID of this plugin.
23
+ */
24
+ private $plugin_name;
25
+
26
+ /**
27
+ * The version of this plugin.
28
+ *
29
+ * @since 3.0.0
30
+ * @access private
31
+ * @var string $version The current version of this plugin.
32
+ */
33
+ private $version;
34
+
35
+ /**
36
+ * Stores the helper class to render elements.
37
+ *
38
+ * @since 3.0.0
39
+ * @access private
40
+ * @var WPPR_Html_Fields $html_helper The HTML helper class.
41
+ */
42
+ private $html_helper;
43
+
44
+ /**
45
+ * Initialize the class and set its properties.
46
+ *
47
+ * @since 3.0.0
48
+ * @param string $plugin_name The name of this plugin.
49
+ * @param string $version The version of this plugin.
50
+ */
51
+ public function __construct( $plugin_name, $version ) {
52
+ $this->plugin_name = $plugin_name;
53
+ $this->version = $version;
54
+ $this->html_helper = new WPPR_Html_Fields();
55
+ }
56
+
57
+ /**
58
+ * Utility method to include required layout.
59
+ *
60
+ * @since 3.0.0
61
+ * @access public
62
+ * @param string $name The name of the layout to be retrieved.
63
+ * @param bool|WPPR_Abstract_Model $model Optional pass a model to use in template.
64
+ */
65
+ public function retrive_template( $name, $model = false ) {
66
+ if ( file_exists( WPPR_PATH . '/includes/admin/layouts/css/' . $name . '.css' ) ) {
67
+ wp_enqueue_style( $this->plugin_name . '-' . $name . '-css', WPPR_URL . '/includes/admin/layouts/css/' . $name . '.css', array(), $this->version );
68
+ }
69
+ include_once( WPPR_PATH . '/includes/admin/layouts/' . $name . '-tpl.php' );
70
+ }
71
+
72
+ /**
73
+ * Render editor metabox.
74
+ *
75
+ * @since 3.0.0
76
+ * @access public
77
+ * @param string $template Path to template file or template name.
78
+ * @param bool|WPPR_Abstract_Model $model Optional pass a model to use in template.
79
+ */
80
+ public function render_editor_metabox( $template, $model = false ) {
81
+ if ( ! file_exists( $template ) ) {
82
+ $template = WPPR_PATH . '/includes/admin/layouts/' . $template . '-tpl.php';
83
+ }
84
+ $html_helper = new WPPR_Html_Fields();
85
+ include_once( $template );
86
+ }
87
+
88
+ /**
89
+ * Method to controll what element is rendered based on type.
90
+ *
91
+ * @since 3.0.0
92
+ * @access public
93
+ * @param array $field The array to use when rendering.
94
+ * @return mixed
95
+ */
96
+ public function add_element( $field ) {
97
+ $output = '
98
+ <div class="controls">
99
+ <div class="explain"><h4>' . $field['title'] . '</h4></div>
100
+ <div class="controls-content">
101
+ ';
102
+ switch ( $field['type'] ) {
103
+ case 'input_text':
104
+ $output .= $this->html_helper->text( $field );
105
+ break;
106
+ case 'select':
107
+ $output .= $this->html_helper->select( $field );
108
+ break;
109
+ case 'color':
110
+ $output .= $this->html_helper->color( $field );
111
+ break;
112
+ case 'text':
113
+ $output .= $this->html_helper->text( $field );
114
+ break;
115
+ case 'icon_font':
116
+ $output .= $this->html_helper->icon_font( $field );
117
+ break;
118
+ }
119
+
120
+ $output .= '<p class="field_description">' . $field['description'] . '</p></div></div><hr/>';
121
+ echo $output;
122
+
123
+ if ( isset( $errors ) ) {
124
+ return $errors; }
125
+ }
126
+ }
includes/admin/helpers/class-wppr-html-fields.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Helper class for HTML fields.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Helpers
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Html_Fields
14
+ */
15
+ class WPPR_Html_Fields {
16
+
17
+ /**
18
+ * Validate a class string.
19
+ *
20
+ * @since 3.0.0
21
+ * @access private
22
+ * @param string $class Class name string to validate.
23
+ * @return string
24
+ */
25
+ private function validate_class( $class ) {
26
+ return implode( ' ', array_map( 'sanitize_html_class', explode( ' ', str_replace( ' ', ' ', $class ) ) ) );
27
+ }
28
+
29
+ /**
30
+ * Merges specific defaults with general ones.
31
+ *
32
+ * @since 3.0.0
33
+ * @access private
34
+ * @param array $specific_defaults The specific defaults array.
35
+ * @return array
36
+ */
37
+ private function define_defaults( $specific_defaults ) {
38
+ $general_defaults = array(
39
+ 'id' => null,
40
+ 'name' => null,
41
+ 'value' => null,
42
+ 'class' => '',
43
+ 'default' => '',
44
+ 'placeholder' => '',
45
+ 'disabled' => false,
46
+ );
47
+
48
+ return wp_parse_args( $specific_defaults, $general_defaults );
49
+ }
50
+
51
+ /**
52
+ * Render a radio html element.
53
+ *
54
+ * @since 3.0.0
55
+ * @access public
56
+ * @param array $args The field settings.
57
+ * @return string
58
+ */
59
+ public function radio( $args ) {
60
+ $defaults = $this->define_defaults(
61
+ array(
62
+ 'class' => 'wppr-radio',
63
+ )
64
+ );
65
+ $args = wp_parse_args( $args, $defaults );
66
+ $class = $this->validate_class( $args['class'] );
67
+ $disabled = '';
68
+ if ( ! empty( $args['options']['disabled'] ) ) {
69
+ $disabled .= ' disabled="disabled"';
70
+ }
71
+ if ( is_null( $args['id'] ) ) {
72
+ $args['id'] = $args['name'];
73
+ }
74
+ $output = '<input type="radio" ' . $disabled . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['id'] ) . '" class="' . $class . '" ' . checked( $args['value'], $args['current'], false ) . ' value="' . esc_attr( $args['value'] ) . '" />';
75
+
76
+ return apply_filters( 'wppr_field', $output, $args );
77
+ }
78
+
79
+ /**
80
+ * Render a text input string.
81
+ *
82
+ * @since 3.0.0
83
+ * @access public
84
+ * @param array $args The settings of the input.
85
+ * @return string
86
+ */
87
+ public function text( $args ) {
88
+ $defaults = $this->define_defaults(
89
+ array(
90
+ 'class' => 'wppr-text',
91
+ )
92
+ );
93
+ $args = wp_parse_args( $args, $defaults );
94
+ $class = $this->validate_class( $args['class'] );
95
+ $disabled = '';
96
+ if ( $args['disabled'] ) {
97
+ $disabled = ' disabled="disabled"';
98
+ }
99
+ if ( is_null( $args['id'] ) ) {
100
+ $args['id'] = $args['name'];
101
+ }
102
+ if ( $args['value'] == null ) {
103
+ $args['value'] = $args['default'];
104
+ }
105
+ $output = '<input type="text" ' . $disabled . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['id'] ) . '" class="' . $class . '" value="' . esc_attr( $args['value'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" />';
106
+
107
+ return apply_filters( 'wppr_field', $output, $args );
108
+ }
109
+
110
+ /**
111
+ * Render a image field.
112
+ *
113
+ * @since 3.0.0
114
+ * @access public
115
+ * @param array $args The settings of the input.
116
+ * @return string
117
+ */
118
+ public function image( $args ) {
119
+ $defaults = $this->define_defaults(
120
+ array(
121
+ 'class' => 'wppr-image',
122
+ 'action' => __( 'Choose image', 'wp-product-review' ),
123
+ )
124
+ );
125
+ $args = wp_parse_args( $args, $defaults );
126
+ $class = $this->validate_class( $args['class'] );
127
+ $disabled = '';
128
+ if ( $args['disabled'] ) {
129
+ $disabled = ' disabled="disabled"';
130
+ }
131
+ if ( is_null( $args['id'] ) ) {
132
+ $args['id'] = $args['name'];
133
+ }
134
+ $output = '<input type="text" ' . $disabled . ' name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( $args['id'] ) . '" class="' . $class . '" value="' . esc_attr( $args['value'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" />';
135
+ $output .= '<input type="button" id="' . esc_attr( $args['id'] ) . '-button" class="wppr-image-button button" value="' . esc_attr( $args['action'] ) . '"/>';
136
+
137
+ return apply_filters( 'wppr_field', $output, $args );
138
+ }
139
+
140
+ /**
141
+ * Render a select input.
142
+ *
143
+ * @since 3.0.0
144
+ * @access public
145
+ * @param array $args The settings of the input.
146
+ * @return mixed
147
+ */
148
+ public function select( $args ) {
149
+ $defaults = $this->define_defaults(
150
+ array(
151
+ 'class' => 'wppr-select',
152
+ )
153
+ );
154
+ $args = wp_parse_args( $args, $defaults );
155
+ $class = $this->validate_class( $args['class'] );
156
+ if ( $args['value'] == null ) {
157
+ $args['value'] = $args['default'];
158
+ }
159
+ $options = array();
160
+ foreach ( $args['options'] as $ov => $op ) {
161
+ $options[ esc_attr( $ov ) ] = esc_html( $op );
162
+ }
163
+ $output = '<select class="' . $class . '" name="' . esc_attr( $args['name'] ) . '" > ';
164
+ foreach ( $options as $k => $v ) {
165
+ $output .= "<option value='" . $k . "' " . ( ( isset( $args['value'] ) && $args['value'] == $k ) ? 'selected' : '') . '>' . $v . '</option>';
166
+ }
167
+ $output .= '</select>';
168
+
169
+ return apply_filters( 'wppr_field', $output, $args );
170
+ }
171
+
172
+ /**
173
+ * Render a color picker.
174
+ *
175
+ * @since 3.0.0
176
+ * @access public
177
+ * @param array $args The settings of the input.
178
+ * @return mixed
179
+ */
180
+ public function color( $args ) {
181
+ $defaults = $this->define_defaults(
182
+ array(
183
+ 'class' => 'wppr-color',
184
+ )
185
+ );
186
+ $args = wp_parse_args( $args, $defaults );
187
+ $class = $this->validate_class( $args['class'] );
188
+ if ( $args['value'] == null ) {
189
+ $args['value'] = $args['default'];
190
+ }
191
+ $output = '<input type="hidden" class="' . $class . '" id="' . esc_attr( $args['id'] ) . '_color" name="' . esc_attr( $args['name'] ) . '" value="' . esc_attr( $args['value'] ) . '"/></br>
192
+ <input type="text" name="" class="subo-color-picker" id="' . esc_attr( $args['id'] ) . '_color_selector" value="' . esc_attr( $args['value'] ) . '" /><br/>';
193
+
194
+ return apply_filters( 'wppr_field', $output, $args );
195
+ }
196
+
197
+ /**
198
+ * Render a Icon font picker.
199
+ *
200
+ * @since 3.0.0
201
+ * @access public
202
+ * @param array $args The settings of the input.
203
+ * @return mixed
204
+ */
205
+ public function icon_font( $args ) {
206
+ $defaults = $this->define_defaults(
207
+ array(
208
+ 'class' => 'cwp_bar_icon_field',
209
+ )
210
+ );
211
+ $args = wp_parse_args( $args, $defaults );
212
+ if ( is_array( $args['value'] ) ) {
213
+ $value = $args['value'][0];
214
+ } else {
215
+ $value = $args['value'];
216
+ }
217
+ if ( trim( $value ) != '' ) {
218
+ $active_icon = '
219
+ <i class="fa fa-fw">&' . $value . '</i>
220
+ <a href="#" class="useDefault">' . __( '. Use Default Styling', 'wp-product-review' ) . ' </a>
221
+ ';
222
+ } else {
223
+ $active_icon = __( '* Currently set to the default styling', 'wp-product-review' );
224
+ }
225
+ $output = '
226
+ <button id="cwp_select_bar_icon">Select Bar Icon</button>
227
+ <input type="hidden" id="cwp_bar_icon_field" name="' . esc_attr( $args['name'] ) . '" value="' . esc_attr( $value ) . '">
228
+ <span class="current_bar_icon">
229
+ ' . $active_icon . '
230
+ </span>
231
+ ';
232
+
233
+ if ( ! class_exists( 'WPPR_PRO' ) ) {
234
+ $output = '<span style="color:red;">' . __( 'You need the PRO <a style="color:red;" href="http://bit.ly/2bhylar" target="_blank" >add-on</a> in order to change the review icons.','wp-product-review' ) . '</span>';
235
+ }
236
+
237
+ return apply_filters( 'wppr_field', $output, $args );
238
+ }
239
+ }
includes/admin/helpers/class-wppr-logger.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WPPR Logger Controller
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Helpers
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Logger.
14
+ */
15
+ class WPPR_Logger {
16
+
17
+ /**
18
+ * Report a message as warning.
19
+ *
20
+ * @since 3.0.0
21
+ * @access public
22
+ * @param string $msg The message to report.
23
+ */
24
+ public function warning( $msg = '' ) {
25
+ $this->message( $msg, 'warning' );
26
+ }
27
+
28
+ /**
29
+ * The error msg to report.
30
+ *
31
+ * @since 3.0.0
32
+ * @access public
33
+ * @param string $msg The error msg.
34
+ */
35
+ public function error( $msg = '' ) {
36
+ $this->message( $msg, 'error' );
37
+ }
38
+
39
+ /**
40
+ * Report a message as notice.
41
+ *
42
+ * @since 3.0.0
43
+ * @access public
44
+ * @param string $msg The message to report as notice.
45
+ */
46
+ public function notice( $msg = '' ) {
47
+ $this->message( $msg, 'notice' );
48
+ }
49
+
50
+ /**
51
+ * Report a message as error|warning|notice.
52
+ *
53
+ * @since 3.0.0
54
+ * @access private
55
+ * @param string $msg The message.
56
+ * @param string $type The type of the message.
57
+ */
58
+ private function message( $msg, $type ) {
59
+ $type = strtoupper( $type );
60
+ $msg = $type . ' : ' . $msg;
61
+ $bt = debug_backtrace();
62
+ $caller = array_shift( $bt );
63
+ $caller = array_shift( $bt );
64
+ $caller = array_shift( $bt );
65
+ $msg = $msg . ' [ ' . $caller['file'];
66
+ $msg = $msg . ' : ' . $caller['line'] . ' ]';
67
+ if ( defined( 'WPPR_DEBUG' ) && WPPR_DEBUG ) {
68
+ error_log( $msg );
69
+ }
70
+ }
71
+ }
includes/admin/index.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden
4
+ *
5
+ * @package WPPR
6
+ * @copyright Copyright (c) 2017, Bogdan Preda
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ * @since 3.0.0
9
+ */
10
+
11
+ /**
12
+ * Nothing to do here.
13
+ */
includes/admin/layouts/css/settings.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /**
2
+ * Settings CSS
3
+ * 3.0.0
4
+ */
includes/admin/layouts/editor-default-tpl.php ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Editor Metabox layout for post page.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ $review = $model->review;
13
+ $check = $review->is_active() ? 'yes' : 'no';
14
+ ?>
15
+ <p class="wppr-active wppr-<?php echo $check; ?>">
16
+ <label for="wppr-review-yes"><?php _e( 'Is this a review post ?', 'wp-product-review' ); ?> </label>
17
+ <?php
18
+ echo $html_helper->radio(
19
+ array(
20
+ 'name' => 'wppr-review-status',
21
+ 'id' => 'wppr-review-yes',
22
+ 'class' => 'wppr-review-status',
23
+ 'value' => 'yes',
24
+ 'current' => $check,
25
+ )
26
+ );
27
+ ?>
28
+ <label for="wppr-review-no"><?php _e( 'Yes', 'wp-product-review' ); ?></label>
29
+ <?php
30
+ echo $html_helper->radio(
31
+ array(
32
+ 'name' => 'wppr-review-status',
33
+ 'id' => 'wppr-review-no',
34
+ 'class' => 'wppr-review-status',
35
+ 'value' => 'no',
36
+ 'current' => $check,
37
+ )
38
+ );
39
+ ?>
40
+ <label for="wppr-review-no"><?php _e( 'No', 'wp-product-review' ); ?></label>
41
+
42
+ </p>
43
+ <div class="wppr-review-editor " id="wppr-meta-<?php echo $check; ?>">
44
+
45
+ <?php do_action( 'wppr_editor_before', $model->post ); ?>
46
+ <div class="wppr-review-details wppr-review-section">
47
+ <h4><?php _e( 'Product Details', 'wp-product-review' ); ?></h4>
48
+ <p><?php _e( 'Specify the general details for the reviewed product.', 'wp-product-review' ); ?></p>
49
+ <?php do_action( 'wppr_editor_details_before', $model->post ); ?>
50
+ <div class="wppr-review-details-fields wppr-review-fieldset">
51
+ <ul>
52
+ <li>
53
+ <label for="wppr-editor-product-name"><?php _e( 'Product Name', 'wp-product-review' ); ?></label>
54
+ <?php
55
+ echo $html_helper->text(
56
+ array(
57
+ 'name' => 'wppr-editor-product-name',
58
+ 'value' => $review->get_name(),
59
+ 'placeholder' => __( 'Product name', 'wp-product-review' ),
60
+ )
61
+ );
62
+ ?>
63
+ </li>
64
+ <li>
65
+ <label for="wppr-editor-product-image"><?php _e( 'Product Image', 'wp-product-review' ); ?></label>
66
+ <?php
67
+ echo $html_helper->image(
68
+ array(
69
+ 'name' => 'wppr-editor-image',
70
+ 'value' => $review->get_image(),
71
+ 'action' => __( 'Choose or Upload an Image', 'wp-product-review' ),
72
+ )
73
+ )
74
+ ?>
75
+ <small>
76
+ *<?php _e( 'If no image is provided, featured image is used', 'wp-product-review' ); ?></small>
77
+ </li>
78
+ <li>
79
+ <span><?php _e( 'Product Image Click', 'wp-product-review' ); ?>
80
+ : </span>
81
+ <?php
82
+ echo $html_helper->radio(
83
+ array(
84
+ 'name' => 'wppr-editor-link',
85
+ 'id' => 'wppr-editor-link-show',
86
+ 'class' => 'wppr-editor-link',
87
+ 'value' => 'image',
88
+ 'current' => $model->get_value( 'wppr-editor-link' ),
89
+ )
90
+ );
91
+ ?>
92
+ <label for="wppr-editor-link-show"><?php _e( 'Show Whole Image', 'wp-product-review' ); ?></label>
93
+ <?php
94
+ echo $html_helper->radio(
95
+ array(
96
+ 'name' => 'wppr-editor-link',
97
+ 'id' => 'wppr-editor-link-open',
98
+ 'class' => 'wppr-editor-link',
99
+ 'value' => 'link',
100
+ 'current' => $model->get_value( 'wppr-editor-link' ),
101
+ )
102
+ );
103
+ ?>
104
+ <label for="wppr-editor-link-open"><?php _e( 'Open Affiliate link', 'wp-product-review' ); ?> </label>
105
+
106
+ </li>
107
+ <?php
108
+ $links = $review->get_links();
109
+ ?>
110
+ <li>
111
+ <label for="wppr-editor-button-text"><?php _e( 'Affiliate Button Text', 'wp-product-review' ); ?> </label>
112
+ <?php
113
+ echo $html_helper->text(
114
+ array(
115
+ 'name' => 'wppr-editor-button-text',
116
+ 'value' => $model->get_value( 'wppr-editor-button-text' ),
117
+ 'placeholder' => __( 'Affiliate Button Text', 'wp-product-review' ),
118
+ )
119
+ );
120
+ ?>
121
+ </li>
122
+ <li>
123
+ <label for="wppr-editor-button-link"><?php _e( 'Affiliate Link', 'wp-product-review' ); ?> </label>
124
+ <?php
125
+ echo $html_helper->text(
126
+ array(
127
+ 'name' => 'wppr-editor-button-link',
128
+ 'value' => $model->get_value( 'wppr-editor-button-link' ),
129
+ 'placeholder' => __( 'Affiliate Link', 'wp-product-review' ),
130
+ )
131
+ );
132
+ ?>
133
+ <?php if ( count( $links ) < 2 ) : ?>
134
+ <a id="wppr-editor-new-link"
135
+ title="<?php _e( 'Add new link', 'wp-product-review' ); ?>">+
136
+ </a>
137
+ <?php endif; ?>
138
+ </li>
139
+ <?php if ( count( $links ) < 2 ) { ?>
140
+ <li class="hidden_fields" style="display: none;">
141
+ <label for="wppr-editor-button-text"><?php _e( 'Affiliate Button Text', 'wp-product-review' ); ?> </label>
142
+ <?php
143
+ echo $html_helper->text(
144
+ array(
145
+ 'name' => 'wppr-editor-button-text-2',
146
+ 'value' => $model->get_value( 'wppr-editor-button-text-2' ),
147
+ 'placeholder' => __( 'Affiliate Button Text', 'wp-product-review' ),
148
+ )
149
+ );
150
+ ?>
151
+ </li>
152
+ <li class="hidden_fields" style="display: none;">
153
+ <label for="wppr-editor-button-link"><?php _e( 'Affiliate Link', 'wp-product-review' ); ?> </label>
154
+ <?php
155
+ echo $html_helper->text(
156
+ array(
157
+ 'name' => 'wppr-editor-button-link-2',
158
+ 'value' => $model->get_value( 'wppr-editor-button-link-2' ),
159
+ 'placeholder' => __( 'Affiliate Link', 'wp-product-review' ),
160
+ )
161
+ );
162
+ ?>
163
+ </li>
164
+ <?php
165
+ }
166
+ ?>
167
+ <?php
168
+ if ( ! empty( $links ) ) {
169
+ if ( count( $links ) > 1 ) {
170
+ $i = 1;
171
+ foreach ( $links as $text => $url ) {
172
+ if ( $i > 1 ) {
173
+ ?>
174
+ <li>
175
+ <label for="wppr-editor-button-text-<?php $i; ?>"><?php echo __( 'Affiliate Button Text', 'wp-product-review' ) . ' ' . $i; ?> </label>
176
+ <?php
177
+ echo $html_helper->text(
178
+ array(
179
+ 'name' => 'wppr-editor-button-text-' . $i,
180
+ 'value' => $text,
181
+ 'placeholder' => __( 'Affiliate Button Text', 'wp-product-review' ) . ' ' . $i,
182
+ )
183
+ );
184
+ ?>
185
+ </li>
186
+ <li>
187
+ <label for="wppr-editor-button-link-<?php $i; ?>"><?php echo __( 'Affiliate Link', 'wp-product-review' ) . ' ' . $i; ?> </label>
188
+ <?php
189
+ echo $html_helper->text(
190
+ array(
191
+ 'name' => 'wppr-editor-button-link-' . $i,
192
+ 'value' => $url,
193
+ 'placeholder' => __( 'Affiliate Link', 'wp-product-review' ) . ' ' . $i,
194
+ )
195
+ );
196
+ ?>
197
+ </li>
198
+ <?php
199
+ }
200
+ $i ++;
201
+ }
202
+ }
203
+ }
204
+ ?>
205
+
206
+ <li>
207
+ <label for="wppr-editor-price"><?php _e( 'Product Price', 'wp-product-review' ); ?> </label>
208
+ <?php
209
+ echo $html_helper->text(
210
+ array(
211
+ 'name' => 'wppr-editor-price',
212
+ 'value' => $review->get_price_raw(),
213
+ 'placeholder' => __( 'Product Price', 'wp-product-review' ),
214
+ )
215
+ );
216
+ ?>
217
+ </li>
218
+
219
+ </ul>
220
+ </div>
221
+ <?php do_action( 'wppr_editor_details_after', $model->post ); ?>
222
+ </div><!-- end .review-settings-notice -->
223
+ <div class="wppr-review-options wppr-review-section">
224
+ <h4><?php _e( 'Product Options', 'wp-product-review' ); ?></h4>
225
+ <p><?php _e( 'Insert your options and their grades. Grading must be done from 0 to 100.', 'wp-product-review' ); ?></p>
226
+ <div class="cwpr_clearfix">
227
+ <?php
228
+ if ( $model->wppr_get_option( 'cwppos_show_poweredby' ) === 'yes' || class_exists( 'WPPR_Pro' ) || function_exists( 'wppr_ep_js_preloader' ) ) {
229
+ ?>
230
+ <a href="#" class="preload_info"><?php _e( 'Preload Info', 'wp-product-review' ); ?></a>
231
+ <?php
232
+ } else {
233
+ echo '<label class="wppr-upsell-label">' . __( ' In order to be able to automatically load your options from another posts, you need the ', 'wp-product-review' ) . '<a href="' . WPPR_UPSELL_LINK . '" target="_blank" >' . __( 'PRO add-on','wp-product-review' ) . '</a></label>';
234
+ }
235
+ ?>
236
+ </div>
237
+ <?php do_action( 'wppr_editor_options_before', $model->post ); ?>
238
+ <div class="wppr-review-fieldset wppr-review-options-fields">
239
+ <ul class="wppr-review-options-list clear">
240
+ <?php
241
+
242
+ $options_nr = $model->wppr_get_option( 'cwppos_option_nr' );
243
+ for ( $i = 1; $i <= $options_nr; $i ++ ) {
244
+ ?>
245
+ <li>
246
+ <label for="wppr-editor-options-text-<?php echo $i; ?>"><?php echo $i; ?></label>
247
+ <?php
248
+ echo $html_helper->text(
249
+ array(
250
+ 'name' => 'wppr-editor-options-name[]',
251
+ 'id' => 'wppr-editor-options-name-' . $i,
252
+ 'value' => $model->get_value( 'wppr-option-name-' . $i ),
253
+ 'placeholder' => __( 'Option', 'wp-product-review' ) . ' ' . $i,
254
+ )
255
+ );
256
+ echo $html_helper->text(
257
+ array(
258
+ 'name' => 'wppr-editor-options-value[]',
259
+ 'id' => 'wppr-editor-options-value-' . $i,
260
+ 'class' => 'wppr-text wppr-option-number',
261
+ 'value' => $model->get_value( 'wppr-option-value-' . $i ),
262
+ 'placeholder' => __( 'Grade', 'wp-product-review' ),
263
+ )
264
+ );
265
+ ?>
266
+ </li>
267
+ <?php
268
+ }
269
+ ?>
270
+ </ul>
271
+ </div>
272
+ <?php do_action( 'wppr_editor_options_after', $model->post ); ?>
273
+
274
+ </div>
275
+ <div class="wppr-review-pros wppr-review-section">
276
+ <h4><?php _e( 'Pro Features', 'wp-product-review' ); ?></h4>
277
+ <p><?php _e( 'Insert product\'s pro features below.', 'wp-product-review' ); ?></p>
278
+
279
+ <?php do_action( 'wppr_editor_pros_before', $model->post ); ?>
280
+ <div class="wppr-review-fieldset wppr-review-pros-fields">
281
+ <ul class="wppr-review-options-list clear">
282
+ <?php
283
+ $options_nr = $model->wppr_get_option( 'cwppos_option_nr' );
284
+ $pros = $review->get_pros();
285
+ for ( $i = 1; $i <= $options_nr; $i ++ ) {
286
+ ?>
287
+ <li>
288
+ <label for="wppr-editor-pros-<?php echo $i; ?>"><?php echo $i; ?></label>
289
+ <?php
290
+ echo $html_helper->text(
291
+ array(
292
+ 'name' => 'wppr-editor-pros[]',
293
+ 'id' => 'wppr-editor-pros-' . $i,
294
+ 'value' => isset( $pros[ $i - 1 ] ) ? $pros[ $i - 1 ] : '',
295
+ 'placeholder' => __( 'Option', 'wp-product-review' ) . ' ' . $i,
296
+ )
297
+ );
298
+ ?>
299
+ </li>
300
+ <?php
301
+ }
302
+ ?>
303
+ </ul>
304
+ </div>
305
+ <?php do_action( 'wppr_editor_pros_after', $model->post ); ?>
306
+ </div>
307
+ <div class="wppr-review-cons wppr-review-section">
308
+ <h4><?php _e( 'Cons Features', 'wp-product-review' ); ?></h4>
309
+ <p><?php _e( 'Insert product\'s cons features below.', 'wp-product-review' ); ?></p>
310
+ <?php do_action( 'wppr_editor_cons_before', $model->post ); ?>
311
+ <div class="wppr-review-fieldset wppr-review-cons-fields">
312
+ <ul class="wppr-review-options-list clear">
313
+ <?php
314
+ $options_nr = $model->wppr_get_option( 'cwppos_option_nr' );
315
+ $cons = $review->get_cons();
316
+ for ( $i = 1; $i <= $options_nr; $i ++ ) {
317
+ ?>
318
+ <li>
319
+ <label for="wppr-editor-cons-<?php echo $i; ?>"><?php echo $i; ?></label>
320
+ <?php
321
+ echo $html_helper->text(
322
+ array(
323
+ 'name' => 'wppr-editor-cons[]',
324
+ 'id' => 'wppr-editor-cons-' . $i,
325
+ 'value' => isset( $cons[ $i - 1 ] ) ? $cons[ $i - 1 ] : '',
326
+ 'placeholder' => __( 'Option', 'wp-product-review' ) . ' ' . $i,
327
+ )
328
+ );
329
+ ?>
330
+ </li>
331
+ <?php
332
+ }
333
+ ?>
334
+ </ul>
335
+ </div>
336
+ <?php do_action( 'wppr_editor_cons_after', $model->post ); ?>
337
+ </div>
338
+
339
+ <br class="clear">
340
+
341
+ <?php if ( ! shortcode_exists( 'P_REVIEW' ) ) : ?>
342
+ <label class="wppr-upsell-label"> You can use the shortcode <b>[P_REVIEW]</b> to show a review you already made or
343
+ <b>[wpr_landing]</b> to display a comparision table of them. The shortcodes are available on the <a
344
+ target="_blank" href="<?php echo WPPR_UPSELL_LINK; ?>">Pro Bundle</a><br/><br/></label>
345
+ <?php endif; ?>
346
+
347
+ <?php do_action( 'wppr_editor_after', $model->post ); ?>
348
+ </div>
includes/admin/layouts/header-part.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Header for admin pages.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage WPPR/Layouts
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ ?>
13
+ <div class="pro-features-header">
14
+ <p class="logo">WP Product Review</p>
15
+ <span class="slogan">by <a
16
+ href="https://themeisle.com/">ThemeIsle</a></span>
17
+ <div class="header-btns">
18
+ <?php if ( ! class_exists( 'WPPR_Pro' ) ) { ?>
19
+ <a target="_blank" href="<?php echo WPPR_UPSELL_LINK; ?>" class="buy-now"><span
20
+ class="dashicons dashicons-cart"></span> More features</a>
21
+ <?php } ?>
22
+ </div>
23
+ <div class="clear"></div>
24
+ </div>
includes/admin/layouts/settings-tpl.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings layout in the admin dashboard.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ $global_settings = WPPR_Global_Settings::instance();
13
+ $sections = $global_settings->get_sections();
14
+ $fields = $global_settings->get_fields();
15
+
16
+ ?>
17
+ <div id="wppr-admin">
18
+ <?php do_action( 'wppr_admin_page_before' ); ?>
19
+
20
+ <?php include WPPR_PATH . '/includes/admin/layouts/header-part.php'; ?>
21
+
22
+ <div id="wppr_top_tabs" class="clearfix">
23
+ <ul id="tabs_menu" role="menu">
24
+ <?php foreach ( $sections as $section_key => $section_name ) : ?>
25
+ <li class="wppr-nav-tab" id="wppr-nav-tab-<?php echo $section_key; ?>"
26
+ data-tab="wppr-tab-<?php echo $section_key; ?>">
27
+ <a href="#wppr-tab-<?php echo $section_key; ?>" title="<?php esc_attr( $section_name ); ?>">
28
+ <?php echo esc_html( $section_name ); ?>
29
+ </a>
30
+ </li>
31
+ <?php endforeach; ?>
32
+ </ul>
33
+
34
+ </div>
35
+ <form id="wppr-settings" method="post" action="#" enctype="multipart/form-data">
36
+
37
+ <?php foreach ( $sections as $section_key => $section_name ) : ?>
38
+ <div id="wppr-tab-<?php echo $section_key; ?>" class="wppr-tab-content">
39
+ <?php if ( ! shortcode_exists( 'P_REVIEW' ) ) : ?>
40
+ <label class="wppr-upsell-label"> You can use the shortcode <b>[P_REVIEW]</b> to show a review you already made or
41
+ <b>[wpr_landing]</b> to display a comparision table of them. The shortcodes are available on the <a
42
+ target="_blank" href="<?php echo WPPR_UPSELL_LINK; ?>">Pro Bundle</a><br/><br/></label>
43
+ <?php endif; ?>
44
+ <?php
45
+ foreach ( $fields[ $section_key ] as $name => $field ) {
46
+ $field['title'] = $field['name'];
47
+ $field['name'] = $name;
48
+ $field['value'] = $model->wppr_get_option( $name );
49
+ $this->add_element( $field );
50
+ }
51
+ ?>
52
+ </div>
53
+
54
+ <?php endforeach; ?>
55
+
56
+ <div id="info_bar">
57
+ <button type="button" class="button-primary cwp_save"><?php _e( 'Save All Changes','wp-product-review' ); ?></button>
58
+ <span class="spinner" ></span>
59
+ </div><!--.info_bar-->
60
+ </form>
61
+ <?php do_action( 'wppr_admin_page_after' ); ?>
62
+ </div>
includes/admin/layouts/upsell-tpl.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Up-sell layout in the admin dashboard.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ ?>
13
+ <div id="wppr-admin">
14
+
15
+ <?php
16
+ include WPPR_PATH . '/includes/admin/layouts/header-part.php';
17
+ ?>
18
+
19
+ <div class="pro-feature">
20
+ <div class="pro-feature-features">
21
+ <h2>Amazon Integration</h2>
22
+ <h4>Connects your site with Amazon in just a click</h4>
23
+ <p>If you want the Amazon data to be imported to your site, you don't have to do it manually. Add the
24
+ product ID and, by just clicking a button, the name, image, affiliate link, and price will be
25
+ transferred. Saves a lot of time.</p>
26
+ <h4>Synchronizes the prices with Amazon</h4>
27
+ <p>The add-on automatically synchronizes the prices with the ones from Amazon, so you won't have to do it
28
+ manually everytime they change. Because prices vary all the time and you probably have better stuff to
29
+ do instead of tracking them.</p>
30
+ </div>
31
+ <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/assets/img/wppr-amazon-integration-and-support.jpg">
32
+ </div>
33
+ <div class="clear"></div>
34
+ </div>
35
+ <div class="clear"></div>
36
+
37
+ <div class="pro-feature">
38
+ <div class="pro-feature-features">
39
+ <h2>Shortcodes</h2>
40
+ <p>Position the review box anywhere in the post with the help of shortcodes. Add as many reviews as you want
41
+ in the same page.</p>
42
+
43
+ </div>
44
+ <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/assets/img/wppr-shortcodes.jpg"></div>
45
+ <div class="clear"></div>
46
+ </div>
47
+ <div class="clear"></div>
48
+
49
+ <div class="pro-feature">
50
+ <div class="pro-feature-features">
51
+ <h2>Comparison Table</h2>
52
+ <p>Our powerful ranking table add-on is also included in the bundle and by using it you can automatically
53
+ generate comparison landing pages or enhance your review articles even more</p>
54
+ </div>
55
+ <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/assets/img/wppr-review-comparison.jpg"></div>
56
+ <div class="clear"></div>
57
+ </div>
58
+ <div class="clear"></div>
59
+
60
+ <div class="pro-feature">
61
+ <div class="pro-feature-features">
62
+ <h2>Import</h2>
63
+ <p>No need to set up each product review separately. You can import options from other reviews you’ve
64
+ previously built</p>
65
+
66
+ </div>
67
+ <div class="pro-feature-image"><img src="<?php echo WPPR_URL; ?>/assets/img/wppr-import.jpg"></div>
68
+ <div class="clear"></div>
69
+ </div>
70
+ <div class="clear"></div>
71
+ </div>
includes/admin/layouts/widget-admin-tpl.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Widget layout for the admin dashboard.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ // @codingStandardsIgnoreStart
13
+ ?>
14
+ <p>
15
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'wp-product-review' ); ?></label>
16
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
17
+ </p>
18
+ <p>
19
+ <label for="<?php echo $this->get_field_id( 'no_items' ); ?>"><?php _e( 'Number of posts to show:', 'wp-product-review' ); ?></label>
20
+ <input id="<?php echo $this->get_field_id( 'no_items' ); ?>" name="<?php echo $this->get_field_name( 'no_items' ); ?>" size="3" type="text" value="<?php echo esc_attr( $instance['no_items'] ); ?>" />
21
+ </p>
22
+ <p>
23
+ <?php $cwp_tp_selected_categ = esc_attr( $instance['cwp_tp_category'] ); ?>
24
+ <label for="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>"><?php _e( 'Category:', 'wp-product-review' ); ?></label>
25
+ <select id="<?php echo $this->get_field_id( 'cwp_tp_category' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_category' ); ?>">
26
+ <?php echo '<option>All</option>'; ?>
27
+ <?php foreach ( $instance['cwp_tp_all_categories'] as $categ_slug => $categ_name ) : ?>
28
+ <?php if ( $categ_slug == $cwp_tp_selected_categ ) {
29
+ echo '<option selected>' . $categ_slug . '</option>';
30
+ } elseif ( $categ_slug == '' ) {
31
+ echo '<option>There are no categs</select>';
32
+ } else {
33
+ echo '<option>' . $categ_slug . '</option>';
34
+ } ?>
35
+ <?php endforeach; ?>
36
+ </select>
37
+ </p>
38
+ <p>
39
+ <?php $cwp_tp_layout = esc_attr( $instance['cwp_tp_layout'] ); ?>
40
+ <label for="<?php echo $this->get_field_id( 'cwp_tp_layout' ); ?>"><?php _e( 'Layout:', 'wp-product-review' ); ?></label>
41
+ <?php
42
+ $layouts = array();
43
+ $customLayoutFiles = glob( WPPR_PATH . '/includes/public/layouts/widget/*.php' );
44
+ foreach ( $customLayoutFiles as $file ) {
45
+ $layouts[ basename( $file ) ] = ucwords( basename( $file, '.php' ) );
46
+ }
47
+ foreach ( $layouts as $key => $val ) :
48
+ $extra = '';
49
+ if ( $key == $cwp_tp_layout ) { $extra = 'checked'; }
50
+ $styleName = strtolower( str_replace( ' ', '', $val ) );
51
+ $id = $this->get_field_id( $styleName );
52
+ ?>
53
+ <br>
54
+ <input type="radio" name="<?php echo $this->get_field_name( 'cwp_tp_layout' ); ?>" value="<?php echo $key;?>" id="<?php echo $id . 'style'?>" <?php echo $extra;?> class="wppr-stylestyle"><label for="<?php echo $id . 'style';?>" class="wppr-stylestyle"><?php echo $val;?></label>
55
+ <span class="wppr-styleimg" id="<?php echo $id . 'style'?>img">
56
+ <img src="<?php echo WPPR_URL . '/assets/img/' . $styleName . '.png';?>">
57
+ </span>
58
+ <?php
59
+ endforeach;
60
+ ?>
61
+ </p>
62
+ <p class="wppr-customField" style="display: none">
63
+ <?php $cwp_tp_buynow = esc_attr( $instance['cwp_tp_buynow'] ); ?>
64
+ <label for="<?php echo $this->get_field_id( 'cwp_tp_buynow' ); ?>"><?php _e( 'Buy Now text:', 'wp-product-review' ); ?></label>
65
+ <input id="<?php echo $this->get_field_id( 'cwp_tp_buynow' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_buynow' ); ?>" class="widefat" type="text" value="<?php echo $cwp_tp_buynow; ?>" />
66
+ </p>
67
+ <p class="wppr-customField" style="display: none">
68
+ <?php $cwp_tp_readreview = esc_attr( $instance['cwp_tp_readreview'] ); ?>
69
+ <label for="<?php echo $this->get_field_id( 'cwp_tp_readreview' ); ?>"><?php _e( 'Read Review text:', 'wp-product-review' ); ?></label>
70
+ <input id="<?php echo $this->get_field_id( 'cwp_tp_readreview' ); ?>" name="<?php echo $this->get_field_name( 'cwp_tp_readreview' ); ?>" class="widefat" type="text" value="<?php echo $cwp_tp_readreview; ?>" />
71
+ </p>
72
+ <p>
73
+ <label for="<?php echo $this->get_field_id( 'title_type' ); ?>"><?php _e( 'Display Product Titles :', 'wp-product-review' ); ?></label>
74
+ <input id="<?php echo $this->get_field_id( 'title_type' ); ?>" name="<?php echo $this->get_field_name( 'title_type' ); ?>" type="checkbox" <?php checked( $instance['title_type'] ); ?> />
75
+ </p>
76
+ <p>
77
+ <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Display Product Image :', 'wp-product-review' ); ?></label>
78
+ <input id="<?php echo $this->get_field_id( 'show_image' ); ?>" name="<?php echo $this->get_field_name( 'show_image' ); ?>" type="checkbox" <?php checked( $instance['show_image'] ); ?> />
79
+ </p>
80
+ <?php // @codingStandardsIgnoreEnd ?>
includes/admin/models/abstract/class-wppr-model-abstract.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Abstract class for Models.
4
+ * Defines inheritable utility methods.
5
+ *
6
+ * @package WPPR
7
+ * @subpackage Models
8
+ * @copyright Copyright (c) 2017, Bogdan Preda
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 3.0.0
11
+ */
12
+
13
+ /**
14
+ * Class WPPR_Model_Abstract
15
+ */
16
+ class WPPR_Model_Abstract {
17
+
18
+ /**
19
+ * The logger class.
20
+ *
21
+ * @since 3.0.0
22
+ * @access public
23
+ * @var WPPR_Logger $logger The logger utility class.
24
+ */
25
+ public $logger;
26
+ /**
27
+ * The main options array.
28
+ *
29
+ * @since 3.0.0
30
+ * @access private
31
+ * @var array $options The options array.
32
+ */
33
+ private $options;
34
+ /**
35
+ * The option namespace.
36
+ *
37
+ * @since 3.0.0
38
+ * @access private
39
+ * @var string $namespace The options namespace.
40
+ */
41
+ private $namespace = 'cwppos_options';
42
+
43
+ /**
44
+ * WPPR_Model_Abstract constructor.
45
+ *
46
+ * @since 3.0.0
47
+ * @access public
48
+ */
49
+ public function __construct() {
50
+ $this->options = get_option( $this->namespace, array() );
51
+ $this->logger = new WPPR_Logger();
52
+ }
53
+
54
+ /**
55
+ * Get the global wppr option.
56
+ *
57
+ * @since 3.0.0
58
+ * @access public
59
+ *
60
+ * @param string $key The option key.
61
+ *
62
+ * @return mixed
63
+ */
64
+ public function wppr_get_option( $key = '' ) {
65
+ return $this->get_var( $key );
66
+ }
67
+
68
+ /**
69
+ * Get the key option value from DB.
70
+ *
71
+ * @since 3.0.0
72
+ * @access protected
73
+ *
74
+ * @param string $key The key name of the option.
75
+ *
76
+ * @return bool|mixed
77
+ */
78
+ protected function get_var( $key ) {
79
+ $this->logger->notice( 'Getting value for ' . $key );
80
+ if ( isset( $this->options[ $key ] ) ) {
81
+ return apply_filters( 'wppr_get_old_option', $this->options[ $key ], $key );
82
+ }
83
+ $default = $this->get_default( $key );
84
+ return apply_filters( 'wppr_get_old_option', $default, $key );
85
+ }
86
+
87
+ /**
88
+ * Get the default setting value based on the settings definition.
89
+ *
90
+ * @param string $key The key name.
91
+ *
92
+ * @return bool|mixed The default value.
93
+ */
94
+ private function get_default( $key ) {
95
+ $settings = WPPR_Global_Settings::instance()->get_fields();
96
+ $all = array();
97
+ foreach ( $settings as $section ) {
98
+ $all = array_merge( $all, $section );
99
+ }
100
+ if ( ! isset( $all[ $key ] ) ) {
101
+ return false;
102
+ }
103
+ if ( ! isset( $all[ $key ]['default'] ) ) {
104
+ return false;
105
+ }
106
+
107
+ return $all[ $key ]['default'];
108
+ }
109
+
110
+ /**
111
+ * Update a global wppr option.
112
+ *
113
+ * @since 3.0.0
114
+ * @access public
115
+ *
116
+ * @param string $key The option key.
117
+ * @param string $value The option value.
118
+ *
119
+ * @return mixed
120
+ */
121
+ public function wppr_set_option( $key = '', $value = '' ) {
122
+ return $this->set_var( $key, $value );
123
+ }
124
+
125
+ /**
126
+ * Setter method for updating the options array.
127
+ *
128
+ * @since 3.0.0
129
+ * @access protected
130
+ *
131
+ * @param string $key The name of option.
132
+ * @param string $value The value of the option.
133
+ *
134
+ * @return bool|mixed
135
+ */
136
+ protected function set_var( $key, $value = '' ) {
137
+ $this->logger->notice( 'Setting value for ' . $key . ' with ' . print_r( $value ) );
138
+ if ( ! array_key_exists( $key, $this->options ) ) {
139
+ $this->options[ $key ] = '';
140
+ }
141
+ $this->options[ $key ] = apply_filters( 'wppr_pre_option_' . $key, $value );
142
+
143
+ return update_option( $this->namespace, $this->options );
144
+ }
145
+ }
includes/admin/models/class-wppr-editor-model.php ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Short desc
4
+ *
5
+ * Long desc
6
+ *
7
+ * @package WPPR
8
+ * @subpackage WPPR_Editor
9
+ * @copyright Copyright (c) 2017, Marius Cristea
10
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11
+ * @since 3.0.0
12
+ */
13
+
14
+ /**
15
+ * The default editor class.
16
+ *
17
+ * Class WPPR_Default_Editor.
18
+ */
19
+ class WPPR_Editor_Model extends WPPR_Model_Abstract {
20
+
21
+ /**
22
+ * The WP_Post object.
23
+ *
24
+ * @since 3.0.0
25
+ * @access public
26
+ * @var WP_Post $post The WordPress post object.
27
+ */
28
+ public $post;
29
+
30
+ /**
31
+ * The WPPR_Review object.
32
+ *
33
+ * @since 3.0.0
34
+ * @access public
35
+ * @var WPPR_Review $review The Review Model class.
36
+ */
37
+ public $review;
38
+
39
+ /**
40
+ * The last review id saved.
41
+ *
42
+ * @since 3.0.0
43
+ * @access private
44
+ * @var int $previous The previous review id.
45
+ */
46
+ private $previous;
47
+
48
+ /**
49
+ * The template to use for this editor.
50
+ *
51
+ * @since 3.0.0
52
+ * @access private
53
+ * @var string $template_to_use The template name or path for this editor.
54
+ */
55
+ private $template_to_use = 'editor-default';
56
+
57
+ /**
58
+ * WPPR_Default_Editor constructor.
59
+ *
60
+ * @since 3.0.0
61
+ * @access public
62
+ * @param WP_Post $post The post object.
63
+ */
64
+ public function __construct( $post ) {
65
+ parent::__construct();
66
+
67
+ if ( $post instanceof WP_Post ) {
68
+ $this->post = $post;
69
+ $this->review = new WPPR_Review_Model( $this->post->ID );
70
+ } else {
71
+ $this->logger->error( 'No WP_Post provided = ' . var_export( $post, true ) );
72
+ }
73
+ $previous = $this->wppr_get_option( 'last_review' );
74
+ if ( ! empty( $previous ) ) {
75
+ $this->previous = new WPPR_Review_Model( $previous );
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Method to get the template needed for this editor.
81
+ *
82
+ * @since 3.0.0
83
+ * @access public
84
+ * @return string
85
+ */
86
+ public function get_template() {
87
+ return $this->template_to_use;
88
+ }
89
+
90
+ /**
91
+ * Retrive the smart values based on the last saved review.
92
+ *
93
+ * @since 3.0.0
94
+ * @access public
95
+ * @param string $key The field name.
96
+ * @return string
97
+ */
98
+ public function get_value( $key ) {
99
+ switch ( true ) {
100
+ case ( $key === 'wppr-editor-button-text' ):
101
+ case ( $key === 'wppr-editor-button-link' ):
102
+ if ( $this->review->is_active() ) {
103
+ $links = $this->review->get_links();
104
+ if ( ! empty( $links ) ) {
105
+ if ( $key == 'wppr-editor-button-link' ) {
106
+ $values = array_values( $links );
107
+ } else {
108
+ $values = array_keys( $links );
109
+ }
110
+
111
+ return isset( $values[0] ) ? $values[0] : '';
112
+ }
113
+ } else {
114
+ if ( ! empty( $this->previous ) ) {
115
+ $links = $this->previous->get_links();
116
+ if ( ! empty( $links ) ) {
117
+ if ( $key == 'wppr-editor-button-link' ) {
118
+ $values = array_values( $links );
119
+ } else {
120
+ $values = array_keys( $links );
121
+ }
122
+
123
+ return isset( $values[0] ) ? $values[0] : '';
124
+ }
125
+ }
126
+ }
127
+
128
+ return '';
129
+ break;
130
+ case ( strpos( $key, 'wppr-option-name-' ) !== false ):
131
+ case ( strpos( $key, 'wppr-option-value-' ) !== false ):
132
+ $options = array();
133
+ if ( $this->review->is_active() ) {
134
+ $options = $this->review->get_options();
135
+ } else {
136
+ if ( ! empty( $this->previous ) ) {
137
+ $options = $this->previous->get_options();
138
+ }
139
+ }
140
+ $parts = explode( '-', $key );
141
+ $index = $parts[ count( $parts ) - 1 ];
142
+ $index = intval( $index ) - 1;
143
+ $type = $parts[ count( $parts ) - 2 ];
144
+
145
+ return isset( $options[ $index ] ) ? $options[ $index ][ $type ] : '';
146
+ break;
147
+ case ( $key === 'wppr-editor-link' ):
148
+ if ( $this->review->is_active() ) {
149
+ return $this->review->get_click();
150
+ } else {
151
+ if ( ! empty( $this->previous ) ) {
152
+ return $this->previous->get_click();
153
+ }
154
+ }
155
+
156
+ return 'image';
157
+ break;
158
+ default:
159
+ return '';
160
+ }// End switch().
161
+ }
162
+
163
+ /**
164
+ * Save the editor data.
165
+ *
166
+ * @since 3.0.0
167
+ * @access public
168
+ */
169
+ public function save() {
170
+ $data = $_POST;
171
+
172
+ do_action( 'wppr_before_save', $this->post, $data );
173
+ $status = isset( $data['wppr-review-status'] ) ? strval( $data['wppr-review-status'] ) : 'no';
174
+
175
+ $review = $this->review;
176
+ if ( $status === 'yes' ) {
177
+
178
+ $review->activate();
179
+ $name = isset( $data['wppr-editor-product-name'] ) ? sanitize_text_field( $data['wppr-editor-product-name'] ) : '';
180
+ $image = isset( $data['wppr-editor-image'] ) ? sanitize_text_field( $data['wppr-editor-image'] ) : '';
181
+ $click = isset( $data['wppr-editor-link'] ) ? strval( sanitize_text_field( $data['wppr-editor-link'] ) ) : 'image';
182
+
183
+ // TODO Setup links as array.
184
+ $link = isset( $data['wppr-editor-button-text'] ) ? strval( sanitize_text_field( $data['wppr-editor-button-text'] ) ) : '';
185
+ $text = isset( $data['wppr-editor-button-link'] ) ? strval( sanitize_text_field( $data['wppr-editor-button-link'] ) ) : '';
186
+ $link2 = isset( $data['wppr-editor-button-text-2'] ) ? strval( sanitize_text_field( $data['wppr-editor-button-text-2'] ) ) : '';
187
+ $text2 = isset( $data['wppr-editor-button-link-2'] ) ? strval( sanitize_text_field( $data['wppr-editor-button-link-2'] ) ) : '';
188
+ $price = isset( $data['wppr-editor-price'] ) ? sanitize_text_field( $data['wppr-editor-price'] ) : 0;
189
+ $options_names = isset( $data['wppr-editor-options-name'] ) ? $data['wppr-editor-options-name'] : array();
190
+ $options_values = isset( $data['wppr-editor-options-value'] ) ? $data['wppr-editor-options-value'] : array();
191
+ $pros = isset( $data['wppr-editor-pros'] ) ? $data['wppr-editor-pros'] : array();
192
+ $cons = isset( $data['wppr-editor-cons'] ) ? $data['wppr-editor-cons'] : array();
193
+ $options = array();
194
+ foreach ( $options_names as $k => $op_name ) {
195
+ if ( isset( $options_values[ $k ] ) && ! empty( $op_name ) && ! empty( $options_values[ $k ] ) ) {
196
+ $options[] = array(
197
+ 'name' => sanitize_text_field( $op_name ),
198
+ 'value' => sanitize_text_field( $options_values[ $k ] ),
199
+ );
200
+
201
+ }
202
+ }
203
+ if ( is_array( $pros ) ) {
204
+ $pros = array_map( 'sanitize_text_field', $pros );
205
+ } else {
206
+ $pros = array();
207
+ }
208
+ if ( is_array( $cons ) ) {
209
+ $cons = array_map( 'sanitize_text_field', $cons );
210
+ } else {
211
+ $cons = array();
212
+ }
213
+ $review->set_name( $name );
214
+ $review->set_image( $image );
215
+ if ( $click === 'image' || $click === 'link' ) {
216
+ $review->set_click( $click );
217
+
218
+ }
219
+ $links = array();
220
+ if ( ! empty( $link ) && ! empty( $text ) ) {
221
+ $links[ $link ] = $text;
222
+ }
223
+ if ( ! empty( $link2 ) && ! empty( $text2 ) ) {
224
+ $links[ $link2 ] = $text2;
225
+ }
226
+ $review->set_links( $links );
227
+ $review->set_price( $price );
228
+ $review->set_pros( $pros );
229
+ $review->set_cons( $cons );
230
+ $review->set_options( $options );
231
+ $this->wppr_set_option( 'last_review', $review->get_ID() );
232
+ } else {
233
+ $review->deactivate();
234
+ }// End if().
235
+ do_action( 'wppr_after_save', $this->post, $data );
236
+ }
237
+
238
+ /**
239
+ * Method to retrieve editor model assets.
240
+ *
241
+ * @since 3.0.0
242
+ * @access public
243
+ * @return array
244
+ */
245
+ public function get_assets() {
246
+ $assets = array(
247
+ 'css' => array(
248
+ 'dashboard-styles' => array(
249
+ 'path' => WPPR_URL . '/assets/css/dashboard_styles.css',
250
+ 'required' => array(),
251
+ ),
252
+ 'default-editor' => array(
253
+ 'path' => WPPR_URL . '/assets/css/editor.css',
254
+ 'required' => array(),
255
+ ),
256
+ ),
257
+ 'js' => array(
258
+ 'default-editor' => array(
259
+ 'path' => WPPR_URL . '/assets/js/admin-review.js',
260
+ 'required' => array( 'jquery' ),
261
+ ),
262
+ ),
263
+ );
264
+
265
+ return $assets;
266
+ }
267
+ }
includes/admin/models/class-wppr-options-model.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Model responsible for direct access to options .
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Models
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Options_Model
14
+ */
15
+ class WPPR_Options_Model extends WPPR_Model_Abstract {
16
+
17
+ /**
18
+ * WPPR_Options_Model constructor.
19
+ *
20
+ * @since 3.0.0
21
+ * @access public
22
+ */
23
+ public function __construct() {
24
+ parent::__construct();
25
+ }
26
+
27
+ }
includes/admin/models/class-wppr-query-model.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The file that defines a model class for easier access to DB
4
+ * functionality, an abstract layer for core and addons to use.
5
+ *
6
+ * @link https://themeisle.com
7
+ * @since 2.0.0
8
+ *
9
+ * @package WPPR_Pro
10
+ * @subpackage WPPR_Pro/includes/models
11
+ */
12
+
13
+ /**
14
+ * Class WPPR_Query_Model
15
+ *
16
+ * A model class for abstracting DB actions.
17
+ *
18
+ * @since 2.0.0
19
+ * @package WPPR_Pro
20
+ * @subpackage WPPR_Pro/includes/model
21
+ */
22
+ class WPPR_Query_Model extends WPPR_Model_Abstract {
23
+
24
+ /**
25
+ * Holds an instance of WPPR_Review_Model
26
+ *
27
+ * @since 2.0.0
28
+ * @access protected
29
+ * @var WPPR_Review_Model $review Holds an instance of WPPR_Review_Model.
30
+ */
31
+ protected $review;
32
+
33
+ /**
34
+ * Holds an instance of the WP DB Object
35
+ *
36
+ * @since 2.0.0
37
+ * @access private
38
+ * @var WPDB $db Holds an instance of the WP DB Object.
39
+ */
40
+ private $db;
41
+
42
+ /**
43
+ * WPPR_Pro_Model constructor.
44
+ *
45
+ * @since 2.0.0
46
+ * @access public
47
+ */
48
+ public function __construct() {
49
+ parent::__construct();
50
+
51
+ global $wpdb;
52
+ $this->db = $wpdb;
53
+ }
54
+
55
+ /**
56
+ * Utility method to return a product by ID.
57
+ *
58
+ * @since 2.0.0
59
+ * @access public
60
+ *
61
+ * @param int $post_id The post ID.
62
+ *
63
+ * @return array
64
+ */
65
+ public function find_by_id( $post_id ) {
66
+ return $this->find(
67
+ array(
68
+ 'post_id' => $post_id,
69
+ )
70
+ );
71
+ }
72
+
73
+ /**
74
+ * Mai utility method to retrive an array of products.
75
+ *
76
+ * @since 2.0.0
77
+ * @access public
78
+ *
79
+ * @param array|false $post The post data to filter by.
80
+ * @param int $limit The limit for the returned results.
81
+ * @param array|false $filter The fields to filter data by.
82
+ * @param array|false $order The fields to order by and the order.
83
+ *
84
+ * @return array
85
+ */
86
+ public function find(
87
+ $post = array(
88
+ 'post_id' => false,
89
+ 'category_id' => false,
90
+ 'category_name' => false,
91
+ ),
92
+ $limit = 20,
93
+ $filter = array(
94
+ 'name' => false,
95
+ 'price' => false,
96
+ 'rating' => false,
97
+ ),
98
+ $order = array(
99
+ 'rating' => false,
100
+ 'price' => false,
101
+ )
102
+ ) {
103
+
104
+ if ( ! is_numeric( $limit ) && $limit >= 0 ) {
105
+ $limit = 20;
106
+ }
107
+
108
+ $sub_query_posts = $this->get_sub_query_posts( $post );
109
+
110
+ $order_by = $this->get_order_by( $order );
111
+
112
+ $conditions = $this->get_query_conditions( $filter );
113
+
114
+ $query = "
115
+ SELECT * FROM (
116
+ SELECT
117
+ `post_id` AS 'ID',
118
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'cwp_meta_box_check', `meta_value`, '' ) SEPARATOR '' ) AS 'cwp_meta_box_check',
119
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'cwp_rev_product_name', `meta_value`, '' ) SEPARATOR '' ) AS 'cwp_rev_product_name',
120
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'cwp_image_link', `meta_value`, '' ) SEPARATOR '' ) AS 'cwp_image_link',
121
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'cwp_rev_product_image', `meta_value`, '' ) SEPARATOR '' ) AS 'cwp_rev_product_image',
122
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'cwp_rev_price', FORMAT( `meta_value`, 2 ), '' ) SEPARATOR '' ) AS 'cwp_rev_price',
123
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'wppr_rating', `meta_value`, '' ) SEPARATOR '' ) AS 'wppr_rating',
124
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'wppr_pros', `meta_value`, '' ) SEPARATOR '' ) AS 'wppr_pros',
125
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'wppr_cons', `meta_value`, '' ) SEPARATOR '' ) AS 'wppr_cons',
126
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'wppr_options', `meta_value`, '' ) SEPARATOR '' ) AS 'wppr_options',
127
+ GROUP_CONCAT( DISTINCT IF( `meta_key` = 'wppr_links', `meta_value`, '' ) SEPARATOR '' ) AS 'wppr_links'
128
+ FROM {$this->db->postmeta}
129
+ WHERE
130
+ `post_id` IN ( " . $sub_query_posts . " )
131
+ GROUP BY `ID`
132
+ ) `pivoted_meta`
133
+ WHERE `cwp_meta_box_check` = 'Yes'
134
+ {$conditions}
135
+ ORDER BY
136
+ {$order_by}
137
+ `cwp_rev_product_name` ASC
138
+ LIMIT {$limit}
139
+ ";
140
+
141
+ $key = hash( 'sha256', $query );
142
+ $processed_res = wp_cache_get( $key, 'wppr' );
143
+ if ( ! is_array( $processed_res ) ) {
144
+ $results = $this->db->get_results( $query, ARRAY_A );
145
+
146
+ $processed_res = array();
147
+ foreach ( $results as $row ) {
148
+
149
+ $row['wppr_pros'] = maybe_unserialize( $row['wppr_pros'] );
150
+ $row['wppr_cons'] = maybe_unserialize( $row['wppr_cons'] );
151
+ $row['wppr_options'] = maybe_unserialize( $row['wppr_options'] );
152
+ $row['wppr_links'] = maybe_unserialize( $row['wppr_links'] );
153
+
154
+ if ( empty( $row['wppr_options'] ) || $row['wppr_options'] == '' ) {
155
+ $this->review = new WPPR_Review_Model( $row['ID'] );
156
+ $row['wppr_options'] = $this->review->get_options();
157
+ }
158
+
159
+ if ( empty( $row['wppr_pros'] ) || $row['wppr_pros'] == '' ) {
160
+ $this->review = new WPPR_Review_Model( $row['ID'] );
161
+ $row['wppr_pros'] = $this->review->get_pros();
162
+ }
163
+
164
+ if ( empty( $row['wppr_cons'] ) || $row['wppr_cons'] == '' ) {
165
+ $this->review = new WPPR_Review_Model( $row['ID'] );
166
+ $row['wppr_cons'] = $this->review->get_cons();
167
+ }
168
+
169
+ if ( empty( $row['wppr_links'] ) || $row['wppr_links'] == '' ) {
170
+ $this->review = new WPPR_Review_Model( $row['ID'] );
171
+ $row['wppr_links'] = $this->review->get_links();
172
+ }
173
+
174
+ $processed_res[] = $row;
175
+ }
176
+
177
+ wp_cache_set( $key, $processed_res, 'wppr', ( 60 * 60 ) );
178
+ }// End if().
179
+
180
+ return $processed_res;
181
+ }
182
+
183
+ /**
184
+ * Build the sub query.
185
+ *
186
+ * @since 2.0.0
187
+ * @access private
188
+ *
189
+ * @param array|false $post The post data to filter by.
190
+ *
191
+ * @return string
192
+ */
193
+ private function get_sub_query_posts( $post ) {
194
+ $sub_query_conditions = $this->get_sub_query_conditions( $post );
195
+
196
+ $sub_query_posts = "
197
+ SELECT `ID`
198
+ FROM {$this->db->terms} wt
199
+ INNER JOIN {$this->db->term_taxonomy} wtt ON wt.term_id = wtt.term_id
200
+ INNER JOIN {$this->db->term_relationships} wtr ON wtt.term_taxonomy_id = wtr.term_taxonomy_id
201
+ INNER JOIN {$this->db->posts} p ON wtr.object_id = p.ID
202
+ WHERE
203
+ p.post_type = 'post' AND p.post_status = 'publish'
204
+ {$sub_query_conditions}
205
+ ";
206
+
207
+ return $sub_query_posts;
208
+ }
209
+
210
+ /**
211
+ * Build the sub query conditions.
212
+ *
213
+ * @since 2.0.0
214
+ * @access private
215
+ *
216
+ * @param array|false $post The post data to filter by.
217
+ *
218
+ * @return string
219
+ */
220
+ private function get_sub_query_conditions( $post ) {
221
+ $sub_query_conditions = '';
222
+ if ( isset( $post['post_id'] ) && $post['post_id'] != false && is_numeric( $post['post_id'] ) && $post['post_id'] > 0 ) {
223
+ $sub_query_conditions .= $this->db->prepare( " AND p.ID = '%d' ", $post['post_id'] );
224
+ }
225
+
226
+ if ( isset( $post['category_id'] ) && $post['category_id'] != false && is_numeric( $post['category_id'] ) && $post['category_id'] > 0 ) {
227
+ $sub_query_conditions .= $this->db->prepare( " AND wt.term_id = '%d' ", $post['category_id'] );
228
+ }
229
+
230
+ if ( isset( $post['category_name'] ) && $post['category_name'] != false ) {
231
+ $sub_query_conditions .= $this->db->prepare( " AND wt.name = '%%%s%%' ", $post['category_name'] );
232
+ }
233
+
234
+ return $sub_query_conditions;
235
+ }
236
+
237
+ /**
238
+ * Build the order by query part.
239
+ *
240
+ * @since 2.0.0
241
+ * @access private
242
+ *
243
+ * @param array|false $order The fields to order by and the order.
244
+ *
245
+ * @return string
246
+ */
247
+ private function get_order_by( $order ) {
248
+ $order_by = '';
249
+ if ( isset( $order['rating'] ) && in_array( $order['rating'], array( 'ASC', 'DESC' ) ) ) {
250
+ $order_by .= "`wppr_rating` {$order['rating']}, ";
251
+ }
252
+
253
+ if ( isset( $order['price'] ) && in_array( $order['price'], array( 'ASC', 'DESC' ) ) ) {
254
+ $order_by .= "`cwp_rev_price` {$order['price']}, ";
255
+ }
256
+ if ( isset( $order['date'] ) && in_array( $order['date'], array( 'ASC', 'DESC' ) ) ) {
257
+ $order_by .= "`ID` {$order['date']}, ";
258
+ }
259
+
260
+ return $order_by;
261
+ }
262
+
263
+ /**
264
+ * Build the query conditions.
265
+ *
266
+ * @since 2.0.0
267
+ * @access private
268
+ *
269
+ * @param array|false $filter The fields to filter data by.
270
+ *
271
+ * @return string
272
+ */
273
+ private function get_query_conditions( $filter ) {
274
+ $conditions = '';
275
+ if ( isset( $filter['name'] ) && $filter['name'] != false ) {
276
+ $conditions .= $this->db->prepare( " AND `cwp_rev_product_name` LIKE '%%%s%%' ", $filter['name'] );
277
+ }
278
+
279
+ if ( isset( $filter['price'] ) && $filter['price'] != false && is_numeric( $filter['price'] ) ) {
280
+ $conditions .= $this->db->prepare( " AND `cwp_rev_price` = FORMAT( '%d', 2 ) ", $filter['price'] );
281
+ }
282
+
283
+ if ( isset( $filter['rating'] ) && $filter['rating'] != false && is_numeric( $filter['rating'] ) ) {
284
+ $conditions .= $this->db->prepare( " AND `wppr_rating` = FORMAT( '%d', 2 ) ", $filter['rating'] );
285
+ }
286
+
287
+ return $conditions;
288
+ }
289
+
290
+ /**
291
+ * Utility method to return products by category ID.
292
+ *
293
+ * @since 2.0.0
294
+ * @access public
295
+ *
296
+ * @param int $cat_id The category ID.
297
+ * @param int $limit Optional. The results limit.
298
+ * @param array|false $filter Optional. The filter array.
299
+ * @param array|false $order Optional. The order array.
300
+ *
301
+ * @return array
302
+ */
303
+ public function find_by_cat_id( $cat_id, $limit = 20, $filter = array(), $order = array() ) {
304
+ return $this->find(
305
+ array(
306
+ 'category_id' => $cat_id,
307
+ ), $limit, $filter, $order
308
+ );
309
+ }
310
+
311
+ /**
312
+ * Utility method to return products by category name.
313
+ *
314
+ * @since 2.0.0
315
+ * @access public
316
+ *
317
+ * @param string $category The category name.
318
+ * @param int $limit Optional. The results limit.
319
+ * @param array|false $filter Optional. The filter array.
320
+ * @param array|false $order Optional. The order array.
321
+ *
322
+ * @return array
323
+ */
324
+ public function find_by_category( $category, $limit = 20, $filter = array(), $order = array() ) {
325
+ return $this->find(
326
+ array(
327
+ 'category_name' => $category,
328
+ ), $limit, $filter, $order
329
+ );
330
+ }
331
+
332
+ /**
333
+ * Utility method to find a product or more by name.
334
+ *
335
+ * @since 2.0.0
336
+ * @access public
337
+ *
338
+ * @param string $name The name to look for.
339
+ * @param int $limit Optional. The results limit.
340
+ *
341
+ * @return array
342
+ */
343
+ public function find_by_name( $name, $limit = 20 ) {
344
+ return $this->find(
345
+ false, $limit, array(
346
+ 'name' => $name,
347
+ )
348
+ );
349
+ }
350
+
351
+ /**
352
+ * Utility method to find a product or more by price.
353
+ *
354
+ * @since 2.0.0
355
+ * @access public
356
+ *
357
+ * @param float|int $price The price to look for.
358
+ * @param int $limit Optional. The results limit.
359
+ *
360
+ * @return array
361
+ */
362
+ public function find_by_price( $price, $limit = 20 ) {
363
+ return $this->find(
364
+ false, $limit, array(
365
+ 'price' => $price,
366
+ )
367
+ );
368
+ }
369
+
370
+ /**
371
+ * Utility method to find a product or more by price.
372
+ *
373
+ * @since 2.0.0
374
+ * @access public
375
+ *
376
+ * @param float|int $rating The rating to look for.
377
+ * @param int $limit Optional. The results limit.
378
+ *
379
+ * @return array
380
+ */
381
+ public function find_by_rating( $rating, $limit = 20 ) {
382
+ return $this->find(
383
+ false, $limit, array(
384
+ 'rating' => $rating,
385
+ )
386
+ );
387
+ }
388
+ }
includes/admin/models/class-wppr-review-model.php ADDED
@@ -0,0 +1,935 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Model responsible for the reviews in WPPR.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Models
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ // Exit if accessed directly
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Class WPPR_Review
19
+ *
20
+ * @since 3.0
21
+ */
22
+ class WPPR_Review_Model extends WPPR_Model_Abstract {
23
+
24
+ /**
25
+ * The review ID.
26
+ *
27
+ * @since 3.0.0
28
+ * @access private
29
+ * @var int $ID The review id.
30
+ */
31
+ private $ID = 0;
32
+
33
+ /**
34
+ * The overall score of the review.
35
+ *
36
+ * @since 3.0.0
37
+ * @access private
38
+ * @var float $score The overall score of the review.
39
+ */
40
+ private $score = 0;
41
+
42
+ /**
43
+ * If the review is active or not.
44
+ *
45
+ * @since 3.0.0
46
+ * @access private
47
+ * @var bool $is_active If the review is active or not.
48
+ */
49
+ private $is_active = false;
50
+
51
+ /**
52
+ * Array containg the list of pros for the review.
53
+ *
54
+ * @since 3.0.0
55
+ * @access private
56
+ * @var array $pros The list of pros.
57
+ */
58
+ private $pros = array();
59
+
60
+ /**
61
+ * The array containg the list of cons for the review.
62
+ *
63
+ * @since 3.0.0
64
+ * @access private
65
+ * @var array $cons The list of cons.
66
+ */
67
+ private $cons = array();
68
+
69
+ /**
70
+ * The review title.
71
+ *
72
+ * @since 3.0.0
73
+ * @access private
74
+ * @var string $name The review title.
75
+ */
76
+ private $name = '';
77
+
78
+ /**
79
+ * The url of the image used in the review.
80
+ *
81
+ * @since 3.0.0
82
+ * @access private
83
+ * @var array $image The urls of the images used.
84
+ */
85
+ private $image = '';
86
+
87
+ /**
88
+ * The click behaviour.
89
+ *
90
+ * @since 3.0.0
91
+ * @access private
92
+ * @var string $click The click behaviour.
93
+ */
94
+ private $click = '';
95
+
96
+ /**
97
+ * The list of links as url=>link_title
98
+ *
99
+ * @since 3.0.0
100
+ * @access private
101
+ * @var array $links The list of links from the review
102
+ */
103
+ private $links = array();
104
+
105
+ /**
106
+ * The price of the product reviewed.
107
+ *
108
+ * @since 3.0.0
109
+ * @access private
110
+ * @var string $price The price of the product reviewed.
111
+ */
112
+ private $price = '0.00';
113
+ /**
114
+ * The price raw of the product reviewed.
115
+ *
116
+ * @since 3.0.0
117
+ * @access private
118
+ * @var string $price The price raw of the product reviewed containg currency and value.
119
+ */
120
+ private $price_raw = '0.00';
121
+
122
+ /**
123
+ * The price currency of the product reviewed.
124
+ *
125
+ * @since 3.0.0
126
+ * @access private
127
+ * @var string $price The currency of the product reviewed.
128
+ */
129
+ private $currency = '$';
130
+
131
+ /**
132
+ * An array keeping the list of options for the product reviewed.
133
+ *
134
+ * @since 3.0.0
135
+ * @access private
136
+ * @var array $options The options of the product reviewed.
137
+ */
138
+ private $options = array();
139
+
140
+ /**
141
+ * WPPR_Review constructor.
142
+ *
143
+ * @since 3.0.0
144
+ * @access public
145
+ *
146
+ * @param mixed $review_id The review id.
147
+ */
148
+ public function __construct( $review_id = false ) {
149
+ parent::__construct();
150
+
151
+ if ( $review_id === false ) {
152
+ $this->logger->error( 'No review id provided.' );
153
+
154
+ return false;
155
+ }
156
+ if ( $this->check_post( $review_id ) ) {
157
+ $this->ID = $review_id;
158
+ $this->logger->notice( 'Checking review status for ID: ' . $review_id );
159
+ $this->setup_status();
160
+ if ( $this->is_active() ) {
161
+ $this->logger->notice( 'Setting up review for ID: ' . $review_id );
162
+ $this->setup_price();
163
+ $this->setup_name();
164
+ $this->setup_click();
165
+ $this->setup_image();
166
+ $this->setup_links();
167
+ $this->setup_pros_cons();
168
+ $this->setup_options();
169
+ $this->count_rating();
170
+
171
+ return true;
172
+ } else {
173
+ $this->logger->warning( 'Review is not active for this ID: ' . $review_id );
174
+
175
+ return false;
176
+ }
177
+ } else {
178
+ $this->logger->error( 'No post id found to attach this review.' );
179
+ }
180
+
181
+ return false;
182
+ }
183
+
184
+ /**
185
+ * Check if post record exists with that id.
186
+ *
187
+ * @since 3.0.0
188
+ * @access private
189
+ *
190
+ * @param string $review_id The review id to check.
191
+ *
192
+ * @return bool
193
+ */
194
+ private function check_post( $review_id ) {
195
+ return is_string( get_post_type( $review_id ) );
196
+ }
197
+
198
+ /**
199
+ * Setup the review status.
200
+ *
201
+ * @since 3.0.0
202
+ * @access private
203
+ */
204
+ private function setup_status() {
205
+ $status = get_post_meta( $this->ID, 'cwp_meta_box_check', true );
206
+ if ( $status === 'Yes' ) {
207
+ $this->is_active = true;
208
+ } else {
209
+ $this->is_active = false;
210
+ }
211
+ }
212
+
213
+ /**
214
+ * Check if review is active or not.
215
+ *
216
+ * @since 3.0.0
217
+ * @access public
218
+ * @return bool
219
+ */
220
+ public function is_active() {
221
+ return apply_filters( 'wppr_is_review_active', $this->is_active, $this->ID, $this );
222
+ }
223
+
224
+ /**
225
+ * Setup the price of the review.
226
+ *
227
+ * @since 3.0.0
228
+ * @access private
229
+ */
230
+ private function setup_price() {
231
+ $price = get_post_meta( $this->ID, 'cwp_rev_price', true );
232
+ $this->price_raw = $price;
233
+ $currency = $this->format_currency( $price );
234
+ $price = $this->format_price( $price );
235
+ $this->price = $price;
236
+ $this->currency = $currency;
237
+ }
238
+
239
+ /**
240
+ * Format a string to a currency format.
241
+ *
242
+ * @since 3.0.0
243
+ * @access private
244
+ *
245
+ * @param string $string The currency for the price.
246
+ *
247
+ * @return string
248
+ */
249
+ private function format_currency( $string ) {
250
+ $currency = preg_replace( '/[0-9.,]/', '', $string );
251
+
252
+ return $currency;
253
+ }
254
+
255
+ /**
256
+ * Format a string to a price format.
257
+ *
258
+ * @since 3.0.0
259
+ * @access private
260
+ *
261
+ * @param string $string The string for the price.
262
+ *
263
+ * @return string
264
+ */
265
+ private function format_price( $string ) {
266
+ $price = preg_replace( '/[^0-9.,]/', '', $string );
267
+
268
+ return floatval( $price );
269
+ }
270
+
271
+ /**
272
+ * Setup the name of the review.
273
+ *
274
+ * @since 3.0.0
275
+ * @access private
276
+ */
277
+ private function setup_name() {
278
+ $name = get_post_meta( $this->ID, 'cwp_rev_product_name', true );
279
+ $this->name = $name;
280
+ }
281
+
282
+ /**
283
+ * Setup the link behaviour
284
+ *
285
+ * @since 3.0.0
286
+ * @access private
287
+ */
288
+ private function setup_click() {
289
+ $click = get_post_meta( $this->ID, 'cwp_image_link', true );
290
+ if ( $click === 'image' || $click === 'link' ) {
291
+ $this->click = $click;
292
+ }
293
+ }
294
+
295
+ /**
296
+ * Setup the image url.
297
+ *
298
+ * @since 3.0.0
299
+ * @access private
300
+ */
301
+ private function setup_image() {
302
+ $image = get_post_meta( $this->ID, 'cwp_rev_product_image', true );
303
+ if ( empty( $image ) ) {
304
+ $image = wp_get_attachment_url( get_post_thumbnail_id( $this->ID ) );
305
+ }
306
+ $this->image = $image;
307
+ }
308
+
309
+ /**
310
+ * Setup the links array.
311
+ *
312
+ * @since 3.0.0
313
+ * @access private
314
+ */
315
+ private function setup_links() {
316
+ $link_text = get_post_meta( $this->ID, 'cwp_product_affiliate_text', true );
317
+ $link_url = get_post_meta( $this->ID, 'cwp_product_affiliate_link', true );
318
+ $this->links[ $link_text ] = $link_url;
319
+ $link_text = get_post_meta( $this->ID, 'cwp_product_affiliate_text2', true );
320
+ $link_url = get_post_meta( $this->ID, 'cwp_product_affiliate_link2', true );
321
+ $this->links[ $link_text ] = $link_url;
322
+ $new_links = get_post_meta( $this->ID, 'wppr_links', true );
323
+ if ( ! empty( $new_links ) ) {
324
+ $this->links = $new_links;
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Setup the pros and cons array.
330
+ *
331
+ * @since 3.0.0
332
+ * @access private
333
+ */
334
+ private function setup_pros_cons() {
335
+ $options_nr = $this->wppr_get_option( 'cwppos_option_nr' );
336
+ $pros = array();
337
+ $cons = array();
338
+ for ( $i = 1; $i <= $options_nr; $i ++ ) {
339
+ $tmp_pro = get_post_meta( $this->ID, 'cwp_option_' . $i . '_pro', true );
340
+ $tmp_con = get_post_meta( $this->ID, 'cwp_option_' . $i . '_cons', true );
341
+ if ( ! empty( $tmp_pro ) ) {
342
+ $pros[] = $tmp_pro;
343
+ }
344
+ if ( ! empty( $tmp_con ) ) {
345
+ $cons[] = $tmp_con;
346
+ }
347
+ }
348
+ // New pros meta.
349
+ $new_pros = get_post_meta( $this->ID, 'wppr_pros', true );
350
+ if ( ! empty( $new_pros ) ) {
351
+ $pros = $new_pros;
352
+ }
353
+ $this->pros = array_filter( $pros );
354
+ // New cons meta.
355
+ $new_cons = get_post_meta( $this->ID, 'wppr_cons', true );
356
+ if ( ! empty( $new_cons ) ) {
357
+ $cons = $new_cons;
358
+ }
359
+ $this->cons = array_filter( $cons );
360
+
361
+ }
362
+
363
+ /**
364
+ * Setup the options array.
365
+ *
366
+ * @since 3.0.0
367
+ * @access private
368
+ */
369
+ private function setup_options() {
370
+ $options = array();
371
+ $options_nr = $this->wppr_get_option( 'cwppos_option_nr' );
372
+ for ( $i = 1; $i <= $options_nr; $i ++ ) {
373
+ $tmp_name = get_post_meta( $this->ID, 'option_' . $i . '_content', true );
374
+ if ( $tmp_name != '' ) {
375
+ $tmp_score = get_post_meta( $this->ID, 'option_' . $i . '_grade', true );
376
+ $options[] = array(
377
+ 'name' => $tmp_name,
378
+ 'value' => $tmp_score,
379
+ );
380
+ }
381
+ }
382
+ $new_options = get_post_meta( $this->ID, 'wppr_options', true );
383
+ if ( ! empty( $new_options ) ) {
384
+ $options = $new_options;
385
+ }
386
+ $this->options = $options;
387
+ }
388
+
389
+ /**
390
+ * Calculate the review rating.
391
+ *
392
+ * @since 3.0.0
393
+ * @access public
394
+ */
395
+ public function count_rating() {
396
+ $values = wp_list_pluck( $this->options, 'value' );
397
+ $this->score = ( count( $this->options ) > 0 ) ? floatval( array_sum( $values ) / count( $this->options ) ) : 0;
398
+
399
+ update_post_meta( $this->ID, 'wppr_rating', number_format( $this->score, 2 ) );
400
+ }
401
+
402
+ /**
403
+ * Deactivate the review.
404
+ *
405
+ * @since 3.0.0
406
+ * @access public
407
+ */
408
+ public function deactivate() {
409
+ if ( $this->is_active === false ) {
410
+ $this->logger->warning( 'Review is already inactive for ID: ' . $this->ID );
411
+ }
412
+
413
+ $this->is_active = apply_filters( 'wppr_review_change_status', false, $this->ID, $this );
414
+
415
+ do_action( 'wppr_review_deactivate', $this->ID, $this );
416
+
417
+ return update_post_meta( $this->ID, 'cwp_meta_box_check', 'No' );
418
+ }
419
+
420
+ /**
421
+ * Activate the review.
422
+ *
423
+ * @since 3.0.0
424
+ * @access public
425
+ */
426
+ public function activate() {
427
+ if ( $this->is_active === true ) {
428
+ $this->logger->warning( 'Review is already active for ID: ' . $this->ID );
429
+ }
430
+
431
+ $this->is_active = apply_filters( 'wppr_review_change_status', true, $this->ID, $this );
432
+ do_action( 'wppr_review_activate', $this->ID, $this );
433
+
434
+ return update_post_meta( $this->ID, 'cwp_meta_box_check', 'Yes' );
435
+ }
436
+
437
+ /**
438
+ * Method to retrieve the review model data as an array.
439
+ *
440
+ * @since 3.0.0
441
+ * @access public
442
+ * @return array
443
+ */
444
+ public function get_review_data() {
445
+ $data = array(
446
+ 'id' => $this->get_ID(),
447
+ 'name' => $this->get_name(),
448
+ 'price' => $this->get_price(),
449
+ 'currency' => $this->get_currency(),
450
+ 'click' => $this->get_click(),
451
+ 'image' => array(
452
+ 'full' => $this->get_image(),
453
+ 'thumb' => $this->get_small_thumbnail(),
454
+ ),
455
+ 'rating' => $this->get_rating(),
456
+ 'comment_rating' => $this->get_comments_rating(),
457
+ 'pros' => $this->get_pros(),
458
+ 'cons' => $this->get_cons(),
459
+ 'options' => $this->get_options(),
460
+ 'links' => $this->get_links(),
461
+ );
462
+
463
+ return $data;
464
+ }
465
+
466
+ /**
467
+ * Return the review id.
468
+ *
469
+ * @since 3.0.0
470
+ * @access public
471
+ * @return int
472
+ */
473
+ public function get_ID() {
474
+ return $this->ID;
475
+ }
476
+
477
+ /**
478
+ * Return the review name.
479
+ *
480
+ * @since 3.0.0
481
+ * @access public
482
+ * @return string
483
+ */
484
+ public function get_name() {
485
+ return apply_filters( 'wppr_name', $this->name, $this->ID, $this );
486
+ }
487
+
488
+ /**
489
+ * Setter method for saving the review name.
490
+ *
491
+ * @since 3.0.0
492
+ * @access public
493
+ *
494
+ * @param string $name The new review name.
495
+ *
496
+ * @return bool
497
+ */
498
+ public function set_name( $name ) {
499
+ $name = apply_filters( 'wppr_name_format', $name, $this->ID, $this );
500
+ if ( $name !== $this->name ) {
501
+ $this->name = $name;
502
+
503
+ return update_post_meta( $this->ID, 'cwp_rev_product_name', $name );
504
+ }
505
+
506
+ return false;
507
+ }
508
+
509
+ /**
510
+ * Returns the review price.
511
+ *
512
+ * @since 3.0.0
513
+ * @access public
514
+ * @return string
515
+ */
516
+ public function get_price() {
517
+ return apply_filters( 'wppr_price', $this->price, $this->ID, $this );
518
+ }
519
+
520
+ /**
521
+ * Setup the new price.
522
+ *
523
+ * @since 3.0.0
524
+ * @access public
525
+ *
526
+ * @param string $price The new price.
527
+ *
528
+ * @return bool
529
+ */
530
+ public function set_price( $price ) {
531
+ $price = apply_filters( 'wppr_price_raw', $price, $this->ID, $this );
532
+ if ( $price !== $this->price_raw ) {
533
+ $this->price_raw = $price;
534
+
535
+ $update = update_post_meta( $this->ID, 'cwp_rev_price', $price );
536
+
537
+ $this->setup_price();
538
+
539
+ return $update;
540
+ } else {
541
+ $this->logger->warning( 'Review: ' . $this->ID . ' price is the same.' );
542
+ }
543
+
544
+ return false;
545
+ }
546
+
547
+ /**
548
+ * Returns the currency price.
549
+ *
550
+ * @since 3.0.0
551
+ * @access public
552
+ * @return string
553
+ */
554
+ public function get_currency() {
555
+ return apply_filters( 'wppr_currency', empty( $this->currency ) ? '$' : $this->currency, $this->ID, $this );
556
+ }
557
+
558
+ /**
559
+ * Return the click behaviour.
560
+ *
561
+ * @since 3.0.0
562
+ * @access public
563
+ * @return string
564
+ */
565
+ public function get_click() {
566
+ return apply_filters( 'wppr_click', $this->click, $this->ID, $this );
567
+ }
568
+
569
+ /**
570
+ * Setter for click behaviour.
571
+ *
572
+ * @since 3.0.0
573
+ * @access public
574
+ *
575
+ * @param string $click The new click behaviour.
576
+ *
577
+ * @return bool
578
+ */
579
+ public function set_click( $click ) {
580
+ if ( $click === 'image' || $click === 'link' ) {
581
+ if ( $this->click != $click ) {
582
+ $this->click = $click;
583
+
584
+ return update_post_meta( $this->ID, 'cwp_image_link', $this->click );
585
+ } else {
586
+ $this->logger->warning( 'Value for click already set in ID: ' . $this->ID );
587
+ }
588
+ } else {
589
+ $this->logger->warning( 'Wrong value for click on ID : ' . $this->ID );
590
+ }
591
+
592
+ return false;
593
+ }
594
+
595
+ /**
596
+ * Get the list of images for the review.
597
+ *
598
+ * @since 3.0.0
599
+ * @access public
600
+ * @return array
601
+ */
602
+ public function get_image() {
603
+ return apply_filters( 'wppr_images', $this->image, $this->ID, $this );
604
+ }
605
+
606
+ /**
607
+ * Set the new image url.
608
+ *
609
+ * @since 3.0.0
610
+ * @access public
611
+ *
612
+ * @param string $image The new image url.
613
+ *
614
+ * @return bool
615
+ */
616
+ public function set_image( $image ) {
617
+ $image = apply_filters( 'wppr_image_format', $image, $this->ID, $this );
618
+ if ( $image !== $this->image ) {
619
+ $this->image = $image;
620
+
621
+ return update_post_meta( $this->ID, 'cwp_rev_product_image', $image );
622
+ } else {
623
+ $this->logger->warning( 'Image already used for ID: ' . $this->ID );
624
+ }
625
+
626
+ return false;
627
+ }
628
+
629
+ /**
630
+ * Return the url of the thumbnail.
631
+ *
632
+ * @since 3.0.0
633
+ * @access public
634
+ * @return string
635
+ */
636
+ public function get_small_thumbnail() {
637
+ global $wpdb;
638
+ // filter for image size;
639
+ $size = apply_filters( 'wppr_review_image_size', 'thumbnail', $this->ID, $this );
640
+ $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $this->image ) );
641
+ $image_id = isset( $attachment[0] ) ? $attachment[0] : '';
642
+ $image_thumb = '';
643
+ if ( ! empty( $image_id ) ) {
644
+ $image_thumb = wp_get_attachment_image_src( $image_id, $size );
645
+ if ( $size !== 'thumbnail' ) {
646
+ if ( $image_thumb[0] === $this->image ) {
647
+ $image_thumb = wp_get_attachment_image_src( $image_id, 'thumbnail' );
648
+ }
649
+ }
650
+ }
651
+
652
+ return apply_filters( 'wppr_thumb', isset( $image_thumb[0] ) ? $image_thumb[0] : $this->image, $this->ID, $this );
653
+ }
654
+
655
+ /**
656
+ * Return the rating of the review.
657
+ *
658
+ * @since 3.0.0
659
+ * @access public
660
+ * @return float
661
+ */
662
+ public function get_rating() {
663
+ $comment_influence = intval( $this->wppr_get_option( 'cwppos_infl_userreview' ) );
664
+
665
+ $rating = $this->score;
666
+ if ( $comment_influence > 0 ) {
667
+ $comments_rating = $this->get_comments_rating();
668
+ $rating = $comments_rating * 10 * ( $comment_influence / 100 ) + $rating * ( ( 100 - $comment_influence ) / 100 );
669
+ }
670
+
671
+ return apply_filters( 'wppr_rating', $rating, $this->ID, $this );
672
+ }
673
+
674
+ /**
675
+ * Get comments rating.
676
+ *
677
+ * @since 3.0.0
678
+ * @access public
679
+ * @return float|int
680
+ */
681
+ public function get_comments_rating() {
682
+ if ( $this->ID === 0 ) {
683
+ $this->logger->error( 'Can not get comments rating, id is not set' );
684
+
685
+ return 0;
686
+ }
687
+ $comments_query = new WP_Comment_Query;
688
+ $comments = $comments_query->query(
689
+ array(
690
+ 'fields' => 'ids',
691
+ 'status' => 'approve',
692
+ 'post_id' => $this->ID,
693
+ )
694
+ );
695
+ if ( $comments ) {
696
+ $options = array();
697
+ foreach ( $comments as $comment ) {
698
+ $options = array_merge( $options, $this->get_comment_options( $comment ) );
699
+ }
700
+
701
+ if ( count( $options ) != 0 ) {
702
+ return ( array_sum( wp_list_pluck( $options, 'value' ) ) / count( $options ) );
703
+ } else {
704
+ return 0;
705
+ }
706
+ } else {
707
+ return 0;
708
+ }
709
+
710
+ }
711
+
712
+ /**
713
+ * Return the options values and names associated with the comment.
714
+ *
715
+ * @since 3.0.0
716
+ * @access public
717
+ *
718
+ * @param int $comment_id The comment id.
719
+ *
720
+ * @return array
721
+ */
722
+ public function get_comment_options( $comment_id ) {
723
+ $options = array();
724
+ if ( $this->wppr_get_option( 'cwppos_show_userreview' ) === 'yes' ) {
725
+ $options_names = wp_list_pluck( $this->options, 'name' );
726
+ foreach ( $options_names as $k => $name ) {
727
+ $value = get_comment_meta( $comment_id, 'meta_option_' . $k, true );
728
+ if ( ! isset( $value ) && trim( $value ) != 0 ) {
729
+ $value = 0;
730
+ }
731
+ $options[] = array(
732
+ 'name' => $name,
733
+ 'value' => number_format( (float) $value, 2 ),
734
+ );
735
+ }
736
+ }
737
+
738
+ return $options;
739
+
740
+ }
741
+
742
+ /**
743
+ * Getter for the pros array.
744
+ *
745
+ * @since 3.0.0
746
+ * @access public
747
+ * @return array
748
+ */
749
+ public function get_pros() {
750
+ return apply_filters( 'wppr_pros', $this->pros, $this->ID, $this );
751
+ }
752
+
753
+ /**
754
+ * Update the pros array.
755
+ *
756
+ * @since 3.0.0
757
+ * @access public
758
+ *
759
+ * @param array|string $pros The pros array or string to add.
760
+ *
761
+ * @return bool
762
+ */
763
+ public function set_pros( $pros ) {
764
+ $pros = apply_filters( 'wppr_pros_format', $pros, $this->ID, $this );
765
+ if ( is_array( $pros ) ) {
766
+ // We update the whole array.
767
+ $this->pros = $pros;
768
+ $this->logger->notice( 'Update pros array for ID . ' . $this->ID );
769
+
770
+ return update_post_meta( $this->ID, 'wppr_pros', $this->pros );
771
+ } else {
772
+ // We add the text to the old array.
773
+ $this->pros[] = $pros;
774
+ $this->logger->notice( 'Adding pros option for ID . ' . $this->ID );
775
+
776
+ return update_post_meta( $this->ID, 'wppr_pros', $this->pros );
777
+ }
778
+ }
779
+
780
+ /**
781
+ * Getter for the cons array.
782
+ *
783
+ * @since 3.0.0
784
+ * @access public
785
+ * @return array
786
+ */
787
+ public function get_cons() {
788
+ return apply_filters( 'wppr_cons', $this->cons, $this->ID, $this );
789
+ }
790
+
791
+ /**
792
+ * Update the cons array.
793
+ *
794
+ * @since 3.0.0
795
+ * @access public
796
+ *
797
+ * @param array|string $cons The cons array or string to add.
798
+ *
799
+ * @return bool
800
+ */
801
+ public function set_cons( $cons ) {
802
+ $cons = apply_filters( 'wppr_cons_format', $cons, $this->ID, $this );
803
+ if ( is_array( $cons ) ) {
804
+ // We update the whole array.
805
+ $this->cons = $cons;
806
+ $this->logger->notice( 'Update cons array for ID . ' . $this->ID );
807
+
808
+ return update_post_meta( $this->ID, 'wppr_cons', $this->cons );
809
+ } else {
810
+ // We add the text to the old array.
811
+ $this->pros[] = $cons;
812
+ $this->logger->notice( 'Adding cons option for ID . ' . $this->ID );
813
+
814
+ return update_post_meta( $this->ID, 'wppr_cons', $this->cons );
815
+ }
816
+
817
+ }
818
+
819
+ /**
820
+ * Return the options array of the review.
821
+ *
822
+ * @since 3.0.0
823
+ * @access public
824
+ * @return array
825
+ */
826
+ public function get_options() {
827
+ return apply_filters( 'wppr_options', $this->options, $this->ID, $this );
828
+ }
829
+
830
+ /**
831
+ * Setter method for options.
832
+ *
833
+ * We update the options array if there is only a single component like :
834
+ * array(
835
+ * 'name'=>'Review name',
836
+ * 'value'=>Option rating
837
+ * )
838
+ * or the all options array if we get smth like:
839
+ * array(
840
+ * array(
841
+ * 'name'=>'Review name',
842
+ * 'value'=>Option rating
843
+ * ),
844
+ * array(
845
+ * 'name'=>'Review name',
846
+ * 'value'=>Option rating
847
+ * )
848
+ * )
849
+ *
850
+ * @since 3.0.0
851
+ * @access public
852
+ *
853
+ * @param array $options The options array.
854
+ *
855
+ * @return bool
856
+ */
857
+ public function set_options( $options ) {
858
+ if ( is_array( $options ) ) {
859
+ $options = apply_filters( 'wppr_options_format', $options, $this->ID, $this );
860
+ if ( isset( $options['name'] ) ) {
861
+ /**
862
+ * Add options if the param is
863
+ * array(
864
+ * 'name'=>'Review name',
865
+ * 'value'=>Option rating
866
+ * )
867
+ */
868
+ $this->options[] = $options;
869
+ $this->count_rating();
870
+
871
+ return update_post_meta( $this->ID, 'wppr_options', $this->options );
872
+ } else {
873
+ /**
874
+ * Update the all list of options.
875
+ */
876
+ $this->options = $options;
877
+ $this->count_rating();
878
+
879
+ return update_post_meta( $this->ID, 'wppr_options', $this->options );
880
+
881
+ }
882
+ } else {
883
+ $this->logger->error( 'Invalid value for options in review: ' . $this->ID );
884
+ }
885
+
886
+ return false;
887
+ }
888
+
889
+ /**
890
+ * Return the list of links in url=>text format.
891
+ *
892
+ * @since 3.0.0
893
+ * @access public
894
+ * @return array
895
+ */
896
+ public function get_links() {
897
+ return apply_filters( 'wppr_links', $this->links, $this->ID );
898
+
899
+ }
900
+
901
+ /**
902
+ * Save the links array ( url=>title ) to the postmeta.
903
+ *
904
+ * @since 3.0.0
905
+ * @access public
906
+ *
907
+ * @param array $links The new links array.
908
+ *
909
+ * @return bool Either was saved or not.
910
+ */
911
+ public function set_links( $links ) {
912
+ $links = apply_filters( 'wppr_links_format', $links, $this->ID, $this );
913
+ if ( is_array( $links ) ) {
914
+ $this->links = $links;
915
+
916
+ return update_post_meta( $this->ID, 'wppr_links', $links );
917
+ } else {
918
+ $this->logger->error( 'Review: ' . $this->ID . ' Invalid array for links, it should be url=>text' );
919
+ }
920
+
921
+ return false;
922
+ }
923
+
924
+ /**
925
+ * Returns the raw price.
926
+ *
927
+ * @since 3.0.0
928
+ * @access public
929
+ * @return string
930
+ */
931
+ public function get_price_raw() {
932
+ return apply_filters( 'wppr_price_raw', $this->price_raw, $this->ID, $this );
933
+ }
934
+
935
+ }
includes/admin/widgets/abstract/class-wppr-widget-abstract.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The WPPR Widget Abstract Class.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Widget
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Widget_Abstract
14
+ */
15
+ class WPPR_Widget_Abstract extends WP_Widget {
16
+ const RESTRICT_TITLE_CHARS = 100;
17
+
18
+ /**
19
+ * Method to load assets required for front end display.
20
+ *
21
+ * @since 3.0.0
22
+ * @access public
23
+ */
24
+ public function assets() {
25
+ wp_enqueue_style( WPPR_SLUG . '-pac-widget-stylesheet', WPPR_URL . '/assets/css/cwppos-widget.css', array(), WPPR_LITE_VERSION );
26
+ wp_enqueue_style( WPPR_SLUG . '-widget-stylesheet-one', WPPR_URL . '/assets/css/cwppos-widget-style1.css', array(), WPPR_LITE_VERSION );
27
+ wp_enqueue_style( WPPR_SLUG . '-widget-rating', WPPR_URL . '/assets/css/cwppos-widget-rating.css', array(), WPPR_LITE_VERSION );
28
+ }
29
+
30
+ /**
31
+ * Method for displaying the widget on the front end.
32
+ *
33
+ * @since 3.0.0
34
+ * @access public
35
+ * @param array $args Arguments for this method.
36
+ * @param array $instance Instance array for the widget.
37
+ * @return array
38
+ */
39
+ public function widget( $args, $instance ) {
40
+ $instance['title'] = apply_filters( 'widget_title', $instance['title'] );
41
+ $instance['no_items'] = apply_filters( 'widget_content', $instance['no_items'] );
42
+ $instance['cwp_tp_category'] = apply_filters( 'widget_content', $instance['cwp_tp_category'] );
43
+ if ( isset( $instance['title_type'] ) ) {
44
+ $instance['post_type'] = apply_filters( 'widget_content', $instance['title_type'] );
45
+ } else {
46
+ $instance['post_type'] = false;
47
+ }
48
+ if ( isset( $instance['show_image'] ) ) {
49
+ $instance['show_image'] = apply_filters( 'widget_content', $instance['show_image'] );
50
+ } else {
51
+ $instance['show_image'] = false;
52
+ }
53
+ // @codingStandardsIgnoreStart
54
+ if ( $instance['cwp_tp_category'] == 'All' ) { $instance['cwp_tp_category'] = ''; }
55
+ if ( ! isset( $instance['cwp_tp_buynow'] ) ) { $instance['cwp_tp_buynow'] = __( 'Buy Now', 'wp-product-review' ); }
56
+ if ( ! isset( $instance['cwp_tp_readreview'] ) ) { $instance['cwp_tp_readreview'] = __( 'Read Review', 'wp-product-review' ); }
57
+ if ( ! isset( $instance['cwp_tp_layout'] ) ) { $instance['cwp_tp_layout'] = 'default.php'; }
58
+ if ( ! isset( $instance['cwp_tp_rating_type'] ) ) { $instance['cwp_tp_rating_type'] = 'round'; }
59
+ // @codingStandardsIgnoreEnd
60
+
61
+ return $instance;
62
+ }
63
+
64
+ /**
65
+ * The admin widget form method.
66
+ *
67
+ * @since 3.0.0
68
+ * @access public
69
+ * @param array $instance The instance array for this widget.
70
+ * @return array
71
+ */
72
+ public function form( $instance ) {
73
+ if ( ! isset( $instance['title'] ) ) {
74
+ $instance['title'] = __( 'Latest Products', 'wp-product-review' );
75
+ }
76
+
77
+ if ( ! isset( $instance['no_items'] ) ) {
78
+ $instance['no_items'] = __( '10', 'wp-product-review' );
79
+ }
80
+
81
+ if ( ! isset( $instance['cwp_tp_category'] ) ) {
82
+ $instance['cwp_tp_category'] = 'Select Category';
83
+ }
84
+
85
+ if ( ! isset( $instance['title_type'] ) ) {
86
+ $instance['title_type'] = false;
87
+ }
88
+
89
+ if ( ! isset( $instance['show_image'] ) ) {
90
+ $instance['show_image'] = false;
91
+ }
92
+
93
+ if ( ! isset( $instance['cwp_tp_buynow'] ) ) {
94
+ $instance['cwp_tp_buynow'] = __( 'Buy Now', 'wp-product-review' );
95
+ }
96
+
97
+ if ( ! isset( $instance['cwp_tp_readreview'] ) ) {
98
+ $instance['cwp_tp_readreview'] = __( 'Read Review', 'wp-product-review' );
99
+ }
100
+
101
+ if ( ! isset( $instance['cwp_tp_layout'] ) ) {
102
+ $instance['cwp_tp_layout'] = 'default.php';
103
+ }
104
+
105
+ if ( $instance['cwp_tp_layout'] == 'default.php' ) {
106
+ $instance['cwp_tp_rating_type'] = 'round';
107
+ } else {
108
+ $instance['cwp_tp_rating_type'] = 'star';
109
+ }
110
+
111
+ $instance['cwp_tp_categ_array'] = get_categories( 'hide_empty=0' );
112
+ foreach ( $instance['cwp_tp_categ_array'] as $categs ) {
113
+ $instance['cwp_tp_all_categories'][ $categs->slug ] = $categs->name;
114
+ }
115
+
116
+ return $instance;
117
+ }
118
+
119
+ /**
120
+ * Method to update widget data.
121
+ *
122
+ * @since 3.0.0
123
+ * @access public
124
+ * @param array $new_instance The new instance array for the widget.
125
+ * @param array $old_instance The old instance array of the widget.
126
+ * @return array
127
+ */
128
+ public function update( $new_instance, $old_instance ) {
129
+
130
+ $instance = $old_instance;
131
+
132
+ $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
133
+
134
+ $instance['no_items'] = ( ! empty( $new_instance['no_items'] ) ) ? strip_tags( $new_instance['no_items'] ) : '';
135
+
136
+ $instance['cwp_tp_category'] = ( ! empty( $new_instance['cwp_tp_category'] ) ) ? strip_tags( $new_instance['cwp_tp_category'] ) : '';
137
+
138
+ $instance['title_type'] = ( isset( $new_instance['title_type'] ) ) ? (bool) $new_instance['title_type'] : false ;
139
+ $instance['show_image'] = ( isset( $new_instance['show_image'] ) ) ? (bool) $new_instance['show_image'] : false ;
140
+
141
+ $instance['cwp_tp_buynow'] = ( ! empty( $new_instance['cwp_tp_buynow'] ) ) ? strip_tags( $new_instance['cwp_tp_buynow'] ) : '';
142
+ $instance['cwp_tp_readreview'] = ( ! empty( $new_instance['cwp_tp_readreview'] ) ) ? strip_tags( $new_instance['cwp_tp_readreview'] ) : '';
143
+ $instance['cwp_tp_layout'] = ( ! empty( $new_instance['cwp_tp_layout'] ) ) ? strip_tags( $new_instance['cwp_tp_layout'] ) : '';
144
+ $instance['cwp_tp_rating_type'] = ( ! empty( $new_instance['cwp_tp_rating_type'] ) ) ? strip_tags( $new_instance['cwp_tp_rating_type'] ) : '';
145
+
146
+ return $instance;
147
+ }
148
+
149
+ }
includes/admin/widgets/class-wppr-latest-products-widget.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The WPPR Latest Widget Class.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Widget
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Latest_Products_Widget
14
+ */
15
+ class WPPR_Latest_Products_Widget extends WPPR_Widget_Abstract {
16
+
17
+ /**
18
+ * WPPR_Latest_Products_Widget constructor.
19
+ *
20
+ * @since 3.0.0
21
+ * @access public
22
+ */
23
+ public function __construct() {
24
+ parent::__construct(
25
+ 'cwp_latest_products_widget',
26
+ __( 'Latest Products Widget', 'wp-product-review' ),
27
+ array(
28
+ 'description' => __( 'This widget displays the latest products based on their rating.', 'wp-product-review' ),
29
+ )
30
+ );
31
+ }
32
+
33
+ /**
34
+ * Method to register the widget.
35
+ *
36
+ * @since 3.0.0
37
+ * @access public
38
+ */
39
+ public function register() {
40
+ register_widget( 'WPPR_Latest_Products_Widget' );
41
+ }
42
+
43
+ /**
44
+ * Method for loading admin widget assets.
45
+ *
46
+ * @since 3.0.0
47
+ * @access public
48
+ */
49
+ public function adminAssets() {
50
+ if ( is_admin() ) {
51
+ wp_enqueue_style( WPPR_SLUG . '-widget-admin-css', WPPR_URL . '/assets/css/cwppos-widget-admin.css', array(), WPPR_LITE_VERSION );
52
+
53
+ wp_register_script( WPPR_SLUG . '-widget-script-latest', WPPR_URL . '/assets/js/widget-latest.js', array(), WPPR_LITE_VERSION );
54
+ wp_localize_script(
55
+ WPPR_SLUG . '-widget-script-latest', 'wppr_widget_localized_data', array(
56
+ 'widgetName' => $this->id_base,
57
+ 'imageCheckbox' => $this->get_field_id( 'show_image' ),
58
+ 'ratingSelect' => $this->get_field_id( 'cwp_tp_rating_type' ),
59
+ )
60
+ );
61
+ wp_enqueue_script( WPPR_SLUG . '-widget-script-latest' );
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Method for displaying the widget on the front end.
67
+ *
68
+ * @since 3.0.0
69
+ * @access public
70
+ * @param array $args Arguments for this method.
71
+ * @param array $instance Instance array for the widget.
72
+ * @return mixed
73
+ */
74
+ public function widget( $args, $instance ) {
75
+ $this->assets();
76
+
77
+ $instance = parent::widget( $args, $instance );
78
+
79
+ $reviews = new WPPR_Query_Model();
80
+ $post = array();
81
+ if ( isset( $instance['cwp_tp_category'] ) && trim( $instance['cwp_tp_category'] ) != '' ) {
82
+ $post['category_name'] = $instance['cwp_tp_category'];
83
+ }
84
+ $order = array();
85
+ $order['date'] = 'DESC';
86
+
87
+ $results = $reviews->find( $post, $instance['no_items'], array(), $order );
88
+
89
+ // before and after widget arguments are defined by themes
90
+ echo $args['before_widget'];
91
+
92
+ if ( ! empty( $instance['title'] ) ) {
93
+ echo $args['before_title'] . $instance['title'] . $args['after_title']; }
94
+
95
+ include WPPR_PATH . '/includes/public/layouts/widget/' . $instance['cwp_tp_layout'];
96
+
97
+ echo $args['after_widget'];
98
+ }
99
+
100
+ /**
101
+ * The admin widget form method.
102
+ *
103
+ * @since 3.0.0
104
+ * @access public
105
+ * @param array $instance The instance array for this widget.
106
+ * @return mixed
107
+ */
108
+ public function form( $instance ) {
109
+ $this->adminAssets();
110
+
111
+ $instance = parent::form( $instance );
112
+ $instance['title'] = __( 'Latest Products', 'wp-product-review' );
113
+
114
+ include( WPPR_PATH . '/includes/admin/layouts/widget-admin-tpl.php' );
115
+ }
116
+ }
includes/admin/widgets/class-wppr-top-products-widget.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The WPPR Top Widget Class.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Widget
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ /**
13
+ * Class WPPR_Top_Products_Widget
14
+ */
15
+ class WPPR_Top_Products_Widget extends WPPR_Widget_Abstract {
16
+
17
+ /**
18
+ * WPPR_Top_Products_Widget constructor.
19
+ *
20
+ * @since 3.0.0
21
+ * @access public
22
+ */
23
+ public function __construct() {
24
+ parent::__construct(
25
+ 'cwp_top_products_widget',
26
+ __( 'Top Products Widget', 'wp-product-review' ),
27
+ array(
28
+ 'description' => __( 'This widget displays the top products based on their rating.', 'wp-product-review' ),
29
+ )
30
+ );
31
+ }
32
+
33
+ /**
34
+ * Method to register the widget.
35
+ *
36
+ * @since 3.0.0
37
+ * @access public
38
+ */
39
+ public function register() {
40
+ register_widget( 'WPPR_Top_Products_Widget' );
41
+ }
42
+
43
+ /**
44
+ * Method to filter posts order.
45
+ *
46
+ * @since 3.0.0
47
+ * @access public
48
+ *
49
+ * @param string $orderby The condition string for ordering.
50
+ *
51
+ * @return string
52
+ */
53
+ public function custom_order_by( $orderby ) {
54
+ return 'mt1.meta_value DESC, mt2.meta_value+0 DESC';
55
+ }
56
+
57
+ /**
58
+ * Method for displaying the widget on the front end.
59
+ *
60
+ * @since 3.0.0
61
+ * @access public
62
+ *
63
+ * @param array $args Arguments for this method.
64
+ * @param array $instance Instance array for the widget.
65
+ *
66
+ * @return mixed
67
+ */
68
+ public function widget( $args, $instance ) {
69
+ $this->assets();
70
+
71
+ $instance = parent::widget( $args, $instance );
72
+
73
+ $reviews = new WPPR_Query_Model();
74
+ $post = array();
75
+ if ( isset( $instance['cwp_tp_category'] ) && trim( $instance['cwp_tp_category'] ) != '' ) {
76
+ $post['category_name'] = $instance['cwp_tp_category'];
77
+ }
78
+ $order = array();
79
+ $order['rating'] = 'DESC';
80
+
81
+ $results = $reviews->find( $post, $instance['no_items'], array(), $order );
82
+
83
+ // before and after widget arguments are defined by themes
84
+ echo $args['before_widget'];
85
+
86
+ if ( ! empty( $instance['title'] ) ) {
87
+ echo $args['before_title'] . $instance['title'] . $args['after_title'];
88
+ }
89
+ include WPPR_PATH . '/includes/public/layouts/widget/' . $instance['cwp_tp_layout'];
90
+
91
+ echo $args['after_widget'];
92
+ }
93
+
94
+ /**
95
+ * The admin widget form method.
96
+ *
97
+ * @since 3.0.0
98
+ * @access public
99
+ *
100
+ * @param array $instance The instance array for this widget.
101
+ *
102
+ * @return mixed
103
+ */
104
+ public function form( $instance ) {
105
+ $this->adminAssets();
106
+
107
+ $instance = parent::form( $instance );
108
+ $instance['title'] = __( 'Top Products', 'wp-product-review' );
109
+
110
+ include( WPPR_PATH . '/includes/admin/layouts/widget-admin-tpl.php' );
111
+ }
112
+
113
+ /**
114
+ * Method for loading admin widget assets.
115
+ *
116
+ * @since 3.0.0
117
+ * @access public
118
+ */
119
+ public function adminAssets() {
120
+ if ( is_admin() ) {
121
+ wp_enqueue_style( WPPR_SLUG . '-widget-admin-css', WPPR_URL . '/assets/css/cwppos-widget-admin.css', array(), WPPR_LITE_VERSION );
122
+
123
+ wp_register_script( WPPR_SLUG . '-widget-script-top', WPPR_URL . '/assets/js/widget-top.js', array(), WPPR_LITE_VERSION );
124
+ wp_localize_script(
125
+ WPPR_SLUG . '-widget-script-top', 'wppr_widget_localized_data', array(
126
+ 'widgetName' => $this->id_base,
127
+ 'imageCheckbox' => $this->get_field_id( 'show_image' ),
128
+ 'ratingSelect' => $this->get_field_id( 'cwp_tp_rating_type' ),
129
+ )
130
+ );
131
+ wp_enqueue_script( WPPR_SLUG . '-widget-script-top' );
132
+ }
133
+ }
134
+ }
includes/class-wppr-activator.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fired during plugin activation
4
+ *
5
+ * @link https://themeisle.com/
6
+ * @since 3.0.0
7
+ *
8
+ * @package WPPR
9
+ * @subpackage WPPR/includes
10
+ */
11
+
12
+ /**
13
+ * Fired during plugin activation.
14
+ *
15
+ * This class defines all code necessary to run during the plugin's activation.
16
+ *
17
+ * @since 3.0.0
18
+ * @package WPPR
19
+ * @subpackage WPPR/includes
20
+ * @author ThemeIsle <friends@themeisle.com>
21
+ */
22
+ class WPPR_Activator {
23
+
24
+ /**
25
+ * Short Description. (use period)
26
+ *
27
+ * Long Description.
28
+ *
29
+ * @since 1.0.0
30
+ */
31
+ public static function activate() {
32
+
33
+ }
34
+
35
+ }
includes/class-wppr-deactivator.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fired during plugin deactivation
4
+ *
5
+ * @link https://themeisle.com/
6
+ * @since 3.0.0
7
+ *
8
+ * @package WPPR
9
+ * @subpackage WPPR/includes
10
+ */
11
+
12
+ /**
13
+ * Fired during plugin deactivation.
14
+ *
15
+ * This class defines all code necessary to run during the plugin's deactivation.
16
+ *
17
+ * @since 3.0.0
18
+ * @package WPPR
19
+ * @subpackage WPPR/includes
20
+ * @author ThemeIsle <friends@themeisle.com>
21
+ */
22
+ class WPPR_Deactivator {
23
+
24
+ /**
25
+ * Short Description. (use period)
26
+ *
27
+ * Long Description.
28
+ *
29
+ * @since 3.0.0
30
+ */
31
+ public static function deactivate() {
32
+
33
+ }
34
+
35
+ }
includes/class-wppr-i18n.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Define the internationalization functionality
4
+ *
5
+ * Loads and defines the internationalization files for this plugin
6
+ * so that it is ready for translation.
7
+ *
8
+ * @link https://themeisle.com/
9
+ * @since 3.0.0
10
+ *
11
+ * @package WPPR
12
+ * @subpackage WPPR/includes
13
+ */
14
+
15
+ /**
16
+ * Define the internationalization functionality.
17
+ *
18
+ * Loads and defines the internationalization files for this plugin
19
+ * so that it is ready for translation.
20
+ *
21
+ * @since 3.0.0
22
+ * @package WPPR
23
+ * @subpackage WPPR/includes
24
+ * @author ThemeIsle <friends@themeisle.com>
25
+ */
26
+ class WPPR_I18n {
27
+
28
+
29
+ /**
30
+ * Load the plugin text domain for translation.
31
+ *
32
+ * @since 3.0.0
33
+ */
34
+ public function load_plugin_textdomain() {
35
+
36
+ load_plugin_textdomain(
37
+ 'wp-product-review',
38
+ false,
39
+ dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
40
+ );
41
+
42
+ }
43
+
44
+
45
+
46
+ }
includes/class-wppr-loader.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Register all actions and filters for the plugin
4
+ *
5
+ * @link https://themeisle.com/
6
+ * @since 3.0.0
7
+ *
8
+ * @package WPPR
9
+ * @subpackage WPPR/includes
10
+ */
11
+
12
+ /**
13
+ * Register all actions and filters for the plugin.
14
+ *
15
+ * Maintain a list of all hooks that are registered throughout
16
+ * the plugin, and register them with the WordPress API. Call the
17
+ * run function to execute the list of actions and filters.
18
+ *
19
+ * @package WPPR
20
+ * @subpackage WPPR/includes
21
+ * @author ThemeIsle <friends@themeisle.com>
22
+ */
23
+ class WPPR_Loader {
24
+
25
+ /**
26
+ * The array of actions registered with WordPress.
27
+ *
28
+ * @since 3.0.0
29
+ * @access protected
30
+ * @var array $actions The actions registered with WordPress to fire when the plugin loads.
31
+ */
32
+ protected $actions;
33
+
34
+ /**
35
+ * The array of filters registered with WordPress.
36
+ *
37
+ * @since 3.0.0
38
+ * @access protected
39
+ * @var array $filters The filters registered with WordPress to fire when the plugin loads.
40
+ */
41
+ protected $filters;
42
+
43
+ /**
44
+ * Initialize the collections used to maintain the actions and filters.
45
+ *
46
+ * @since 3.0.0
47
+ */
48
+ public function __construct() {
49
+
50
+ $this->actions = array();
51
+ $this->filters = array();
52
+
53
+ }
54
+
55
+ /**
56
+ * Add a new action to the collection to be registered with WordPress.
57
+ *
58
+ * @since 3.0.0
59
+ * @param string $hook The name of the WordPress action that is being registered.
60
+ * @param object $component A reference to the instance of the object on which the action is defined.
61
+ * @param string $callback The name of the function definition on the $component.
62
+ * @param int $priority Optional. he priority at which the function should be fired. Default is 10.
63
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
64
+ */
65
+ public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
66
+ $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
67
+ }
68
+
69
+ /**
70
+ * Add a new filter to the collection to be registered with WordPress.
71
+ *
72
+ * @since 3.0.0
73
+ * @param string $hook The name of the WordPress filter that is being registered.
74
+ * @param object $component A reference to the instance of the object on which the filter is defined.
75
+ * @param string $callback The name of the function definition on the $component.
76
+ * @param int $priority Optional. he priority at which the function should be fired. Default is 10.
77
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
78
+ */
79
+ public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
80
+ $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
81
+ }
82
+
83
+ /**
84
+ * A utility function that is used to register the actions and hooks into a single
85
+ * collection.
86
+ *
87
+ * @since 3.0.0
88
+ * @access private
89
+ * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
90
+ * @param string $hook The name of the WordPress filter that is being registered.
91
+ * @param object $component A reference to the instance of the object on which the filter is defined.
92
+ * @param string $callback The name of the function definition on the $component.
93
+ * @param int $priority The priority at which the function should be fired.
94
+ * @param int $accepted_args The number of arguments that should be passed to the $callback.
95
+ * @return array The collection of actions and filters registered with WordPress.
96
+ */
97
+ private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
98
+
99
+ $hooks[] = array(
100
+ 'hook' => $hook,
101
+ 'component' => $component,
102
+ 'callback' => $callback,
103
+ 'priority' => $priority,
104
+ 'accepted_args' => $accepted_args,
105
+ );
106
+
107
+ return $hooks;
108
+
109
+ }
110
+
111
+ /**
112
+ * Register the filters and actions with WordPress.
113
+ *
114
+ * @since 3.0.0
115
+ */
116
+ public function run() {
117
+
118
+ foreach ( $this->filters as $hook ) {
119
+ add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
120
+ }
121
+
122
+ foreach ( $this->actions as $hook ) {
123
+ add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
124
+ }
125
+
126
+ }
127
+
128
+ }
includes/class-wppr.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The file that defines the core plugin class
4
+ *
5
+ * A class definition that includes attributes and functions used across both the
6
+ * public-facing side of the site and the admin area.
7
+ *
8
+ * @link https://themeisle.com/
9
+ * @since 3.0.0
10
+ *
11
+ * @package WPPR
12
+ * @subpackage WPPR/includes
13
+ */
14
+
15
+ /**
16
+ * The core plugin class.
17
+ *
18
+ * This is used to define internationalization, admin-specific hooks, and
19
+ * public-facing site hooks.
20
+ *
21
+ * Also maintains the unique identifier of this plugin as well as the current
22
+ * version of the plugin.
23
+ *
24
+ * @since 3.0.0
25
+ * @package WPPR
26
+ * @subpackage WPPR/includes
27
+ * @author ThemeIsle <friends@themeisle.com>
28
+ */
29
+ class WPPR {
30
+
31
+ /**
32
+ * The loader that's responsible for maintaining and registering all hooks that power
33
+ * the plugin.
34
+ *
35
+ * @since 3.0.0
36
+ * @access protected
37
+ * @var WPPR_Loader $loader Maintains and registers all hooks for the plugin.
38
+ */
39
+ protected $loader;
40
+
41
+ /**
42
+ * The unique identifier of this plugin.
43
+ *
44
+ * @since 3.0.0
45
+ * @access protected
46
+ * @var string $plugin_name The string used to uniquely identify this plugin.
47
+ */
48
+ protected $plugin_name;
49
+
50
+ /**
51
+ * The current version of the plugin.
52
+ *
53
+ * @since 3.0.0
54
+ * @access protected
55
+ * @var string $version The current version of the plugin.
56
+ */
57
+ protected $version;
58
+
59
+ /**
60
+ * Define the core functionality of the plugin.
61
+ *
62
+ * Set the plugin name and the plugin version that can be used throughout the plugin.
63
+ * Load the dependencies, define the locale, and set the hooks for the admin area and
64
+ * the public-facing side of the site.
65
+ *
66
+ * @since 3.0.0
67
+ */
68
+ public function __construct() {
69
+ $this->plugin_name = 'wppr';
70
+ $this->version = '3.0.0';
71
+
72
+ $this->load_dependencies();
73
+ $this->set_locale();
74
+ $this->define_admin_hooks();
75
+ $this->define_public_hooks();
76
+ }
77
+
78
+ /**
79
+ * Load the required dependencies for this plugin.
80
+ *
81
+ * Include the following files that make up the plugin:
82
+ *
83
+ * - WPPR_Loader. Orchestrates the hooks of the plugin.
84
+ * - WPPR_I18n. Defines internationalization functionality.
85
+ * - WPPR_Admin. Defines all hooks for the admin area.
86
+ * - WPPR_Public. Defines all hooks for the public side of the site.
87
+ *
88
+ * Create an instance of the loader which will be used to register the hooks
89
+ * with WordPress.
90
+ *
91
+ * @since 3.0.0
92
+ * @access private
93
+ */
94
+ private function load_dependencies() {
95
+ $this->loader = new WPPR_Loader();
96
+ }
97
+
98
+ /**
99
+ * Define the locale for this plugin for internationalization.
100
+ *
101
+ * Uses the WPPR_I18n class in order to set the domain and to register the hook
102
+ * with WordPress.
103
+ *
104
+ * @since 3.0.0
105
+ * @access private
106
+ */
107
+ private function set_locale() {
108
+ $plugin_i18n = new WPPR_I18n();
109
+ $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
110
+ }
111
+
112
+ /**
113
+ * Register all of the hooks related to the admin area functionality
114
+ * of the plugin.
115
+ *
116
+ * @since 3.0.0
117
+ * @access private
118
+ */
119
+ private function define_admin_hooks() {
120
+
121
+ $plugin_admin = new WPPR_Admin( $this->get_plugin_name(), $this->get_version() );
122
+ $this->loader->add_action( 'admin_menu', $plugin_admin, 'menu_pages' );
123
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
124
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
125
+ $this->loader->add_action( 'wp_ajax_update_options', $plugin_admin, 'update_options' );
126
+
127
+ $plugin_editor = new WPPR_Editor( $this->get_plugin_name(), $this->get_version() );
128
+ $this->loader->add_action( 'add_meta_boxes', $plugin_editor, 'set_editor' );
129
+ $this->loader->add_action( 'save_post', $plugin_editor, 'editor_save' );
130
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_editor, 'load_assets' );
131
+
132
+ $plugin_widget_latest = new WPPR_Latest_Products_Widget();
133
+ $this->loader->add_action( 'widgets_init', $plugin_widget_latest, 'register' );
134
+
135
+ $plugin_widget_top = new WPPR_Top_Products_Widget();
136
+ $this->loader->add_action( 'widgets_init', $plugin_widget_top, 'register' );
137
+ }
138
+
139
+ /**
140
+ * Register all of the hooks related to the public-facing functionality
141
+ * of the plugin.
142
+ *
143
+ * @since 3.0.0
144
+ * @access private
145
+ */
146
+ private function define_public_hooks() {
147
+
148
+ $plugin_public = new WPPR_Public( $this->get_plugin_name(), $this->get_version() );
149
+
150
+ $this->loader->add_action( 'wp', $plugin_public, 'init' );
151
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
152
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
153
+ $this->loader->add_action( 'wp_footer', $plugin_public, 'dynamic_stylesheet' );
154
+ $this->loader->add_action( 'wp_head', $plugin_public, 'default_settings' );
155
+ $this->loader->add_action( 'comment_form_logged_in_after', $plugin_public, 'add_comment_fields' );
156
+ $this->loader->add_action( 'comment_form_after_fields', $plugin_public, 'add_comment_fields' );
157
+ $this->loader->add_action( 'comment_post', $plugin_public, 'save_comment_fields',1 );
158
+ $this->loader->add_filter( 'comment_text', $plugin_public, 'show_comment_ratings' );
159
+
160
+ $currentTheme = wp_get_theme();
161
+ if ( $currentTheme->get( 'Name' ) !== 'Bookrev' && $currentTheme->get( 'Name' ) !== 'Book Rev Lite' ) {
162
+ $this->loader->add_filter( 'the_content', $plugin_public, 'display_on_front' );
163
+ }
164
+
165
+ }
166
+
167
+ /**
168
+ * Run the loader to execute all of the hooks with WordPress.
169
+ *
170
+ * @since 3.0.0
171
+ */
172
+ public function run() {
173
+ $this->loader->run();
174
+ }
175
+
176
+ /**
177
+ * The name of the plugin used to uniquely identify it within the context of
178
+ * WordPress and to define internationalization functionality.
179
+ *
180
+ * @since 3.0.0
181
+ * @return string The name of the plugin.
182
+ */
183
+ public function get_plugin_name() {
184
+ return $this->plugin_name;
185
+ }
186
+
187
+ /**
188
+ * The reference to the class that orchestrates the hooks with the plugin.
189
+ *
190
+ * @since 3.0.0
191
+ * @return WPPR_Loader Orchestrates the hooks of the plugin.
192
+ */
193
+ public function get_loader() {
194
+ return $this->loader;
195
+ }
196
+
197
+ /**
198
+ * Retrieve the version number of the plugin.
199
+ *
200
+ * @since 3.0.0
201
+ * @return string The version number of the plugin.
202
+ */
203
+ public function get_version() {
204
+ return $this->version;
205
+ }
206
+
207
+ }
includes/index.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden
4
+ *
5
+ * @package WPPR
6
+ * @copyright Copyright (c) 2017, Bogdan Preda
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ * @since 3.0.0
9
+ */
10
+
11
+ /**
12
+ * Nothing to do here.
13
+ */
includes/public/class-wppr-public.php ADDED
@@ -0,0 +1,498 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The public-facing functionality of the plugin.
4
+ *
5
+ * @link https://themeisle.com/
6
+ * @since 3.0.0
7
+ *
8
+ * @package Wppr
9
+ * @subpackage Wppr/public
10
+ */
11
+
12
+ /**
13
+ * The public-facing functionality of the plugin.
14
+ *
15
+ * Defines the plugin name, version, and two examples hooks for how to
16
+ * enqueue the admin-specific stylesheet and JavaScript.
17
+ *
18
+ * @package Wppr
19
+ * @subpackage Wppr/public
20
+ * @author ThemeIsle <friends@themeisle.com>
21
+ */
22
+ class Wppr_Public {
23
+
24
+ /**
25
+ * The ID of this plugin.
26
+ *
27
+ * @since 3.0.0
28
+ * @access private
29
+ * @var string $plugin_name The ID of this plugin.
30
+ */
31
+ private $plugin_name;
32
+
33
+ /**
34
+ * The version of this plugin.
35
+ *
36
+ * @since 3.0.0
37
+ * @access private
38
+ * @var string $version The current version of this plugin.
39
+ */
40
+ private $version;
41
+
42
+ /**
43
+ * Stores a WPPR_Review_Model object.
44
+ *
45
+ * @since 3.0.0
46
+ * @access private
47
+ * @var WPPR_Review_Model $review The review model.
48
+ */
49
+ private $review;
50
+
51
+ /**
52
+ * Initialize the class and set its properties.
53
+ *
54
+ * @since 3.0.0
55
+ * @access public
56
+ *
57
+ * @param string $plugin_name The name of the plugin.
58
+ * @param string $version The version of this plugin.
59
+ */
60
+ public function __construct( $plugin_name, $version ) {
61
+ $this->plugin_name = $plugin_name;
62
+ $this->version = $version;
63
+
64
+ }
65
+
66
+ /**
67
+ * Register the stylesheets for the public-facing side of the site.
68
+ *
69
+ * @since 3.0.0
70
+ * @access public
71
+ */
72
+ public function enqueue_styles() {
73
+ /**
74
+ * This function is provided for demonstration purposes only.
75
+ *
76
+ * An instance of this class should be passed to the run() function
77
+ * defined in Wppr_Loader as all of the hooks are defined
78
+ * in that particular class.
79
+ *
80
+ * The Wppr_Loader will then create the relationship
81
+ * between the defined hooks and the functions defined in this
82
+ * class.
83
+ */
84
+ $this->init();
85
+ if ( $this->review->is_active() || $this->is_shortcode_used() ) {
86
+ wp_enqueue_style( $this->plugin_name . '-frontpage-stylesheet', WPPR_URL . '/assets/css/frontpage.css', array(), $this->version );
87
+
88
+ if ( $this->review->wppr_get_option( 'cwppos_lighbox' ) == 'no' ) {
89
+ wp_enqueue_style( $this->plugin_name . '-lightbox-css', WPPR_URL . '/assets/css/lightbox.css', array(), $this->version );
90
+ }
91
+ if ( $this->review->wppr_get_option( 'cwppos_show_userreview' ) == 'yes' ) {
92
+
93
+ wp_enqueue_style( $this->plugin_name . 'jqueryui', WPPR_URL . '/assets/css/jquery-ui.css', array(), $this->version );
94
+ }
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Method for loading the Review Model.
100
+ *
101
+ * @since 3.0.0
102
+ * @access public
103
+ */
104
+ public function init() {
105
+ global $post;
106
+ if ( $post ) {
107
+ $this->review = new WPPR_Review_Model( $post->ID );
108
+ } else {
109
+ $this->review = new WPPR_Review_Model( 0 );
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Check if the current post has a shortcode or not.
115
+ *
116
+ * @return bool Either we use the shortcode or not.
117
+ */
118
+ public function is_shortcode_used() {
119
+ global $post;
120
+
121
+ if ( ! has_shortcode( $post->post_content, 'P_REVIEW' ) ) {
122
+ return false;
123
+ }
124
+
125
+ return true;
126
+ }
127
+
128
+ /**
129
+ * Register the JavaScript for the public-facing side of the site.
130
+ *
131
+ * @since 3.0.0
132
+ * @access public
133
+ */
134
+ public function enqueue_scripts() {
135
+
136
+ /**
137
+ * This function is provided for demonstration purposes only.
138
+ *
139
+ * An instance of this class should be passed to the run() function
140
+ * defined in Wppr_Loader as all of the hooks are defined
141
+ * in that particular class.
142
+ *
143
+ * The Wppr_Loader will then create the relationship
144
+ * between the defined hooks and the functions defined in this
145
+ * class.
146
+ */
147
+ $this->init();
148
+ if ( $this->review->is_active() || $this->is_shortcode_used() ) {
149
+
150
+ wp_enqueue_script( $this->plugin_name . '-pie-chart-js', WPPR_URL . '/assets/js/pie-chart.js', array( 'jquery' ), $this->version, true );
151
+ wp_enqueue_script(
152
+ $this->plugin_name . '-frontpage-js', WPPR_URL . '/assets/js/main.js', array(
153
+ 'jquery',
154
+ $this->plugin_name . '-pie-chart-js',
155
+ ), $this->version, true
156
+ );
157
+ if ( $this->review->wppr_get_option( 'cwppos_lighbox' ) == 'no' ) {
158
+ wp_enqueue_script( $this->plugin_name . '-lightbox-js', WPPR_URL . '/assets/js/lightbox.min.js', array( 'jquery' ), $this->version, true );
159
+ }
160
+
161
+ if ( $this->review->wppr_get_option( 'cwppos_show_userreview' ) == 'yes' ) {
162
+ wp_enqueue_script( 'jquery-ui-slider' );
163
+ }
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Method to define dynamic style and script options based on saved settings.
169
+ *
170
+ * @since 3.0.0
171
+ * @access public
172
+ */
173
+ public function dynamic_stylesheet() {
174
+ $this->init();
175
+ if ( $this->review->is_active() || $this->is_shortcode_used() ) {
176
+
177
+ $options_model = new WPPR_Options_Model();
178
+
179
+ global $content_width;
180
+ if ( $options_model->wppr_get_option( 'cwppos_widget_size' ) != '' ) {
181
+ $width = $options_model->wppr_get_option( 'cwppos_widget_size' );
182
+ } else {
183
+ $width = $content_width;
184
+ }
185
+ if ( $width < 200 ) {
186
+ $width = 600;
187
+ }
188
+ $img_size = min( 180, $width * 0.51 * 0.4 );
189
+ $height_left = $img_size + 10;
190
+
191
+ $conditional_media_styles = '';
192
+ if ( $options_model->wppr_get_option( 'cwppos_widget_size' ) != '' ) {
193
+ $conditional_media_styles = '
194
+ #review-statistics {
195
+ width: ' . $options_model->wppr_get_option( 'cwppos_widget_size' ) . 'px;
196
+ }
197
+ ';
198
+ }
199
+
200
+ $conditional_styles = '';
201
+ if ( $options_model->wppr_get_option( 'cwppos_show_icon' ) == 'yes' ) {
202
+ $conditional_styles .= '
203
+ div.affiliate-button a span {
204
+ background: url("' . WPPR_URL . '/assets/img/cart-icon.png") no-repeat left center;
205
+ }
206
+
207
+ div.affiliate-button a:hover span {
208
+ background: url("' . WPPR_URL . '/assets/img/cart-icon-hover.png") no-repeat left center;
209
+ }
210
+ ';
211
+ }
212
+
213
+ if ( $options_model->wppr_get_option( 'cwppos_show_userreview' ) == 'yes' ) {
214
+ $conditional_styles .= '
215
+ .commentlist .comment-body p {
216
+ clear: left;
217
+ }
218
+ ';
219
+ }
220
+
221
+ $style = '
222
+ <style type="text/css">
223
+ @media (min-width: 820px) {
224
+ #review-statistics .review-wrap-up .review-wu-left .rev-wu-image, #review-statistics .review-wrap-up .review-wu-left .review-wu-grade {
225
+ height: ' . $height_left . 'px;
226
+ }
227
+
228
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart .cwp-review-percentage {
229
+
230
+ margin-top: ' . ( $img_size * 0.1 ) . '%;
231
+ }
232
+
233
+ #review-statistics .review-wrap-up .review-wu-left .review-wu-grade .cwp-review-chart span {
234
+ font-size: ' . round( 30 * $img_size / 140 ) . 'px;
235
+ }
236
+
237
+ ' . $conditional_media_styles . '
238
+ }
239
+
240
+ #review-statistics .review-wrap-up div.cwpr-review-top {
241
+ border-top: ' . $options_model->wppr_get_option( 'cwppos_reviewboxbd_width' ) . 'px solid ' . $options_model->wppr_get_option( 'cwppos_reviewboxbd_color' ) . ';
242
+ }
243
+
244
+ .user-comments-grades .comment-meta-grade-bar,
245
+ #review-statistics .review-wu-bars ul li {
246
+ background: ' . $options_model->wppr_get_option( 'cwppos_rating_default' ) . ';
247
+ }
248
+
249
+ #review-statistics .rev-option.customBarIcon ul li {
250
+ color: ' . $options_model->wppr_get_option( 'cwppos_rating_default' ) . ';
251
+ }
252
+
253
+ #review-statistics .review-wrap-up .review-wu-right ul li, #review-statistics .review-wu-bars h3, .review-wu-bars span, #review-statistics .review-wrap-up .cwpr-review-top .cwp-item-category a {
254
+ color: ' . $options_model->wppr_get_option( 'cwppos_font_color' ) . ';
255
+ }
256
+
257
+ #review-statistics .review-wrap-up .review-wu-right .pros h2 {
258
+ color: ' . $options_model->wppr_get_option( 'cwppos_pros_color' ) . ';
259
+ }
260
+
261
+ #review-statistics .review-wrap-up .review-wu-right .cons h2 {
262
+ color: ' . $options_model->wppr_get_option( 'cwppos_cons_color' ) . ';
263
+ }
264
+
265
+ div.affiliate-button a {
266
+ border: 2px solid ' . $options_model->wppr_get_option( 'cwppos_buttonbd_color' ) . ';
267
+ }
268
+
269
+ div.affiliate-button a:hover {
270
+ border: 2px solid ' . $options_model->wppr_get_option( 'cwppos_buttonbh_color' ) . ';
271
+ }
272
+
273
+ div.affiliate-button a {
274
+ background: ' . $options_model->wppr_get_option( 'cwppos_buttonbkd_color' ) . ';
275
+ }
276
+
277
+ div.affiliate-button a:hover {
278
+ background: ' . $options_model->wppr_get_option( 'cwppos_buttonbkh_color' ) . ';
279
+ }
280
+
281
+ div.affiliate-button a span {
282
+ color: ' . $options_model->wppr_get_option( 'cwppos_buttontxtd_color' ) . ';
283
+ }
284
+
285
+ div.affiliate-button a:hover span {
286
+ color: ' . $options_model->wppr_get_option( 'cwppos_buttontxth_color' ) . ';
287
+ }
288
+
289
+ ' . $conditional_styles . '
290
+ </style>
291
+ ';
292
+
293
+ echo $style;
294
+
295
+ $script = '
296
+ <script type="text/javascript">
297
+ var c1 = "' . $options_model->wppr_get_option( 'cwppos_rating_weak' ) . '";
298
+ var c2 = "' . $options_model->wppr_get_option( 'cwppos_rating_notbad' ) . '";
299
+ var c3 = "' . $options_model->wppr_get_option( 'cwppos_rating_good' ) . '";
300
+ var c4 = "' . $options_model->wppr_get_option( 'cwppos_rating_very_good' ) . '";
301
+ </script>
302
+ ';
303
+
304
+ echo $script;
305
+ }// End if().
306
+ }
307
+
308
+ /**
309
+ * Temporary methods
310
+ *
311
+ * @since 3.0.0
312
+ * @access public
313
+ *
314
+ * @param mixed $content The page content.
315
+ *
316
+ * @return mixed
317
+ */
318
+ public function display_on_front( $content ) {
319
+ $this->init();
320
+ if ( $this->review->is_active() ) {
321
+ $options_model = new WPPR_Options_Model();
322
+ $output = '';
323
+ $visual = 'full';
324
+
325
+ if ( $visual == 'full' ) {
326
+ $theme_template = get_template_directory() . '/wppr/default.php';
327
+ if ( file_exists( $theme_template ) ) {
328
+ include( $theme_template );
329
+ } else {
330
+ include( WPPR_PATH . '/includes/public/layouts/default-tpl.php' );
331
+ }
332
+ }
333
+
334
+ include_once( WPPR_PATH . '/includes/public/layouts/rich-json-ld.php' );
335
+
336
+ $review_position_before_content = $options_model->wppr_get_option( 'cwppos_show_reviewbox' );
337
+ if ( $review_position_before_content == 'yes' ) {
338
+ $content = $content . $output;
339
+ } elseif ( $review_position_before_content == 'no' ) {
340
+ $content = $output . $content ;
341
+ }
342
+ }
343
+
344
+ return $content;
345
+ }
346
+
347
+ /**
348
+ * Sets the default settings for front end display
349
+ *
350
+ * @since 3.0.0
351
+ * @access public
352
+ */
353
+ public function default_settings() {
354
+ $this->init();
355
+ if ( $this->review->is_active() ) {
356
+
357
+ $options_model = new WPPR_Options_Model();
358
+
359
+ $options_model->wppr_get_option( 'cwppos_rating_default' );
360
+
361
+ if ( class_exists( 'WPPR_Pro' ) ) {
362
+ $isSetToPro = true;
363
+ } else {
364
+ $isSetToPro = false;
365
+ }
366
+
367
+ if ( $isSetToPro ) {
368
+ $uni_font = $options_model->wppr_get_option( 'cwppos_change_bar_icon' );
369
+ } else {
370
+ $uni_font = '';
371
+ }
372
+ $track = $options_model->wppr_get_option( 'cwppos_rating_chart_default' );
373
+ if ( is_array( $uni_font ) ) {
374
+ $uni_font = $uni_font[0];
375
+ } elseif ( substr( $uni_font, 0, 1 ) == '#' ) {
376
+ $uni_font = $uni_font;
377
+ } else {
378
+ $uni_font = '';
379
+ }
380
+
381
+ if ( ! empty( $uni_font ) ) {
382
+ if ( $isSetToPro ) {
383
+ if ( $options_model->wppr_get_option( 'cwppos_fontawesome' ) === 'no' ) {
384
+ wp_enqueue_style( 'cwp-pac-fontawesome-stylesheet', WPPR_URL . '/assets/css/font-awesome.min.css' );
385
+ }
386
+ }
387
+ }
388
+ echo "<script type='text/javascript'>
389
+ var cwpCustomBarIcon = '" . $uni_font . "';
390
+ var isSetToPro = '" . $isSetToPro . "';
391
+ var trackcolor = '" . $track . "';
392
+ </script>";
393
+ }// End if().
394
+ }
395
+
396
+ /**
397
+ * Adds the comment form fields.
398
+ *
399
+ * @return string The comment form fields.
400
+ */
401
+ function add_comment_fields() {
402
+ $this->init();
403
+ if ( ! $this->review->is_active() ) {
404
+ return '';
405
+ }
406
+ if ( $this->review->wppr_get_option( 'cwppos_show_userreview' ) != 'yes' ) {
407
+ return '';
408
+ }
409
+ $options = $this->review->get_options();
410
+ $option_names = wp_list_pluck( $options, 'name' );
411
+ $sliders = array();
412
+ foreach ( $option_names as $k => $value ) {
413
+ $sliders[] =
414
+ '<div class="wppr-comment-form-meta">
415
+ <label for="wppr-slider-option-' . $k . '">' . $value . '</label>
416
+ <input type="text" id="wppr-slider-option-' . $k . '" class="meta_option_input" value="" name="wppr-slider-option-' . $k . '" readonly="readonly">
417
+ <div class="wppr-comment-meta-slider"></div>
418
+ <div class="cwpr_clearfix"></div>
419
+ </div>';
420
+ }
421
+ echo '<div id="wppr-slider-comment">' . implode( '', $sliders ) . '<div class="cwpr_clearfix"></div></div>';
422
+
423
+ }
424
+
425
+ /**
426
+ * Update the comment meta fields with the rating.
427
+ *
428
+ * @param int $comment_id The comment id.
429
+ */
430
+ public function save_comment_fields( $comment_id ) {
431
+ $comment = get_comment( $comment_id );
432
+ if ( empty( $comment ) ) {
433
+ return;
434
+ }
435
+ $review = new WPPR_Review_Model( $comment->comment_post_ID );
436
+ if ( empty( $review ) ) {
437
+ return;
438
+
439
+ }
440
+ if ( ! $review->is_active() ) {
441
+ return;
442
+ }
443
+ if ( $review->wppr_get_option( 'cwppos_show_userreview' ) != 'yes' ) {
444
+ return;
445
+ }
446
+
447
+ $options = $review->get_options();
448
+ $option_names = wp_list_pluck( $options, 'name' );
449
+ foreach ( $option_names as $k => $value ) {
450
+ if ( isset( $_POST[ 'wppr-slider-option-' . $k ] ) ) {
451
+ $option_value = wp_filter_nohtml_kses( $_POST[ 'wppr-slider-option-' . $k ] );
452
+ update_comment_meta( $comment_id, 'meta_option_' . $k, $option_value );
453
+ }
454
+ }
455
+ }
456
+
457
+ /**
458
+ * Alter the comment text and add the review ratings.
459
+ *
460
+ * @param string $text Comment text.
461
+ *
462
+ * @return string Comment text with review.
463
+ */
464
+ public function show_comment_ratings( $text ) {
465
+ $this->init();
466
+ if ( ! $this->review->is_active() ) {
467
+ return $text;
468
+ }
469
+ if ( $this->review->wppr_get_option( 'cwppos_show_userreview' ) != 'yes' ) {
470
+ return $text;
471
+ }
472
+
473
+ global $comment;
474
+
475
+ $options = $this->review->get_comment_options( $comment->comment_ID );
476
+ if ( empty( $options ) ) {
477
+ return $text;
478
+ }
479
+ $return = '';
480
+ $return .= '<div class="user-comments-grades">';
481
+ foreach ( $options as $k => $option ) {
482
+ $comment_meta_score = $option['value'] * 10;
483
+ $return .= '<div class="comment-meta-option">
484
+ <p class="comment-meta-option-name">' . $option['name'] . '</p>
485
+ <p class="comment-meta-option-grade">' . $option['value'] . '</p>
486
+ <div class="cwpr_clearfix"></div>
487
+ <div class="comment-meta-grade-bar">
488
+ <div class="comment-meta-grade" style="width: ' . intval( $option['value'] ) * 10 . '%"></div>
489
+ </div><!-- end .comment-meta-grade-bar -->
490
+ </div><!-- end .comment-meta-option -->
491
+ ';
492
+ }
493
+ $return .= '</div>';
494
+
495
+ return $return . $text . '<div class="cwpr_clearfix"></div>';
496
+ }
497
+
498
+ }
includes/public/index.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden
4
+ *
5
+ * @package WPPR
6
+ * @copyright Copyright (c) 2017, Bogdan Preda
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ * @since 3.0.0
9
+ */
10
+
11
+ /**
12
+ * Nothing to do here.
13
+ */
includes/public/layouts/default-tpl.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Prodact Review front page layout.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ $review = $this->review->get_review_data();
13
+ $sub_title_info = '';
14
+ $sub_title_info = $review['price'];
15
+ if ( $sub_title_info != '' ) {
16
+ $is_disabled = apply_filters( 'wppr_disable_price_richsnippet', false );
17
+ if ( ! $is_disabled ) {
18
+ $sub_title_info = '<span>
19
+ <span>' . $review['currency'] . $review['price'] . '</span>
20
+ </span>';
21
+ }
22
+ }
23
+
24
+ $lightbox = '';
25
+ if ( $this->review->wppr_get_option( 'cwppos_lighbox' ) == 'no' ) {
26
+ $lightbox = 'data-lightbox="' . $review['image']['full'] . '"';
27
+ }
28
+ $image_link_url = $review['image']['full'];
29
+ $multiple_affiliates_class = 'affiliate-button';
30
+ $display_links_count = 0;
31
+ foreach ( $review['links'] as $title => $link ) {
32
+ if ( $title != '' && $link != '' ) {
33
+ if ( $review['click'] != 'image' ) {
34
+ $image_link_url = $link;
35
+ }
36
+ $display_links_count++;
37
+ }
38
+ }
39
+ if ( $display_links_count > 1 ) {
40
+ $multiple_affiliates_class = 'affiliate-button2 affiliate-button';
41
+ }
42
+
43
+ $extra_class = '';
44
+
45
+ $output = '
46
+ <section id="review-statistics" class="article-section">
47
+ <div class="review-wrap-up cwpr_clearfix" >
48
+ <div class="cwpr-review-top cwpr_clearfix">
49
+ <span><h2 class="cwp-item">' . $review['name'] . '</h2></span>
50
+ <span class="cwp-item-price cwp-item">' . $sub_title_info . '</span>
51
+ </div><!-- end .cwpr-review-top -->
52
+ <div class="review-wu-left">
53
+ <div class="rev-wu-image">
54
+ <a href="' . $image_link_url . '" ' . $lightbox . ' rel="nofollow" target="_blank"><img src="' . $review['image']['thumb'] . '" alt="' . do_shortcode( $review['name'] ) . '" class="photo photo-wrapup wppr-product-image" /></a>
55
+ </div><!-- end .rev-wu-image -->
56
+ <div class="review-wu-grade">
57
+ <div class="cwp-review-chart ' . $extra_class . '">
58
+ <span>
59
+ <div class="cwp-review-percentage" data-percent="' . $review['rating'] . '">
60
+ <span class="cwp-review-rating">' . $review['rating'] . '</span>
61
+ </div>
62
+ </span>
63
+ </div><!-- end .chart -->
64
+ </div><!-- end .review-wu-grade -->
65
+ <div class="review-wu-bars">
66
+ ';
67
+ if ( isset( $review['options'] ) && ! empty( $review['options'] ) ) {
68
+ foreach ( $review['options'] as $option ) {
69
+ $output .= '
70
+ <div class="rev-option" data-value=' . $option['value'] . '>
71
+ <div class="cwpr_clearfix">
72
+ <h3>' . apply_filters( 'wppr_option_name_html', $option['name'] ) . '</h3>
73
+ <span>' . round( $option['value'] / 10 ) . '/10</span>
74
+ </div>
75
+ <ul class="cwpr_clearfix"></ul>
76
+ </div>
77
+ ';
78
+ }
79
+ }
80
+ $output .= '
81
+ </div><!-- end .review-wu-bars -->
82
+ </div><!-- end .review-wu-left -->
83
+ <div class="review-wu-right">
84
+ <div class="pros">
85
+ <h2>' .
86
+ // @codingStandardsIgnoreStart
87
+ apply_filters( 'wppr_review_pros_text', __( $options_model->wppr_get_option( 'cwppos_pros_text' ), 'wp-product-review' ) )
88
+ // @codingStandardsIgnoreEnd
89
+ . '</h2>
90
+ <ul>';
91
+ if ( isset( $review['pros'] ) && ! empty( $review['pros'] ) ) {
92
+ foreach ( $review['pros'] as $pro ) {
93
+ $output .= '<li>' . $pro . '</li>';
94
+ }
95
+ }
96
+ $output .= '
97
+ </ul>
98
+ </div><!-- end .pros -->
99
+ <div class="cons">
100
+ <h2>' .
101
+ // @codingStandardsIgnoreStart
102
+ apply_filters( 'wppr_review_cons_text', __( $options_model->wppr_get_option( 'cwppos_cons_text' ), 'wp-product-review' ) )
103
+ // @codingStandardsIgnoreEnd
104
+ . '</h2>
105
+ <ul>';
106
+ if ( isset( $review['cons'] ) && ! empty( $review['cons'] ) ) {
107
+ foreach ( $review['cons'] as $con ) {
108
+ $output .= '<li>' . $con . '</li>';
109
+ }
110
+ }
111
+ $output .= '
112
+ </ul>
113
+ </div>
114
+ </div><!-- end .review-wu-right -->
115
+ </div><!-- end .review-wrap-up -->
116
+ </section><!-- end #review-statistics -->
117
+ ';
118
+ if ( ! empty( $review['links'] ) ) {
119
+ foreach ( $review['links'] as $title => $link ) {
120
+ if ( $title != '' && $link != '' ) {
121
+ $output .= '
122
+ <div class="' . $multiple_affiliates_class . '">
123
+ <a href="' . $link . '" rel="nofollow" target="_blank"><span>' . $title . '</span> </a>
124
+ </div><!-- end .affiliate-button -->
125
+ ';
126
+ }
127
+ }
128
+ }
includes/public/layouts/rating-tpl.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Prodact Review front page layout.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ $review = $this->review->get_review_data();
13
+ $sub_title_info = '';
14
+ $sub_title_info = $review['price'];
15
+ if ( $sub_title_info != '' ) {
16
+ $is_disabled = apply_filters( 'wppr_disable_price_richsnippet', false );
17
+ $currency = preg_replace( '/[0-9.,]/', '', $review['price'] );
18
+ if ( ! $is_disabled ) {
19
+ $sub_title_info = '<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
20
+ <span itemprop="priceCurrency">' . $currency . '</span>
21
+ <span itemprop="price">' . $review['price'] . '</span>
22
+ </span>';
23
+ }
24
+ }
25
+
26
+ $lightbox = '';
27
+ if ( $this->review->wppr_get_option( 'cwppos_lighbox' ) == 'no' ) {
28
+ $lightbox = 'data-lightbox="' . $review['image']['full'] . '"';
29
+ }
30
+ $image_link_url = $review['image']['full'];
31
+ $multiple_affiliates_class = 'affiliate-button';
32
+ $display_links_count = 0;
33
+ foreach ( $review['links'] as $title => $link ) {
34
+ if ( $title != '' && $link != '' ) {
35
+ if ( $review['click'] != 'image' ) {
36
+ $image_link_url = $link;
37
+ }
38
+ $display_links_count++;
39
+ }
40
+ }
41
+ if ( $display_links_count > 1 ) {
42
+ $multiple_affiliates_class = 'affiliate-button2 affiliate-button';
43
+ }
44
+
45
+ $extra_class = ''; // TODO add check for embeded
46
+
47
+ $output = '
48
+ <div class="review-wu-grade">
49
+ <div class="cwp-review-chart ' . $extra_class . '">
50
+ <span>
51
+ <div class="cwp-review-percentage" data-percent="' . $review['rating'] . '">
52
+ <span class="cwp-review-rating">' . $review['comment_rating'] . '</span>
53
+ </div>
54
+ </span>
55
+ </div><!-- end .chart -->
56
+ </div>
57
+ ';
includes/public/layouts/rich-json-ld.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Prodact Review front page layout.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ if ( $this->review->wppr_get_option( 'wppr_rich_snippet' ) == 'yes' ) {
13
+ $review = $this->review->get_review_data();
14
+ $currency = $review['currency'];
15
+ $output .= '
16
+ <script type="application/ld+json">
17
+ {
18
+ "@context": "http://schema.org/",
19
+ "@type": "Product",
20
+ "name": "' . $review['name'] . '",
21
+ "image": "' . $review['image']['thumb'] . '",
22
+ "description": "' . get_the_excerpt( $review['id'] ) . '",
23
+ "aggregateRating": {
24
+ "@type": "AggregateRating",
25
+ "bestRating": "10",
26
+ "worstRating": "1",
27
+ "ratingValue": "' . ( $review['rating'] / 10 ) . '",
28
+ "reviewCount": "1"
29
+ },
30
+ "offers": {
31
+ "@type": "Offer",
32
+ "price": "' . number_format( $review['price'], 2 ) . '",
33
+ "priceCurrency": "' . $currency . '",
34
+ "availability": "http://schema.org/InStock",
35
+ "seller": {
36
+ "@type": "Organization",
37
+ "name": "' . get_the_author() . '"
38
+ }
39
+ }
40
+ }
41
+ </script>';
42
+ }
includes/public/layouts/score-tpl.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Prodact Review front page layout.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ $output = number_format( floor( $this->review->get_rating() ) / 10, 1 );
includes/public/layouts/widget/default.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Default Widget Layout for front end.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ echo '<ul>';
13
+ foreach ( $results as $review ) :
14
+ $product_title_display = ( $post_type == true ) ? $review['cwp_rev_product_name'] : get_the_title();
15
+ $product_image = $review['cwp_rev_product_image'];
16
+
17
+ if ( strlen( $product_title_display ) > self::RESTRICT_TITLE_CHARS ) {
18
+ $product_title_display = substr( $product_title_display, 0, self::RESTRICT_TITLE_CHARS ) . '...';
19
+ }
20
+ ?>
21
+ <li class="cwp-popular-review cwp_top_posts_widget_
22
+ <?php
23
+ if ( $instance['show_image'] == true && ! empty( $product_image ) ) {
24
+ echo ' wppr-cols-3';
25
+ } else {
26
+ echo ' wppr-cols-2';
27
+ }
28
+ ?>
29
+ ">
30
+ <?php
31
+ if ( $instance['show_image'] == true && ! empty( $product_image ) ) {
32
+ ?>
33
+ <img class="cwp_rev_image wppr-col" src="<?php echo $product_image; ?>"
34
+ alt="<?php echo $review['cwp_rev_product_name']; ?>">
35
+ <?php } ?>
36
+ <a href="<?php echo get_the_permalink( $review['ID'] ); ?>" class="wppr-col"
37
+ title="<?php echo $review['cwp_rev_product_name']; ?>">
38
+ <?php echo $product_title_display; ?>
39
+ </a>
40
+ <?php
41
+ $review_score = $review['wppr_rating'];
42
+ if ( ! empty( $review_score ) ) {
43
+ ?>
44
+ <div class="review-grade-widget wppr-col">
45
+ <div class="cwp-review-chart absolute">
46
+ <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>"><span></span></div>
47
+ </div><!-- end .chart -->
48
+ </div>
49
+ <?php } ?>
50
+ </li>
51
+ <?php
52
+ endforeach;
53
+ ?>
54
+ </ul>
includes/public/layouts/widget/style 1.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Style One Widget Layout for front end.
4
+ *
5
+ * @package WPPR
6
+ * @subpackage Layouts
7
+ * @copyright Copyright (c) 2017, Bogdan Preda
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 3.0.0
10
+ */
11
+
12
+ // @codingStandardsIgnoreStart
13
+ ?>
14
+ <div class="wppr-prodlist">
15
+ <?php
16
+ foreach ( $results as $review ) :
17
+ $product_image = $review['cwp_rev_product_image'];
18
+ $product_title = ( $instance['post_type'] == true ) ? $review['cwp_rev_product_name'] : get_the_title( $review['ID'] );
19
+ $product_title_display = $product_title;
20
+ if ( strlen( $product_title_display ) > self::RESTRICT_TITLE_CHARS ) {
21
+ $product_title_display = substr( $product_title_display, 0, self::RESTRICT_TITLE_CHARS ) . '...';
22
+ }
23
+
24
+ $affiliate_link = reset( $review['wppr_links'] );
25
+ $review_link = get_the_permalink();
26
+
27
+ $showingImg = $instance['show_image'] == true && ! empty( $product_image );
28
+ ?>
29
+
30
+ <div class="wppr-prodrow">
31
+ <?php if ( $showingImg ) { ?>
32
+ <div class="wppr-prodrowleft">
33
+ <a href="<?php echo $review_link; ?>" class="wppr-col" title="<?php echo $product_title; ?>">
34
+ <img class="cwp_rev_image wppr-col" src="<?php echo $product_image; ?>"
35
+ alt="<?php echo $product_title; ?>"/>
36
+ </a>
37
+ </div>
38
+ <?php
39
+ }
40
+ ?>
41
+ <div class="wppr-prodrowright <?php echo $showingImg ? 'wppr-prodrowrightadjust' : '' ?>">
42
+ <p><strong><?php echo $product_title_display; ?></strong></p>
43
+ <?php
44
+ $review_score = $review['wppr_rating'];
45
+
46
+ if ( ! empty( $review_score ) ) {
47
+ if ( $instance['cwp_tp_rating_type'] == 'round' ) {
48
+ ?>
49
+ <div class="review-grade-widget wppr-col">
50
+ <div class="cwp-review-chart relative">
51
+ <div class="cwp-review-percentage" data-percent="<?php echo $review_score; ?>">
52
+ <span></span></div>
53
+ </div><!-- end .chart -->
54
+ </div>
55
+ <div class="clear"></div>
56
+ <?php
57
+ } else {
58
+ ?>
59
+ <div class="wppr-rating">
60
+ <div style="width:<?php echo $review_score; ?>%;"> <?php echo $review_score; ?></div>
61
+ </div>
62
+ <?php
63
+ }
64
+ }
65
+ ?>
66
+ <p class="wppr-style1-buttons">
67
+ <?php
68
+ $link = "<a href='{$affiliate_link}' rel='nofollow' target='_blank' class='wppr-bttn'>" . __( $instance['cwp_tp_buynow'], 'wp-product-review' ) . '</a>';
69
+ if ( ! empty( $instance['cwp_tp_buynow'] ) ) {
70
+ echo apply_filters( 'wppr_widget_style1_buynow_link', $link, get_the_ID(), $affiliate_link, $instance['cwp_tp_buynow'] );
71
+ }
72
+
73
+ $link = "<a href='{$review_link}' rel='nofollow' target='_blank' class='wppr-bttn'>" . __( $instance['cwp_tp_readreview'], 'wp-product-review' ) . '</a>';
74
+ if ( ! empty( $instance['cwp_tp_readreview'] ) ) {
75
+ echo apply_filters( 'wppr_widget_style1_readreview_link', $link, get_the_ID(), $review_link, $instance['cwp_tp_readreview'] );
76
+ }
77
+ ?>
78
+ </p>
79
+ </div>
80
+ <div class="clear"></div>
81
+ </div>
82
+ <?php endforeach; ?>
83
+ </div>
index.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Silence is golden
4
+ *
5
+ * @package WPPR
6
+ * @copyright Copyright (c) 2017, Bogdan Preda
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ * @since 3.0.0
9
+ */
10
+
11
+ /**
12
+ * Nothing to do here.
13
+ */
javascript/admin-review.js DELETED
@@ -1,63 +0,0 @@
1
- /* jshint ignore:start */
2
- jQuery(document).ready(function(){
3
-
4
- var meta_image_frame;
5
-
6
-
7
- jQuery('#cwp_rev_product_image-button').click(function(e){
8
-
9
-
10
- e.preventDefault();
11
-
12
-
13
- if ( meta_image_frame ) {
14
- wp.media.frame.open();
15
- return;
16
- }
17
- var mtitle="Add a product image to the review";
18
- var mbutton = "Attach the image ";
19
-
20
- meta_image_frame = wp.media.frames.meta_image_frame = wp.media({
21
- title: mtitle,
22
- button: { text: mbutton },
23
- library: { type: 'image' }
24
- });
25
-
26
-
27
- meta_image_frame.on('select', function(){
28
-
29
-
30
- var media_attachment = meta_image_frame.state().get('selection').first().toJSON();
31
-
32
-
33
- jQuery('#cwp_rev_product_image').val(media_attachment.url);
34
- });
35
-
36
-
37
- wp.media.frame.open();
38
- });
39
-
40
- jQuery('input:radio[name="cwp_meta_box_check"]').change(function(){
41
- var value = jQuery(this).val();
42
- if(value === "Yes"){
43
-
44
- jQuery("#cwp_review_meta_box .product-review-meta-No").show();
45
- jQuery("#cwp_review_meta_box .product-review-meta-Yes").show();
46
- }else{
47
- jQuery("#cwp_review_meta_box .product-review-meta-Yes").hide();
48
- jQuery("#cwp_review_meta_box .product-review-meta-No").hide();
49
- }
50
- });
51
-
52
- jQuery('#cwp_add_button').click(function(e){
53
- e.preventDefault();
54
- jQuery('.cwp_hide_button2').show();
55
- jQuery(this).hide();
56
- return false;
57
- })
58
-
59
-
60
-
61
-
62
-
63
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/custom-bar-icon.js DELETED
@@ -1,49 +0,0 @@
1
- /* jshint ignore:start */
2
- jQuery("#cwp_select_bar_icon").click(function(a) {
3
- a.preventDefault();
4
- a.stopPropagation();
5
- var b = ["&#xf096","&#xf08a","&#xf11b","&#xf06d","&#xf1b2","&#xf005","&#xf155","&#xf1db","&#xf006","&#xf0c8","&#xf02d","&#xf135","&#xf013","&#xf0fa",];
6
- if (0 != jQuery("#bar-icon-elements").length){
7
- jQuery("#bar-icon-elements").addClass("active").show(); } else { insertIconContainer(b); }
8
- });
9
-
10
- function insertIconContainer(a) {
11
- jQuery("#cwp_form").append("<div id='bar-icon-elements' class='active'></div>");
12
- a.forEach(function(a) {
13
- iC = a.substring(1);
14
- var b = "<i id='" + iC + "' class='fa icon fa-fw'>" + a + "</i>";
15
- jQuery("#bar-icon-elements").append(b);
16
- });
17
- jQuery("#bar-icon-elements").append("<span class='closeModal'><i class='fa fa-times'></i></span>");
18
- jQuery("#bar-icon-elements .closeModal").click(function(x) {
19
- jQuery("#bar-icon-elements").removeClass("active").hide();
20
-
21
- });
22
- }
23
-
24
- function r() {
25
- jQuery(".current_bar_icon").html("").text("* Currently set to the default styling.");
26
- jQuery("input[type='hidden']#cwp_bar_icon_field").val("");
27
- }
28
-
29
- jQuery(".useDefault").click(function(a) {
30
- a.preventDefault();
31
- a.stopPropagation();
32
- r();
33
- });
34
-
35
- function d() {
36
- jQuery("#bar-icon-elements").removeClass("active").hide();
37
-
38
- }
39
-
40
- jQuery("#cwp_form").on("click", "#bar-icon-elements i.icon", function(a) {
41
- a.preventDefault();
42
- var b = jQuery(this).attr("id");
43
- var uD = "<a href='#' class='useDefault'>Use Default Styling</a>";
44
- jQuery("#bar-icon-elements i.active").removeClass("active");
45
- jQuery(this).addClass("active");
46
- jQuery(".current_bar_icon").text("").append("<i class='fa icon fa-fw'>&" + b + "</i>" + uD);
47
- jQuery("input[type='hidden']#cwp_bar_icon_field").val(b);
48
- d();
49
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/cwp-pointers.js DELETED
@@ -1,30 +0,0 @@
1
- /* jshint ignore:start */
2
- (function ($, cwpp){
3
-
4
- $(document).ready( function() {
5
-
6
- var timeout;
7
-
8
- $("#cwp_product_affiliate_link").on("keyup", function(e){
9
- if($(this).val().indexOf("amazon") != -1){
10
- $("#wppr_product_affiliate_link_upsell").show();
11
- timeout = setTimeout(function(){wppr_open_pointer(0);}, 1000);
12
- }
13
- });
14
-
15
- function wppr_open_pointer(i) {
16
- pointer = cwpp.pointers.pointers[i];
17
- options = $.extend( pointer.options, {
18
- close: function() {
19
- $.post( ajaxurl, {
20
- pointer: pointer.pointer_id,
21
- action: 'wppr-dismiss-amazon-link'
22
- });
23
- }
24
- });
25
-
26
- $(pointer.target).pointer( options ).pointer('open');
27
- clearTimeout(timeout);
28
- }
29
- });
30
- })(jQuery, cwpp)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/main.js DELETED
@@ -1,106 +0,0 @@
1
- /* jshint ignore:start */
2
- /**
3
- * Main JavaScript File
4
- */
5
- jQuery(document).ready(function($) {
6
-
7
- var initPieChart = function() {
8
- returnColor = function(percent) {
9
-
10
- if (percent > 0 && percent <= 25) {
11
- return c1;
12
- } else if (percent > 25 && percent <= 50) {
13
- return c2;
14
- } else if (percent > 50 && percent <= 75) {
15
- return c3;
16
- } else if (percent > 75) {
17
- return c4;
18
- }
19
- };
20
- if (typeof trackcolor != 'undefined') {
21
- trackColorRight = trackcolor.toUpperCase();
22
- }
23
- else {
24
- trackColorRight = '#ebebeb';
25
- }
26
-
27
- p_image_width = $('.review-wrap-up .rev-wu-image').width();
28
- if (p_image_width==0 || p_image_width==null) p_image_width = 50;
29
- $('.cwp-review-percentage').cwp_easyPieChart({
30
- barColor: function(percent) {
31
- return returnColor(percent);
32
- },
33
- trackColor: trackColorRight,
34
- scaleColor: false,
35
- lineCap: 'butt',
36
- rotate: 0,
37
- lineWidth: 15 * Math.min(p_image_width,150)/140,
38
- animate: 1,
39
- size : Math.min(p_image_width,150)*0.8,
40
- onStep: function(value) {
41
- var c = returnColor(value);
42
-
43
- this.$el.find('span').text(~~value / 10);
44
- this.$el.find('span').css({
45
- color: c
46
- });
47
- }
48
- });
49
- };
50
-
51
- initPieChart();
52
-
53
- function wuReview() {
54
-
55
-
56
-
57
-
58
- if( !(typeof(cwpCustomBarIcon) === "undefined") && !(cwpCustomBarIcon === "") && isSetToPro) {
59
- $(".rev-option").each(function() {
60
- var grade = $(this).attr("data-value");
61
- $(this).addClass("customBarIcon");
62
- var x = 10;
63
- if ($(this).children("ul").find("li").length == 0)
64
- for (var i = 0; i < x; i++) {
65
- $(this).children("ul").append("<li><i class='fa fa-fw'>&"+cwpCustomBarIcon+"</i></li>");
66
- }
67
- $(this).children("ul").children("li:nth-child(-n+" + Math.ceil(grade / 10) + ")").css("color", returnColor(grade));
68
- $(this).children("div").children("span").text(grade / 10 + "/10");
69
- });
70
- } else {
71
- $(".rev-option").each(function() {
72
- var grade = $(this).attr("data-value");
73
- var x = 10;
74
- if ($(this).children("ul").find("li").length == 0)
75
- for (var i = 0; i < x; i++) {
76
- $(this).children("ul").append("<li style='margin-right: 2%;'></li>");
77
- }
78
- $(this).children("ul").children("li:nth-child(-n+" + Math.ceil(grade / 10) + ")").css("background", returnColor(grade));
79
- $(this).children("div").children("span").text(grade / 10 + "/10");
80
- });
81
- }
82
-
83
- }
84
-
85
- $(".comment-meta-option .comment-meta-grade").each(function() {
86
- var theBarWidth = (100 * parseFloat($(this).css('width')) / parseFloat($(this).parent().css('width')));
87
- $(this).css("background", returnColor(theBarWidth));
88
- });
89
-
90
-
91
- wuReview();
92
-
93
- $(".comment_meta_slider").each(function() {
94
- var comm_meta_input = $(this).parent(".comment-form-meta-option").children("input");
95
- $(this).slider({
96
- min: 0,
97
- max: 100,
98
- value: 4,
99
- slide: function(event, ui) {
100
- $(comm_meta_input).val(ui.value / 10);
101
- }
102
- });
103
- });
104
-
105
-
106
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/pie-chart.js DELETED
@@ -1,404 +0,0 @@
1
- /* jshint ignore:start */
2
-
3
- /*
4
-
5
- Easy pie chart is a jquery plugin to display simple animated pie charts for only one value
6
-
7
-
8
-
9
- Dual licensed under the MIT (http:
10
-
11
- and GPL (http:
12
-
13
-
14
-
15
- Built on top of the jQuery library (http:
16
-
17
-
18
-
19
- @source: http:
20
-
21
- @autor: Robert Fleischmann
22
-
23
- @version: 1.2.5
24
-
25
-
26
-
27
- Inspired by: http:
28
-
29
- Thanks to Philip Thrasher for the jquery plugin boilerplate for coffee script
30
-
31
- */
32
-
33
-
34
-
35
- (function($) {
36
-
37
- $.cwp_easyPieChart = function(el, options) {
38
-
39
- var addScaleLine, animateLine, drawLine, easeInOutQuad, rAF, renderBackground, renderScale, renderTrack,
40
-
41
- _this = this;
42
-
43
- this.el = el;
44
-
45
- this.$el = $(el);
46
-
47
- this.$el.data("cwp_easyPieChart", this);
48
-
49
- this.init = function() {
50
-
51
- var percent, scaleBy;
52
-
53
- _this.options = $.extend({}, $.cwp_easyPieChart.defaultOptions, options);
54
-
55
- percent = parseInt(_this.$el.data('percent'), 10);
56
-
57
- _this.percentage = 0;
58
-
59
- _this.canvas = $("<canvas width='" + _this.options.size + "' height='" + _this.options.size + "'></canvas>").get(0);
60
-
61
- _this.$el.append(_this.canvas);
62
-
63
- if (typeof G_vmlCanvasManager !== "undefined" && G_vmlCanvasManager !== null) {
64
-
65
- G_vmlCanvasManager.initElement(_this.canvas);
66
-
67
- }
68
-
69
- _this.ctx = _this.canvas.getContext('2d');
70
-
71
- if (window.devicePixelRatio > 1) {
72
-
73
- scaleBy = window.devicePixelRatio;
74
-
75
- $(_this.canvas).css({
76
-
77
- width: _this.options.size,
78
-
79
- height: _this.options.size
80
-
81
- });
82
-
83
- _this.canvas.width *= scaleBy;
84
-
85
- _this.canvas.height *= scaleBy;
86
-
87
- _this.ctx.scale(scaleBy, scaleBy);
88
-
89
- _this.ctx.webkitImageSmoothingEnabled = true;
90
-
91
- }
92
-
93
- _this.ctx.translate(_this.options.size / 2, _this.options.size / 2);
94
-
95
- _this.ctx.rotate(_this.options.rotate * Math.PI / 180);
96
-
97
- _this.$el.addClass('cwp_easyPieChart');
98
-
99
- _this.$el.css({
100
-
101
- width: _this.options.size,
102
-
103
- height: _this.options.size,
104
-
105
- lineHeight: "" + _this.options.size + "px"
106
-
107
- });
108
-
109
- _this.update(percent);
110
-
111
- return _this;
112
-
113
- };
114
-
115
- this.update = function(percent) {
116
-
117
- percent = parseFloat(percent) || 0;
118
-
119
- if (_this.options.animate === false) {
120
-
121
- drawLine(percent);
122
-
123
- } else {
124
-
125
- if (_this.options.delay) {
126
-
127
- animateLine(_this.percentage, 0);
128
-
129
- setTimeout(function() {
130
-
131
- return animateLine(_this.percentage, percent);
132
-
133
- }, _this.options.delay);
134
-
135
- } else {
136
-
137
- animateLine(_this.percentage, percent);
138
-
139
- }
140
-
141
- }
142
-
143
- return _this;
144
-
145
- };
146
-
147
- renderScale = function() {
148
-
149
- var i, _i, _results;
150
-
151
- _this.ctx.fillStyle = _this.options.scaleColor;
152
-
153
- _this.ctx.lineWidth = 1;
154
-
155
- _results = [];
156
-
157
- for (i = _i = 0; _i <= 24; i = ++_i) {
158
-
159
- _results.push(addScaleLine(i));
160
-
161
- }
162
-
163
- return _results;
164
-
165
- };
166
-
167
- addScaleLine = function(i) {
168
-
169
- var offset;
170
-
171
- offset = i % 6 === 0 ? 0 : _this.options.size * 0.017;
172
-
173
- _this.ctx.save();
174
-
175
- _this.ctx.rotate(i * Math.PI / 12);
176
-
177
- _this.ctx.fillRect(_this.options.size / 2 - offset, 0, -_this.options.size * 0.05 + offset, 1);
178
-
179
- _this.ctx.restore();
180
-
181
- };
182
-
183
- renderTrack = function() {
184
-
185
- var offset;
186
-
187
- offset = _this.options.size / 2 - _this.options.lineWidth / 2;
188
-
189
- if (_this.options.scaleColor !== false) {
190
-
191
- offset -= _this.options.size * 0.08;
192
-
193
- }
194
-
195
- _this.ctx.beginPath();
196
-
197
- _this.ctx.arc(0, 0, offset, 0, Math.PI * 2, true);
198
-
199
- _this.ctx.closePath();
200
-
201
- _this.ctx.strokeStyle = _this.options.trackColor;
202
-
203
- _this.ctx.lineWidth = _this.options.lineWidth;
204
-
205
- _this.ctx.stroke();
206
-
207
- };
208
-
209
- renderBackground = function() {
210
-
211
- if (_this.options.scaleColor !== false) {
212
-
213
- renderScale();
214
-
215
- }
216
-
217
- if (_this.options.trackColor !== false) {
218
-
219
- renderTrack();
220
-
221
- }
222
-
223
- };
224
-
225
-
226
-
227
- drawLine = function(percent) {
228
-
229
- var offset;
230
-
231
- renderBackground();
232
-
233
- _this.ctx.strokeStyle = $.isFunction(_this.options.barColor) ? _this.options.barColor(percent) : _this.options.barColor;
234
-
235
- _this.ctx.lineCap = _this.options.lineCap;
236
-
237
- _this.ctx.lineWidth = _this.options.lineWidth;
238
-
239
- offset = _this.options.size / 2 - _this.options.lineWidth / 2;
240
-
241
- if (_this.options.scaleColor !== false) {
242
-
243
- offset -= _this.options.size * 0.08;
244
-
245
- }
246
-
247
- _this.ctx.save();
248
-
249
- _this.ctx.rotate(-Math.PI / 2);
250
-
251
- _this.ctx.beginPath();
252
-
253
- _this.ctx.arc(0, 0, offset, 0, Math.PI * 2 * percent / 100, false);
254
-
255
- _this.ctx.stroke();
256
-
257
- _this.ctx.restore();
258
-
259
- };
260
-
261
- rAF = (function() {
262
-
263
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
264
-
265
- return window.setTimeout(callback, 1000 / 60);
266
-
267
- };
268
-
269
- })();
270
-
271
- animateLine = function(from, to) {
272
-
273
- var anim, startTime;
274
-
275
- _this.options.onStart.call(_this);
276
-
277
- _this.percentage = to;
278
-
279
- Date.now || (Date.now = function() {
280
-
281
- return +(new Date);
282
-
283
- });
284
-
285
- startTime = Date.now();
286
-
287
- anim = function() {
288
-
289
- var currentValue, process;
290
-
291
- process = Math.min(Date.now() - startTime, _this.options.animate);
292
-
293
- _this.ctx.clearRect(-_this.options.size / 2, -_this.options.size / 2, _this.options.size, _this.options.size);
294
-
295
- renderBackground.call(_this);
296
-
297
- currentValue = [easeInOutQuad(process, from, to - from, _this.options.animate)];
298
-
299
- _this.options.onStep.call(_this, currentValue);
300
-
301
- drawLine.call(_this, currentValue);
302
-
303
- if (process >= _this.options.animate) {
304
-
305
- return _this.options.onStop.call(_this, currentValue, to);
306
-
307
- } else {
308
-
309
- return rAF(anim);
310
-
311
- }
312
-
313
- };
314
-
315
- rAF(anim);
316
-
317
- };
318
-
319
- easeInOutQuad = function(t, b, c, d) {
320
-
321
- var easeIn, easing;
322
-
323
- easeIn = function(t) {
324
-
325
- return Math.pow(t, 2);
326
-
327
- };
328
-
329
- easing = function(t) {
330
-
331
- if (t < 1) {
332
-
333
- return easeIn(t);
334
-
335
- } else {
336
-
337
- return 2 - easeIn((t / 2) * -2 + 2);
338
-
339
- }
340
-
341
- };
342
-
343
- t /= d / 2;
344
-
345
- return c / 2 * easing(t) + b;
346
-
347
- };
348
-
349
- return this.init();
350
-
351
- };
352
-
353
- $.cwp_easyPieChart.defaultOptions = {
354
-
355
- barColor: '#ef1e25',
356
-
357
- trackColor: '#f2f2f2',
358
-
359
- scaleColor: '#dfe0e0',
360
-
361
- lineCap: 'round',
362
-
363
- rotate: 0,
364
-
365
- size: 110,
366
-
367
- lineWidth: 3,
368
-
369
- animate: false,
370
-
371
- delay: false,
372
-
373
- onStart: $.noop,
374
-
375
- onStop: $.noop,
376
-
377
- onStep: $.noop
378
-
379
- };
380
-
381
- $.fn.cwp_easyPieChart = function(options) {
382
-
383
- return $.each(this, function(i, el) {
384
-
385
- var $el, instanceOptions;
386
-
387
- $el = $(el);
388
-
389
- if (!$el.data('cwp_easyPieChart')) {
390
-
391
- instanceOptions = $.extend({}, options, $el.data());
392
-
393
- return $el.data('cwp_easyPieChart', new $.cwp_easyPieChart(el, instanceOptions));
394
-
395
- }
396
-
397
- });
398
-
399
- };
400
-
401
- return void 0;
402
-
403
- })(jQuery);
404
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/widget-latest.js DELETED
@@ -1,48 +0,0 @@
1
- /* jshint ignore:start */
2
- (function($, w){
3
-
4
- $(document).ready(function(){
5
- if($(".widget").length > 0){
6
- $(".widget").each(function(){
7
- if($(this).attr("id").indexOf(w.widgetName.toLowerCase()) != -1){
8
- toggleCustomFields(true, $(this).attr("id"));
9
- }
10
- });
11
- }else{
12
- toggleCustomFields(true, "wpcontent");
13
- }
14
- });
15
-
16
- function toggleCustomFields(deflt, widgetID){
17
- var val = getWidgetStyle(widgetID);
18
- if(val == "default.php"){
19
- $("#" + widgetID).find(".wppr-customField").hide();
20
- }else{
21
- $("#" + widgetID).find(".wppr-customField").show();
22
- if(!deflt) $("#" + widgetID).find("#" + w.imageCheckbox).prop("checked", true);
23
- }
24
-
25
- addListeners(widgetID);
26
- }
27
-
28
- $(document).on('widget-updated widget-added', function(e, w){
29
- toggleCustomFields(true, w[0]["id"]);
30
- });
31
-
32
- function addListeners(widgetID){
33
- $("#" + widgetID).find("input.wppr-stylestyle").on("click", function(e){
34
- toggleCustomFields(false, widgetID);
35
- });
36
- $("#" + widgetID).find("label.wppr-stylestyle").hover(function(e){
37
- $("#" + $(this).attr("for") + "img").show();
38
- }, function(e){
39
- $("#" + $(this).attr("for") + "img").hide();
40
- });
41
- }
42
-
43
- function getWidgetStyle(id){
44
- var name = $("#" + id).find("input:radio.wppr-stylestyle").attr("name");
45
- return $("input:radio[name='" + name + "']:checked").val();
46
- }
47
-
48
- })(jQuery, cwpw_latest);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
javascript/widget-top.js DELETED
@@ -1,48 +0,0 @@
1
- /* jshint ignore:start */
2
- (function($, w){
3
-
4
- $(document).ready(function(){
5
- if($(".widget").length > 0){
6
- $(".widget").each(function(){
7
- if($(this).attr("id").indexOf(w.widgetName.toLowerCase()) != -1){
8
- toggleCustomFields(true, $(this).attr("id"));
9
- }
10
- });
11
- }else{
12
- toggleCustomFields(true, "wpcontent");
13
- }
14
- });
15
-
16
- function toggleCustomFields(deflt, widgetID){
17
- var val = getWidgetStyle(widgetID);
18
- if(val == "default.php"){
19
- $("#" + widgetID).find(".wppr-customField").hide();
20
- }else{
21
- $("#" + widgetID).find(".wppr-customField").show();
22
- if(!deflt) $("#" + widgetID).find("#" + w.imageCheckbox).prop("checked", true);
23
- }
24
-
25
- addListeners(widgetID);
26
- }
27
-
28
- $(document).on('widget-updated widget-added', function(e, w){
29
- toggleCustomFields(true, w[0]["id"]);
30
- });
31
-
32
- function addListeners(widgetID){
33
- $("#" + widgetID).find("input.wppr-stylestyle").on("click", function(e){
34
- toggleCustomFields(false, widgetID);
35
- });
36
- $("#" + widgetID).find("label.wppr-stylestyle").hover(function(e){
37
- $("#" + $(this).attr("for") + "img").show();
38
- }, function(e){
39
- $("#" + $(this).attr("for") + "img").hide();
40
- });
41
- }
42
-
43
- function getWidgetStyle(id){
44
- var name = $("#" + id).find("input:radio.wppr-stylestyle").attr("name");
45
- return $("input:radio[name='" + name + "']:checked").val();
46
- }
47
-
48
- })(jQuery, cwpw_top);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/wp-product-review.pot ADDED
@@ -0,0 +1,558 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2017 ThemeIsle
2
+ # This file is distributed under the no.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: WP Product Review Lite 3.0.0\n"
6
+ "Report-Msgid-Bugs-To: https://github.com/Codeinwp/wp-product-review/issues\n"
7
+ "POT-Creation-Date: 2017-08-22 20:14:37+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: Themeisle Translate Team <friends@themeisle.com>\n"
13
+ "Language-Team: Themeisle Translate <friends@themeisle.com>\n"
14
+ "X-Generator: grunt-wp-i18n 0.5.4\n"
15
+ "X-Poedit-KeywordsList: "
16
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
17
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
18
+ "Language: en\n"
19
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
+ "X-Poedit-Country: United States\n"
21
+ "X-Poedit-SourceCharset: UTF-8\n"
22
+ "X-Poedit-Basepath: ../\n"
23
+ "X-Poedit-SearchPath-0: .\n"
24
+ "X-Poedit-Bookmarks: \n"
25
+ "X-Textdomain-Support: yes\n"
26
+
27
+ #: includes/admin/widgets/abstract/class-wppr-widget-abstract.php:78
28
+ msgid "10"
29
+ msgstr ""
30
+
31
+ #: includes/admin/class-wppr-admin.php:132
32
+ msgid "WP Product Review"
33
+ msgstr ""
34
+
35
+ #: includes/admin/class-wppr-admin.php:132
36
+ msgid "Product Review"
37
+ msgstr ""
38
+
39
+ #: includes/admin/class-wppr-admin.php:139
40
+ msgid "More Features"
41
+ msgstr ""
42
+
43
+ #: includes/admin/class-wppr-admin.php:139
44
+ msgid "More Features "
45
+ msgstr ""
46
+
47
+ #: includes/admin/class-wppr-editor.php:57
48
+ msgid "Product Review Extra Settings"
49
+ msgstr ""
50
+
51
+ #: includes/admin/class-wppr-global-settings.php:61
52
+ msgid "General settings"
53
+ msgstr ""
54
+
55
+ #: includes/admin/class-wppr-global-settings.php:62
56
+ msgid "Rating colors"
57
+ msgstr ""
58
+
59
+ #: includes/admin/class-wppr-global-settings.php:63
60
+ msgid "Typography"
61
+ msgstr ""
62
+
63
+ #: includes/admin/class-wppr-global-settings.php:64
64
+ msgid "Buy button"
65
+ msgstr ""
66
+
67
+ #: includes/admin/class-wppr-global-settings.php:72
68
+ msgid "Position of the review box"
69
+ msgstr ""
70
+
71
+ #: includes/admin/class-wppr-global-settings.php:73
72
+ msgid ""
73
+ "You can choose manually and use : <?php echo cwppos_show_review('postid'); "
74
+ "?> or you can get the Product in post add-on and use :[P_REVIEW "
75
+ "post_id=3067 visual='full']"
76
+ msgstr ""
77
+
78
+ #: includes/admin/class-wppr-global-settings.php:76
79
+ msgid "Before content"
80
+ msgstr ""
81
+
82
+ #: includes/admin/class-wppr-global-settings.php:77
83
+ msgid "After content"
84
+ msgstr ""
85
+
86
+ #: includes/admin/class-wppr-global-settings.php:78
87
+ msgid "Manually placed"
88
+ msgstr ""
89
+
90
+ #: includes/admin/class-wppr-global-settings.php:84
91
+ msgid "Show review comment"
92
+ msgstr ""
93
+
94
+ #: includes/admin/class-wppr-global-settings.php:85
95
+ msgid "Activate comment review user"
96
+ msgstr ""
97
+
98
+ #: includes/admin/class-wppr-global-settings.php:88
99
+ #: includes/admin/class-wppr-global-settings.php:143
100
+ #: includes/admin/class-wppr-global-settings.php:154
101
+ #: includes/admin/class-wppr-global-settings.php:165
102
+ #: includes/admin/layouts/editor-default-tpl.php:28
103
+ msgid "Yes"
104
+ msgstr ""
105
+
106
+ #: includes/admin/class-wppr-global-settings.php:89
107
+ #: includes/admin/class-wppr-global-settings.php:144
108
+ #: includes/admin/class-wppr-global-settings.php:155
109
+ #: includes/admin/class-wppr-global-settings.php:166
110
+ #: includes/admin/layouts/editor-default-tpl.php:40
111
+ msgid "No"
112
+ msgstr ""
113
+
114
+ #: includes/admin/class-wppr-global-settings.php:95
115
+ msgid "Visitor Review Influence"
116
+ msgstr ""
117
+
118
+ #: includes/admin/class-wppr-global-settings.php:96
119
+ msgid "Select how much visitors rating will affect the main one"
120
+ msgstr ""
121
+
122
+ #: includes/admin/class-wppr-global-settings.php:115
123
+ msgid "Number of options/pros/cons"
124
+ msgstr ""
125
+
126
+ #: includes/admin/class-wppr-global-settings.php:116
127
+ msgid "You can select the default number of options / pros/ cons (3-10)"
128
+ msgstr ""
129
+
130
+ #: includes/admin/class-wppr-global-settings.php:132
131
+ msgid "Content width"
132
+ msgstr ""
133
+
134
+ #: includes/admin/class-wppr-global-settings.php:133
135
+ msgid ""
136
+ "Write your content width in pixels in this format : 600 if you want to "
137
+ "limit the review box width."
138
+ msgstr ""
139
+
140
+ #: includes/admin/class-wppr-global-settings.php:139
141
+ msgid "Disable Lighbox images"
142
+ msgstr ""
143
+
144
+ #: includes/admin/class-wppr-global-settings.php:140
145
+ msgid "Disable lightbox effect on product images (increase loading speed)"
146
+ msgstr ""
147
+
148
+ #: includes/admin/class-wppr-global-settings.php:150
149
+ msgid "Disable Font Awesome"
150
+ msgstr ""
151
+
152
+ #: includes/admin/class-wppr-global-settings.php:151
153
+ msgid ""
154
+ "Disable Font Awesome for websites that already are including it (increase "
155
+ "loading speed)"
156
+ msgstr ""
157
+
158
+ #: includes/admin/class-wppr-global-settings.php:161
159
+ msgid "Enable Rich Snippets"
160
+ msgstr ""
161
+
162
+ #: includes/admin/class-wppr-global-settings.php:162
163
+ msgid "Enable rich snippets on the product page."
164
+ msgstr ""
165
+
166
+ #: includes/admin/class-wppr-global-settings.php:174
167
+ msgid "Rating options default color"
168
+ msgstr ""
169
+
170
+ #: includes/admin/class-wppr-global-settings.php:175
171
+ msgid "Select the color to be used by default on rating."
172
+ msgstr ""
173
+
174
+ #: includes/admin/class-wppr-global-settings.php:181
175
+ msgid "Rating chart default color"
176
+ msgstr ""
177
+
178
+ #: includes/admin/class-wppr-global-settings.php:182
179
+ msgid "Select the color to be used by default on rating chart."
180
+ msgstr ""
181
+
182
+ #: includes/admin/class-wppr-global-settings.php:188
183
+ msgid "Weak rating"
184
+ msgstr ""
185
+
186
+ #: includes/admin/class-wppr-global-settings.php:189
187
+ msgid "Select the color to be used when the rating is weak. ( < 2.5)"
188
+ msgstr ""
189
+
190
+ #: includes/admin/class-wppr-global-settings.php:195
191
+ msgid "Not bad rating"
192
+ msgstr ""
193
+
194
+ #: includes/admin/class-wppr-global-settings.php:196
195
+ msgid "Select the color to be used when the rating is not bad. ( > 2.5 and < 5)"
196
+ msgstr ""
197
+
198
+ #: includes/admin/class-wppr-global-settings.php:202
199
+ msgid "Good rating"
200
+ msgstr ""
201
+
202
+ #: includes/admin/class-wppr-global-settings.php:203
203
+ msgid "Select the color to be used when the rating is good. ( >5 and <7.5)"
204
+ msgstr ""
205
+
206
+ #: includes/admin/class-wppr-global-settings.php:209
207
+ msgid "Very good rating"
208
+ msgstr ""
209
+
210
+ #: includes/admin/class-wppr-global-settings.php:210
211
+ msgid "Select the color to be used when the rating is very good. ( 7.5 < and <10)"
212
+ msgstr ""
213
+
214
+ #: includes/admin/class-wppr-global-settings.php:219
215
+ msgid "Font color"
216
+ msgstr ""
217
+
218
+ #: includes/admin/class-wppr-global-settings.php:220
219
+ msgid "Select the color to be used on the font."
220
+ msgstr ""
221
+
222
+ #: includes/admin/class-wppr-global-settings.php:226
223
+ msgid "Pros text color"
224
+ msgstr ""
225
+
226
+ #: includes/admin/class-wppr-global-settings.php:227
227
+ msgid "Select the color to be used on the 'Pros' text."
228
+ msgstr ""
229
+
230
+ #: includes/admin/class-wppr-global-settings.php:233
231
+ msgid "Cons text color"
232
+ msgstr ""
233
+
234
+ #: includes/admin/class-wppr-global-settings.php:234
235
+ msgid "Select the color to be used on the Cons text."
236
+ msgstr ""
237
+
238
+ #: includes/admin/class-wppr-global-settings.php:240
239
+ msgid "Pros text"
240
+ msgstr ""
241
+
242
+ #: includes/admin/class-wppr-global-settings.php:241
243
+ msgid "Specify text for pros heading"
244
+ msgstr ""
245
+
246
+ #: includes/admin/class-wppr-global-settings.php:247
247
+ msgid "Cons text"
248
+ msgstr ""
249
+
250
+ #: includes/admin/class-wppr-global-settings.php:248
251
+ msgid "Specify text for cons heading"
252
+ msgstr ""
253
+
254
+ #: includes/admin/class-wppr-global-settings.php:254
255
+ msgid "Review box border"
256
+ msgstr ""
257
+
258
+ #: includes/admin/class-wppr-global-settings.php:255
259
+ msgid "Select the border color to be used on the review box"
260
+ msgstr ""
261
+
262
+ #: includes/admin/class-wppr-global-settings.php:261
263
+ msgid "Review box border width"
264
+ msgstr ""
265
+
266
+ #: includes/admin/class-wppr-global-settings.php:262
267
+ msgid "Select the width in pixels of the top border of the review box"
268
+ msgstr ""
269
+
270
+ #: includes/admin/class-wppr-global-settings.php:270
271
+ msgid "Show button icon"
272
+ msgstr ""
273
+
274
+ #: includes/admin/class-wppr-global-settings.php:271
275
+ msgid "Show icon on the cart icon on button."
276
+ msgstr ""
277
+
278
+ #: includes/admin/class-wppr-global-settings.php:281
279
+ msgid "Button border"
280
+ msgstr ""
281
+
282
+ #: includes/admin/class-wppr-global-settings.php:282
283
+ msgid "Select the border color to be used on the buy button for the default state"
284
+ msgstr ""
285
+
286
+ #: includes/admin/class-wppr-global-settings.php:288
287
+ msgid "Button border hover"
288
+ msgstr ""
289
+
290
+ #: includes/admin/class-wppr-global-settings.php:289
291
+ msgid "Select the border color to be used on the buy button for the hover state"
292
+ msgstr ""
293
+
294
+ #: includes/admin/class-wppr-global-settings.php:295
295
+ msgid "Button background"
296
+ msgstr ""
297
+
298
+ #: includes/admin/class-wppr-global-settings.php:296
299
+ msgid ""
300
+ "Select the background color to be used on the buy button for the default "
301
+ "state"
302
+ msgstr ""
303
+
304
+ #: includes/admin/class-wppr-global-settings.php:302
305
+ msgid "Button background hover"
306
+ msgstr ""
307
+
308
+ #: includes/admin/class-wppr-global-settings.php:303
309
+ msgid ""
310
+ "Select the background color to be used on the buy button for the hover "
311
+ "state"
312
+ msgstr ""
313
+
314
+ #: includes/admin/class-wppr-global-settings.php:309
315
+ msgid "Button text color"
316
+ msgstr ""
317
+
318
+ #: includes/admin/class-wppr-global-settings.php:310
319
+ msgid "Select the text color to be used on the buy button for the default state"
320
+ msgstr ""
321
+
322
+ #: includes/admin/class-wppr-global-settings.php:316
323
+ msgid "Button text color hover"
324
+ msgstr ""
325
+
326
+ #: includes/admin/class-wppr-global-settings.php:317
327
+ msgid "Select the text color to be used on the buy button for the hover state"
328
+ msgstr ""
329
+
330
+ #: includes/admin/helpers/class-wppr-html-fields.php:122
331
+ msgid "Choose image"
332
+ msgstr ""
333
+
334
+ #: includes/admin/helpers/class-wppr-html-fields.php:220
335
+ msgid ". Use Default Styling"
336
+ msgstr ""
337
+
338
+ #: includes/admin/helpers/class-wppr-html-fields.php:223
339
+ msgid "* Currently set to the default styling"
340
+ msgstr ""
341
+
342
+ #: includes/admin/helpers/class-wppr-html-fields.php:234
343
+ msgid ""
344
+ "You need the PRO <a style=\"color:red;\" href=\"http://bit.ly/2bhylar\" "
345
+ "target=\"_blank\" >add-on</a> in order to change the review icons."
346
+ msgstr ""
347
+
348
+ #: includes/admin/layouts/editor-default-tpl.php:16
349
+ msgid "Is this a review post ?"
350
+ msgstr ""
351
+
352
+ #: includes/admin/layouts/editor-default-tpl.php:47
353
+ msgid "Product Details"
354
+ msgstr ""
355
+
356
+ #: includes/admin/layouts/editor-default-tpl.php:48
357
+ msgid "Specify the general details for the reviewed product."
358
+ msgstr ""
359
+
360
+ #: includes/admin/layouts/editor-default-tpl.php:53
361
+ msgid "Product Name"
362
+ msgstr ""
363
+
364
+ #: includes/admin/layouts/editor-default-tpl.php:59
365
+ msgid "Product name"
366
+ msgstr ""
367
+
368
+ #: includes/admin/layouts/editor-default-tpl.php:65
369
+ msgid "Product Image"
370
+ msgstr ""
371
+
372
+ #: includes/admin/layouts/editor-default-tpl.php:71
373
+ msgid "Choose or Upload an Image"
374
+ msgstr ""
375
+
376
+ #: includes/admin/layouts/editor-default-tpl.php:76
377
+ msgid "If no image is provided, featured image is used"
378
+ msgstr ""
379
+
380
+ #: includes/admin/layouts/editor-default-tpl.php:79
381
+ msgid "Product Image Click"
382
+ msgstr ""
383
+
384
+ #: includes/admin/layouts/editor-default-tpl.php:92
385
+ msgid "Show Whole Image"
386
+ msgstr ""
387
+
388
+ #: includes/admin/layouts/editor-default-tpl.php:104
389
+ msgid "Open Affiliate link"
390
+ msgstr ""
391
+
392
+ #: includes/admin/layouts/editor-default-tpl.php:111
393
+ #: includes/admin/layouts/editor-default-tpl.php:117
394
+ #: includes/admin/layouts/editor-default-tpl.php:141
395
+ #: includes/admin/layouts/editor-default-tpl.php:147
396
+ #: includes/admin/layouts/editor-default-tpl.php:175
397
+ #: includes/admin/layouts/editor-default-tpl.php:181
398
+ msgid "Affiliate Button Text"
399
+ msgstr ""
400
+
401
+ #: includes/admin/layouts/editor-default-tpl.php:123
402
+ #: includes/admin/layouts/editor-default-tpl.php:129
403
+ #: includes/admin/layouts/editor-default-tpl.php:153
404
+ #: includes/admin/layouts/editor-default-tpl.php:159
405
+ #: includes/admin/layouts/editor-default-tpl.php:187
406
+ #: includes/admin/layouts/editor-default-tpl.php:193
407
+ msgid "Affiliate Link"
408
+ msgstr ""
409
+
410
+ #: includes/admin/layouts/editor-default-tpl.php:135
411
+ msgid "Add new link"
412
+ msgstr ""
413
+
414
+ #: includes/admin/layouts/editor-default-tpl.php:207
415
+ #: includes/admin/layouts/editor-default-tpl.php:213
416
+ msgid "Product Price"
417
+ msgstr ""
418
+
419
+ #: includes/admin/layouts/editor-default-tpl.php:224
420
+ msgid "Product Options"
421
+ msgstr ""
422
+
423
+ #: includes/admin/layouts/editor-default-tpl.php:225
424
+ msgid "Insert your options and their grades. Grading must be done from 0 to 100."
425
+ msgstr ""
426
+
427
+ #: includes/admin/layouts/editor-default-tpl.php:230
428
+ msgid "Preload Info"
429
+ msgstr ""
430
+
431
+ #: includes/admin/layouts/editor-default-tpl.php:233
432
+ msgid ""
433
+ " In order to be able to automatically load your options from another posts, "
434
+ "you need the "
435
+ msgstr ""
436
+
437
+ #: includes/admin/layouts/editor-default-tpl.php:233
438
+ msgid "PRO add-on"
439
+ msgstr ""
440
+
441
+ #: includes/admin/layouts/editor-default-tpl.php:253
442
+ #: includes/admin/layouts/editor-default-tpl.php:295
443
+ #: includes/admin/layouts/editor-default-tpl.php:326
444
+ msgid "Option"
445
+ msgstr ""
446
+
447
+ #: includes/admin/layouts/editor-default-tpl.php:262
448
+ msgid "Grade"
449
+ msgstr ""
450
+
451
+ #: includes/admin/layouts/editor-default-tpl.php:276
452
+ msgid "Pro Features"
453
+ msgstr ""
454
+
455
+ #: includes/admin/layouts/editor-default-tpl.php:277
456
+ msgid "Insert product's pro features below."
457
+ msgstr ""
458
+
459
+ #: includes/admin/layouts/editor-default-tpl.php:308
460
+ msgid "Cons Features"
461
+ msgstr ""
462
+
463
+ #: includes/admin/layouts/editor-default-tpl.php:309
464
+ msgid "Insert product's cons features below."
465
+ msgstr ""
466
+
467
+ #: includes/admin/layouts/settings-tpl.php:57
468
+ msgid "Save All Changes"
469
+ msgstr ""
470
+
471
+ #: includes/admin/layouts/widget-admin-tpl.php:15
472
+ msgid "Title:"
473
+ msgstr ""
474
+
475
+ #: includes/admin/layouts/widget-admin-tpl.php:19
476
+ msgid "Number of posts to show:"
477
+ msgstr ""
478
+
479
+ #: includes/admin/layouts/widget-admin-tpl.php:24
480
+ msgid "Category:"
481
+ msgstr ""
482
+
483
+ #: includes/admin/layouts/widget-admin-tpl.php:40
484
+ msgid "Layout:"
485
+ msgstr ""
486
+
487
+ #: includes/admin/layouts/widget-admin-tpl.php:64
488
+ msgid "Buy Now text:"
489
+ msgstr ""
490
+
491
+ #: includes/admin/layouts/widget-admin-tpl.php:69
492
+ msgid "Read Review text:"
493
+ msgstr ""
494
+
495
+ #: includes/admin/layouts/widget-admin-tpl.php:73
496
+ msgid "Display Product Titles :"
497
+ msgstr ""
498
+
499
+ #: includes/admin/layouts/widget-admin-tpl.php:77
500
+ msgid "Display Product Image :"
501
+ msgstr ""
502
+
503
+ #: includes/admin/widgets/abstract/class-wppr-widget-abstract.php:55
504
+ #: includes/admin/widgets/abstract/class-wppr-widget-abstract.php:94
505
+ msgid "Buy Now"
506
+ msgstr ""
507
+
508
+ #: includes/admin/widgets/abstract/class-wppr-widget-abstract.php:56
509
+ #: includes/admin/widgets/abstract/class-wppr-widget-abstract.php:98
510
+ msgid "Read Review"
511
+ msgstr ""
512
+
513
+ #: includes/admin/widgets/abstract/class-wppr-widget-abstract.php:74
514
+ #: includes/admin/widgets/class-wppr-latest-products-widget.php:121
515
+ msgid "Latest Products"
516
+ msgstr ""
517
+
518
+ #: includes/admin/widgets/class-wppr-latest-products-widget.php:26
519
+ msgid "CWP Latest Products Widget"
520
+ msgstr ""
521
+
522
+ #: includes/admin/widgets/class-wppr-latest-products-widget.php:28
523
+ msgid "This widget displays the latest products based on their rating."
524
+ msgstr ""
525
+
526
+ #: includes/admin/widgets/class-wppr-top-products-widget.php:26
527
+ msgid "CWP Top Products Widget"
528
+ msgstr ""
529
+
530
+ #: includes/admin/widgets/class-wppr-top-products-widget.php:28
531
+ msgid "This widget displays the top products based on their rating."
532
+ msgstr ""
533
+
534
+ #: includes/admin/widgets/class-wppr-top-products-widget.php:133
535
+ msgid "Top Products"
536
+ msgstr ""
537
+
538
+ #. Plugin Name of the plugin/theme
539
+ msgid "WP Product Review Lite"
540
+ msgstr ""
541
+
542
+ #. Plugin URI of the plugin/theme
543
+ msgid "https://themeisle.com/plugins/wp-product-review/"
544
+ msgstr ""
545
+
546
+ #. Description of the plugin/theme
547
+ msgid ""
548
+ "The highest rated and most complete review plugin, now with rich snippets "
549
+ "support. Easily turn your basic posts into in-depth reviews."
550
+ msgstr ""
551
+
552
+ #. Author of the plugin/theme
553
+ msgid "ThemeIsle"
554
+ msgstr ""
555
+
556
+ #. Author URI of the plugin/theme
557
+ msgid "https://themeisle.com/"
558
+ msgstr ""
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: codeinwp,marius2012,marius_codeinwp,hardeepasrani,themeisle,Madali
3
  Tags: review, rating, posts, widget, review blogger, review blogging, affiliate, product reviews,plugin, google rating, product review, rating, review, star rating, user rating, wp rating, wp review, google, hreview,rich snippets,seo,snippet
4
  Author URI: http://themeisle.com
5
  Requires at least: 3.5
6
- Tested up to: 4.6.1
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,30 +12,6 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  Easily turn your basic posts into in-depth reviews with ratings, pros and cons, affiliate links, rich snippets and user reviews.
13
  == Description ==
14
 
15
-
16
- > > If you want to see a live demo of the review plugin + rich snippets you can check <a href="http://demo.themeisle.com/parallax-one/wp-product-review/">http://demo.themeisle.com/parallax-one/wp-product-review/</a>.
17
-
18
-
19
- ### Why to get the PRO add-ons ?
20
-
21
- Using the add-ons you will unleash the most important functionality : SHORTCODE . Using something like : [P_REVIEW post_id=3067 visual='full'] you are able to display the review box anywhere in the post, or you can even display 5 boxes in the same page (different products).
22
-
23
- Other notable features :
24
-
25
- * Custom Review Icons
26
- * Preloader functionality
27
- * Unlimited Options
28
- * PROs/ Cons
29
-
30
- ### Knowledgebase
31
-
32
- 1. How to change the html format of the review name -> http://docs.themeisle.com/article/130-how-to-change-the-html-format-of-the-review-name
33
- 2. How to change dynamically the name of the review -> http://docs.themeisle.com/article/131-how-to-change-dynamically-the-name-of-the-review
34
- 3. How to change dynamically the option name format -> http://docs.themeisle.com/article/132-how-to-change-dynamically-the-option-name-format
35
- 4. How to change dynamically the pros/cons heading text -> http://docs.themeisle.com/article/133-how-to-change-dynamically-the-pros-cons-heading-text
36
- 5. How to change dynamically the image size for review -> http://docs.themeisle.com/article/135-how-to-change-dynamically-the-image-size-for-review
37
-
38
-
39
  ### User Review Enabled
40
 
41
  1. This review plugin helps you to interact with your users with improved comments, you can expose your reviews in a easier to read way and will help you generate money by adding a buy now button in your post. Rich snippets are also supported.
@@ -48,12 +24,32 @@ Other notable features :
48
 
49
  1. For updates follow https://twitter.com/themeisle.
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  If you wanna learn more about the <a href="http://www.codeinwp.com/blog/fastest-wordpress-hosting/" rel="nofollow">fastest WordPress hosting</a> or which <a href="http://www.codeinwp.com/blog/15-best-wordpress-review-themes/" rel="nofollow">review themes</a> are playing nice with WP Product review, checkout our blog.
52
 
 
 
 
 
 
 
 
 
 
53
 
54
- **Fortcoming**
55
 
56
- - Direct amazon integration
57
 
58
 
59
  **WP Product Review provides following features**
@@ -71,6 +67,13 @@ If you wanna learn more about the <a href="http://www.codeinwp.com/blog/fastest-
71
  * fr_FR translation by Jacques Soule of http://wordpress-pour-vous.com/
72
 
73
  == Changelog ==
 
 
 
 
 
 
 
74
 
75
  **New in 2.9.8**
76
 
@@ -317,13 +320,48 @@ Alternatively you can also follow the following steps to install the WP Product
317
 
318
  == Frequently Asked Questions ==
319
 
320
- 1. How to activate user reviews ?
 
 
 
321
 
322
  By default user reviews are disabled since not all the themes are compatible with this option due to different designs for the comment box. You can easily activate them from General Settings
323
 
324
  If you have any questions please get in touch with us at,
325
  https://themeisle.com/contact
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  == Screenshots ==
328
 
329
  1. Screenshot 1 Wrap-up review widget that is added at the end of the posts
@@ -334,3 +372,5 @@ https://themeisle.com/contact
334
  for more you can check out
335
 
336
  https://themeisle.com/plugins/wp-product-review-lite/
 
 
3
  Tags: review, rating, posts, widget, review blogger, review blogging, affiliate, product reviews,plugin, google rating, product review, rating, review, star rating, user rating, wp rating, wp review, google, hreview,rich snippets,seo,snippet
4
  Author URI: http://themeisle.com
5
  Requires at least: 3.5
6
+ Tested up to: 4.8
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  Easily turn your basic posts into in-depth reviews with ratings, pros and cons, affiliate links, rich snippets and user reviews.
13
  == Description ==
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ### User Review Enabled
16
 
17
  1. This review plugin helps you to interact with your users with improved comments, you can expose your reviews in a easier to read way and will help you generate money by adding a buy now button in your post. Rich snippets are also supported.
24
 
25
  1. For updates follow https://twitter.com/themeisle.
26
 
27
+ > **Time-saving features available in the Pro version:**
28
+ >
29
+ > * Shortcodes
30
+ > * Custom Rating Icons
31
+ > * Product Review Listings
32
+ > * Comparison Table
33
+ > * Amazon Integration
34
+ > * Priority email support from the developer of the plugin
35
+ > * Support and updates for 12 months
36
+ >
37
+ > **[Learn more about WP Product Review](http://themeisle.com/plugins/wp-product-review/)**
38
+
39
+
40
  If you wanna learn more about the <a href="http://www.codeinwp.com/blog/fastest-wordpress-hosting/" rel="nofollow">fastest WordPress hosting</a> or which <a href="http://www.codeinwp.com/blog/15-best-wordpress-review-themes/" rel="nofollow">review themes</a> are playing nice with WP Product review, checkout our blog.
41
 
42
+ = See how WP Product Review can integrate with your website =
43
+
44
+ * [Default review](https://demo.themeisle.com/wp-product-review/sample-review/)
45
+ * [Custom icons ratings](https://demo.themeisle.com/wp-product-review/custom-icons/)
46
+ * [Comparision table](https://demo.themeisle.com/wp-product-review/comparison-table/)
47
+ * [Shortcode reviews](https://demo.themeisle.com/wp-product-review/shortcode-review/)
48
+ * [Listing table](https://demo.themeisle.com/wp-product-review/listing-table/)
49
+ * [Reviews by visitors](https://demo.themeisle.com/wp-product-review/review-with-comments/)
50
+
51
 
 
52
 
 
53
 
54
 
55
  **WP Product Review provides following features**
67
  * fr_FR translation by Jacques Soule of http://wordpress-pour-vous.com/
68
 
69
  == Changelog ==
70
+ = 3.0.0 - 2017-08-23 =
71
+
72
+ * Major code refactor ( Please test before update )
73
+ * Added JSON-LD support
74
+ * Improved compatibility with themes
75
+
76
+
77
 
78
  **New in 2.9.8**
79
 
320
 
321
  == Frequently Asked Questions ==
322
 
323
+ == Frequently Asked Questions ==
324
+
325
+
326
+ = How to activate user reviews =
327
 
328
  By default user reviews are disabled since not all the themes are compatible with this option due to different designs for the comment box. You can easily activate them from General Settings
329
 
330
  If you have any questions please get in touch with us at,
331
  https://themeisle.com/contact
332
 
333
+ = How to change the html format of the review name =
334
+ [http://docs.themeisle.com/article/130-how-to-change-the-html-format-of-the-review-name](http://docs.themeisle.com/article/130-how-to-change-the-html-format-of-the-review-name)
335
+
336
+ = How to change dynamically the image size for review =
337
+ [http://docs.themeisle.com/article/135-how-to-change-dynamically-the-image-size-for-review](http://docs.themeisle.com/article/135-how-to-change-dynamically-the-image-size-for-review)
338
+
339
+ = How to change dynamically the pros/cons heading text =
340
+ [http://docs.themeisle.com/article/133-how-to-change-dynamically-the-pros-cons-heading-text](http://docs.themeisle.com/article/133-how-to-change-dynamically-the-pros-cons-heading-text)
341
+
342
+ = How to change dynamically the name of the review =
343
+ [http://docs.themeisle.com/article/131-how-to-change-dynamically-the-name-of-the-review](http://docs.themeisle.com/article/131-how-to-change-dynamically-the-name-of-the-review)
344
+
345
+ = How to change dynamically the option name format =
346
+ [http://docs.themeisle.com/article/132-how-to-change-dynamically-the-option-name-format](http://docs.themeisle.com/article/132-how-to-change-dynamically-the-option-name-format)
347
+
348
+ = How to make Comment Review option work in any theme =
349
+ [http://docs.themeisle.com/article/54-why-comment-review-option-is-not-working-with-my-theme](http://docs.themeisle.com/article/54-why-comment-review-option-is-not-working-with-my-theme)
350
+
351
+ = How to fix the review boxes issue =
352
+ [http://docs.themeisle.com/article/210-how-to-fix-the-review-boxes-issue](http://docs.themeisle.com/article/210-how-to-fix-the-review-boxes-issue)
353
+
354
+ = Price in WP Product Review is messed up =
355
+ [http://docs.themeisle.com/article/216-price-in-wp-product-review-is-messed-up](http://docs.themeisle.com/article/216-price-in-wp-product-review-is-messed-up)
356
+
357
+ = Prevent users from posting multiple review on a single post in WP Product Review =
358
+ [http://docs.themeisle.com/article/578-prevent-users-from-posting-multiple-review-on-a-single-post-in-wp-product-review](http://docs.themeisle.com/article/578-prevent-users-from-posting-multiple-review-on-a-single-post-in-wp-product-review)
359
+
360
+ == Upgrade Notice ==
361
+
362
+ = 3.0 =
363
+ 3.0 is a major update. It is important that you make backups and ensure themes are 3.0 compatible before upgrading.
364
+
365
  == Screenshots ==
366
 
367
  1. Screenshot 1 Wrap-up review widget that is added at the end of the posts
372
  for more you can check out
373
 
374
  https://themeisle.com/plugins/wp-product-review-lite/
375
+
376
+
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.png DELETED
Binary file
uninstall.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fired when the plugin is uninstalled.
4
+ *
5
+ * When populating this file, consider the following flow
6
+ * of control:
7
+ *
8
+ * - This method should be static
9
+ * - Check if the $_REQUEST content actually is the plugin name
10
+ * - Run an admin referrer check to make sure it goes through authentication
11
+ * - Verify the output of $_GET makes sense
12
+ * - Repeat with other user roles. Best directly by using the links/query string parameters.
13
+ * - Repeat things for multisite. Once for a single site in the network, once sitewide.
14
+ *
15
+ * This file may be updated more in future version of the Boilerplate; however, this is the
16
+ * general skeleton and outline for how the file should work.
17
+ *
18
+ * For more information, see the following discussion:
19
+ * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
20
+ *
21
+ * @link https://themeisle.com/
22
+ * @since 1.0.0
23
+ *
24
+ * @package Wppr
25
+ */
26
+
27
+ // If uninstall not called from WordPress, then exit.
28
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
29
+ exit;
30
+ }
vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer' . '/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInite6913fb43af06d5102ae810f141aed23::getLoader();
vendor/autoload_52.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_52.php generated by xrstf/composer-php52
4
+
5
+ require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
+
7
+ return ComposerAutoloaderInite64e7691549e1caf8ed453d37599105f::getLoader();
vendor/codeinwp/themeisle-sdk/LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ {one line to give the program's name and a brief idea of what it does.}
635
+ Copyright (C) {year} {name of author}
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ {project} Copyright (C) {year} {fullname}
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-deactivate.php ADDED
@@ -0,0 +1,470 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The deactivate feedback model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
16
+ /**
17
+ * Deactivate feedback model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Feedback_Deactivate extends ThemeIsle_SDK_Feedback {
20
+
21
+ /**
22
+ * @var array $options_plugin The main options list for plugins.
23
+ */
24
+ private $options_plugin = array(
25
+ 'I only needed the plugin for a short period' => array(
26
+ 'id' => 1,
27
+ ),
28
+ 'The plugin broke my site' => array(
29
+ 'id' => 2,
30
+ ),
31
+ 'I found a better plugin' => array(
32
+ 'id' => 3,
33
+ 'type' => 'text',
34
+ 'placeholder' => 'What\'s the plugin\'s name?',
35
+ ),
36
+ 'The plugin suddenly stopped working' => array(
37
+ 'id' => 4,
38
+ ),
39
+ 'I no longer need the plugin' => array(
40
+ 'id' => 5,
41
+ 'type' => 'textarea',
42
+ 'placeholder' => 'If you could improve one thing about our product, what would it be?',
43
+ ),
44
+ 'It\'s a temporary deactivation. I\'m just debugging an issue.' => array(
45
+ 'id' => 6,
46
+ ),
47
+ );
48
+
49
+ /**
50
+ * @var array $options_theme The main options list for themes.
51
+ */
52
+ private $options_theme = array(
53
+ 'I don\'t know how to make it look like demo' => array(
54
+ 'id' => 7,
55
+ ),
56
+ 'It lacks options' => array(
57
+ 'id' => 8,
58
+ ),
59
+ 'Is not working with a plugin that I need' => array(
60
+ 'id' => 9,
61
+ 'type' => 'text',
62
+ 'placeholder' => 'What is the name of the plugin',
63
+ ),
64
+ 'I want to try a new design, I don\'t like {theme} style' => array(
65
+ 'id' => 10,
66
+ ),
67
+ );
68
+
69
+ /**
70
+ * @var array $other The other option
71
+ */
72
+ private $other = array(
73
+ 'Other' => array(
74
+ 'id' => 999,
75
+ 'type' => 'textarea',
76
+ 'placeholder' => 'cmon cmon tell us',
77
+ ),
78
+ );
79
+
80
+ /**
81
+ * @var string $heading_plugin The heading of the modal
82
+ */
83
+ private $heading_plugin = 'If you have a moment, please let us know why you are deactivating:';
84
+
85
+ /**
86
+ * @var string $heading_theme The heading of the modal
87
+ */
88
+ private $heading_theme = 'Looking to change {theme}, what doesn\'t work for you?';
89
+
90
+ /**
91
+ * @var string $button_submit_before The text of the deactivate button before an option is chosen
92
+ */
93
+ private $button_submit_before = 'Skip &amp; Deactivate';
94
+
95
+ /**
96
+ * @var string $button_submit The text of the deactivate button
97
+ */
98
+ private $button_submit = 'Submit &amp; Deactivate';
99
+
100
+ /**
101
+ * @var string $button_cancel The text of the cancel button
102
+ */
103
+ private $button_cancel = 'Cancel';
104
+
105
+ /**
106
+ * @var int how many seconds before the deactivation window is triggered for themes
107
+ */
108
+ const AUTO_TRIGGER_DEACTIVATE_WINDOW_SECONDS = 3;
109
+
110
+ /**
111
+ * @var int how many days before the deactivation window pops up again for the theme
112
+ */
113
+ const PAUSE_DEACTIVATE_WINDOW_DAYS = 100;
114
+
115
+ /**
116
+ * ThemeIsle_SDK_Feedback_Deactivate constructor.
117
+ *
118
+ * @param ThemeIsle_SDK_Product $product_object The product object.
119
+ */
120
+ public function __construct( $product_object ) {
121
+ parent::__construct( $product_object );
122
+ }
123
+
124
+ /**
125
+ * Registers the hooks
126
+ */
127
+ public function setup_hooks_child() {
128
+ global $pagenow;
129
+
130
+ if ( ( $this->product->get_type() === 'plugin' && $pagenow === 'plugins.php' ) || ( $this->product->get_type() === 'theme' && $pagenow === 'theme-install.php' ) ) {
131
+ add_action( 'admin_head', array( $this, 'load_resources' ) );
132
+ }
133
+ add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'post_deactivate' ) );
134
+ }
135
+
136
+ /**
137
+ * Loads the additional resources
138
+ */
139
+ function load_resources() {
140
+ add_thickbox();
141
+
142
+ $id = $this->product->get_key() . '_deactivate';
143
+
144
+ $this->add_css( $this->product->get_type(), $this->product->get_key() );
145
+ $this->add_js( $this->product->get_type(), $this->product->get_key(), '#TB_inline?' . apply_filters( $this->product->get_key() . '_feedback_deactivate_attributes', 'width=600&height=550' ) . '&inlineId=' . $id );
146
+
147
+ echo '<div id="' . $id . '" style="display:none;" class="themeisle-deactivate-box">' . $this->get_html( $this->product->get_type(), $this->product->get_key() ) . '</div>';
148
+ }
149
+
150
+ /**
151
+ * Loads the css
152
+ *
153
+ * @param string $type The type of product.
154
+ * @param string $key The product key.
155
+ */
156
+ function add_css( $type, $key ) {
157
+ $suffix = 'theme' === $type ? 'theme-install-php' : 'plugins-php';
158
+ ?>
159
+ <style type="text/css" id="<?php echo $key; ?>ti-deactivate-css">
160
+ input[name="ti-deactivate-option"] ~ div {
161
+ display: none;
162
+ }
163
+
164
+ input[name="ti-deactivate-option"]:checked ~ div {
165
+ display: block;
166
+ }
167
+
168
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_window.thickbox-loading:before {
169
+ background: none !important;
170
+ }
171
+
172
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_title {
173
+ font-size: 21px;
174
+ padding: 20px 0;
175
+ background-color: #f3f3f3;
176
+ }
177
+
178
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container div.actions {
179
+ padding: 20px 0;
180
+ background-color: #f3f3f3;
181
+ border-top: 1px solid #dddddd;
182
+ }
183
+
184
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container input.button.button-primary {
185
+ margin-right: 20px;
186
+ }
187
+
188
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container input.button {
189
+ margin-right: 20px;
190
+ }
191
+
192
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_ajaxWindowTitle {
193
+ text-align: left;
194
+ margin-left: 15px;
195
+ }
196
+
197
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container div.revive_network-container {
198
+ background-color: #ffffff;
199
+ }
200
+
201
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li {
202
+ font-size: 14px;
203
+ }
204
+
205
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li label {
206
+ margin-left: 10px;
207
+ line-height: 32px;
208
+ font-size: 16px;
209
+ }
210
+
211
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_ajaxContent {
212
+ padding: 10px 20px;
213
+ }
214
+
215
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container li div textarea {
216
+ padding: 10px 15px;
217
+ width: 100%;
218
+ }
219
+
220
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li div {
221
+ margin: 10px 30px;
222
+ }
223
+
224
+ .<?php echo $key; ?>-container #TB_title #TB_ajaxWindowTitle {
225
+ display: block;
226
+ }
227
+
228
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container .actions {
229
+
230
+ width: 100%;
231
+ display: block;
232
+ position: absolute;
233
+ left: 0px;
234
+ bottom: 0px;
235
+ text-align: right;
236
+ }
237
+
238
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_title {
239
+
240
+ height: 33px;
241
+ width: 100%;
242
+ text-align: center;
243
+ }
244
+
245
+ .theme-install-php .<?php echo $key; ?>-container #TB_closeWindowButton .tb-close-icon:before {
246
+ font-size: 32px;
247
+ }
248
+
249
+ .<?php echo $key; ?>-container #TB_closeWindowButton .tb-close-icon {
250
+
251
+ color: #eee;
252
+ }
253
+
254
+ .<?php echo $key; ?>-container #TB_closeWindowButton {
255
+ left: auto;
256
+ right: -30px;
257
+ color: #eee;
258
+ }
259
+
260
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container {
261
+
262
+ margin: auto !important;
263
+ height: 550px !important;
264
+ top: 0 !important;
265
+ left: 0 !important;
266
+ bottom: 0 !important;
267
+ right: 0 !important;
268
+ }
269
+ </style>
270
+ <?php
271
+ }
272
+
273
+ /**
274
+ * Loads the js
275
+ *
276
+ * @param string $type The type of product.
277
+ * @param string $key The product key.
278
+ * @param string $src The url that will hijack the deactivate button url.
279
+ */
280
+ function add_js( $type, $key, $src ) {
281
+ $heading = 'plugin' === $type ? $this->heading_plugin : str_replace( '{theme}', $this->product->get_name(), $this->heading_theme );
282
+ $heading = apply_filters( $this->product->get_key() . '_feedback_deactivate_heading', $heading );
283
+ ?>
284
+ <script type="text/javascript" id="ti-deactivate-js">
285
+ (function ($) {
286
+ $(document).ready(function () {
287
+ var auto_trigger = false;
288
+ var target_element = 'tr[data-plugin^="<?php echo $this->product->get_slug(); ?>/"] span.deactivate a';
289
+ <?php
290
+ if ( 'theme' === $type ) {
291
+ ?>
292
+ auto_trigger = true;
293
+ if ($('a.ti-auto-anchor').length == 0) {
294
+ $('body').append($('<a class="ti-auto-anchor" href=""></a>'));
295
+ }
296
+ target_element = 'a.ti-auto-anchor';
297
+ <?php
298
+ }
299
+ ?>
300
+
301
+ if (auto_trigger) {
302
+ setTimeout(function () {
303
+ $('a.ti-auto-anchor').trigger('click');
304
+ }, <?php echo self::AUTO_TRIGGER_DEACTIVATE_WINDOW_SECONDS * 1000; ?> );
305
+ }
306
+ $( document ).on( 'thickbox:removed', function() {
307
+ $.ajax({
308
+ url: ajaxurl,
309
+ method: 'post',
310
+ data: {
311
+ 'action' : '<?php echo $key . __CLASS__; ?>',
312
+ 'nonce' : '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
313
+ 'type' : '<?php echo $type; ?>',
314
+ 'key' : '<?php echo $key; ?>'
315
+ },
316
+ });
317
+ });
318
+ var href = $(target_element).attr('href');
319
+ $('#<?php echo $key; ?>ti-deactivate-no').on('click', function (e) {
320
+ e.preventDefault();
321
+ e.stopPropagation();
322
+
323
+ $('body').unbind('thickbox:removed');
324
+ tb_remove();
325
+ });
326
+
327
+ $('#<?php echo $key; ?> ul.ti-list label, #<?php echo $key; ?> ul.ti-list input[name="ti-deactivate-option"]').on('click', function (e) {
328
+ $('#<?php echo $key; ?>ti-deactivate-yes').val($('#<?php echo $key; ?>ti-deactivate-yes').attr('data-after-text'));
329
+
330
+ var radio = $(this).prop('tagName') === 'LABEL' ? $(this).parent() : $(this);
331
+ if (radio.parent().find('textarea').length > 0 && radio.parent().find('textarea').val().length === 0) {
332
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
333
+ radio.parent().find('textarea').on('keyup', function (ee) {
334
+ if ($(this).val().length === 0) {
335
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
336
+ } else {
337
+ $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
338
+ }
339
+ });
340
+ } else {
341
+ $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
342
+ }
343
+ });
344
+
345
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('data-ti-action', href).on('click', function (e) {
346
+ e.preventDefault();
347
+ e.stopPropagation();
348
+ $.ajax({
349
+ url: ajaxurl,
350
+ method: 'post',
351
+ data: {
352
+ 'action' : '<?php echo $key . __CLASS__; ?>',
353
+ 'nonce' : '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
354
+ 'id' : $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().attr('ti-option-id'),
355
+ 'msg' : $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().find('textarea').val(),
356
+ 'type' : '<?php echo $type; ?>',
357
+ 'key' : '<?php echo $key; ?>'
358
+ },
359
+ });
360
+ var redirect = $(this).attr('data-ti-action');
361
+ if (redirect != '') {
362
+ location.href = redirect;
363
+ } else {
364
+ $('body').unbind('thickbox:removed');
365
+ tb_remove();
366
+ }
367
+ });
368
+
369
+ $(target_element).attr('name', '<?php echo esc_html( $heading ); ?>').attr('href', '<?php echo $src; ?>').addClass('thickbox');
370
+ var thicbox_timer;
371
+ $(target_element).on('click', function () {
372
+ tiBindThickbox();
373
+ });
374
+
375
+ function tiBindThickbox() {
376
+ var thicbox_timer = setTimeout(function () {
377
+ if ($("#<?php echo esc_html( $key ); ?>").is(":visible")) {
378
+ $("body").trigger('thickbox:iframe:loaded');
379
+ $("#TB_window").addClass("<?php echo $key; ?>-container");
380
+ clearTimeout(thicbox_timer);
381
+ $('body').unbind('thickbox:removed');
382
+ } else {
383
+ tiBindThickbox();
384
+ }
385
+ }, 100);
386
+ }
387
+ });
388
+ })(jQuery);
389
+ </script>
390
+ <?php
391
+ }
392
+
393
+ /**
394
+ * Generates the HTML
395
+ *
396
+ * @param string $type The type of product.
397
+ * @param string $key The product key.
398
+ */
399
+ function get_html( $type, $key ) {
400
+ $options = 'plugin' === $type ? $this->options_plugin : $this->options_theme;
401
+ $button_submit_before = 'plugin' === $type ? $this->button_submit_before : 'Submit';
402
+ $button_submit = 'plugin' === $type ? $this->button_submit : 'Submit';
403
+ $options = $this->randomize_options( apply_filters( $this->product->get_key() . '_feedback_deactivate_options', $options ) );
404
+ $button_submit_before = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit_before', $button_submit_before );
405
+ $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', $button_submit );
406
+ $button_cancel = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_cancel', $this->button_cancel );
407
+
408
+ $options += $this->other;
409
+
410
+ $list = '';
411
+ foreach ( $options as $title => $attributes ) {
412
+ $id = $attributes['id'];
413
+ $list .= '<li ti-option-id="' . $id . '"><input type="radio" name="ti-deactivate-option" id="' . $key . $id . '"><label for="' . $key . $id . '">' . str_replace( '{theme}', $this->product->get_name(), $title ) . '</label>';
414
+ if ( array_key_exists( 'type', $attributes ) ) {
415
+ $list .= '<div>';
416
+ $placeholder = array_key_exists( 'placeholder', $attributes ) ? $attributes['placeholder'] : '';
417
+ switch ( $attributes['type'] ) {
418
+ case 'text':
419
+ $list .= '<textarea style="width: 100%" rows="1" name="comments" placeholder="' . $placeholder . '"></textarea>';
420
+ break;
421
+ case 'textarea':
422
+ $list .= '<textarea style="width: 100%" rows="2" name="comments" placeholder="' . $placeholder . '"></textarea>';
423
+ break;
424
+ }
425
+ $list .= '</div>';
426
+ }
427
+ $list .= '</li>';
428
+ }
429
+
430
+ return '<div id="' . $this->product->get_key() . '">'
431
+ . '<ul class="ti-list">' . $list . '</ul>'
432
+ . '<div class="actions">'
433
+ . get_submit_button(
434
+ $button_submit_before , 'secondary', $this->product->get_key() . 'ti-deactivate-yes', false, array(
435
+ 'data-after-text' => $button_submit,
436
+ )
437
+ )
438
+ . get_submit_button( $button_cancel, 'primary', $this->product->get_key() . 'ti-deactivate-no', false )
439
+ . '</div></div>';
440
+ }
441
+
442
+ /**
443
+ * Called when the deactivate button is clicked
444
+ */
445
+ function post_deactivate() {
446
+ check_ajax_referer( (string) __CLASS__, 'nonce' );
447
+
448
+ if ( ! empty( $_POST['id'] ) ) {
449
+ $this->call_api(
450
+ array(
451
+ 'type' => 'deactivate',
452
+ 'id' => $_POST['id'],
453
+ 'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
454
+ )
455
+ );
456
+ }
457
+
458
+ $this->post_deactivate_or_cancel();
459
+ }
460
+
461
+ /**
462
+ * Called when the deactivate/cancel button is clicked
463
+ */
464
+ private function post_deactivate_or_cancel() {
465
+ if ( isset( $_POST['type'] ) && isset( $_POST['key'] ) && 'theme' === $_POST['type'] ) {
466
+ set_transient( 'ti_sdk_pause_' . $_POST['key'], true, PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );
467
+ }
468
+ }
469
+ }
470
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-factory.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The feedback factory class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Factory' ) ) :
16
+ /**
17
+ * Feedback model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Feedback_Factory {
20
+
21
+ /**
22
+ * @var array $instances collection of the instances that are registered with the factory
23
+ */
24
+ private $_instances = array();
25
+
26
+ /**
27
+ * ThemeIsle_SDK_Feedback_Factory constructor.
28
+ *
29
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
30
+ * @param array $feedback_types the feedback types.
31
+ */
32
+ public function __construct( $product_object, $feedback_types ) {
33
+ if ( $product_object instanceof ThemeIsle_SDK_Product && $feedback_types && is_array( $feedback_types ) ) {
34
+ foreach ( $feedback_types as $type ) {
35
+ $class = 'ThemeIsle_SDK_Feedback_' . ucwords( $type );
36
+ $instance = new $class( $product_object );
37
+ $this->_instances[ $type ] = $instance;
38
+ $instance->setup_hooks();
39
+ }
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Get the registered instances
45
+ */
46
+ public function get_instances() {
47
+ return $this->_instances;
48
+ }
49
+ }
50
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-review.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The review feedback model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Review' ) ) :
16
+ /**
17
+ * Deactivate feedback model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Feedback_Review extends ThemeIsle_SDK_Feedback {
20
+
21
+ /**
22
+ * @var string $heading The heading of the modal
23
+ */
24
+ private $heading = 'Hey, it’s great to see you have {product} active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers! <br/> <br/>~ {developer}, developer of {product}';
25
+
26
+ /**
27
+ * @var string $button_cancel The text of the cancel button
28
+ */
29
+ private $button_cancel = 'No, thanks.';
30
+ /**
31
+ * @var array Developers who work for each type of product for review purpose.
32
+ */
33
+ private $developers = array(
34
+ 'plugin' => array( 'Marius', 'Bogdan' ),
35
+ 'theme' => array( 'Rodica', 'Andrei', 'Bogdan', 'Cristi' ),
36
+ );
37
+ /**
38
+ * @var string $button_already The text of the already did it button
39
+ */
40
+ private $button_do = 'Ok, I will gladly help.';
41
+
42
+ /**
43
+ * ThemeIsle_SDK_Feedback_Deactivate constructor.
44
+ *
45
+ * @param ThemeIsle_SDK_Product $product_object The product object.
46
+ */
47
+ public function __construct( $product_object ) {
48
+ parent::__construct( $product_object );
49
+ }
50
+
51
+ /**
52
+ * Registers the hooks
53
+ */
54
+ public function setup_hooks_child() {
55
+ add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'dismiss' ) );
56
+ }
57
+
58
+ /**
59
+ * Shows the notification
60
+ */
61
+ function show_notification() {
62
+ if ( ! $this->product->is_wordpress_available() ) {
63
+ $this->disable();
64
+
65
+ return false;
66
+ }
67
+ $show = get_option( $this->product->get_key() . '_review_flag', 'yes' );
68
+ if ( 'no' === $show ) {
69
+ return false;
70
+ }
71
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
72
+
73
+ return true;
74
+ }
75
+
76
+ /**
77
+ * Shows the admin notice
78
+ */
79
+ function admin_notices() {
80
+ $id = $this->product->get_key() . '_review';
81
+
82
+ $this->add_css( $this->product->get_key() );
83
+ $this->add_js( $this->product->get_key() );
84
+
85
+ echo '<div class="notice notice-success is-dismissible" id="' . $id . '" ><div class="themeisle-review-box">' . $this->get_html( $this->product->get_key() ) . '</div></div>';
86
+ }
87
+
88
+ /**
89
+ * Loads the css
90
+ *
91
+ * @param string $key The product key.
92
+ */
93
+ function add_css( $key ) {
94
+ ?>
95
+ <style type="text/css" id="<?php echo $key; ?>ti-review-css">
96
+ #<?php echo $key; ?>-review-notification {
97
+ padding-bottom: 5px;
98
+ }
99
+
100
+ #<?php echo $key; ?>-review-notification .review-dismiss {
101
+ margin-left: 5px;
102
+ }
103
+ </style>
104
+ <?php
105
+ }
106
+
107
+ /**
108
+ * Loads the js
109
+ *
110
+ * @param string $key The product key.
111
+ */
112
+ function add_js( $key ) {
113
+ ?>
114
+ <script type="text/javascript" id="<?php echo $key; ?>ti-review-js">
115
+ (function ($) {
116
+ $(document).ready(function () {
117
+ $('#<?php echo $key; ?>_review').on('click', '.notice-dismiss, .review-dismiss', function (e) {
118
+
119
+ $.ajax({
120
+ url: ajaxurl,
121
+ method: "post",
122
+ data: {
123
+ 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
124
+ 'action': '<?php echo $this->product->get_key() . __CLASS__; ?>'
125
+ },
126
+ success: function () {
127
+ $('#<?php echo $key; ?>_review').hide();
128
+ }
129
+ });
130
+ });
131
+ });
132
+ })(jQuery);
133
+ </script>
134
+ <?php
135
+ }
136
+
137
+ /**
138
+ * Generates the HTML
139
+ *
140
+ * @param string $key The product key.
141
+ */
142
+ function get_html( $key ) {
143
+ $link = 'https://wordpress.org/support/' . $this->product->get_type() . '/' . $this->product->get_slug() . '/reviews/#wporg-footer';
144
+ $heading = apply_filters( $this->product->get_key() . '_feedback_review_heading', $this->heading );
145
+ $heading = str_replace(
146
+ array( '{product}' ),
147
+ trim( str_replace( 'Lite', '', $this->product->get_name() ) ), $heading
148
+ );
149
+ $heading = str_replace( '{developer}', $this->developers[ $this->product->get_type() ][ rand( 0, ( count( $this->developers[ $this->product->get_type() ] ) - 1 ) ) ], $heading );
150
+
151
+ $button_cancel = apply_filters( $this->product->get_key() . '_feedback_review_button_cancel', $this->button_cancel );
152
+ $button_do = apply_filters( $this->product->get_key() . '_feedback_review_button_do', $this->button_do );
153
+
154
+ return '<div id="' . $this->product->get_key() . '-review-notification" class="themeisle-sdk-review-box">'
155
+ . '<p>' . $heading . '</p>'
156
+ . '<div class="actions">'
157
+ . '<a href="' . $link . '" target="_blank" class="button button-primary review-dismiss"> ' . $button_do . '</a>'
158
+ . get_submit_button( $button_cancel, 'review-dismiss ' . $this->product->get_key() . '-ti-review', $this->product->get_key() . 'ti-review-no', false )
159
+ . '</div></div>';
160
+ }
161
+
162
+ /**
163
+ * Called when the either button is clicked
164
+ */
165
+ function dismiss() {
166
+ check_ajax_referer( (string) __CLASS__, 'nonce' );
167
+
168
+ $this->disable();
169
+ }
170
+
171
+ /**
172
+ * Disables the notification
173
+ */
174
+ protected function disable() {
175
+ update_option( $this->product->get_key() . '_review_flag', 'no' );
176
+ }
177
+
178
+ /**
179
+ * Enables the notification
180
+ */
181
+ protected function enable() {
182
+ update_option( $this->product->get_key() . '_review_flag', 'yes' );
183
+ }
184
+ }
185
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The feedback model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback' ) ) :
16
+ /**
17
+ * Feedback model for ThemeIsle SDK.
18
+ */
19
+ abstract class ThemeIsle_SDK_Feedback {
20
+ /**
21
+ * @var ThemeIsle_SDK_Product $product Themeisle Product.
22
+ */
23
+ protected $product;
24
+
25
+ /**
26
+ * @var string $feedback_url Url where to send the feedback
27
+ */
28
+ private $feedback_url = 'http://feedback.themeisle.com/wordpress/wp-json/__pirate_feedback_/v1/feedback';
29
+
30
+ /**
31
+ * ThemeIsle_SDK_Feedback constructor.
32
+ *
33
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
34
+ */
35
+ public function __construct( $product_object ) {
36
+ if ( $product_object instanceof ThemeIsle_SDK_Product ) {
37
+ $this->product = $product_object;
38
+ }
39
+ $this->setup_hooks();
40
+ }
41
+
42
+ /**
43
+ * Registers the hooks and then delegates to the child
44
+ */
45
+ public function setup_hooks() {
46
+ $this->setup_hooks_child();
47
+ }
48
+
49
+ /**
50
+ * Calls the API
51
+ *
52
+ * @param string $attributes The attributes of the post body.
53
+ */
54
+ protected function call_api( $attributes ) {
55
+ $slug = $this->product->get_slug();
56
+ $version = $this->product->get_version();
57
+ $attributes['slug'] = $slug;
58
+ $attributes['version'] = $version;
59
+
60
+ $response = wp_remote_post(
61
+ $this->feedback_url, array(
62
+ 'body' => $attributes,
63
+ )
64
+ );
65
+ }
66
+
67
+ /**
68
+ * Randomizes the options array
69
+ *
70
+ * @param array $options The options array.
71
+ */
72
+ function randomize_options( $options ) {
73
+ $new = array();
74
+ $keys = array_keys( $options );
75
+ shuffle( $keys );
76
+
77
+ foreach ( $keys as $key ) {
78
+ $new[ $key ] = $options[ $key ];
79
+ }
80
+
81
+ return $new;
82
+ }
83
+
84
+ /**
85
+ * Abstract function for delegating to the child
86
+ */
87
+ protected abstract function setup_hooks_child();
88
+
89
+ }
90
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php ADDED
@@ -0,0 +1,710 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main loader class for license handling.
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Licenser
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
12
+ /**
13
+ * Class ThemeIsle_SDK_Licenser
14
+ *
15
+ * Used to update the themeisle products
16
+ */
17
+ class ThemeIsle_SDK_Licenser {
18
+
19
+ /**
20
+ * @var string $license_key The license key string
21
+ */
22
+ public $license_key;
23
+
24
+ /**
25
+ * @var bool $do_check This ensures that the custom API request only runs on the second time that WP fires the update check
26
+ */
27
+ private $do_check = false;
28
+
29
+ /**
30
+ * @var bool $failed_checks Number of failed checks to the api endpoint
31
+ */
32
+ private $failed_checks = 0;
33
+ /**
34
+ * @var ThemeIsle_SDK_Product $product The ThemeIsle Product.
35
+ */
36
+ private $product;
37
+ /**
38
+ * @var string $product_key The product update response key.
39
+ */
40
+ private $product_key;
41
+ /**
42
+ * @var int $max_failed Maximum failed checks allowed before show the notice
43
+ */
44
+ private static $max_failed = 5;
45
+
46
+ /**
47
+ * ThemeIsle_SDK_Licenser constructor.
48
+ *
49
+ * @param ThemeIsle_SDK_Product $product The product object.
50
+ */
51
+ public function __construct( $product ) {
52
+ $this->product = $product;
53
+ $this->product_key = $this->product->get_key() . '-update-response';
54
+ if ( ! $this->product->requires_license() ) {
55
+ $this->license_key = 'free';
56
+ } else {
57
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
58
+ $this->failed_checks = intval( get_option( $this->product->get_key() . '_failed_checks', 0 ) );
59
+ if ( $license_data !== '' ) {
60
+ $this->license_key = isset( $license_data->key ) ? $license_data->key : get_option( $this->product->get_key() . '_license', '' );
61
+ } else {
62
+ $this->license_key = get_option( $this->product->get_key() . '_license', '' );
63
+ }
64
+ $this->register_license_hooks();
65
+ }
66
+ }
67
+
68
+ /**
69
+ * Register license hooks for the themeisle products
70
+ */
71
+ public function register_license_hooks() {
72
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
73
+ add_action( 'admin_init', array( $this, 'activate_license' ) );
74
+ add_action( 'admin_init', array( $this, 'product_valid' ), 99999999 );
75
+ add_action( 'admin_notices', array( $this, 'show_notice' ) );
76
+ }
77
+
78
+ /**
79
+ * @param string $r Update payload.
80
+ * @param string $url The api url.
81
+ *
82
+ * @return mixed List of themes to check for update.
83
+ */
84
+ function disable_wporg_update( $r, $url ) {
85
+
86
+ if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/' ) ) {
87
+ return $r;
88
+ }
89
+
90
+ // Decode the JSON response
91
+ $themes = json_decode( $r['body']['themes'] );
92
+
93
+ unset( $themes->themes->{$this->product->get_slug()} );
94
+
95
+ // Encode the updated JSON response
96
+ $r['body']['themes'] = json_encode( $themes );
97
+
98
+ return $r;
99
+ }
100
+
101
+ /**
102
+ * Register the setting for the license of the product
103
+ *
104
+ * @return bool
105
+ */
106
+ public function register_settings() {
107
+ if ( ! is_admin() ) {
108
+ return false;
109
+ }
110
+ add_settings_field(
111
+ $this->product->get_key() . '_license',
112
+ $this->product->get_name() . ' license',
113
+ array( $this, 'license_view' ),
114
+ 'general'
115
+ );
116
+ }
117
+
118
+ /**
119
+ * The license view field
120
+ */
121
+ public function license_view() {
122
+ $status = $this->get_license_status();
123
+ $value = $this->license_key;
124
+
125
+ $activate_string = apply_filters( $this->product->get_key() . '_lc_activate_string', 'Activate' );
126
+ $deactivate_string = apply_filters( $this->product->get_key() . '_lc_deactivate_string', 'Deactivate' );
127
+ $valid_string = apply_filters( $this->product->get_key() . '_lc_valid_string', 'Valid' );
128
+ $invalid_string = apply_filters( $this->product->get_key() . '_lc_invalid_string', 'Invalid' );
129
+ $license_message = apply_filters( $this->product->get_key() . '_lc_license_message', 'Enter your license from %s purchase history in order to get %s updates' );
130
+
131
+ echo '<p ><input ' . ( ( $status === 'valid' ) ? ( 'style="border:1px solid #7ad03a; "' ) : '' ) . ' type="text" id="' . $this->product->get_key() . '_license" name="' . $this->product->get_key() . '_license" value="' . $value . '" /><a ' . ( ( $status === 'valid' ) ? ( 'style="color:#fff;background: #7ad03a; display: inline-block;text-decoration: none;font-size: 13px;line-height: 26px;height: 26px; margin-left:5px; padding: 0 10px 1px; -webkit-border-radius: 3px;border-radius: 3px; ">' . $valid_string ) : ( 'style="color:#fff;background: #dd3d36; display: inline-block;text-decoration: none;font-size: 13px;line-height: 26px;height: 26px; margin-left:5px; padding: 0 10px 1px; -webkit-border-radius: 3px;border-radius: 3px; ">' . $invalid_string ) ) . ' </a>&nbsp;&nbsp;&nbsp;<button name="' . $this->product->get_key() . '_btn_trigger" ' . ( ( $status === 'valid' ) ? ( ' class="button button-primary">' . $deactivate_string ) : ( ' class="button button-primary" value="yes" type="submit" >' . $activate_string ) ) . ' </button></p><p class="description">' . sprintf( $license_message, '<a href="' . $this->product->get_store_url() . '">' . $this->product->get_store_name() . '</a> ', $this->product->get_type() ) . '</p>';
132
+
133
+ }
134
+
135
+ /**
136
+ * Return the license status.
137
+ *
138
+ * @return string The License status.
139
+ */
140
+ public function get_license_status() {
141
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
142
+ if ( $license_data !== '' ) {
143
+ return isset( $license_data->license ) ? $license_data->license : get_option( $this->product->get_key() . '_license_status', 'not_active' );
144
+ } else {
145
+ return get_option( $this->product->get_key() . '_license_status', 'not_active' );
146
+ }
147
+
148
+ }
149
+
150
+ /**
151
+ * Check if the license is active or not
152
+ *
153
+ * @return bool
154
+ */
155
+ public function check_activation() {
156
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
157
+ if ( $license_data !== '' ) {
158
+ return isset( $license_data->error ) ? ( $license_data->error == 'no_activations_left' ) : false;
159
+ }
160
+
161
+ return false;
162
+ }
163
+
164
+ /**
165
+ * Check if the license is about to expire in the next month
166
+ *
167
+ * @return bool
168
+ */
169
+ function check_expiration() {
170
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
171
+ if ( $license_data !== '' ) {
172
+ if ( isset( $license_data->expires ) ) {
173
+ if ( strtotime( $license_data->expires ) - time() < 30 * 24 * 3600 ) {
174
+ return true;
175
+ }
176
+ }
177
+ }
178
+
179
+ return false;
180
+ }
181
+
182
+ /**
183
+ * Return the renew url from the store used
184
+ *
185
+ * @return string The renew url.
186
+ */
187
+ function renew_url() {
188
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
189
+ if ( $license_data !== '' ) {
190
+ if ( isset( $license_data->download_id ) && isset( $license_data->key ) ) {
191
+ return $this->product->get_store_url() . '/checkout/?edd_license_key=' . $license_data->key . '&download_id=' . $license_data->download_id;
192
+ }
193
+ }
194
+
195
+ return $this->product->get_store_url();
196
+ }
197
+
198
+ /**
199
+ * Check if we hide the notificatin nag or not
200
+ *
201
+ * @param string $hide The notification to hide.
202
+ *
203
+ * @return bool Either hide them or not.
204
+ */
205
+ function check_hide( $hide ) {
206
+ if ( isset( $_GET[ $this->product->get_key() . '_hide_' . $hide ] ) ) {
207
+ if ( $_GET[ $this->product->get_key() . '_hide_' . $hide ] === 'yes' ) {
208
+ update_option( $this->product->get_key() . '_hide_' . $hide, 'yes' );
209
+
210
+ return false;
211
+ }
212
+ } else {
213
+ $license = get_option( $this->product->get_key() . '_hide_' . $hide, '' );
214
+ if ( $license === 'yes' ) {
215
+ return false;
216
+ }
217
+ }
218
+
219
+ return true;
220
+ }
221
+
222
+ /**
223
+ * Show the admin notice regarding the license status
224
+ *
225
+ * @return bool
226
+ */
227
+ function show_notice() {
228
+ if ( ! is_admin() ) {
229
+ return false;
230
+ }
231
+ $status = $this->get_license_status();
232
+ $no_activations_string = apply_filters(
233
+ $this->product->get_key() . '_lc_no_activations_string', 'No activations left for %s !!!. You need to
234
+ upgrade your plan in order to use %s on more
235
+ websites. Please ask the %s
236
+ Staff for more details.'
237
+ );
238
+ $no_valid_string = apply_filters(
239
+ $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s , please add
240
+ your license code from your <a href="%s" target="_blank">purchase history</a> and validate it <a
241
+ href="%s">here</a> '
242
+ );
243
+ $expiration_string = apply_filters(
244
+ $this->product->get_key() . '_lc_expiration_string', 'Your license is about to expire
245
+ for %s. You can go to %s and renew it '
246
+ );
247
+ $hide_notice_string = apply_filters( $this->product->get_key() . '_lc_hide_notice_string', 'Hide Notice' );
248
+ if ( $status != 'valid' ) {
249
+ if ( $this->check_activation() ) {
250
+ if ( $this->check_hide( 'activation' ) ) {
251
+ ?>
252
+ <div class="error">
253
+ <p><strong>
254
+ <?php
255
+ echo sprintf(
256
+ $no_activations_string, $this->product->get_name(), $this->product->get_name(), '<a href="' . $this->product->get_store_url() . '"
257
+ target="_blank">' . $this->product->get_store_name() . '</a>'
258
+ );
259
+ ?>
260
+ </strong> | <a
261
+ href="<?php echo add_query_arg( $this->product->get_key() . '_activation', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
262
+ </p>
263
+ </div>
264
+ <?php
265
+ return false;
266
+ }
267
+ }
268
+ ?>
269
+ <?php if ( $this->check_hide( 'valid' ) ) : ?>
270
+ <div class="error">
271
+ <p>
272
+ <strong><?php echo sprintf( $no_valid_string, $this->product->get_name() . ' ' . $this->product->get_type(), $this->product->get_store_url(), admin_url( 'options-general.php' ) . '#' . $this->product->get_key() ); ?> </strong>|
273
+ <a
274
+ href="<?php echo add_query_arg( $this->product->get_key() . '_hide_valid', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
275
+ </p>
276
+ </div>
277
+ <?php endif; ?>
278
+ <?php
279
+ } else {
280
+ if ( $this->check_expiration() ) {
281
+ if ( $this->check_hide( 'expiration' ) ) {
282
+ ?>
283
+ <div class="update-nag">
284
+ <p>
285
+ <strong>
286
+ <?php
287
+ echo sprintf(
288
+ $expiration_string, $this->product->get_name() . ' ' . $this->product->get_type(), '<a
289
+ href="' . $this->renew_url() . '"
290
+ target="_blank">' . $this->product->get_store_name() . '</a>'
291
+ );
292
+ ?>
293
+ </strong> |
294
+ <a
295
+ href="<?php echo add_query_arg( $this->product->get_key() . '_hide_expiration', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
296
+ </p>
297
+ </div>
298
+ <?php
299
+ }
300
+ }
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Run the license check call
306
+ */
307
+ public function product_valid() {
308
+ if ( false === ( $license = get_transient( $this->product->get_key() . '_license_data' ) ) ) {
309
+ $license = $this->check_license();
310
+ set_transient( $this->product->get_key() . '_license_data', $license, 12 * HOUR_IN_SECONDS );
311
+ update_option( $this->product->get_key() . '_license_data', $license );
312
+ }
313
+
314
+ }
315
+
316
+ /**
317
+ * Increment the failed checks
318
+ */
319
+ private function increment_failed_checks() {
320
+ $this->failed_checks ++;
321
+ update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
322
+ }
323
+
324
+ /**
325
+ * Reset the failed checks
326
+ */
327
+ private function reset_failed_checks() {
328
+ $this->failed_checks = 1;
329
+ update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
330
+ }
331
+
332
+ /**
333
+ * Check the license status
334
+ *
335
+ * @return object The license data.
336
+ */
337
+ public function check_license() {
338
+ $status = $this->get_license_status();
339
+ if ( $status == 'not_active' ) {
340
+ $license_data = new stdClass();
341
+ $license_data->license = 'not_active';
342
+
343
+ return $license_data;
344
+ }
345
+ $license = trim( $this->license_key );
346
+ $api_params = array(
347
+ 'edd_action' => 'check_license',
348
+ 'license' => $license,
349
+ 'item_name' => rawurlencode( $this->product->get_name() ),
350
+ 'url' => rawurlencode( home_url() ),
351
+ );
352
+ // Call the custom API.
353
+ $response = wp_remote_get(
354
+ add_query_arg( $api_params, $this->product->get_store_url() ), array(
355
+ 'timeout' => 15,
356
+ 'sslverify' => false,
357
+ )
358
+ );
359
+ if ( is_wp_error( $response ) ) {
360
+ $license_data = new stdClass();
361
+ $license_data->license = 'valid';
362
+
363
+ } else {
364
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
365
+ if ( ! is_object( $license_data ) ) {
366
+ $license_data = new stdClass();
367
+ $license_data->license = 'valid';
368
+ }
369
+ }
370
+ $license_old = get_option( $this->product->get_key() . '_license_data', '' );
371
+ if ( $license_old->license == 'valid' && ( $license_data->license != $license_old->license ) ) {
372
+ $this->increment_failed_checks();
373
+ } else {
374
+ $this->reset_failed_checks();
375
+ }
376
+
377
+ if ( $this->failed_checks <= self::$max_failed ) {
378
+ return $license_old;
379
+ }
380
+
381
+ if ( isset( $license_old->hide_valid ) ) {
382
+ $license_data->hide_valid = true;
383
+ }
384
+
385
+ if ( ! isset( $license_data->key ) ) {
386
+ $license_data->key = isset( $license_old->key ) ? $license_old->key : '';
387
+ }
388
+
389
+ if ( isset( $license_old->hide_expiration ) ) {
390
+ $license_data->hide_expiration = true;
391
+ }
392
+
393
+ if ( isset( $license_old->hide_activation ) ) {
394
+ $license_data->hide_activation = true;
395
+ }
396
+
397
+ return $license_data;
398
+
399
+ }
400
+
401
+ /**
402
+ * Activate the license remotely
403
+ */
404
+ function activate_license() {
405
+ // listen for our activate button to be clicked
406
+ if ( isset( $_POST[ $this->product->get_key() . '_btn_trigger' ] ) ) {
407
+ $status = $this->get_license_status();
408
+ // retrieve the license from the database
409
+ $license = $_POST[ $this->product->get_key() . '_license' ];
410
+ $api_params = array(
411
+ 'license' => $license,
412
+ 'item_name' => rawurlencode( $this->product->get_name() ),
413
+ 'url' => rawurlencode( home_url() ),
414
+ );
415
+ if ( $status != 'valid' ) {
416
+ // data to send in our API request
417
+ $api_params['edd_action'] = 'activate_license';
418
+ } else {
419
+ $api_params['edd_action'] = 'deactivate_license';
420
+ }
421
+ // Call the custom API.
422
+ $response = wp_remote_get( add_query_arg( $api_params, $this->product->get_store_url() ) );
423
+ // make sure the response came back okay
424
+ if ( is_wp_error( $response ) ) {
425
+ $license_data = new stdClass();
426
+ $license_data->license = ( $status != 'valid' ) ? 'valid' : 'invalid';
427
+
428
+ } else {
429
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
430
+ if ( ! is_object( $license_data ) ) {
431
+ $license_data = new stdClass();
432
+ $license_data->license = ( $status != 'valid' ) ? 'valid' : 'invalid';
433
+ }
434
+ }
435
+ if ( ! isset( $license_data->key ) ) {
436
+ $license_data->key = $license;
437
+ }
438
+ if ( $license_data->license == 'valid' ) {
439
+ $this->reset_failed_checks();
440
+ }
441
+
442
+ if ( isset( $license_data->plan ) ) {
443
+ update_option( $this->product->get_key() . '_license_plan', $license_data->plan );
444
+ }
445
+
446
+ update_option( $this->product->get_key() . '_license_data', $license_data );
447
+ delete_transient( $this->product->get_key() . '_license_data' );
448
+ set_transient( $this->product->get_key() . '_license_data', $license_data, 12 * HOUR_IN_SECONDS );
449
+
450
+ }
451
+ }
452
+
453
+ /**
454
+ * Enable the license system
455
+ */
456
+ public function enable() {
457
+ if ( $this->product->get_type() == 'plugin' ) {
458
+ add_filter(
459
+ 'pre_set_site_transient_update_plugins', array(
460
+ $this,
461
+ 'pre_set_site_transient_update_plugins_filter',
462
+ )
463
+ );
464
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
465
+ add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
466
+ }
467
+ if ( $this->product->get_type() == 'theme' ) {
468
+ add_filter( 'site_transient_update_themes', array( &$this, 'theme_update_transient' ) );
469
+ add_filter( 'delete_site_transient_update_themes', array( &$this, 'delete_theme_update_transient' ) );
470
+ add_action( 'load-update-core.php', array( &$this, 'delete_theme_update_transient' ) );
471
+ add_action( 'load-themes.php', array( &$this, 'delete_theme_update_transient' ) );
472
+ add_action( 'load-themes.php', array( &$this, 'load_themes_screen' ) );
473
+ add_filter( 'http_request_args', array( $this, 'disable_wporg_update' ), 5, 2 );
474
+
475
+ }
476
+
477
+ }
478
+
479
+ /**
480
+ * Load the Themes screen
481
+ */
482
+ function load_themes_screen() {
483
+ add_thickbox();
484
+ add_action( 'admin_notices', array( &$this, 'update_nag' ) );
485
+ }
486
+
487
+ /**
488
+ * Alter the nag for themes update
489
+ */
490
+ function update_nag() {
491
+ $theme = wp_get_theme( $this->product->get_slug() );
492
+ $api_response = get_transient( $this->product_key );
493
+ if ( false === $api_response ) {
494
+ return;
495
+ }
496
+ $update_url = wp_nonce_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $this->product->get_slug() ), 'upgrade-theme_' . $this->product->get_slug() );
497
+ $update_message = apply_filters( 'themeisle_sdk_license_update_message', 'Updating this theme will lose any customizations you have made. Cancel to stop, OK to update.' );
498
+ $update_onclick = ' onclick="if ( confirm(\'' . esc_js( $update_message ) . '\') ) {return true;}return false;"';
499
+ if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
500
+ echo '<div id="update-nag">';
501
+ printf(
502
+ '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
503
+ $theme->get( 'Name' ),
504
+ $api_response->new_version,
505
+ '#TB_inline?width=640&amp;inlineId=' . $this->product->get_version() . '_changelog',
506
+ $theme->get( 'Name' ),
507
+ $update_url,
508
+ $update_onclick
509
+ );
510
+ echo '</div>';
511
+ echo '<div id="' . $this->product->get_slug() . '_' . 'changelog" style="display:none;">';
512
+ echo wpautop( $api_response->sections['changelog'] );
513
+ echo '</div>';
514
+ }
515
+ }
516
+
517
+ /**
518
+ * @param mixed $value The transient data.
519
+ *
520
+ * @return mixed
521
+ */
522
+ function theme_update_transient( $value ) {
523
+ $update_data = $this->check_for_update();
524
+ if ( $update_data ) {
525
+ $value->response[ $this->product->get_slug() ] = $update_data;
526
+ }
527
+
528
+ return $value;
529
+ }
530
+
531
+ /**
532
+ * Delete the update transient
533
+ */
534
+ function delete_theme_update_transient() {
535
+ delete_transient( $this->product_key );
536
+ }
537
+
538
+ /**
539
+ * Check for updates
540
+ *
541
+ * @return array|bool Either the update data or false in case of failure
542
+ */
543
+ function check_for_update() {
544
+ $theme = wp_get_theme( $this->product->get_slug() );
545
+ $update_data = get_transient( $this->product_key );
546
+ if ( false === $update_data ) {
547
+ $failed = false;
548
+ if ( empty( $this->license_key ) ) {
549
+ return false;
550
+ }
551
+ $api_params = array(
552
+ 'edd_action' => 'get_version',
553
+ 'version' => $this->product->get_version(),
554
+ 'license' => $this->license_key,
555
+ 'name' => $this->product->get_name(),
556
+ 'slug' => $this->product->get_slug(),
557
+ 'author' => $this->product->get_store_name(),
558
+ 'url' => rawurlencode( home_url() ),
559
+ );
560
+ $response = wp_remote_post(
561
+ $this->product->get_store_url(), array(
562
+ 'timeout' => 15,
563
+ 'sslverify' => false,
564
+ 'body' => $api_params,
565
+ )
566
+ );
567
+ // make sure the response was successful
568
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
569
+ $failed = true;
570
+ }
571
+ $update_data = json_decode( wp_remote_retrieve_body( $response ) );
572
+ if ( ! is_object( $update_data ) ) {
573
+ $failed = true;
574
+ }
575
+ // if the response failed, try again in 30 minutes
576
+ if ( $failed ) {
577
+ $data = new stdClass;
578
+ $data->new_version = $this->product->get_version();
579
+ set_transient( $this->product_key, $data, strtotime( '+30 minutes' ) );
580
+
581
+ return false;
582
+ }
583
+ // if the status is 'ok', return the update arguments
584
+ if ( ! $failed ) {
585
+ $update_data->sections = maybe_unserialize( $update_data->sections );
586
+ set_transient( $this->product_key, $update_data, strtotime( '+12 hours' ) );
587
+ }
588
+ }
589
+ if ( version_compare( $this->product->get_version(), $update_data->new_version, '>=' ) ) {
590
+ return false;
591
+ }
592
+
593
+ return (array) $update_data;
594
+ }
595
+
596
+ /**
597
+ * Check for Updates at the defined API endpoint and modify the update array.
598
+ *
599
+ * This function dives into the update API just when WordPress creates its update array,
600
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
601
+ * It is reassembled from parts of the native WordPress plugin update code.
602
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
603
+ *
604
+ * @uses api_request()
605
+ *
606
+ * @param array $_transient_data Update array build by WordPress.
607
+ *
608
+ * @return array Modified update array with custom plugin data.
609
+ */
610
+ public function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
611
+ if ( empty( $_transient_data ) || ! $this->do_check ) {
612
+ $this->do_check = true;
613
+
614
+ return $_transient_data;
615
+ }
616
+ $api_response = $this->api_request();
617
+ if ( false !== $api_response && is_object( $api_response ) && isset( $api_response->new_version ) ) {
618
+ if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
619
+ $_transient_data->response[ $this->product->get_slug() . '/' . $this->product->get_file() ] = $api_response;
620
+ }
621
+ }
622
+
623
+ return $_transient_data;
624
+ }
625
+
626
+ /**
627
+ * Calls the API and, if successfull, returns the object delivered by the API.
628
+ *
629
+ * @uses get_bloginfo()
630
+ * @uses wp_remote_post()
631
+ * @uses is_wp_error()
632
+ *
633
+ * @param string $_action The requested action.
634
+ * @param array $_data Parameters for the API action.
635
+ *
636
+ * @return false||object
637
+ */
638
+ private function api_request( $_action = '', $_data = '' ) {
639
+ if ( empty( $this->license_key ) ) {
640
+ return;
641
+ }
642
+ $api_params = array(
643
+ 'edd_action' => 'get_version',
644
+ 'license' => $this->license_key,
645
+ 'name' => rawurlencode( $this->product->get_name() ),
646
+ 'slug' => rawurlencode( $this->product->get_slug() ),
647
+ 'author' => $this->product->get_store_name(),
648
+ 'url' => rawurlencode( home_url() ),
649
+ );
650
+ $request = wp_remote_post(
651
+ $this->product->get_store_url(), array(
652
+ 'timeout' => 15,
653
+ 'sslverify' => false,
654
+ 'body' => $api_params,
655
+ )
656
+ );
657
+ if ( ! is_wp_error( $request ) ) :
658
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
659
+ if ( $request && isset( $request->sections ) ) {
660
+ $request->sections = maybe_unserialize( $request->sections );
661
+ }
662
+
663
+ return $request;
664
+ else :
665
+ return false;
666
+ endif;
667
+ }
668
+
669
+ /**
670
+ * Updates information on the "View version x.x details" page with custom data.
671
+ *
672
+ * @uses api_request()
673
+ *
674
+ * @param mixed $_data Plugin data.
675
+ * @param string $_action Action to send.
676
+ * @param object $_args Arguments to use.
677
+ *
678
+ * @return object $_data
679
+ */
680
+ public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
681
+ if ( ( $_action != 'plugin_information' ) || ! isset( $_args->slug ) || ( $_args->slug != $this->product->get_slug() ) ) {
682
+ return $_data;
683
+ }
684
+ $api_response = $this->api_request();
685
+ if ( false !== $api_response ) {
686
+ $_data = $api_response;
687
+ }
688
+
689
+ return $_data;
690
+ }
691
+
692
+ /**
693
+ * Disable SSL verification in order to prevent download update failures
694
+ *
695
+ * @param array $args Http args.
696
+ * @param string $url Url to check.
697
+ *
698
+ * @return object $array
699
+ */
700
+ function http_request_args( $args, $url ) {
701
+ // If it is an https request and we are performing a package download, disable ssl verification
702
+ if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
703
+ $args['sslverify'] = false;
704
+ }
705
+
706
+ return $args;
707
+ }
708
+
709
+ }
710
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main loader class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Loader
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Loader' ) ) :
16
+ /**
17
+ * Singleton loader for ThemeIsle SDK.
18
+ */
19
+ final class ThemeIsle_SDK_Loader {
20
+ /**
21
+ * @var ThemeIsle_SDK_Loader instance The singleton instance
22
+ */
23
+ private static $instance;
24
+ /**
25
+ * @var string $version The class version.
26
+ */
27
+ private static $version = '1.0.0';
28
+ /**
29
+ * @var array The products which use the SDK.
30
+ */
31
+ private static $products;
32
+
33
+ /**
34
+ * Register product into SDK.
35
+ *
36
+ * @param string $basefile The product basefile.
37
+ *
38
+ * @return ThemeIsle_SDK_Loader The singleton object.
39
+ */
40
+ public static function init_product( $basefile ) {
41
+
42
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof ThemeIsle_SDK_Loader ) ) {
43
+ self::$instance = new ThemeIsle_SDK_Loader;
44
+
45
+ }
46
+ $product_object = new ThemeIsle_SDK_Product( $basefile );
47
+ self::$products[ $product_object->get_slug() ] = $product_object;
48
+
49
+ $notifications = array();
50
+ // Based on the WordPress Available file header we enable the logger or not.
51
+ if ( ! $product_object->is_wordpress_available() ) {
52
+ $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
+ $licenser->enable();
54
+ }
55
+
56
+ $logger = new ThemeIsle_SDK_Logger( $product_object );
57
+ if ( $product_object->is_logger_active() ) {
58
+ $logger->enable();
59
+ } else {
60
+ $notifications[] = $logger;
61
+ }
62
+
63
+ $feedback = new ThemeIsle_SDK_Feedback_Factory( $product_object, $product_object->get_feedback_types() );
64
+
65
+ $instances = $feedback->get_instances();
66
+ if ( array_key_exists( 'review', $instances ) ) {
67
+ $notifications[] = $instances['review'];
68
+ }
69
+ new ThemeIsle_SDK_Notification_Manager( $product_object, $notifications );
70
+ if ( ! $product_object->is_external_author() ) {
71
+ new ThemeIsle_SDK_Widgets_Factory( $product_object, $product_object->get_widget_types() );
72
+ }
73
+
74
+ return self::$instance;
75
+ }
76
+
77
+ /**
78
+ * Get all products using the SDK.
79
+ *
80
+ * @return array Products available.
81
+ */
82
+ public static function get_products() {
83
+ return self::$products;
84
+ }
85
+
86
+
87
+ }
88
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-logger.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main loader class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Logger
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
12
+ /**
13
+ * Class ThemeIsle_SDK_Logger
14
+ *
15
+ * Send the statistics to the Themeisle Endpoint
16
+ */
17
+ /**
18
+ * Class ThemeIsle_SDK_Logger
19
+ */
20
+ class ThemeIsle_SDK_Logger {
21
+
22
+ /**
23
+ * @var string $logging_url Url where to send the logs
24
+ */
25
+ private $logging_url = 'http://log.themeisle.com/wp-json/v1/logs/';
26
+
27
+ /**
28
+ * @var ThemeIsle_SDK_Product $product Themeisle Product.
29
+ */
30
+ private $product;
31
+
32
+ /**
33
+ * @var string $product_cron Cron name handler
34
+ */
35
+ private $product_cron;
36
+
37
+ /**
38
+ * @var string $heading The heading of the modal
39
+ */
40
+ private $heading = 'Do you enjoy {product}? Become a contributor by opting in to our anonymous data tracking. We guarantee no sensitive data is collected.';
41
+
42
+ /**
43
+ * @var string $button_submit The text of the submit button
44
+ */
45
+ private $button_submit = 'Sure, I would love to help.';
46
+
47
+ /**
48
+ * @var string $button_cancel The text of the cancel button
49
+ */
50
+ private $button_cancel = 'No, thanks.';
51
+
52
+ /**
53
+ * ThemeIsle_SDK_Logger constructor.
54
+ *
55
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
56
+ */
57
+ public function __construct( $product_object ) {
58
+ if ( $product_object instanceof ThemeIsle_SDK_Product ) {
59
+ $this->product = $product_object;
60
+ $this->product_cron = $product_object->get_key() . '_log_activity';
61
+ }
62
+ add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'dismiss' ) );
63
+ }
64
+
65
+
66
+ /**
67
+ * Start the cron to send the log. It will randomize the interval in order to not send all the logs at the same time.
68
+ */
69
+ public function enable() {
70
+ if ( ! wp_next_scheduled( $this->product_cron ) ) {
71
+ wp_schedule_single_event( time() + ( rand( 15, 24 ) * 3600 ), $this->product_cron );
72
+ }
73
+ add_action( $this->product_cron, array( $this, 'send_log' ) );
74
+ }
75
+
76
+ /**
77
+ * Send the statistics to the api endpoint
78
+ */
79
+ public function send_log() {
80
+ wp_remote_post(
81
+ $this->logging_url, array(
82
+ 'method' => 'POST',
83
+ 'timeout' => 3,
84
+ 'redirection' => 5,
85
+ 'headers' => array(
86
+ 'X-ThemeIsle-Event' => 'log_site',
87
+ ),
88
+ 'body' => array(
89
+ 'site' => get_site_url(),
90
+ 'slug' => $this->product->get_slug(),
91
+ 'version' => $this->product->get_version(),
92
+ 'data' => apply_filters( $this->product->get_key() . '_logger_data', array() ),
93
+ ),
94
+ )
95
+ );
96
+ }
97
+
98
+ /**
99
+ * Dismiss the notification
100
+ */
101
+ function dismiss() {
102
+ check_ajax_referer( (string) __CLASS__, 'nonce' );
103
+
104
+ $flag = intval( $_POST['enable'] ) === 1;
105
+ update_option( $this->product->logger_option, ( $flag ? 'yes' : 'no' ) );
106
+
107
+ if ( true === $flag ) {
108
+ $this->enable();
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Shows the notification
114
+ */
115
+ function show_notification() {
116
+ $show = $this->product->is_logger_active();
117
+ $checked = get_option( $this->product->logger_option, '' );
118
+ if ( ! $show && $checked == '' ) {
119
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
120
+
121
+ return true;
122
+ }
123
+
124
+ return false;
125
+ }
126
+
127
+ /**
128
+ * Shows the admin notice
129
+ */
130
+ function admin_notices() {
131
+ $id = $this->product->get_key() . '_logger';
132
+
133
+ $this->add_media( $this->product->get_key() );
134
+
135
+ echo '<div class="notice notice-success is-dismissible " id="' . $this->product->get_key() . '-logger-notification" ><div id="' . $id . '" class="themeisle-logger-box">' . $this->get_html( $this->product->get_key() ) . '</div></div>';
136
+ }
137
+
138
+ /**
139
+ * Generates the HTML
140
+ *
141
+ * @param string $key The product key.
142
+ */
143
+ function get_html( $key ) {
144
+ $heading = apply_filters( $this->product->get_key() . '_logger_heading', $this->heading );
145
+ $heading = str_replace(
146
+ array( '{product}' ), array(
147
+ trim( str_replace( 'Lite', '', $this->product->get_name() ) ),
148
+ ),
149
+ $heading
150
+ );
151
+ $button_submit = apply_filters( $this->product->get_key() . '_logger_button_submit', $this->button_submit );
152
+ $button_cancel = apply_filters( $this->product->get_key() . '_logger_button_cancel', $this->button_cancel );
153
+
154
+ return '<div >'
155
+ . '<p>' . $heading . '</p>'
156
+ . '<div class="actions">'
157
+ . get_submit_button(
158
+ $button_submit, 'primary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-yes', false, array(
159
+ 'data-ti-log-enable' => 1,
160
+ )
161
+ )
162
+ . get_submit_button(
163
+ $button_cancel, 'secondary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-no', false, array(
164
+ 'data-ti-log-enable' => 0,
165
+ )
166
+ )
167
+ . '</div></div>';
168
+ }
169
+
170
+ /**
171
+ * Loads the js
172
+ *
173
+ * @param string $key The product key.
174
+ */
175
+ function add_media( $key ) {
176
+ ?>
177
+ <style type="text/css">
178
+ #<?php echo $key; ?>-logger-notification {
179
+ padding-bottom: 5px;
180
+ }
181
+
182
+ #<?php echo $key; ?>-logger-notification .button {
183
+ margin-left: 5px;
184
+ }
185
+ </style>
186
+ <script type="text/javascript" id="<?php echo $key; ?>ti-logger-js">
187
+ (function ($) {
188
+ $(document).ready(function () {
189
+ $('.<?php echo $key; ?>-ti-logger').on('click', function (e) {
190
+
191
+ $.ajax({
192
+ url: ajaxurl,
193
+ method: "post",
194
+ data: {
195
+ 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
196
+ 'action': '<?php echo $this->product->get_key() . __CLASS__; ?>',
197
+ 'enable': $(this).attr('data-ti-log-enable')
198
+ },
199
+ success: function () {
200
+ $('#<?php echo $key; ?>-logger-notification').hide();
201
+ }
202
+ });
203
+ });
204
+ });
205
+ })(jQuery);
206
+ </script>
207
+ <?php
208
+ }
209
+
210
+ }
211
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-notification-manager.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The notification manager class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Notification
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Notification_Manager' ) ) :
16
+ /**
17
+ * Notification manager model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Notification_Manager {
20
+ /**
21
+ * Time between notifications.
22
+ */
23
+ const NOTIFICATION_INTERVAL_HOURS = 100;
24
+ /**
25
+ * @var array Notifications for the current product.
26
+ */
27
+ private $notifications = array();
28
+ /**
29
+ * @var ThemeIsle_SDK_Product Current product.
30
+ */
31
+ private $product;
32
+ /**
33
+ * @var array ThemeIsle_SDK_Feedback Feedbacks available.
34
+ */
35
+ private $callbacks = array();
36
+
37
+ /**
38
+ * ThemeIsle_SDK_Notification_Manager constructor.
39
+ *
40
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
41
+ * @param array $callbacks the objects that will be called when a notification is due.
42
+ */
43
+ public function __construct( $product_object, $callbacks ) {
44
+ $this->product = $product_object;
45
+ $this->callbacks = $callbacks;
46
+ $this->setup_hooks();
47
+ }
48
+
49
+ /**
50
+ * Setup the notifications.
51
+ */
52
+ function setup_notifications() {
53
+ if ( ! current_user_can( 'manage_options' ) ) {
54
+ return;
55
+ }
56
+ // Load the notifications only if we have it installed after the required interval.
57
+ if ( ( time() - $this->product->get_install_time() ) > self::NOTIFICATION_INTERVAL_HOURS * HOUR_IN_SECONDS ) {
58
+ if ( $this->product instanceof ThemeIsle_SDK_Product && $this->callbacks && is_array( $this->callbacks ) ) {
59
+ foreach ( $this->callbacks as $instance ) {
60
+ $this->notifications[ $this->product->get_key() . get_class( $instance ) ] = $instance;
61
+ }
62
+ }
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Setup the internal hooks
68
+ */
69
+ private function setup_hooks() {
70
+ add_action( 'admin_head', array( $this, 'show_notification' ) );
71
+ add_action( 'admin_init', array( $this, 'setup_notifications' ) );
72
+ }
73
+
74
+ /**
75
+ * Shows the notification
76
+ */
77
+ function show_notification() {
78
+
79
+ $hidden = get_option( 'themeisle_sdk_notification_hidden', array() );
80
+ $instances = $this->notifications;
81
+ if ( empty( $instances ) ) {
82
+ return;
83
+ }
84
+
85
+ // Get timestamp of last notification.
86
+ $old = 0;
87
+ if ( ! empty( $hidden ) ) {
88
+ $old = $hidden[ count( $hidden ) - 1 ]['time'];
89
+ }
90
+ // Check if the current one is expired.
91
+ if ( ( time() - $old ) > self::NOTIFICATION_INTERVAL_HOURS * HOUR_IN_SECONDS ) {
92
+ // Get hidden notifications key.
93
+ $hidden_ones = wp_list_pluck( $hidden, 'key' );
94
+ // Get the non-hidden notifications.
95
+ $available_notifications = array_diff( array_keys( $instances ), $hidden_ones );
96
+ if ( empty( $available_notifications ) ) {
97
+ return;
98
+ }
99
+ // Get the first notification available.
100
+ $new_one = reset( $available_notifications );
101
+
102
+ $instance = $instances[ $new_one ];
103
+ $hidden[] = array(
104
+ 'time' => time(),
105
+ 'key' => $new_one,
106
+ );
107
+ update_option( 'themeisle_sdk_notification_hidden', $hidden );
108
+ } else {
109
+ $key = $hidden[ count( $hidden ) - 1 ]['key'];
110
+ if ( ! isset( $this->notifications[ $key ] ) ) {
111
+ return;
112
+ } else {
113
+ $instance = $this->notifications[ $key ];
114
+ }
115
+ }
116
+ $instance->show_notification();
117
+ }
118
+ }
119
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-product.php ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The product model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Product
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
16
+ /**
17
+ * Product model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Product {
20
+ /**
21
+ * @var string $slug THe product slug.
22
+ */
23
+ private $slug;
24
+ /**
25
+ * @var string $basefile The file with headers.
26
+ */
27
+ private $basefile;
28
+ /**
29
+ * @var string $type The product type ( plugin | theme ).
30
+ */
31
+ private $type;
32
+ /**
33
+ * @var string $file The file name.
34
+ */
35
+ private $file;
36
+ /**
37
+ * @var string $name The product name.
38
+ */
39
+ private $name;
40
+ /**
41
+ * @var string $key The product ready key.
42
+ */
43
+ private $key;
44
+ /**
45
+ * @var string $author_url The url of the author.
46
+ */
47
+ private $author_url;
48
+ /**
49
+ * @var string $store_url The store url.
50
+ */
51
+ private $store_url;
52
+ /**
53
+ * @var int $install The date of install.
54
+ */
55
+ private $install;
56
+ /**
57
+ * @var string $store_name The store name.
58
+ */
59
+ private $store_name;
60
+ /**
61
+ * @var array $allowed_authors The allowed authors.
62
+ */
63
+ private $allowed_authors = array( 'proteusthemes.com', 'anarieldesign.com' );
64
+ /**
65
+ * @var bool $requires_license Either user needs to activate it with license.
66
+ */
67
+ private $requires_license;
68
+ /**
69
+ * @var bool $wordpress_available Either is available on WordPress or not.
70
+ */
71
+ private $wordpress_available;
72
+ /**
73
+ * @var string $version The product version.
74
+ */
75
+ private $version;
76
+ /**
77
+ * @var string $logger_option Logger option key.
78
+ */
79
+ public $logger_option;
80
+ /**
81
+ * @var string $pro_slug Pro slug, if available.
82
+ */
83
+ public $pro_slug;
84
+ /**
85
+ * @var string $feedback_types All the feedback types the product supports
86
+ */
87
+ private $feedback_types = array();
88
+
89
+ /**
90
+ * @var string $widget_types All the widget types the product supports
91
+ */
92
+ private $widget_types = array( 'dashboard_blog' );
93
+
94
+ /**
95
+ * ThemeIsle_SDK_Product constructor.
96
+ *
97
+ * @param string $basefile Product basefile.
98
+ */
99
+ public function __construct( $basefile ) {
100
+ if ( ! empty( $basefile ) ) {
101
+ if ( is_readable( $basefile ) ) {
102
+ $this->basefile = $basefile;
103
+ $this->setup_from_path();
104
+ $this->setup_from_fileheaders();
105
+ }
106
+ }
107
+ $install = get_option( $this->get_key() . '_install', 0 );
108
+ if ( $install === 0 ) {
109
+ $install = time();
110
+ update_option( $this->get_key() . '_install', time() );
111
+ }
112
+ $this->install = $install;
113
+
114
+ $this->logger_option = $this->get_key() . '_logger_flag';
115
+
116
+ }
117
+
118
+ /**
119
+ * Setup props from fileheaders.
120
+ */
121
+ public function setup_from_fileheaders() {
122
+ $file_headers = array(
123
+ 'Requires License' => 'Requires License',
124
+ 'WordPress Available' => 'WordPress Available',
125
+ 'Pro Slug' => 'Pro Slug',
126
+ 'Version' => 'Version',
127
+ );
128
+ if ( $this->type == 'plugin' ) {
129
+ $file_headers['Name'] = 'Plugin Name';
130
+ $file_headers['AuthorName'] = 'Author';
131
+ $file_headers['AuthorURI'] = 'Author URI';
132
+ }
133
+ if ( $this->type == 'theme' ) {
134
+ $file_headers['Name'] = 'Theme Name';
135
+ $file_headers['AuthorName'] = 'Author';
136
+ $file_headers['AuthorURI'] = 'Author URI';
137
+ }
138
+ $file_headers = get_file_data( $this->basefile, $file_headers );
139
+
140
+ $this->name = $file_headers['Name'];
141
+ $this->store_name = $file_headers['AuthorName'];
142
+ $this->author_url = $file_headers['AuthorURI'];
143
+ $this->store_url = $file_headers['AuthorURI'];
144
+ if ( $this->is_external_author() ) {
145
+ $this->store_url = 'https://themeisle.com';
146
+ $this->store_name = 'ThemeIsle';
147
+ }
148
+ $this->requires_license = ( $file_headers['Requires License'] == 'yes' ) ? true : false;
149
+ $this->wordpress_available = ( $file_headers['WordPress Available'] == 'yes' ) ? true : false;
150
+ $this->pro_slug = ! empty( $file_headers['Pro Slug'] ) ? $file_headers['Pro Slug'] : '';
151
+ $this->version = $file_headers['Version'];
152
+ if ( $this->require_uninstall_feedback() ) {
153
+ $this->feedback_types[] = 'deactivate';
154
+ }
155
+ if ( $this->is_wordpress_available() ) {
156
+ $this->feedback_types[] = 'review';
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Check if the product is by external author or not.
162
+ *
163
+ * @return bool Either is external author or no.
164
+ */
165
+ public function is_external_author() {
166
+ foreach ( $this->allowed_authors as $author ) {
167
+ if ( strpos( $this->author_url, $author ) !== false ) {
168
+ return true;
169
+ }
170
+ }
171
+
172
+ return false;
173
+ }
174
+
175
+ /**
176
+ * The magic var_dump info method.
177
+ *
178
+ * @return array Debug info.
179
+ */
180
+ public function __debugInfo() {
181
+ return array(
182
+ 'name' => $this->name,
183
+ 'slug' => $this->slug,
184
+ 'version' => $this->version,
185
+ 'basefile' => $this->basefile,
186
+ 'key' => $this->key,
187
+ 'type' => $this->type,
188
+ 'store_name' => $this->store_name,
189
+ 'store_url' => $this->store_url,
190
+ 'wordpress_available' => $this->wordpress_available,
191
+ 'requires_license' => $this->requires_license,
192
+ );
193
+
194
+ }
195
+
196
+ /**
197
+ * Setup props from path.
198
+ */
199
+ public function setup_from_path() {
200
+ $this->file = basename( $this->basefile );
201
+ $dir = dirname( $this->basefile );
202
+ $this->slug = basename( $dir );
203
+ $exts = explode( '.', $this->basefile );
204
+ $ext = $exts[ count( $exts ) - 1 ];
205
+ if ( $ext == 'css' ) {
206
+ $this->type = 'theme';
207
+ }
208
+ if ( $ext == 'php' ) {
209
+ $this->type = 'plugin';
210
+ }
211
+ $this->key = self::key_ready_name( $this->slug );
212
+ }
213
+
214
+ /**
215
+ * @param string $string the String to be normalized for cron handler.
216
+ *
217
+ * @return string $name The normalized string.
218
+ */
219
+ static function key_ready_name( $string ) {
220
+ return str_replace( '-', '_', strtolower( trim( $string ) ) );
221
+ }
222
+
223
+ /**
224
+ * Getter for product name.
225
+ *
226
+ * @return string The product name.
227
+ */
228
+ public function get_name() {
229
+ return $this->name;
230
+ }
231
+
232
+ /**
233
+ * Getter for product version.
234
+ *
235
+ * @return string The product version.
236
+ */
237
+ public function get_version() {
238
+ return $this->version;
239
+ }
240
+
241
+ /**
242
+ * If product is available on wordpress.org or not.
243
+ *
244
+ * @return bool Either is wp available or not.
245
+ */
246
+ public function is_wordpress_available() {
247
+ return $this->wordpress_available;
248
+ }
249
+
250
+ /**
251
+ * Return the product key.
252
+ *
253
+ * @return string The product key.
254
+ */
255
+ public function get_key() {
256
+ return $this->key;
257
+ }
258
+
259
+ /**
260
+ * Either the product requires license or not.
261
+ *
262
+ * @return bool Either requires license or not.
263
+ */
264
+ public function requires_license() {
265
+ return $this->requires_license;
266
+ }
267
+
268
+ /**
269
+ * Check if the product is either theme or plugin.
270
+ *
271
+ * @return string Product type.
272
+ */
273
+ public function get_type() {
274
+ return $this->type;
275
+ }
276
+
277
+ /**
278
+ * Returns the Store name.
279
+ *
280
+ * @return string Store name.
281
+ */
282
+ public function get_store_name() {
283
+ return $this->store_name;
284
+ }
285
+
286
+ /**
287
+ * Returns the store url.
288
+ *
289
+ * @return string The store url.
290
+ */
291
+ public function get_store_url() {
292
+ return $this->store_url;
293
+ }
294
+
295
+ /**
296
+ * Returns the product slug.
297
+ *
298
+ * @return string The product slug.
299
+ */
300
+ public function get_slug() {
301
+ return $this->slug;
302
+ }
303
+
304
+ /**
305
+ * Returns product basefile, which holds the metaheaders.
306
+ *
307
+ * @return string The product basefile.
308
+ */
309
+ public function get_basefile() {
310
+ return $this->basefile;
311
+ }
312
+
313
+ /**
314
+ * Returns product filename.
315
+ *
316
+ * @return string The product filename.
317
+ */
318
+ public function get_file() {
319
+ return $this->file;
320
+ }
321
+
322
+ /**
323
+ * Returns feedback types
324
+ *
325
+ * @return array The feedback types.
326
+ */
327
+ public function get_feedback_types() {
328
+ return apply_filters( $this->get_key() . '_feedback_types', $this->feedback_types );
329
+ }
330
+
331
+ /**
332
+ * Returns widget types
333
+ *
334
+ * @return array The widget types.
335
+ */
336
+ public function get_widget_types() {
337
+ return apply_filters( $this->get_key() . '_widget_types', $this->widget_types );
338
+ }
339
+
340
+ /**
341
+ * We log the user website and product version.
342
+ *
343
+ * @return bool Either we log the data or not.
344
+ */
345
+ public function is_logger_active() {
346
+ // If is not available on WordPress log this automatically.
347
+ if ( ! $this->is_wordpress_available() ) {
348
+ return true;
349
+ } else {
350
+ $pro_slug = $this->get_pro_slug();
351
+ if ( ! empty( $pro_slug ) ) {
352
+
353
+ $all_products = ThemeIsle_SDK_Loader::get_products();
354
+ if ( isset( $all_products[ $pro_slug ] ) ) {
355
+ return true;
356
+ }
357
+ }
358
+
359
+ return ( get_option( $this->get_key() . '_logger_flag', 'no' ) === 'yes' );
360
+
361
+ }
362
+ }
363
+
364
+ /**
365
+ * Returns the pro slug, if available.
366
+ *
367
+ * @return string The pro slug.
368
+ */
369
+ public function get_pro_slug() {
370
+ return $this->pro_slug;
371
+ }
372
+
373
+ /**
374
+ * Return the install timestamp.
375
+ *
376
+ * @return int The install timestamp.
377
+ */
378
+ public function get_install_time() {
379
+ return $this->install;
380
+ }
381
+
382
+ /**
383
+ * We require feedback on uninstall.
384
+ *
385
+ * @return bool Either we should require feedback on uninstall or not.
386
+ */
387
+ public function require_uninstall_feedback() {
388
+ if ( $this->get_type() == 'theme' && ! $this->is_external_author() ) {
389
+ return ! get_transient( 'ti_sdk_pause_' . $this->get_key(), false );
390
+ }
391
+
392
+ if ( $this->get_type() == 'plugin' ) {
393
+
394
+ return true;
395
+ }
396
+
397
+ return false;
398
+ }
399
+
400
+ }
401
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The blog dashboard model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Widgets
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Widget_Dashboard_Blog' ) ) :
16
+ /**
17
+ * Blog dashboard widget model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Widget_Dashboard_Blog extends ThemeIsle_SDK_Widget {
20
+
21
+ /**
22
+ * @var array instance The instances.
23
+ */
24
+ protected $product;
25
+ /**
26
+ * @var array Feed items.
27
+ */
28
+ private $items = array();
29
+
30
+ /**
31
+ * ThemeIsle_SDK_Widget_Dashboard_Blog constructor.
32
+ *
33
+ * @param ThemeIsle_SDK_Product $product_object The product object.
34
+ */
35
+ public function __construct( $product_object ) {
36
+ $this->product = $product_object;
37
+ parent::__construct( $product_object );
38
+ }
39
+
40
+ /**
41
+ * Registers the hooks
42
+ */
43
+ public function setup_hooks_child() {
44
+ $this->setup_vars();
45
+ add_action( 'wp_dashboard_setup', array( &$this, 'add_widget' ) );
46
+ add_action( 'wp_network_dashboard_setup', array( &$this, 'add_widget' ) );
47
+ add_filter( 'themeisle_sdk_recommend_plugin_or_theme', array( &$this, 'recommend_plugin_or_theme' ) );
48
+ }
49
+
50
+ /**
51
+ * Setup class variables
52
+ */
53
+ function setup_vars() {
54
+ $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
55
+ $this->feeds = apply_filters(
56
+ 'themeisle_sdk_dashboard_widget_feeds', array(
57
+ 'https://themeisle.com/blog/feed',
58
+ )
59
+ );
60
+ }
61
+
62
+ /**
63
+ * Add widget to the dashboard
64
+ *
65
+ * @return string|void
66
+ */
67
+ function add_widget() {
68
+ global $wp_meta_boxes;
69
+ if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
70
+ return;
71
+ }
72
+ wp_add_dashboard_widget(
73
+ 'themeisle', $this->dashboard_name, array(
74
+ &$this,
75
+ 'render_dashboard_widget',
76
+ )
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Setup feed items.
82
+ */
83
+ private function setup_feeds() {
84
+ $items_normalized = array();
85
+ if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) {
86
+ // Load SimplePie Instance
87
+ $feed = fetch_feed( $this->feeds );
88
+ // TODO report error when is an error loading the feed
89
+ if ( is_wp_error( $feed ) ) {
90
+ return;
91
+ }
92
+
93
+ $items = $feed->get_items( 0, 5 );
94
+ foreach ( (array) $items as $item ) {
95
+ $items_normalized[] = array(
96
+ 'title' => $item->get_title(),
97
+ 'date' => $item->get_date( 'U' ),
98
+ 'link' => $item->get_permalink(),
99
+ );
100
+ }
101
+ set_transient( 'themeisle_sdk_feed_items', $items_normalized, 48 * HOUR_IN_SECONDS );
102
+ }
103
+ $this->items = $items_normalized;
104
+ }
105
+
106
+ /**
107
+ * Render widget content
108
+ */
109
+ function render_dashboard_widget() {
110
+ $this->setup_feeds();
111
+ ?>
112
+ <style type="text/css">
113
+ #themeisle ul {
114
+ margin-bottom: 0px;
115
+ }
116
+
117
+ #themeisle ul li.ti-dw-recommend-item {
118
+
119
+ padding-left: 7px;
120
+ border-top: 1px solid #eee;
121
+
122
+ margin-bottom: 0px;
123
+ padding-top: 6px;
124
+ }
125
+
126
+ #themeisle h2.hndle {
127
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALfSURBVEhL7VW/ayJBFL7/5ZqziBzIcSCHxUE4hAiCgnAQsBASOAikEAIeCAaCiJAyIBICQURYwoJoEUmxa6MWioWxURu30mq77b57s86acX+oOQhp8sFjdmbfzrfve2/efMI74IP0VTB0gz/th/8iNbQxOt0eOmoN6WgAn78cwJeoYcLf78KrSPVneU3isEQZoz0D3pt03jhDrDTERJXxWM3A5yAOIPmgce/t2IvUGFzjkDa+7C5RTx0gWbxG0v8bBXUG3fLReigk4rh55gtbsAfpGDfhVTS+VA19bYbH7BkqU/56AzNU7nrYpbI7qfbEcxfBkSOHJGO27Vk0htqEYoXvARdS+tsEJyAJY1GRkOxnGTdq2zuaRZOkJ1Wi1+h7ODlJB/l1kYRKZVyKhMwoSmUw5M4uWMhIcl9f1l1qB2m/aMkZQIE2d5BeDTGiSD0VfC4jZPmSKiO+LMJGuoRE1bkiOIW00CAdW3NuxzLmxhD1hyHmug7dbBRD9KdLc4dR6Zfgn0ffXN2EjVSMLIcOrWxuwiyyPhYGI7X0m/agqPeIib5+yit/LWILKYuUlrTa5kbMwjko7J0AXc1RLZwifRF58Us1YXMzYSMV5WQ5ZWsG5VnYaG1BxM7zKBRzOAkHac460gxK9sUnVBqbu9rhKCS9lRaq1/poCeUq7tL6uPnjSLeoBRo9/KXjslqP4Na1gbiQssiULK9gP+VVqPnFQMblnwi+WmTfIji5amLES1mn/mz9yCFVuddZdiFlIJlTK+JtH2/AaPMogzipzrZ+4yQ1qCL1JSaNDL6bf81y1aOb5R6Vhow6G1tPNK9Borl0R2NLRiEaxNEF9Wa3yrHBSarTbeHot7ySqVmYR4AucDYuaJyzkfptZ0e/FeGa03m3jOQPizCAo0QG9W2ktL5HgGt45JRgaBh1x9R1WHY0KCTnLZOW5Kw0miuZq01ITGa6Z18Db9I3xAfpm+IdSIF/du91gSA2+I8AAAAASUVORK5CYII=');
128
+ background-repeat: no-repeat;
129
+ background-position: 90% 50%;
130
+ background-size: 29px;
131
+ }
132
+
133
+ .ti-dw-feed-item {
134
+ display: flex;
135
+ align-items: center;
136
+ }
137
+
138
+ .ti-dw-feed-item a {
139
+ float: left;
140
+ width: 89.9%;
141
+ }
142
+
143
+ .ti-dw-feed-item .ti-dw-day-container {
144
+ width: 100%;
145
+ letter-spacing: 3px;
146
+ display: block;
147
+ }
148
+
149
+ .ti-dw-feed-item .ti-dw-month-container {
150
+
151
+ width: 100%;
152
+ display: block;
153
+ font-weight: 600;
154
+ padding: 0px;
155
+ margin-top: -6px;
156
+ text-transform: uppercase;
157
+ font-size: 10px;
158
+ letter-spacing: 1px;
159
+ }
160
+
161
+ .ti-dw-feed-item .ti-dw-date-container {
162
+ float: left;
163
+ min-height: 30px;
164
+ margin-right: 0.1%;
165
+ width: 10%;
166
+ text-align: center;
167
+ }
168
+
169
+ .ti-dw-recommend-item span {
170
+ color: #72777c;
171
+ }
172
+
173
+ </style>
174
+ <ul>
175
+ <?php
176
+ foreach ( $this->items as $item ) {
177
+ ?>
178
+ <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
179
+ class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
180
+ class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
181
+ href="
182
+ <?php
183
+ echo add_query_arg(
184
+ array(
185
+ 'utm_campaign' => 'feed',
186
+ 'utm_medium' => 'dashboard_widget',
187
+ ), $item['link']
188
+ );
189
+ ?>
190
+ " target="_blank"><?php echo $item['title']; ?></a>
191
+ <div class="clear"></div>
192
+ </li>
193
+ <?php
194
+ }
195
+
196
+ $recommend = apply_filters( 'themeisle_sdk_recommend_plugin_or_theme', array() );
197
+ if ( is_array( $recommend ) && ! empty( $recommend ) ) {
198
+
199
+ $type = $recommend['type'];
200
+ if ( ( $type == 'theme' && current_user_can( 'install_themes' ) ) || ( $type == 'plugin' && current_user_can( 'install_plugins' ) ) ) {
201
+ add_thickbox();
202
+ $url = add_query_arg(
203
+ array(
204
+ 'theme' => $recommend['slug'],
205
+ ), network_admin_url( 'theme-install.php' )
206
+ );
207
+
208
+ if ( 'plugin' === $type ) {
209
+
210
+ $url = add_query_arg(
211
+ array(
212
+ 'tab' => 'plugin-information',
213
+ 'plugin' => $recommend['slug'],
214
+ ), network_admin_url( 'plugin-install.php' )
215
+ );
216
+ }
217
+ ?>
218
+ <li class="ti-dw-recommend-item ">
219
+ <span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
220
+ : </span>
221
+ <?php
222
+ echo trim(
223
+ str_replace(
224
+ array(
225
+ 'lite',
226
+ 'Lite',
227
+ ), '', $recommend['name']
228
+ )
229
+ );
230
+ ?>
231
+ (<a class="thickbox open-plugin-details-modal"
232
+ href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php echo apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ); ?></a>)
233
+ </li>
234
+
235
+ <?php
236
+ }
237
+ }
238
+ ?>
239
+ </ul>
240
+
241
+ <?php
242
+
243
+ }
244
+
245
+ /**
246
+ * Either the current product is installed or not.
247
+ *
248
+ * @param array $val The current recommended product.
249
+ *
250
+ * @return bool Either we should exclude the plugin or not.
251
+ */
252
+ public function remove_current_products( $val ) {
253
+ if ( $val['type'] === 'theme' ) {
254
+ $exist = wp_get_theme( $val['slug'] );
255
+
256
+ return ! $exist->exists();
257
+ } else {
258
+ $all_plugins = array_keys( get_plugins() );
259
+ foreach ( $all_plugins as $slug ) {
260
+ if ( strpos( $slug, $val['slug'] ) !== false ) {
261
+ return false;
262
+ }
263
+ }
264
+
265
+ return true;
266
+ }
267
+ }
268
+
269
+ /**
270
+ * Fetch themes from wporg api.
271
+ *
272
+ * @param string $author The author name.
273
+ *
274
+ * @return array The list of themes.
275
+ */
276
+ function get_themes_from_wporg( $author ) {
277
+ $products = wp_remote_get(
278
+ 'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[author]=' . $author . '&request[per_page]=30&request[fields][active_installs]=true'
279
+ );
280
+ $products = json_decode( wp_remote_retrieve_body( $products ) );
281
+ if ( is_object( $products ) ) {
282
+ $products = isset( $products->themes ) ? $products->themes : array();
283
+ } else {
284
+ $products = array();
285
+ }
286
+
287
+ return $products;
288
+ }
289
+
290
+ /**
291
+ * Fetch plugin from wporg api.
292
+ *
293
+ * @param string $author The author slug.
294
+ *
295
+ * @return array The list of plugins for the selected author.
296
+ */
297
+ function get_plugins_from_wporg( $author ) {
298
+ $products = wp_remote_get(
299
+ 'https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[author]=' . $author . '&request[author]=codeinwp&request[per_page]=20&request[fields][active_installs]=true'
300
+ );
301
+ $products = json_decode( wp_remote_retrieve_body( $products ) );
302
+ if ( is_object( $products ) ) {
303
+ $products = isset( $products->plugins ) ? $products->plugins : array();
304
+ } else {
305
+ $products = array();
306
+ }
307
+
308
+ return $products;
309
+ }
310
+
311
+ /**
312
+ * Fetch products from the recomended section.
313
+ *
314
+ * @return array|mixed The list of products to use in recomended section.
315
+ */
316
+ function get_product_from_api() {
317
+ if ( false === ( $products = get_transient( 'themeisle_sdk_products' ) ) ) {
318
+ $products = array();
319
+ $themeisle_themes = $this->get_themes_from_wporg( 'themeisle' );
320
+ $codeinwp_themes = $this->get_themes_from_wporg( 'codeinwp' );
321
+
322
+ $themeisle_plugins = $this->get_plugins_from_wporg( 'themeisle' );
323
+ $codeinwp_plugins = $this->get_plugins_from_wporg( 'codeinwp' );
324
+
325
+ $all_themes = array_merge( $themeisle_themes, $codeinwp_themes );
326
+ foreach ( $all_themes as $theme ) {
327
+ if ( $theme->active_installs < 4999 ) {
328
+ continue;
329
+ }
330
+ $products[] = array(
331
+ 'name' => $theme->name,
332
+ 'type' => 'theme',
333
+ 'slug' => $theme->slug,
334
+ 'installs' => $theme->active_installs,
335
+ );
336
+ }
337
+ $all_plugins = array_merge( $themeisle_plugins, $codeinwp_plugins );
338
+ foreach ( $all_plugins as $plugin ) {
339
+ if ( $plugin->active_installs < 5999 ) {
340
+ continue;
341
+ }
342
+ $products[] = array(
343
+ 'name' => $plugin->name,
344
+ 'type' => 'plugin',
345
+ 'slug' => $plugin->slug,
346
+ 'installs' => $plugin->active_installs,
347
+ );
348
+ }
349
+ set_transient( 'themeisle_sdk_products', $products, 6 * HOUR_IN_SECONDS );
350
+ }
351
+
352
+ return $products;
353
+ }
354
+
355
+ /**
356
+ * Contact the API and fetch the recommended plugins/themes
357
+ */
358
+ function recommend_plugin_or_theme() {
359
+ $products = $this->get_product_from_api();
360
+ if ( ! is_array( $products ) ) {
361
+ $products = array();
362
+ }
363
+ $products = array_filter( $products, array( $this, 'remove_current_products' ) );
364
+ $products = array_merge( $products );
365
+ if ( count( $products ) > 1 ) {
366
+ shuffle( $products );
367
+ $products = array_slice( $products, 0, 1 );
368
+ }
369
+ $to_recommend = isset( $products[0] ) ? $products[0] : $products;
370
+
371
+ return $to_recommend;
372
+ }
373
+ }
374
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The widget model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Widgets
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Widget' ) ) :
16
+ /**
17
+ * Widget model for ThemeIsle SDK.
18
+ */
19
+ abstract class ThemeIsle_SDK_Widget {
20
+ /**
21
+ * @var ThemeIsle_SDK_Product $product Themeisle Product.
22
+ */
23
+ protected $product;
24
+
25
+ /**
26
+ * ThemeIsle_SDK_Widget constructor.
27
+ *
28
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
29
+ */
30
+ public function __construct( $product_object ) {
31
+ if ( $product_object instanceof ThemeIsle_SDK_Product ) {
32
+ $this->product = $product_object;
33
+ }
34
+ $this->setup_hooks();
35
+ }
36
+
37
+ /**
38
+ * Registers the hooks and then delegates to the child
39
+ */
40
+ public function setup_hooks() {
41
+ $this->setup_hooks_child();
42
+ }
43
+
44
+ /**
45
+ * Abstract function for delegating to the child
46
+ */
47
+ protected abstract function setup_hooks_child();
48
+
49
+ }
50
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widgets-factory.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The widgets factory class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Widgets
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Widgets_Factory' ) ) :
16
+ /**
17
+ * Widgets factory model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Widgets_Factory {
20
+
21
+ /**
22
+ * ThemeIsle_SDK_Widgets_Factory constructor.
23
+ *
24
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
25
+ * @param array $widgets the widgets.
26
+ */
27
+ public function __construct( $product_object, $widgets ) {
28
+ if ( $product_object instanceof ThemeIsle_SDK_Product && $widgets && is_array( $widgets ) ) {
29
+ foreach ( $widgets as $widget ) {
30
+ $class = 'ThemeIsle_SDK_Widget_' . str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $widget ) ) );
31
+ $instance = new $class( $product_object );
32
+ $instance->setup_hooks();
33
+ }
34
+ }
35
+ }
36
+ }
37
+ endif;
vendor/codeinwp/themeisle-sdk/composer.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "codeinwp/themeisle-sdk",
3
+ "description": "ThemeIsle SDK ",
4
+ "keywords": [
5
+ "wordpress"
6
+ ],
7
+ "homepage": "https://github.com/Codeinwp/themeisle-sdk",
8
+ "license": "GPL-2.0+",
9
+ "authors": [
10
+ {
11
+ "name": "ThemeIsle team",
12
+ "email": "friends@themeisle.com",
13
+ "homepage": "https://themeisle.com"
14
+ }
15
+ ],
16
+ "autoload": {
17
+ "files": [
18
+ "load.php"
19
+ ]
20
+ },
21
+ "support": {
22
+ "issues": "https://github.com/Codeinwp/themeisle-sdk/issues"
23
+ }
24
+ }
vendor/codeinwp/themeisle-sdk/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package ThemeIsleSDK
4
+ * Ignore this.
5
+ */
vendor/codeinwp/themeisle-sdk/load.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Loader for the ThemeIsleSDK
4
+ *
5
+ * Logic for loading always the latest SDK from the installed themes/plugins.
6
+ *
7
+ * @package ThemeIsleSDK
8
+ * @copyright Copyright (c) 2017, Marius Cristea
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 1.1.0
11
+ */
12
+
13
+ // Current SDK version and path.
14
+ $themeisle_sdk_version = '1.5.6';
15
+ $themeisle_sdk_path = dirname( __FILE__ );
16
+
17
+ global $themeisle_sdk_max_version;
18
+ global $themeisle_sdk_max_path;
19
+
20
+ if ( version_compare( $themeisle_sdk_version, $themeisle_sdk_max_version ) >= 0 ) {
21
+ $themeisle_sdk_max_version = $themeisle_sdk_version;
22
+ $themeisle_sdk_max_path = $themeisle_sdk_path;
23
+ }
24
+
25
+ // load the latest sdk version from the active Themeisle products
26
+ if ( ! function_exists( 'themeisle_sdk_load_latest' ) ) :
27
+ /**
28
+ * Always load the latest sdk version.
29
+ */
30
+ function themeisle_sdk_load_latest() {
31
+ global $themeisle_sdk_max_path;
32
+ require_once $themeisle_sdk_max_path . '/start.php';
33
+ }
34
+ endif;
35
+ add_action( 'init', 'themeisle_sdk_load_latest' );
vendor/codeinwp/themeisle-sdk/start.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File responsible for sdk files loading.
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @copyright Copyright (c) 2017, Marius Cristea
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ * @since 1.1.0
9
+ */
10
+ $products = apply_filters( 'themeisle_sdk_products', array() );
11
+ $path = dirname( __FILE__ );
12
+ $files_to_load = array(
13
+ 'class-themeisle-sdk-loader.php',
14
+ 'class-themeisle-sdk-product.php',
15
+ 'class-themeisle-sdk-logger.php',
16
+ 'class-themeisle-sdk-licenser.php',
17
+ 'class-themeisle-sdk-feedback-factory.php',
18
+ 'class-themeisle-sdk-feedback.php',
19
+ 'class-themeisle-sdk-feedback-deactivate.php',
20
+ 'class-themeisle-sdk-feedback-review.php',
21
+ 'class-themeisle-sdk-notification-manager.php',
22
+ 'class-themeisle-sdk-widget.php',
23
+ 'class-themeisle-sdk-widget-dashboard-blog.php',
24
+ 'class-themeisle-sdk-widgets-factory.php',
25
+ );
26
+
27
+ foreach ( $files_to_load as $file ) {
28
+ $file_path = $path . '/' . $file;
29
+ if ( is_readable( $file_path ) ) {
30
+ require_once $file_path;
31
+ }
32
+ }
33
+ foreach ( $products as $product ) {
34
+ ThemeIsle_SDK_Loader::init_product( $product );
35
+ }
vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,413 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+
57
+ private $classMapAuthoritative = false;
58
+
59
+ public function getPrefixes()
60
+ {
61
+ if (!empty($this->prefixesPsr0)) {
62
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
63
+ }
64
+
65
+ return array();
66
+ }
67
+
68
+ public function getPrefixesPsr4()
69
+ {
70
+ return $this->prefixDirsPsr4;
71
+ }
72
+
73
+ public function getFallbackDirs()
74
+ {
75
+ return $this->fallbackDirsPsr0;
76
+ }
77
+
78
+ public function getFallbackDirsPsr4()
79
+ {
80
+ return $this->fallbackDirsPsr4;
81
+ }
82
+
83
+ public function getClassMap()
84
+ {
85
+ return $this->classMap;
86
+ }
87
+
88
+ /**
89
+ * @param array $classMap Class to filename map
90
+ */
91
+ public function addClassMap(array $classMap)
92
+ {
93
+ if ($this->classMap) {
94
+ $this->classMap = array_merge($this->classMap, $classMap);
95
+ } else {
96
+ $this->classMap = $classMap;
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Registers a set of PSR-0 directories for a given prefix, either
102
+ * appending or prepending to the ones previously set for this prefix.
103
+ *
104
+ * @param string $prefix The prefix
105
+ * @param array|string $paths The PSR-0 root directories
106
+ * @param bool $prepend Whether to prepend the directories
107
+ */
108
+ public function add($prefix, $paths, $prepend = false)
109
+ {
110
+ if (!$prefix) {
111
+ if ($prepend) {
112
+ $this->fallbackDirsPsr0 = array_merge(
113
+ (array) $paths,
114
+ $this->fallbackDirsPsr0
115
+ );
116
+ } else {
117
+ $this->fallbackDirsPsr0 = array_merge(
118
+ $this->fallbackDirsPsr0,
119
+ (array) $paths
120
+ );
121
+ }
122
+
123
+ return;
124
+ }
125
+
126
+ $first = $prefix[0];
127
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
+
130
+ return;
131
+ }
132
+ if ($prepend) {
133
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
134
+ (array) $paths,
135
+ $this->prefixesPsr0[$first][$prefix]
136
+ );
137
+ } else {
138
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
139
+ $this->prefixesPsr0[$first][$prefix],
140
+ (array) $paths
141
+ );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Registers a set of PSR-4 directories for a given namespace, either
147
+ * appending or prepending to the ones previously set for this namespace.
148
+ *
149
+ * @param string $prefix The prefix/namespace, with trailing '\\'
150
+ * @param array|string $paths The PSR-4 base directories
151
+ * @param bool $prepend Whether to prepend the directories
152
+ *
153
+ * @throws \InvalidArgumentException
154
+ */
155
+ public function addPsr4($prefix, $paths, $prepend = false)
156
+ {
157
+ if (!$prefix) {
158
+ // Register directories for the root namespace.
159
+ if ($prepend) {
160
+ $this->fallbackDirsPsr4 = array_merge(
161
+ (array) $paths,
162
+ $this->fallbackDirsPsr4
163
+ );
164
+ } else {
165
+ $this->fallbackDirsPsr4 = array_merge(
166
+ $this->fallbackDirsPsr4,
167
+ (array) $paths
168
+ );
169
+ }
170
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
+ // Register directories for a new namespace.
172
+ $length = strlen($prefix);
173
+ if ('\\' !== $prefix[$length - 1]) {
174
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
+ }
176
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
+ } elseif ($prepend) {
179
+ // Prepend directories for an already registered namespace.
180
+ $this->prefixDirsPsr4[$prefix] = array_merge(
181
+ (array) $paths,
182
+ $this->prefixDirsPsr4[$prefix]
183
+ );
184
+ } else {
185
+ // Append directories for an already registered namespace.
186
+ $this->prefixDirsPsr4[$prefix] = array_merge(
187
+ $this->prefixDirsPsr4[$prefix],
188
+ (array) $paths
189
+ );
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Registers a set of PSR-0 directories for a given prefix,
195
+ * replacing any others previously set for this prefix.
196
+ *
197
+ * @param string $prefix The prefix
198
+ * @param array|string $paths The PSR-0 base directories
199
+ */
200
+ public function set($prefix, $paths)
201
+ {
202
+ if (!$prefix) {
203
+ $this->fallbackDirsPsr0 = (array) $paths;
204
+ } else {
205
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Registers a set of PSR-4 directories for a given namespace,
211
+ * replacing any others previously set for this namespace.
212
+ *
213
+ * @param string $prefix The prefix/namespace, with trailing '\\'
214
+ * @param array|string $paths The PSR-4 base directories
215
+ *
216
+ * @throws \InvalidArgumentException
217
+ */
218
+ public function setPsr4($prefix, $paths)
219
+ {
220
+ if (!$prefix) {
221
+ $this->fallbackDirsPsr4 = (array) $paths;
222
+ } else {
223
+ $length = strlen($prefix);
224
+ if ('\\' !== $prefix[$length - 1]) {
225
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
+ }
227
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Turns on searching the include path for class files.
234
+ *
235
+ * @param bool $useIncludePath
236
+ */
237
+ public function setUseIncludePath($useIncludePath)
238
+ {
239
+ $this->useIncludePath = $useIncludePath;
240
+ }
241
+
242
+ /**
243
+ * Can be used to check if the autoloader uses the include path to check
244
+ * for classes.
245
+ *
246
+ * @return bool
247
+ */
248
+ public function getUseIncludePath()
249
+ {
250
+ return $this->useIncludePath;
251
+ }
252
+
253
+ /**
254
+ * Turns off searching the prefix and fallback directories for classes
255
+ * that have not been registered with the class map.
256
+ *
257
+ * @param bool $classMapAuthoritative
258
+ */
259
+ public function setClassMapAuthoritative($classMapAuthoritative)
260
+ {
261
+ $this->classMapAuthoritative = $classMapAuthoritative;
262
+ }
263
+
264
+ /**
265
+ * Should class lookup fail if not found in the current class map?
266
+ *
267
+ * @return bool
268
+ */
269
+ public function isClassMapAuthoritative()
270
+ {
271
+ return $this->classMapAuthoritative;
272
+ }
273
+
274
+ /**
275
+ * Registers this instance as an autoloader.
276
+ *
277
+ * @param bool $prepend Whether to prepend the autoloader or not
278
+ */
279
+ public function register($prepend = false)
280
+ {
281
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
+ }
283
+
284
+ /**
285
+ * Unregisters this instance as an autoloader.
286
+ */
287
+ public function unregister()
288
+ {
289
+ spl_autoload_unregister(array($this, 'loadClass'));
290
+ }
291
+
292
+ /**
293
+ * Loads the given class or interface.
294
+ *
295
+ * @param string $class The name of the class
296
+ * @return bool|null True if loaded, null otherwise
297
+ */
298
+ public function loadClass($class)
299
+ {
300
+ if ($file = $this->findFile($class)) {
301
+ includeFile($file);
302
+
303
+ return true;
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Finds the path to the file where the class is defined.
309
+ *
310
+ * @param string $class The name of the class
311
+ *
312
+ * @return string|false The path if found, false otherwise
313
+ */
314
+ public function findFile($class)
315
+ {
316
+ // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
+ if ('\\' == $class[0]) {
318
+ $class = substr($class, 1);
319
+ }
320
+
321
+ // class map lookup
322
+ if (isset($this->classMap[$class])) {
323
+ return $this->classMap[$class];
324
+ }
325
+ if ($this->classMapAuthoritative) {
326
+ return false;
327
+ }
328
+
329
+ $file = $this->findFileWithExtension($class, '.php');
330
+
331
+ // Search for Hack files if we are running on HHVM
332
+ if ($file === null && defined('HHVM_VERSION')) {
333
+ $file = $this->findFileWithExtension($class, '.hh');
334
+ }
335
+
336
+ if ($file === null) {
337
+ // Remember that this class does not exist.
338
+ return $this->classMap[$class] = false;
339
+ }
340
+
341
+ return $file;
342
+ }
343
+
344
+ private function findFileWithExtension($class, $ext)
345
+ {
346
+ // PSR-4 lookup
347
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
+
349
+ $first = $class[0];
350
+ if (isset($this->prefixLengthsPsr4[$first])) {
351
+ foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
+ if (0 === strpos($class, $prefix)) {
353
+ foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
+ return $file;
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ // PSR-4 fallback dirs
363
+ foreach ($this->fallbackDirsPsr4 as $dir) {
364
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
+ return $file;
366
+ }
367
+ }
368
+
369
+ // PSR-0 lookup
370
+ if (false !== $pos = strrpos($class, '\\')) {
371
+ // namespaced class name
372
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
+ } else {
375
+ // PEAR-like class name
376
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
+ }
378
+
379
+ if (isset($this->prefixesPsr0[$first])) {
380
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
+ if (0 === strpos($class, $prefix)) {
382
+ foreach ($dirs as $dir) {
383
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
+ return $file;
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ // PSR-0 fallback dirs
392
+ foreach ($this->fallbackDirsPsr0 as $dir) {
393
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
+ return $file;
395
+ }
396
+ }
397
+
398
+ // PSR-0 include paths.
399
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
+ return $file;
401
+ }
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Scope isolated include.
407
+ *
408
+ * Prevents access to $this/self from included files.
409
+ */
410
+ function includeFile($file)
411
+ {
412
+ include $file;
413
+ }
vendor/composer/ClassLoader52.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ * --------------------------------------------------------------------------
11
+ *
12
+ * 99% of this is copied as-is from the original Composer source code and is
13
+ * released under MIT license as well. Copyright goes to:
14
+ *
15
+ * - Fabien Potencier <fabien@symfony.com>
16
+ * - Jordi Boggiano <j.boggiano@seld.be>
17
+ */
18
+
19
+ class xrstf_Composer52_ClassLoader {
20
+ private $prefixes = array();
21
+ private $fallbackDirs = array();
22
+ private $useIncludePath = false;
23
+ private $classMap = array();
24
+ private $classMapAuthoratative = false;
25
+ private $allowUnderscore = false;
26
+
27
+ /**
28
+ * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
+ */
30
+ public function setAllowUnderscore($flag) {
31
+ $this->allowUnderscore = (boolean) $flag;
32
+ }
33
+
34
+ /**
35
+ * @return array
36
+ */
37
+ public function getPrefixes() {
38
+ return $this->prefixes;
39
+ }
40
+
41
+ /**
42
+ * Turns off searching the prefix and fallback directories for classes
43
+ * that have not been registered with the class map.
44
+ *
45
+ * @param bool $classMapAuthoratative
46
+ */
47
+ public function setClassMapAuthoritative($classMapAuthoratative) {
48
+ $this->classMapAuthoratative = $classMapAuthoratative;
49
+ }
50
+
51
+ /**
52
+ * Should class lookup fail if not found in the current class map?
53
+ *
54
+ * @return bool
55
+ */
56
+ public function getClassMapAuthoratative() {
57
+ return $this->classMapAuthoratative;
58
+ }
59
+
60
+ /**
61
+ * @return array
62
+ */
63
+ public function getFallbackDirs() {
64
+ return $this->fallbackDirs;
65
+ }
66
+
67
+ /**
68
+ * @return array
69
+ */
70
+ public function getClassMap() {
71
+ return $this->classMap;
72
+ }
73
+
74
+ /**
75
+ * @param array $classMap class to filename map
76
+ */
77
+ public function addClassMap(array $classMap) {
78
+ if ($this->classMap) {
79
+ $this->classMap = array_merge($this->classMap, $classMap);
80
+ }
81
+ else {
82
+ $this->classMap = $classMap;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Registers a set of classes, merging with any others previously set.
88
+ *
89
+ * @param string $prefix the classes prefix
90
+ * @param array|string $paths the location(s) of the classes
91
+ * @param bool $prepend prepend the location(s)
92
+ */
93
+ public function add($prefix, $paths, $prepend = false) {
94
+ if (!$prefix) {
95
+ if ($prepend) {
96
+ $this->fallbackDirs = array_merge(
97
+ (array) $paths,
98
+ $this->fallbackDirs
99
+ );
100
+ }
101
+ else {
102
+ $this->fallbackDirs = array_merge(
103
+ $this->fallbackDirs,
104
+ (array) $paths
105
+ );
106
+ }
107
+
108
+ return;
109
+ }
110
+
111
+ if (!isset($this->prefixes[$prefix])) {
112
+ $this->prefixes[$prefix] = (array) $paths;
113
+ return;
114
+ }
115
+
116
+ if ($prepend) {
117
+ $this->prefixes[$prefix] = array_merge(
118
+ (array) $paths,
119
+ $this->prefixes[$prefix]
120
+ );
121
+ }
122
+ else {
123
+ $this->prefixes[$prefix] = array_merge(
124
+ $this->prefixes[$prefix],
125
+ (array) $paths
126
+ );
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Registers a set of classes, replacing any others previously set.
132
+ *
133
+ * @param string $prefix the classes prefix
134
+ * @param array|string $paths the location(s) of the classes
135
+ */
136
+ public function set($prefix, $paths) {
137
+ if (!$prefix) {
138
+ $this->fallbackDirs = (array) $paths;
139
+ return;
140
+ }
141
+
142
+ $this->prefixes[$prefix] = (array) $paths;
143
+ }
144
+
145
+ /**
146
+ * Turns on searching the include path for class files.
147
+ *
148
+ * @param bool $useIncludePath
149
+ */
150
+ public function setUseIncludePath($useIncludePath) {
151
+ $this->useIncludePath = $useIncludePath;
152
+ }
153
+
154
+ /**
155
+ * Can be used to check if the autoloader uses the include path to check
156
+ * for classes.
157
+ *
158
+ * @return bool
159
+ */
160
+ public function getUseIncludePath() {
161
+ return $this->useIncludePath;
162
+ }
163
+
164
+ /**
165
+ * Registers this instance as an autoloader.
166
+ */
167
+ public function register() {
168
+ spl_autoload_register(array($this, 'loadClass'), true);
169
+ }
170
+
171
+ /**
172
+ * Unregisters this instance as an autoloader.
173
+ */
174
+ public function unregister() {
175
+ spl_autoload_unregister(array($this, 'loadClass'));
176
+ }
177
+
178
+ /**
179
+ * Loads the given class or interface.
180
+ *
181
+ * @param string $class the name of the class
182
+ * @return bool|null true, if loaded
183
+ */
184
+ public function loadClass($class) {
185
+ if ($file = $this->findFile($class)) {
186
+ include $file;
187
+ return true;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Finds the path to the file where the class is defined.
193
+ *
194
+ * @param string $class the name of the class
195
+ * @return string|null the path, if found
196
+ */
197
+ public function findFile($class) {
198
+ if ('\\' === $class[0]) {
199
+ $class = substr($class, 1);
200
+ }
201
+
202
+ if (isset($this->classMap[$class])) {
203
+ return $this->classMap[$class];
204
+ }
205
+ elseif ($this->classMapAuthoratative) {
206
+ return false;
207
+ }
208
+
209
+ $classPath = $this->getClassPath($class);
210
+
211
+ foreach ($this->prefixes as $prefix => $dirs) {
212
+ if (0 === strpos($class, $prefix)) {
213
+ foreach ($dirs as $dir) {
214
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ foreach ($this->fallbackDirs as $dir) {
222
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
224
+ }
225
+ }
226
+
227
+ if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
+ return $file;
229
+ }
230
+
231
+ return $this->classMap[$class] = false;
232
+ }
233
+
234
+ private function getClassPath($class) {
235
+ if (false !== $pos = strrpos($class, '\\')) {
236
+ // namespaced class name
237
+ $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
+ $className = substr($class, $pos + 1);
239
+ }
240
+ else {
241
+ // PEAR-like class name
242
+ $classPath = null;
243
+ $className = $class;
244
+ }
245
+
246
+ $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
+
248
+ // restore the prefix
249
+ if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
+ $className[0] = '_';
251
+ }
252
+
253
+ $classPath .= $className.'.php';
254
+
255
+ return $classPath;
256
+ }
257
+
258
+ public static function resolveIncludePath($classPath) {
259
+ $paths = explode(PATH_SEPARATOR, get_include_path());
260
+
261
+ foreach ($paths as $path) {
262
+ $path = rtrim($path, '/\\');
263
+
264
+ if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
+ return $file;
266
+ }
267
+ }
268
+
269
+ return false;
270
+ }
271
+ }
vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) 2016 Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_files.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_files.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ '957c51f8f334b5ea3be310bfb8b3492c' => $vendorDir . '/codeinwp/themeisle-sdk/load.php',
10
+ 'e703aeb0864a8fb0d43dfe8b54c1a0ea' => $vendorDir . '/codeinwp/themeisle-sdk/load.php',
11
+ );
vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
10
+ );
vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInite6913fb43af06d5102ae810f141aed23
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ public static function getLoader()
17
+ {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInite6913fb43af06d5102ae810f141aed23', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInite6913fb43af06d5102ae810f141aed23', 'loadClassLoader'));
25
+
26
+ $map = require __DIR__ . '/autoload_namespaces.php';
27
+ foreach ($map as $namespace => $path) {
28
+ $loader->set($namespace, $path);
29
+ }
30
+
31
+ $map = require __DIR__ . '/autoload_psr4.php';
32
+ foreach ($map as $namespace => $path) {
33
+ $loader->setPsr4($namespace, $path);
34
+ }
35
+
36
+ $classMap = require __DIR__ . '/autoload_classmap.php';
37
+ if ($classMap) {
38
+ $loader->addClassMap($classMap);
39
+ }
40
+
41
+ $loader->register(true);
42
+
43
+ $includeFiles = require __DIR__ . '/autoload_files.php';
44
+ foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequiree6913fb43af06d5102ae810f141aed23($fileIdentifier, $file);
46
+ }
47
+
48
+ return $loader;
49
+ }
50
+ }
51
+
52
+ function composerRequiree6913fb43af06d5102ae810f141aed23($fileIdentifier, $file)
53
+ {
54
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
+ require $file;
56
+
57
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
58
+ }
59
+ }
vendor/composer/autoload_real_52.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real_52.php generated by xrstf/composer-php52
4
+
5
+ class ComposerAutoloaderInite64e7691549e1caf8ed453d37599105f {
6
+ private static $loader;
7
+
8
+ public static function loadClassLoader($class) {
9
+ if ('xrstf_Composer52_ClassLoader' === $class) {
10
+ require dirname(__FILE__).'/ClassLoader52.php';
11
+ }
12
+ }
13
+
14
+ /**
15
+ * @return xrstf_Composer52_ClassLoader
16
+ */
17
+ public static function getLoader() {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInite64e7691549e1caf8ed453d37599105f', 'loadClassLoader'), true /*, true */);
23
+ self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInite64e7691549e1caf8ed453d37599105f', 'loadClassLoader'));
25
+
26
+ $vendorDir = dirname(dirname(__FILE__));
27
+ $baseDir = dirname($vendorDir);
28
+ $dir = dirname(__FILE__);
29
+
30
+ $map = require $dir.'/autoload_namespaces.php';
31
+ foreach ($map as $namespace => $path) {
32
+ $loader->add($namespace, $path);
33
+ }
34
+
35
+ $classMap = require $dir.'/autoload_classmap.php';
36
+ if ($classMap) {
37
+ $loader->addClassMap($classMap);
38
+ }
39
+
40
+ $loader->register(true);
41
+
42
+ require $vendorDir . '/codeinwp/themeisle-sdk/load.php';
43
+ require $vendorDir . '/codeinwp/themeisle-sdk/load.php';
44
+
45
+ return $loader;
46
+ }
47
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "xrstf/composer-php52",
4
+ "version": "v1.0.20",
5
+ "version_normalized": "1.0.20.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/composer-php52/composer-php52.git",
9
+ "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/composer-php52/composer-php52/zipball/bd41459d5e27df8d33057842b32377c39e97a5a8",
14
+ "reference": "bd41459d5e27df8d33057842b32377c39e97a5a8",
15
+ "shasum": ""
16
+ },
17
+ "time": "2016-04-16 21:52:24",
18
+ "type": "library",
19
+ "extra": {
20
+ "branch-alias": {
21
+ "dev-default": "1.x-dev"
22
+ }
23
+ },
24
+ "installation-source": "dist",
25
+ "autoload": {
26
+ "psr-0": {
27
+ "xrstf\\Composer52": "lib/"
28
+ }
29
+ },
30
+ "notification-url": "https://packagist.org/downloads/",
31
+ "license": [
32
+ "MIT"
33
+ ]
34
+ },
35
+ {
36
+ "name": "codeinwp/themeisle-sdk",
37
+ "version": "dev-master",
38
+ "version_normalized": "9999999-dev",
39
+ "source": {
40
+ "type": "git",
41
+ "url": "https://github.com/Codeinwp/themeisle-sdk.git",
42
+ "reference": "1fb829fd268e739864b6f1822239c1112d80853f"
43
+ },
44
+ "dist": {
45
+ "type": "zip",
46
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/1fb829fd268e739864b6f1822239c1112d80853f",
47
+ "reference": "1fb829fd268e739864b6f1822239c1112d80853f",
48
+ "shasum": ""
49
+ },
50
+ "time": "2017-08-22 16:09:34",
51
+ "type": "library",
52
+ "installation-source": "dist",
53
+ "autoload": {
54
+ "files": [
55
+ "load.php"
56
+ ]
57
+ },
58
+ "license": [
59
+ "GPL-2.0+"
60
+ ],
61
+ "authors": [
62
+ {
63
+ "name": "ThemeIsle team",
64
+ "email": "friends@themeisle.com",
65
+ "homepage": "https://themeisle.com"
66
+ }
67
+ ],
68
+ "description": "ThemeIsle SDK ",
69
+ "homepage": "https://github.com/Codeinwp/themeisle-sdk",
70
+ "keywords": [
71
+ "wordpress"
72
+ ],
73
+ "support": {
74
+ "issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
75
+ "source": "https://github.com/Codeinwp/themeisle-sdk/tree/master"
76
+ }
77
+ }
78
+ ]
vendor/xrstf/composer-php52/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2013 Christoph Mewes
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is furnished
8
+ to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
vendor/xrstf/composer-php52/README.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PHP 5.2 Autoloading for Composer
2
+ ================================
3
+
4
+ This package provides an easy way to get a PHP 5.2 compatible autoloader out of Composer. The generated autoloader is fully compatible to the original and is written into separate files, each ending with `_52.php`.
5
+
6
+ Legacy
7
+ ------
8
+
9
+ Please do not use this, if you can avoid it. It's a horrible hack, often breaks and is extremely tied to Composer's interna. This package was originally developed in 2012, when PHP 5.2 was much more common on cheap webhosts.
10
+
11
+ In 2016, this package has been moved from Bitbucket to a Github organization, because the original developer could no longer reliably maintain it. This is the reason for this legacy package name ``xrstf/...``.
12
+
13
+ Usage
14
+ -----
15
+
16
+ In your project's `composer.json`, add the following lines:
17
+
18
+ ```json
19
+ {
20
+ "require": {
21
+ "xrstf/composer-php52": "1.*"
22
+ },
23
+ "scripts": {
24
+ "post-install-cmd": [
25
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
26
+ ],
27
+ "post-update-cmd": [
28
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
29
+ ],
30
+ "post-autoload-dump": [
31
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
32
+ ]
33
+ }
34
+ }
35
+ ```
36
+
37
+ After the next update/install, you will have a `vendor/autoload_52.php` file, that you can simply include and use in PHP 5.2 projects.
vendor/xrstf/composer-php52/composer.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "xrstf/composer-php52",
3
+ "license": "MIT",
4
+ "support": {
5
+ "source": "https://github.com/composer-php52/composer-php52",
6
+ "issues": "https://github.com/composer-php52/composer-php52/issues"
7
+ },
8
+ "autoload": {
9
+ "psr-0": {
10
+ "xrstf\\Composer52": "lib/"
11
+ }
12
+ },
13
+ "scripts": {
14
+ "post-install-cmd": [
15
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
16
+ ],
17
+ "post-update-cmd": [
18
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
19
+ ]
20
+ },
21
+ "extra": {
22
+ "branch-alias": {
23
+ "dev-default": "1.x-dev"
24
+ }
25
+ }
26
+ }
vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ * --------------------------------------------------------------------------
11
+ *
12
+ * 99% of this is copied as-is from the original Composer source code and is
13
+ * released under MIT license as well. Copyright goes to:
14
+ *
15
+ * - Igor Wiedler <igor@wiedler.ch>
16
+ * - Jordi Boggiano <j.boggiano@seld.be>
17
+ */
18
+
19
+ namespace xrstf\Composer52;
20
+
21
+ use Composer\Autoload\AutoloadGenerator as BaseGenerator;
22
+ use Composer\Autoload\ClassMapGenerator;
23
+ use Composer\Config;
24
+ use Composer\Installer\InstallationManager;
25
+ use Composer\Package\AliasPackage;
26
+ use Composer\Package\PackageInterface;
27
+ use Composer\Repository\InstalledRepositoryInterface;
28
+ use Composer\Util\Filesystem;
29
+
30
+ class AutoloadGenerator extends BaseGenerator {
31
+
32
+ /**
33
+ * @var bool
34
+ */
35
+ private $classMapAuthoritative = false;
36
+
37
+ public function __construct() {
38
+ // do nothing (but keep this constructor so we can build an instance without the need for an event dispatcher)
39
+ }
40
+
41
+ /**
42
+ * Whether or not generated autoloader considers the class map
43
+ * authoritative.
44
+ *
45
+ * @param bool $classMapAuthoritative
46
+ */
47
+ public function setClassMapAuthoritative($classMapAuthoritative)
48
+ {
49
+ $this->classMapAuthoritative = (boolean) $classMapAuthoritative;
50
+ }
51
+
52
+ public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') {
53
+ if ($this->classMapAuthoritative) {
54
+ // Force scanPsr0Packages when classmap is authoritative
55
+ $scanPsr0Packages = true;
56
+ }
57
+
58
+ $filesystem = new Filesystem();
59
+ $filesystem->ensureDirectoryExists($config->get('vendor-dir'));
60
+
61
+ $cwd = getcwd();
62
+ $basePath = $filesystem->normalizePath($cwd);
63
+ $vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
64
+ $targetDir = $vendorPath.'/'.$targetDir;
65
+ $filesystem->ensureDirectoryExists($targetDir);
66
+
67
+ $useGlobalIncludePath = (bool) $config->get('use-include-path');
68
+ $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
69
+ $classMapAuthoritative = $config->get('classmap-authoritative');
70
+
71
+ $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
72
+ $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
73
+
74
+ $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
75
+ $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
76
+
77
+ // add 5.2 compat
78
+ $vendorPathCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
79
+ $vendorPathToTargetDirCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathToTargetDirCode);
80
+
81
+ $packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
82
+ $autoloads = $this->parseAutoloads($packageMap, $mainPackage);
83
+
84
+ // add custom psr-0 autoloading if the root package has a target dir
85
+ $targetDirLoader = null;
86
+ $mainAutoload = $mainPackage->getAutoload();
87
+ if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
88
+ $levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
89
+ $prefixes = implode(', ', array_map(function ($prefix) {
90
+ return var_export($prefix, true);
91
+ }, array_keys($mainAutoload['psr-0'])));
92
+
93
+ $baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
94
+
95
+ $targetDirLoader = <<<EOF
96
+
97
+ public static function autoload(\$class) {
98
+ \$dir = $baseDirFromTargetDirCode.'/';
99
+ \$prefixes = array($prefixes);
100
+
101
+ foreach (\$prefixes as \$prefix) {
102
+ if (0 !== strpos(\$class, \$prefix)) {
103
+ continue;
104
+ }
105
+
106
+ \$path = explode(DIRECTORY_SEPARATOR, self::getClassPath(\$class));
107
+ \$path = \$dir.implode('/', array_slice(\$path, $levels));
108
+
109
+ if (!\$path = self::resolveIncludePath(\$path)) {
110
+ return false;
111
+ }
112
+
113
+ require \$path;
114
+ return true;
115
+ }
116
+ }
117
+
118
+ EOF;
119
+ }
120
+
121
+ $filesCode = "";
122
+ $autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
123
+ foreach ($autoloads['files'] as $functionFile) {
124
+ // don't include file if it is using PHP 5.3+ syntax
125
+ // https://bitbucket.org/xrstf/composer-php52/issue/4
126
+ if ($this->isPHP53($functionFile)) {
127
+ $filesCode .= '// require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile)."; // disabled because of PHP 5.3 syntax\n";
128
+ }
129
+ else {
130
+ $filesCode .= ' require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile).";\n";
131
+ }
132
+ }
133
+
134
+ if (!$suffix) {
135
+ $suffix = md5(uniqid('', true));
136
+ }
137
+
138
+ $includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode);
139
+
140
+ file_put_contents($vendorPath.'/autoload_52.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
141
+ file_put_contents($targetDir.'/autoload_real_52.php', $this->getAutoloadRealFile(true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader));
142
+
143
+ // use stream_copy_to_stream instead of copy
144
+ // to work around https://bugs.php.net/bug.php?id=64634
145
+ $sourceLoader = fopen(__DIR__.'/ClassLoader.php', 'r');
146
+ $targetLoader = fopen($targetDir.'/ClassLoader52.php', 'w+');
147
+ stream_copy_to_stream($sourceLoader, $targetLoader);
148
+ fclose($sourceLoader);
149
+ fclose($targetLoader);
150
+ unset($sourceLoader, $targetLoader);
151
+ }
152
+
153
+ protected function isPHP53($file) {
154
+ $tokens = token_get_all(file_get_contents($file));
155
+ $php53 = array(T_DIR, T_GOTO, T_NAMESPACE, T_NS_C, T_NS_SEPARATOR, T_USE);
156
+
157
+ // PHP 5.4+
158
+ if (defined('T_TRAIT')) {
159
+ $php53[] = T_TRAIT;
160
+ $php53[] = T_TRAIT_C;
161
+ $php53[] = T_TRAIT_C;
162
+ }
163
+
164
+ // PHP 5.5+
165
+ if (defined('T_FINALLY')) {
166
+ $php53[] = T_FINALLY;
167
+ $php53[] = T_YIELD;
168
+ }
169
+
170
+ foreach ($tokens as $token) {
171
+ if (is_array($token) && in_array($token[0], $php53)) {
172
+ return true;
173
+ }
174
+ }
175
+
176
+ return false;
177
+ }
178
+
179
+ protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) {
180
+ $includePaths = array();
181
+
182
+ foreach ($packageMap as $item) {
183
+ list($package, $installPath) = $item;
184
+
185
+ if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
186
+ $installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
187
+ }
188
+
189
+ foreach ($package->getIncludePaths() as $includePath) {
190
+ $includePath = trim($includePath, '/');
191
+ $includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
192
+ }
193
+ }
194
+
195
+ if (!$includePaths) {
196
+ return;
197
+ }
198
+
199
+ $includePathsFile = <<<EOF
200
+ <?php
201
+
202
+ // include_paths_52.php generated by xrstf/composer-php52
203
+
204
+ \$vendorDir = $vendorPathCode;
205
+ \$baseDir = $appBaseDirCode;
206
+
207
+ return array(
208
+
209
+ EOF;
210
+
211
+ foreach ($includePaths as $path) {
212
+ $includePathsFile .= "\t" . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
213
+ }
214
+
215
+ return $includePathsFile . ");\n";
216
+ }
217
+
218
+ protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) {
219
+ return <<<AUTOLOAD
220
+ <?php
221
+
222
+ // autoload_52.php generated by xrstf/composer-php52
223
+
224
+ require_once $vendorPathToTargetDirCode.'/autoload_real_52.php';
225
+
226
+ return ComposerAutoloaderInit$suffix::getLoader();
227
+
228
+ AUTOLOAD;
229
+ }
230
+
231
+ protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion = 70000) {
232
+ // TODO the class ComposerAutoloaderInit should be revert to a closure
233
+ // when APC has been fixed:
234
+ // - https://github.com/composer/composer/issues/959
235
+ // - https://bugs.php.net/bug.php?id=52144
236
+ // - https://bugs.php.net/bug.php?id=61576
237
+ // - https://bugs.php.net/bug.php?id=59298
238
+
239
+ if ($filesCode) {
240
+ $filesCode = "\n\n".rtrim($filesCode);
241
+ }
242
+
243
+ $file = <<<HEADER
244
+ <?php
245
+
246
+ // autoload_real_52.php generated by xrstf/composer-php52
247
+
248
+ class ComposerAutoloaderInit$suffix {
249
+ private static \$loader;
250
+
251
+ public static function loadClassLoader(\$class) {
252
+ if ('xrstf_Composer52_ClassLoader' === \$class) {
253
+ require dirname(__FILE__).'/ClassLoader52.php';
254
+ }
255
+ }
256
+
257
+ /**
258
+ * @return xrstf_Composer52_ClassLoader
259
+ */
260
+ public static function getLoader() {
261
+ if (null !== self::\$loader) {
262
+ return self::\$loader;
263
+ }
264
+
265
+ spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true /*, true */);
266
+ self::\$loader = \$loader = new xrstf_Composer52_ClassLoader();
267
+ spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
268
+
269
+ \$vendorDir = $vendorPathCode;
270
+ \$baseDir = $appBaseDirCode;
271
+ \$dir = dirname(__FILE__);
272
+
273
+
274
+ HEADER;
275
+
276
+ if ($useIncludePath) {
277
+ $file .= <<<'INCLUDE_PATH'
278
+ $includePaths = require $dir.'/include_paths.php';
279
+ array_push($includePaths, get_include_path());
280
+ set_include_path(implode(PATH_SEPARATOR, $includePaths));
281
+
282
+
283
+ INCLUDE_PATH;
284
+ }
285
+
286
+ $file .= <<<'PSR0'
287
+ $map = require $dir.'/autoload_namespaces.php';
288
+ foreach ($map as $namespace => $path) {
289
+ $loader->add($namespace, $path);
290
+ }
291
+
292
+
293
+ PSR0;
294
+
295
+ if ($useClassMap) {
296
+ $file .= <<<'CLASSMAP'
297
+ $classMap = require $dir.'/autoload_classmap.php';
298
+ if ($classMap) {
299
+ $loader->addClassMap($classMap);
300
+ }
301
+
302
+
303
+ CLASSMAP;
304
+ }
305
+
306
+ if ($this->classMapAuthoritative) {
307
+ $file .= <<<'CLASSMAPAUTHORITATIVE'
308
+ $loader->setClassMapAuthoritative(true);
309
+
310
+ CLASSMAPAUTHORITATIVE;
311
+ }
312
+
313
+ if ($useGlobalIncludePath) {
314
+ $file .= <<<'INCLUDEPATH'
315
+ $loader->setUseIncludePath(true);
316
+
317
+
318
+ INCLUDEPATH;
319
+ }
320
+
321
+ if ($targetDirLoader) {
322
+ $file .= <<<REGISTER_AUTOLOAD
323
+ spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true);
324
+
325
+
326
+ REGISTER_AUTOLOAD;
327
+
328
+ }
329
+
330
+ $file .= <<<METHOD_FOOTER
331
+ \$loader->register($prependAutoloader);{$filesCode}
332
+
333
+ return \$loader;
334
+ }
335
+
336
+ METHOD_FOOTER;
337
+
338
+ $file .= $targetDirLoader;
339
+
340
+ return $file . <<<FOOTER
341
+ }
342
+
343
+ FOOTER;
344
+
345
+ }
346
+ }
vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ *
10
+ * --------------------------------------------------------------------------
11
+ *
12
+ * 99% of this is copied as-is from the original Composer source code and is
13
+ * released under MIT license as well. Copyright goes to:
14
+ *
15
+ * - Fabien Potencier <fabien@symfony.com>
16
+ * - Jordi Boggiano <j.boggiano@seld.be>
17
+ */
18
+
19
+ class xrstf_Composer52_ClassLoader {
20
+ private $prefixes = array();
21
+ private $fallbackDirs = array();
22
+ private $useIncludePath = false;
23
+ private $classMap = array();
24
+ private $classMapAuthoratative = false;
25
+ private $allowUnderscore = false;
26
+
27
+ /**
28
+ * @param boolean $flag true to allow class names with a leading underscore, false to disable
29
+ */
30
+ public function setAllowUnderscore($flag) {
31
+ $this->allowUnderscore = (boolean) $flag;
32
+ }
33
+
34
+ /**
35
+ * @return array
36
+ */
37
+ public function getPrefixes() {
38
+ return $this->prefixes;
39
+ }
40
+
41
+ /**
42
+ * Turns off searching the prefix and fallback directories for classes
43
+ * that have not been registered with the class map.
44
+ *
45
+ * @param bool $classMapAuthoratative
46
+ */
47
+ public function setClassMapAuthoritative($classMapAuthoratative) {
48
+ $this->classMapAuthoratative = $classMapAuthoratative;
49
+ }
50
+
51
+ /**
52
+ * Should class lookup fail if not found in the current class map?
53
+ *
54
+ * @return bool
55
+ */
56
+ public function getClassMapAuthoratative() {
57
+ return $this->classMapAuthoratative;
58
+ }
59
+
60
+ /**
61
+ * @return array
62
+ */
63
+ public function getFallbackDirs() {
64
+ return $this->fallbackDirs;
65
+ }
66
+
67
+ /**
68
+ * @return array
69
+ */
70
+ public function getClassMap() {
71
+ return $this->classMap;
72
+ }
73
+
74
+ /**
75
+ * @param array $classMap class to filename map
76
+ */
77
+ public function addClassMap(array $classMap) {
78
+ if ($this->classMap) {
79
+ $this->classMap = array_merge($this->classMap, $classMap);
80
+ }
81
+ else {
82
+ $this->classMap = $classMap;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Registers a set of classes, merging with any others previously set.
88
+ *
89
+ * @param string $prefix the classes prefix
90
+ * @param array|string $paths the location(s) of the classes
91
+ * @param bool $prepend prepend the location(s)
92
+ */
93
+ public function add($prefix, $paths, $prepend = false) {
94
+ if (!$prefix) {
95
+ if ($prepend) {
96
+ $this->fallbackDirs = array_merge(
97
+ (array) $paths,
98
+ $this->fallbackDirs
99
+ );
100
+ }
101
+ else {
102
+ $this->fallbackDirs = array_merge(
103
+ $this->fallbackDirs,
104
+ (array) $paths
105
+ );
106
+ }
107
+
108
+ return;
109
+ }
110
+
111
+ if (!isset($this->prefixes[$prefix])) {
112
+ $this->prefixes[$prefix] = (array) $paths;
113
+ return;
114
+ }
115
+
116
+ if ($prepend) {
117
+ $this->prefixes[$prefix] = array_merge(
118
+ (array) $paths,
119
+ $this->prefixes[$prefix]
120
+ );
121
+ }
122
+ else {
123
+ $this->prefixes[$prefix] = array_merge(
124
+ $this->prefixes[$prefix],
125
+ (array) $paths
126
+ );
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Registers a set of classes, replacing any others previously set.
132
+ *
133
+ * @param string $prefix the classes prefix
134
+ * @param array|string $paths the location(s) of the classes
135
+ */
136
+ public function set($prefix, $paths) {
137
+ if (!$prefix) {
138
+ $this->fallbackDirs = (array) $paths;
139
+ return;
140
+ }
141
+
142
+ $this->prefixes[$prefix] = (array) $paths;
143
+ }
144
+
145
+ /**
146
+ * Turns on searching the include path for class files.
147
+ *
148
+ * @param bool $useIncludePath
149
+ */
150
+ public function setUseIncludePath($useIncludePath) {
151
+ $this->useIncludePath = $useIncludePath;
152
+ }
153
+
154
+ /**
155
+ * Can be used to check if the autoloader uses the include path to check
156
+ * for classes.
157
+ *
158
+ * @return bool
159
+ */
160
+ public function getUseIncludePath() {
161
+ return $this->useIncludePath;
162
+ }
163
+
164
+ /**
165
+ * Registers this instance as an autoloader.
166
+ */
167
+ public function register() {
168
+ spl_autoload_register(array($this, 'loadClass'), true);
169
+ }
170
+
171
+ /**
172
+ * Unregisters this instance as an autoloader.
173
+ */
174
+ public function unregister() {
175
+ spl_autoload_unregister(array($this, 'loadClass'));
176
+ }
177
+
178
+ /**
179
+ * Loads the given class or interface.
180
+ *
181
+ * @param string $class the name of the class
182
+ * @return bool|null true, if loaded
183
+ */
184
+ public function loadClass($class) {
185
+ if ($file = $this->findFile($class)) {
186
+ include $file;
187
+ return true;
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Finds the path to the file where the class is defined.
193
+ *
194
+ * @param string $class the name of the class
195
+ * @return string|null the path, if found
196
+ */
197
+ public function findFile($class) {
198
+ if ('\\' === $class[0]) {
199
+ $class = substr($class, 1);
200
+ }
201
+
202
+ if (isset($this->classMap[$class])) {
203
+ return $this->classMap[$class];
204
+ }
205
+ elseif ($this->classMapAuthoratative) {
206
+ return false;
207
+ }
208
+
209
+ $classPath = $this->getClassPath($class);
210
+
211
+ foreach ($this->prefixes as $prefix => $dirs) {
212
+ if (0 === strpos($class, $prefix)) {
213
+ foreach ($dirs as $dir) {
214
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
215
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
216
+ }
217
+ }
218
+ }
219
+ }
220
+
221
+ foreach ($this->fallbackDirs as $dir) {
222
+ if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
223
+ return $dir.DIRECTORY_SEPARATOR.$classPath;
224
+ }
225
+ }
226
+
227
+ if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
228
+ return $file;
229
+ }
230
+
231
+ return $this->classMap[$class] = false;
232
+ }
233
+
234
+ private function getClassPath($class) {
235
+ if (false !== $pos = strrpos($class, '\\')) {
236
+ // namespaced class name
237
+ $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
238
+ $className = substr($class, $pos + 1);
239
+ }
240
+ else {
241
+ // PEAR-like class name
242
+ $classPath = null;
243
+ $className = $class;
244
+ }
245
+
246
+ $className = str_replace('_', DIRECTORY_SEPARATOR, $className);
247
+
248
+ // restore the prefix
249
+ if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
250
+ $className[0] = '_';
251
+ }
252
+
253
+ $classPath .= $className.'.php';
254
+
255
+ return $classPath;
256
+ }
257
+
258
+ public static function resolveIncludePath($classPath) {
259
+ $paths = explode(PATH_SEPARATOR, get_include_path());
260
+
261
+ foreach ($paths as $path) {
262
+ $path = rtrim($path, '/\\');
263
+
264
+ if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
265
+ return $file;
266
+ }
267
+ }
268
+
269
+ return false;
270
+ }
271
+ }
vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
4
+ *
5
+ * This file is released under the terms of the MIT license. You can find the
6
+ * complete text in the attached LICENSE file or online at:
7
+ *
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ */
10
+
11
+ namespace xrstf\Composer52;
12
+
13
+ use Composer\Repository\CompositeRepository;
14
+ use Composer\Script\Event;
15
+
16
+ class Generator {
17
+ public static function onPostInstallCmd(Event $event) {
18
+ $composer = $event->getComposer();
19
+ $installationManager = $composer->getInstallationManager();
20
+ $repoManager = $composer->getRepositoryManager();
21
+ $localRepo = $repoManager->getLocalRepository();
22
+ $package = $composer->getPackage();
23
+ $config = $composer->getConfig();
24
+
25
+ // We can't gain access to the Command's input object, so we have to look
26
+ // for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works
27
+ // (always returns an empty array), nor does Symfony's Console Input, as
28
+ // it expects a full definition of the current command line and we can't
29
+ // provide that.
30
+
31
+ $args = $_SERVER['argv'];
32
+ $optimize = in_array('-o', $args) || in_array('--optimize-autoloader', $args) || in_array('--optimize', $args);
33
+
34
+ $suffix = $config->get('autoloader-suffix');
35
+
36
+ $generator = new AutoloadGenerator();
37
+ $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix);
38
+ }
39
+ }
wp-product-review.php CHANGED
@@ -2,66 +2,98 @@
2
  /**
3
  * Main loader file
4
  *
5
- * @package WPPR
6
- * @author ThemeIsle
7
- * @since 1.0.0
 
8
  *
 
 
 
9
  *
10
- * Plugin Name: WP Product Review Lite
11
- * Description: The highest rated and most complete review plugin, now with rich snippets support. Easily turn your basic posts into in-depth reviews.
12
- * Version: 2.9.8
13
- * Author: Themeisle
14
- * Author URI: http://themeisle.com/
15
- * Plugin URI: http://themeisle.com/plugins/wp-product-review-lite/
 
16
  * Requires at least: 3.5
17
- * Tested up to: 4.6
18
- * Stable tag: trunk
19
- * License: GPLv2 or later
20
- * License URI: http://www.gnu.org/licenses/gpl-2.0.html
21
- * Text Domain: cwppos
22
- * Domain Path: /languages
 
 
 
23
  */
24
 
25
- define( 'WPPR_LITE_VERSION', '2.9.8' );
26
- define( 'WPPR_PATH',dirname( __FILE__ ) );
27
- define( 'WPPR_SLUG', 'wppr' );
28
- define( 'WPPR_URL',plugins_url( 'wp-product-review' ) );
29
 
30
- if ( wp_get_theme() !== 'Reviewgine Affiliate PRO' ) {
31
- include 'admin/functions.php';
32
- include 'inc/wppr-filters.php';
33
- include 'inc/cwp_metabox.php';
34
- include 'inc/cwp_frontpage.php';
35
- include 'inc/cwp_top_products_widget.php';
36
- include 'inc/cwp_latest_products_widget.php';
37
- include 'inc/cwp_comment.php';
38
- include 'inc/cwp_js_preloader.php';
39
- include 'inc/wppr-main.php';
40
- include 'inc/abtesting/abtesting.php';
41
  }
42
 
43
- add_filter( WPPR_SLUG . '_upsell_config', 'wppr_upsell_config' );
44
- if ( class_exists( 'TIABTesting' ) ) {
 
 
 
 
 
 
45
 
46
- $abtesting = new TIABTesting( WPPR_SLUG, WPPR_LITE_VERSION );
 
47
 
48
- }
49
- function wppr_upsell_config( $config ) {
50
- return array(
51
- 'preloader' => array(
52
- __( ' In order to be able to automatically load your options from another posts, you need the PRO add-on', 'cwppos' ) . '<a href="http://bit.ly/2bpC3vT" target="_blank" class="preload_info_upsell">' . __( 'View Preload features','cwppos' ) . '</a>',
53
- '<i>' . __( ' You can always import options from other reviews using the preloader feature from the PRO add-on', 'cwppos' ) . '</i><a href="http://bit.ly/2c1QNFK" target="_blank" class="preload_info_upsell">' . __( 'View more PRO features','cwppos' ) . '</a>',
54
- '<i>' . __( ' Build review more easily by importing them from other posts using the preloader feature from the pro addon', 'cwppos' ) . '</i><a href="http://bit.ly/2bT89Sk" target="_blank" class="preload_info_upsell">' . __( 'View details','cwppos' ) . '</a>',
55
- ),
56
- 'amazon_title' => array(
57
- __( 'Hold on', 'cwppos' ),
58
- __( 'Breaking news', 'cwppos' ),
59
- __( 'Review tip', 'cwppos' ),
60
- __( 'Integrate with Amazon', 'cwppos' ),
61
- ),
62
- 'amazon_body' => array(
63
- __( "Do you know that you can import products directly from your amazon affiliate account using the <a href='http://bit.ly/2cjpsux'>PRO</a> version", 'cwppos' ),
64
- __( "Do you know that you can import products from amazon and keep them synced using the <a href='http://bit.ly/2cEefYy'>PRO</a> version ", 'cwppos' ),
65
- ),
 
 
 
 
 
 
 
 
 
 
66
  );
67
  }
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Main loader file
4
  *
5
+ * This file is read by WordPress to generate the plugin information in the plugin
6
+ * admin area. This file also includes all of the dependencies used by the plugin,
7
+ * registers the activation and deactivation functions, and defines a function
8
+ * that starts the plugin.
9
  *
10
+ * @link https://themeisle.com/
11
+ * @since 3.0.0
12
+ * @package Wppr
13
  *
14
+ * @wordpress-plugin
15
+ * Plugin Name: WP Product Review Lite
16
+ * Plugin URI: https://themeisle.com/plugins/wp-product-review/
17
+ * Description: The highest rated and most complete review plugin, now with rich snippets support. Easily turn your basic posts into in-depth reviews.
18
+ * Version: 3.0.0
19
+ * Author: ThemeIsle
20
+ * Author URI: https://themeisle.com/
21
  * Requires at least: 3.5
22
+ * Tested up to: 4.6
23
+ * Stable tag: trunk
24
+ * WordPress Available: yes
25
+ * Pro Slug: wp-product-review-pro
26
+ * Requires License: no
27
+ * License: GPLv2 or later
28
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
29
+ * Text Domain: wp-product-review
30
+ * Domain Path: /languages
31
  */
32
 
33
+ // If this file is called directly, abort.
34
+ if ( ! defined( 'WPINC' ) ) {
35
+ die;
36
+ }
37
 
38
+ /**
39
+ * The code that runs during plugin activation.
40
+ * This action is documented in includes/class-wppr-activator.php
41
+ */
42
+ function activate_wppr() {
43
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-wppr-activator.php';
44
+ Wppr_Activator::activate();
 
 
 
 
45
  }
46
 
47
+ /**
48
+ * The code that runs during plugin deactivation.
49
+ * This action is documented in includes/class-wppr-deactivator.php
50
+ */
51
+ function deactivate_wppr() {
52
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-wppr-deactivator.php';
53
+ Wppr_Deactivator::deactivate();
54
+ }
55
 
56
+ register_activation_hook( __FILE__, 'activate_wppr' );
57
+ register_deactivation_hook( __FILE__, 'deactivate_wppr' );
58
 
59
+ /**
60
+ * Begins execution of the plugin.
61
+ *
62
+ * Since everything within the plugin is registered via hooks,
63
+ * then kicking off the plugin from this point in the file does
64
+ * not affect the page life cycle.
65
+ *
66
+ * @since 3.0.0
67
+ */
68
+ function run_wppr() {
69
+
70
+ define( 'WPPR_LITE_VERSION', '3.0.0' );
71
+ define( 'WPPR_PATH', dirname( __FILE__ ) );
72
+ define( 'WPPR_SLUG', 'wppr' );
73
+ define( 'WPPR_UPSELL_LINK', 'https://themeisle.com/plugins/wp-product-review/' );
74
+ define( 'WPPR_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ) );
75
+
76
+ $plugin = new WPPR();
77
+ $plugin->run();
78
+ $vendor_file = WPPR_PATH . '/vendor/autoload_52.php';
79
+ if ( is_readable( $vendor_file ) ) {
80
+ require_once $vendor_file;
81
+ }
82
+ add_filter(
83
+ 'themeisle_sdk_products', function ( $products ) {
84
+ $products[] = __FILE__;
85
+ return $products;
86
+ }
87
  );
88
  }
89
+
90
+ require( 'class-wppr-autoloader.php' );
91
+ WPPR_Autoloader::define_namespaces( array( 'WPPR' ) );
92
+ /**
93
+ * Invocation of the Autoloader::loader method.
94
+ *
95
+ * @since 1.0.0
96
+ */
97
+ spl_autoload_register( array( 'WPPR_Autoloader', 'loader' ) );
98
+
99
+ run_wppr();