Version Description
Download this release
Release Info
Developer | MyThemeShop |
Plugin | WP Review |
Version | 5.1.0 |
Comparing to | |
See all releases |
Code changes from version 5.0.8 to 5.1.0
- LICENSE +674 -0
- admin/activation.php +8 -1
- admin/admin.php +134 -153
- admin/assets/css/admin.css +1 -343
- admin/assets/js/admin.js +40 -41
- admin/assets/js/review-items.js +9 -0
- admin/class-wp-review-form-field.php +16 -12
- admin/{import.php → class-wp-review-importer.php} +11 -0
- admin/class-wp-review-options.php +11 -11
- admin/demo-importer.php +6 -3
- admin/demo-importer/class-wp-review-demo-importer.php +3 -0
- admin/font-awesome-icons.php +2 -0
- admin/metaboxes.php +212 -173
- admin/options/hello-bar.php +14 -10
- admin/options/multisite.php +262 -231
- admin/options/popup.php +16 -12
- admin/options/review.php +237 -183
- admin/review-options-meta-box.php +34 -21
- box-templates/global/partials/review-schema.php +14 -14
- comments/comments.php +26 -21
- includes/ajax.php +98 -74
- includes/comments.php +90 -51
- includes/enqueue.php +10 -11
- includes/functions.php +767 -506
- includes/schemas.php +15 -15
- includes/shortcodes.php +6 -6
- includes/widgets/class-wp-review-tab-widget.php +174 -109
- public/css/wp-review.css +3 -352
- rating-types/circle-input.php +8 -0
- rating-types/circle-output.php +8 -0
- rating-types/percentage-input.php +2 -2
- rating-types/percentage-output.php +3 -3
- rating-types/point-input.php +2 -2
- rating-types/point-output.php +5 -4
- rating-types/star-input.php +4 -5
- rating-types/star-output.php +29 -21
- rating-types/thumbs-input.php +8 -0
- rating-types/thumbs-output.php +8 -0
- readme.txt +8 -1
- template-list.php +180 -177
- wp-review.php +3 -3
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. <https://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 <https://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 |
+
<program> Copyright (C) <year> <name of author>
|
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 |
+
<https://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 |
+
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
admin/activation.php
CHANGED
@@ -1 +1,8 @@
|
|
1 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugins activation code
|
4 |
+
*
|
5 |
+
* @package WP_Review
|
6 |
+
*/
|
7 |
+
|
8 |
+
// Silence is gold.
|
admin/admin.php
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
* @param string $hook_suffix Admin page hook suffix.
|
19 |
*/
|
20 |
function wp_review_admin_style( $hook_suffix ) {
|
21 |
-
if ( ! in_array( $hook_suffix, array( 'post-new.php', 'edit-comments.php', 'post.php', 'edit.php', 'widgets.php', 'settings_page_wp-review/admin/options' ) ) ) {
|
22 |
return;
|
23 |
}
|
24 |
|
@@ -26,14 +26,39 @@ function wp_review_admin_style( $hook_suffix ) {
|
|
26 |
return;
|
27 |
}
|
28 |
|
29 |
-
|
|
|
30 |
|
31 |
-
|
32 |
-
wp_enqueue_style( 'select2', WP_REVIEW_URI . 'admin/assets/css/select2.min.css', array(), '4.0.6-rc.0' );
|
33 |
|
34 |
-
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
$inline_css = '.column-wp_review_rating .pro-only-notice, .latestPost-review-wrapper .pro-only-notice { display: none; }';
|
39 |
wp_add_inline_style( 'wp-review-admin-style', $inline_css );
|
@@ -41,18 +66,17 @@ function wp_review_admin_style( $hook_suffix ) {
|
|
41 |
wp_enqueue_style( 'magnificPopup', WP_REVIEW_ASSETS . 'css/magnific-popup.css', array(), '1.1.0' );
|
42 |
wp_enqueue_script( 'magnificPopup', WP_REVIEW_ASSETS . 'js/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
wp_register_script( 'js-cookie', WP_REVIEW_ASSETS . 'js/js.cookie.min.js', array(), '2.1.4', true );
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
56 |
|
57 |
wp_enqueue_script(
|
58 |
'wp-review-admin-script',
|
@@ -65,28 +89,10 @@ function wp_review_admin_style( $hook_suffix ) {
|
|
65 |
'jquery-ui-sortable',
|
66 |
'jquery-ui-datepicker',
|
67 |
'wp-util',
|
68 |
-
'wp-review-rating-inputs',
|
69 |
-
'js-cookie',
|
70 |
'magnificPopup',
|
71 |
'imagesloaded',
|
72 |
),
|
73 |
-
|
74 |
-
true
|
75 |
-
);
|
76 |
-
|
77 |
-
wp_enqueue_script(
|
78 |
-
'wp-review-admin-import',
|
79 |
-
WP_REVIEW_URI . 'admin/assets/js/admin.import.js',
|
80 |
-
array( 'jquery', 'wp-util' ),
|
81 |
-
'3.0.0',
|
82 |
-
true
|
83 |
-
);
|
84 |
-
|
85 |
-
wp_enqueue_script(
|
86 |
-
'wp-review-review-items',
|
87 |
-
WP_REVIEW_URI . 'admin/assets/js/review-items.js',
|
88 |
-
array( 'backbone', 'wp-review-admin-script', 'jquery-ui-sortable' ),
|
89 |
-
'3.0.6',
|
90 |
true
|
91 |
);
|
92 |
|
@@ -155,29 +161,6 @@ function wp_review_admin_style( $hook_suffix ) {
|
|
155 |
'importDemoDone' => __( 'Importing proccess finished!', 'wp-review' ),
|
156 |
)
|
157 |
);
|
158 |
-
|
159 |
-
wp_localize_script(
|
160 |
-
'wp-review-admin-import',
|
161 |
-
'wprImportVars',
|
162 |
-
array(
|
163 |
-
'confirm' => __( 'Are you sure you want to import from %s?', 'wp-review' ),
|
164 |
-
'server_error' => __( 'The server responded with an error. Try again.', 'wp-review' ),
|
165 |
-
'confirmOptionsImport' => __( 'Are you sure you want to import options? All current options will be lost.', 'wp-review' ),
|
166 |
-
'importOptionsNonce' => wp_create_nonce( 'wp-review-import-options' ),
|
167 |
-
)
|
168 |
-
);
|
169 |
-
|
170 |
-
wp_enqueue_style(
|
171 |
-
'jquery-ui',
|
172 |
-
WP_REVIEW_URI . 'admin/assets/css/jquery-ui.min.css',
|
173 |
-
array(),
|
174 |
-
'1.12.1'
|
175 |
-
);
|
176 |
-
|
177 |
-
// Load frontend css but not on the post editor screen.
|
178 |
-
if ( stripos( 'post.php', $hook_suffix ) === false ) {
|
179 |
-
wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), WP_REVIEW_PLUGIN_VERSION, 'all' );
|
180 |
-
}
|
181 |
}
|
182 |
|
183 |
add_action( 'admin_enqueue_scripts', 'wp_review_admin_style' );
|
@@ -212,71 +195,71 @@ function wp_review_get_icons() {
|
|
212 |
*/
|
213 |
function wp_review_get_animations_in() {
|
214 |
return array(
|
215 |
-
__( 'Attention Seekers', 'wp-review' )
|
216 |
-
'bounce'
|
217 |
-
'flash'
|
218 |
-
'pulse'
|
219 |
'rubberBand' => __( 'rubberBand', 'wp-review' ),
|
220 |
-
'shake'
|
221 |
-
'swing'
|
222 |
-
'tada'
|
223 |
-
'wobble'
|
224 |
-
'jello'
|
225 |
),
|
226 |
__( 'Bouncing Entrances', 'wp-review' ) => array(
|
227 |
-
'bounceIn'
|
228 |
-
'bounceInDown'
|
229 |
-
'bounceInLeft'
|
230 |
'bounceInRight' => __( 'bounceInRight', 'wp-review' ),
|
231 |
-
'bounceInUp'
|
232 |
),
|
233 |
-
__( 'Fading Entrances', 'wp-review' )
|
234 |
-
'fadeIn'
|
235 |
-
'fadeInDown'
|
236 |
-
'fadeInDownBig'
|
237 |
-
'fadeInLeft'
|
238 |
-
'fadeInLeftBig'
|
239 |
-
'fadeInRight'
|
240 |
'fadeInRightBig' => __( 'fadeInRightBig', 'wp-review' ),
|
241 |
-
'fadeInUp'
|
242 |
-
'fadeInUpBig'
|
243 |
),
|
244 |
-
__( 'Flippers', 'wp-review' )
|
245 |
-
'flip'
|
246 |
-
'flipInX'
|
247 |
-
'flipInY'
|
248 |
'flipOutX' => __( 'flipOutX', 'wp-review' ),
|
249 |
'flipOutY' => __( 'flipOutY', 'wp-review' ),
|
250 |
),
|
251 |
-
__( 'Lightspeed', 'wp-review' )
|
252 |
-
'lightSpeedIn'
|
253 |
'lightSpeedOut' => __( 'lightSpeedOut', 'wp-review' ),
|
254 |
),
|
255 |
__( 'Rotating Entrances', 'wp-review' ) => array(
|
256 |
-
'rotateIn'
|
257 |
-
'rotateInDownLeft'
|
258 |
'rotateInDownRight' => __( 'rotateInDownRight', 'wp-review' ),
|
259 |
-
'rotateInUpLeft'
|
260 |
-
'rotateInUpRight'
|
261 |
),
|
262 |
-
__( 'Sliding Entrances', 'wp-review' )
|
263 |
-
'slideInUp'
|
264 |
-
'slideInDown'
|
265 |
-
'slideInLeft'
|
266 |
'slideInRight' => __( 'slideInRight', 'wp-review' ),
|
267 |
),
|
268 |
-
__( 'Zoom Entrances', 'wp-review' )
|
269 |
-
'zoomIn'
|
270 |
-
'zoomInDown'
|
271 |
-
'zoomInLeft'
|
272 |
'zoomInRight' => __( 'zoomInRight', 'wp-review' ),
|
273 |
-
'zoomInUp'
|
274 |
),
|
275 |
-
__( 'Specials', 'wp-review' )
|
276 |
-
'hinge'
|
277 |
'jackInTheBox' => __( 'jackInTheBox', 'wp-review' ),
|
278 |
-
'rollIn'
|
279 |
-
'rollOut'
|
280 |
),
|
281 |
);
|
282 |
}
|
@@ -292,70 +275,70 @@ function wp_review_get_animations_in() {
|
|
292 |
function wp_review_get_animations_out() {
|
293 |
return array(
|
294 |
__( 'Attention Seekers', 'wp-review' ) => array(
|
295 |
-
'bounce'
|
296 |
-
'flash'
|
297 |
-
'pulse'
|
298 |
'rubberBand' => __( 'rubberBand', 'wp-review' ),
|
299 |
-
'shake'
|
300 |
-
'swing'
|
301 |
-
'tada'
|
302 |
-
'wobble'
|
303 |
-
'jello'
|
304 |
),
|
305 |
-
__( 'Bouncing Exits', 'wp-review' )
|
306 |
-
'bounceOut'
|
307 |
-
'bounceOutDown'
|
308 |
-
'bounceOutLeft'
|
309 |
'bounceOutRight' => __( 'bounceOutRight', 'wp-review' ),
|
310 |
-
'bounceOutUp'
|
311 |
),
|
312 |
-
__( 'Fading Exits', 'wp-review' )
|
313 |
-
'fadeOut'
|
314 |
-
'fadeOutDown'
|
315 |
-
'fadeOutDownBig'
|
316 |
-
'fadeOutLeft'
|
317 |
-
'fadeOutLeftBig'
|
318 |
-
'fadeOutRight'
|
319 |
'fadeOutRightBig' => __( 'fadeOutRightBig', 'wp-review' ),
|
320 |
-
'fadeOutUp'
|
321 |
-
'fadeOutUpBig'
|
322 |
),
|
323 |
-
__( 'Flippers', 'wp-review' )
|
324 |
-
'flip'
|
325 |
-
'flipInX'
|
326 |
-
'flipInY'
|
327 |
'flipOutX' => __( 'flipOutX', 'wp-review' ),
|
328 |
'flipOutY' => __( 'flipOutY', 'wp-review' ),
|
329 |
),
|
330 |
-
__( 'Lightspeed', 'wp-review' )
|
331 |
-
'lightSpeedIn'
|
332 |
'lightSpeedOut' => __( 'lightSpeedOut', 'wp-review' ),
|
333 |
),
|
334 |
-
__( 'Rotating Exits', 'wp-review' )
|
335 |
-
'rotateOut'
|
336 |
-
'rotateOutDownLeft'
|
337 |
'rotateOutDownRight' => __( 'rotateOutDownRight', 'wp-review' ),
|
338 |
-
'rotateOutUpLeft'
|
339 |
-
'rotateOutUpRight'
|
340 |
),
|
341 |
-
__( 'Sliding Exits', 'wp-review' )
|
342 |
-
'slideOutUp'
|
343 |
-
'slideOutDown'
|
344 |
-
'slideOutLeft'
|
345 |
'slideOutRight' => __( 'slideOutRight', 'wp-review' ),
|
346 |
),
|
347 |
-
__( 'Zoom Exits', 'wp-review' )
|
348 |
-
'zoomOut'
|
349 |
-
'zoomOutDown'
|
350 |
-
'zoomOutLeft'
|
351 |
'zoomOutRight' => __( 'zoomOutRight', 'wp-review' ),
|
352 |
-
'zoomOutUp'
|
353 |
),
|
354 |
-
__( 'Specials', 'wp-review' )
|
355 |
-
'hinge'
|
356 |
'jackInTheBox' => __( 'jackInTheBox', 'wp-review' ),
|
357 |
-
'rollIn'
|
358 |
-
'rollOut'
|
359 |
),
|
360 |
);
|
361 |
}
|
@@ -421,8 +404,6 @@ function wp_review_print_select_options( $options, $value ) {
|
|
421 |
function wpreview_plugin_settings_link( $links ) {
|
422 |
$hide = wp_review_network_option( 'hide_global_options_' );
|
423 |
if ( ! $hide ) {
|
424 |
-
$dir = explode( '/', WP_REVIEW_PLUGIN_BASE );
|
425 |
-
$dir = $dir[0];
|
426 |
$settings_link = '<a href="options-general.php?page=wp-review/admin/options.php">' . __( 'Settings', 'wp-review' ) . '</a>';
|
427 |
array_unshift( $links, $settings_link );
|
428 |
}
|
@@ -527,7 +508,7 @@ function wp_review_print_pro_popup() {
|
|
527 |
<div id="wp-review-pro-popup-notice" class="mfp-hide">
|
528 |
<div class="pro-popup-title"><?php esc_html_e( 'Buy WP Review Pro', 'wp-review' ); ?></div>
|
529 |
<div class="pro-popup-content">
|
530 |
-
<img class="pro-popup-image" src="<?php echo esc_url( WP_REVIEW_URI . 'admin/assets/images/wp-review-pro.jpg' ); ?>"
|
531 |
<h2 class="pro-notice-header"><?php esc_html_e( 'Like WP Review Plugin? You will LOVE WP Review Pro!', 'wp-review' ); ?></h2>
|
532 |
<p><?php esc_html_e( '15 new review box templates, 15 new Schema types, commment reviews, user can rate each feature, review popups, review notification bars, custom width, 9 new custom widgets, Google reviews, Facebook reviews, Yelp reviews and much more...', 'wp-review' ); ?></p>
|
533 |
<a class="button-primary" href="https://mythemeshop.com/plugins/wp-review-pro/?utm_source=WP+Review&utm_medium=Popup&utm_content=WP+Review+Pro+LP&utm_campaign=WordPressOrg" target="_blank"><?php esc_html_e( 'Buy WP Review Pro', 'wp-review' ); ?></a>
|
18 |
* @param string $hook_suffix Admin page hook suffix.
|
19 |
*/
|
20 |
function wp_review_admin_style( $hook_suffix ) {
|
21 |
+
if ( ! in_array( $hook_suffix, array( 'post-new.php', 'edit-comments.php', 'post.php', 'edit.php', 'widgets.php', 'settings_page_wp-review/admin/options' ), true ) ) {
|
22 |
return;
|
23 |
}
|
24 |
|
26 |
return;
|
27 |
}
|
28 |
|
29 |
+
if ( 'settings_page_wp-review/admin/options' === $hook_suffix ) {
|
30 |
+
wp_enqueue_style( 'fontawesome', WP_REVIEW_ASSETS . 'css/font-awesome.min.css', array(), '4.7.0' );
|
31 |
|
32 |
+
wp_enqueue_script( 'js-cookie', WP_REVIEW_ASSETS . 'js/js.cookie.min.js', array(), '2.1.4', true );
|
|
|
33 |
|
34 |
+
wp_enqueue_script( 'wp-review-admin-import', WP_REVIEW_URI . 'admin/assets/js/admin.import.js', array( 'jquery', 'wp-util' ), WP_REVIEW_PLUGIN_VERSION, true );
|
35 |
|
36 |
+
wp_localize_script(
|
37 |
+
'wp-review-admin-import',
|
38 |
+
'wprImportVars',
|
39 |
+
array(
|
40 |
+
// translators: import source.
|
41 |
+
'confirm' => __( 'Are you sure you want to import from %s?', 'wp-review' ),
|
42 |
+
'server_error' => __( 'The server responded with an error. Try again.', 'wp-review' ),
|
43 |
+
'confirmOptionsImport' => __( 'Are you sure you want to import options? All current options will be lost.', 'wp-review' ),
|
44 |
+
'importOptionsNonce' => wp_create_nonce( 'wp-review-import-options' ),
|
45 |
+
)
|
46 |
+
);
|
47 |
+
}
|
48 |
+
|
49 |
+
if ( in_array( $hook_suffix, array( 'settings_page_wp-review/admin/options', 'post.php', 'post-new.php' ), true ) ) {
|
50 |
+
wp_enqueue_style( 'jquery-ui', WP_REVIEW_URI . 'admin/assets/css/jquery-ui.min.css', array(), '1.12.1' );
|
51 |
+
|
52 |
+
wp_enqueue_script( 'select2', WP_REVIEW_URI . 'admin/assets/js/select2.min.js', array( 'jquery' ), '4.0.6-rc.0', true );
|
53 |
+
wp_enqueue_style( 'select2', WP_REVIEW_URI . 'admin/assets/css/select2.min.css', array(), '4.0.6-rc.0' );
|
54 |
+
}
|
55 |
+
|
56 |
+
// Load frontend css but not on the post editor screen.
|
57 |
+
if ( stripos( 'post.php', $hook_suffix ) === false ) {
|
58 |
+
wp_enqueue_style( 'wp_review-style', trailingslashit( WP_REVIEW_ASSETS ) . 'css/wp-review.css', array(), WP_REVIEW_PLUGIN_VERSION, 'all' );
|
59 |
+
}
|
60 |
+
|
61 |
+
wp_enqueue_style( 'wp-review-admin-style', WP_REVIEW_URI . 'admin/assets/css/admin.css', array( 'wp-color-picker' ), WP_REVIEW_PLUGIN_VERSION );
|
62 |
|
63 |
$inline_css = '.column-wp_review_rating .pro-only-notice, .latestPost-review-wrapper .pro-only-notice { display: none; }';
|
64 |
wp_add_inline_style( 'wp-review-admin-style', $inline_css );
|
66 |
wp_enqueue_style( 'magnificPopup', WP_REVIEW_ASSETS . 'css/magnific-popup.css', array(), '1.1.0' );
|
67 |
wp_enqueue_script( 'magnificPopup', WP_REVIEW_ASSETS . 'js/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
|
68 |
|
69 |
+
if ( in_array( $hook_suffix, array( 'post.php', 'post-new.php' ), true ) ) {
|
70 |
+
wp_enqueue_script( 'wp-review-rating-inputs', WP_REVIEW_URI . 'admin/assets/js/rating-inputs.js', array( 'jquery-ui-slider' ), WP_REVIEW_PLUGIN_VERSION, true );
|
|
|
|
|
71 |
|
72 |
+
wp_enqueue_script(
|
73 |
+
'wp-review-review-items',
|
74 |
+
WP_REVIEW_URI . 'admin/assets/js/review-items.js',
|
75 |
+
array( 'backbone', 'wp-review-admin-script', 'jquery-ui-sortable' ),
|
76 |
+
WP_REVIEW_PLUGIN_VERSION,
|
77 |
+
true
|
78 |
+
);
|
79 |
+
}
|
80 |
|
81 |
wp_enqueue_script(
|
82 |
'wp-review-admin-script',
|
89 |
'jquery-ui-sortable',
|
90 |
'jquery-ui-datepicker',
|
91 |
'wp-util',
|
|
|
|
|
92 |
'magnificPopup',
|
93 |
'imagesloaded',
|
94 |
),
|
95 |
+
WP_REVIEW_PLUGIN_VERSION,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
true
|
97 |
);
|
98 |
|
161 |
'importDemoDone' => __( 'Importing proccess finished!', 'wp-review' ),
|
162 |
)
|
163 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
|
166 |
add_action( 'admin_enqueue_scripts', 'wp_review_admin_style' );
|
195 |
*/
|
196 |
function wp_review_get_animations_in() {
|
197 |
return array(
|
198 |
+
__( 'Attention Seekers', 'wp-review' ) => array(
|
199 |
+
'bounce' => __( 'bounce', 'wp-review' ),
|
200 |
+
'flash' => __( 'flash', 'wp-review' ),
|
201 |
+
'pulse' => __( 'pulse', 'wp-review' ),
|
202 |
'rubberBand' => __( 'rubberBand', 'wp-review' ),
|
203 |
+
'shake' => __( 'shake', 'wp-review' ),
|
204 |
+
'swing' => __( 'swing', 'wp-review' ),
|
205 |
+
'tada' => __( 'tada', 'wp-review' ),
|
206 |
+
'wobble' => __( 'wobble', 'wp-review' ),
|
207 |
+
'jello' => __( 'jello', 'wp-review' ),
|
208 |
),
|
209 |
__( 'Bouncing Entrances', 'wp-review' ) => array(
|
210 |
+
'bounceIn' => __( 'bounceIn', 'wp-review' ),
|
211 |
+
'bounceInDown' => __( 'bounceInDown', 'wp-review' ),
|
212 |
+
'bounceInLeft' => __( 'bounceInLeft', 'wp-review' ),
|
213 |
'bounceInRight' => __( 'bounceInRight', 'wp-review' ),
|
214 |
+
'bounceInUp' => __( 'bounceInUp', 'wp-review' ),
|
215 |
),
|
216 |
+
__( 'Fading Entrances', 'wp-review' ) => array(
|
217 |
+
'fadeIn' => __( 'fadeIn', 'wp-review' ),
|
218 |
+
'fadeInDown' => __( 'fadeInDown', 'wp-review' ),
|
219 |
+
'fadeInDownBig' => __( 'fadeInDownBig', 'wp-review' ),
|
220 |
+
'fadeInLeft' => __( 'fadeInLeft', 'wp-review' ),
|
221 |
+
'fadeInLeftBig' => __( 'fadeInLeftBig', 'wp-review' ),
|
222 |
+
'fadeInRight' => __( 'fadeInRight', 'wp-review' ),
|
223 |
'fadeInRightBig' => __( 'fadeInRightBig', 'wp-review' ),
|
224 |
+
'fadeInUp' => __( 'fadeInUp', 'wp-review' ),
|
225 |
+
'fadeInUpBig' => __( 'fadeInUpBig', 'wp-review' ),
|
226 |
),
|
227 |
+
__( 'Flippers', 'wp-review' ) => array(
|
228 |
+
'flip' => __( 'flip', 'wp-review' ),
|
229 |
+
'flipInX' => __( 'flipInX', 'wp-review' ),
|
230 |
+
'flipInY' => __( 'flipInY', 'wp-review' ),
|
231 |
'flipOutX' => __( 'flipOutX', 'wp-review' ),
|
232 |
'flipOutY' => __( 'flipOutY', 'wp-review' ),
|
233 |
),
|
234 |
+
__( 'Lightspeed', 'wp-review' ) => array(
|
235 |
+
'lightSpeedIn' => __( 'lightSpeedIn', 'wp-review' ),
|
236 |
'lightSpeedOut' => __( 'lightSpeedOut', 'wp-review' ),
|
237 |
),
|
238 |
__( 'Rotating Entrances', 'wp-review' ) => array(
|
239 |
+
'rotateIn' => __( 'rotateIn', 'wp-review' ),
|
240 |
+
'rotateInDownLeft' => __( 'rotateInDownLeft', 'wp-review' ),
|
241 |
'rotateInDownRight' => __( 'rotateInDownRight', 'wp-review' ),
|
242 |
+
'rotateInUpLeft' => __( 'rotateInUpLeft', 'wp-review' ),
|
243 |
+
'rotateInUpRight' => __( 'rotateInUpRight', 'wp-review' ),
|
244 |
),
|
245 |
+
__( 'Sliding Entrances', 'wp-review' ) => array(
|
246 |
+
'slideInUp' => __( 'slideInUp', 'wp-review' ),
|
247 |
+
'slideInDown' => __( 'slideInDown', 'wp-review' ),
|
248 |
+
'slideInLeft' => __( 'slideInLeft', 'wp-review' ),
|
249 |
'slideInRight' => __( 'slideInRight', 'wp-review' ),
|
250 |
),
|
251 |
+
__( 'Zoom Entrances', 'wp-review' ) => array(
|
252 |
+
'zoomIn' => __( 'zoomIn', 'wp-review' ),
|
253 |
+
'zoomInDown' => __( 'zoomInDown', 'wp-review' ),
|
254 |
+
'zoomInLeft' => __( 'zoomInLeft', 'wp-review' ),
|
255 |
'zoomInRight' => __( 'zoomInRight', 'wp-review' ),
|
256 |
+
'zoomInUp' => __( 'zoomInUp', 'wp-review' ),
|
257 |
),
|
258 |
+
__( 'Specials', 'wp-review' ) => array(
|
259 |
+
'hinge' => __( 'hinge', 'wp-review' ),
|
260 |
'jackInTheBox' => __( 'jackInTheBox', 'wp-review' ),
|
261 |
+
'rollIn' => __( 'rollIn', 'wp-review' ),
|
262 |
+
'rollOut' => __( 'rollOut', 'wp-review' ),
|
263 |
),
|
264 |
);
|
265 |
}
|
275 |
function wp_review_get_animations_out() {
|
276 |
return array(
|
277 |
__( 'Attention Seekers', 'wp-review' ) => array(
|
278 |
+
'bounce' => __( 'bounce', 'wp-review' ),
|
279 |
+
'flash' => __( 'flash', 'wp-review' ),
|
280 |
+
'pulse' => __( 'pulse', 'wp-review' ),
|
281 |
'rubberBand' => __( 'rubberBand', 'wp-review' ),
|
282 |
+
'shake' => __( 'shake', 'wp-review' ),
|
283 |
+
'swing' => __( 'swing', 'wp-review' ),
|
284 |
+
'tada' => __( 'tada', 'wp-review' ),
|
285 |
+
'wobble' => __( 'wobble', 'wp-review' ),
|
286 |
+
'jello' => __( 'jello', 'wp-review' ),
|
287 |
),
|
288 |
+
__( 'Bouncing Exits', 'wp-review' ) => array(
|
289 |
+
'bounceOut' => __( 'bounceOut', 'wp-review' ),
|
290 |
+
'bounceOutDown' => __( 'bounceOutDown', 'wp-review' ),
|
291 |
+
'bounceOutLeft' => __( 'bounceOutLeft', 'wp-review' ),
|
292 |
'bounceOutRight' => __( 'bounceOutRight', 'wp-review' ),
|
293 |
+
'bounceOutUp' => __( 'bounceOutUp', 'wp-review' ),
|
294 |
),
|
295 |
+
__( 'Fading Exits', 'wp-review' ) => array(
|
296 |
+
'fadeOut' => __( 'fadeOut', 'wp-review' ),
|
297 |
+
'fadeOutDown' => __( 'fadeOutDown', 'wp-review' ),
|
298 |
+
'fadeOutDownBig' => __( 'fadeOutDownBig', 'wp-review' ),
|
299 |
+
'fadeOutLeft' => __( 'fadeOutLeft', 'wp-review' ),
|
300 |
+
'fadeOutLeftBig' => __( 'fadeOutLeftBig', 'wp-review' ),
|
301 |
+
'fadeOutRight' => __( 'fadeOutRight', 'wp-review' ),
|
302 |
'fadeOutRightBig' => __( 'fadeOutRightBig', 'wp-review' ),
|
303 |
+
'fadeOutUp' => __( 'fadeOutUp', 'wp-review' ),
|
304 |
+
'fadeOutUpBig' => __( 'fadeOutUpBig', 'wp-review' ),
|
305 |
),
|
306 |
+
__( 'Flippers', 'wp-review' ) => array(
|
307 |
+
'flip' => __( 'flip', 'wp-review' ),
|
308 |
+
'flipInX' => __( 'flipInX', 'wp-review' ),
|
309 |
+
'flipInY' => __( 'flipInY', 'wp-review' ),
|
310 |
'flipOutX' => __( 'flipOutX', 'wp-review' ),
|
311 |
'flipOutY' => __( 'flipOutY', 'wp-review' ),
|
312 |
),
|
313 |
+
__( 'Lightspeed', 'wp-review' ) => array(
|
314 |
+
'lightSpeedIn' => __( 'lightSpeedIn', 'wp-review' ),
|
315 |
'lightSpeedOut' => __( 'lightSpeedOut', 'wp-review' ),
|
316 |
),
|
317 |
+
__( 'Rotating Exits', 'wp-review' ) => array(
|
318 |
+
'rotateOut' => __( 'rotateOut', 'wp-review' ),
|
319 |
+
'rotateOutDownLeft' => __( 'rotateOutDownLeft', 'wp-review' ),
|
320 |
'rotateOutDownRight' => __( 'rotateOutDownRight', 'wp-review' ),
|
321 |
+
'rotateOutUpLeft' => __( 'rotateOutUpLeft', 'wp-review' ),
|
322 |
+
'rotateOutUpRight' => __( 'rotateOutUpRight', 'wp-review' ),
|
323 |
),
|
324 |
+
__( 'Sliding Exits', 'wp-review' ) => array(
|
325 |
+
'slideOutUp' => __( 'slideOutUp', 'wp-review' ),
|
326 |
+
'slideOutDown' => __( 'slideOutDown', 'wp-review' ),
|
327 |
+
'slideOutLeft' => __( 'slideOutLeft', 'wp-review' ),
|
328 |
'slideOutRight' => __( 'slideOutRight', 'wp-review' ),
|
329 |
),
|
330 |
+
__( 'Zoom Exits', 'wp-review' ) => array(
|
331 |
+
'zoomOut' => __( 'zoomOut', 'wp-review' ),
|
332 |
+
'zoomOutDown' => __( 'zoomOutDown', 'wp-review' ),
|
333 |
+
'zoomOutLeft' => __( 'zoomOutLeft', 'wp-review' ),
|
334 |
'zoomOutRight' => __( 'zoomOutRight', 'wp-review' ),
|
335 |
+
'zoomOutUp' => __( 'zoomOutUp', 'wp-review' ),
|
336 |
),
|
337 |
+
__( 'Specials', 'wp-review' ) => array(
|
338 |
+
'hinge' => __( 'hinge', 'wp-review' ),
|
339 |
'jackInTheBox' => __( 'jackInTheBox', 'wp-review' ),
|
340 |
+
'rollIn' => __( 'rollIn', 'wp-review' ),
|
341 |
+
'rollOut' => __( 'rollOut', 'wp-review' ),
|
342 |
),
|
343 |
);
|
344 |
}
|
404 |
function wpreview_plugin_settings_link( $links ) {
|
405 |
$hide = wp_review_network_option( 'hide_global_options_' );
|
406 |
if ( ! $hide ) {
|
|
|
|
|
407 |
$settings_link = '<a href="options-general.php?page=wp-review/admin/options.php">' . __( 'Settings', 'wp-review' ) . '</a>';
|
408 |
array_unshift( $links, $settings_link );
|
409 |
}
|
508 |
<div id="wp-review-pro-popup-notice" class="mfp-hide">
|
509 |
<div class="pro-popup-title"><?php esc_html_e( 'Buy WP Review Pro', 'wp-review' ); ?></div>
|
510 |
<div class="pro-popup-content">
|
511 |
+
<a href="https://mythemeshop.com/plugins/wp-review-pro/?utm_source=WP+Review&utm_medium=Popup&utm_content=WP+Review+Pro+LP&utm_campaign=WordPressOrg" target="_blank"><img class="pro-popup-image" src="<?php echo esc_url( WP_REVIEW_URI . 'admin/assets/images/wp-review-pro.jpg' ); ?>" /></a>
|
512 |
<h2 class="pro-notice-header"><?php esc_html_e( 'Like WP Review Plugin? You will LOVE WP Review Pro!', 'wp-review' ); ?></h2>
|
513 |
<p><?php esc_html_e( '15 new review box templates, 15 new Schema types, commment reviews, user can rate each feature, review popups, review notification bars, custom width, 9 new custom widgets, Google reviews, Facebook reviews, Yelp reviews and much more...', 'wp-review' ); ?></p>
|
514 |
<a class="button-primary" href="https://mythemeshop.com/plugins/wp-review-pro/?utm_source=WP+Review&utm_medium=Popup&utm_content=WP+Review+Pro+LP&utm_campaign=WordPressOrg" target="_blank"><?php esc_html_e( 'Buy WP Review Pro', 'wp-review' ); ?></a>
|
admin/assets/css/admin.css
CHANGED
@@ -1,345 +1,3 @@
|
|
1 |
-
.border-box, .wpr-box-template-images { box-sizing: border-box; }
|
2 |
-
|
3 |
-
.border-box *, .wpr-box-template-images * { box-sizing: border-box; }
|
4 |
-
|
5 |
-
.wpr-flex { display: flex; flex-wrap: wrap; }
|
6 |
-
|
7 |
-
.wpr-flex-wrap { flex-wrap: wrap; }
|
8 |
-
|
9 |
-
.wpr-col-1-2 { flex: 0 0 50%; }
|
10 |
-
|
11 |
-
.wpr-col-1-3 { flex: 0 0 33.33%; margin-bottom: 12px; padding-bottom: 12px; }
|
12 |
-
|
13 |
-
.wpr-col-1-3 label { position: relative; padding-left: 20px; }
|
14 |
-
|
15 |
-
.wpr-col-1-3 label input[type=checkbox] { position: absolute; top: 0; left: 0; box-shadow: none; overflow: hidden; border: 2px solid rgba(33, 38, 44, 0.6); border-radius: 2px; }
|
16 |
-
|
17 |
-
.wpr-col-1-3 label input[type=checkbox]:checked { border-color: #069de3; }
|
18 |
-
|
19 |
-
.wpr-col-1-3 label input[type=checkbox]:checked:before { line-height: 16px; width: 17px; height: 16px; margin: -2px 0 0 -5px; content: '\f147'; text-align: center; color: #fff; border-radius: 2px; background: #069de3; }
|
20 |
-
|
21 |
-
.wp-review * { box-sizing: border-box; }
|
22 |
-
|
23 |
-
.wp-review p.submit { text-align: right; }
|
24 |
-
|
25 |
-
.wp-review h1 { margin-bottom: 15px; }
|
26 |
-
|
27 |
-
.wpr-flex-wrap { justify-content: space-between; }
|
28 |
-
|
29 |
-
.wpr-flex-wrap .wpr-col-1-2 { flex: 0 0 49%; }
|
30 |
-
|
31 |
-
.wpr-flex-wrap .wpr-col-1-2:last-child { float: right; }
|
32 |
-
|
33 |
-
/*--------------------------- Fields --------------------------*/
|
34 |
-
.wp-review-field { padding: 15px 0; border-bottom: 1px dashed #ddd; margin-top: 1em; margin-bottom: 1em; border-bottom: 1px dashed #ddd; }
|
35 |
-
|
36 |
-
.wp-review-field, .wp-review-field * { box-sizing: border-box; }
|
37 |
-
|
38 |
-
.postbox .wp-review-field { padding: 0; border-bottom: 0; }
|
39 |
-
|
40 |
-
@media (min-width: 600px) { .wp-review-field:not(.vertical):not(.no-flex) { display: flex; flex-wrap: wrap; }
|
41 |
-
.wp-review-field:not(.vertical):not(.no-flex) .wp-review-field-label { flex: 0 0 25%; padding-right: 4%; }
|
42 |
-
.wp-review-field:not(.vertical):not(.no-flex) .wp-review-field-label.full-width { flex: 0 0 100%; padding-right: 0; }
|
43 |
-
.wp-review-field:not(.vertical):not(.no-flex) .wp-review-field-option { flex: 0 0 75%; }
|
44 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image { position: relative; }
|
45 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon.hide, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image.hide { display: none; }
|
46 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon a.wpr-toggle-rating, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image a.wpr-toggle-rating { position: absolute; top: 0; right: 0; }
|
47 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper { padding: 2px; width: 55px; height: 55px; border: 1px solid #ddd; position: relative; }
|
48 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper img, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper img { max-width: 100%; }
|
49 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper i, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper i { position: absolute; top: -6px; right: -6px; color: #444; cursor: pointer; }
|
50 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper.hide, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper.hide { display: none; }
|
51 |
-
.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .set_rating_image.hide, .wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .set_rating_image.hide { display: none; }
|
52 |
-
.postbox .wp-review-field .wp-review-field-label { flex: 0 0 20%; }
|
53 |
-
.postbox .wp-review-field .wp-review-field-option { flex: 0 0 80%; } }
|
54 |
-
|
55 |
-
.wpr_image_upload_field .clear-image { margin-left: 10px; }
|
56 |
-
|
57 |
-
/*--------------------------- Review items --------------------------*/
|
58 |
-
.wpr-star-input-wrapper { position: relative; color: #c40000; overflow: hidden; display: inline-block; }
|
59 |
-
|
60 |
-
.wpr-star-input-wrapper .stars-bg { color: #ccc; white-space: nowrap; }
|
61 |
-
|
62 |
-
.wpr-star-input-wrapper .stars-result { white-space: nowrap; position: absolute; left: 0; top: 0; overflow: hidden; }
|
63 |
-
|
64 |
-
.wpr-input-wrapper.ui-slider .ui-slider-handle { background-color: #fff; box-shadow: 0 0px 3px rgba(0, 0, 0, 0.4); border-radius: 2px; cursor: pointer; }
|
65 |
-
|
66 |
-
/*--------------------------- Options page --------------------------*/
|
67 |
-
.wpr-vertical-tabs { max-width: 880px; position: relative; }
|
68 |
-
|
69 |
-
.wpr-vertical-tabs__titles { width: 200px; float: left; border-right: 0; margin: 0; z-index: 10; position: absolute; left: 0; top: 0; }
|
70 |
-
|
71 |
-
.wpr-vertical-tabs__titles.active { background-color: #fff; }
|
72 |
-
|
73 |
-
.wpr-vertical-tabs__title { margin: 0; padding: 0; position: relative; }
|
74 |
-
|
75 |
-
.wpr-vertical-tabs__title:first-child a { border-top: 1px solid #ccc; }
|
76 |
-
|
77 |
-
.wpr-vertical-tabs__title.active a { background-color: #fff; }
|
78 |
-
|
79 |
-
.wpr-vertical-tabs__title.active a:after { content: ""; width: 1px; height: 40px; position: absolute; right: -1px; top: 1px; background: #fff; z-index: 10; }
|
80 |
-
|
81 |
-
.wpr-vertical-tabs__title i { font-size: 18px; min-width: 20px; margin-right: 10px; text-align: center; color: #444; }
|
82 |
-
|
83 |
-
.wpr-vertical-tabs__title a { font-size: 16px; display: block; box-sizing: border-box; padding: 11px 15px; white-space: nowrap; text-decoration: none; color: #555; border: 1px solid #ccc; border-top: 0; border-right: 0; outline: none; background: #e5e5e5; box-shadow: none; }
|
84 |
-
|
85 |
-
.wpr-vertical-tabs__contents { padding-left: 200px; }
|
86 |
-
|
87 |
-
.wpr-vertical-tabs__content { padding: 15px; min-height: 400px; background: #fff; border: 1px solid #ccc; }
|
88 |
-
|
89 |
-
.wpr-vertical-tabs__content > h2 { margin-top: 0; }
|
90 |
-
|
91 |
-
.wpr-vertical-tabs__content .nav-tab-active { background-color: #fff; border-bottom-color: #fff; }
|
92 |
-
|
93 |
-
/*.wp-review-field { clear: both; padding-top: 0; }*/
|
94 |
-
.clearfix:before, .clearfix:after { content: " "; display: table; }
|
95 |
-
|
96 |
-
.clearfix:after { clear: both; }
|
97 |
-
|
98 |
-
.clearfix { *zoom: 1; }
|
99 |
-
|
100 |
-
.wp_review_schema_type_options textarea { width: 77%; min-height: 80px; }
|
101 |
-
|
102 |
-
.wp-review-field select { width: 15em; margin-left: 0; }
|
103 |
-
|
104 |
-
.wp-review-field #wp_review_product_price { width: 70px; }
|
105 |
-
|
106 |
-
.wp-review-field .wp-color-result { margin: 0; }
|
107 |
-
|
108 |
-
.wp-review-field .large-text { width: 77%; }
|
109 |
-
|
110 |
-
.wp-review-field input { margin: 0; padding: 5px 8px; }
|
111 |
-
|
112 |
-
.wp-review-field .wp-picker-container { display: inline-block; }
|
113 |
-
|
114 |
-
.wp-review-field .wp-picker-container label { flex: none; width: auto; }
|
115 |
-
|
116 |
-
.wp-review-field .wp-picker-container input[type="text"].wp-color-picker { padding: 4px; width: 65px; }
|
117 |
-
|
118 |
-
.wp-review-field .wp-picker-container .iris-picker { box-sizing: initial; }
|
119 |
-
|
120 |
-
.wp-review-field .wp-picker-container .wp-picker-open + .wp-picker-input-wrap { width: 140px; }
|
121 |
-
|
122 |
-
#wp-wp_review_pros-wrap textarea.wp-editor-area, #wp-wp_review_cons-wrap textarea.wp-editor-area, #wp-wp_review_desc-wrap textarea.wp-editor-area { border: 0; }
|
123 |
-
|
124 |
-
.wp_review_schema_options_label { vertical-align: top; padding-top: 5px; }
|
125 |
-
|
126 |
-
.wpr_image_upload_field { display: inline-block; }
|
127 |
-
|
128 |
-
.wp-review-item th { text-align: left; }
|
129 |
-
|
130 |
-
.wp-review-item td:first-child { text-align: center; }
|
131 |
-
|
132 |
-
.wp-review-item .handle { cursor: move; }
|
133 |
-
|
134 |
-
.wp-review-links td:first-child { text-align: center; }
|
135 |
-
|
136 |
-
.wp-review-links .handle { cursor: move; }
|
137 |
-
|
138 |
-
.wp-review-links input[type="text"] { padding: 5px 8px; }
|
139 |
-
|
140 |
-
.has-border-bottom { border-bottom: 1px solid #ddd; margin-bottom: 20px; padding-bottom: 20px; }
|
141 |
-
|
142 |
-
.review-total { text-align: right; }
|
143 |
-
|
144 |
-
.wp-review-field-option:not(.pyre_field) .wp-picker-holder { position: absolute; z-index: 9; }
|
145 |
-
|
146 |
-
.review-value-incorrect { border-color: #F00 !important; }
|
147 |
-
|
148 |
-
#wp_review_id_hint { margin-left: 8px; }
|
149 |
-
|
150 |
-
.wp-review-admin-options .form-table td { padding: 20px 10px; vertical-align: top; }
|
151 |
-
|
152 |
-
.wp-review-admin-options p.description { font-weight: normal; font-style: normal; }
|
153 |
-
|
154 |
-
.wp-review-admin-options .wp-review-field > label .description { margin-left: 0; }
|
155 |
-
|
156 |
-
.wp-review-admin-options .wp-review-field input { padding: 7px; border-radius: 2px; margin: 0; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); }
|
157 |
-
|
158 |
-
.wp-review-admin-options .wp-review-field input[type=radio] { border-radius: 50%; }
|
159 |
-
|
160 |
-
.wp-review-admin-options .wp-review-field input[type=checkbox] { border-radius: 0; }
|
161 |
-
|
162 |
-
.wp-review-admin-options .wp-review-field .large-text { width: 70%; }
|
163 |
-
|
164 |
-
.wp-review-admin-options .wp-review-field .description { display: block; color: #888; font-style: normal; margin-top: 5px; }
|
165 |
-
|
166 |
-
.wp-review-admin-options #wp_review_shortcode_hint_field span { display: inline; margin-left: 6px; }
|
167 |
-
|
168 |
-
.wp-review-admin-options .wp-review-thumbnail-options label { margin-right: 0; width: 90%; }
|
169 |
-
|
170 |
-
.wp-review-description label { margin-bottom: -20px; display: block; }
|
171 |
-
|
172 |
-
.wp-review-theme-defaults-msg { position: relative; }
|
173 |
-
|
174 |
-
.wp-review-theme-defaults-msg a.button { display: inline-block; margin-bottom: 8px; }
|
175 |
-
|
176 |
-
.wp-review-theme-defaults-msg a.close-notice { position: absolute; top: 0; right: 0; }
|
177 |
-
|
178 |
-
.edit-ratings-notice.update-nag { background: #fff9e8; margin-right: 0; }
|
179 |
-
|
180 |
-
#wp-review-width-slider { width: 70%; float: left; margin-top: 12px; margin-right: 25px; border-radius: 0; max-width: 600px; border: 0; background: #d8d8d8; height: 8px; }
|
181 |
-
|
182 |
-
#wp-review-width-slider .ui-slider-handle { background: #fff; box-shadow: 0 0px 3px rgba(0, 0, 0, 0.4); border-radius: 2px; }
|
183 |
-
|
184 |
-
#wp-review-width-slider.ui-slider-horizontal .ui-slider-range-min { border: 0; border-radius: 2px; background: #0184bb; }
|
185 |
-
|
186 |
-
#wp_review_width { width: 60px; }
|
187 |
-
|
188 |
-
.wrap.wp-review .nav-tab-wrapper { border-bottom: 1px solid #ccc; margin-top: 16px; }
|
189 |
-
|
190 |
-
.wrap.wp-review .nav-tab-wrapper a:focus { box-shadow: none; }
|
191 |
-
|
192 |
-
.nav-tab-hidden { display: none; }
|
193 |
-
|
194 |
-
.nav-tab-hidden.nav-tab-active { display: block; }
|
195 |
-
|
196 |
-
textarea#wp-review-migrate-log { width: 600px; max-width: 100%; height: 200px; display: none; }
|
197 |
-
|
198 |
-
.already-migrated-msg { display: none; }
|
199 |
-
|
200 |
-
#start-migrate { margin-bottom: 12px; }
|
201 |
-
|
202 |
-
#wp-review-settings-tab-contents > div { display: none; max-width: 900px; }
|
203 |
-
|
204 |
-
#wp-review-settings-tab-contents .settings-tab-general { display: block; }
|
205 |
-
|
206 |
-
.pros-cons-title { max-width: 25%; }
|
207 |
-
|
208 |
-
.column-wp_review_rating, .column-wp_review_comment_rating { text-align: center; position: relative; width: 110px; }
|
209 |
-
|
210 |
-
.column-wp_review_rating .review-star, .column-wp_review_comment_rating .review-star { position: relative; letter-spacing: 1px; }
|
211 |
-
|
212 |
-
.column-wp_review_rating .no-rating, .column-wp_review_comment_rating .no-rating { color: #aaa; font-style: italic; }
|
213 |
-
|
214 |
-
#editwpreview { overflow: hidden; }
|
215 |
-
|
216 |
-
#editwpreview .inside { float: left; padding: 3px 0 2px 5px; margin: 0; text-align: left; }
|
217 |
-
|
218 |
-
#editwpreview .inside input { width: 180px; }
|
219 |
-
|
220 |
-
#editwpreview label { padding: 2px 0; }
|
221 |
-
|
222 |
-
h4.wp-review-comment-title { margin-top: 0; margin-bottom: 1em; }
|
223 |
-
|
224 |
-
.review-result-wrapper { position: relative; display: inline-block; font-size: 0; }
|
225 |
-
|
226 |
-
.postbox .review-result-wrapper a, .postbox .review-result i { cursor: pointer; }
|
227 |
-
|
228 |
-
.review-result { position: absolute; top: 0; left: 0; height: 22px; overflow: hidden; white-space: nowrap; }
|
229 |
-
|
230 |
-
.wp-review-rating-feature { display: inline-block; }
|
231 |
-
|
232 |
-
.wp-review-notice { position: relative; }
|
233 |
-
|
234 |
-
.wpr_image_upload_img { margin: 0 0 10px; padding: 0; max-width: 100%; height: auto; float: left; display: inline-block; }
|
235 |
-
|
236 |
-
.wpr-hide { display: none; }
|
237 |
-
|
238 |
-
.wpr-tabs .tab-title.nav-tab-active { background-color: #fff; border-bottom-color: #fff; }
|
239 |
-
|
240 |
-
.wpr-box-template-images { display: flex; flex-wrap: wrap; }
|
241 |
-
|
242 |
-
.wpr-box-template-images .wpr-box-template-image { flex: 0 0 50%; display: block; outline: 0; box-shadow: none; text-decoration: none; text-align: center; color: #333; font-weight: 700; margin-bottom: 5px; }
|
243 |
-
|
244 |
-
.wpr-box-template-images .wpr-box-template-image img { padding: 4px; width: 100%; height: auto; display: block; }
|
245 |
-
|
246 |
-
.wpr-box-template-images .wpr-box-template-image.active img { background-color: #0073aa; }
|
247 |
-
|
248 |
-
#wpr-review-items-app * { box-sizing: border-box; }
|
249 |
-
|
250 |
-
#wpr-review-items-app .wpr-review-item { background-color: #f7f7f7; padding: 10px 10px 10px 30px; margin-bottom: 5px; }
|
251 |
-
|
252 |
-
#wpr-review-items-app .wpr-review-item .setting-row:first-of-type .col-2 input { width: 100%; padding: 5px; background: #fff; }
|
253 |
-
|
254 |
-
#wpr-review-items-app .wpr-review-item .col-3 input { float: right; background: #fff; }
|
255 |
-
|
256 |
-
#wpr-review-items-app .wpr-review-item .wpr-icon-move { cursor: move; position: absolute; left: 5px; top: 16px; }
|
257 |
-
|
258 |
-
#wpr-review-items-app .setting-row { padding: 5px 0; }
|
259 |
-
|
260 |
-
#wpr-review-items-app .final-row .col-3 { text-align: right; }
|
261 |
-
|
262 |
-
#wpr-review-items-app .final-row .col-3 input { float: right; min-width: 52px; }
|
263 |
-
|
264 |
-
#wpr-review-items-app .final-row .col-3 label { margin: 4px 10px 0 0; display: inline-block; font-weight: bold; }
|
265 |
-
|
266 |
-
#wpr-review-items-app .wpr-percentage-input-wrapper { margin-top: 10px; }
|
267 |
-
|
268 |
-
#wpr-review-items-app .wp-picker-container { display: inline-block; }
|
269 |
-
|
270 |
-
#wpr-review-items-app .wp-picker-holder * { box-sizing: initial; }
|
271 |
-
|
272 |
-
@media (min-width: 768px) { #wpr-review-items-app .wpr-review-item { position: relative; }
|
273 |
-
#wpr-review-items-app .delete-item { position: absolute; right: 10px; bottom: 10px; }
|
274 |
-
#wpr-review-items-app .setting-row { display: flex; flex-wrap: wrap; }
|
275 |
-
#wpr-review-items-app .col-1 { flex: 0 0 20%; }
|
276 |
-
#wpr-review-items-app .col-2 { flex: 0 0 60%; padding: 0 10px; }
|
277 |
-
#wpr-review-items-app .col-3 { flex: 0 0 20%; } }
|
278 |
-
|
279 |
-
#wp_review_box_template_wrapper { position: relative; }
|
280 |
-
|
281 |
-
#wp_review_box_template_preview { position: absolute; left: 250px; top: 0px; z-index: 1000; padding: 3px; box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); background: #fff; }
|
282 |
-
|
283 |
-
#wp_review_box_template_preview.loading { background: #eee url(../images/loading.svg) no-repeat center center; }
|
284 |
-
|
285 |
-
#wp_review_box_template_preview.loading img { visibility: hidden; }
|
286 |
-
|
287 |
-
#wp_review_box_template_img, #wp_review_box_template_preview_img { max-width: 414px; height: auto; }
|
288 |
-
|
289 |
-
.wpr-switch { display: inline-block; }
|
290 |
-
|
291 |
-
.wpr-switch input { position: absolute !important; clip: rect(0, 0, 0, 0); height: 1px; width: 1px; border: 0; overflow: hidden; }
|
292 |
-
|
293 |
-
.wpr-switch label { float: left; display: inline-block; min-width: 45px; background-color: #e4e4e4; color: rgba(0, 0, 0, 0.6); font-size: 12px; font-weight: 700; line-height: 28px; text-align: center; text-shadow: none; border: 1px solid rgba(0, 0, 0, 0.2); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1); transition: all 0.1s ease-in-out; }
|
294 |
-
|
295 |
-
.wpr-switch label:hover { cursor: pointer; }
|
296 |
-
|
297 |
-
.wpr-switch label:first-of-type { border-radius: 3px 0 0 3px; border-right: 0; font-weight: normal; }
|
298 |
-
|
299 |
-
.wpr-switch label:last-of-type { border-radius: 0 3px 3px 0; border-left: 0; font-weight: normal; }
|
300 |
-
|
301 |
-
input.wpr-switch__on:checked + label, input.wpr-switch__off:checked + label { background: #0085ba; border-color: #0073aa #006799 #006799; box-shadow: 0 1px 0 #006799; color: #fff; text-decoration: none; text-shadow: 0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799; margin-bottom: 2px; }
|
302 |
-
|
303 |
-
input.wpr-switch__on:checked + label:hover, input.wpr-switch__off:checked + label:hover { background: #008ec2; border-color: #006799; color: #fff; }
|
304 |
-
|
305 |
-
input.wpr-switch__off:checked + label, input.wpr-switch__off:checked + label:hover { color: #fff; background: #f5786f; border-color: #bd4c44 #bd4c44 #bd4c44; box-shadow: 0 1px 0 #bd4c44; text-shadow: none; }
|
306 |
-
|
307 |
-
#wp-review-demo-importer-popup { background: #fff; border: 1px solid #eaeaeb; border-radius: 3px; box-shadow: 0 1px 0 #FFF inset, 0 1px 5px rgba(0, 0, 0, 0.1); position: relative; width: auto; max-width: 600px; margin: 50px auto; }
|
308 |
-
|
309 |
-
#wp-review-demo-importer-modal-header { border-bottom: 1px solid #eaeaeb; background: #FAFBFD; padding: 12px 20px; }
|
310 |
-
|
311 |
-
#wp-review-demo-importer-modal-header .spinner { margin-top: 14px; }
|
312 |
-
|
313 |
-
#wp-review-demo-importer-modal-header h2, #wp-review-demo-importer-modal-content h4 { padding: 0 !important; margin: 0 !important; }
|
314 |
-
|
315 |
-
#wp-review-demo-importer-modal-header h2 { font-size: 1.8em; line-height: 2em; }
|
316 |
-
|
317 |
-
#wp-review-demo-importer-modal-content { background: #fff; padding: 20px; overflow: auto; height: 300px; width: 100%; box-sizing: border-box; }
|
318 |
-
|
319 |
-
#wp-review-demo-importer-modal-content p { padding: 0; margin: 0; }
|
320 |
-
|
321 |
-
#wp-review-demo-importer-modal-footer { border-top: 1px solid #eaeaeb; background: #FAFBFD; padding: 12px 20px; display: inline-block; width: 100%; box-sizing: border-box; }
|
322 |
-
|
323 |
-
#wp-review-demo-importer-modal-footer-info { float: left; }
|
324 |
-
|
325 |
-
#wp-review-demo-importer-modal-footer-button { float: right; display: none; text-transform: uppercase; }
|
326 |
-
|
327 |
-
.wp-admin select.mce-selectbox { padding: 0; }
|
328 |
-
|
329 |
-
#wp-review-metabox-userReview .inside > p:first-of-type label, #wp-review-metabox-userReview .inside > p:nth-of-type(2) label, #wp-review-metabox-userReview .inside > p:nth-of-type(3) label, #wp-review-metabox-userReview .inside > p:nth-of-type(4) label { padding-right: 0; margin-left: 5px; }
|
330 |
-
|
331 |
-
.wp-review-subsite-wrapper { display: none; }
|
332 |
-
|
333 |
-
.wp-review-pro-text { color: #00cc66; }
|
334 |
-
|
335 |
-
.wp-review-disabled { position: relative; cursor: pointer; }
|
336 |
-
|
337 |
-
.wp-review-disabled:before { content: " "; display: block; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; }
|
338 |
-
|
339 |
-
.wp-review-disabled.inline-block { display: inline-block; }
|
340 |
-
|
341 |
-
.wp-review-disabled.wpr-switch, .wp-review-disabled.has-bg { opacity: 0.3; }
|
342 |
-
|
343 |
-
option.disabled { color: #aaa; }
|
344 |
|
345 |
/*# sourceMappingURL=../sourcemaps/admin.css.map */
|
1 |
+
.border-box,.wpr-box-template-images{box-sizing:border-box}.border-box *,.wpr-box-template-images *{box-sizing:border-box}.wpr-flex{display:flex;flex-wrap:wrap}.wpr-flex-wrap{flex-wrap:wrap}.wpr-col-1-2{flex:0 0 50%}.wpr-col-1-3{flex:0 0 33.33%;margin-bottom:12px;padding-bottom:12px}.wpr-col-1-3 label{position:relative;padding-left:20px}.wpr-col-1-3 label input[type=checkbox]{position:absolute;top:0;left:0;box-shadow:none;overflow:hidden;border:2px solid rgba(33,38,44,0.6);border-radius:2px}.wpr-col-1-3 label input[type=checkbox]:checked{border-color:#069de3}.wpr-col-1-3 label input[type=checkbox]:checked:before{line-height:16px;width:17px;height:16px;margin:-2px 0 0 -5px;content:'\f147';text-align:center;color:#fff;border-radius:2px;background:#069de3}.wp-review *{box-sizing:border-box}.wp-review p.submit{text-align:right}.wp-review h1{margin-bottom:15px}.wpr-flex-wrap{justify-content:space-between}.wpr-flex-wrap .wpr-col-1-2{flex:0 0 49%}.wpr-flex-wrap .wpr-col-1-2:last-child{float:right}.wp-review-field{padding:15px 0;border-bottom:1px dashed #ddd;margin-top:1em;margin-bottom:1em;border-bottom:1px dashed #ddd}.wp-review-field,.wp-review-field *{box-sizing:border-box}.postbox .wp-review-field{padding:0;border-bottom:0}@media (min-width: 600px){.wp-review-field:not(.vertical):not(.no-flex){display:flex;flex-wrap:wrap}.wp-review-field:not(.vertical):not(.no-flex) .wp-review-field-label{flex:0 0 25%;padding-right:4%}.wp-review-field:not(.vertical):not(.no-flex) .wp-review-field-label.full-width{flex:0 0 100%;padding-right:0}.wp-review-field:not(.vertical):not(.no-flex) .wp-review-field-option{flex:0 0 75%}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image{position:relative}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon.hide,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image.hide{display:none}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon a.wpr-toggle-rating,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image a.wpr-toggle-rating{position:absolute;top:0;right:0}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper{padding:2px;width:55px;height:55px;border:1px solid #ddd;position:relative}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper img,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper img{max-width:100%}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper i,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper i{position:absolute;top:-6px;right:-6px;color:#444;cursor:pointer}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .img-wrapper.hide,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .img-wrapper.hide{display:none}.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-icon .set_rating_image.hide,.wp-review-field:not(.vertical):not(.no-flex).wp-review-rating-image .set_rating_image.hide{display:none}.postbox .wp-review-field .wp-review-field-label{flex:0 0 20%}.postbox .wp-review-field .wp-review-field-option{flex:0 0 80%}}.wpr_image_upload_field .clear-image{margin-left:10px}.wpr-star-input-wrapper{position:relative;color:#c40000;overflow:hidden;display:inline-block}.wpr-star-input-wrapper .stars-bg{color:#ccc;white-space:nowrap}.wpr-star-input-wrapper .stars-result{white-space:nowrap;position:absolute;left:0;top:0;overflow:hidden}.wpr-input-wrapper.ui-slider .ui-slider-handle{background-color:#fff;box-shadow:0 0px 3px rgba(0,0,0,0.4);border-radius:2px;cursor:pointer}.wpr-vertical-tabs{max-width:880px;position:relative}.wpr-vertical-tabs__titles{width:200px;float:left;border-right:0;margin:0;z-index:10;position:absolute;left:0;top:0}.wpr-vertical-tabs__titles.active{background-color:#fff}.wpr-vertical-tabs__title{margin:0;padding:0;position:relative}.wpr-vertical-tabs__title:first-child a{border-top:1px solid #ccc}.wpr-vertical-tabs__title.active a{background-color:#fff}.wpr-vertical-tabs__title.active a:after{content:"";width:1px;height:40px;position:absolute;right:-1px;top:1px;background:#fff;z-index:10}.wpr-vertical-tabs__title i{font-size:18px;min-width:20px;margin-right:10px;text-align:center;color:#444}.wpr-vertical-tabs__title a{font-size:16px;display:block;box-sizing:border-box;padding:11px 15px;white-space:nowrap;text-decoration:none;color:#555;border:1px solid #ccc;border-top:0;border-right:0;outline:none;background:#e5e5e5;box-shadow:none}.wpr-vertical-tabs__contents{padding-left:200px}.wpr-vertical-tabs__content{padding:15px;min-height:400px;background:#fff;border:1px solid #ccc}.wpr-vertical-tabs__content>h2{margin-top:0}.wpr-vertical-tabs__content .nav-tab-active{background-color:#fff;border-bottom-color:#fff}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.clearfix{*zoom:1}.wp_review_schema_type_options textarea{width:77%;min-height:80px}.wp-review-field select{width:15em;margin-left:0}.wp-review-field #wp_review_product_price{width:70px}.wp-review-field .wp-color-result{margin:0}.wp-review-field .large-text{width:77%}.wp-review-field input{margin:0;padding:5px 8px}.wp-review-field .wp-picker-container{display:inline-block}.wp-review-field .wp-picker-container label{flex:none;width:auto}.wp-review-field .wp-picker-container input[type="text"].wp-color-picker{padding:4px;width:65px}.wp-review-field .wp-picker-container .iris-picker{box-sizing:initial}.wp-review-field .wp-picker-container .wp-picker-open+.wp-picker-input-wrap{width:140px}#wp-wp_review_pros-wrap textarea.wp-editor-area,#wp-wp_review_cons-wrap textarea.wp-editor-area,#wp-wp_review_desc-wrap textarea.wp-editor-area{border:0}.wp_review_schema_options_label{vertical-align:top;padding-top:5px}.wpr_image_upload_field{display:inline-block}.wp-review-item th{text-align:left}.wp-review-item td:first-child{text-align:center}.wp-review-item .handle{cursor:move}.wp-review-links td:first-child{text-align:center}.wp-review-links .handle{cursor:move}.wp-review-links input[type="text"]{padding:5px 8px}.has-border-bottom{border-bottom:1px solid #ddd;margin-bottom:20px;padding-bottom:20px}.review-total{text-align:right}.wp-review-field-option:not(.pyre_field) .wp-picker-holder{position:absolute;z-index:9}.review-value-incorrect{border-color:#F00 !important}#wp_review_id_hint{margin-left:8px}.wp-review-admin-options .form-table td{padding:20px 10px;vertical-align:top}.wp-review-admin-options p.description{font-weight:normal;font-style:normal}.wp-review-admin-options .wp-review-field>label .description{margin-left:0}.wp-review-admin-options .wp-review-field input{padding:7px;border-radius:2px;margin:0;box-shadow:inset 0 1px 3px rgba(0,0,0,0.1)}.wp-review-admin-options .wp-review-field input[type=radio]{border-radius:50%}.wp-review-admin-options .wp-review-field input[type=checkbox]{border-radius:0}.wp-review-admin-options .wp-review-field .large-text{width:70%}.wp-review-admin-options .wp-review-field .description{display:block;color:#888;font-style:normal;margin-top:5px}.wp-review-admin-options #wp_review_shortcode_hint_field span{display:inline;margin-left:6px}.wp-review-admin-options .wp-review-thumbnail-options label{margin-right:0;width:90%}.wp-review-description label{margin-bottom:-20px;display:block}.wp-review-theme-defaults-msg{position:relative}.wp-review-theme-defaults-msg a.button{display:inline-block;margin-bottom:8px}.wp-review-theme-defaults-msg a.close-notice{position:absolute;top:0;right:0}.edit-ratings-notice.update-nag{background:#fff9e8;margin-right:0}#wp-review-width-slider{width:70%;float:left;margin-top:12px;margin-right:25px;border-radius:0;max-width:600px;border:0;background:#d8d8d8;height:8px}#wp-review-width-slider .ui-slider-handle{background:#fff;box-shadow:0 0px 3px rgba(0,0,0,0.4);border-radius:2px}#wp-review-width-slider.ui-slider-horizontal .ui-slider-range-min{border:0;border-radius:2px;background:#0184bb}#wp_review_width{width:60px}.wrap.wp-review .nav-tab-wrapper{border-bottom:1px solid #ccc;margin-top:16px}.wrap.wp-review .nav-tab-wrapper a:focus{box-shadow:none}.nav-tab-hidden{display:none}.nav-tab-hidden.nav-tab-active{display:block}textarea#wp-review-migrate-log{width:600px;max-width:100%;height:200px;display:none}.already-migrated-msg{display:none}#start-migrate{margin-bottom:12px}#wp-review-settings-tab-contents>div{display:none;max-width:900px}#wp-review-settings-tab-contents .settings-tab-general{display:block}.pros-cons-title{max-width:25%}.column-wp_review_rating,.column-wp_review_comment_rating{text-align:center;position:relative;width:110px}.column-wp_review_rating .review-star,.column-wp_review_comment_rating .review-star{position:relative;letter-spacing:1px}.column-wp_review_rating .no-rating,.column-wp_review_comment_rating .no-rating{color:#aaa;font-style:italic}#editwpreview{overflow:hidden}#editwpreview .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:left}#editwpreview .inside input{width:180px}#editwpreview label{padding:2px 0}h4.wp-review-comment-title{margin-top:0;margin-bottom:1em}.review-result-wrapper{position:relative;display:inline-block;font-size:0}.postbox .review-result-wrapper a,.postbox .review-result i{cursor:pointer}.review-result{position:absolute;top:0;left:0;height:22px;overflow:hidden;white-space:nowrap}.wp-review-rating-feature{display:inline-block}.wp-review-notice{position:relative}.wpr_image_upload_img{margin:0 0 10px;padding:0;max-width:100%;height:auto;float:left;display:inline-block}.wpr-hide{display:none}.wpr-tabs .tab-title.nav-tab-active{background-color:#fff;border-bottom-color:#fff}.wpr-box-template-images{display:flex;flex-wrap:wrap}.wpr-box-template-images .wpr-box-template-image{flex:0 0 50%;display:block;outline:0;box-shadow:none;text-decoration:none;text-align:center;color:#333;font-weight:700;margin-bottom:5px}.wpr-box-template-images .wpr-box-template-image img{padding:4px;width:100%;height:auto;display:block}.wpr-box-template-images .wpr-box-template-image.active img{background-color:#0073aa}#wpr-review-items-app *{box-sizing:border-box}#wpr-review-items-app .wpr-review-item{background-color:#f7f7f7;padding:10px 10px 10px 30px;margin-bottom:5px}#wpr-review-items-app .wpr-review-item .setting-row:first-of-type .col-2 input{width:100%;padding:5px;background:#fff}#wpr-review-items-app .wpr-review-item .col-3 input{float:right;background:#fff}#wpr-review-items-app .wpr-review-item .wpr-icon-move{cursor:move;position:absolute;left:5px;top:16px}#wpr-review-items-app .setting-row{padding:5px 0}#wpr-review-items-app .final-row .col-3{text-align:right}#wpr-review-items-app .final-row .col-3 input{float:right;min-width:52px}#wpr-review-items-app .final-row .col-3 label{margin:4px 10px 0 0;display:inline-block;font-weight:bold}#wpr-review-items-app .wpr-percentage-input-wrapper{margin-top:10px}#wpr-review-items-app .wp-picker-container{display:inline-block}#wpr-review-items-app .wp-picker-holder *{box-sizing:initial}@media (min-width: 768px){#wpr-review-items-app .wpr-review-item{position:relative}#wpr-review-items-app .delete-item{position:absolute;right:10px;bottom:10px}#wpr-review-items-app .setting-row{display:flex;flex-wrap:wrap}#wpr-review-items-app .col-1{flex:0 0 20%}#wpr-review-items-app .col-2{flex:0 0 60%;padding:0 10px}#wpr-review-items-app .col-3{flex:0 0 20%}}#wp_review_box_template_wrapper{position:relative}#wp_review_box_template_preview{position:absolute;left:250px;top:0px;z-index:1000;padding:3px;box-shadow:0 0 3px rgba(0,0,0,0.2);background:#fff}#wp_review_box_template_preview.loading{background:#eee url(../images/loading.svg) no-repeat center center}#wp_review_box_template_preview.loading img{visibility:hidden}#wp_review_box_template_img,#wp_review_box_template_preview_img{max-width:414px;height:auto}.wpr-switch{display:inline-block}.wpr-switch input{position:absolute !important;clip:rect(0, 0, 0, 0);height:1px;width:1px;border:0;overflow:hidden}.wpr-switch label{float:left;display:inline-block;min-width:45px;background-color:#e4e4e4;color:rgba(0,0,0,0.6);font-size:12px;font-weight:700;line-height:28px;text-align:center;text-shadow:none;border:1px solid rgba(0,0,0,0.2);box-shadow:inset 0 1px 3px rgba(0,0,0,0.3),0 1px rgba(255,255,255,0.1);transition:all 0.1s ease-in-out}.wpr-switch label:hover{cursor:pointer}.wpr-switch label:first-of-type{border-radius:3px 0 0 3px;border-right:0;font-weight:normal}.wpr-switch label:last-of-type{border-radius:0 3px 3px 0;border-left:0;font-weight:normal}input.wpr-switch__on:checked+label,input.wpr-switch__off:checked+label{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;margin-bottom:2px}input.wpr-switch__on:checked+label:hover,input.wpr-switch__off:checked+label:hover{background:#008ec2;border-color:#006799;color:#fff}input.wpr-switch__off:checked+label,input.wpr-switch__off:checked+label:hover{color:#fff;background:#f5786f;border-color:#bd4c44 #bd4c44 #bd4c44;box-shadow:0 1px 0 #bd4c44;text-shadow:none}#wp-review-demo-importer-popup{background:#fff;border:1px solid #eaeaeb;border-radius:3px;box-shadow:0 1px 0 #fff inset,0 1px 5px rgba(0,0,0,0.1);position:relative;width:auto;max-width:600px;margin:50px auto}#wp-review-demo-importer-modal-header{border-bottom:1px solid #eaeaeb;background:#FAFBFD;padding:12px 20px}#wp-review-demo-importer-modal-header .spinner{margin-top:14px}#wp-review-demo-importer-modal-header h2,#wp-review-demo-importer-modal-content h4{padding:0 !important;margin:0 !important}#wp-review-demo-importer-modal-header h2{font-size:1.8em;line-height:2em}#wp-review-demo-importer-modal-content{background:#fff;padding:20px;overflow:auto;height:300px;width:100%;box-sizing:border-box}#wp-review-demo-importer-modal-content p{padding:0;margin:0}#wp-review-demo-importer-modal-footer{border-top:1px solid #eaeaeb;background:#FAFBFD;padding:12px 20px;display:inline-block;width:100%;box-sizing:border-box}#wp-review-demo-importer-modal-footer-info{float:left}#wp-review-demo-importer-modal-footer-button{float:right;display:none;text-transform:uppercase}.wp-admin select.mce-selectbox{padding:0}#wp-review-metabox-userReview .inside>p:first-of-type label,#wp-review-metabox-userReview .inside>p:nth-of-type(2) label,#wp-review-metabox-userReview .inside>p:nth-of-type(3) label,#wp-review-metabox-userReview .inside>p:nth-of-type(4) label{padding-right:0;margin-left:5px}.wp-review-subsite-wrapper{display:none}.wp-review-pro-text{color:#00cc66}.wp-review-disabled{position:relative;cursor:pointer}.wp-review-disabled:before{content:" ";display:block;position:absolute;top:0;left:0;right:0;bottom:0;z-index:100}.wp-review-disabled.inline-block{display:inline-block}.wp-review-disabled.wpr-switch,.wp-review-disabled.has-bg{opacity:0.3}option.disabled{color:#aaa}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
/*# sourceMappingURL=../sourcemaps/admin.css.map */
|
admin/assets/js/admin.js
CHANGED
@@ -5,12 +5,16 @@
|
|
5 |
* Author: MyThemesShop
|
6 |
* Author URI: http://mythemeshop.com/
|
7 |
*/
|
8 |
-
( function(
|
9 |
"use strict";
|
10 |
|
11 |
var wpreview = window.wpreview = window.wpreview || {};
|
12 |
|
13 |
wpreview.initSelect2 = function() {
|
|
|
|
|
|
|
|
|
14 |
function addIcon( option ) {
|
15 |
if ( $( option.element ).attr( 'data-icon' ) ) {
|
16 |
return $( '<span><i class="' + $( option.element ).attr( 'data-icon' ) + '"></i> ' + option.text + '</span>' );
|
@@ -79,8 +83,11 @@
|
|
79 |
wpreview.tabs({
|
80 |
wrapper: '[data-vertical-tabs]',
|
81 |
activeElement: 'li',
|
82 |
-
active: $( '#setting-error-settings_updated' ).length ? Cookies.get( 'wpr-last-vtab' ) : '',
|
83 |
activate: function( tab ) {
|
|
|
|
|
|
|
84 |
Cookies.set( 'wpr-last-vtab', tab );
|
85 |
}
|
86 |
});
|
@@ -90,11 +97,14 @@
|
|
90 |
title: '.nav-tab',
|
91 |
content: '.tab-content',
|
92 |
activeClass: 'nav-tab-active',
|
93 |
-
active: $( '#setting-error-settings_updated' ).length ? Cookies.get( 'wpr-last-htab' ) : '',
|
94 |
activate: function( tab ) {
|
95 |
if ( ! $( '#wpr-global-options' ).length ) {
|
96 |
return;
|
97 |
}
|
|
|
|
|
|
|
98 |
Cookies.set( 'wpr-last-htab', tab );
|
99 |
}
|
100 |
});
|
@@ -191,43 +201,6 @@
|
|
191 |
}
|
192 |
});
|
193 |
|
194 |
-
var richSnippetSelect = $('#rank_math_rich_snippet');
|
195 |
-
|
196 |
-
$( document ).on( 'change', 'select#wp_review_schema', function() {
|
197 |
-
var $this = $( this ),
|
198 |
-
value = $this.val(),
|
199 |
-
targetSelector = '#wp_review_schema_type_' + value;
|
200 |
-
|
201 |
-
$( '.wp_review_schema_type_options' ).hide();
|
202 |
-
$( '#wp_review_schema_type_options_wrap' ).hide();
|
203 |
-
|
204 |
-
if ( value ) {
|
205 |
-
$( targetSelector ).show();
|
206 |
-
if ( 'none' !== value ) {
|
207 |
-
$( '#wp_review_schema_type_options_wrap' ).show();
|
208 |
-
|
209 |
-
if(richSnippetSelect.length)
|
210 |
-
richSnippetSelect.val('off').trigger('change');
|
211 |
-
}
|
212 |
-
}
|
213 |
-
|
214 |
-
});
|
215 |
-
|
216 |
-
if(richSnippetSelect.length) {
|
217 |
-
|
218 |
-
var wpReviewSchemaSelect = $('select#wp_review_schema');
|
219 |
-
|
220 |
-
if(wpReviewSchemaSelect.val() !== 'none') {
|
221 |
-
richSnippetSelect.val('off').trigger('change');
|
222 |
-
}
|
223 |
-
|
224 |
-
richSnippetSelect.on( 'change', function() {
|
225 |
-
if( 'off' !== $(this).val() ) {
|
226 |
-
wpReviewSchemaSelect.val( 'none' ).trigger( 'change' );
|
227 |
-
}
|
228 |
-
}).trigger( 'change' );
|
229 |
-
}
|
230 |
-
|
231 |
$( document ).on( 'change', '#wp_review_rating_schema', function() {
|
232 |
var value = $( this ).val();
|
233 |
if ( 'author' === value ) {
|
@@ -285,7 +258,29 @@
|
|
285 |
} else {
|
286 |
$( this ).next( 'input[name="wp_review_type"]' ).val( selected_val );
|
287 |
}
|
|
|
288 |
}).change();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
};
|
290 |
|
291 |
wpreview.linkChoices = function( options ) {
|
@@ -315,6 +310,10 @@
|
|
315 |
};
|
316 |
|
317 |
wpreview.boxTemplatesSelect = function() {
|
|
|
|
|
|
|
|
|
318 |
var $select = $( 'select#wp_review_box_template' ),
|
319 |
globalColor = $( '#wpr-review-global-color-value' ).val(),
|
320 |
globalInactiveColor = $( '#wpr-review-global-inactive-color-value' ).val(),
|
@@ -620,7 +619,7 @@
|
|
620 |
$( '.input-color, .input-inactive-color' ).closest( '.col-2' ).addClass( 'pyre_field' );
|
621 |
}
|
622 |
});
|
623 |
-
})( jQuery
|
624 |
|
625 |
jQuery(document).ready(function($) {
|
626 |
|
5 |
* Author: MyThemesShop
|
6 |
* Author URI: http://mythemeshop.com/
|
7 |
*/
|
8 |
+
( function( $ ) {
|
9 |
"use strict";
|
10 |
|
11 |
var wpreview = window.wpreview = window.wpreview || {};
|
12 |
|
13 |
wpreview.initSelect2 = function() {
|
14 |
+
if ( 'function' !== typeof $.fn.select2 ) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
function addIcon( option ) {
|
19 |
if ( $( option.element ).attr( 'data-icon' ) ) {
|
20 |
return $( '<span><i class="' + $( option.element ).attr( 'data-icon' ) + '"></i> ' + option.text + '</span>' );
|
83 |
wpreview.tabs({
|
84 |
wrapper: '[data-vertical-tabs]',
|
85 |
activeElement: 'li',
|
86 |
+
active: $( '#setting-error-settings_updated' ).length && 'undefined' !== typeof Cookies ? Cookies.get( 'wpr-last-vtab' ) : '',
|
87 |
activate: function( tab ) {
|
88 |
+
if ( 'undefined' === typeof Cookies ) {
|
89 |
+
return;
|
90 |
+
}
|
91 |
Cookies.set( 'wpr-last-vtab', tab );
|
92 |
}
|
93 |
});
|
97 |
title: '.nav-tab',
|
98 |
content: '.tab-content',
|
99 |
activeClass: 'nav-tab-active',
|
100 |
+
active: $( '#setting-error-settings_updated' ).length && 'undefined' !== typeof Cookies ? Cookies.get( 'wpr-last-htab' ) : '',
|
101 |
activate: function( tab ) {
|
102 |
if ( ! $( '#wpr-global-options' ).length ) {
|
103 |
return;
|
104 |
}
|
105 |
+
if ( 'undefined' === typeof Cookies ) {
|
106 |
+
return;
|
107 |
+
}
|
108 |
Cookies.set( 'wpr-last-htab', tab );
|
109 |
}
|
110 |
});
|
201 |
}
|
202 |
});
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
$( document ).on( 'change', '#wp_review_rating_schema', function() {
|
205 |
var value = $( this ).val();
|
206 |
if ( 'author' === value ) {
|
258 |
} else {
|
259 |
$( this ).next( 'input[name="wp_review_type"]' ).val( selected_val );
|
260 |
}
|
261 |
+
rankMathRichSnippet();
|
262 |
}).change();
|
263 |
+
|
264 |
+
rankMathRichSnippet();
|
265 |
+
|
266 |
+
function rankMathRichSnippet() {
|
267 |
+
|
268 |
+
var rankMathSnippet = $( 'select#rank_math_rich_snippet');
|
269 |
+
if( ! rankMathSnippet.length ) {
|
270 |
+
return;
|
271 |
+
}
|
272 |
+
|
273 |
+
var ReviewType = $('#wp_review_type').val();
|
274 |
+
if( 'review' === rankMathSnippet.val() && 'none' !== ReviewType ) {
|
275 |
+
rankMathSnippet.val('off').trigger('change');
|
276 |
+
}
|
277 |
+
if( 'none' === ReviewType ) {
|
278 |
+
rankMathSnippet.find( 'option[value="review"]' ).show();
|
279 |
+
} else {
|
280 |
+
rankMathSnippet.find( 'option[value="review"]' ).hide();
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
};
|
285 |
|
286 |
wpreview.linkChoices = function( options ) {
|
310 |
};
|
311 |
|
312 |
wpreview.boxTemplatesSelect = function() {
|
313 |
+
if ( 'function' !== typeof $.fn.select2 ) {
|
314 |
+
return;
|
315 |
+
}
|
316 |
+
|
317 |
var $select = $( 'select#wp_review_box_template' ),
|
318 |
globalColor = $( '#wpr-review-global-color-value' ).val(),
|
319 |
globalInactiveColor = $( '#wpr-review-global-inactive-color-value' ).val(),
|
619 |
$( '.input-color, .input-inactive-color' ).closest( '.col-2' ).addClass( 'pyre_field' );
|
620 |
}
|
621 |
});
|
622 |
+
})( jQuery );
|
623 |
|
624 |
jQuery(document).ready(function($) {
|
625 |
|
admin/assets/js/review-items.js
CHANGED
@@ -155,6 +155,7 @@
|
|
155 |
this.collection.on( 'add', this.calculateTotal, this );
|
156 |
this.collection.on( 'change', this.calculateTotal, this );
|
157 |
this.collection.on( 'remove', this.calculateTotal, this );
|
|
|
158 |
},
|
159 |
|
160 |
events: {
|
@@ -178,6 +179,10 @@
|
|
178 |
},
|
179 |
|
180 |
calculateTotal: function() {
|
|
|
|
|
|
|
|
|
181 |
var total = 0,
|
182 |
count = this.collection.length;
|
183 |
|
@@ -210,6 +215,10 @@
|
|
210 |
item.set( 'type', type );
|
211 |
});
|
212 |
this.render();
|
|
|
|
|
|
|
|
|
213 |
}
|
214 |
});
|
215 |
|
155 |
this.collection.on( 'add', this.calculateTotal, this );
|
156 |
this.collection.on( 'change', this.calculateTotal, this );
|
157 |
this.collection.on( 'remove', this.calculateTotal, this );
|
158 |
+
this.collection.on( 'add change remove', this.updateAppAttr, this );
|
159 |
},
|
160 |
|
161 |
events: {
|
179 |
},
|
180 |
|
181 |
calculateTotal: function() {
|
182 |
+
if ( ! this.$el.attr( 'data-changed' ) ) {
|
183 |
+
return;
|
184 |
+
}
|
185 |
+
|
186 |
var total = 0,
|
187 |
count = this.collection.length;
|
188 |
|
215 |
item.set( 'type', type );
|
216 |
});
|
217 |
this.render();
|
218 |
+
},
|
219 |
+
|
220 |
+
updateAppAttr: function() {
|
221 |
+
this.$el.attr( 'data-changed', '1' );
|
222 |
}
|
223 |
});
|
224 |
|
admin/class-wp-review-form-field.php
CHANGED
@@ -18,19 +18,23 @@ class WP_Review_Form_Field {
|
|
18 |
* @return string
|
19 |
*/
|
20 |
public function render_switch( array $args = array() ) {
|
21 |
-
$args = wp_parse_args(
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
$switch_name = $args['name'] ? $args['name'] : $switch_id;
|
33 |
-
$value
|
34 |
|
35 |
if ( $args['disabled'] ) {
|
36 |
$args['class'] .= ' wp-review-disabled';
|
18 |
* @return string
|
19 |
*/
|
20 |
public function render_switch( array $args = array() ) {
|
21 |
+
$args = wp_parse_args(
|
22 |
+
$args,
|
23 |
+
array(
|
24 |
+
'id' => '',
|
25 |
+
'class' => '',
|
26 |
+
'name' => '',
|
27 |
+
'on_label' => _x( 'Yes', 'switch label', 'wp-review' ),
|
28 |
+
'off_label' => _x( 'No', 'switch label', 'wp-review' ),
|
29 |
+
'value' => 0,
|
30 |
+
'echo' => true,
|
31 |
+
'disabled' => false,
|
32 |
+
)
|
33 |
+
);
|
34 |
+
|
35 |
+
$switch_id = $args['id'] ? $args['id'] : 'wpr-switch-' . mt_rand( 100, 999 );
|
36 |
$switch_name = $args['name'] ? $args['name'] : $switch_id;
|
37 |
+
$value = intval( $args['value'] );
|
38 |
|
39 |
if ( $args['disabled'] ) {
|
40 |
$args['class'] .= ' wp-review-disabled';
|
admin/{import.php → class-wp-review-importer.php}
RENAMED
@@ -1,7 +1,15 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
defined( 'ABSPATH' ) || exit;
|
4 |
|
|
|
|
|
|
|
5 |
class WP_Review_Importer {
|
6 |
|
7 |
/**
|
@@ -11,6 +19,9 @@ class WP_Review_Importer {
|
|
11 |
*/
|
12 |
private $numposts;
|
13 |
|
|
|
|
|
|
|
14 |
public function __construct() {
|
15 |
add_action( 'wp_ajax_wp_review_import_options', array( $this, 'import_options' ) );
|
16 |
add_action( 'init', array( $this, 'extra_tasks' ) );
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Review importer
|
4 |
+
*
|
5 |
+
* @package WP_Review
|
6 |
+
*/
|
7 |
|
8 |
defined( 'ABSPATH' ) || exit;
|
9 |
|
10 |
+
/**
|
11 |
+
* Class WP_Review_Importer
|
12 |
+
*/
|
13 |
class WP_Review_Importer {
|
14 |
|
15 |
/**
|
19 |
*/
|
20 |
private $numposts;
|
21 |
|
22 |
+
/**
|
23 |
+
* WP_Review_Importer constructor.
|
24 |
+
*/
|
25 |
public function __construct() {
|
26 |
add_action( 'wp_ajax_wp_review_import_options', array( $this, 'import_options' ) );
|
27 |
add_action( 'init', array( $this, 'extra_tasks' ) );
|
admin/class-wp-review-options.php
CHANGED
@@ -57,8 +57,8 @@ class WP_Review_Options {
|
|
57 |
/**
|
58 |
* Adds classes to body tag.
|
59 |
*
|
60 |
-
* @param
|
61 |
-
* @return
|
62 |
*/
|
63 |
public function admin_body_classes( $classes ) {
|
64 |
$classes .= ' wp-review-admin-options';
|
@@ -137,23 +137,23 @@ class WP_Review_Options {
|
|
137 |
|
138 |
$tabs = array();
|
139 |
|
140 |
-
foreach($tabs_content as $key => $tab) {
|
141 |
-
$hide = wp_review_network_option($tab['multisite_enabled']);
|
142 |
-
if( current_user_can($tab['capability']) &&
|
143 |
$tabs[] = array(
|
144 |
'id' => $key,
|
145 |
'title' => $tab['title'],
|
146 |
-
'icon'
|
147 |
-
'view' => WP_REVIEW_ADMIN . 'options/'
|
148 |
);
|
149 |
}
|
150 |
}
|
151 |
|
152 |
-
if(is_multisite() && is_main_site() && current_user_can('administrator')) {
|
153 |
$tabs[] = array(
|
154 |
'id' => 'multisite_settings',
|
155 |
'title' => __( 'Multisite Settings', 'wp-review' ),
|
156 |
-
'icon'
|
157 |
'view' => WP_REVIEW_ADMIN . 'options/multisite.php',
|
158 |
);
|
159 |
}
|
@@ -196,5 +196,5 @@ class WP_Review_Options {
|
|
196 |
}
|
197 |
}
|
198 |
|
199 |
-
$
|
200 |
-
$
|
57 |
/**
|
58 |
* Adds classes to body tag.
|
59 |
*
|
60 |
+
* @param string $classes Body classes.
|
61 |
+
* @return string
|
62 |
*/
|
63 |
public function admin_body_classes( $classes ) {
|
64 |
$classes .= ' wp-review-admin-options';
|
137 |
|
138 |
$tabs = array();
|
139 |
|
140 |
+
foreach ( $tabs_content as $key => $tab ) {
|
141 |
+
$hide = wp_review_network_option( $tab['multisite_enabled'] );
|
142 |
+
if ( current_user_can( $tab['capability'] ) && ! $hide ) {
|
143 |
$tabs[] = array(
|
144 |
'id' => $key,
|
145 |
'title' => $tab['title'],
|
146 |
+
'icon' => 'fa fa-' . $tab['icon'],
|
147 |
+
'view' => WP_REVIEW_ADMIN . 'options/' . $key . '.php',
|
148 |
);
|
149 |
}
|
150 |
}
|
151 |
|
152 |
+
if ( is_multisite() && is_main_site() && current_user_can( 'administrator' ) ) {
|
153 |
$tabs[] = array(
|
154 |
'id' => 'multisite_settings',
|
155 |
'title' => __( 'Multisite Settings', 'wp-review' ),
|
156 |
+
'icon' => 'fa fa-sitemap',
|
157 |
'view' => WP_REVIEW_ADMIN . 'options/multisite.php',
|
158 |
);
|
159 |
}
|
196 |
}
|
197 |
}
|
198 |
|
199 |
+
$options_page = new WP_Review_Options();
|
200 |
+
$options_page->init();
|
admin/demo-importer.php
CHANGED
@@ -6,15 +6,18 @@
|
|
6 |
* @since 3.0.0
|
7 |
*/
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
|
13 |
/**
|
14 |
* Imports demo.
|
15 |
*/
|
16 |
function wp_review_import_demo() {
|
17 |
-
$file
|
18 |
$importer = new WP_Review_Demo_Importer();
|
19 |
$importer->import( $file );
|
20 |
}
|
6 |
* @since 3.0.0
|
7 |
*/
|
8 |
|
9 |
+
/**
|
10 |
+
* Require files.
|
11 |
+
*/
|
12 |
+
require_once WP_REVIEW_ADMIN . 'demo-importer/class-wp-import.php';
|
13 |
+
require_once WP_REVIEW_ADMIN . 'demo-importer/class-wp-review-demo-importer.php';
|
14 |
|
15 |
|
16 |
/**
|
17 |
* Imports demo.
|
18 |
*/
|
19 |
function wp_review_import_demo() {
|
20 |
+
$file = WP_REVIEW_INCLUDES . 'demo/demo-content.xml';
|
21 |
$importer = new WP_Review_Demo_Importer();
|
22 |
$importer->import( $file );
|
23 |
}
|
admin/demo-importer/class-wp-review-demo-importer.php
CHANGED
@@ -6,6 +6,9 @@
|
|
6 |
* @since 3.0.0
|
7 |
*/
|
8 |
|
|
|
|
|
|
|
9 |
class WP_Review_Demo_Importer {
|
10 |
|
11 |
/**
|
6 |
* @since 3.0.0
|
7 |
*/
|
8 |
|
9 |
+
/**
|
10 |
+
* Class WP_Review_Demo_Importer
|
11 |
+
*/
|
12 |
class WP_Review_Demo_Importer {
|
13 |
|
14 |
/**
|
admin/font-awesome-icons.php
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
* @since 3.0.0
|
7 |
*/
|
8 |
|
|
|
9 |
return array(
|
10 |
'fa fa-star' => array( 'unicode' => '\f005', 'name' => 'Star' ),
|
11 |
'fa fa-500px' => array( 'unicode' => '\f26e', 'name' => '500px' ),
|
@@ -683,3 +684,4 @@ return array(
|
|
683 |
'fa fa-youtube-play' => array( 'unicode' => '\f16a', 'name' => 'Youtube play' ),
|
684 |
'fa fa-youtube-square' => array( 'unicode' => '\f166', 'name' => 'Youtube square' ),
|
685 |
);
|
|
6 |
* @since 3.0.0
|
7 |
*/
|
8 |
|
9 |
+
// phpcs:disable
|
10 |
return array(
|
11 |
'fa fa-star' => array( 'unicode' => '\f005', 'name' => 'Star' ),
|
12 |
'fa fa-500px' => array( 'unicode' => '\f26e', 'name' => '500px' ),
|
684 |
'fa fa-youtube-play' => array( 'unicode' => '\f16a', 'name' => 'Youtube play' ),
|
685 |
'fa fa-youtube-square' => array( 'unicode' => '\f166', 'name' => 'Youtube square' ),
|
686 |
);
|
687 |
+
// phpcs:enable
|
admin/metaboxes.php
CHANGED
@@ -24,17 +24,17 @@ require_once plugin_dir_path( __FILE__ ) . 'review-options-meta-box.php';
|
|
24 |
* @since 1.0
|
25 |
*/
|
26 |
function wp_review_add_meta_boxes() {
|
27 |
-
$post_types
|
28 |
-
$excluded_post_types
|
29 |
-
$hide_review_box
|
30 |
-
$hide_review_links
|
31 |
-
$hide_review_desc
|
32 |
$hide_review_features = wp_review_network_option( 'hide_features_' );
|
33 |
-
$hide_user_reviews
|
34 |
|
35 |
if ( ! $hide_review_box && current_user_can( 'wp_review_single_page' ) ) {
|
36 |
foreach ( $post_types as $post_type ) {
|
37 |
-
if ( ! in_array( $post_type, $excluded_post_types ) ) {
|
38 |
add_meta_box(
|
39 |
'wp-review-metabox-review',
|
40 |
__( 'Review', 'wp-review' ),
|
@@ -59,7 +59,7 @@ function wp_review_add_meta_boxes() {
|
|
59 |
add_meta_box(
|
60 |
'wp-review-metabox-reviewLinks',
|
61 |
__( 'Review Links', 'wp-review' ),
|
62 |
-
'
|
63 |
$post_type,
|
64 |
'normal',
|
65 |
'high'
|
@@ -80,7 +80,7 @@ function wp_review_add_meta_boxes() {
|
|
80 |
add_meta_box(
|
81 |
'wp-review-metabox-userReview',
|
82 |
__( 'User Reviews', 'wp-review' ),
|
83 |
-
'
|
84 |
$post_type,
|
85 |
'normal',
|
86 |
'high'
|
@@ -100,8 +100,8 @@ function wp_review_add_meta_boxes() {
|
|
100 |
* @param WP_Post $post Post object.
|
101 |
*/
|
102 |
function wp_review_render_meta_box_item( $post ) {
|
103 |
-
$form_field
|
104 |
-
$options
|
105 |
$default_location = wp_review_get_default_location();
|
106 |
$default_criteria = wp_review_get_default_criteria();
|
107 |
|
@@ -117,8 +117,8 @@ function wp_review_render_meta_box_item( $post ) {
|
|
117 |
);
|
118 |
}
|
119 |
|
120 |
-
$global_colors
|
121 |
-
$global_color
|
122 |
$global_inactive_color = $global_colors['inactive_color'];
|
123 |
|
124 |
/* Retrieve an existing value from the database. */
|
@@ -133,13 +133,15 @@ function wp_review_render_meta_box_item( $post ) {
|
|
133 |
|
134 |
$total = get_post_meta( $post->ID, 'wp_review_total', true );
|
135 |
|
136 |
-
$
|
137 |
-
$
|
|
|
|
|
138 |
|
139 |
-
$location
|
140 |
-
$fontcolor
|
141 |
-
$bgcolor1
|
142 |
-
$bgcolor2
|
143 |
$bordercolor = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
|
144 |
|
145 |
if ( ! $color ) {
|
@@ -149,41 +151,41 @@ function wp_review_render_meta_box_item( $post ) {
|
|
149 |
$inactive_color = $global_inactive_color;
|
150 |
}
|
151 |
|
152 |
-
if ( ''
|
153 |
$location = ! empty( $options['location'] ) ? $options['location'] : $default_location;
|
154 |
}
|
155 |
-
if ( ''
|
156 |
$fontcolor = $global_colors['fontcolor'];
|
157 |
}
|
158 |
-
if ( ''
|
159 |
$bgcolor1 = $global_colors['bgcolor1'];
|
160 |
}
|
161 |
-
if ( ''
|
162 |
$bgcolor2 = $global_colors['bgcolor2'];
|
163 |
}
|
164 |
-
if ( ''
|
165 |
$bordercolor = $global_colors['bordercolor'];
|
166 |
}
|
167 |
|
168 |
-
$fields
|
169 |
-
'location'
|
170 |
-
'color'
|
171 |
-
'inactive_color'
|
172 |
-
'fontcolor'
|
173 |
-
'bgcolor1'
|
174 |
-
'bgcolor2'
|
175 |
-
'bordercolor'
|
176 |
-
'fontfamily'
|
177 |
-
'custom_colors'
|
178 |
-
'custom_location'
|
179 |
'disable_features' => true,
|
180 |
);
|
181 |
$displayed_fields = apply_filters( 'wp_review_metabox_item_fields', $fields );
|
182 |
|
183 |
$review_templates = wp_review_get_box_templates();
|
184 |
-
$box_template
|
185 |
|
186 |
-
if ( ! $box_template || ! in_array( $box_template, array( 'default', 'aqua' ) ) ) {
|
187 |
$box_template = wp_review_option( 'box_template', 'default' );
|
188 |
}
|
189 |
$box_template_img = ! empty( $review_templates[ $box_template ] ) ? $review_templates[ $box_template ]['image'] : WP_REVIEW_ASSETS . 'images/largethumb.png';
|
@@ -282,7 +284,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
282 |
</div>
|
283 |
</script>
|
284 |
|
285 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['disable_features'] ) ) echo ' style="display: none;"'; ?>>
|
286 |
<div class="wp-review-field-label">
|
287 |
<label><?php esc_html_e( 'Hide Features', 'wp-review' ); ?></label>
|
288 |
<?php wp_review_print_pro_text(); ?>
|
@@ -290,31 +292,35 @@ function wp_review_render_meta_box_item( $post ) {
|
|
290 |
|
291 |
<div class="wp-review-field-option">
|
292 |
<?php
|
293 |
-
$form_field->render_switch(
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
|
|
|
|
298 |
?>
|
299 |
</div>
|
300 |
</div>
|
301 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['custom_location'] ) ) echo ' style="display: none;"'; ?>>
|
302 |
<div class="wp-review-field-label">
|
303 |
<label><?php esc_html_e( 'Custom Location', 'wp-review' ); ?></label>
|
304 |
</div>
|
305 |
|
306 |
<div class="wp-review-field-option">
|
307 |
<?php
|
308 |
-
$form_field->render_switch(
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
|
|
|
|
313 |
?>
|
314 |
</div>
|
315 |
</div>
|
316 |
|
317 |
-
<div class="wp-review-location-options"<?php if ( empty( $custom_location ) || empty( $displayed_fields['location'] ) ) echo ' style="display: none;"'; ?>>
|
318 |
<div class="wp-review-field">
|
319 |
<div class="wp-review-field-label">
|
320 |
<label for="wp_review_location"><?php esc_html_e( 'Review Location', 'wp-review' ); ?></label>
|
@@ -336,23 +342,25 @@ function wp_review_render_meta_box_item( $post ) {
|
|
336 |
</div>
|
337 |
</div>
|
338 |
|
339 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['custom_colors'] ) ) echo ' style="display: none;"'; ?>>
|
340 |
<div class="wp-review-field-label">
|
341 |
<label><?php esc_html_e( 'Custom Layout', 'wp-review' ); ?></label>
|
342 |
</div>
|
343 |
|
344 |
<div class="wp-review-field-option">
|
345 |
<?php
|
346 |
-
$form_field->render_switch(
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
|
|
|
|
351 |
?>
|
352 |
</div>
|
353 |
</div>
|
354 |
|
355 |
-
<div class="wp-review-color-options"<?php if ( empty( $custom_colors ) ) echo ' style="display: none;"'; ?>>
|
356 |
<div class="wp-review-field vertical">
|
357 |
<div class="wp-review-field-label">
|
358 |
<label for="wp_review_box_template"><?php esc_html_e( 'Default', 'wp-review' ); ?></label>
|
@@ -386,7 +394,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
386 |
</div>
|
387 |
</div>
|
388 |
|
389 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['color'] ) ) echo ' style="display: none;"'; ?>>
|
390 |
<div class="wp-review-field-label">
|
391 |
<label for="wp_review_color"><?php esc_html_e( 'Review Color', 'wp-review' ); ?></label>
|
392 |
</div>
|
@@ -396,7 +404,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
396 |
</div>
|
397 |
</div>
|
398 |
|
399 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['inactive_color'] ) ) echo ' style="display: none;"'; ?>>
|
400 |
<div class="wp-review-field-label">
|
401 |
<label for="wp_review_inactive_color"><?php esc_html_e( 'Inactive Review Color', 'wp-review' ); ?></label>
|
402 |
</div>
|
@@ -406,7 +414,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
406 |
</div>
|
407 |
</div>
|
408 |
|
409 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['fontcolor'] ) ) echo ' style="display: none;"'; ?>>
|
410 |
<div class="wp-review-field-label">
|
411 |
<label for="wp_review_fontcolor"><?php esc_html_e( 'Font Color', 'wp-review' ); ?></label>
|
412 |
</div>
|
@@ -416,7 +424,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
416 |
</div>
|
417 |
</div>
|
418 |
|
419 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor1'] ) ) echo ' style="display: none;"'; ?>>
|
420 |
<div class="wp-review-field-label">
|
421 |
<label for="wp_review_bgcolor1"><?php esc_html_e( 'Heading Background Color', 'wp-review' ); ?></label>
|
422 |
</div>
|
@@ -426,7 +434,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
426 |
</div>
|
427 |
</div>
|
428 |
|
429 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor2'] ) ) echo ' style="display: none;"'; ?>>
|
430 |
<div class="wp-review-field-label">
|
431 |
<label for="wp_review_bgcolor2"><?php esc_html_e( 'Background Color', 'wp-review' ); ?></label>
|
432 |
</div>
|
@@ -436,7 +444,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
436 |
</div>
|
437 |
</div>
|
438 |
|
439 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bordercolor'] ) ) echo ' style="display: none;"'; ?>>
|
440 |
<div class="wp-review-field-label">
|
441 |
<label for="wp_review_bordercolor"><?php esc_html_e( 'Border Color', 'wp-review' ); ?></label>
|
442 |
</div>
|
@@ -446,7 +454,7 @@ function wp_review_render_meta_box_item( $post ) {
|
|
446 |
</div>
|
447 |
</div>
|
448 |
|
449 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['fontfamily'] ) ) echo ' style="display: none;"'; ?>>
|
450 |
<div class="wp-review-field-label">
|
451 |
<label><?php esc_html_e( 'Google Font', 'wp-review' ); ?></label>
|
452 |
<?php wp_review_print_pro_text(); ?>
|
@@ -454,11 +462,13 @@ function wp_review_render_meta_box_item( $post ) {
|
|
454 |
|
455 |
<div class="wp-review-field-option">
|
456 |
<?php
|
457 |
-
$form_field->render_switch(
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
|
|
|
|
462 |
?>
|
463 |
</div>
|
464 |
</div>
|
@@ -471,11 +481,13 @@ function wp_review_render_meta_box_item( $post ) {
|
|
471 |
|
472 |
<div class="wp-review-field-option">
|
473 |
<?php
|
474 |
-
$form_field->render_switch(
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
|
|
|
|
479 |
?>
|
480 |
</div>
|
481 |
</div>
|
@@ -494,13 +506,13 @@ function wp_review_render_meta_box_desc( $post ) {
|
|
494 |
wp_nonce_field( basename( __FILE__ ), 'wp-review-desc-nonce' );
|
495 |
|
496 |
/* Retrieve existing values from the database. */
|
497 |
-
$desc
|
498 |
$desc_title = get_post_meta( $post->ID, 'wp_review_desc_title', true );
|
499 |
if ( ! $desc_title ) {
|
500 |
$desc_title = __( 'Summary', 'wp-review' );
|
501 |
}
|
502 |
$form_field = new WP_Review_Form_Field();
|
503 |
-
$hidden
|
504 |
?>
|
505 |
<div id="wp_review_desc_settings" class="<?php echo esc_attr( $hidden ); ?>">
|
506 |
<div class="wp-review-field">
|
@@ -525,7 +537,7 @@ function wp_review_render_meta_box_desc( $post ) {
|
|
525 |
$desc,
|
526 |
'wp_review_desc',
|
527 |
array(
|
528 |
-
'tinymce'
|
529 |
'toolbar1' => 'bold,italic,underline,bullist,numlist,separator,separator,link,unlink,undo,redo,removeformat',
|
530 |
'toolbar2' => '',
|
531 |
'toolbar3' => '',
|
@@ -604,11 +616,13 @@ function wp_review_render_meta_box_desc( $post ) {
|
|
604 |
|
605 |
<div class="wp-review-field-option">
|
606 |
<?php
|
607 |
-
$form_field->render_switch(
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
|
|
|
|
612 |
?>
|
613 |
</div>
|
614 |
</div>
|
@@ -618,7 +632,7 @@ function wp_review_render_meta_box_desc( $post ) {
|
|
618 |
/**
|
619 |
* Maps default link texts and urls.
|
620 |
*
|
621 |
-
* @since 5.0.3 Move this function out of `
|
622 |
*
|
623 |
* @param string $text Link text.
|
624 |
* @param string $url Link url.
|
@@ -627,22 +641,31 @@ function wp_review_render_meta_box_desc( $post ) {
|
|
627 |
function wp_review_get_default_links( $text, $url ) {
|
628 |
return array(
|
629 |
'text' => $text,
|
630 |
-
'url'
|
631 |
);
|
632 |
}
|
633 |
|
634 |
-
|
|
|
|
|
|
|
|
|
|
|
635 |
|
636 |
wp_nonce_field( basename( __FILE__ ), 'wp-review-links-options-nonce' );
|
637 |
|
638 |
wp_review_switch_to_main();
|
639 |
$options = get_option( 'wp_review_options' );
|
640 |
-
if (is_multisite() )
|
|
|
|
|
|
|
641 |
$defaults = array_map(
|
642 |
'wp_review_get_default_links',
|
643 |
empty( $options['default_link_text'] ) ? array() : $options['default_link_text'],
|
644 |
empty( $options['default_link_url'] ) ? array() : $options['default_link_url']
|
645 |
);
|
|
|
646 |
$items = get_post_meta( $post->ID, 'wp_review_links', true );
|
647 |
if ( ! is_array( $items ) ) {
|
648 |
$items = $defaults;
|
@@ -651,12 +674,12 @@ function wp_review_render_meta_box_reviewLinks( $post ) {
|
|
651 |
<table id="wp-review-links" class="wp-review-links" width="100%">
|
652 |
|
653 |
<thead>
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
</thead>
|
661 |
|
662 |
<tbody>
|
@@ -704,11 +727,16 @@ function wp_review_render_meta_box_reviewLinks( $post ) {
|
|
704 |
|
705 |
</table>
|
706 |
|
707 |
-
<a class="add-row button" data-target="#wp-review-links" href="#"><?php esc_html_e( 'Add another', 'wp-review' ) ?></a>
|
708 |
-
<?php
|
709 |
}
|
710 |
|
711 |
-
|
|
|
|
|
|
|
|
|
|
|
712 |
/* Add an nonce field so we can check for it later. */
|
713 |
wp_nonce_field( basename( __FILE__ ), 'wp-review-userReview-nonce' );
|
714 |
$enabled = wp_review_get_user_rating_setup( $post->ID );
|
@@ -717,9 +745,10 @@ function wp_review_render_meta_box_userReview( $post ) {
|
|
717 |
if ( ! $type ) {
|
718 |
$type = wp_review_option( 'review_type', 'none' );
|
719 |
}
|
720 |
-
|
|
|
721 |
$available_types = wp_review_get_rating_types();
|
722 |
-
$product_price
|
723 |
|
724 |
$form_field = new WP_Review_Form_Field();
|
725 |
?>
|
@@ -817,11 +846,13 @@ function wp_review_render_meta_box_userReview( $post ) {
|
|
817 |
|
818 |
<div class="wp-review-field-option">
|
819 |
<?php
|
820 |
-
$form_field->render_switch(
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
|
|
|
|
825 |
?>
|
826 |
</div>
|
827 |
</div>
|
@@ -854,7 +885,9 @@ function wp_review_render_meta_box_userReview( $post ) {
|
|
854 |
</div>
|
855 |
</div>
|
856 |
|
857 |
-
<?php
|
|
|
|
|
858 |
<p style="margin-top: 50px;">
|
859 |
<button
|
860 |
type="button"
|
@@ -866,7 +899,8 @@ function wp_review_render_meta_box_userReview( $post ) {
|
|
866 |
><?php esc_html_e( 'Purge visitor ratings', 'wp-review' ); ?></button>
|
867 |
<span class="description"><?php esc_html_e( 'Click to remove all visitor ratings of this post.', 'wp-review' ); ?></span>
|
868 |
</p>
|
869 |
-
|
|
|
870 |
}
|
871 |
|
872 |
/**
|
@@ -876,6 +910,7 @@ function wp_review_render_meta_box_userReview( $post ) {
|
|
876 |
*
|
877 |
* @param int $post_id Post ID.
|
878 |
* @param WP_Post $post Post object.
|
|
|
879 |
*/
|
880 |
function wp_review_save_postdata( $post_id, $post ) {
|
881 |
|
@@ -885,55 +920,55 @@ function wp_review_save_postdata( $post_id, $post ) {
|
|
885 |
}
|
886 |
|
887 |
if ( ! isset( $_POST['wp-review-review-options-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-review-options-nonce'], 'wp-review-meta-box-options' ) ) {
|
888 |
-
return;
|
889 |
}
|
890 |
|
891 |
-
$hide_desc
|
892 |
-
$hide_links
|
893 |
-
$hide_user_reviews
|
894 |
$hide_review_features = false;
|
895 |
|
896 |
-
if (is_multisite() ) {
|
897 |
-
$hide_desc
|
898 |
-
$hide_links
|
899 |
-
$hide_user_reviews
|
900 |
$hide_review_features = wp_review_network_option( 'hide_features_' );
|
901 |
}
|
902 |
|
903 |
-
if ( ! $hide_desc && !current_user_can( 'wp_review_description' ) ) {
|
904 |
$hide_desc = true;
|
905 |
}
|
906 |
|
907 |
-
if ( ! $hide_links && !current_user_can( 'wp_review_links' ) ) {
|
908 |
$hide_links = true;
|
909 |
}
|
910 |
|
911 |
-
if ( ! $hide_user_reviews && !current_user_can( 'wp_review_user_reviews' ) ) {
|
912 |
$hide_user_reviews = true;
|
913 |
}
|
914 |
|
915 |
-
if ( ! $hide_review_features && !current_user_can( 'wp_review_features' ) ) {
|
916 |
$hide_review_features = true;
|
917 |
}
|
918 |
|
919 |
if ( ! $hide_review_features && ( ! isset( $_POST['wp-review-item-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-item-nonce'], basename( __FILE__ ) ) ) ) {
|
920 |
-
return;
|
921 |
}
|
922 |
|
923 |
if ( ! $hide_desc && ( ! isset( $_POST['wp-review-desc-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-desc-nonce'], basename( __FILE__ ) ) ) ) {
|
924 |
-
return;
|
925 |
}
|
926 |
|
927 |
if ( ! $hide_links && ( ! isset( $_POST['wp-review-links-options-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-links-options-nonce'], basename( __FILE__ ) ) ) ) {
|
928 |
-
return;
|
929 |
}
|
930 |
|
931 |
if ( ! $hide_user_reviews && ( ! isset( $_POST['wp-review-userReview-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-userReview-nonce'], basename( __FILE__ ) ) ) ) {
|
932 |
-
return;
|
933 |
}
|
934 |
|
935 |
/* Check the user's permissions. */
|
936 |
-
if ( isset($_POST['post_type']) && 'page'
|
937 |
if ( ! current_user_can( 'edit_page', $post_id ) ) {
|
938 |
return $post_id;
|
939 |
}
|
@@ -954,29 +989,29 @@ function wp_review_save_postdata( $post_id, $post ) {
|
|
954 |
}
|
955 |
|
956 |
$meta = array(
|
957 |
-
'wp_review_custom_location'
|
958 |
-
'wp_review_custom_colors'
|
959 |
-
'wp_review_custom_author'
|
960 |
-
'wp_review_location'
|
961 |
-
'wp_review_heading'
|
962 |
-
'wp_review_desc_title'
|
963 |
-
'wp_review_desc'
|
964 |
-
'wp_review_hide_desc'
|
965 |
-
'wp_review_userReview'
|
966 |
-
'wp_review_total'
|
967 |
-
'wp_review_color'
|
968 |
-
'wp_review_inactive_color'
|
969 |
-
'wp_review_fontcolor'
|
970 |
-
'wp_review_bgcolor1'
|
971 |
-
'wp_review_bgcolor2'
|
972 |
-
'wp_review_bordercolor'
|
973 |
-
'wp_review_author'
|
974 |
-
'wp_review_schema'
|
975 |
-
'wp_review_rating_schema'
|
976 |
-
'wp_review_show_schema_data'
|
977 |
-
'wp_review_user_review_type'
|
978 |
-
'wp_review_product_price'
|
979 |
-
'wp_review_box_template'
|
980 |
);
|
981 |
|
982 |
$default_colors = wp_review_get_global_colors();
|
@@ -998,7 +1033,7 @@ function wp_review_save_postdata( $post_id, $post ) {
|
|
998 |
$new_meta_value = '0';
|
999 |
}
|
1000 |
|
1001 |
-
if( 'wp_review_box_template' === $meta_key && !in_array( $new_meta_value, array( 'default', 'aqua' ) ) ) {
|
1002 |
continue;
|
1003 |
}
|
1004 |
|
@@ -1014,9 +1049,9 @@ function wp_review_save_postdata( $post_id, $post ) {
|
|
1014 |
|
1015 |
wp_review_save_review_items_data( $post_id );
|
1016 |
|
1017 |
-
$old
|
1018 |
$link_text = (array) filter_input( INPUT_POST, 'wp_review_link_title', FILTER_SANITIZE_STRING, FILTER_FORCE_ARRAY );
|
1019 |
-
$link_url
|
1020 |
$new_links = array();
|
1021 |
|
1022 |
if ( ! empty( $link_text ) ) {
|
@@ -1053,12 +1088,13 @@ function wp_review_save_postdata( $post_id, $post ) {
|
|
1053 |
/**
|
1054 |
* Clears transients
|
1055 |
*
|
1056 |
-
* @param int
|
|
|
1057 |
*/
|
1058 |
function wp_review_clear_query_cache( $post_id, $post ) {
|
1059 |
global $wpdb;
|
1060 |
$where = $wpdb->prepare( 'WHERE option_name REGEXP %s', '_transient(_timeout)?_wp_review_[0-9a-f]{32}' );
|
1061 |
-
$wpdb->query( "DELETE FROM {$wpdb->prefix}options {$where}" );
|
1062 |
}
|
1063 |
|
1064 |
/**
|
@@ -1068,18 +1104,11 @@ function wp_review_clear_query_cache( $post_id, $post ) {
|
|
1068 |
*/
|
1069 |
function wp_review_save_review_items_data( $post_id ) {
|
1070 |
$old = get_post_meta( $post_id, 'wp_review_item', true );
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
$post_inactive_color = get_post_meta( $post_id, 'wp_review_inactive_color', true );
|
1077 |
-
$custom_colors = get_post_meta( $post_id, 'wp_review_custom_colors', true );
|
1078 |
-
|
1079 |
-
if ( ! empty( $_POST['wp_review_item_title'] ) ) {
|
1080 |
-
$title = $_POST['wp_review_item_title'];
|
1081 |
-
$star = $_POST['wp_review_item_star'];
|
1082 |
-
$ids = $_POST['wp_review_item_id'];
|
1083 |
$new = array();
|
1084 |
|
1085 |
$count = count( $title );
|
@@ -1089,7 +1118,7 @@ function wp_review_save_review_items_data( $post_id ) {
|
|
1089 |
continue; // Prevent item without score.
|
1090 |
}
|
1091 |
|
1092 |
-
$new[ $i ]
|
1093 |
$new[ $i ]['wp_review_item_star'] = floatval( $star[ $i ] );
|
1094 |
|
1095 |
if ( ! empty( $ids[ $i ] ) ) {
|
@@ -1101,7 +1130,7 @@ function wp_review_save_review_items_data( $post_id ) {
|
|
1101 |
}
|
1102 |
}
|
1103 |
|
1104 |
-
if ( ! empty( $new ) && $new
|
1105 |
update_post_meta( $post_id, 'wp_review_item', $new );
|
1106 |
} elseif ( empty( $new ) && $old ) {
|
1107 |
delete_post_meta( $post_id, 'wp_review_item', $old );
|
@@ -1120,31 +1149,41 @@ function wp_review_save_review_items_data( $post_id ) {
|
|
1120 |
* @return array
|
1121 |
*/
|
1122 |
function add_field_debug_preview( $fields ) {
|
1123 |
-
|
1124 |
-
|
1125 |
}
|
1126 |
add_filter( '_wp_post_revision_fields', 'add_field_debug_preview' );
|
1127 |
|
1128 |
|
|
|
|
|
|
|
1129 |
function add_input_debug_preview() {
|
1130 |
-
|
1131 |
}
|
1132 |
add_action( 'edit_form_after_title', 'add_input_debug_preview' );
|
1133 |
|
1134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
function wp_review_schema_field( $args, $value, $schema_type ) {
|
1136 |
$type = isset( $args['type'] ) ? $args['type'] : '';
|
1137 |
$name = isset( $args['name'] ) ? $args['name'] : '';
|
1138 |
$label = isset( $args['label'] ) ? $args['label'] : '';
|
1139 |
$options = isset( $args['options'] ) ? $args['options'] : array();
|
1140 |
$default = isset( $args['default'] ) ? $args['default'] : '';
|
1141 |
-
$min
|
1142 |
-
$max
|
1143 |
-
$info
|
1144 |
|
1145 |
// Option value.
|
1146 |
-
$opt_val
|
1147 |
-
$opt_id_attr
|
1148 |
$opt_name_attr = 'wp_review_schema_options[' . $schema_type . '][' . $name . ']';
|
1149 |
|
1150 |
$form_field = new WP_Review_Form_Field();
|
@@ -1200,8 +1239,8 @@ function wp_review_schema_field( $args, $value, $schema_type ) {
|
|
1200 |
}
|
1201 |
?>
|
1202 |
</span>
|
1203 |
-
<input type="hidden" id="<?php echo esc_attr( $opt_id_attr ); ?>-id" name="<?php echo esc_attr( $opt_name_attr ); ?>[id]" value="<?php if ( isset( $opt_val['id'] ) ) echo $opt_val['id']; ?>" />
|
1204 |
-
<input type="hidden" id="<?php echo esc_attr( $opt_id_attr ); ?>-url" name="<?php echo esc_attr( $opt_name_attr ); ?>[url]" value="<?php if ( isset( $opt_val['url'] ) ) echo $opt_val['url']; ?>" />
|
1205 |
<button class="button" name="<?php echo esc_attr( $opt_id_attr ); ?>-upload" id="<?php echo esc_attr( $opt_id_attr ); ?>-upload" data-id="<?php echo esc_attr( $opt_id_attr ); ?>" onclick="wprImageField.uploader( '<?php echo esc_attr( $opt_id_attr ); ?>' ); return false;"><?php esc_html_e( 'Select Image', 'wp-review' ); ?></button>
|
1206 |
<?php
|
1207 |
if ( ! empty( $opt_val['url'] ) ) {
|
24 |
* @since 1.0
|
25 |
*/
|
26 |
function wp_review_add_meta_boxes() {
|
27 |
+
$post_types = get_post_types( array( 'public' => true ), 'names' );
|
28 |
+
$excluded_post_types = apply_filters( 'wp_review_excluded_post_types', array( 'attachment' ) );
|
29 |
+
$hide_review_box = wp_review_network_option( 'hide_ratings_in_posts_' );
|
30 |
+
$hide_review_links = wp_review_network_option( 'hide_review_links_' );
|
31 |
+
$hide_review_desc = wp_review_network_option( 'hide_review_description_' );
|
32 |
$hide_review_features = wp_review_network_option( 'hide_features_' );
|
33 |
+
$hide_user_reviews = wp_review_network_option( 'hide_user_reviews_' );
|
34 |
|
35 |
if ( ! $hide_review_box && current_user_can( 'wp_review_single_page' ) ) {
|
36 |
foreach ( $post_types as $post_type ) {
|
37 |
+
if ( ! in_array( $post_type, $excluded_post_types, true ) ) {
|
38 |
add_meta_box(
|
39 |
'wp-review-metabox-review',
|
40 |
__( 'Review', 'wp-review' ),
|
59 |
add_meta_box(
|
60 |
'wp-review-metabox-reviewLinks',
|
61 |
__( 'Review Links', 'wp-review' ),
|
62 |
+
'wp_review_render_meta_box_review_links',
|
63 |
$post_type,
|
64 |
'normal',
|
65 |
'high'
|
80 |
add_meta_box(
|
81 |
'wp-review-metabox-userReview',
|
82 |
__( 'User Reviews', 'wp-review' ),
|
83 |
+
'wp_review_render_meta_box_user_review',
|
84 |
$post_type,
|
85 |
'normal',
|
86 |
'high'
|
100 |
* @param WP_Post $post Post object.
|
101 |
*/
|
102 |
function wp_review_render_meta_box_item( $post ) {
|
103 |
+
$form_field = new WP_Review_Form_Field();
|
104 |
+
$options = get_option( 'wp_review_options' );
|
105 |
$default_location = wp_review_get_default_location();
|
106 |
$default_criteria = wp_review_get_default_criteria();
|
107 |
|
117 |
);
|
118 |
}
|
119 |
|
120 |
+
$global_colors = wp_review_get_global_colors();
|
121 |
+
$global_color = $global_colors['color'];
|
122 |
$global_inactive_color = $global_colors['inactive_color'];
|
123 |
|
124 |
/* Retrieve an existing value from the database. */
|
133 |
|
134 |
$total = get_post_meta( $post->ID, 'wp_review_total', true );
|
135 |
|
136 |
+
$post_color = get_post_meta( $post->ID, 'wp_review_color', true );
|
137 |
+
$post_inactive_color = get_post_meta( $post->ID, 'wp_review_inactive_color', true );
|
138 |
+
$color = $post_color;
|
139 |
+
$inactive_color = $post_inactive_color;
|
140 |
|
141 |
+
$location = get_post_meta( $post->ID, 'wp_review_location', true );
|
142 |
+
$fontcolor = get_post_meta( $post->ID, 'wp_review_fontcolor', true );
|
143 |
+
$bgcolor1 = get_post_meta( $post->ID, 'wp_review_bgcolor1', true );
|
144 |
+
$bgcolor2 = get_post_meta( $post->ID, 'wp_review_bgcolor2', true );
|
145 |
$bordercolor = get_post_meta( $post->ID, 'wp_review_bordercolor', true );
|
146 |
|
147 |
if ( ! $color ) {
|
151 |
$inactive_color = $global_inactive_color;
|
152 |
}
|
153 |
|
154 |
+
if ( '' === $location ) {
|
155 |
$location = ! empty( $options['location'] ) ? $options['location'] : $default_location;
|
156 |
}
|
157 |
+
if ( '' === $fontcolor ) {
|
158 |
$fontcolor = $global_colors['fontcolor'];
|
159 |
}
|
160 |
+
if ( '' === $bgcolor1 ) {
|
161 |
$bgcolor1 = $global_colors['bgcolor1'];
|
162 |
}
|
163 |
+
if ( '' === $bgcolor2 ) {
|
164 |
$bgcolor2 = $global_colors['bgcolor2'];
|
165 |
}
|
166 |
+
if ( '' === $bordercolor ) {
|
167 |
$bordercolor = $global_colors['bordercolor'];
|
168 |
}
|
169 |
|
170 |
+
$fields = array(
|
171 |
+
'location' => true,
|
172 |
+
'color' => true,
|
173 |
+
'inactive_color' => true,
|
174 |
+
'fontcolor' => true,
|
175 |
+
'bgcolor1' => true,
|
176 |
+
'bgcolor2' => true,
|
177 |
+
'bordercolor' => true,
|
178 |
+
'fontfamily' => true,
|
179 |
+
'custom_colors' => true,
|
180 |
+
'custom_location' => true,
|
181 |
'disable_features' => true,
|
182 |
);
|
183 |
$displayed_fields = apply_filters( 'wp_review_metabox_item_fields', $fields );
|
184 |
|
185 |
$review_templates = wp_review_get_box_templates();
|
186 |
+
$box_template = get_post_meta( $post->ID, 'wp_review_box_template', true );
|
187 |
|
188 |
+
if ( ! $box_template || ! in_array( $box_template, array( 'default', 'aqua' ), true ) ) {
|
189 |
$box_template = wp_review_option( 'box_template', 'default' );
|
190 |
}
|
191 |
$box_template_img = ! empty( $review_templates[ $box_template ] ) ? $review_templates[ $box_template ]['image'] : WP_REVIEW_ASSETS . 'images/largethumb.png';
|
284 |
</div>
|
285 |
</script>
|
286 |
|
287 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['disable_features'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
288 |
<div class="wp-review-field-label">
|
289 |
<label><?php esc_html_e( 'Hide Features', 'wp-review' ); ?></label>
|
290 |
<?php wp_review_print_pro_text(); ?>
|
292 |
|
293 |
<div class="wp-review-field-option">
|
294 |
<?php
|
295 |
+
$form_field->render_switch(
|
296 |
+
array(
|
297 |
+
'id' => 'wp_review_disable_features',
|
298 |
+
'name' => 'wp_review_disable_features',
|
299 |
+
'disabled' => true,
|
300 |
+
)
|
301 |
+
);
|
302 |
?>
|
303 |
</div>
|
304 |
</div>
|
305 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['custom_location'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
306 |
<div class="wp-review-field-label">
|
307 |
<label><?php esc_html_e( 'Custom Location', 'wp-review' ); ?></label>
|
308 |
</div>
|
309 |
|
310 |
<div class="wp-review-field-option">
|
311 |
<?php
|
312 |
+
$form_field->render_switch(
|
313 |
+
array(
|
314 |
+
'id' => 'wp_review_custom_location',
|
315 |
+
'name' => 'wp_review_custom_location',
|
316 |
+
'value' => $custom_location,
|
317 |
+
)
|
318 |
+
);
|
319 |
?>
|
320 |
</div>
|
321 |
</div>
|
322 |
|
323 |
+
<div class="wp-review-location-options"<?php if ( empty( $custom_location ) || empty( $displayed_fields['location'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
324 |
<div class="wp-review-field">
|
325 |
<div class="wp-review-field-label">
|
326 |
<label for="wp_review_location"><?php esc_html_e( 'Review Location', 'wp-review' ); ?></label>
|
342 |
</div>
|
343 |
</div>
|
344 |
|
345 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['custom_colors'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
346 |
<div class="wp-review-field-label">
|
347 |
<label><?php esc_html_e( 'Custom Layout', 'wp-review' ); ?></label>
|
348 |
</div>
|
349 |
|
350 |
<div class="wp-review-field-option">
|
351 |
<?php
|
352 |
+
$form_field->render_switch(
|
353 |
+
array(
|
354 |
+
'id' => 'wp_review_custom_colors',
|
355 |
+
'name' => 'wp_review_custom_colors',
|
356 |
+
'value' => $custom_colors,
|
357 |
+
)
|
358 |
+
);
|
359 |
?>
|
360 |
</div>
|
361 |
</div>
|
362 |
|
363 |
+
<div class="wp-review-color-options"<?php if ( empty( $custom_colors ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
364 |
<div class="wp-review-field vertical">
|
365 |
<div class="wp-review-field-label">
|
366 |
<label for="wp_review_box_template"><?php esc_html_e( 'Default', 'wp-review' ); ?></label>
|
394 |
</div>
|
395 |
</div>
|
396 |
|
397 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['color'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
398 |
<div class="wp-review-field-label">
|
399 |
<label for="wp_review_color"><?php esc_html_e( 'Review Color', 'wp-review' ); ?></label>
|
400 |
</div>
|
404 |
</div>
|
405 |
</div>
|
406 |
|
407 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['inactive_color'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
408 |
<div class="wp-review-field-label">
|
409 |
<label for="wp_review_inactive_color"><?php esc_html_e( 'Inactive Review Color', 'wp-review' ); ?></label>
|
410 |
</div>
|
414 |
</div>
|
415 |
</div>
|
416 |
|
417 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['fontcolor'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
418 |
<div class="wp-review-field-label">
|
419 |
<label for="wp_review_fontcolor"><?php esc_html_e( 'Font Color', 'wp-review' ); ?></label>
|
420 |
</div>
|
424 |
</div>
|
425 |
</div>
|
426 |
|
427 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor1'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
428 |
<div class="wp-review-field-label">
|
429 |
<label for="wp_review_bgcolor1"><?php esc_html_e( 'Heading Background Color', 'wp-review' ); ?></label>
|
430 |
</div>
|
434 |
</div>
|
435 |
</div>
|
436 |
|
437 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor2'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
438 |
<div class="wp-review-field-label">
|
439 |
<label for="wp_review_bgcolor2"><?php esc_html_e( 'Background Color', 'wp-review' ); ?></label>
|
440 |
</div>
|
444 |
</div>
|
445 |
</div>
|
446 |
|
447 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bordercolor'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
448 |
<div class="wp-review-field-label">
|
449 |
<label for="wp_review_bordercolor"><?php esc_html_e( 'Border Color', 'wp-review' ); ?></label>
|
450 |
</div>
|
454 |
</div>
|
455 |
</div>
|
456 |
|
457 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['fontfamily'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
458 |
<div class="wp-review-field-label">
|
459 |
<label><?php esc_html_e( 'Google Font', 'wp-review' ); ?></label>
|
460 |
<?php wp_review_print_pro_text(); ?>
|
462 |
|
463 |
<div class="wp-review-field-option">
|
464 |
<?php
|
465 |
+
$form_field->render_switch(
|
466 |
+
array(
|
467 |
+
'id' => 'wp_review_fontfamily',
|
468 |
+
'name' => 'wp_review_fontfamily',
|
469 |
+
'disabled' => true,
|
470 |
+
)
|
471 |
+
);
|
472 |
?>
|
473 |
</div>
|
474 |
</div>
|
481 |
|
482 |
<div class="wp-review-field-option">
|
483 |
<?php
|
484 |
+
$form_field->render_switch(
|
485 |
+
array(
|
486 |
+
'id' => 'wp_review_custom_width',
|
487 |
+
'name' => 'wp_review_custom_width',
|
488 |
+
'disabled' => true,
|
489 |
+
)
|
490 |
+
);
|
491 |
?>
|
492 |
</div>
|
493 |
</div>
|
506 |
wp_nonce_field( basename( __FILE__ ), 'wp-review-desc-nonce' );
|
507 |
|
508 |
/* Retrieve existing values from the database. */
|
509 |
+
$desc = get_post_meta( $post->ID, 'wp_review_desc', true );
|
510 |
$desc_title = get_post_meta( $post->ID, 'wp_review_desc_title', true );
|
511 |
if ( ! $desc_title ) {
|
512 |
$desc_title = __( 'Summary', 'wp-review' );
|
513 |
}
|
514 |
$form_field = new WP_Review_Form_Field();
|
515 |
+
$hidden = wp_review_is_hidden_desc( $post->ID ) ? 'hidden' : '';
|
516 |
?>
|
517 |
<div id="wp_review_desc_settings" class="<?php echo esc_attr( $hidden ); ?>">
|
518 |
<div class="wp-review-field">
|
537 |
$desc,
|
538 |
'wp_review_desc',
|
539 |
array(
|
540 |
+
'tinymce' => array(
|
541 |
'toolbar1' => 'bold,italic,underline,bullist,numlist,separator,separator,link,unlink,undo,redo,removeformat',
|
542 |
'toolbar2' => '',
|
543 |
'toolbar3' => '',
|
616 |
|
617 |
<div class="wp-review-field-option">
|
618 |
<?php
|
619 |
+
$form_field->render_switch(
|
620 |
+
array(
|
621 |
+
'id' => 'wp_review_hide_desc',
|
622 |
+
'name' => 'wp_review_hide_desc',
|
623 |
+
'disabled' => true,
|
624 |
+
)
|
625 |
+
);
|
626 |
?>
|
627 |
</div>
|
628 |
</div>
|
632 |
/**
|
633 |
* Maps default link texts and urls.
|
634 |
*
|
635 |
+
* @since 5.0.3 Move this function out of `wp_review_render_meta_box_review_links()`
|
636 |
*
|
637 |
* @param string $text Link text.
|
638 |
* @param string $url Link url.
|
641 |
function wp_review_get_default_links( $text, $url ) {
|
642 |
return array(
|
643 |
'text' => $text,
|
644 |
+
'url' => $url,
|
645 |
);
|
646 |
}
|
647 |
|
648 |
+
/**
|
649 |
+
* Renders review links meta box.
|
650 |
+
*
|
651 |
+
* @param WP_Post $post Post object.
|
652 |
+
*/
|
653 |
+
function wp_review_render_meta_box_review_links( $post ) {
|
654 |
|
655 |
wp_nonce_field( basename( __FILE__ ), 'wp-review-links-options-nonce' );
|
656 |
|
657 |
wp_review_switch_to_main();
|
658 |
$options = get_option( 'wp_review_options' );
|
659 |
+
if ( is_multisite() ) {
|
660 |
+
restore_current_blog();
|
661 |
+
}
|
662 |
+
|
663 |
$defaults = array_map(
|
664 |
'wp_review_get_default_links',
|
665 |
empty( $options['default_link_text'] ) ? array() : $options['default_link_text'],
|
666 |
empty( $options['default_link_url'] ) ? array() : $options['default_link_url']
|
667 |
);
|
668 |
+
|
669 |
$items = get_post_meta( $post->ID, 'wp_review_links', true );
|
670 |
if ( ! is_array( $items ) ) {
|
671 |
$items = $defaults;
|
674 |
<table id="wp-review-links" class="wp-review-links" width="100%">
|
675 |
|
676 |
<thead>
|
677 |
+
<tr>
|
678 |
+
<th width="5%"></th>
|
679 |
+
<th width="45%"><?php esc_html_e( 'Text', 'wp-review' ); ?></th>
|
680 |
+
<th width="40%"><?php esc_html_e( 'URL', 'wp-review' ); ?></th>
|
681 |
+
<th width="10%"></th>
|
682 |
+
</tr>
|
683 |
</thead>
|
684 |
|
685 |
<tbody>
|
727 |
|
728 |
</table>
|
729 |
|
730 |
+
<a class="add-row button" data-target="#wp-review-links" href="#"><?php esc_html_e( 'Add another', 'wp-review' ); ?></a>
|
731 |
+
<?php
|
732 |
}
|
733 |
|
734 |
+
/**
|
735 |
+
* Renders user review meta box.
|
736 |
+
*
|
737 |
+
* @param WP_Post $post Post object.
|
738 |
+
*/
|
739 |
+
function wp_review_render_meta_box_user_review( $post ) {
|
740 |
/* Add an nonce field so we can check for it later. */
|
741 |
wp_nonce_field( basename( __FILE__ ), 'wp-review-userReview-nonce' );
|
742 |
$enabled = wp_review_get_user_rating_setup( $post->ID );
|
745 |
if ( ! $type ) {
|
746 |
$type = wp_review_option( 'review_type', 'none' );
|
747 |
}
|
748 |
+
|
749 |
+
// $available_types = apply_filters( 'wp_review_metabox_user_rating_types', wp_review_get_review_types( 'user' ) );
|
750 |
$available_types = wp_review_get_rating_types();
|
751 |
+
$product_price = wp_review_get_product_price( $post->ID );
|
752 |
|
753 |
$form_field = new WP_Review_Form_Field();
|
754 |
?>
|
846 |
|
847 |
<div class="wp-review-field-option">
|
848 |
<?php
|
849 |
+
$form_field->render_switch(
|
850 |
+
array(
|
851 |
+
'id' => 'wp_review_hide_visitors_rating',
|
852 |
+
'name' => 'wp_review_hide_visitors_rating',
|
853 |
+
'disabled' => true,
|
854 |
+
)
|
855 |
+
);
|
856 |
?>
|
857 |
</div>
|
858 |
</div>
|
885 |
</div>
|
886 |
</div>
|
887 |
|
888 |
+
<?php
|
889 |
+
if ( current_user_can( 'wp_review_purge_visitor_ratings' ) ) {
|
890 |
+
?>
|
891 |
<p style="margin-top: 50px;">
|
892 |
<button
|
893 |
type="button"
|
899 |
><?php esc_html_e( 'Purge visitor ratings', 'wp-review' ); ?></button>
|
900 |
<span class="description"><?php esc_html_e( 'Click to remove all visitor ratings of this post.', 'wp-review' ); ?></span>
|
901 |
</p>
|
902 |
+
<?php
|
903 |
+
}
|
904 |
}
|
905 |
|
906 |
/**
|
910 |
*
|
911 |
* @param int $post_id Post ID.
|
912 |
* @param WP_Post $post Post object.
|
913 |
+
* @return int
|
914 |
*/
|
915 |
function wp_review_save_postdata( $post_id, $post ) {
|
916 |
|
920 |
}
|
921 |
|
922 |
if ( ! isset( $_POST['wp-review-review-options-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-review-options-nonce'], 'wp-review-meta-box-options' ) ) {
|
923 |
+
return $post_id;
|
924 |
}
|
925 |
|
926 |
+
$hide_desc = false;
|
927 |
+
$hide_links = false;
|
928 |
+
$hide_user_reviews = false;
|
929 |
$hide_review_features = false;
|
930 |
|
931 |
+
if ( is_multisite() ) {
|
932 |
+
$hide_desc = wp_review_network_option( 'hide_review_description_' );
|
933 |
+
$hide_links = wp_review_network_option( 'hide_review_links_' );
|
934 |
+
$hide_user_reviews = wp_review_network_option( 'hide_user_reviews_' );
|
935 |
$hide_review_features = wp_review_network_option( 'hide_features_' );
|
936 |
}
|
937 |
|
938 |
+
if ( ! $hide_desc && ! current_user_can( 'wp_review_description' ) ) {
|
939 |
$hide_desc = true;
|
940 |
}
|
941 |
|
942 |
+
if ( ! $hide_links && ! current_user_can( 'wp_review_links' ) ) {
|
943 |
$hide_links = true;
|
944 |
}
|
945 |
|
946 |
+
if ( ! $hide_user_reviews && ! current_user_can( 'wp_review_user_reviews' ) ) {
|
947 |
$hide_user_reviews = true;
|
948 |
}
|
949 |
|
950 |
+
if ( ! $hide_review_features && ! current_user_can( 'wp_review_features' ) ) {
|
951 |
$hide_review_features = true;
|
952 |
}
|
953 |
|
954 |
if ( ! $hide_review_features && ( ! isset( $_POST['wp-review-item-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-item-nonce'], basename( __FILE__ ) ) ) ) {
|
955 |
+
return $post_id;
|
956 |
}
|
957 |
|
958 |
if ( ! $hide_desc && ( ! isset( $_POST['wp-review-desc-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-desc-nonce'], basename( __FILE__ ) ) ) ) {
|
959 |
+
return $post_id;
|
960 |
}
|
961 |
|
962 |
if ( ! $hide_links && ( ! isset( $_POST['wp-review-links-options-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-links-options-nonce'], basename( __FILE__ ) ) ) ) {
|
963 |
+
return $post_id;
|
964 |
}
|
965 |
|
966 |
if ( ! $hide_user_reviews && ( ! isset( $_POST['wp-review-userReview-nonce'] ) || ! wp_verify_nonce( $_POST['wp-review-userReview-nonce'], basename( __FILE__ ) ) ) ) {
|
967 |
+
return $post_id;
|
968 |
}
|
969 |
|
970 |
/* Check the user's permissions. */
|
971 |
+
if ( isset( $_POST['post_type'] ) && 'page' === $_POST['post_type'] ) {
|
972 |
if ( ! current_user_can( 'edit_page', $post_id ) ) {
|
973 |
return $post_id;
|
974 |
}
|
989 |
}
|
990 |
|
991 |
$meta = array(
|
992 |
+
'wp_review_custom_location' => filter_input( INPUT_POST, 'wp_review_custom_location', FILTER_SANITIZE_STRING ),
|
993 |
+
'wp_review_custom_colors' => filter_input( INPUT_POST, 'wp_review_custom_colors', FILTER_SANITIZE_STRING ),
|
994 |
+
'wp_review_custom_author' => filter_input( INPUT_POST, 'wp_review_custom_author', FILTER_SANITIZE_STRING ),
|
995 |
+
'wp_review_location' => filter_input( INPUT_POST, 'wp_review_location', FILTER_SANITIZE_STRING ),
|
996 |
+
'wp_review_heading' => filter_input( INPUT_POST, 'wp_review_heading', FILTER_SANITIZE_STRING ),
|
997 |
+
'wp_review_desc_title' => filter_input( INPUT_POST, 'wp_review_desc_title', FILTER_SANITIZE_STRING ),
|
998 |
+
'wp_review_desc' => ! empty( $_POST['wp_review_desc'] ) ? wp_kses_post( wp_unslash( $_POST['wp_review_desc'] ) ) : '',
|
999 |
+
'wp_review_hide_desc' => filter_input( INPUT_POST, 'wp_review_hide_desc', FILTER_SANITIZE_STRING ),
|
1000 |
+
'wp_review_userReview' => filter_input( INPUT_POST, 'wp_review_userReview', FILTER_SANITIZE_STRING ),
|
1001 |
+
'wp_review_total' => filter_input( INPUT_POST, 'wp_review_total', FILTER_SANITIZE_STRING ),
|
1002 |
+
'wp_review_color' => filter_input( INPUT_POST, 'wp_review_color', FILTER_SANITIZE_STRING ),
|
1003 |
+
'wp_review_inactive_color' => filter_input( INPUT_POST, 'wp_review_inactive_color', FILTER_SANITIZE_STRING ),
|
1004 |
+
'wp_review_fontcolor' => filter_input( INPUT_POST, 'wp_review_fontcolor', FILTER_SANITIZE_STRING ),
|
1005 |
+
'wp_review_bgcolor1' => filter_input( INPUT_POST, 'wp_review_bgcolor1', FILTER_SANITIZE_STRING ),
|
1006 |
+
'wp_review_bgcolor2' => filter_input( INPUT_POST, 'wp_review_bgcolor2', FILTER_SANITIZE_STRING ),
|
1007 |
+
'wp_review_bordercolor' => filter_input( INPUT_POST, 'wp_review_bordercolor', FILTER_SANITIZE_STRING ),
|
1008 |
+
'wp_review_author' => filter_input( INPUT_POST, 'wp_review_author', FILTER_SANITIZE_STRING ),
|
1009 |
+
'wp_review_schema' => filter_input( INPUT_POST, 'wp_review_schema', FILTER_SANITIZE_STRING ),
|
1010 |
+
'wp_review_rating_schema' => filter_input( INPUT_POST, 'wp_review_rating_schema', FILTER_SANITIZE_STRING ),
|
1011 |
+
'wp_review_show_schema_data' => filter_input( INPUT_POST, 'wp_review_show_schema_data', FILTER_SANITIZE_STRING ),
|
1012 |
+
'wp_review_user_review_type' => filter_input( INPUT_POST, 'wp_review_user_review_type', FILTER_SANITIZE_STRING ),
|
1013 |
+
'wp_review_product_price' => filter_input( INPUT_POST, 'wp_review_product_price', FILTER_SANITIZE_STRING ),
|
1014 |
+
'wp_review_box_template' => filter_input( INPUT_POST, 'wp_review_box_template', FILTER_SANITIZE_STRING ),
|
1015 |
);
|
1016 |
|
1017 |
$default_colors = wp_review_get_global_colors();
|
1033 |
$new_meta_value = '0';
|
1034 |
}
|
1035 |
|
1036 |
+
if ( 'wp_review_box_template' === $meta_key && ! in_array( $new_meta_value, array( 'default', 'aqua' ), true ) ) {
|
1037 |
continue;
|
1038 |
}
|
1039 |
|
1049 |
|
1050 |
wp_review_save_review_items_data( $post_id );
|
1051 |
|
1052 |
+
$old = get_post_meta( $post_id, 'wp_review_item', true );
|
1053 |
$link_text = (array) filter_input( INPUT_POST, 'wp_review_link_title', FILTER_SANITIZE_STRING, FILTER_FORCE_ARRAY );
|
1054 |
+
$link_url = (array) filter_input( INPUT_POST, 'wp_review_link_url', FILTER_SANITIZE_STRING, FILTER_FORCE_ARRAY );
|
1055 |
$new_links = array();
|
1056 |
|
1057 |
if ( ! empty( $link_text ) ) {
|
1088 |
/**
|
1089 |
* Clears transients
|
1090 |
*
|
1091 |
+
* @param int $post_id Post ID.
|
1092 |
+
* @param WP_Post $post Post object.
|
1093 |
*/
|
1094 |
function wp_review_clear_query_cache( $post_id, $post ) {
|
1095 |
global $wpdb;
|
1096 |
$where = $wpdb->prepare( 'WHERE option_name REGEXP %s', '_transient(_timeout)?_wp_review_[0-9a-f]{32}' );
|
1097 |
+
$wpdb->query( "DELETE FROM {$wpdb->prefix}options {$where}" ); // WPCS: unprepared SQL ok.
|
1098 |
}
|
1099 |
|
1100 |
/**
|
1104 |
*/
|
1105 |
function wp_review_save_review_items_data( $post_id ) {
|
1106 |
$old = get_post_meta( $post_id, 'wp_review_item', true );
|
1107 |
+
|
1108 |
+
if ( ! empty( $_POST['wp_review_item_title'] ) ) { // WPCS: csrf ok.
|
1109 |
+
$title = $_POST['wp_review_item_title']; // WPCS: csrf ok.
|
1110 |
+
$star = $_POST['wp_review_item_star']; // WPCS: csrf ok.
|
1111 |
+
$ids = $_POST['wp_review_item_id']; // WPCS: csrf ok.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1112 |
$new = array();
|
1113 |
|
1114 |
$count = count( $title );
|
1118 |
continue; // Prevent item without score.
|
1119 |
}
|
1120 |
|
1121 |
+
$new[ $i ] = array();
|
1122 |
$new[ $i ]['wp_review_item_star'] = floatval( $star[ $i ] );
|
1123 |
|
1124 |
if ( ! empty( $ids[ $i ] ) ) {
|
1130 |
}
|
1131 |
}
|
1132 |
|
1133 |
+
if ( ! empty( $new ) && $new !== $old ) {
|
1134 |
update_post_meta( $post_id, 'wp_review_item', $new );
|
1135 |
} elseif ( empty( $new ) && $old ) {
|
1136 |
delete_post_meta( $post_id, 'wp_review_item', $old );
|
1149 |
* @return array
|
1150 |
*/
|
1151 |
function add_field_debug_preview( $fields ) {
|
1152 |
+
$fields['debug_preview'] = 'debug_preview';
|
1153 |
+
return $fields;
|
1154 |
}
|
1155 |
add_filter( '_wp_post_revision_fields', 'add_field_debug_preview' );
|
1156 |
|
1157 |
|
1158 |
+
/**
|
1159 |
+
* Adds input debug preview.
|
1160 |
+
*/
|
1161 |
function add_input_debug_preview() {
|
1162 |
+
echo '<input type="hidden" name="debug_preview" value="debug_preview">';
|
1163 |
}
|
1164 |
add_action( 'edit_form_after_title', 'add_input_debug_preview' );
|
1165 |
|
1166 |
|
1167 |
+
/**
|
1168 |
+
* Shows schema field.
|
1169 |
+
*
|
1170 |
+
* @param array $args Args.
|
1171 |
+
* @param array $value Schema value.
|
1172 |
+
* @param string $schema_type Schema type.
|
1173 |
+
*/
|
1174 |
function wp_review_schema_field( $args, $value, $schema_type ) {
|
1175 |
$type = isset( $args['type'] ) ? $args['type'] : '';
|
1176 |
$name = isset( $args['name'] ) ? $args['name'] : '';
|
1177 |
$label = isset( $args['label'] ) ? $args['label'] : '';
|
1178 |
$options = isset( $args['options'] ) ? $args['options'] : array();
|
1179 |
$default = isset( $args['default'] ) ? $args['default'] : '';
|
1180 |
+
$min = isset( $args['min'] ) ? $args['min'] : '0';
|
1181 |
+
$max = isset( $args['max'] ) ? $args['max'] : '';
|
1182 |
+
$info = isset( $args['info'] ) ? $args['info'] : '';
|
1183 |
|
1184 |
// Option value.
|
1185 |
+
$opt_val = isset( $value[ $name ] ) ? $value[ $name ] : $default;
|
1186 |
+
$opt_id_attr = 'wp_review_schema_options_' . $schema_type . '_' . $name;
|
1187 |
$opt_name_attr = 'wp_review_schema_options[' . $schema_type . '][' . $name . ']';
|
1188 |
|
1189 |
$form_field = new WP_Review_Form_Field();
|
1239 |
}
|
1240 |
?>
|
1241 |
</span>
|
1242 |
+
<input type="hidden" id="<?php echo esc_attr( $opt_id_attr ); ?>-id" name="<?php echo esc_attr( $opt_name_attr ); ?>[id]" value="<?php if ( isset( $opt_val['id'] ) ) echo $opt_val['id']; // phpcs:ignore ?>" />
|
1243 |
+
<input type="hidden" id="<?php echo esc_attr( $opt_id_attr ); ?>-url" name="<?php echo esc_attr( $opt_name_attr ); ?>[url]" value="<?php if ( isset( $opt_val['url'] ) ) echo $opt_val['url']; // phpcs:ignore ?>" />
|
1244 |
<button class="button" name="<?php echo esc_attr( $opt_id_attr ); ?>-upload" id="<?php echo esc_attr( $opt_id_attr ); ?>-upload" data-id="<?php echo esc_attr( $opt_id_attr ); ?>" onclick="wprImageField.uploader( '<?php echo esc_attr( $opt_id_attr ); ?>' ); return false;"><?php esc_html_e( 'Select Image', 'wp-review' ); ?></button>
|
1245 |
<?php
|
1246 |
if ( ! empty( $opt_val['url'] ) ) {
|
admin/options/hello-bar.php
CHANGED
@@ -23,11 +23,13 @@
|
|
23 |
|
24 |
<div class="wp-review-field-option">
|
25 |
<?php
|
26 |
-
$form_field->render_switch(
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
31 |
?>
|
32 |
</div>
|
33 |
</div>
|
@@ -101,11 +103,13 @@
|
|
101 |
</div>
|
102 |
<div class="wp-review-field-option">
|
103 |
<?php
|
104 |
-
$form_field->render_switch(
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
109 |
?>
|
110 |
</div>
|
111 |
</div>
|
23 |
|
24 |
<div class="wp-review-field-option">
|
25 |
<?php
|
26 |
+
$form_field->render_switch(
|
27 |
+
array(
|
28 |
+
'id' => 'wp_review_hello_bar_enable',
|
29 |
+
'name' => 'wp_review_hello_bar[enable]',
|
30 |
+
'disabled' => true,
|
31 |
+
)
|
32 |
+
);
|
33 |
?>
|
34 |
</div>
|
35 |
</div>
|
103 |
</div>
|
104 |
<div class="wp-review-field-option">
|
105 |
<?php
|
106 |
+
$form_field->render_switch(
|
107 |
+
array(
|
108 |
+
'id' => 'wp_review_hello_bar_target_blank',
|
109 |
+
'name' => 'wp_review_hello_bar[target_blank]',
|
110 |
+
'disabled' => true,
|
111 |
+
)
|
112 |
+
);
|
113 |
?>
|
114 |
</div>
|
115 |
</div>
|
admin/options/multisite.php
CHANGED
@@ -9,305 +9,336 @@
|
|
9 |
<?php $sites = get_sites(); ?>
|
10 |
<div class="wp-review-field wp-review-select-site">
|
11 |
<div class="wp-review-field-label">
|
12 |
-
<label for="
|
13 |
</div>
|
14 |
|
15 |
<div class="wp-review-field-option">
|
16 |
<select id="wp-review-select-site">
|
17 |
-
<option value=""><?php
|
18 |
-
<?php
|
|
|
19 |
foreach ( $sites as $site ) {
|
20 |
-
if (
|
21 |
-
|
22 |
-
?>
|
23 |
-
<option value="<?php echo $site->blog_id; ?>"><?php echo $blog_details->blogname; ?></option>
|
24 |
-
<?php
|
25 |
}
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
-
}
|
|
|
28 |
</select>
|
29 |
</div>
|
30 |
</div>
|
31 |
|
32 |
<?php
|
33 |
-
// $options = get_option('wp_review_options', true);
|
34 |
-
|
35 |
foreach ( $sites as $site ) {
|
36 |
if ( ! is_main_site( $site->blog_id ) ) {
|
37 |
-
$hide_options
|
38 |
$hide_role_manager = wp_review_option( 'hide_role_manager_' . $site->blog_id );
|
39 |
-
$hide_import
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
<div class="wp-review-field-label">
|
45 |
-
<label><?php esc_html_e( 'Hide global options panel', 'wp-review' ); ?></label>
|
46 |
-
</div>
|
47 |
-
|
48 |
-
<div class="wp-review-field-option">
|
49 |
-
<?php
|
50 |
-
$form_field->render_switch( array(
|
51 |
-
'id' => 'wp_review_show_global_options_' . $site->blog_id,
|
52 |
-
'name' => 'wp_review_options[hide_global_options_' . $site->blog_id . ']',
|
53 |
-
'value' => ! empty( $hide_options ),
|
54 |
-
) );
|
55 |
-
?>
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
<?php $hide = $hide_options ? 'style="display: none;"' : ''; ?>
|
59 |
-
<div class="wp-review-multisite-global-options" <?php echo $hide; ?>>
|
60 |
-
|
61 |
-
<div class="wp-review-field">
|
62 |
<div class="wp-review-field-label">
|
63 |
-
<label><?php esc_html_e( 'Hide
|
64 |
-
<?php wp_review_print_pro_text(); ?>
|
65 |
</div>
|
66 |
|
67 |
<div class="wp-review-field-option">
|
68 |
<?php
|
69 |
-
$form_field->render_switch(
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
74 |
?>
|
75 |
</div>
|
76 |
</div>
|
|
|
|
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
92 |
</div>
|
93 |
-
</div>
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
|
|
|
|
|
|
109 |
</div>
|
110 |
-
</div>
|
111 |
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
|
|
|
|
126 |
</div>
|
127 |
-
</div>
|
128 |
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
143 |
</div>
|
144 |
-
</div>
|
145 |
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
159 |
</div>
|
160 |
-
</div>
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
175 |
</div>
|
176 |
-
</div>
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
$hide_in_posts = wp_review_option( 'hide_ratings_in_posts_' . $site->blog_id );
|
183 |
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
|
|
|
|
|
|
|
|
191 |
</div>
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
</div>
|
202 |
</div>
|
203 |
-
</div>
|
204 |
|
205 |
-
|
206 |
-
|
207 |
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
222 |
</div>
|
223 |
-
</div>
|
224 |
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
|
|
|
|
|
|
239 |
</div>
|
240 |
-
</div>
|
241 |
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
|
|
|
|
|
|
256 |
</div>
|
257 |
-
</div>
|
258 |
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
|
|
|
|
|
|
272 |
</div>
|
273 |
-
</div>
|
274 |
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
|
|
|
|
|
|
289 |
</div>
|
290 |
-
</div>
|
291 |
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
|
|
|
|
|
|
305 |
</div>
|
|
|
306 |
</div>
|
307 |
|
308 |
</div>
|
309 |
-
|
310 |
-
</div>
|
311 |
-
<?php
|
312 |
}
|
313 |
} ?>
|
9 |
<?php $sites = get_sites(); ?>
|
10 |
<div class="wp-review-field wp-review-select-site">
|
11 |
<div class="wp-review-field-label">
|
12 |
+
<label for="wp-review-select-site"><strong><?php esc_html_e( 'Site: ', 'wp-review' ); ?></strong></label>
|
13 |
</div>
|
14 |
|
15 |
<div class="wp-review-field-option">
|
16 |
<select id="wp-review-select-site">
|
17 |
+
<option value=""><?php esc_html_e( 'Select site', 'wp-review' ); ?></option>
|
18 |
+
<?php
|
19 |
+
if ( ! empty( $sites ) ) {
|
20 |
foreach ( $sites as $site ) {
|
21 |
+
if ( is_main_site( $site->blog_id ) ) {
|
22 |
+
continue;
|
|
|
|
|
|
|
23 |
}
|
24 |
+
$blog_details = get_blog_details( $site->blog_id );
|
25 |
+
?>
|
26 |
+
<option value="<?php echo intval( $site->blog_id ); ?>"><?php echo esc_html( $blog_details->blogname ); ?></option>
|
27 |
+
<?php
|
28 |
}
|
29 |
+
}
|
30 |
+
?>
|
31 |
</select>
|
32 |
</div>
|
33 |
</div>
|
34 |
|
35 |
<?php
|
|
|
|
|
36 |
foreach ( $sites as $site ) {
|
37 |
if ( ! is_main_site( $site->blog_id ) ) {
|
38 |
+
$hide_options = wp_review_option( 'hide_global_options_' . $site->blog_id );
|
39 |
$hide_role_manager = wp_review_option( 'hide_role_manager_' . $site->blog_id );
|
40 |
+
$hide_import = wp_review_option( 'hide_import_' . $site->blog_id );
|
41 |
+
?>
|
42 |
+
<div class="wp-review-subsite-wrapper" id="wp-review-site-<?php echo intval( $site->blog_id ); ?>-fields">
|
43 |
+
<h3><?php esc_html_e( 'General Settings', 'wp-review' ); ?></h3>
|
44 |
+
<div class="wp-review-field wp-review-multisite-general-settings">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
<div class="wp-review-field-label">
|
46 |
+
<label><?php esc_html_e( 'Hide global options panel', 'wp-review' ); ?></label>
|
|
|
47 |
</div>
|
48 |
|
49 |
<div class="wp-review-field-option">
|
50 |
<?php
|
51 |
+
$form_field->render_switch(
|
52 |
+
array(
|
53 |
+
'id' => 'wp_review_show_global_options_' . $site->blog_id,
|
54 |
+
'name' => 'wp_review_options[hide_global_options_' . $site->blog_id . ']',
|
55 |
+
'value' => ! empty( $hide_options ),
|
56 |
+
)
|
57 |
+
);
|
58 |
?>
|
59 |
</div>
|
60 |
</div>
|
61 |
+
<?php $hide = $hide_options ? 'style="display: none;"' : ''; ?>
|
62 |
+
<div class="wp-review-multisite-global-options" <?php echo $hide; // WPCS: xss ok. ?>>
|
63 |
|
64 |
+
<div class="wp-review-field">
|
65 |
+
<div class="wp-review-field-label">
|
66 |
+
<label><?php esc_html_e( 'Hide Popup', 'wp-review' ); ?></label>
|
67 |
+
<?php wp_review_print_pro_text(); ?>
|
68 |
+
</div>
|
69 |
|
70 |
+
<div class="wp-review-field-option">
|
71 |
+
<?php
|
72 |
+
$form_field->render_switch(
|
73 |
+
array(
|
74 |
+
'id' => 'wp_review_hide_general_popup_' . $site->blog_id,
|
75 |
+
'name' => 'wp_review_options[hide_general_popup_' . $site->blog_id . ']',
|
76 |
+
'disabled' => true,
|
77 |
+
)
|
78 |
+
);
|
79 |
+
?>
|
80 |
+
</div>
|
81 |
</div>
|
|
|
82 |
|
83 |
+
<div class="wp-review-field">
|
84 |
+
<div class="wp-review-field-label">
|
85 |
+
<label><?php esc_html_e( 'Hide Notification Bar', 'wp-review' ); ?></label>
|
86 |
+
<?php wp_review_print_pro_text(); ?>
|
87 |
+
</div>
|
88 |
|
89 |
+
<div class="wp-review-field-option">
|
90 |
+
<?php
|
91 |
+
$form_field->render_switch(
|
92 |
+
array(
|
93 |
+
'id' => 'wp_review_hide_general_bar_' . $site->blog_id,
|
94 |
+
'name' => 'wp_review_options[hide_general_bar_' . $site->blog_id . ']',
|
95 |
+
'disabled' => true,
|
96 |
+
)
|
97 |
+
);
|
98 |
+
?>
|
99 |
+
</div>
|
100 |
</div>
|
|
|
101 |
|
102 |
+
<div class="wp-review-field">
|
103 |
+
<div class="wp-review-field-label">
|
104 |
+
<label><?php esc_html_e( 'Hide Yelp Reviews', 'wp-review' ); ?></label>
|
105 |
+
<?php wp_review_print_pro_text(); ?>
|
106 |
+
</div>
|
107 |
|
108 |
+
<div class="wp-review-field-option">
|
109 |
+
<?php
|
110 |
+
$form_field->render_switch(
|
111 |
+
array(
|
112 |
+
'id' => 'wp_review_hide_yelp_reviews_' . $site->blog_id,
|
113 |
+
'name' => 'wp_review_options[hide_yelp_reviews_' . $site->blog_id . ']',
|
114 |
+
'disabled' => true,
|
115 |
+
)
|
116 |
+
);
|
117 |
+
?>
|
118 |
+
</div>
|
119 |
</div>
|
|
|
120 |
|
121 |
+
<div class="wp-review-field">
|
122 |
+
<div class="wp-review-field-label">
|
123 |
+
<label><?php esc_html_e( 'Hide Facebook Reviews', 'wp-review' ); ?></label>
|
124 |
+
<?php wp_review_print_pro_text(); ?>
|
125 |
+
</div>
|
126 |
|
127 |
+
<div class="wp-review-field-option">
|
128 |
+
<?php
|
129 |
+
$form_field->render_switch(
|
130 |
+
array(
|
131 |
+
'id' => 'wp_review_hide_facebook_reviews_' . $site->blog_id,
|
132 |
+
'name' => 'wp_review_options[hide_facebook_reviews_' . $site->blog_id . ']',
|
133 |
+
'disabled' => true,
|
134 |
+
)
|
135 |
+
);
|
136 |
+
?>
|
137 |
+
</div>
|
138 |
</div>
|
|
|
139 |
|
140 |
+
<div class="wp-review-field">
|
141 |
+
<div class="wp-review-field-label">
|
142 |
+
<label><?php esc_html_e( 'Hide Google Reviews', 'wp-review' ); ?></label>
|
143 |
+
<?php wp_review_print_pro_text(); ?>
|
144 |
+
</div>
|
145 |
|
146 |
+
<div class="wp-review-field-option">
|
147 |
+
<?php
|
148 |
+
$form_field->render_switch(
|
149 |
+
array(
|
150 |
+
'id' => 'wp_review_hide_google_reviews_' . $site->blog_id,
|
151 |
+
'name' => 'wp_review_options[hide_google_reviews_' . $site->blog_id . ']',
|
152 |
+
'disabled' => true,
|
153 |
+
)
|
154 |
+
);
|
155 |
+
?>
|
156 |
+
</div>
|
157 |
</div>
|
|
|
158 |
|
159 |
+
<div class="wp-review-field">
|
160 |
+
<div class="wp-review-field-label">
|
161 |
+
<label><?php esc_html_e( 'Hide Role Manager', 'wp-review' ); ?></label>
|
162 |
+
</div>
|
163 |
|
164 |
+
<div class="wp-review-field-option">
|
165 |
+
<?php
|
166 |
+
$form_field->render_switch(
|
167 |
+
array(
|
168 |
+
'id' => 'wp_review_hide_role_manager_' . $site->blog_id,
|
169 |
+
'name' => 'wp_review_options[hide_role_manager_' . $site->blog_id . ']',
|
170 |
+
'value' => ! empty( $hide_role_manager ),
|
171 |
+
)
|
172 |
+
);
|
173 |
+
?>
|
174 |
+
</div>
|
175 |
</div>
|
|
|
176 |
|
177 |
+
<div class="wp-review-field">
|
178 |
+
<div class="wp-review-field-label">
|
179 |
+
<label><?php esc_html_e( 'Hide Import', 'wp-review' ); ?></label>
|
180 |
+
</div>
|
|
|
181 |
|
182 |
+
<div class="wp-review-field-option">
|
183 |
+
<?php
|
184 |
+
$form_field->render_switch(
|
185 |
+
array(
|
186 |
+
'id' => 'wp_review_hide_import_' . $site->blog_id,
|
187 |
+
'name' => 'wp_review_options[hide_import_' . $site->blog_id . ']',
|
188 |
+
'value' => ! empty( $hide_import ),
|
189 |
+
)
|
190 |
+
);
|
191 |
+
?>
|
192 |
+
</div>
|
193 |
</div>
|
194 |
|
195 |
+
</div>
|
196 |
+
<br />
|
197 |
+
<h3><?php esc_html_e( 'Post Settings', 'wp-review' ); ?></h3>
|
198 |
+
<?php
|
199 |
+
$hide_in_posts = wp_review_option( 'hide_ratings_in_posts_' . $site->blog_id );
|
200 |
+
|
201 |
+
$hide_review_links = wp_review_option( 'hide_review_links_' . $site->blog_id );
|
202 |
+
$hide_user_reviews = wp_review_option( 'hide_user_reviews_' . $site->blog_id );
|
203 |
+
?>
|
204 |
+
<div class="wp-review-multisite-posts-options">
|
205 |
+
<div class="wp-review-field">
|
206 |
+
<div class="wp-review-field-label">
|
207 |
+
<label><?php esc_html_e( 'Hide reviews in single editor', 'wp-review' ); ?></label>
|
208 |
+
</div>
|
209 |
+
|
210 |
+
<div class="wp-review-field-option">
|
211 |
+
<?php
|
212 |
+
$form_field->render_switch(
|
213 |
+
array(
|
214 |
+
'id' => 'wp_review_hide_ratings_in_posts_' . $site->blog_id,
|
215 |
+
'name' => 'wp_review_options[hide_ratings_in_posts_' . $site->blog_id . ']',
|
216 |
+
'value' => ! empty( $hide_in_posts ),
|
217 |
+
)
|
218 |
+
);
|
219 |
+
?>
|
220 |
+
</div>
|
221 |
</div>
|
222 |
</div>
|
|
|
223 |
|
224 |
+
<?php $hide = $hide_in_posts ? 'style="display: none;"' : ''; ?>
|
225 |
+
<div id="wp-review-multisite-posts-options" <?php echo $hide; // WPCS: xss ok. ?>>
|
226 |
|
227 |
+
<div class="wp-review-field">
|
228 |
+
<div class="wp-review-field-label">
|
229 |
+
<label><?php esc_html_e( 'Hide Popup Box', 'wp-review' ); ?></label>
|
230 |
+
<?php wp_review_print_pro_text(); ?>
|
231 |
+
</div>
|
232 |
|
233 |
+
<div class="wp-review-field-option">
|
234 |
+
<?php
|
235 |
+
$form_field->render_switch(
|
236 |
+
array(
|
237 |
+
'id' => 'wp_review_hide_popup_box__' . $site->blog_id,
|
238 |
+
'name' => 'wp_review_options[hide_popup_box_' . $site->blog_id . ']',
|
239 |
+
'disabled' => true,
|
240 |
+
)
|
241 |
+
);
|
242 |
+
?>
|
243 |
+
</div>
|
244 |
</div>
|
|
|
245 |
|
246 |
+
<div class="wp-review-field">
|
247 |
+
<div class="wp-review-field-label">
|
248 |
+
<label><?php esc_html_e( 'Hide Notification Bar', 'wp-review' ); ?></label>
|
249 |
+
<?php wp_review_print_pro_text(); ?>
|
250 |
+
</div>
|
251 |
|
252 |
+
<div class="wp-review-field-option">
|
253 |
+
<?php
|
254 |
+
$form_field->render_switch(
|
255 |
+
array(
|
256 |
+
'id' => 'wp_review_hide_notification_bar__' . $site->blog_id,
|
257 |
+
'name' => 'wp_review_options[hide_notification_bar_' . $site->blog_id . ']',
|
258 |
+
'disabled' => true,
|
259 |
+
)
|
260 |
+
);
|
261 |
+
?>
|
262 |
+
</div>
|
263 |
</div>
|
|
|
264 |
|
265 |
+
<div class="wp-review-field">
|
266 |
+
<div class="wp-review-field-label">
|
267 |
+
<label><?php esc_html_e( 'Hide Features', 'wp-review' ); ?></label>
|
268 |
+
<?php wp_review_print_pro_text(); ?>
|
269 |
+
</div>
|
270 |
|
271 |
+
<div class="wp-review-field-option">
|
272 |
+
<?php
|
273 |
+
$form_field->render_switch(
|
274 |
+
array(
|
275 |
+
'id' => 'wp_review_hide_features__' . $site->blog_id,
|
276 |
+
'name' => 'wp_review_options[hide_features_' . $site->blog_id . ']',
|
277 |
+
'disabled' => true,
|
278 |
+
)
|
279 |
+
);
|
280 |
+
?>
|
281 |
+
</div>
|
282 |
</div>
|
|
|
283 |
|
284 |
+
<div class="wp-review-field">
|
285 |
+
<div class="wp-review-field-label">
|
286 |
+
<label><?php esc_html_e( 'Hide Review Links', 'wp-review' ); ?></label>
|
287 |
+
</div>
|
288 |
|
289 |
+
<div class="wp-review-field-option">
|
290 |
+
<?php
|
291 |
+
$form_field->render_switch(
|
292 |
+
array(
|
293 |
+
'id' => 'wp_review_hide_review_links__' . $site->blog_id,
|
294 |
+
'name' => 'wp_review_options[hide_review_links_' . $site->blog_id . ']',
|
295 |
+
'value' => ! empty( $hide_review_links ),
|
296 |
+
)
|
297 |
+
);
|
298 |
+
?>
|
299 |
+
</div>
|
300 |
</div>
|
|
|
301 |
|
302 |
+
<div class="wp-review-field">
|
303 |
+
<div class="wp-review-field-label">
|
304 |
+
<label><?php esc_html_e( 'Hide Review Description, Pros/Cons & Total Rating', 'wp-review' ); ?></label>
|
305 |
+
<?php wp_review_print_pro_text(); ?>
|
306 |
+
</div>
|
307 |
|
308 |
+
<div class="wp-review-field-option">
|
309 |
+
<?php
|
310 |
+
$form_field->render_switch(
|
311 |
+
array(
|
312 |
+
'id' => 'wp_review_hide_review_description__' . $site->blog_id,
|
313 |
+
'name' => 'wp_review_options[hide_review_description_' . $site->blog_id . ']',
|
314 |
+
'disabled' => true,
|
315 |
+
)
|
316 |
+
);
|
317 |
+
?>
|
318 |
+
</div>
|
319 |
</div>
|
|
|
320 |
|
321 |
+
<div class="wp-review-field">
|
322 |
+
<div class="wp-review-field-label">
|
323 |
+
<label><?php esc_html_e( 'Hide User Reviews', 'wp-review' ); ?></label>
|
324 |
+
</div>
|
325 |
|
326 |
+
<div class="wp-review-field-option">
|
327 |
+
<?php
|
328 |
+
$form_field->render_switch(
|
329 |
+
array(
|
330 |
+
'id' => 'wp_review_hide_user_reviews__' . $site->blog_id,
|
331 |
+
'name' => 'wp_review_options[hide_user_reviews_' . $site->blog_id . ']',
|
332 |
+
'value' => ! empty( $hide_user_reviews ),
|
333 |
+
)
|
334 |
+
);
|
335 |
+
?>
|
336 |
+
</div>
|
337 |
</div>
|
338 |
+
|
339 |
</div>
|
340 |
|
341 |
</div>
|
342 |
+
<?php
|
|
|
|
|
343 |
}
|
344 |
} ?>
|
admin/options/popup.php
CHANGED
@@ -14,11 +14,13 @@
|
|
14 |
|
15 |
<div class="wp-review-field-option">
|
16 |
<?php
|
17 |
-
$form_field->render_switch(
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
22 |
?>
|
23 |
</div>
|
24 |
</div>
|
@@ -148,13 +150,15 @@
|
|
148 |
<div class="wp-review-field-option">
|
149 |
<span class="wp-review-disabled inline-block has-bg">
|
150 |
<?php
|
151 |
-
wp_dropdown_categories(
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
158 |
?>
|
159 |
</span>
|
160 |
</div>
|
14 |
|
15 |
<div class="wp-review-field-option">
|
16 |
<?php
|
17 |
+
$form_field->render_switch(
|
18 |
+
array(
|
19 |
+
'id' => 'wp_review_popup_enable',
|
20 |
+
'name' => 'wp_review_popup[enable]',
|
21 |
+
'disabled' => true,
|
22 |
+
)
|
23 |
+
);
|
24 |
?>
|
25 |
</div>
|
26 |
</div>
|
150 |
<div class="wp-review-field-option">
|
151 |
<span class="wp-review-disabled inline-block has-bg">
|
152 |
<?php
|
153 |
+
wp_dropdown_categories(
|
154 |
+
array(
|
155 |
+
'show_option_all' => esc_html__( 'All categories', 'wp-review' ),
|
156 |
+
'orderby' => 'name',
|
157 |
+
'hide_empty' => false,
|
158 |
+
'name' => 'wp_review_popup[category]',
|
159 |
+
'id' => 'wp_review_popup_category',
|
160 |
+
)
|
161 |
+
);
|
162 |
?>
|
163 |
</span>
|
164 |
</div>
|
admin/options/review.php
CHANGED
@@ -8,18 +8,18 @@
|
|
8 |
$options = get_option( 'wp_review_options' );
|
9 |
|
10 |
$default_options = array(
|
11 |
-
'colors'
|
12 |
-
'color'
|
13 |
'inactive_color' => '',
|
14 |
-
'fontcolor'
|
15 |
-
'bgcolor1'
|
16 |
-
'bgcolor2'
|
17 |
-
'bordercolor'
|
18 |
),
|
19 |
-
'default_features'
|
20 |
-
'default_link_texts'
|
21 |
-
'default_link_urls'
|
22 |
-
'default_schema_type'
|
23 |
'default_user_review_type' => WP_REVIEW_REVIEW_DISABLED,
|
24 |
'image_sizes' => array(),
|
25 |
);
|
@@ -33,12 +33,12 @@ if ( empty( $options['image_sizes'] ) ) {
|
|
33 |
$options['image_sizes'] = array();
|
34 |
}
|
35 |
|
36 |
-
$opt_name
|
37 |
-
$options_updated
|
38 |
$suggest_theme_defaults = true;
|
39 |
-
if ( ! empty( $_GET['wp-review-theme-defaults'] ) && empty( $_GET['settings-updated'] ) ) {
|
40 |
wp_review_theme_defaults( $options_updated, true );
|
41 |
-
$options
|
42 |
$suggest_theme_defaults = false;
|
43 |
}
|
44 |
|
@@ -48,34 +48,34 @@ if ( empty( $options_updated ) ) {
|
|
48 |
}
|
49 |
|
50 |
$opts_tmp = array_merge( $options, $options_updated );
|
51 |
-
if ( $opts_tmp
|
52 |
$suggest_theme_defaults = false;
|
53 |
}
|
54 |
|
55 |
// Migrate.
|
56 |
global $wpdb;
|
57 |
$current_blog_id = get_current_blog_id();
|
58 |
-
$total_rows
|
59 |
-
$rows_left
|
60 |
-
$migrated_rows
|
61 |
-
$has_migrated
|
62 |
-
if ( ! $has_migrated && $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->base_prefix}mts_wp_reviews'" )
|
63 |
// Table exists and not migrated (fully) yet.
|
64 |
-
$total_rows = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}mts_wp_reviews WHERE blog_id = {$current_blog_id}" );
|
65 |
-
$rows_left
|
66 |
}
|
67 |
|
68 |
$comment_form_integration = ( ! empty( $options['comment_form_integration'] ) ? $options['comment_form_integration'] : 'replace' );
|
69 |
-
if ( 'replace'
|
70 |
$comment_form_integration = 'extend';
|
71 |
}
|
72 |
|
73 |
$comments_template = ( ! empty( $options['comments_template'] ) ? $options['comments_template'] : 'theme' );
|
74 |
-
if ( 'theme'
|
75 |
$comments_template = 'plugin';
|
76 |
}
|
77 |
|
78 |
-
$default_colors
|
79 |
$default_location = wp_review_get_default_location();
|
80 |
$default_criteria = wp_review_get_default_criteria();
|
81 |
|
@@ -86,7 +86,7 @@ foreach ( $default_criteria as $item ) {
|
|
86 |
'wp_review_item_star' => '',
|
87 |
);
|
88 |
}
|
89 |
-
$default_schema
|
90 |
$default_user_review_type = empty( $options['default_user_review_type'] ) ? WP_REVIEW_REVIEW_DISABLED : $options['default_user_review_type'];
|
91 |
|
92 |
$options['colors'] = apply_filters( 'wp_review_colors', $options['colors'], 0 );
|
@@ -94,48 +94,51 @@ if ( ! isset( $options['default'] ) ) {
|
|
94 |
$options['default'] = array();
|
95 |
}
|
96 |
/* Retrieve an existing value from the database. */
|
97 |
-
$items
|
98 |
-
$link_texts
|
99 |
-
$link_urls
|
100 |
-
$location
|
101 |
-
$color
|
102 |
-
$inactive_color
|
103 |
-
$fontcolor
|
104 |
-
$bgcolor1
|
105 |
-
$bgcolor2
|
106 |
-
$bordercolor
|
107 |
|
108 |
$force_user_ratings = wp_review_option( 'force_user_ratings' );
|
109 |
|
110 |
-
$rating_icon
|
111 |
$rating_image = wp_review_option( 'rating_image' );
|
112 |
|
113 |
$review_templates = wp_review_get_box_templates();
|
114 |
-
$box_template
|
115 |
$box_template_img = ! empty( $review_templates[ $box_template ] ) ? $review_templates[ $box_template ]['image'] : WP_REVIEW_ASSETS . 'images/largethumb.png';
|
116 |
|
117 |
$review_types = wp_review_get_rating_types();
|
118 |
-
$review_type
|
119 |
|
120 |
-
if ( ''
|
121 |
$items = $default_items;
|
122 |
}
|
123 |
-
if ( ''
|
124 |
$color = $default_colors['color'];
|
125 |
}
|
126 |
-
if ( ''
|
|
|
|
|
|
|
127 |
$location = $default_location;
|
128 |
}
|
129 |
-
if ( ''
|
130 |
$fontcolor = $default_colors['fontcolor'];
|
131 |
}
|
132 |
-
if ( ''
|
133 |
$bgcolor1 = $default_colors['bgcolor1'];
|
134 |
}
|
135 |
-
if ( ''
|
136 |
$bgcolor2 = $default_colors['bgcolor2'];
|
137 |
}
|
138 |
-
if ( ''
|
139 |
$bordercolor = $default_colors['bordercolor'];
|
140 |
}
|
141 |
if ( empty( $width ) ) {
|
@@ -143,26 +146,29 @@ if ( empty( $width ) ) {
|
|
143 |
}
|
144 |
|
145 |
$fields = array(
|
146 |
-
'location'
|
147 |
-
'color'
|
148 |
-
'inactive_color'
|
149 |
-
'fontcolor'
|
150 |
-
'bgcolor1'
|
151 |
-
'bgcolor2'
|
152 |
-
'bordercolor'
|
153 |
-
'custom_colors'
|
154 |
'custom_location' => true,
|
155 |
);
|
156 |
|
157 |
$displayed_fields = apply_filters( 'wp_review_metabox_item_fields', $fields );
|
158 |
|
159 |
-
$available_types = apply_filters(
|
160 |
-
'
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
)
|
|
|
|
|
|
|
166 |
|
167 |
$form_field = new WP_Review_Form_Field();
|
168 |
?>
|
@@ -185,14 +191,15 @@ $form_field = new WP_Review_Form_Field();
|
|
185 |
echo '<p class="wp-review-filter-msg"><div class="dashicons dashicons-info"></div>' . esc_html__( 'There is a filter set for the review location that may modify the options below.', 'wp-review' ) . '</p>';
|
186 |
}
|
187 |
|
188 |
-
if ( $suggest_theme_defaults ) {
|
189 |
-
|
190 |
-
<
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
196 |
<?php } ?>
|
197 |
|
198 |
<div class="wp-review-field">
|
@@ -202,11 +209,13 @@ $form_field = new WP_Review_Form_Field();
|
|
202 |
|
203 |
<div class="wp-review-field-option">
|
204 |
<?php
|
205 |
-
$form_field->render_switch(
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
|
|
210 |
?>
|
211 |
</div>
|
212 |
</div>
|
@@ -219,11 +228,13 @@ $form_field = new WP_Review_Form_Field();
|
|
219 |
|
220 |
<div class="wp-review-field-option">
|
221 |
<?php
|
222 |
-
$form_field->render_switch(
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
|
|
227 |
?>
|
228 |
</div>
|
229 |
</div>
|
@@ -236,11 +247,13 @@ $form_field = new WP_Review_Form_Field();
|
|
236 |
|
237 |
<div class="wp-review-field-option">
|
238 |
<?php
|
239 |
-
$form_field->render_switch(
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
|
|
244 |
?>
|
245 |
</div>
|
246 |
</div>
|
@@ -254,11 +267,13 @@ $form_field = new WP_Review_Form_Field();
|
|
254 |
|
255 |
<div class="wp-review-field-option">
|
256 |
<?php
|
257 |
-
$form_field->render_switch(
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
|
|
|
|
262 |
?>
|
263 |
</div>
|
264 |
</div>
|
@@ -272,11 +287,13 @@ $form_field = new WP_Review_Form_Field();
|
|
272 |
|
273 |
<div class="wp-review-field-option">
|
274 |
<?php
|
275 |
-
$form_field->render_switch(
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
|
|
|
|
280 |
?>
|
281 |
</div>
|
282 |
|
@@ -357,11 +374,13 @@ $form_field = new WP_Review_Form_Field();
|
|
357 |
|
358 |
<div class="wp-review-field-option">
|
359 |
<?php
|
360 |
-
$form_field->render_switch(
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
|
|
|
|
365 |
?>
|
366 |
</div>
|
367 |
</div>
|
@@ -374,11 +393,13 @@ $form_field = new WP_Review_Form_Field();
|
|
374 |
|
375 |
<div class="wp-review-field-option">
|
376 |
<?php
|
377 |
-
$form_field->render_switch(
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
|
|
|
|
382 |
?>
|
383 |
</div>
|
384 |
</div>
|
@@ -399,7 +420,9 @@ $form_field = new WP_Review_Form_Field();
|
|
399 |
</div>
|
400 |
</div>
|
401 |
|
402 |
-
<?php
|
|
|
|
|
403 |
<div class="wp-review-field-label">
|
404 |
<label><?php esc_html_e( 'Show text count with Star ratings', 'wp-review' ); ?></label>
|
405 |
</div>
|
@@ -413,7 +436,9 @@ $form_field = new WP_Review_Form_Field();
|
|
413 |
) );
|
414 |
?>
|
415 |
</div>
|
416 |
-
</div>*/
|
|
|
|
|
417 |
|
418 |
<div class="wp-review-field">
|
419 |
<div class="wp-review-field-label">
|
@@ -422,11 +447,13 @@ $form_field = new WP_Review_Form_Field();
|
|
422 |
|
423 |
<div class="wp-review-field-option">
|
424 |
<?php
|
425 |
-
$form_field->render_switch(
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
|
|
|
|
430 |
?>
|
431 |
</div>
|
432 |
</div>
|
@@ -439,11 +466,13 @@ $form_field = new WP_Review_Form_Field();
|
|
439 |
|
440 |
<div class="wp-review-field-option">
|
441 |
<?php
|
442 |
-
$form_field->render_switch(
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
|
|
|
|
447 |
?>
|
448 |
</div>
|
449 |
</div>
|
@@ -456,15 +485,19 @@ $form_field = new WP_Review_Form_Field();
|
|
456 |
|
457 |
<div class="wp-review-field-option">
|
458 |
<?php
|
459 |
-
$form_field->render_switch(
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
|
|
|
|
464 |
?>
|
465 |
</div>
|
466 |
</div>
|
467 |
-
<?php
|
|
|
|
|
468 |
<p style="margin-top: 50px;">
|
469 |
<button
|
470 |
type="button"
|
@@ -522,7 +555,7 @@ $form_field = new WP_Review_Form_Field();
|
|
522 |
|
523 |
<div class="wp-review-color-options">
|
524 |
|
525 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['color'] ) ) echo ' style="display: none;"'; ?>>
|
526 |
<div class="wp-review-field-label">
|
527 |
<label for="wp_review_color"><?php esc_html_e( 'Review Color', 'wp-review' ); ?></label>
|
528 |
</div>
|
@@ -532,7 +565,7 @@ $form_field = new WP_Review_Form_Field();
|
|
532 |
</div>
|
533 |
</div>
|
534 |
|
535 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['inactive_color'] ) ) echo ' style="display: none;"'; ?>>
|
536 |
<div class="wp-review-field-label">
|
537 |
<label for="wp_review_inactive_color"><?php esc_html_e( 'Inactive Review Color', 'wp-review' ); ?></label>
|
538 |
</div>
|
@@ -542,7 +575,7 @@ $form_field = new WP_Review_Form_Field();
|
|
542 |
</div>
|
543 |
</div>
|
544 |
|
545 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['fontcolor'] ) ) echo ' style="display: none;"'; ?>>
|
546 |
<div class="wp-review-field-label">
|
547 |
<label for="wp_review_fontcolor"><?php esc_html_e( 'Font Color', 'wp-review' ); ?></label>
|
548 |
</div>
|
@@ -552,7 +585,7 @@ $form_field = new WP_Review_Form_Field();
|
|
552 |
</div>
|
553 |
</div>
|
554 |
|
555 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor1'] ) ) echo ' style="display: none;"'; ?>>
|
556 |
<div class="wp-review-field-label">
|
557 |
<label for="wp_review_bgcolor1"><?php esc_html_e( 'Heading Background Color', 'wp-review' ); ?></label>
|
558 |
</div>
|
@@ -562,7 +595,7 @@ $form_field = new WP_Review_Form_Field();
|
|
562 |
</div>
|
563 |
</div>
|
564 |
|
565 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor2'] ) ) echo ' style="display: none;"'; ?>>
|
566 |
<div class="wp-review-field-label">
|
567 |
<label for="wp_review_bgcolor2"><?php esc_html_e( 'Background Color', 'wp-review' ); ?></label>
|
568 |
</div>
|
@@ -572,7 +605,7 @@ $form_field = new WP_Review_Form_Field();
|
|
572 |
</div>
|
573 |
</div>
|
574 |
|
575 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bordercolor'] ) ) echo ' style="display: none;"'; ?>>
|
576 |
<div class="wp-review-field-label">
|
577 |
<label for="wp_review_bordercolor"><?php esc_html_e( 'Border Color', 'wp-review' ); ?></label>
|
578 |
</div>
|
@@ -600,18 +633,20 @@ $form_field = new WP_Review_Form_Field();
|
|
600 |
<div class="wp-review-field-label">
|
601 |
<label><?php esc_html_e( 'Google Font', 'wp-review' ); ?></label><br>
|
602 |
<span class="description">
|
603 |
-
<?php _e( 'Many templates use Google Font, select <code>No</code> to use default theme font.', 'wp-review' ); ?>
|
604 |
</span>
|
605 |
<?php wp_review_print_pro_text(); ?>
|
606 |
</div>
|
607 |
|
608 |
<div class="wp-review-field-option">
|
609 |
<?php
|
610 |
-
$form_field->render_switch(
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
|
|
|
|
615 |
?>
|
616 |
</div>
|
617 |
</div>
|
@@ -627,11 +662,13 @@ $form_field = new WP_Review_Form_Field();
|
|
627 |
|
628 |
<div class="wp-review-field-option">
|
629 |
<?php
|
630 |
-
$form_field->render_switch(
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
|
|
|
|
635 |
?>
|
636 |
</div>
|
637 |
</div>
|
@@ -657,7 +694,7 @@ $form_field = new WP_Review_Form_Field();
|
|
657 |
?>
|
658 |
</select>
|
659 |
</div>
|
660 |
-
<a href="#" class="wpr-toggle-rating wp-review-disabled inline-block has-bg"><?php
|
661 |
</div>
|
662 |
</div>
|
663 |
|
@@ -695,7 +732,7 @@ $form_field = new WP_Review_Form_Field();
|
|
695 |
</div>
|
696 |
</div>
|
697 |
|
698 |
-
<div class="wp-review-field"<?php if ( empty( $displayed_fields['location'] ) ) echo ' style="display: none;"'; ?>>
|
699 |
<div class="wp-review-field-label">
|
700 |
<label for="wp_review_location"><?php esc_html_e( 'Review Location', 'wp-review' ); ?></label>
|
701 |
</div>
|
@@ -741,9 +778,9 @@ $form_field = new WP_Review_Form_Field();
|
|
741 |
<?php if ( ! empty( $item ) ) : ?>
|
742 |
<tr>
|
743 |
<td style="padding:0">
|
744 |
-
<input type="text" name="wp_review_options[default_features][]" value="<?php if ( ! empty( $item ) ) echo esc_attr( $item ); ?>" <?php echo $has_criteria_filter ? 'disabled="disabled" readonly="readonly"' : ''; ?> />
|
745 |
<?php if ( ! $has_criteria_filter ) : ?>
|
746 |
-
<a class="button remove-row" href="#"><?php
|
747 |
<?php endif; ?>
|
748 |
</td>
|
749 |
</tr>
|
@@ -754,9 +791,9 @@ $form_field = new WP_Review_Form_Field();
|
|
754 |
<?php if ( ! empty( $item ) ) : ?>
|
755 |
<tr>
|
756 |
<td style="padding:0">
|
757 |
-
<input type="text" name="wp_review_options[default_features][]" value="<?php if ( ! empty( $item ) ) echo esc_attr( $item ); ?>" <?php echo $has_criteria_filter ? 'disabled="disabled" readonly="readonly"' : ''; ?> />
|
758 |
<?php if ( ! $has_criteria_filter ) : ?>
|
759 |
-
<a class="button remove-row" href="#"><?php
|
760 |
<?php endif; ?>
|
761 |
</td>
|
762 |
</tr>
|
@@ -766,14 +803,14 @@ $form_field = new WP_Review_Form_Field();
|
|
766 |
<tr class="empty-row screen-reader-text">
|
767 |
<td style="padding:0">
|
768 |
<input class="focus-on-add" type="text" name="wp_review_options[default_features][]" />
|
769 |
-
<a class="button remove-row" href="#"><?php
|
770 |
</td>
|
771 |
</tr>
|
772 |
</table>
|
773 |
<?php if ( $has_criteria_filter ) : ?>
|
774 |
-
<p class="description"><?php
|
775 |
<?php else : ?>
|
776 |
-
<a class="add-row button" data-target="#wp-review-item" href="#"><?php
|
777 |
<?php endif; ?>
|
778 |
</div>
|
779 |
</div>
|
@@ -785,14 +822,14 @@ $form_field = new WP_Review_Form_Field();
|
|
785 |
|
786 |
<div class="wp-review-field-option">
|
787 |
<table id="wp-review-link">
|
788 |
-
<?php if ( ! empty
|
789 |
<?php foreach ( $link_texts as $key => $text ) : ?>
|
790 |
<?php if ( ! empty( $text ) && ! empty( $link_urls[ $key ] ) ) : ?>
|
791 |
<tr>
|
792 |
<td style="padding:0">
|
793 |
<input type="text" name="wp_review_options[default_link_text][]" placeholder="Text" value="<?php echo esc_attr( $text ); ?>" />
|
794 |
<input type="url" name="wp_review_options[default_link_url][]" placeholder="URL" value="<?php echo esc_url( $link_urls[ $key ] ); ?>" />
|
795 |
-
<a class="button remove-row" href="#"><?php
|
796 |
</td>
|
797 |
</tr>
|
798 |
<?php endif; ?>
|
@@ -802,11 +839,11 @@ $form_field = new WP_Review_Form_Field();
|
|
802 |
<td style="padding:0">
|
803 |
<input class="focus-on-add" type="text" name="wp_review_options[default_link_text][]" placeholder="Text" />
|
804 |
<input type="url" name="wp_review_options[default_link_url][]" placeholder="URL" />
|
805 |
-
<a class="button remove-row" href="#"><?php
|
806 |
</td>
|
807 |
</tr>
|
808 |
</table>
|
809 |
-
<a class="add-row button" data-target="#wp-review-link" href="#"><?php
|
810 |
</div>
|
811 |
</div>
|
812 |
|
@@ -853,11 +890,13 @@ $form_field = new WP_Review_Form_Field();
|
|
853 |
|
854 |
<div class="wp-review-field-option">
|
855 |
<?php
|
856 |
-
$form_field->render_switch(
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
|
|
|
|
861 |
?>
|
862 |
</div>
|
863 |
</div>
|
@@ -870,11 +909,13 @@ $form_field = new WP_Review_Form_Field();
|
|
870 |
|
871 |
<div class="wp-review-field-option">
|
872 |
<?php
|
873 |
-
$form_field->render_switch(
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
|
|
|
|
878 |
?>
|
879 |
</div>
|
880 |
</div>
|
@@ -887,11 +928,13 @@ $form_field = new WP_Review_Form_Field();
|
|
887 |
|
888 |
<div class="wp-review-field-option">
|
889 |
<?php
|
890 |
-
$form_field->render_switch(
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
|
|
|
|
895 |
?>
|
896 |
</div>
|
897 |
</div>
|
@@ -904,11 +947,13 @@ $form_field = new WP_Review_Form_Field();
|
|
904 |
|
905 |
<div class="wp-review-field-option">
|
906 |
<?php
|
907 |
-
$form_field->render_switch(
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
|
|
|
|
912 |
?>
|
913 |
</div>
|
914 |
</div>
|
@@ -921,11 +966,13 @@ $form_field = new WP_Review_Form_Field();
|
|
921 |
|
922 |
<div class="wp-review-field-option">
|
923 |
<?php
|
924 |
-
$form_field->render_switch(
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
|
|
|
|
929 |
?>
|
930 |
</div>
|
931 |
</div>
|
@@ -938,11 +985,13 @@ $form_field = new WP_Review_Form_Field();
|
|
938 |
|
939 |
<div class="wp-review-field-option">
|
940 |
<?php
|
941 |
-
$form_field->render_switch(
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
|
|
|
|
946 |
?>
|
947 |
</div>
|
948 |
</div>
|
@@ -952,7 +1001,12 @@ $form_field = new WP_Review_Form_Field();
|
|
952 |
<div id="review-migrate" class="settings-tab-migrate tab-content" style="display: none;">
|
953 |
<div id="settings-allow-migrate">
|
954 |
<p><?php esc_html_e( 'Here you can import your existing user ratings from WP Review 1.x and WP Review Pro 1.x.', 'wp-review' ); ?></p>
|
955 |
-
<p class="migrate-items"
|
|
|
|
|
|
|
|
|
|
|
956 |
<a href="#" class="button button-secondary" id="start-migrate" data-start="<?php echo esc_attr( $migrated_rows ); ?>"><?php esc_html_e( 'Start import', 'wp-review' ); ?></a>
|
957 |
<textarea id="wp-review-migrate-log"></textarea>
|
958 |
</div>
|
8 |
$options = get_option( 'wp_review_options' );
|
9 |
|
10 |
$default_options = array(
|
11 |
+
'colors' => array(
|
12 |
+
'color' => '',
|
13 |
'inactive_color' => '',
|
14 |
+
'fontcolor' => '',
|
15 |
+
'bgcolor1' => '',
|
16 |
+
'bgcolor2' => '',
|
17 |
+
'bordercolor' => '',
|
18 |
),
|
19 |
+
'default_features' => array(),
|
20 |
+
'default_link_texts' => array(),
|
21 |
+
'default_link_urls' => array(),
|
22 |
+
'default_schema_type' => 'Thing',
|
23 |
'default_user_review_type' => WP_REVIEW_REVIEW_DISABLED,
|
24 |
'image_sizes' => array(),
|
25 |
);
|
33 |
$options['image_sizes'] = array();
|
34 |
}
|
35 |
|
36 |
+
$opt_name = 'wp_review_options_' . wp_get_theme();
|
37 |
+
$options_updated = get_option( $opt_name );
|
38 |
$suggest_theme_defaults = true;
|
39 |
+
if ( ! empty( $_GET['wp-review-theme-defaults'] ) && empty( $_GET['settings-updated'] ) ) { // WPCS: csrf ok.
|
40 |
wp_review_theme_defaults( $options_updated, true );
|
41 |
+
$options = get_option( 'wp_review_options' );
|
42 |
$suggest_theme_defaults = false;
|
43 |
}
|
44 |
|
48 |
}
|
49 |
|
50 |
$opts_tmp = array_merge( $options, $options_updated );
|
51 |
+
if ( $opts_tmp === $options ) {
|
52 |
$suggest_theme_defaults = false;
|
53 |
}
|
54 |
|
55 |
// Migrate.
|
56 |
global $wpdb;
|
57 |
$current_blog_id = get_current_blog_id();
|
58 |
+
$total_rows = 0;
|
59 |
+
$rows_left = 0;
|
60 |
+
$migrated_rows = get_option( 'wp_review_migrated_rows', 0 );
|
61 |
+
$has_migrated = get_option( 'wp_review_has_migrated', false );
|
62 |
+
if ( ! $has_migrated && $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->base_prefix}mts_wp_reviews'" ) === "{$wpdb->base_prefix}mts_wp_reviews" ) {
|
63 |
// Table exists and not migrated (fully) yet.
|
64 |
+
$total_rows = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->base_prefix}mts_wp_reviews WHERE blog_id = {$current_blog_id}" ); // WPCS: unprepared SQL ok.
|
65 |
+
$rows_left = $total_rows - $migrated_rows;
|
66 |
}
|
67 |
|
68 |
$comment_form_integration = ( ! empty( $options['comment_form_integration'] ) ? $options['comment_form_integration'] : 'replace' );
|
69 |
+
if ( 'replace' !== $comment_form_integration ) {
|
70 |
$comment_form_integration = 'extend';
|
71 |
}
|
72 |
|
73 |
$comments_template = ( ! empty( $options['comments_template'] ) ? $options['comments_template'] : 'theme' );
|
74 |
+
if ( 'theme' !== $comments_template ) {
|
75 |
$comments_template = 'plugin';
|
76 |
}
|
77 |
|
78 |
+
$default_colors = wp_review_get_default_colors();
|
79 |
$default_location = wp_review_get_default_location();
|
80 |
$default_criteria = wp_review_get_default_criteria();
|
81 |
|
86 |
'wp_review_item_star' => '',
|
87 |
);
|
88 |
}
|
89 |
+
$default_schema = $default_options['default_schema_type'];
|
90 |
$default_user_review_type = empty( $options['default_user_review_type'] ) ? WP_REVIEW_REVIEW_DISABLED : $options['default_user_review_type'];
|
91 |
|
92 |
$options['colors'] = apply_filters( 'wp_review_colors', $options['colors'], 0 );
|
94 |
$options['default'] = array();
|
95 |
}
|
96 |
/* Retrieve an existing value from the database. */
|
97 |
+
$items = ! empty( $options['default_features'] ) ? $options['default_features'] : '';
|
98 |
+
$link_texts = ! empty( $options['default_link_text'] ) ? $options['default_link_text'] : array();
|
99 |
+
$link_urls = ! empty( $options['default_link_url'] ) ? $options['default_link_url'] : array();
|
100 |
+
$location = wp_review_option( 'review_location' );
|
101 |
+
$color = ! empty( $options['colors']['color'] ) ? $options['colors']['color'] : '';
|
102 |
+
$inactive_color = ! empty( $options['colors']['inactive_color'] ) ? $options['colors']['inactive_color'] : '';
|
103 |
+
$fontcolor = ! empty( $options['colors']['fontcolor'] ) ? $options['colors']['fontcolor'] : '';
|
104 |
+
$bgcolor1 = ! empty( $options['colors']['bgcolor1'] ) ? $options['colors']['bgcolor1'] : '';
|
105 |
+
$bgcolor2 = ! empty( $options['colors']['bgcolor2'] ) ? $options['colors']['bgcolor2'] : '';
|
106 |
+
$bordercolor = ! empty( $options['colors']['bordercolor'] ) ? $options['colors']['bordercolor'] : '';
|
107 |
|
108 |
$force_user_ratings = wp_review_option( 'force_user_ratings' );
|
109 |
|
110 |
+
$rating_icon = wp_review_option( 'rating_icon', apply_filters( 'wp_review_default_rating_icon', 'fa fa-star' ) );
|
111 |
$rating_image = wp_review_option( 'rating_image' );
|
112 |
|
113 |
$review_templates = wp_review_get_box_templates();
|
114 |
+
$box_template = wp_review_option( 'box_template', 'default' );
|
115 |
$box_template_img = ! empty( $review_templates[ $box_template ] ) ? $review_templates[ $box_template ]['image'] : WP_REVIEW_ASSETS . 'images/largethumb.png';
|
116 |
|
117 |
$review_types = wp_review_get_rating_types();
|
118 |
+
$review_type = wp_review_option( 'review_type', 'none' );
|
119 |
|
120 |
+
if ( '' === $items ) {
|
121 |
$items = $default_items;
|
122 |
}
|
123 |
+
if ( '' === $color ) {
|
124 |
$color = $default_colors['color'];
|
125 |
}
|
126 |
+
if ( '' === $inactive_color ) {
|
127 |
+
$inactive_color = $default_colors['inactive_color'];
|
128 |
+
}
|
129 |
+
if ( '' === $location ) {
|
130 |
$location = $default_location;
|
131 |
}
|
132 |
+
if ( '' === $fontcolor ) {
|
133 |
$fontcolor = $default_colors['fontcolor'];
|
134 |
}
|
135 |
+
if ( '' === $bgcolor1 ) {
|
136 |
$bgcolor1 = $default_colors['bgcolor1'];
|
137 |
}
|
138 |
+
if ( '' === $bgcolor2 ) {
|
139 |
$bgcolor2 = $default_colors['bgcolor2'];
|
140 |
}
|
141 |
+
if ( '' === $bordercolor ) {
|
142 |
$bordercolor = $default_colors['bordercolor'];
|
143 |
}
|
144 |
if ( empty( $width ) ) {
|
146 |
}
|
147 |
|
148 |
$fields = array(
|
149 |
+
'location' => true,
|
150 |
+
'color' => true,
|
151 |
+
'inactive_color' => true,
|
152 |
+
'fontcolor' => true,
|
153 |
+
'bgcolor1' => true,
|
154 |
+
'bgcolor2' => true,
|
155 |
+
'bordercolor' => true,
|
156 |
+
'custom_colors' => true,
|
157 |
'custom_location' => true,
|
158 |
);
|
159 |
|
160 |
$displayed_fields = apply_filters( 'wp_review_metabox_item_fields', $fields );
|
161 |
|
162 |
+
$available_types = apply_filters(
|
163 |
+
'wp_review_metabox_types',
|
164 |
+
array(
|
165 |
+
'star' => __( 'Star', 'wp-review' ),
|
166 |
+
'point' => __( 'Point', 'wp-review' ),
|
167 |
+
'percentage' => __( 'Percentage', 'wp-review' ),
|
168 |
+
'circle' => __( 'Circle', 'wp-review' ),
|
169 |
+
'thumbs' => __( 'Thumbs', 'wp-review' ),
|
170 |
+
)
|
171 |
+
);
|
172 |
|
173 |
$form_field = new WP_Review_Form_Field();
|
174 |
?>
|
191 |
echo '<p class="wp-review-filter-msg"><div class="dashicons dashicons-info"></div>' . esc_html__( 'There is a filter set for the review location that may modify the options below.', 'wp-review' ) . '</p>';
|
192 |
}
|
193 |
|
194 |
+
if ( $suggest_theme_defaults ) {
|
195 |
+
?>
|
196 |
+
<div class="wp-review-theme-defaults-msg updated settings-error">
|
197 |
+
<p class="wp-review-field">
|
198 |
+
<?php esc_html_e( 'The current theme provides default settings for the plugin.', 'wp-review' ); ?><br />
|
199 |
+
</p>
|
200 |
+
<a href="<?php echo admin_url( 'options-general.php?page=wp-review/admin/options.php&wp-review-theme-defaults=1' ); // WPCS: xss ok. ?>" class="button button-primary"><?php esc_html_e( 'Set to theme defaults', 'wp-review' ); ?></a>
|
201 |
+
<a href="#" class="dashicons dashicons-no-alt close-notice"></a>
|
202 |
+
</div>
|
203 |
<?php } ?>
|
204 |
|
205 |
<div class="wp-review-field">
|
209 |
|
210 |
<div class="wp-review-field-option">
|
211 |
<?php
|
212 |
+
$form_field->render_switch(
|
213 |
+
array(
|
214 |
+
'id' => 'wp_review_registered_only',
|
215 |
+
'name' => 'wp_review_options[registered_only]',
|
216 |
+
'value' => ! empty( $options['registered_only'] ),
|
217 |
+
)
|
218 |
+
);
|
219 |
?>
|
220 |
</div>
|
221 |
</div>
|
228 |
|
229 |
<div class="wp-review-field-option">
|
230 |
<?php
|
231 |
+
$form_field->render_switch(
|
232 |
+
array(
|
233 |
+
'id' => 'wp_review_show_on_thumbnails',
|
234 |
+
'name' => 'wp_review_options[show_on_thumbnails]',
|
235 |
+
'disabled' => true,
|
236 |
+
)
|
237 |
+
);
|
238 |
?>
|
239 |
</div>
|
240 |
</div>
|
247 |
|
248 |
<div class="wp-review-field-option">
|
249 |
<?php
|
250 |
+
$form_field->render_switch(
|
251 |
+
array(
|
252 |
+
'id' => 'wp_review_global_user_rating',
|
253 |
+
'name' => 'wp_review_options[global_user_rating]',
|
254 |
+
'disabled' => true,
|
255 |
+
)
|
256 |
+
);
|
257 |
?>
|
258 |
</div>
|
259 |
</div>
|
267 |
|
268 |
<div class="wp-review-field-option">
|
269 |
<?php
|
270 |
+
$form_field->render_switch(
|
271 |
+
array(
|
272 |
+
'id' => 'wp_review_replace_wc_rating',
|
273 |
+
'name' => 'wp_review_options[replace_wc_rating]',
|
274 |
+
'disabled' => true,
|
275 |
+
)
|
276 |
+
);
|
277 |
?>
|
278 |
</div>
|
279 |
</div>
|
287 |
|
288 |
<div class="wp-review-field-option">
|
289 |
<?php
|
290 |
+
$form_field->render_switch(
|
291 |
+
array(
|
292 |
+
'id' => 'wp_review_dequeue_map_backend',
|
293 |
+
'name' => 'wp_review_options[dequeue_map_backend]',
|
294 |
+
'disabled' => true,
|
295 |
+
)
|
296 |
+
);
|
297 |
?>
|
298 |
</div>
|
299 |
|
374 |
|
375 |
<div class="wp-review-field-option">
|
376 |
<?php
|
377 |
+
$form_field->render_switch(
|
378 |
+
array(
|
379 |
+
'id' => 'wp_review_require_rating',
|
380 |
+
'name' => 'wp_review_options[require_rating]',
|
381 |
+
'disabled' => true,
|
382 |
+
)
|
383 |
+
);
|
384 |
?>
|
385 |
</div>
|
386 |
</div>
|
393 |
|
394 |
<div class="wp-review-field-option">
|
395 |
<?php
|
396 |
+
$form_field->render_switch(
|
397 |
+
array(
|
398 |
+
'id' => 'wp_review_allow_comment_feedback',
|
399 |
+
'name' => 'wp_review_options[allow_comment_feedback]',
|
400 |
+
'disabled' => true,
|
401 |
+
)
|
402 |
+
);
|
403 |
?>
|
404 |
</div>
|
405 |
</div>
|
420 |
</div>
|
421 |
</div>
|
422 |
|
423 |
+
<?php
|
424 |
+
// phpcs:disable
|
425 |
+
/*<div class="wp-review-field">
|
426 |
<div class="wp-review-field-label">
|
427 |
<label><?php esc_html_e( 'Show text count with Star ratings', 'wp-review' ); ?></label>
|
428 |
</div>
|
436 |
) );
|
437 |
?>
|
438 |
</div>
|
439 |
+
</div>*/
|
440 |
+
// phpcs:enable
|
441 |
+
?>
|
442 |
|
443 |
<div class="wp-review-field">
|
444 |
<div class="wp-review-field-label">
|
447 |
|
448 |
<div class="wp-review-field-option">
|
449 |
<?php
|
450 |
+
$form_field->render_switch(
|
451 |
+
array(
|
452 |
+
'id' => 'wp_review_multi_reviews_per_account',
|
453 |
+
'name' => 'wp_review_options[multi_reviews_per_account]',
|
454 |
+
'value' => ! empty( $options['multi_reviews_per_account'] ),
|
455 |
+
)
|
456 |
+
);
|
457 |
?>
|
458 |
</div>
|
459 |
</div>
|
466 |
|
467 |
<div class="wp-review-field-option">
|
468 |
<?php
|
469 |
+
$form_field->render_switch(
|
470 |
+
array(
|
471 |
+
'id' => 'wp_review_comment_pros_cons',
|
472 |
+
'name' => 'wp_review_options[comment_pros_cons]',
|
473 |
+
'disabled' => true,
|
474 |
+
)
|
475 |
+
);
|
476 |
?>
|
477 |
</div>
|
478 |
</div>
|
485 |
|
486 |
<div class="wp-review-field-option">
|
487 |
<?php
|
488 |
+
$form_field->render_switch(
|
489 |
+
array(
|
490 |
+
'id' => 'wp_review_approve_ratings',
|
491 |
+
'name' => 'wp_review_options[approve_ratings]',
|
492 |
+
'disabled' => true,
|
493 |
+
)
|
494 |
+
);
|
495 |
?>
|
496 |
</div>
|
497 |
</div>
|
498 |
+
<?php
|
499 |
+
if ( current_user_can( 'wp_review_purge_visitor_ratings' ) ) {
|
500 |
+
?>
|
501 |
<p style="margin-top: 50px;">
|
502 |
<button
|
503 |
type="button"
|
555 |
|
556 |
<div class="wp-review-color-options">
|
557 |
|
558 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['color'] ) ) echo ' style="display: none;"'; // phpcS:ignore ?>>
|
559 |
<div class="wp-review-field-label">
|
560 |
<label for="wp_review_color"><?php esc_html_e( 'Review Color', 'wp-review' ); ?></label>
|
561 |
</div>
|
565 |
</div>
|
566 |
</div>
|
567 |
|
568 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['inactive_color'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
569 |
<div class="wp-review-field-label">
|
570 |
<label for="wp_review_inactive_color"><?php esc_html_e( 'Inactive Review Color', 'wp-review' ); ?></label>
|
571 |
</div>
|
575 |
</div>
|
576 |
</div>
|
577 |
|
578 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['fontcolor'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
579 |
<div class="wp-review-field-label">
|
580 |
<label for="wp_review_fontcolor"><?php esc_html_e( 'Font Color', 'wp-review' ); ?></label>
|
581 |
</div>
|
585 |
</div>
|
586 |
</div>
|
587 |
|
588 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor1'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
589 |
<div class="wp-review-field-label">
|
590 |
<label for="wp_review_bgcolor1"><?php esc_html_e( 'Heading Background Color', 'wp-review' ); ?></label>
|
591 |
</div>
|
595 |
</div>
|
596 |
</div>
|
597 |
|
598 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bgcolor2'] ) ) echo ' style="display: none;"'; //phpcs:ignore ?>>
|
599 |
<div class="wp-review-field-label">
|
600 |
<label for="wp_review_bgcolor2"><?php esc_html_e( 'Background Color', 'wp-review' ); ?></label>
|
601 |
</div>
|
605 |
</div>
|
606 |
</div>
|
607 |
|
608 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['bordercolor'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
609 |
<div class="wp-review-field-label">
|
610 |
<label for="wp_review_bordercolor"><?php esc_html_e( 'Border Color', 'wp-review' ); ?></label>
|
611 |
</div>
|
633 |
<div class="wp-review-field-label">
|
634 |
<label><?php esc_html_e( 'Google Font', 'wp-review' ); ?></label><br>
|
635 |
<span class="description">
|
636 |
+
<?php _e( 'Many templates use Google Font, select <code>No</code> to use default theme font.', 'wp-review' ); // WPCS: xss ok. ?>
|
637 |
</span>
|
638 |
<?php wp_review_print_pro_text(); ?>
|
639 |
</div>
|
640 |
|
641 |
<div class="wp-review-field-option">
|
642 |
<?php
|
643 |
+
$form_field->render_switch(
|
644 |
+
array(
|
645 |
+
'id' => 'wp_review_fontfamily',
|
646 |
+
'name' => 'wp_review_options[fontfamily]',
|
647 |
+
'disabled' => true,
|
648 |
+
)
|
649 |
+
);
|
650 |
?>
|
651 |
</div>
|
652 |
</div>
|
662 |
|
663 |
<div class="wp-review-field-option">
|
664 |
<?php
|
665 |
+
$form_field->render_switch(
|
666 |
+
array(
|
667 |
+
'id' => 'wp_review_custom_comment_colors',
|
668 |
+
'name' => 'wp_review_options[custom_comment_colors]',
|
669 |
+
'disabled' => true,
|
670 |
+
)
|
671 |
+
);
|
672 |
?>
|
673 |
</div>
|
674 |
</div>
|
694 |
?>
|
695 |
</select>
|
696 |
</div>
|
697 |
+
<a href="#" class="wpr-toggle-rating wp-review-disabled inline-block has-bg"><?php esc_html_e( 'Use Image', 'wp-review' ); ?></a>
|
698 |
</div>
|
699 |
</div>
|
700 |
|
732 |
</div>
|
733 |
</div>
|
734 |
|
735 |
+
<div class="wp-review-field"<?php if ( empty( $displayed_fields['location'] ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
736 |
<div class="wp-review-field-label">
|
737 |
<label for="wp_review_location"><?php esc_html_e( 'Review Location', 'wp-review' ); ?></label>
|
738 |
</div>
|
778 |
<?php if ( ! empty( $item ) ) : ?>
|
779 |
<tr>
|
780 |
<td style="padding:0">
|
781 |
+
<input type="text" name="wp_review_options[default_features][]" value="<?php if ( ! empty( $item ) ) echo esc_attr( $item ); // phpcs:ignore ?>" <?php echo $has_criteria_filter ? 'disabled="disabled" readonly="readonly"' : ''; ?> />
|
782 |
<?php if ( ! $has_criteria_filter ) : ?>
|
783 |
+
<a class="button remove-row" href="#"><?php esc_html_e( 'Delete', 'wp-review' ); ?></a>
|
784 |
<?php endif; ?>
|
785 |
</td>
|
786 |
</tr>
|
791 |
<?php if ( ! empty( $item ) ) : ?>
|
792 |
<tr>
|
793 |
<td style="padding:0">
|
794 |
+
<input type="text" name="wp_review_options[default_features][]" value="<?php if ( ! empty( $item ) ) echo esc_attr( $item ); // phpcs:ignore ?>" <?php echo $has_criteria_filter ? 'disabled="disabled" readonly="readonly"' : ''; ?> />
|
795 |
<?php if ( ! $has_criteria_filter ) : ?>
|
796 |
+
<a class="button remove-row" href="#"><?php esc_html_e( 'Delete', 'wp-review' ); ?></a>
|
797 |
<?php endif; ?>
|
798 |
</td>
|
799 |
</tr>
|
803 |
<tr class="empty-row screen-reader-text">
|
804 |
<td style="padding:0">
|
805 |
<input class="focus-on-add" type="text" name="wp_review_options[default_features][]" />
|
806 |
+
<a class="button remove-row" href="#"><?php esc_html_e( 'Delete', 'wp-review' ); ?></a>
|
807 |
</td>
|
808 |
</tr>
|
809 |
</table>
|
810 |
<?php if ( $has_criteria_filter ) : ?>
|
811 |
+
<p class="description"><?php esc_html_e( 'Default features are set by a filter function. Remove it to change.', 'wp-review' ); ?></p>
|
812 |
<?php else : ?>
|
813 |
+
<a class="add-row button" data-target="#wp-review-item" href="#"><?php esc_html_e( 'Add default feature', 'wp-review' ); ?></a>
|
814 |
<?php endif; ?>
|
815 |
</div>
|
816 |
</div>
|
822 |
|
823 |
<div class="wp-review-field-option">
|
824 |
<table id="wp-review-link">
|
825 |
+
<?php if ( ! empty( $link_texts ) ) : ?>
|
826 |
<?php foreach ( $link_texts as $key => $text ) : ?>
|
827 |
<?php if ( ! empty( $text ) && ! empty( $link_urls[ $key ] ) ) : ?>
|
828 |
<tr>
|
829 |
<td style="padding:0">
|
830 |
<input type="text" name="wp_review_options[default_link_text][]" placeholder="Text" value="<?php echo esc_attr( $text ); ?>" />
|
831 |
<input type="url" name="wp_review_options[default_link_url][]" placeholder="URL" value="<?php echo esc_url( $link_urls[ $key ] ); ?>" />
|
832 |
+
<a class="button remove-row" href="#"><?php esc_html_e( 'Delete', 'wp-review' ); ?></a>
|
833 |
</td>
|
834 |
</tr>
|
835 |
<?php endif; ?>
|
839 |
<td style="padding:0">
|
840 |
<input class="focus-on-add" type="text" name="wp_review_options[default_link_text][]" placeholder="Text" />
|
841 |
<input type="url" name="wp_review_options[default_link_url][]" placeholder="URL" />
|
842 |
+
<a class="button remove-row" href="#"><?php esc_html_e( 'Delete', 'wp-review' ); ?></a>
|
843 |
</td>
|
844 |
</tr>
|
845 |
</table>
|
846 |
+
<a class="add-row button" data-target="#wp-review-link" href="#"><?php esc_html_e( 'Add default link', 'wp-review' ); ?></a>
|
847 |
</div>
|
848 |
</div>
|
849 |
|
890 |
|
891 |
<div class="wp-review-field-option">
|
892 |
<?php
|
893 |
+
$form_field->render_switch(
|
894 |
+
array(
|
895 |
+
'id' => 'wp_review_enable_embed',
|
896 |
+
'name' => 'wp_review_options[enable_embed]',
|
897 |
+
'disabled' => true,
|
898 |
+
)
|
899 |
+
);
|
900 |
?>
|
901 |
</div>
|
902 |
</div>
|
909 |
|
910 |
<div class="wp-review-field-option">
|
911 |
<?php
|
912 |
+
$form_field->render_switch(
|
913 |
+
array(
|
914 |
+
'id' => 'wp_review_embed_show_title',
|
915 |
+
'name' => 'wp_review_options[embed_show_title]',
|
916 |
+
'disabled' => true,
|
917 |
+
)
|
918 |
+
);
|
919 |
?>
|
920 |
</div>
|
921 |
</div>
|
928 |
|
929 |
<div class="wp-review-field-option">
|
930 |
<?php
|
931 |
+
$form_field->render_switch(
|
932 |
+
array(
|
933 |
+
'id' => 'wp_review_embed_show_thumbnail',
|
934 |
+
'name' => 'wp_review_options[embed_show_thumbnail]',
|
935 |
+
'disabled' => true,
|
936 |
+
)
|
937 |
+
);
|
938 |
?>
|
939 |
</div>
|
940 |
</div>
|
947 |
|
948 |
<div class="wp-review-field-option">
|
949 |
<?php
|
950 |
+
$form_field->render_switch(
|
951 |
+
array(
|
952 |
+
'id' => 'wp_review_embed_show_excerpt',
|
953 |
+
'name' => 'wp_review_options[embed_show_excerpt]',
|
954 |
+
'disabled' => true,
|
955 |
+
)
|
956 |
+
);
|
957 |
?>
|
958 |
</div>
|
959 |
</div>
|
966 |
|
967 |
<div class="wp-review-field-option">
|
968 |
<?php
|
969 |
+
$form_field->render_switch(
|
970 |
+
array(
|
971 |
+
'id' => 'wp_review_embed_show_rating_box',
|
972 |
+
'name' => 'wp_review_options[embed_show_rating_box]',
|
973 |
+
'disabled' => true,
|
974 |
+
)
|
975 |
+
);
|
976 |
?>
|
977 |
</div>
|
978 |
</div>
|
985 |
|
986 |
<div class="wp-review-field-option">
|
987 |
<?php
|
988 |
+
$form_field->render_switch(
|
989 |
+
array(
|
990 |
+
'id' => 'wp_review_embed_show_credit',
|
991 |
+
'name' => 'wp_review_options[embed_show_credit]',
|
992 |
+
'disabled' => true,
|
993 |
+
)
|
994 |
+
);
|
995 |
?>
|
996 |
</div>
|
997 |
</div>
|
1001 |
<div id="review-migrate" class="settings-tab-migrate tab-content" style="display: none;">
|
1002 |
<div id="settings-allow-migrate">
|
1003 |
<p><?php esc_html_e( 'Here you can import your existing user ratings from WP Review 1.x and WP Review Pro 1.x.', 'wp-review' ); ?></p>
|
1004 |
+
<p class="migrate-items">
|
1005 |
+
<?php
|
1006 |
+
// translators: number of rows left.
|
1007 |
+
printf( esc_html__( '%s ratings left to import.', 'wp-review' ), '<span id="migrate-items-num">' . intval( $rows_left ) . '</span>' );
|
1008 |
+
?>
|
1009 |
+
</p>
|
1010 |
<a href="#" class="button button-secondary" id="start-migrate" data-start="<?php echo esc_attr( $migrated_rows ); ?>"><?php esc_html_e( 'Start import', 'wp-review' ); ?></a>
|
1011 |
<textarea id="wp-review-migrate-log"></textarea>
|
1012 |
</div>
|
admin/review-options-meta-box.php
CHANGED
@@ -9,9 +9,11 @@
|
|
9 |
* Render the meta box.
|
10 |
*
|
11 |
* @since 1.0
|
|
|
|
|
12 |
*/
|
13 |
function wp_review_render_meta_box_review_options( $post ) {
|
14 |
-
global $post
|
15 |
|
16 |
/* Add an nonce field so we can check for it later. */
|
17 |
wp_nonce_field( 'wp-review-meta-box-options', 'wp-review-review-options-nonce' );
|
@@ -27,7 +29,7 @@ function wp_review_render_meta_box_review_options( $post ) {
|
|
27 |
$heading = get_post_meta( $post->ID, 'wp_review_heading', true );
|
28 |
// $available_types = apply_filters('wp_review_metabox_types', wp_review_get_review_types() );
|
29 |
$available_types = wp_review_get_rating_types();
|
30 |
-
$schemas
|
31 |
|
32 |
$rating_schema = wp_review_get_rating_schema( $post->ID );
|
33 |
$custom_author = get_post_meta( $post->ID, 'wp_review_custom_author', true );
|
@@ -73,7 +75,12 @@ function wp_review_render_meta_box_review_options( $post ) {
|
|
73 |
</select>
|
74 |
<input type="hidden" name="wp_review_type" value="<?php echo esc_attr( $type_post_value ); ?>">
|
75 |
|
76 |
-
<span id="wp_review_id_hint"
|
|
|
|
|
|
|
|
|
|
|
77 |
</div>
|
78 |
</div>
|
79 |
|
@@ -117,23 +124,25 @@ function wp_review_render_meta_box_review_options( $post ) {
|
|
117 |
</select>
|
118 |
</div>
|
119 |
</div>
|
120 |
-
<div id="wp_review_schema_author_wrapper"<?php if ( 'author' !== $rating_schema ) echo ' style="display: none;"'; ?>>
|
121 |
<div class="wp-review-field">
|
122 |
<div class="wp-review-field-label">
|
123 |
<label><?php esc_html_e( 'Custom Author', 'wp-review' ); ?></label>
|
124 |
</div>
|
125 |
<div class="wp-review-field-option">
|
126 |
<?php
|
127 |
-
$form_field->render_switch(
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
132 |
?>
|
133 |
</div>
|
134 |
</div>
|
135 |
|
136 |
-
<div class="wp-review-author-options"<?php if ( empty( $custom_author ) ) echo ' style="display: none;"'; ?>>
|
137 |
<div class="wp-review-field">
|
138 |
<div class="wp-review-field-label">
|
139 |
<label for="wp_review_author"><?php esc_html_e( 'Review Author', 'wp-review' ); ?></label>
|
@@ -155,11 +164,13 @@ function wp_review_render_meta_box_review_options( $post ) {
|
|
155 |
|
156 |
<div class="wp-review-field-option">
|
157 |
<?php
|
158 |
-
$form_field->render_switch(
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
|
|
163 |
?>
|
164 |
</div>
|
165 |
</div>
|
@@ -173,11 +184,13 @@ function wp_review_render_meta_box_review_options( $post ) {
|
|
173 |
|
174 |
<div class="wp-review-field-option">
|
175 |
<?php
|
176 |
-
$form_field->render_switch(
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
|
|
|
|
181 |
?>
|
182 |
</div>
|
183 |
</div>
|
@@ -205,7 +218,7 @@ function wp_review_render_meta_box_review_options( $post ) {
|
|
205 |
</div><!-- End #popup -->
|
206 |
<?php } ?>
|
207 |
|
208 |
-
<?php if ( ! wp_review_network_option( 'hide_notification_bar_' ) &&
|
209 |
<div id="hello-bar" class="tab-content wp-review-hello-bar" style="display: none;">
|
210 |
<div class="wp-review-field">
|
211 |
<div class="wp-review-field-label">
|
9 |
* Render the meta box.
|
10 |
*
|
11 |
* @since 1.0
|
12 |
+
*
|
13 |
+
* @param WP_Post $post Post object.
|
14 |
*/
|
15 |
function wp_review_render_meta_box_review_options( $post ) {
|
16 |
+
global $post;
|
17 |
|
18 |
/* Add an nonce field so we can check for it later. */
|
19 |
wp_nonce_field( 'wp-review-meta-box-options', 'wp-review-review-options-nonce' );
|
29 |
$heading = get_post_meta( $post->ID, 'wp_review_heading', true );
|
30 |
// $available_types = apply_filters('wp_review_metabox_types', wp_review_get_review_types() );
|
31 |
$available_types = wp_review_get_rating_types();
|
32 |
+
$schemas = wp_review_schema_types();
|
33 |
|
34 |
$rating_schema = wp_review_get_rating_schema( $post->ID );
|
35 |
$custom_author = get_post_meta( $post->ID, 'wp_review_custom_author', true );
|
75 |
</select>
|
76 |
<input type="hidden" name="wp_review_type" value="<?php echo esc_attr( $type_post_value ); ?>">
|
77 |
|
78 |
+
<span id="wp_review_id_hint">
|
79 |
+
<?php
|
80 |
+
// translators: review ID.
|
81 |
+
printf( esc_html__( 'Review ID: %s', 'wp-review' ), '<strong>' . intval( $post->ID ) . '</strong>' );
|
82 |
+
?>
|
83 |
+
</span>
|
84 |
</div>
|
85 |
</div>
|
86 |
|
124 |
</select>
|
125 |
</div>
|
126 |
</div>
|
127 |
+
<div id="wp_review_schema_author_wrapper"<?php if ( 'author' !== $rating_schema ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
128 |
<div class="wp-review-field">
|
129 |
<div class="wp-review-field-label">
|
130 |
<label><?php esc_html_e( 'Custom Author', 'wp-review' ); ?></label>
|
131 |
</div>
|
132 |
<div class="wp-review-field-option">
|
133 |
<?php
|
134 |
+
$form_field->render_switch(
|
135 |
+
array(
|
136 |
+
'id' => 'wp_review_custom_author',
|
137 |
+
'name' => 'wp_review_custom_author',
|
138 |
+
'value' => $custom_author,
|
139 |
+
)
|
140 |
+
);
|
141 |
?>
|
142 |
</div>
|
143 |
</div>
|
144 |
|
145 |
+
<div class="wp-review-author-options"<?php if ( empty( $custom_author ) ) echo ' style="display: none;"'; // phpcs:ignore ?>>
|
146 |
<div class="wp-review-field">
|
147 |
<div class="wp-review-field-label">
|
148 |
<label for="wp_review_author"><?php esc_html_e( 'Review Author', 'wp-review' ); ?></label>
|
164 |
|
165 |
<div class="wp-review-field-option">
|
166 |
<?php
|
167 |
+
$form_field->render_switch(
|
168 |
+
array(
|
169 |
+
'id' => 'wp_review_show_schema_data',
|
170 |
+
'name' => 'wp_review_show_schema_data',
|
171 |
+
'disabled' => true,
|
172 |
+
)
|
173 |
+
);
|
174 |
?>
|
175 |
</div>
|
176 |
</div>
|
184 |
|
185 |
<div class="wp-review-field-option">
|
186 |
<?php
|
187 |
+
$form_field->render_switch(
|
188 |
+
array(
|
189 |
+
'id' => 'wp_review_enable_embed',
|
190 |
+
'name' => 'wp_review_enable_embed',
|
191 |
+
'disabled' => true,
|
192 |
+
)
|
193 |
+
);
|
194 |
?>
|
195 |
</div>
|
196 |
</div>
|
218 |
</div><!-- End #popup -->
|
219 |
<?php } ?>
|
220 |
|
221 |
+
<?php if ( ! wp_review_network_option( 'hide_notification_bar_' ) && current_user_can( 'wp_review_notification_bar' ) ) { ?>
|
222 |
<div id="hello-bar" class="tab-content wp-review-hello-bar" style="display: none;">
|
223 |
<div class="wp-review-field">
|
224 |
<div class="wp-review-field-label">
|
box-templates/global/partials/review-schema.php
CHANGED
@@ -14,8 +14,8 @@ $schema = wp_review_get_schema_type_data( $review['schema'] );
|
|
14 |
if ( ! $schema ) {
|
15 |
return;
|
16 |
}
|
17 |
-
$fields
|
18 |
-
$image
|
19 |
$schema_data = ! empty( $review['schema_data'][ $review['schema'] ] ) ? (array) $review['schema_data'][ $review['schema'] ] : array();
|
20 |
?>
|
21 |
<div class="reviewed-item">
|
@@ -33,9 +33,9 @@ $schema_data = ! empty( $review['schema_data'][ $review['schema'] ] ) ? (array)
|
|
33 |
|
34 |
if ( 'image' === $data['name'] && ! isset( $data['part_of'] ) ) {
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
continue;
|
40 |
}
|
41 |
|
@@ -45,15 +45,15 @@ $schema_data = ! empty( $review['schema_data'][ $review['schema'] ] ) ? (array)
|
|
45 |
}
|
46 |
|
47 |
if ( 'url' === $data['name'] && ! isset( $data['part_of'] ) ) {
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
continue;
|
58 |
}
|
59 |
|
14 |
if ( ! $schema ) {
|
15 |
return;
|
16 |
}
|
17 |
+
$fields = wp_review_get_schema_fields( $schema );
|
18 |
+
$image = $reviewed_item_data = $url = '';
|
19 |
$schema_data = ! empty( $review['schema_data'][ $review['schema'] ] ) ? (array) $review['schema_data'][ $review['schema'] ] : array();
|
20 |
?>
|
21 |
<div class="reviewed-item">
|
33 |
|
34 |
if ( 'image' === $data['name'] && ! isset( $data['part_of'] ) ) {
|
35 |
|
36 |
+
if ( ! empty( $schema_data['image']['id'] ) ) {
|
37 |
+
$image = wp_get_attachment_image( $schema_data['image']['id'], apply_filters( 'wp_review_item_reviewed_image_size', 'medium' ) );
|
38 |
+
}
|
39 |
continue;
|
40 |
}
|
41 |
|
45 |
}
|
46 |
|
47 |
if ( 'url' === $data['name'] && ! isset( $data['part_of'] ) ) {
|
48 |
+
if ( ! empty( $schema_data['url'] ) ) {
|
49 |
+
$more_text = ! empty( $schema_data['more_text'] ) ? $schema_data['more_text'] : __( '[ More ]', 'wp-review' );
|
50 |
+
$link = '<a href="' . esc_url( $schema_data['url'] ) . '" class="reviewed-item-link">' . esc_html( $more_text ) . '</a>';
|
51 |
+
if ( ! empty( $schema_data['use_button_style'] ) ) {
|
52 |
+
$url = '<ul class="review-links" style="padding-left: 0; padding-right: 0;"><li>' . $link . '</li></ul>';
|
53 |
+
} else {
|
54 |
+
$url = '<p>' . $link . '</p>';
|
55 |
+
}
|
56 |
+
}
|
57 |
continue;
|
58 |
}
|
59 |
|
comments/comments.php
CHANGED
@@ -3,15 +3,17 @@
|
|
3 |
* The template for displaying the comments.
|
4 |
*
|
5 |
* This contains both the comments and the comment form.
|
|
|
|
|
6 |
*/
|
7 |
|
8 |
-
// Do not delete these lines
|
9 |
if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
|
10 |
-
die
|
11 |
}
|
12 |
-
|
13 |
if ( post_password_required() ) { ?>
|
14 |
-
<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'wp-review' ); ?></p>
|
15 |
<?php
|
16 |
return;
|
17 |
}
|
@@ -21,16 +23,20 @@ if ( post_password_required() ) { ?>
|
|
21 |
<div id="comments">
|
22 |
<h4 class="total-comments"><?php comments_number( __( 'No Responses', 'wp-review' ), __( 'One Response', 'wp-review' ), __( '% Comments', 'wp-review' ) ); ?></h4>
|
23 |
<ol class="commentlist">
|
24 |
-
<?php
|
|
|
|
|
25 |
<div class="navigation">
|
26 |
<div class="alignleft"><?php previous_comments_link(); ?></div>
|
27 |
<div class="alignright"><?php next_comments_link(); ?></div>
|
28 |
</div>
|
29 |
-
|
30 |
-
|
|
|
31 |
wp_list_comments( 'callback=wp_review_comments' );
|
32 |
-
|
33 |
-
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { //
|
|
|
34 |
<div class="navigation">
|
35 |
<div class="alignleft"><?php previous_comments_link(); ?></div>
|
36 |
<div class="alignright"><?php next_comments_link(); ?></div>
|
@@ -46,24 +52,23 @@ if ( post_password_required() ) { ?>
|
|
46 |
<?php
|
47 |
global $aria_req;
|
48 |
$comments_args = array(
|
49 |
-
'title_reply'
|
50 |
'comment_notes_before' => '',
|
51 |
-
'comment_notes_after'
|
52 |
-
'label_submit'
|
53 |
-
'comment_field'
|
54 |
-
'fields'
|
55 |
'comment_form_default_fields',
|
56 |
array(
|
57 |
-
'author'
|
58 |
-
'email'
|
59 |
-
'url'
|
60 |
-
'cookies' => '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"
|
61 |
-
'<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>',
|
62 |
)
|
63 |
-
)
|
64 |
);
|
65 |
comment_form( $comments_args );
|
66 |
?>
|
67 |
</div>
|
68 |
</div>
|
69 |
-
<?php endif; // if you delete this the sky will fall on your head ?>
|
3 |
* The template for displaying the comments.
|
4 |
*
|
5 |
* This contains both the comments and the comment form.
|
6 |
+
*
|
7 |
+
* @package WP_Review
|
8 |
*/
|
9 |
|
10 |
+
// Do not delete these lines.
|
11 |
if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && 'comments.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
|
12 |
+
die( __( 'Please do not load this page directly. Thanks!', 'wp-review' ) );
|
13 |
}
|
14 |
+
|
15 |
if ( post_password_required() ) { ?>
|
16 |
+
<p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.', 'wp-review' ); ?></p>
|
17 |
<?php
|
18 |
return;
|
19 |
}
|
23 |
<div id="comments">
|
24 |
<h4 class="total-comments"><?php comments_number( __( 'No Responses', 'wp-review' ), __( 'One Response', 'wp-review' ), __( '% Comments', 'wp-review' ) ); ?></h4>
|
25 |
<ol class="commentlist">
|
26 |
+
<?php
|
27 |
+
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through.
|
28 |
+
?>
|
29 |
<div class="navigation">
|
30 |
<div class="alignleft"><?php previous_comments_link(); ?></div>
|
31 |
<div class="alignright"><?php next_comments_link(); ?></div>
|
32 |
</div>
|
33 |
+
<?php
|
34 |
+
}
|
35 |
+
|
36 |
wp_list_comments( 'callback=wp_review_comments' );
|
37 |
+
|
38 |
+
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through.
|
39 |
+
?>
|
40 |
<div class="navigation">
|
41 |
<div class="alignleft"><?php previous_comments_link(); ?></div>
|
42 |
<div class="alignright"><?php next_comments_link(); ?></div>
|
52 |
<?php
|
53 |
global $aria_req;
|
54 |
$comments_args = array(
|
55 |
+
'title_reply' => '<h4>' . __( 'Leave a Reply', 'wp-review' ) . '</h4>',
|
56 |
'comment_notes_before' => '',
|
57 |
+
'comment_notes_after' => '',
|
58 |
+
'label_submit' => __( 'Post Comment', 'wp-review' ),
|
59 |
+
'comment_field' => '<p class="comment-form-comment"><label for="comment" class="review-comment-field-msg">' . __( 'Comment*', 'wp-review' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
|
60 |
+
'fields' => apply_filters(
|
61 |
'comment_form_default_fields',
|
62 |
array(
|
63 |
+
'author' => '<p class="comment-form-author">' . ( $req ? '' : '' ) . '<label for="author" class="review-comment-field-msg">' . __( 'Name*', 'wp-review' ) . '</label><input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
|
64 |
+
'email' => '<p class="comment-form-email">' . ( $req ? '' : '' ) . '<label for="email" class="review-comment-field-msg">' . __( 'Email*', 'wp-review' ) . '</label><input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
|
65 |
+
'url' => '<p class="comment-form-url"><label for="url" class="review-comment-field-msg">' . __( 'Website', 'wp-review' ) . '</label><input id="url" name="url" type="text" value="' . esc_url( $commenter['comment_author_url'] ) . '" size="30" /></p>',
|
66 |
+
'cookies' => '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" /><label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>',
|
|
|
67 |
)
|
68 |
+
),
|
69 |
);
|
70 |
comment_form( $comments_args );
|
71 |
?>
|
72 |
</div>
|
73 |
</div>
|
74 |
+
<?php endif; // if you delete this the sky will fall on your head. ?>
|
includes/ajax.php
CHANGED
@@ -7,8 +7,10 @@
|
|
7 |
*/
|
8 |
|
9 |
/* Get review with Ajax */
|
10 |
-
|
11 |
-
|
|
|
|
|
12 |
|
13 |
add_action( 'wp_ajax_wp_review_rate', 'wp_review_ajax_rate' );
|
14 |
add_action( 'wp_ajax_nopriv_wp_review_rate', 'wp_review_ajax_rate' );
|
@@ -29,24 +31,23 @@ add_action( 'wp_ajax_nopriv_wpr-upload-comment-image', 'wp_review_upload_comment
|
|
29 |
/**
|
30 |
* Upload Comment Image with Ajax.
|
31 |
*/
|
32 |
-
|
33 |
function wp_review_upload_comment_image() {
|
34 |
|
35 |
-
$files
|
36 |
$attachment_id = '';
|
37 |
-
if( !empty($files) ) {
|
38 |
-
$file_data['name']
|
39 |
-
$file_data['type']
|
40 |
$file_data['tmp_name'] = $files['tmp_name'][0];
|
41 |
-
$file_data['error']
|
42 |
-
$file_data['size']
|
43 |
|
44 |
-
//
|
45 |
-
require_once
|
46 |
-
require_once
|
47 |
-
require_once
|
48 |
|
49 |
-
$attachment_id = media_handle_sideload( $file_data, 0);
|
50 |
if ( is_wp_error( $attachment_id ) ) {
|
51 |
$attachment_id = false;
|
52 |
}
|
@@ -64,7 +65,7 @@ function mts_review_get_review() {
|
|
64 |
|
65 |
$post_id = intval( $_POST['post_id'] );
|
66 |
$user_id = is_user_logged_in() ? get_current_user_id() : 0;
|
67 |
-
$review
|
68 |
|
69 |
$review_text = $review;
|
70 |
|
@@ -86,18 +87,21 @@ function mts_review_get_review() {
|
|
86 |
! wp_review_has_reviewed( $post_id, $user_id, $uip, WP_REVIEW_COMMENT_TYPE_VISITOR ) &&
|
87 |
( is_user_logged_in() || ! wp_review_option( 'registered_only' ) )
|
88 |
) {
|
89 |
-
$insert = wp_insert_comment(
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
101 |
|
102 |
if ( $insert ) {
|
103 |
if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review ) ) {
|
@@ -122,9 +126,9 @@ function mts_review_get_review() {
|
|
122 |
*/
|
123 |
function wp_review_ajax_rate() {
|
124 |
check_ajax_referer( 'wp-review-security', 'nonce' );
|
125 |
-
$post_id
|
126 |
-
$review
|
127 |
-
$review
|
128 |
$review_data = array(
|
129 |
'total' => $review,
|
130 |
);
|
@@ -148,7 +152,7 @@ function wp_review_ajax_migrate_ratings() {
|
|
148 |
|
149 |
$current_blog_id = get_current_blog_id();
|
150 |
|
151 |
-
$query = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->base_prefix . 'mts_wp_reviews WHERE blog_id = ' . $current_blog_id . ' LIMIT ' . $limit . ' OFFSET ' . $start );
|
152 |
|
153 |
foreach ( $query as $review ) {
|
154 |
|
@@ -156,17 +160,27 @@ function wp_review_ajax_migrate_ratings() {
|
|
156 |
continue; // Skip 0-star ratings.
|
157 |
}
|
158 |
|
159 |
-
$insert = wp_insert_comment(
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
|
171 |
if ( $insert ) {
|
172 |
if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review->rate ) ) {
|
@@ -178,23 +192,25 @@ function wp_review_ajax_migrate_ratings() {
|
|
178 |
}
|
179 |
}
|
180 |
|
181 |
-
$end = $start + count( $query );
|
182 |
-
|
183 |
update_option( 'wp_review_migrated_rows', $end );
|
184 |
|
185 |
-
$total_rows
|
186 |
$migration_finished = 0;
|
187 |
if ( $total_rows == $end ) {
|
188 |
update_option( 'wp_review_has_migrated', 1 );
|
189 |
$migration_finished = 1;
|
190 |
}
|
191 |
|
192 |
-
echo wp_json_encode(
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
|
|
|
|
198 |
|
199 |
die();
|
200 |
}
|
@@ -207,14 +223,17 @@ function wp_review_ajax_load_reviews() {
|
|
207 |
$options = $_POST; // WPCS: csrf ok.
|
208 |
|
209 |
// Options are same as widgets args to keep compatibility.
|
210 |
-
$options = wp_parse_args(
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
|
|
|
|
|
|
218 |
|
219 |
$type = ! empty( $options['_type'] ) ? $options['_type'] : 'recent';
|
220 |
|
@@ -224,9 +243,9 @@ function wp_review_ajax_load_reviews() {
|
|
224 |
wp_send_json_success( '' );
|
225 |
}
|
226 |
|
227 |
-
$page
|
228 |
-
$last_page
|
229 |
-
$in_widget
|
230 |
$GLOBALS['in_widget'] = $in_widget;
|
231 |
|
232 |
ob_start();
|
@@ -238,7 +257,7 @@ function wp_review_ajax_load_reviews() {
|
|
238 |
if ( ! has_post_thumbnail() ) {
|
239 |
$classes[] = 'wp-review-no-thumbnail';
|
240 |
}
|
241 |
-
$classes
|
242 |
?>
|
243 |
<li class="item">
|
244 |
<a title="<?php the_title(); ?>" rel="nofollow" href="<?php the_permalink(); ?>">
|
@@ -300,19 +319,22 @@ function wp_review_ajax_load_reviews() {
|
|
300 |
*
|
301 |
* @since 3.0.8
|
302 |
*
|
303 |
-
* @param int
|
304 |
-
* @param int
|
305 |
-
* @param
|
306 |
*/
|
307 |
function wp_review_extra_info( $post_id, $extra_info, array $args = array() ) {
|
308 |
if ( ! $extra_info ) {
|
309 |
return;
|
310 |
}
|
311 |
|
312 |
-
$args = wp_parse_args(
|
313 |
-
|
314 |
-
|
315 |
-
|
|
|
|
|
|
|
316 |
|
317 |
if ( 1 === $extra_info ) {
|
318 |
?>
|
@@ -328,8 +350,10 @@ function wp_review_extra_info( $post_id, $extra_info, array $args = array() ) {
|
|
328 |
<div class="<?php echo esc_attr( $args['class'] ); ?>">
|
329 |
<?php
|
330 |
if ( ! $post_reviews['count'] ) {
|
|
|
331 |
printf( __( '%s review', 'wp-review' ), 0 );
|
332 |
} else {
|
|
|
333 |
printf( _n( '%s review', '%s reviews', $post_reviews['count'], 'wp-review' ), $post_reviews['count'] );
|
334 |
}
|
335 |
?>
|
@@ -355,8 +379,8 @@ function wp_review_ajax_visitor_features_rating() {
|
|
355 |
wp_send_json_error( __( 'Empty type data', 'wp-review' ) );
|
356 |
}
|
357 |
$post_id = intval( $_POST['post_id'] );
|
358 |
-
$rating
|
359 |
-
$type
|
360 |
|
361 |
$total = 0;
|
362 |
$count = 0;
|
@@ -366,8 +390,8 @@ function wp_review_ajax_visitor_features_rating() {
|
|
366 |
}
|
367 |
|
368 |
$review_data = array(
|
369 |
-
'total'
|
370 |
-
'type'
|
371 |
'features' => $rating,
|
372 |
);
|
373 |
wp_review_visitor_rate( $post_id, $review_data );
|
7 |
*/
|
8 |
|
9 |
/* Get review with Ajax */
|
10 |
+
|
11 |
+
/* add_action('wp_ajax_mts_review_get_review', 'mts_review_get_review'); */
|
12 |
+
|
13 |
+
/* add_action('wp_ajax_nopriv_mts_review_get_review', 'mts_review_get_review'); */
|
14 |
|
15 |
add_action( 'wp_ajax_wp_review_rate', 'wp_review_ajax_rate' );
|
16 |
add_action( 'wp_ajax_nopriv_wp_review_rate', 'wp_review_ajax_rate' );
|
31 |
/**
|
32 |
* Upload Comment Image with Ajax.
|
33 |
*/
|
|
|
34 |
function wp_review_upload_comment_image() {
|
35 |
|
36 |
+
$files = array_filter( $_FILES['files'] );
|
37 |
$attachment_id = '';
|
38 |
+
if ( ! empty( $files ) ) {
|
39 |
+
$file_data['name'] = $files['name'][0];
|
40 |
+
$file_data['type'] = $files['type'][0];
|
41 |
$file_data['tmp_name'] = $files['tmp_name'][0];
|
42 |
+
$file_data['error'] = $files['error'][0];
|
43 |
+
$file_data['size'] = $files['size'][0];
|
44 |
|
45 |
+
// These files need to be included as dependencies when on the front end.
|
46 |
+
require_once ABSPATH . 'wp-admin/includes/image.php';
|
47 |
+
require_once ABSPATH . 'wp-admin/includes/file.php';
|
48 |
+
require_once ABSPATH . 'wp-admin/includes/media.php';
|
49 |
|
50 |
+
$attachment_id = media_handle_sideload( $file_data, 0 );
|
51 |
if ( is_wp_error( $attachment_id ) ) {
|
52 |
$attachment_id = false;
|
53 |
}
|
65 |
|
66 |
$post_id = intval( $_POST['post_id'] );
|
67 |
$user_id = is_user_logged_in() ? get_current_user_id() : 0;
|
68 |
+
$review = round( abs( filter_input( INPUT_POST, 'review' ) ), 2 );
|
69 |
|
70 |
$review_text = $review;
|
71 |
|
87 |
! wp_review_has_reviewed( $post_id, $user_id, $uip, WP_REVIEW_COMMENT_TYPE_VISITOR ) &&
|
88 |
( is_user_logged_in() || ! wp_review_option( 'registered_only' ) )
|
89 |
) {
|
90 |
+
$insert = wp_insert_comment(
|
91 |
+
array(
|
92 |
+
'user_id' => $user_id,
|
93 |
+
'comment_type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
|
94 |
+
'comment_post_ID' => $post_id,
|
95 |
+
'comment_parent' => 0,
|
96 |
+
'comment_author_IP' => $uip,
|
97 |
+
// translators: review text.
|
98 |
+
'comment_content' => sprintf( __( 'Visitor Rating: %s', 'wp-review' ), $review_text ),
|
99 |
+
'comment_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '',
|
100 |
+
'comment_date' => current_time( 'mysql' ),
|
101 |
+
'comment_date_gmt' => current_time( 'mysql', 1 ),
|
102 |
+
'comment_approved' => 1,
|
103 |
+
)
|
104 |
+
);
|
105 |
|
106 |
if ( $insert ) {
|
107 |
if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review ) ) {
|
126 |
*/
|
127 |
function wp_review_ajax_rate() {
|
128 |
check_ajax_referer( 'wp-review-security', 'nonce' );
|
129 |
+
$post_id = intval( $_POST['post_id'] );
|
130 |
+
$review = filter_input( INPUT_POST, 'review' );
|
131 |
+
$review = round( $review, 2 );
|
132 |
$review_data = array(
|
133 |
'total' => $review,
|
134 |
);
|
152 |
|
153 |
$current_blog_id = get_current_blog_id();
|
154 |
|
155 |
+
$query = $wpdb->get_results( 'SELECT * FROM ' . $wpdb->base_prefix . 'mts_wp_reviews WHERE blog_id = ' . $current_blog_id . ' LIMIT ' . $limit . ' OFFSET ' . $start ); // WPCS: unprepared SQL ok.
|
156 |
|
157 |
foreach ( $query as $review ) {
|
158 |
|
160 |
continue; // Skip 0-star ratings.
|
161 |
}
|
162 |
|
163 |
+
$insert = wp_insert_comment(
|
164 |
+
array(
|
165 |
+
'user_id' => $review->user_id,
|
166 |
+
'comment_type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
|
167 |
+
'comment_post_ID' => $review->post_id,
|
168 |
+
'comment_parent' => 0,
|
169 |
+
'comment_content' => sprintf(
|
170 |
+
// translators: visitors rating.
|
171 |
+
__( 'Visitor Rating: %s', 'wp-review' ),
|
172 |
+
sprintf(
|
173 |
+
// translators: review rate.
|
174 |
+
__( '%s Stars', 'wp-review' ),
|
175 |
+
$review->rate
|
176 |
+
)
|
177 |
+
),
|
178 |
+
'comment_author_IP' => $review->user_ip,
|
179 |
+
'comment_date' => gmdate( 'Y-m-d H:i:s', ( strtotime( $review->date ) + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) ),
|
180 |
+
'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', strtotime( $review->date ) ),
|
181 |
+
'comment_approved' => 1,
|
182 |
+
)
|
183 |
+
);
|
184 |
|
185 |
if ( $insert ) {
|
186 |
if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review->rate ) ) {
|
192 |
}
|
193 |
}
|
194 |
|
195 |
+
$end = $start + count( $query ); // $wpdb->num_rows;
|
196 |
+
// $migrated_rows = get_option( 'wp_review_migrated_rows', 0 );
|
197 |
update_option( 'wp_review_migrated_rows', $end );
|
198 |
|
199 |
+
$total_rows = $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->base_prefix . 'mts_wp_reviews WHERE blog_id = ' . $current_blog_id ); // WPCS: unprepared SQL ok.
|
200 |
$migration_finished = 0;
|
201 |
if ( $total_rows == $end ) {
|
202 |
update_option( 'wp_review_has_migrated', 1 );
|
203 |
$migration_finished = 1;
|
204 |
}
|
205 |
|
206 |
+
echo wp_json_encode(
|
207 |
+
array(
|
208 |
+
'start' => $start,
|
209 |
+
'lastrow' => $end,
|
210 |
+
'rowsleft' => $total_rows - $end,
|
211 |
+
'finished' => $migration_finished,
|
212 |
+
)
|
213 |
+
);
|
214 |
|
215 |
die();
|
216 |
}
|
223 |
$options = $_POST; // WPCS: csrf ok.
|
224 |
|
225 |
// Options are same as widgets args to keep compatibility.
|
226 |
+
$options = wp_parse_args(
|
227 |
+
$options,
|
228 |
+
array(
|
229 |
+
'post_num' => 5,
|
230 |
+
'page' => 1,
|
231 |
+
'review_type' => '',
|
232 |
+
'thumb_size' => 'small',
|
233 |
+
'cat' => '',
|
234 |
+
'number_of_days' => '',
|
235 |
+
)
|
236 |
+
);
|
237 |
|
238 |
$type = ! empty( $options['_type'] ) ? $options['_type'] : 'recent';
|
239 |
|
243 |
wp_send_json_success( '' );
|
244 |
}
|
245 |
|
246 |
+
$page = ! empty( $options['page'] ) ? intval( $options['page'] ) : 1;
|
247 |
+
$last_page = $query->max_num_pages;
|
248 |
+
$in_widget = ! empty( $options['widget_id'] );
|
249 |
$GLOBALS['in_widget'] = $in_widget;
|
250 |
|
251 |
ob_start();
|
257 |
if ( ! has_post_thumbnail() ) {
|
258 |
$classes[] = 'wp-review-no-thumbnail';
|
259 |
}
|
260 |
+
$classes = implode( ' ', $classes );
|
261 |
?>
|
262 |
<li class="item">
|
263 |
<a title="<?php the_title(); ?>" rel="nofollow" href="<?php the_permalink(); ?>">
|
319 |
*
|
320 |
* @since 3.0.8
|
321 |
*
|
322 |
+
* @param int $post_id Post ID.
|
323 |
+
* @param int $extra_info Extra info. 1 for date, 2 for reviews count, 0 for none.
|
324 |
+
* @param array $args Custom args.
|
325 |
*/
|
326 |
function wp_review_extra_info( $post_id, $extra_info, array $args = array() ) {
|
327 |
if ( ! $extra_info ) {
|
328 |
return;
|
329 |
}
|
330 |
|
331 |
+
$args = wp_parse_args(
|
332 |
+
$args,
|
333 |
+
array(
|
334 |
+
'class' => 'postmeta',
|
335 |
+
'date_format' => get_option( 'date_format' ),
|
336 |
+
)
|
337 |
+
);
|
338 |
|
339 |
if ( 1 === $extra_info ) {
|
340 |
?>
|
350 |
<div class="<?php echo esc_attr( $args['class'] ); ?>">
|
351 |
<?php
|
352 |
if ( ! $post_reviews['count'] ) {
|
353 |
+
// translators: number of reviews.
|
354 |
printf( __( '%s review', 'wp-review' ), 0 );
|
355 |
} else {
|
356 |
+
// translators: number of reviews.
|
357 |
printf( _n( '%s review', '%s reviews', $post_reviews['count'], 'wp-review' ), $post_reviews['count'] );
|
358 |
}
|
359 |
?>
|
379 |
wp_send_json_error( __( 'Empty type data', 'wp-review' ) );
|
380 |
}
|
381 |
$post_id = intval( $_POST['post_id'] );
|
382 |
+
$rating = $_POST['rating']; // WPCS: sanitization ok.
|
383 |
+
$type = wp_kses( wp_unslash( $_POST['type'] ), array() );
|
384 |
|
385 |
$total = 0;
|
386 |
$count = 0;
|
390 |
}
|
391 |
|
392 |
$review_data = array(
|
393 |
+
'total' => $total / $count,
|
394 |
+
'type' => $type,
|
395 |
'features' => $rating,
|
396 |
);
|
397 |
wp_review_visitor_rate( $post_id, $review_data );
|
includes/comments.php
CHANGED
@@ -1,14 +1,28 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
3 |
function wp_review_override_comments_count() {
|
4 |
remove_filter( 'get_comments_number', 'mts_comment_count', 0 );
|
5 |
add_filter( 'get_comments_number', 'wp_review_comment_count', 0 );
|
6 |
}
|
7 |
add_action( 'after_setup_theme', 'wp_review_override_comments_count', 30 );
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
function wp_review_comment_count( $count ) {
|
10 |
if ( ! is_admin() ) {
|
11 |
-
$comments
|
12 |
$comments_by_type = separate_comments( $comments );
|
13 |
if ( isset( $comments_by_type['comment'] ) ) {
|
14 |
$wp_review_comments_count = isset( $comments_by_type['wp_review_comment'] ) ? count( $comments_by_type['wp_review_comment'] ) : 0;
|
@@ -31,10 +45,23 @@ function wp_review_comment_add_meta_box() {
|
|
31 |
if ( ! $type ) {
|
32 |
$type = 'star';
|
33 |
}
|
34 |
-
add_meta_box(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
add_action( 'add_meta_boxes_comment', 'wp_review_comment_add_meta_box' );
|
37 |
|
|
|
|
|
|
|
|
|
|
|
38 |
function wp_review_comment_meta_box_fields( $comment ) {
|
39 |
$comment_id = $comment->comment_ID;
|
40 |
if ( WP_REVIEW_COMMENT_TYPE_COMMENT === get_comment_type( $comment_id ) ) {
|
@@ -42,19 +69,10 @@ function wp_review_comment_meta_box_fields( $comment ) {
|
|
42 |
} else {
|
43 |
$rating = get_comment_meta( $comment_id, WP_REVIEW_VISITOR_RATING_METAKEY, true );
|
44 |
}
|
45 |
-
$title
|
46 |
$rating_items = get_comment_meta( $comment_id, WP_REVIEW_COMMENT_FEATURES_RATING_METAKEY, true );
|
47 |
wp_nonce_field( 'wp_review_comment_rating_update', 'wp_review_comment_rating_update', false );
|
48 |
?>
|
49 |
-
<div class="wp-review-field">
|
50 |
-
<div class="wp-review-field-label">
|
51 |
-
<label for="wp_review_comment_title"><?php esc_html_e( 'Review Title', 'wp-review' ); ?></label>
|
52 |
-
</div>
|
53 |
-
<div class="wp-review-field-option">
|
54 |
-
<input type="text" name="wp_review_comment_title" value="<?php echo esc_attr( $title ); ?>" id="wp_review_comment_title">
|
55 |
-
</div>
|
56 |
-
</div>
|
57 |
-
|
58 |
<div class="wp-review-field">
|
59 |
<div class="wp-review-field-label">
|
60 |
<label for="wp_review_comment_rating"><?php esc_html_e( 'Review total', 'wp-review' ); ?></label>
|
@@ -64,7 +82,8 @@ function wp_review_comment_meta_box_fields( $comment ) {
|
|
64 |
</div>
|
65 |
</div>
|
66 |
|
67 |
-
<?php
|
|
|
68 |
$items = wp_review_get_review_items( $comment->comment_post_ID );
|
69 |
foreach ( $items as $item_id => $item ) :
|
70 |
$value = ! empty( $rating_items[ $item_id ] ) ? $rating_items[ $item_id ] : 0;
|
@@ -81,34 +100,36 @@ function wp_review_comment_meta_box_fields( $comment ) {
|
|
81 |
<?php endif; ?>
|
82 |
|
83 |
<?php
|
84 |
-
$comment_qualifier
|
85 |
-
$comment_image
|
86 |
$comment_image_name = 'wp_review_comment_attachment_url';
|
87 |
-
if(
|
88 |
$comment_image = get_comment_meta( $comment_id, 'wp_review_comment_attachment_src', true );
|
89 |
-
if($comment_image) {
|
90 |
$comment_image_name = 'wp_review_comment_attachment_src';
|
91 |
}
|
92 |
}
|
93 |
|
94 |
-
if($comment_qualifier) {
|
95 |
?>
|
96 |
<div class="wp-review-field">
|
97 |
<div class="wp-review-field-label">
|
98 |
-
<label for="wp_review_comment_qualifier"><?php echo apply_filters('wp_review_comment_qualifier', __('Does Product Matches the Description?', 'wp-review')); ?></label>
|
99 |
</div>
|
100 |
<div class="wp-review-field-option">
|
101 |
<select id="wp_review_comment_qualifier" name="wp_review_comment_qualifier">
|
102 |
-
<option value=""><?php _e('Select', 'wp-review'); ?></option>
|
103 |
-
<option value="yes" <?php selected($comment_qualifier, 'yes', true); ?>><?php _e('Yes', 'wp-review'); ?></option>
|
104 |
-
<option value="no" <?php selected($comment_qualifier, 'no', true); ?>><?php _e('No', 'wp-review'); ?></option>
|
105 |
</select>
|
106 |
</div>
|
107 |
</div>
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
112 |
}
|
113 |
?>
|
114 |
<div class="wp-review-field">
|
@@ -116,7 +137,7 @@ function wp_review_comment_meta_box_fields( $comment ) {
|
|
116 |
<label for="wp_review_comment_image"><?php esc_html_e( 'Comment Image', 'wp-review' ); ?></label>
|
117 |
</div>
|
118 |
<div class="wp-review-field-option">
|
119 |
-
<input type="text" name="<?php echo esc_attr($comment_image_name) ?>" value="<?php echo esc_attr($comment_image); ?>" />
|
120 |
</div>
|
121 |
</div>
|
122 |
<?php } ?>
|
@@ -125,7 +146,9 @@ function wp_review_comment_meta_box_fields( $comment ) {
|
|
125 |
}
|
126 |
|
127 |
/**
|
128 |
-
* Save our comment (from the admin area)
|
|
|
|
|
129 |
*/
|
130 |
function wp_review_comment_edit_comment( $comment_id ) {
|
131 |
if (
|
@@ -144,16 +167,9 @@ function wp_review_comment_edit_comment( $comment_id ) {
|
|
144 |
|
145 |
$rating = filter_input( INPUT_POST, 'wp_review_comment_rating', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
wp_review_clear_cached_reviews( $comment );
|
151 |
-
// }
|
152 |
-
|
153 |
-
if ( ! empty( $_POST['wp_review_comment_title'] ) ) {
|
154 |
-
$title = sanitize_text_field( wp_unslash( $_POST['wp_review_comment_title'] ) );
|
155 |
-
update_comment_meta( $comment_id, WP_REVIEW_COMMENT_TITLE_METAKEY, $title );
|
156 |
-
}
|
157 |
|
158 |
if ( ! empty( $_POST['wp_review_comment_pros'] ) ) {
|
159 |
update_comment_meta( $comment_id, 'wp_review_comment_pros', wp_kses_post( wp_unslash( $_POST['wp_review_comment_pros'] ) ) );
|
@@ -238,7 +254,14 @@ function wp_review_comment_quick_edit_javascript() {
|
|
238 |
}
|
239 |
add_action( 'admin_footer-edit-comments.php', 'wp_review_comment_quick_edit_javascript' );
|
240 |
|
241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
$actions['quickedit'] = sprintf(
|
243 |
'<span class="quickedit hide-if-no-js"><a onclick="if (typeof(wpreview_expandedOpen) == \'function\') wpreview_expandedOpen(%1$s);" data-comment-id="%1$s" data-post-id="%2$s" data-action="edit" class="vim-q comment-inline" title="%3$s" href="#">%4$s</a></span>',
|
244 |
$comment->comment_ID,
|
@@ -250,7 +273,14 @@ function wp_review_comment_quick_edit_action($actions, $comment ) {
|
|
250 |
}
|
251 |
add_filter( 'comment_row_actions', 'wp_review_comment_quick_edit_action', 10, 2 );
|
252 |
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
function wp_review_comment_rating( $value, $comment_id = null, $args = array() ) {
|
255 |
global $post;
|
256 |
|
@@ -281,8 +311,8 @@ function wp_review_comment_rating( $value, $comment_id = null, $args = array() )
|
|
281 |
if ( $value > $rating_type['max'] ) {
|
282 |
$value = $rating_type['max'];
|
283 |
}
|
284 |
-
$template
|
285 |
-
$comment_rating
|
286 |
$args['show_one'] = true;
|
287 |
set_query_var( 'rating', compact( 'value', 'type', 'args', 'comment_rating', 'post_id', 'color', 'colors' ) );
|
288 |
ob_start();
|
@@ -293,7 +323,13 @@ function wp_review_comment_rating( $value, $comment_id = null, $args = array() )
|
|
293 |
}
|
294 |
|
295 |
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
function wp_review_update_comment_ratings( $new_status, $old_status, $comment ) {
|
298 |
if ( WP_REVIEW_COMMENT_TYPE_VISITOR === $comment->comment_type ) {
|
299 |
mts_get_post_reviews( $comment->comment_post_ID, true );
|
@@ -312,18 +348,21 @@ add_action( 'transition_comment_status', 'wp_review_update_comment_ratings', 10,
|
|
312 |
*/
|
313 |
function wp_review_add_comments_list_view( $views ) {
|
314 |
foreach ( $views as $key => $view ) {
|
315 |
-
$view
|
316 |
-
$view
|
317 |
$views[ $key ] = $view;
|
318 |
}
|
319 |
|
320 |
// Visitor reviews.
|
321 |
-
$url
|
322 |
-
$url
|
323 |
-
$count = get_comments(
|
324 |
-
|
325 |
-
|
326 |
-
|
|
|
|
|
|
|
327 |
$views['visitor_reviews'] = sprintf(
|
328 |
'<a href="%1$s" class="%2$s" aria-current="page">%3$s <span class="count">(<span class="all-count">%4$s</span>)</span></a>',
|
329 |
esc_url( $url ),
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Comments related functions
|
4 |
+
*
|
5 |
+
* @package WP_Review
|
6 |
+
*/
|
7 |
|
8 |
+
/**
|
9 |
+
* Overrides comments count.
|
10 |
+
*/
|
11 |
function wp_review_override_comments_count() {
|
12 |
remove_filter( 'get_comments_number', 'mts_comment_count', 0 );
|
13 |
add_filter( 'get_comments_number', 'wp_review_comment_count', 0 );
|
14 |
}
|
15 |
add_action( 'after_setup_theme', 'wp_review_override_comments_count', 30 );
|
16 |
|
17 |
+
/**
|
18 |
+
* Filters comment count.
|
19 |
+
*
|
20 |
+
* @param int $count Comment count.
|
21 |
+
* @return int
|
22 |
+
*/
|
23 |
function wp_review_comment_count( $count ) {
|
24 |
if ( ! is_admin() ) {
|
25 |
+
$comments = get_comments( 'status=approve&post_id=' . get_the_ID() );
|
26 |
$comments_by_type = separate_comments( $comments );
|
27 |
if ( isset( $comments_by_type['comment'] ) ) {
|
28 |
$wp_review_comments_count = isset( $comments_by_type['wp_review_comment'] ) ? count( $comments_by_type['wp_review_comment'] ) : 0;
|
45 |
if ( ! $type ) {
|
46 |
$type = 'star';
|
47 |
}
|
48 |
+
add_meta_box(
|
49 |
+
'wp-review-comment-rating',
|
50 |
+
// translators: rating label.
|
51 |
+
sprintf( __( 'WP Review Rating (%s)', 'wp-review' ), $wp_review_rating_types[ $type ]['label'] ),
|
52 |
+
'wp_review_comment_meta_box_fields',
|
53 |
+
'comment',
|
54 |
+
'normal',
|
55 |
+
'high'
|
56 |
+
);
|
57 |
}
|
58 |
add_action( 'add_meta_boxes_comment', 'wp_review_comment_add_meta_box' );
|
59 |
|
60 |
+
/**
|
61 |
+
* Shows comment meta box fields.
|
62 |
+
*
|
63 |
+
* @param object $comment Comment object.
|
64 |
+
*/
|
65 |
function wp_review_comment_meta_box_fields( $comment ) {
|
66 |
$comment_id = $comment->comment_ID;
|
67 |
if ( WP_REVIEW_COMMENT_TYPE_COMMENT === get_comment_type( $comment_id ) ) {
|
69 |
} else {
|
70 |
$rating = get_comment_meta( $comment_id, WP_REVIEW_VISITOR_RATING_METAKEY, true );
|
71 |
}
|
72 |
+
$title = get_comment_meta( $comment_id, WP_REVIEW_COMMENT_TITLE_METAKEY, true );
|
73 |
$rating_items = get_comment_meta( $comment_id, WP_REVIEW_COMMENT_FEATURES_RATING_METAKEY, true );
|
74 |
wp_nonce_field( 'wp_review_comment_rating_update', 'wp_review_comment_rating_update', false );
|
75 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
<div class="wp-review-field">
|
77 |
<div class="wp-review-field-label">
|
78 |
<label for="wp_review_comment_rating"><?php esc_html_e( 'Review total', 'wp-review' ); ?></label>
|
82 |
</div>
|
83 |
</div>
|
84 |
|
85 |
+
<?php
|
86 |
+
if ( ! empty( $rating_items ) ) :
|
87 |
$items = wp_review_get_review_items( $comment->comment_post_ID );
|
88 |
foreach ( $items as $item_id => $item ) :
|
89 |
$value = ! empty( $rating_items[ $item_id ] ) ? $rating_items[ $item_id ] : 0;
|
100 |
<?php endif; ?>
|
101 |
|
102 |
<?php
|
103 |
+
$comment_qualifier = get_comment_meta( $comment_id, 'wp_review_comment_qualifier', true );
|
104 |
+
$comment_image = get_comment_meta( $comment_id, 'wp_review_comment_attachment_url', true );
|
105 |
$comment_image_name = 'wp_review_comment_attachment_url';
|
106 |
+
if ( ! $comment_image ) {
|
107 |
$comment_image = get_comment_meta( $comment_id, 'wp_review_comment_attachment_src', true );
|
108 |
+
if ( $comment_image ) {
|
109 |
$comment_image_name = 'wp_review_comment_attachment_src';
|
110 |
}
|
111 |
}
|
112 |
|
113 |
+
if ( $comment_qualifier ) {
|
114 |
?>
|
115 |
<div class="wp-review-field">
|
116 |
<div class="wp-review-field-label">
|
117 |
+
<label for="wp_review_comment_qualifier"><?php echo apply_filters( 'wp_review_comment_qualifier', __( 'Does Product Matches the Description?', 'wp-review' ) ); ?></label>
|
118 |
</div>
|
119 |
<div class="wp-review-field-option">
|
120 |
<select id="wp_review_comment_qualifier" name="wp_review_comment_qualifier">
|
121 |
+
<option value=""><?php _e( 'Select', 'wp-review' ); ?></option>
|
122 |
+
<option value="yes" <?php selected( $comment_qualifier, 'yes', true ); ?>><?php _e( 'Yes', 'wp-review' ); ?></option>
|
123 |
+
<option value="no" <?php selected( $comment_qualifier, 'no', true ); ?>><?php _e( 'No', 'wp-review' ); ?></option>
|
124 |
</select>
|
125 |
</div>
|
126 |
</div>
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( $comment_image ) {
|
131 |
+
if ( is_numeric( $comment_image ) ) {
|
132 |
+
$comment_image = wp_get_attachment_url( $comment_image );
|
133 |
}
|
134 |
?>
|
135 |
<div class="wp-review-field">
|
137 |
<label for="wp_review_comment_image"><?php esc_html_e( 'Comment Image', 'wp-review' ); ?></label>
|
138 |
</div>
|
139 |
<div class="wp-review-field-option">
|
140 |
+
<input type="text" name="<?php echo esc_attr( $comment_image_name ); ?>" value="<?php echo esc_attr( $comment_image ); ?>" />
|
141 |
</div>
|
142 |
</div>
|
143 |
<?php } ?>
|
146 |
}
|
147 |
|
148 |
/**
|
149 |
+
* Save our comment (from the admin area).
|
150 |
+
*
|
151 |
+
* @param int $comment_id Comment ID.
|
152 |
*/
|
153 |
function wp_review_comment_edit_comment( $comment_id ) {
|
154 |
if (
|
167 |
|
168 |
$rating = filter_input( INPUT_POST, 'wp_review_comment_rating', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
|
169 |
|
170 |
+
$comment = get_comment( $comment_id );
|
171 |
+
update_comment_meta( $comment_id, $meta_key, $rating );
|
172 |
+
wp_review_clear_cached_reviews( $comment );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
if ( ! empty( $_POST['wp_review_comment_pros'] ) ) {
|
175 |
update_comment_meta( $comment_id, 'wp_review_comment_pros', wp_kses_post( wp_unslash( $_POST['wp_review_comment_pros'] ) ) );
|
254 |
}
|
255 |
add_action( 'admin_footer-edit-comments.php', 'wp_review_comment_quick_edit_javascript' );
|
256 |
|
257 |
+
/**
|
258 |
+
* Filters comment quick edit link.
|
259 |
+
*
|
260 |
+
* @param array $actions Comments list table actions.
|
261 |
+
* @param object $comment Comment object.
|
262 |
+
* @return array
|
263 |
+
*/
|
264 |
+
function wp_review_comment_quick_edit_action( $actions, $comment ) {
|
265 |
$actions['quickedit'] = sprintf(
|
266 |
'<span class="quickedit hide-if-no-js"><a onclick="if (typeof(wpreview_expandedOpen) == \'function\') wpreview_expandedOpen(%1$s);" data-comment-id="%1$s" data-post-id="%2$s" data-action="edit" class="vim-q comment-inline" title="%3$s" href="#">%4$s</a></span>',
|
267 |
$comment->comment_ID,
|
273 |
}
|
274 |
add_filter( 'comment_row_actions', 'wp_review_comment_quick_edit_action', 10, 2 );
|
275 |
|
276 |
+
/**
|
277 |
+
* Gets comments rating template.
|
278 |
+
*
|
279 |
+
* @param float $value Rating value.
|
280 |
+
* @param int $comment_id Comment ID.
|
281 |
+
* @param array $args Custom args.
|
282 |
+
* @return string
|
283 |
+
*/
|
284 |
function wp_review_comment_rating( $value, $comment_id = null, $args = array() ) {
|
285 |
global $post;
|
286 |
|
311 |
if ( $value > $rating_type['max'] ) {
|
312 |
$value = $rating_type['max'];
|
313 |
}
|
314 |
+
$template = $rating_type['output_template'];
|
315 |
+
$comment_rating = true;
|
316 |
$args['show_one'] = true;
|
317 |
set_query_var( 'rating', compact( 'value', 'type', 'args', 'comment_rating', 'post_id', 'color', 'colors' ) );
|
318 |
ob_start();
|
323 |
}
|
324 |
|
325 |
|
326 |
+
/**
|
327 |
+
* Update user ratings total if comment status is changed.
|
328 |
+
*
|
329 |
+
* @param string $new_status New status.
|
330 |
+
* @param string $old_status Old status.
|
331 |
+
* @param object $comment Comment object.
|
332 |
+
*/
|
333 |
function wp_review_update_comment_ratings( $new_status, $old_status, $comment ) {
|
334 |
if ( WP_REVIEW_COMMENT_TYPE_VISITOR === $comment->comment_type ) {
|
335 |
mts_get_post_reviews( $comment->comment_post_ID, true );
|
348 |
*/
|
349 |
function wp_review_add_comments_list_view( $views ) {
|
350 |
foreach ( $views as $key => $view ) {
|
351 |
+
$view = str_replace( 'comment_type=' . WP_REVIEW_COMMENT_TYPE_COMMENT . '&', '', $view );
|
352 |
+
$view = str_replace( 'comment_type=' . WP_REVIEW_COMMENT_TYPE_VISITOR . '&', '', $view );
|
353 |
$views[ $key ] = $view;
|
354 |
}
|
355 |
|
356 |
// Visitor reviews.
|
357 |
+
$url = add_query_arg( 'comment_type', WP_REVIEW_COMMENT_TYPE_VISITOR );
|
358 |
+
$url = remove_query_arg( 'comment_status', $url );
|
359 |
+
$count = get_comments(
|
360 |
+
array(
|
361 |
+
'count' => true,
|
362 |
+
'type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
|
363 |
+
)
|
364 |
+
);
|
365 |
+
|
366 |
$views['visitor_reviews'] = sprintf(
|
367 |
'<a href="%1$s" class="%2$s" aria-current="page">%3$s <span class="count">(<span class="all-count">%4$s</span>)</span></a>',
|
368 |
esc_url( $url ),
|
includes/enqueue.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
/**
|
3 |
* Custom style for the plugin.
|
4 |
*
|
|
|
5 |
* @since 1.0
|
6 |
* @copyright Copyright (c) 2013, MyThemesShop
|
7 |
* @author MyThemesShop
|
@@ -11,9 +12,6 @@
|
|
11 |
/* Enqueue style for this plugin. */
|
12 |
add_action( 'wp_enqueue_scripts', 'wp_review_enqueue', 12 );
|
13 |
|
14 |
-
/* IE7 style for the font icon. */
|
15 |
-
// add_action( 'wp_head', 'wp_review_ie7' );
|
16 |
-
|
17 |
/**
|
18 |
* Enqueue style
|
19 |
*
|
@@ -21,8 +19,6 @@ add_action( 'wp_enqueue_scripts', 'wp_review_enqueue', 12 );
|
|
21 |
* @since 3.0.0 Add font awesome.
|
22 |
*/
|
23 |
function wp_review_enqueue() {
|
24 |
-
$rating_types = wp_review_get_rating_types();
|
25 |
-
|
26 |
// Register.
|
27 |
wp_register_style( 'magnificPopup', WP_REVIEW_ASSETS . 'css/magnific-popup.css', array(), '1.1.0' );
|
28 |
wp_register_script( 'magnificPopup', WP_REVIEW_ASSETS . 'js/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
|
@@ -33,12 +29,15 @@ function wp_review_enqueue() {
|
|
33 |
|
34 |
wp_register_script( 'wp_review-js', WP_REVIEW_ASSETS . 'js/main.js', array( 'magnificPopup', 'js-cookie', 'wp-util' ), WP_REVIEW_PLUGIN_VERSION, true );
|
35 |
|
36 |
-
wp_localize_script(
|
37 |
-
'
|
38 |
-
'
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
42 |
|
43 |
// Enqueue.
|
44 |
wp_enqueue_script( 'js-cookie' );
|
2 |
/**
|
3 |
* Custom style for the plugin.
|
4 |
*
|
5 |
+
* @package WP_Review
|
6 |
* @since 1.0
|
7 |
* @copyright Copyright (c) 2013, MyThemesShop
|
8 |
* @author MyThemesShop
|
12 |
/* Enqueue style for this plugin. */
|
13 |
add_action( 'wp_enqueue_scripts', 'wp_review_enqueue', 12 );
|
14 |
|
|
|
|
|
|
|
15 |
/**
|
16 |
* Enqueue style
|
17 |
*
|
19 |
* @since 3.0.0 Add font awesome.
|
20 |
*/
|
21 |
function wp_review_enqueue() {
|
|
|
|
|
22 |
// Register.
|
23 |
wp_register_style( 'magnificPopup', WP_REVIEW_ASSETS . 'css/magnific-popup.css', array(), '1.1.0' );
|
24 |
wp_register_script( 'magnificPopup', WP_REVIEW_ASSETS . 'js/jquery.magnific-popup.min.js', array( 'jquery' ), '1.1.0', true );
|
29 |
|
30 |
wp_register_script( 'wp_review-js', WP_REVIEW_ASSETS . 'js/main.js', array( 'magnificPopup', 'js-cookie', 'wp-util' ), WP_REVIEW_PLUGIN_VERSION, true );
|
31 |
|
32 |
+
wp_localize_script(
|
33 |
+
'wp_review-js',
|
34 |
+
'wpreview',
|
35 |
+
array(
|
36 |
+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
37 |
+
'rateAllFeatures' => __( 'Please rate all features', 'wp-review' ),
|
38 |
+
'verifiedPurchase' => __( '(Verified purchase)', 'wp-review' ),
|
39 |
+
)
|
40 |
+
);
|
41 |
|
42 |
// Enqueue.
|
43 |
wp_enqueue_script( 'js-cookie' );
|
includes/functions.php
CHANGED
@@ -39,14 +39,18 @@ function wp_review_option( $name, $default = null ) {
|
|
39 |
* @return array
|
40 |
*/
|
41 |
function wp_review_get_default_colors() {
|
42 |
-
|
43 |
-
'color'
|
44 |
'inactive_color' => '#95bae0',
|
45 |
-
'fontcolor'
|
46 |
-
'bgcolor1'
|
47 |
-
'bgcolor2'
|
48 |
-
'bordercolor'
|
49 |
-
)
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
|
52 |
|
@@ -87,7 +91,7 @@ function wp_review_get_default_location() {
|
|
87 |
*
|
88 |
* @since 3.0.0
|
89 |
*
|
90 |
-
* @return
|
91 |
*/
|
92 |
function wp_review_get_default_criteria() {
|
93 |
$default_criteria = apply_filters( 'wp_review_default_criteria', array() );
|
@@ -126,12 +130,21 @@ add_image_size( 'wp_review_large', 320, 200, true );
|
|
126 |
add_image_size( 'wp_review_small', 65, 65, true );
|
127 |
|
128 |
// Filter to add custom images sizes in Thumbnail selection box.
|
129 |
-
add_filter(
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
|
137 |
/**
|
@@ -141,6 +154,7 @@ add_filter( 'image_size_names_choose', function( $sizes ) {
|
|
141 |
* @since 1.0
|
142 |
*
|
143 |
* @param int $post_id Post ID.
|
|
|
144 |
*/
|
145 |
function wp_review_get_data( $post_id = null ) {
|
146 |
return wp_review_get_review_box( $post_id );
|
@@ -154,10 +168,10 @@ function wp_review_get_data( $post_id = null ) {
|
|
154 |
* @return string
|
155 |
*/
|
156 |
function wp_review_inject_data( $content ) {
|
157 |
-
$post_id
|
158 |
-
$options
|
159 |
$custom_location = get_post_meta( $post_id, 'wp_review_custom_location', true );
|
160 |
-
$location
|
161 |
if ( ! $custom_location && ! empty( $options['review_location'] ) ) {
|
162 |
$location = $options['review_location'];
|
163 |
}
|
@@ -172,15 +186,15 @@ function wp_review_inject_data( $content ) {
|
|
172 |
global $multipage, $numpages, $page;
|
173 |
if ( $multipage ) {
|
174 |
if ( $page == $numpages ) {
|
175 |
-
return $content
|
176 |
} else {
|
177 |
return $content;
|
178 |
}
|
179 |
} else {
|
180 |
-
return $content
|
181 |
}
|
182 |
} elseif ( 'top' == $location ) {
|
183 |
-
return $review
|
184 |
} else {
|
185 |
return $content;
|
186 |
}
|
@@ -206,7 +220,7 @@ function wp_review_show_total( $echo = true, $class = 'review-total-only', $post
|
|
206 |
$post_id = get_the_ID();
|
207 |
}
|
208 |
|
209 |
-
$type
|
210 |
$user_type = wp_review_get_post_user_review_type( $post_id );
|
211 |
if ( ! $type && ! $user_type ) {
|
212 |
return '';
|
@@ -216,19 +230,20 @@ function wp_review_show_total( $echo = true, $class = 'review-total-only', $post
|
|
216 |
|
217 |
// Fix for themes.
|
218 |
if ( false !== strpos( $class, 'latestPost-review-wrapper' ) ) {
|
219 |
-
$args['color']
|
220 |
$args['inactive_color'] = '#dedcdc';
|
221 |
}
|
222 |
// Fix for rank-math.
|
223 |
if ( false !== strpos( $class, 'rank-math-snippet' ) ) {
|
224 |
-
$args['color']
|
225 |
$args['inactive_color'] = '#dedcdc';
|
226 |
}
|
227 |
|
228 |
$show_on_thumbnails_type = 'author';
|
229 |
$show_on_thumbnails_type = apply_filters( 'wp_review_thumbnails_total', $show_on_thumbnails_type, $post_id, $args ); // Will override option.
|
230 |
|
231 |
-
$rating =
|
|
|
232 |
switch ( $show_on_thumbnails_type ) {
|
233 |
case 'author':
|
234 |
$total = get_post_meta( $post_id, 'wp_review_total', true );
|
@@ -287,8 +302,8 @@ function wp_review_show_total( $echo = true, $class = 'review-total-only', $post
|
|
287 |
* @return array
|
288 |
*/
|
289 |
function mts_get_post_reviews( $post_id, $force = false ) {
|
290 |
-
$post_reviews
|
291 |
-
$review_count
|
292 |
$positive_count = (int) get_post_meta( $post_id, 'wp_review_positive_count', true );
|
293 |
$negative_count = (int) get_post_meta( $post_id, 'wp_review_negative_count', true );
|
294 |
|
@@ -302,36 +317,44 @@ function mts_get_post_reviews( $post_id, $force = false ) {
|
|
302 |
}
|
303 |
|
304 |
if ( is_numeric( $post_id ) && $post_id > 0 ) {
|
305 |
-
$comments
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
312 |
$post_reviews = array(
|
313 |
'rating' => $count > 0 ? round( $rating / $count, 2 ) : 0,
|
314 |
'count' => $count,
|
315 |
);
|
316 |
|
317 |
-
$positive_comments = get_comments(
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
|
|
|
|
|
|
325 |
$post_reviews['positive_count'] = count( $positive_comments );
|
326 |
|
327 |
-
$negative_comments = get_comments(
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
|
|
|
|
|
|
335 |
$post_reviews['negative_count'] = count( $negative_comments );
|
336 |
|
337 |
update_post_meta( $post_id, 'wp_review_user_reviews', $post_reviews['rating'] );
|
@@ -352,51 +375,59 @@ function mts_get_post_reviews( $post_id, $force = false ) {
|
|
352 |
* @return array
|
353 |
*/
|
354 |
function mts_get_post_comments_reviews( $post_id, $force = false ) {
|
355 |
-
$post_reviews
|
356 |
-
$review_count
|
357 |
$positive_count = (int) get_post_meta( $post_id, 'wp_review_comments_positive_count', true );
|
358 |
$negative_count = (int) get_post_meta( $post_id, 'wp_review_comments_negative_count', true );
|
359 |
|
360 |
if ( ! $force && $post_reviews && $review_count ) {
|
361 |
return array(
|
362 |
-
'rating'
|
363 |
-
'count'
|
364 |
'positive_count' => $positive_count,
|
365 |
'negative_count' => $negative_count,
|
366 |
);
|
367 |
}
|
368 |
|
369 |
if ( is_numeric( $post_id ) && $post_id > 0 ) {
|
370 |
-
$comments
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
|
|
|
|
377 |
$post_reviews = array(
|
378 |
'rating' => $count > 0 ? round( $rating / $count, 2 ) : 0,
|
379 |
-
'count'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
);
|
381 |
|
382 |
-
$positive_comments = get_comments( array(
|
383 |
-
'post_id' => $post_id,
|
384 |
-
'type' => WP_REVIEW_COMMENT_TYPE_COMMENT,
|
385 |
-
'status' => 'approve',
|
386 |
-
'fields' => 'ids',
|
387 |
-
'meta_key' => WP_REVIEW_COMMENT_RATING_METAKEY,
|
388 |
-
'meta_value' => 100,
|
389 |
-
) );
|
390 |
$post_reviews['positive_count'] = count( $positive_comments );
|
391 |
|
392 |
-
$negative_comments = get_comments(
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
|
|
|
|
|
|
400 |
$post_reviews['negative_count'] = count( $negative_comments );
|
401 |
|
402 |
update_post_meta( $post_id, 'wp_review_comments_rating_value', $post_reviews['rating'] );
|
@@ -423,7 +454,7 @@ function wp_review_get_post_feature_reviews( $post_id = null, $force = false, $t
|
|
423 |
}
|
424 |
|
425 |
$post_meta_key = "wp_review_{$type}_feature_reviews";
|
426 |
-
$reviews
|
427 |
if ( ! $force && $reviews ) {
|
428 |
return $reviews;
|
429 |
}
|
@@ -432,12 +463,14 @@ function wp_review_get_post_feature_reviews( $post_id = null, $force = false, $t
|
|
432 |
if ( ! $features ) {
|
433 |
return array();
|
434 |
}
|
435 |
-
$comments = get_comments(
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
|
|
|
|
441 |
foreach ( $features as $value ) {
|
442 |
$reviews[ $value['id'] ] = array(
|
443 |
'total' => 0,
|
@@ -502,13 +535,26 @@ function wp_review_on_change_comment_status( $new_status, $old_status, $comment
|
|
502 |
}
|
503 |
add_action( 'transition_comment_status', 'wp_review_on_change_comment_status', 10, 3 );
|
504 |
|
505 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
function wpreview_comment_ratings_callback( $carry, $comment ) {
|
507 |
$rating = get_comment_meta( $comment->comment_ID, WP_REVIEW_COMMENT_RATING_METAKEY, true );
|
508 |
$carry += floatval( $rating );
|
509 |
return $carry;
|
510 |
}
|
511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
function wpreview_visitor_ratings_callback( $carry, $comment ) {
|
513 |
$rating = get_comment_meta( $comment->comment_ID, WP_REVIEW_VISITOR_RATING_METAKEY, true );
|
514 |
$carry += floatval( $rating );
|
@@ -525,7 +571,7 @@ function wpreview_visitor_ratings_callback( $carry, $comment ) {
|
|
525 |
* @param string $type Rating type.
|
526 |
* @return bool
|
527 |
*/
|
528 |
-
function hasPreviousReview( $post_id, $user_id, $ip, $type = 'any' ) {
|
529 |
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_review_has_reviewed' );
|
530 |
return wp_review_has_reviewed( $post_id, $user_id, $ip, $type );
|
531 |
}
|
@@ -592,12 +638,12 @@ function wp_review_has_reviewed_by_user_id( $post_id, $user_id, $ip, $type = 'an
|
|
592 |
* @return WP_Comment|false
|
593 |
*/
|
594 |
function wp_review_get_previous_review_comment( $comment ) {
|
595 |
-
$post_id
|
596 |
$query_args = array(
|
597 |
-
'post_id'
|
598 |
-
'type_in'
|
599 |
-
'meta_key'
|
600 |
-
'meta_value'
|
601 |
'meta_compare' => '>',
|
602 |
);
|
603 |
|
@@ -625,7 +671,7 @@ function wp_review_get_previous_review_comment( $comment ) {
|
|
625 |
* @param WP_Comment_Query $query Comment query.
|
626 |
* @return WP_Comment_Query
|
627 |
*/
|
628 |
-
function wp_review_add_comment_type_to_query(
|
629 |
$commenttype = get_query_var( 'wp_review_commenttype' );
|
630 |
if ( 'any' === $commenttype ) {
|
631 |
$query->query_vars['type__in'] = array( WP_REVIEW_COMMENT_TYPE_COMMENT, WP_REVIEW_COMMENT_TYPE_VISITOR );
|
@@ -647,9 +693,21 @@ function wp_review_filter_comment_by_ip( array $clauses ) {
|
|
647 |
return $clauses;
|
648 |
}
|
649 |
|
650 |
-
|
651 |
-
|
652 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
653 |
set_query_var( 'wp_review_commenttype', $type );
|
654 |
add_filter( 'pre_get_comments', 'wp_review_add_comment_type_to_query' );
|
655 |
if ( $user_id ) {
|
@@ -670,30 +728,41 @@ function getPreviousReview( $post_id, $user_id, $ip, $type = 'any' ) {
|
|
670 |
return false;
|
671 |
}
|
672 |
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
function wp_review_theme_defaults( $new_options, $force_change = false ) {
|
674 |
global $pagenow;
|
675 |
$opt_name = 'wp_review_options_' . wp_get_theme();
|
676 |
-
$options
|
677 |
if ( empty( $options ) ) {
|
678 |
$options = array();
|
679 |
}
|
680 |
$options_updated = get_option( $opt_name );
|
681 |
// If the theme was just activated OR options weren't updated yet.
|
682 |
-
if ( empty( $options_updated ) || $options_updated != $new_options || $force_change || ( isset( $_GET['activated'] ) &&
|
683 |
update_option( 'wp_review_options', array_merge( $options, $new_options ) );
|
684 |
update_option( $opt_name, $new_options );
|
685 |
}
|
686 |
}
|
687 |
|
|
|
|
|
|
|
|
|
|
|
688 |
function wp_review_get_all_image_sizes() {
|
689 |
global $_wp_additional_image_sizes;
|
690 |
|
691 |
$default_image_sizes = array( 'thumbnail', 'medium', 'large' );
|
692 |
|
693 |
foreach ( $default_image_sizes as $size ) {
|
694 |
-
$image_sizes[ $size ]['width']
|
695 |
$image_sizes[ $size ]['height'] = intval( get_option( "{$size}_size_h" ) );
|
696 |
-
$image_sizes[ $size ]['crop']
|
697 |
}
|
698 |
|
699 |
if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) {
|
@@ -706,10 +775,10 @@ function wp_review_get_all_image_sizes() {
|
|
706 |
/**
|
707 |
* Exclude review-type comments from being included in the comment query.
|
708 |
*
|
709 |
-
* @param WP_Comment_Query $query
|
710 |
*/
|
711 |
-
function wp_review_exclude_review_comments(
|
712 |
-
if ( ! is_admin() && ( WP_REVIEW_COMMENT_TYPE_VISITOR !== $query->query_vars['type'] && ! in_array( WP_REVIEW_COMMENT_TYPE_VISITOR, (array) $query->query_vars['type__in'] )) ) {
|
713 |
$query->query_vars['type__not_in'] = array_merge(
|
714 |
is_array( $query->query_vars['type__not_in'] ) ? $query->query_vars['type__not_in'] : array(),
|
715 |
array( WP_REVIEW_COMMENT_TYPE_VISITOR )
|
@@ -721,8 +790,7 @@ add_action( 'pre_get_comments', 'wp_review_exclude_review_comments', 15 );
|
|
721 |
/**
|
722 |
* Add "Reviews" to comments table view.
|
723 |
*
|
724 |
-
* @param array $comment_types
|
725 |
-
*
|
726 |
* @return mixed
|
727 |
*/
|
728 |
function wp_review_add_to_comment_table_dropdown( $comment_types ) {
|
@@ -748,16 +816,16 @@ add_filter( 'admin_comment_types_dropdown', 'wp_review_add_to_comment_table_drop
|
|
748 |
* 3 - Both
|
749 |
*/
|
750 |
function wp_review_get_user_rating_setup( $post_id ) {
|
751 |
-
$default
|
752 |
$user_reviews = get_post_meta( $post_id, 'wp_review_userReview', true );
|
753 |
-
$enabled
|
754 |
if ( is_array( $user_reviews ) ) {
|
755 |
$enabled = (int) $user_reviews[0];
|
756 |
}
|
757 |
|
758 |
// Reviews through comments: enabled by default.
|
759 |
$review_through_comment = get_post_meta( $post_id, 'wp_review_through_comment', true );
|
760 |
-
$custom_fields
|
761 |
if ( ! isset( $custom_fields['wp_review_through_comment'] ) ) {
|
762 |
$review_through_comment = 0;
|
763 |
}
|
@@ -775,20 +843,23 @@ function wp_review_get_user_rating_setup( $post_id ) {
|
|
775 |
|
776 |
/**
|
777 |
* Exclude visitor ratings when updating a post's comment count.
|
778 |
-
*
|
779 |
-
* @param $
|
780 |
-
* @param $
|
|
|
781 |
*
|
782 |
* @internal param $comment_id
|
783 |
* @internal param $comment
|
784 |
*/
|
785 |
function wp_review_exclude_visitor_review_count( $post_id, $new, $old ) {
|
786 |
global $wpdb;
|
787 |
-
$count = get_comments(
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
|
|
|
|
792 |
$wpdb->update( $wpdb->posts, array( 'comment_count' => $count ), array( 'ID' => $post_id ) );
|
793 |
|
794 |
// Update user review count.
|
@@ -805,7 +876,7 @@ add_action( 'wp_update_comment_count', 'wp_review_exclude_visitor_review_count',
|
|
805 |
* @return string
|
806 |
*/
|
807 |
function wp_review_get_review_schema( $post_id ) {
|
808 |
-
$schema
|
809 |
$schemas = wp_review_schema_types();
|
810 |
|
811 |
if ( empty( $schema ) || ! isset( $schemas[ $schema ] ) ) {
|
@@ -847,19 +918,19 @@ function wp_review_user_review( $post_id, $votable = true, $force_display = fals
|
|
847 |
return $review;
|
848 |
}
|
849 |
|
850 |
-
$allowed_class
|
851 |
-
$has_not_rated_class
|
852 |
-
$post_reviews
|
853 |
-
$user_total
|
854 |
$users_reviews_count = $post_reviews['count'];
|
855 |
-
$positive_rating
|
856 |
-
$negative_rating
|
857 |
-
$total
|
858 |
-
$type
|
859 |
|
860 |
$options = get_option( 'wp_review_options' );
|
861 |
-
$colors
|
862 |
-
$color
|
863 |
|
864 |
$user_id = '';
|
865 |
if ( is_user_logged_in() ) {
|
@@ -884,7 +955,7 @@ function wp_review_user_review( $post_id, $votable = true, $force_display = fals
|
|
884 |
$review = ob_get_contents();
|
885 |
ob_end_clean();
|
886 |
|
887 |
-
if (
|
888 |
$review .= '<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
|
889 |
<meta itemprop="ratingValue" content="' . $user_total . '" />
|
890 |
<meta itemprop="reviewCount" content="' . $users_reviews_count . '" />
|
@@ -896,10 +967,10 @@ function wp_review_user_review( $post_id, $votable = true, $force_display = fals
|
|
896 |
|
897 |
|
898 |
/**
|
899 |
-
* Get the path to a template prioritizing theme directory first.
|
900 |
*
|
901 |
-
* @param string $type
|
902 |
-
* @param string $default
|
903 |
*
|
904 |
* @return string
|
905 |
*/
|
@@ -952,56 +1023,84 @@ function wp_review_register_rating_type( $rating_type, $args ) {
|
|
952 |
return true;
|
953 |
}
|
954 |
|
|
|
|
|
|
|
955 |
function wp_review_register_default_rating_types() {
|
956 |
-
wp_review_register_rating_type(
|
957 |
-
'
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
'
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
)
|
985 |
-
|
986 |
-
wp_review_register_rating_type(
|
987 |
-
'
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
'
|
1003 |
-
|
1004 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1005 |
}
|
1006 |
add_action( 'init', 'wp_review_register_default_rating_types' );
|
1007 |
|
@@ -1033,15 +1132,18 @@ function wp_review_get_rating_type_data( $type ) {
|
|
1033 |
if ( ! isset( $rating_types[ $type ] ) ) {
|
1034 |
return false;
|
1035 |
}
|
1036 |
-
return wp_parse_args(
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
|
|
|
|
|
|
1045 |
}
|
1046 |
|
1047 |
|
@@ -1097,7 +1199,7 @@ function wp_review_get_post_user_review_type( $post_id = null ) {
|
|
1097 |
$type = get_post_meta( $post_id, 'wp_review_user_review_type', true );
|
1098 |
|
1099 |
$user_rating_setup = wp_review_get_user_rating_setup( $post_id );
|
1100 |
-
$user_reviews
|
1101 |
if ( ! $user_reviews ) {
|
1102 |
return ''; // User ratings not enabled.
|
1103 |
}
|
@@ -1115,43 +1217,49 @@ function wp_review_get_post_user_review_type( $post_id = null ) {
|
|
1115 |
* @param int $post_id Post ID.
|
1116 |
* @return string
|
1117 |
*/
|
1118 |
-
function wp_review_get_post_box_template( $post_id ) {
|
1119 |
-
global $post
|
1120 |
|
1121 |
if ( empty( $post_id ) ) {
|
1122 |
$post_id = $post->ID;
|
1123 |
}
|
1124 |
|
1125 |
-
$template
|
1126 |
$template .= '.php';
|
1127 |
if ( empty( $template ) || ! wp_review_locate_box_template( $template ) ) {
|
1128 |
-
$template = 'default.php'; // fallback to default.php
|
1129 |
}
|
1130 |
|
1131 |
return apply_filters( 'wp_review_get_box_template', $template, $post_id );
|
1132 |
}
|
1133 |
|
1134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
function wp_review_locate_box_template( $template_name, $return_full_path = true ) {
|
1136 |
// We look for box templates in:
|
1137 |
// 1. plugins_dir/box-templates
|
1138 |
// 2. theme_dir/wp-review
|
1139 |
// 3. childtheme_dir/wp-review
|
1140 |
-
// 4... Use filter to add more
|
1141 |
-
$default_paths
|
1142 |
WP_REVIEW_DIR . 'box-templates',
|
1143 |
get_template_directory() . '/wp-review',
|
1144 |
get_stylesheet_directory() . '/wp-review',
|
1145 |
);
|
1146 |
$template_paths = apply_filters( 'wp_review_box_template_paths', $default_paths );
|
1147 |
|
1148 |
-
|
1149 |
-
$
|
1150 |
-
$located = '';
|
1151 |
$path_partial = '';
|
1152 |
foreach ( $paths as $path ) {
|
1153 |
-
|
1154 |
-
|
|
|
1155 |
$path_partial = $path;
|
1156 |
break;
|
1157 |
}
|
@@ -1187,8 +1295,8 @@ function wp_review_locate_template( $template_name, $return_full_path = true ) {
|
|
1187 |
function wp_review_load_template( $template_name, $data = array() ) {
|
1188 |
$path = wp_review_locate_template( $template_name, true );
|
1189 |
if ( $path ) {
|
1190 |
-
extract( $data );
|
1191 |
-
include $path;
|
1192 |
}
|
1193 |
}
|
1194 |
|
@@ -1228,13 +1336,13 @@ function wp_review_rating( $value, $post_id = null, $args = array() ) {
|
|
1228 |
}
|
1229 |
|
1230 |
$colors = apply_filters( 'wp_review_colors', $colors, $post_id );
|
1231 |
-
$color
|
1232 |
|
1233 |
// Don't allow higher rating than max.
|
1234 |
if ( $value > $rating_type['max'] ) {
|
1235 |
$value = $rating_type['max'];
|
1236 |
}
|
1237 |
-
$template
|
1238 |
$comment_rating = false;
|
1239 |
set_query_var( 'rating', compact( 'value', 'post_id', 'type', 'args', 'comment_rating', 'color', 'colors' ) );
|
1240 |
ob_start();
|
@@ -1244,22 +1352,26 @@ function wp_review_rating( $value, $post_id = null, $args = array() ) {
|
|
1244 |
return $review;
|
1245 |
}
|
1246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1247 |
function wp_review_user_rating( $post_id = null, $args = array() ) {
|
1248 |
$options = get_option( 'wp_review_options' );
|
1249 |
-
$type
|
1250 |
if ( empty( $type ) ) {
|
1251 |
return '';
|
1252 |
}
|
1253 |
|
1254 |
$rating_type = wp_review_get_rating_type_data( $type );
|
1255 |
-
$review = '';
|
1256 |
|
1257 |
-
$post_reviews
|
1258 |
-
$value
|
1259 |
$args['positive_count'] = isset( $post_reviews['positive_count'] ) ? $post_reviews['positive_count'] : 0;
|
1260 |
$args['negative_count'] = isset( $post_reviews['negative_count'] ) ? $post_reviews['negative_count'] : 0;
|
1261 |
-
/* $count = $post_reviews['count']; */
|
1262 |
-
$total = get_post_meta( $post_id, 'wp_review_total', true );
|
1263 |
|
1264 |
$user_id = '';
|
1265 |
if ( is_user_logged_in() ) {
|
@@ -1267,19 +1379,23 @@ function wp_review_user_rating( $post_id = null, $args = array() ) {
|
|
1267 |
}
|
1268 |
|
1269 |
if ( wp_review_has_reviewed( $post_id, $user_id, wp_review_get_user_ip(), WP_REVIEW_COMMENT_TYPE_VISITOR ) || ( ! is_user_logged_in() && ! empty( $options['registered_only'] ) ) ) {
|
1270 |
-
$output = wp_review_rating(
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
|
|
|
|
|
|
|
|
1275 |
return $output;
|
1276 |
}
|
1277 |
|
1278 |
$colors = wp_review_get_colors( $post_id );
|
1279 |
-
$color
|
1280 |
|
1281 |
$rating_type_template = $rating_type['input_template'];
|
1282 |
-
$comment_rating
|
1283 |
set_query_var( 'rating', compact( 'value', 'post_id', 'comment_rating', 'args', 'color', 'colors' ) );
|
1284 |
ob_start();
|
1285 |
load_template( $rating_type_template, false );
|
@@ -1306,23 +1422,23 @@ function wp_review_visitor_feature_rating( $post_id = null, $args = array() ) {
|
|
1306 |
|
1307 |
$args = wp_parse_args( $args, array( 'type' => 'user' ) );
|
1308 |
|
1309 |
-
$type
|
1310 |
$rating_type = wp_review_get_rating_type_data( $type );
|
1311 |
if ( empty( $rating_type ) ) {
|
1312 |
return '';
|
1313 |
}
|
1314 |
|
1315 |
$colors = wp_review_get_colors( $post_id );
|
1316 |
-
$color
|
1317 |
|
1318 |
-
$user_has_reviewed
|
1319 |
-
$is_output
|
1320 |
$rating_type_template = $is_output ? $rating_type['output_template'] : $rating_type['input_template'];
|
1321 |
-
$comment_rating
|
1322 |
|
1323 |
$args['hide_button'] = true;
|
1324 |
|
1325 |
-
$output
|
1326 |
'<div class="wpr-%1$s-features-rating" data-type="%2$s" data-nonce="%3$s" data-post_id="%4$s">',
|
1327 |
esc_attr( $args['type'] ),
|
1328 |
esc_attr( $type ),
|
@@ -1333,13 +1449,13 @@ function wp_review_visitor_feature_rating( $post_id = null, $args = array() ) {
|
|
1333 |
$output .= '<ul class="features-rating-list review-list">';
|
1334 |
|
1335 |
$features = wp_review_get_review_items( $post_id );
|
1336 |
-
$reviews
|
1337 |
-
if( is_array( $features ) && !empty( $features ) ) {
|
1338 |
foreach ( $features as $feature_id => $feature ) {
|
1339 |
if ( ! isset( $reviews[ $feature_id ] ) ) {
|
1340 |
$review = array(
|
1341 |
-
'total'
|
1342 |
-
'count'
|
1343 |
'positive' => 0,
|
1344 |
'negative' => 0,
|
1345 |
);
|
@@ -1352,10 +1468,10 @@ function wp_review_visitor_feature_rating( $post_id = null, $args = array() ) {
|
|
1352 |
$value = intval( $review['count'] ) ? $review['total'] / $review['count'] : 0;
|
1353 |
}
|
1354 |
$value_text = '<span>' . sprintf( $rating_type['value_text'], $value ) . '</span> - ';
|
1355 |
-
$output
|
1356 |
|
1357 |
$rating_output = '';
|
1358 |
-
$title_output
|
1359 |
|
1360 |
if ( ! $user_has_reviewed ) {
|
1361 |
$rating_output .= sprintf(
|
@@ -1367,12 +1483,12 @@ function wp_review_visitor_feature_rating( $post_id = null, $args = array() ) {
|
|
1367 |
}
|
1368 |
|
1369 |
if ( ! empty( $feature['wp_review_item_color'] ) ) {
|
1370 |
-
$color
|
1371 |
$colors['color'] = $color;
|
1372 |
}
|
1373 |
|
1374 |
if ( ! empty( $feature['wp_review_item_inactive_color'] ) ) {
|
1375 |
-
$inactive_color
|
1376 |
$colors['inactive_color'] = $inactive_color;
|
1377 |
}
|
1378 |
|
@@ -1415,7 +1531,13 @@ function wp_review_visitor_feature_rating( $post_id = null, $args = array() ) {
|
|
1415 |
return $output;
|
1416 |
}
|
1417 |
|
1418 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1419 |
function wp_review_user_comments_rating( $post_id = null, $args = array() ) {
|
1420 |
$type = wp_review_get_post_user_review_type( $post_id );
|
1421 |
|
@@ -1423,21 +1545,13 @@ function wp_review_user_comments_rating( $post_id = null, $args = array() ) {
|
|
1423 |
return '';
|
1424 |
}
|
1425 |
|
1426 |
-
$
|
1427 |
-
|
1428 |
-
$post_reviews = mts_get_post_comments_reviews( $post_id );
|
1429 |
-
$value = $post_reviews['rating'];
|
1430 |
-
$count = $post_reviews['count'];
|
1431 |
$args['positive_count'] = isset( $post_reviews['positive_count'] ) ? $post_reviews['positive_count'] : 0;
|
1432 |
$args['negative_count'] = isset( $post_reviews['negative_count'] ) ? $post_reviews['negative_count'] : 0;
|
1433 |
-
$args['user_rating']
|
1434 |
$args['comment_rating'] = true;
|
1435 |
|
1436 |
-
$user_id = '';
|
1437 |
-
if ( is_user_logged_in() ) {
|
1438 |
-
$user_id = get_current_user_id();
|
1439 |
-
}
|
1440 |
-
|
1441 |
if ( '' == $value ) {
|
1442 |
$value = '0.0';
|
1443 |
}
|
@@ -1470,7 +1584,6 @@ function wp_review_get_review_data( $post_id = null, $args = array() ) {
|
|
1470 |
$post_id = get_the_ID();
|
1471 |
}
|
1472 |
|
1473 |
-
$options = get_option( 'wp_review_options' );
|
1474 |
$data = array();
|
1475 |
|
1476 |
$data['post_id'] = $post_id;
|
@@ -1487,7 +1600,7 @@ function wp_review_get_review_data( $post_id = null, $args = array() ) {
|
|
1487 |
|
1488 |
$data['product_price'] = wp_review_get_product_price( $post_id );
|
1489 |
|
1490 |
-
$data['items']
|
1491 |
$data['disable_features'] = get_post_meta( $post_id, 'wp_review_disable_features', true );
|
1492 |
|
1493 |
$data['type'] = wp_review_get_post_review_type( $post_id );
|
@@ -1507,71 +1620,65 @@ function wp_review_get_review_data( $post_id = null, $args = array() ) {
|
|
1507 |
|
1508 |
$data['links'] = wp_review_get_review_links( $post_id );
|
1509 |
|
1510 |
-
$custom_author
|
1511 |
-
$author_field
|
1512 |
$data['author'] = ( ! $author_field || empty( $author_field ) || ! $custom_author ) ? get_the_author() : $author_field;
|
1513 |
|
1514 |
-
$colors
|
1515 |
$data['colors'] = $colors;
|
1516 |
|
1517 |
$data['width'] = 100;
|
1518 |
$data['align'] = 'left';
|
1519 |
|
1520 |
-
|
1521 |
-
$
|
1522 |
-
$
|
1523 |
-
$
|
1524 |
-
*/
|
1525 |
-
|
1526 |
-
$user_review = in_array( wp_review_get_user_rating_setup( $post_id ), array( WP_REVIEW_REVIEW_VISITOR_ONLY, WP_REVIEW_REVIEW_ALLOW_BOTH ) );
|
1527 |
-
$comments_review = in_array( wp_review_get_user_rating_setup( $post_id ), array( WP_REVIEW_REVIEW_COMMENT_ONLY, WP_REVIEW_REVIEW_ALLOW_BOTH ) );
|
1528 |
-
$user_review_type = '';
|
1529 |
-
$user_review_total = '';
|
1530 |
$user_review_positive = '';
|
1531 |
$user_review_negative = '';
|
1532 |
-
$user_review_count
|
1533 |
-
$user_has_reviewed
|
1534 |
if ( $user_review || $comments_review ) {
|
1535 |
$user_review_type = wp_review_get_post_user_review_type( $post_id );
|
1536 |
}
|
1537 |
|
1538 |
if ( $user_review ) {
|
1539 |
-
$post_reviews
|
1540 |
-
$user_review_total
|
1541 |
-
$user_review_count
|
1542 |
$user_review_positive = $post_reviews['positive_count'];
|
1543 |
$user_review_negative = $post_reviews['negative_count'];
|
1544 |
-
$user_id
|
1545 |
-
$uip
|
1546 |
if ( wp_review_has_reviewed( $post_id, $user_id, $uip, WP_REVIEW_COMMENT_TYPE_VISITOR ) ) {
|
1547 |
$user_has_reviewed = true;
|
1548 |
}
|
1549 |
}
|
1550 |
-
$data['user_review']
|
1551 |
-
$data['comments_review']
|
1552 |
-
$data['user_review_type']
|
1553 |
-
$data['user_review_total']
|
1554 |
-
$data['user_review_count']
|
1555 |
$data['user_review_positive'] = $user_review_positive;
|
1556 |
$data['user_review_negative'] = $user_review_negative;
|
1557 |
-
$data['user_has_reviewed']
|
1558 |
$data['hide_comments_rating'] = get_post_meta( $post_id, 'wp_review_hide_comments_total', true );
|
1559 |
|
1560 |
-
$hide_user_reviews = wp_review_network_option('hide_user_reviews_');
|
1561 |
-
if($hide_user_reviews) {
|
1562 |
-
$data['user_review']
|
1563 |
$data['comments_review'] = false;
|
1564 |
}
|
1565 |
-
$hide_desc = wp_review_network_option('hide_review_description_');
|
1566 |
-
if($hide_desc) {
|
1567 |
$data['hide_desc'] = true;
|
1568 |
}
|
1569 |
-
$hide_links = wp_review_network_option('hide_review_links_');
|
1570 |
-
if($hide_links) {
|
1571 |
$data['links'] = true;
|
1572 |
}
|
1573 |
-
$hide_features = wp_review_network_option('hide_features_');
|
1574 |
-
if($hide_features) {
|
1575 |
$data['disable_features'] = true;
|
1576 |
}
|
1577 |
/**
|
@@ -1600,17 +1707,17 @@ function wp_review_get_colors( $post_id ) {
|
|
1600 |
$color_options = wp_review_get_global_colors();
|
1601 |
$custom_colors = get_post_meta( $post_id, 'wp_review_custom_colors', true );
|
1602 |
|
1603 |
-
$colors
|
1604 |
-
$colors['custom_colors']
|
1605 |
$colors['custom_location'] = get_post_meta( $post_id, 'wp_review_custom_location', true );
|
1606 |
-
$colors['custom_width']
|
1607 |
-
$colors['color']
|
1608 |
$colors['inactive_color'] = get_post_meta( $post_id, 'wp_review_inactive_color', true );
|
1609 |
-
$colors['type']
|
1610 |
-
$colors['fontcolor']
|
1611 |
-
$colors['bgcolor1']
|
1612 |
-
$colors['bgcolor2']
|
1613 |
-
$colors['bordercolor']
|
1614 |
|
1615 |
if ( ! $custom_colors && is_array( $color_options ) ) {
|
1616 |
$colors = array_merge( $colors, $color_options );
|
@@ -1645,7 +1752,7 @@ function wp_review_force_hiding_review_elements( $review, $args ) {
|
|
1645 |
}
|
1646 |
|
1647 |
if ( ! empty( $args['hide_rating_box'] ) ) {
|
1648 |
-
$review['user_review']
|
1649 |
$review['comments_review'] = false;
|
1650 |
}
|
1651 |
|
@@ -1666,20 +1773,20 @@ add_filter( 'wp_review_get_review_data', 'wp_review_force_hiding_review_elements
|
|
1666 |
* @return string Review box output.
|
1667 |
*/
|
1668 |
function wp_review_get_review_box( $post_id = null ) {
|
1669 |
-
$hide_user_reviews = wp_review_network_option('hide_ratings_in_posts_');
|
1670 |
if ( ! wp_review_is_enable( $post_id ) || $hide_user_reviews ) {
|
1671 |
-
return;
|
1672 |
}
|
1673 |
|
1674 |
-
//WPML workaround to show translated post data instead of original post.
|
1675 |
-
if ( is_singular() && function_exists('icl_object_id') ) {
|
1676 |
global $post;
|
1677 |
$post_id = $post->ID;
|
1678 |
}
|
1679 |
|
1680 |
$review_data = wp_review_get_review_data( $post_id );
|
1681 |
|
1682 |
-
$template
|
1683 |
$box_template_path = wp_review_locate_box_template( $template );
|
1684 |
|
1685 |
$template_id = rtrim( $template, '.php' );
|
@@ -1704,7 +1811,12 @@ function wp_review_get_review_box( $post_id = null ) {
|
|
1704 |
return $review;
|
1705 |
}
|
1706 |
|
1707 |
-
|
|
|
|
|
|
|
|
|
|
|
1708 |
function wp_review_get_box_template_info( $template = false ) {
|
1709 |
$default_template_headers = array(
|
1710 |
'Name' => 'WP Review',
|
@@ -1751,6 +1863,11 @@ function wp_review_get_box_template_directory_uri() {
|
|
1751 |
}
|
1752 |
|
1753 |
|
|
|
|
|
|
|
|
|
|
|
1754 |
function wp_review_get_box_templates_list() {
|
1755 |
|
1756 |
$default_paths = array(
|
@@ -1758,7 +1875,7 @@ function wp_review_get_box_templates_list() {
|
|
1758 |
get_template_directory() . '/wp-review',
|
1759 |
get_stylesheet_directory() . '/wp-review',
|
1760 |
);
|
1761 |
-
$paths
|
1762 |
|
1763 |
$templates = array();
|
1764 |
|
@@ -1766,38 +1883,53 @@ function wp_review_get_box_templates_list() {
|
|
1766 |
$path = trailingslashit( $path );
|
1767 |
// Look for files containing our header 'Launcher template'.
|
1768 |
$files = (array) wp_review_scandir( $path, 'php', 2 );
|
1769 |
-
foreach ( $files as $file => $full_path ) {
|
1770 |
if ( ! $full_path || ! preg_match( '|WP Review:(.*)$|mi', file_get_contents( $full_path ), $header ) ) {
|
1771 |
continue;
|
1772 |
}
|
1773 |
|
1774 |
-
$templates[ $file ]
|
1775 |
$templates[ $file ]['path'] = $path;
|
1776 |
}
|
1777 |
}
|
1778 |
return $templates;
|
1779 |
}
|
1780 |
|
1781 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1782 |
function wp_review_scandir( $path, $extensions = null, $depth = 0, $relative_path = '' ) {
|
1783 |
-
if ( ! is_dir( $path ) )
|
1784 |
return false;
|
|
|
|
|
1785 |
if ( $extensions ) {
|
1786 |
-
$extensions
|
1787 |
$_extensions = implode( '|', $extensions );
|
1788 |
}
|
|
|
1789 |
$relative_path = trailingslashit( $relative_path );
|
1790 |
-
if ( '/' == $relative_path )
|
1791 |
$relative_path = '';
|
|
|
|
|
1792 |
$results = scandir( $path );
|
1793 |
-
$files
|
1794 |
foreach ( $results as $result ) {
|
1795 |
-
if ( '.' == $result[0] )
|
1796 |
continue;
|
|
|
1797 |
if ( is_dir( $path . '/' . $result ) ) {
|
1798 |
-
if ( ! $depth || 'CVS' == $result )
|
1799 |
continue;
|
1800 |
-
|
|
|
1801 |
$files = array_merge_recursive( $files, $found );
|
1802 |
} elseif ( ! $extensions || preg_match( '~\.(' . $_extensions . ')$~', $result ) ) {
|
1803 |
$files[ $relative_path . $result ] = $path . '/' . $result;
|
@@ -1806,11 +1938,13 @@ function wp_review_scandir( $path, $extensions = null, $depth = 0, $relative_pat
|
|
1806 |
return $files;
|
1807 |
}
|
1808 |
|
1809 |
-
|
|
|
|
|
1810 |
function wp_review_add_admin_columns() {
|
1811 |
-
$post_types
|
1812 |
$excluded_post_types = apply_filters( 'wp_review_excluded_post_types', array( 'attachment' ) );
|
1813 |
-
$allowed_post_types
|
1814 |
foreach ( $allowed_post_types as $key => $value ) {
|
1815 |
// Add post list table column.
|
1816 |
add_filter( 'manage_' . $value . '_posts_columns', 'wp_review_post_list_column' );
|
@@ -1820,11 +1954,23 @@ function wp_review_add_admin_columns() {
|
|
1820 |
}
|
1821 |
add_action( 'init', 'wp_review_add_admin_columns' );
|
1822 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1823 |
function wp_review_post_list_column( $columns ) {
|
1824 |
$columns['wp_review_rating'] = __( 'Rating', 'wp-review' );
|
1825 |
return $columns;
|
1826 |
}
|
1827 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1828 |
function wp_review_post_list_column_content( $column_name, $post_id ) {
|
1829 |
if ( 'wp_review_rating' === $column_name ) {
|
1830 |
$total = get_post_meta( $post_id, 'wp_review_total', true );
|
@@ -1839,23 +1985,23 @@ function wp_review_post_list_column_content( $column_name, $post_id ) {
|
|
1839 |
}
|
1840 |
}
|
1841 |
|
1842 |
-
|
1843 |
-
|
1844 |
-
/*
|
1845 |
-
* Notice about migrating ratings.
|
1846 |
*/
|
1847 |
-
|
1848 |
function wp_review_migrate_notice_ignore() {
|
1849 |
global $current_user;
|
1850 |
$user_id = $current_user->ID;
|
1851 |
/* If user clicks to ignore the notice, add that to their user meta */
|
1852 |
-
if ( isset( $_GET['wp_review_migrate_notice_ignore']) && '1' == $_GET['wp_review_migrate_notice_ignore'] ) {
|
1853 |
add_user_meta( $user_id, 'wp_review_migrate_notice_ignore', 'true', true );
|
1854 |
}
|
1855 |
}
|
1856 |
add_action( 'admin_init', 'wp_review_migrate_notice_ignore' );
|
1857 |
|
1858 |
|
|
|
|
|
|
|
1859 |
function wp_review_migrate_notice() {
|
1860 |
// Migrate.
|
1861 |
global $wpdb, $current_user;
|
@@ -1870,13 +2016,12 @@ function wp_review_migrate_notice() {
|
|
1870 |
}
|
1871 |
|
1872 |
$current_blog_id = get_current_blog_id();
|
1873 |
-
$
|
1874 |
-
$
|
1875 |
-
$
|
1876 |
-
|
1877 |
-
|
1878 |
-
$
|
1879 |
-
$rows_left = $total_rows - $migrated_rows;
|
1880 |
}
|
1881 |
|
1882 |
if ( ! $rows_left ) {
|
@@ -1884,14 +2029,24 @@ function wp_review_migrate_notice() {
|
|
1884 |
}
|
1885 |
?>
|
1886 |
<div class="updated notice-info wp-review-notice">
|
1887 |
-
<p
|
|
|
|
|
|
|
|
|
|
|
1888 |
<a class="notice-dismiss" href="<?php echo esc_url( add_query_arg( 'wp_review_migrate_notice_ignore', '1' ) ); ?>"></a>
|
1889 |
</div>
|
1890 |
<?php
|
1891 |
}
|
1892 |
add_action( 'admin_notices', 'wp_review_migrate_notice' );
|
1893 |
|
1894 |
-
|
|
|
|
|
|
|
|
|
|
|
1895 |
function wp_review_get_schema( $review ) {
|
1896 |
if ( 'none' === $review['schema'] ) {
|
1897 |
return '';
|
@@ -1943,9 +2098,18 @@ function wp_review_get_schema( $review ) {
|
|
1943 |
|
1944 |
}
|
1945 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1946 |
function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
1947 |
|
1948 |
-
if ( empty( $review['schema'] ) || 'Thing' === $review['schema'] || ! isset( $review['schema_data'] ) )
|
|
|
|
|
1949 |
|
1950 |
$args = array(
|
1951 |
'@context' => 'http://schema.org',
|
@@ -1957,7 +2121,7 @@ function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
|
1957 |
$args += $ldjson_data;
|
1958 |
} else {
|
1959 |
$schemas = wp_review_schema_types();
|
1960 |
-
$fields
|
1961 |
|
1962 |
foreach ( $fields as $key => $data ) {
|
1963 |
if ( ! empty( $data['omit'] ) ) {
|
@@ -1968,10 +2132,10 @@ function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
|
1968 |
$review['schema_data'][ $review['schema'] ][ $data['name'] ] = preg_split( '/\r\n|[\r\n]/', $review['schema_data'][ $review['schema'] ][ $data['name'] ] );
|
1969 |
}
|
1970 |
if ( isset( $data['part_of'] ) ) {
|
1971 |
-
$args[ $data['part_of'] ][
|
1972 |
if ( 'image' === $data['type'] ) {
|
1973 |
$args[ $data['part_of'] ][ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ]['url'];
|
1974 |
-
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) {
|
1975 |
$args[ $data['part_of'] ][ $data['name'] ] = 'PT' . $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
1976 |
} else {
|
1977 |
$args[ $data['part_of'] ][ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
@@ -1979,7 +2143,7 @@ function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
|
1979 |
} else {
|
1980 |
if ( 'image' === $data['type'] ) {
|
1981 |
$args[ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ]['url'];
|
1982 |
-
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) {
|
1983 |
$args[ $data['name'] ] = 'PT' . $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
1984 |
} else {
|
1985 |
$args[ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
@@ -1989,13 +2153,13 @@ function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
|
1989 |
}
|
1990 |
}
|
1991 |
|
1992 |
-
// Nested aggregateRating is required in some types ( SoftwareApplication, Recipe )
|
1993 |
-
$force_user_rating = in_array( $review['schema'], apply_filters( 'wp_review_schema_force_nested_user_rating_types', array('SoftwareApplication', 'Recipe') ) );
|
1994 |
if ( $force_user_rating ) {
|
1995 |
if ( $review['user_review'] || $review['comments_review'] ) {
|
1996 |
-
$
|
1997 |
-
if ( !empty( $
|
1998 |
-
$args['aggregateRating'] = $
|
1999 |
}
|
2000 |
}
|
2001 |
if ( 'author' === $review['rating_schema'] ) {
|
@@ -2004,9 +2168,9 @@ function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
|
2004 |
} elseif ( $nested_rating ) {
|
2005 |
if ( in_array( $review['rating_schema'], array( 'visitors' ) ) ) {
|
2006 |
if ( $review['user_review'] || $review['comments_review'] ) {
|
2007 |
-
$
|
2008 |
-
if ( !empty( $
|
2009 |
-
$args['aggregateRating'] = $
|
2010 |
}
|
2011 |
}
|
2012 |
} else {
|
@@ -2016,16 +2180,25 @@ function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
|
2016 |
|
2017 |
$args = apply_filters( 'wp_review_get_schema_type_args', $args, $review, $nested_rating );
|
2018 |
|
2019 |
-
$output
|
2020 |
$output .= wp_json_encode( $args, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ) . PHP_EOL;
|
2021 |
$output .= '</script>' . PHP_EOL;
|
2022 |
|
2023 |
return apply_filters( 'wp_review_get_schema_type', $output, $args, $review, $nested_rating );
|
2024 |
}
|
2025 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026 |
function wp_review_get_schema_review_rating( $review, $nested_item = false ) {
|
2027 |
|
2028 |
-
if (
|
|
|
|
|
2029 |
|
2030 |
global $wp_review_rating_types;
|
2031 |
|
@@ -2056,16 +2229,25 @@ function wp_review_get_schema_review_rating( $review, $nested_item = false ) {
|
|
2056 |
|
2057 |
$args = apply_filters( 'wp_review_get_schema_review_rating_args', $args, $review );
|
2058 |
|
2059 |
-
$output
|
2060 |
$output .= wp_json_encode( $args, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ) . PHP_EOL;
|
2061 |
$output .= '</script>' . PHP_EOL;
|
2062 |
|
2063 |
return apply_filters( 'wp_review_get_schema_review_rating', $output, $args, $review );
|
2064 |
}
|
2065 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2066 |
function wp_review_get_schema_user_rating( $review, $nested_item = false ) {
|
2067 |
|
2068 |
-
if ( ! $nested_item && in_array( $review['schema'], apply_filters( 'wp_review_schema_force_nested_user_rating_types', array( 'SoftwareApplication', 'Recipe' ) ) ) )
|
|
|
|
|
2069 |
|
2070 |
global $wp_review_rating_types;
|
2071 |
|
@@ -2105,13 +2287,19 @@ function wp_review_get_schema_user_rating( $review, $nested_item = false ) {
|
|
2105 |
return apply_filters( 'wp_review_get_schema_user_rating', $output, $args, $review );
|
2106 |
}
|
2107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2108 |
function wp_review_get_reviewed_item_name( $review ) {
|
2109 |
|
2110 |
$item_reviewed = empty( $review['heading'] ) ? get_the_title( $review['post_id'] ) : esc_html( $review['heading'] );
|
2111 |
|
2112 |
-
if ( !empty( $review['schema'] ) && 'Thing' !== $review['schema'] ) {
|
2113 |
|
2114 |
-
if ( isset( $review['schema_data'][ $review['schema'] ]['name'] ) && !empty( $review['schema_data'][ $review['schema'] ]['name'] ) ) {
|
2115 |
$item_reviewed = $review['schema_data'][ $review['schema'] ]['name'];
|
2116 |
}
|
2117 |
}
|
@@ -2119,6 +2307,12 @@ function wp_review_get_reviewed_item_name( $review ) {
|
|
2119 |
return apply_filters( 'wp_review_get_reviewed_item_name', $item_reviewed, $review );
|
2120 |
}
|
2121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2122 |
function wp_review_get_schema_nested_user_rating_args( $review ) {
|
2123 |
|
2124 |
global $wp_review_rating_types;
|
@@ -2135,6 +2329,12 @@ function wp_review_get_schema_nested_user_rating_args( $review ) {
|
|
2135 |
return apply_filters( 'wp_review_get_schema_nested_user_rating_args', $args, $review );
|
2136 |
}
|
2137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2138 |
function wp_review_get_schema_nested_review_args( $review ) {
|
2139 |
global $wp_review_rating_types;
|
2140 |
|
@@ -2155,10 +2355,16 @@ function wp_review_get_schema_nested_review_args( $review ) {
|
|
2155 |
return apply_filters( 'wp_review_get_schema_nested_review_args', $args, $review );
|
2156 |
}
|
2157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2158 |
function wp_review_get_schema_nested_item_args( $review ) {
|
2159 |
|
2160 |
$args = array(
|
2161 |
-
|
2162 |
);
|
2163 |
|
2164 |
$schema_data = ! empty( $review['schema_data'][ $review['schema'] ] ) ? $review['schema_data'][ $review['schema'] ] : array();
|
@@ -2167,30 +2373,30 @@ function wp_review_get_schema_nested_item_args( $review ) {
|
|
2167 |
$args += $ldjson_data;
|
2168 |
} else {
|
2169 |
$schemas = wp_review_schema_types();
|
2170 |
-
$fields
|
2171 |
-
if( is_array( $fields ) && !empty( $fields ) ) {
|
2172 |
foreach ( $fields as $key => $data ) {
|
2173 |
if ( ! empty( $data['omit'] ) ) {
|
2174 |
continue;
|
2175 |
}
|
2176 |
-
if ( isset( $schema_data[ $data['name'] ] ) && !empty( $schema_data[ $data['name'] ] ) ) {
|
2177 |
if ( isset( $data['multiline'] ) && $data['multiline'] ) {
|
2178 |
-
$schema_data[ $data['name'] ] = preg_split('/\r\n|[\r\n]/', $schema_data[ $data['name'] ] );
|
2179 |
}
|
2180 |
if ( isset( $data['part_of'] ) ) {
|
2181 |
-
$args[ $data['part_of'] ][
|
2182 |
if ( 'image' === $data['type'] ) {
|
2183 |
$args[ $data['part_of'] ][ $data['name'] ] = $schema_data[ $data['name'] ]['url'];
|
2184 |
-
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) {
|
2185 |
-
$args[ $data['part_of'] ][ $data['name'] ] = 'PT'
|
2186 |
} else {
|
2187 |
$args[ $data['part_of'] ][ $data['name'] ] = $schema_data[ $data['name'] ];
|
2188 |
}
|
2189 |
} else {
|
2190 |
if ( 'image' === $data['type'] ) {
|
2191 |
$args[ $data['name'] ] = $schema_data[ $data['name'] ]['url'];
|
2192 |
-
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) {
|
2193 |
-
$args[ $data['name'] ] = 'PT'
|
2194 |
} else {
|
2195 |
$args[ $data['name'] ] = $schema_data[ $data['name'] ];
|
2196 |
}
|
@@ -2200,14 +2406,12 @@ function wp_review_get_schema_nested_item_args( $review ) {
|
|
2200 |
}
|
2201 |
}
|
2202 |
|
2203 |
-
// Nested aggregateRating is recommended in some types ( SoftwareApplication, Recipe )
|
2204 |
-
if ( in_array( $review['schema'], apply_filters( 'wp_review_schema_force_nested_user_rating_types', array('SoftwareApplication', 'Recipe') ) ) && ( $review['user_review'] || $review['comments_review'] ) ) {
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
}
|
2210 |
-
//}
|
2211 |
}
|
2212 |
|
2213 |
return apply_filters( 'wp_review_get_schema_nested_item_args', $args, $review );
|
@@ -2225,7 +2429,7 @@ function wp_review_get_schema_nested_item_args( $review ) {
|
|
2225 |
*/
|
2226 |
function wp_review_get_ldjson_data( $type, $data, $review ) {
|
2227 |
$ldjson_data = array();
|
2228 |
-
$post_id
|
2229 |
|
2230 |
switch ( $type ) {
|
2231 |
case 'Article':
|
@@ -2234,18 +2438,18 @@ function wp_review_get_ldjson_data( $type, $data, $review ) {
|
|
2234 |
'@type' => 'Webpage',
|
2235 |
'@id' => get_permalink( $post_id ),
|
2236 |
),
|
2237 |
-
'headline'
|
2238 |
-
'image'
|
2239 |
'@type' => 'ImageObject',
|
2240 |
'url' => ! empty( $data['image']['url'] ) ? esc_url( $data['image']['url'] ) : '',
|
2241 |
),
|
2242 |
-
'datePublished'
|
2243 |
-
'dateModified'
|
2244 |
-
'author'
|
2245 |
'@type' => 'Person',
|
2246 |
'name' => ! empty( $data['author'] ) ? $data['author'] : '',
|
2247 |
),
|
2248 |
-
'publisher'
|
2249 |
'@type' => 'Organization',
|
2250 |
'name' => ! empty( $data['publisher'] ) ? $data['publisher'] : '',
|
2251 |
'logo' => array(
|
@@ -2253,7 +2457,7 @@ function wp_review_get_ldjson_data( $type, $data, $review ) {
|
|
2253 |
'url' => ! empty( $data['publisher_logo']['url'] ) ? esc_url( $data['publisher_logo']['url'] ) : '',
|
2254 |
),
|
2255 |
),
|
2256 |
-
'description'
|
2257 |
);
|
2258 |
break;
|
2259 |
|
@@ -2287,10 +2491,10 @@ function wp_review_get_rating_icon() {
|
|
2287 |
function wp_review_get_rating_image() {
|
2288 |
|
2289 |
$rating_image = wp_review_option( 'rating_image', apply_filters( 'wp_review_default_rating_image', '' ) );
|
2290 |
-
if($rating_image) {
|
2291 |
-
$rating_img_src = wp_get_attachment_image_src($rating_image);
|
2292 |
|
2293 |
-
if(!empty($rating_img_src)) {
|
2294 |
$rating_image = $rating_img_src[0];
|
2295 |
}
|
2296 |
}
|
@@ -2312,7 +2516,7 @@ function wp_review_is_enable( $post_id = null ) {
|
|
2312 |
$post_id = get_the_ID();
|
2313 |
}
|
2314 |
|
2315 |
-
return
|
2316 |
}
|
2317 |
|
2318 |
|
@@ -2489,7 +2693,7 @@ function wp_review_get_box_template( $post_id = null ) {
|
|
2489 |
$post_id = get_the_ID();
|
2490 |
}
|
2491 |
$template = get_post_meta( $post_id, 'wp_review_box_template', true );
|
2492 |
-
$custom
|
2493 |
if ( ! $custom || ! $template ) {
|
2494 |
$template = wp_review_option( 'box_template', 'default' );
|
2495 |
}
|
@@ -2515,10 +2719,12 @@ function wp_review_transient_expired_time() {
|
|
2515 |
* @since 3.0.0
|
2516 |
*/
|
2517 |
function wp_review_clear_cache() {
|
|
|
2518 |
// delete_transient( 'wp_review_recent_reviews_query' );
|
2519 |
// delete_transient( 'wp_review_toprated_reviews_query' );
|
2520 |
// delete_transient( 'wp_review_mostvoted_reviews_query' );
|
2521 |
// delete_transient( 'wp_review_custom_reviews_query' );
|
|
|
2522 |
}
|
2523 |
|
2524 |
|
@@ -2532,8 +2738,6 @@ function wp_review_clear_cache_via_url() {
|
|
2532 |
return;
|
2533 |
}
|
2534 |
wp_review_clear_cache();
|
2535 |
-
// wp_redirect( remove_query_arg( 'clear' ) );
|
2536 |
-
// exit;
|
2537 |
}
|
2538 |
add_action( 'template_redirect', 'wp_review_clear_cache_via_url' );
|
2539 |
|
@@ -2548,11 +2752,13 @@ add_action( 'template_redirect', 'wp_review_clear_cache_via_url' );
|
|
2548 |
* @return WP_Query
|
2549 |
*/
|
2550 |
function wp_review_get_reviews_query( $type, $options ) {
|
2551 |
-
$key = 'wp_review_' . md5(
|
2552 |
-
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
|
|
|
|
2556 |
|
2557 |
if ( ! empty( $options['clear_cache'] ) ) {
|
2558 |
delete_transient( $key );
|
@@ -2564,7 +2770,7 @@ function wp_review_get_reviews_query( $type, $options ) {
|
|
2564 |
}
|
2565 |
|
2566 |
$options['review_type'] = $options['review_type'] ? (array) $options['review_type'] : array();
|
2567 |
-
$options['cat']
|
2568 |
|
2569 |
switch ( $type ) {
|
2570 |
case 'mostvoted':
|
@@ -2585,9 +2791,8 @@ function wp_review_get_reviews_query( $type, $options ) {
|
|
2585 |
|
2586 |
case 'cat':
|
2587 |
$query_args = array(
|
2588 |
-
'orderby'
|
2589 |
-
'order'
|
2590 |
-
// 'cat' => intval( $options['cat'] ),
|
2591 |
'category__in' => $options['cat'],
|
2592 |
);
|
2593 |
break;
|
@@ -2607,13 +2812,13 @@ function wp_review_get_reviews_query( $type, $options ) {
|
|
2607 |
}
|
2608 |
|
2609 |
$query_args['ignore_sticky_posts'] = true;
|
2610 |
-
$query_args['post_type']
|
2611 |
-
$query_args['post_status']
|
2612 |
-
$query_args['posts_per_page']
|
2613 |
-
$query_args['paged']
|
2614 |
|
2615 |
if ( ! empty( $options['number_of_days'] ) && intval( $options['number_of_days'] ) ) {
|
2616 |
-
$date_str
|
2617 |
$query_args['date_query'] = array(
|
2618 |
array(
|
2619 |
'after' => sprintf( $date_str, intval( $options['number_of_days'] ) ),
|
@@ -2627,7 +2832,6 @@ function wp_review_get_reviews_query( $type, $options ) {
|
|
2627 |
if ( ! empty( $options['review_type'] ) ) {
|
2628 |
$meta_query[] = array(
|
2629 |
'key' => 'wp_review_type',
|
2630 |
-
// 'compare' => '==',
|
2631 |
'compare' => 'IN',
|
2632 |
'value' => $options['review_type'],
|
2633 |
);
|
@@ -2749,11 +2953,15 @@ function wp_review_spinner() {
|
|
2749 |
* }
|
2750 |
*/
|
2751 |
function wp_review_visitor_rate( $post_id, $rating_data ) {
|
2752 |
-
$rating_data = wp_parse_args(
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
|
|
|
|
|
|
|
|
2757 |
$output = array(
|
2758 |
'status' => '',
|
2759 |
'html' => '',
|
@@ -2766,7 +2974,7 @@ function wp_review_visitor_rate( $post_id, $rating_data ) {
|
|
2766 |
exit;
|
2767 |
}
|
2768 |
|
2769 |
-
$type
|
2770 |
$rating_type = wp_review_get_rating_type_data( $type );
|
2771 |
if ( ! $rating_type ) {
|
2772 |
echo wp_json_encode( $output );
|
@@ -2788,8 +2996,8 @@ function wp_review_visitor_rate( $post_id, $rating_data ) {
|
|
2788 |
}
|
2789 |
|
2790 |
$user_id = is_user_logged_in() ? get_current_user_id() : 0;
|
2791 |
-
$review
|
2792 |
-
$uip
|
2793 |
|
2794 |
if ( ! function_exists( 'wp_review_comment_duplicate_trigger' ) ) {
|
2795 |
/**
|
@@ -2798,12 +3006,12 @@ function wp_review_visitor_rate( $post_id, $rating_data ) {
|
|
2798 |
* @param array $commentdata Comment data.
|
2799 |
*/
|
2800 |
function wp_review_comment_duplicate_trigger( $commentdata ) {
|
2801 |
-
$post_reviews
|
2802 |
-
$output['status']
|
2803 |
-
$output['error']
|
2804 |
$output['rating_total'] = $post_reviews['rating'];
|
2805 |
$output['rating_count'] = $post_reviews['count'];
|
2806 |
-
$output['html']
|
2807 |
echo wp_json_encode( $output );
|
2808 |
exit;
|
2809 |
}
|
@@ -2843,34 +3051,40 @@ function wp_review_visitor_rate( $post_id, $rating_data ) {
|
|
2843 |
$approve_comment = true;
|
2844 |
}
|
2845 |
|
2846 |
-
$insert = wp_insert_comment(
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
2853 |
-
|
2854 |
-
|
2855 |
-
|
2856 |
-
|
2857 |
-
|
|
|
|
|
2858 |
|
2859 |
if ( $insert ) {
|
2860 |
if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review ) ) {
|
2861 |
if ( ! empty( $rating_data['features'] ) ) {
|
2862 |
update_comment_meta( $insert, WP_REVIEW_COMMENT_FEATURES_RATING_METAKEY, $rating_data['features'] );
|
2863 |
}
|
2864 |
-
$reviews = wp_review_get_post_feature_reviews( $post_id, true );
|
2865 |
|
2866 |
$output['status'] = 'ok';
|
|
|
2867 |
if ( ! empty( $rating_data['features'] ) ) {
|
2868 |
-
$
|
|
|
|
|
2869 |
} else {
|
2870 |
-
$post_reviews
|
2871 |
-
$output['html']
|
|
|
|
|
2872 |
}
|
2873 |
-
|
2874 |
if ( ! $approve_comment ) {
|
2875 |
$output['awaiting_moderation'] = __( 'Your rating is awaiting moderation.', 'wp-review' );
|
2876 |
}
|
@@ -2882,12 +3096,12 @@ function wp_review_visitor_rate( $post_id, $rating_data ) {
|
|
2882 |
}
|
2883 |
} // End if().
|
2884 |
|
2885 |
-
$post_reviews
|
2886 |
-
$output['status']
|
2887 |
-
$output['error']
|
2888 |
$output['rating_total'] = $post_reviews['rating'];
|
2889 |
$output['rating_count'] = $post_reviews['count'];
|
2890 |
-
$output['html']
|
2891 |
echo wp_json_encode( $output );
|
2892 |
exit;
|
2893 |
}
|
@@ -2989,15 +3203,21 @@ function wp_review_enqueue_rating_type_scripts( $type = 'output', array $rating_
|
|
2989 |
}
|
2990 |
}
|
2991 |
|
2992 |
-
// GDPR Compliant - Export User Information
|
2993 |
-
|
2994 |
if ( ! function_exists( 'wp_review_data_exporter' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2995 |
function wp_review_data_exporter( $email_address, $page = 1 ) {
|
2996 |
// Limit us to 500 comments at a time to avoid timing out.
|
2997 |
-
$number
|
2998 |
-
$page
|
2999 |
$data_to_export = array();
|
3000 |
-
$comments
|
3001 |
array(
|
3002 |
'author_email' => $email_address,
|
3003 |
'number' => $number,
|
@@ -3007,16 +3227,18 @@ if ( ! function_exists( 'wp_review_data_exporter' ) ) {
|
|
3007 |
'update_comment_meta_cache' => false,
|
3008 |
)
|
3009 |
);
|
|
|
3010 |
$comment_prop_to_export = array(
|
3011 |
-
'comment_rating'
|
3012 |
-
'features_rating'
|
3013 |
-
'comment_title'
|
3014 |
);
|
|
|
3015 |
foreach ( (array) $comments as $comment ) {
|
3016 |
$comment_data_to_export = array();
|
3017 |
foreach ( $comment_prop_to_export as $key => $name ) {
|
3018 |
$comment_id = $comment->comment_ID;
|
3019 |
-
$value
|
3020 |
if ( ! empty( $value ) ) {
|
3021 |
if ( 'features_rating' !== $key ) {
|
3022 |
$comment_data_to_export[] = array(
|
@@ -3024,15 +3246,15 @@ if ( ! function_exists( 'wp_review_data_exporter' ) ) {
|
|
3024 |
'value' => $value,
|
3025 |
);
|
3026 |
} else {
|
3027 |
-
$post_id
|
3028 |
-
$type
|
3029 |
-
$rating_type
|
3030 |
-
$items
|
3031 |
$rating_items = get_comment_meta( $comment_id, WP_REVIEW_COMMENT_FEATURES_RATING_METAKEY, true );
|
|
|
3032 |
$review_ratings = array();
|
3033 |
foreach ( $items as $item_id => $item ) {
|
3034 |
if ( isset( $rating_items[ $item_id ] ) ) {
|
3035 |
-
$value = $rating_items[ $item_id ];
|
3036 |
$review_ratings[ $item['wp_review_item_title'] ] = $rating_items[ $item_id ] . ' of ' . $rating_type['max'];
|
3037 |
}
|
3038 |
}
|
@@ -3062,12 +3284,18 @@ if ( ! function_exists( 'wp_review_data_exporter' ) ) {
|
|
3062 |
}
|
3063 |
}
|
3064 |
|
3065 |
-
// Filter function to register data exporter
|
3066 |
if ( ! function_exists( 'wp_review_register_data_exporter' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
3067 |
function wp_review_register_data_exporter( $exporters ) {
|
3068 |
$exporters['wp-review'] = array(
|
3069 |
-
'exporter_friendly_name'
|
3070 |
-
'callback'
|
3071 |
);
|
3072 |
return $exporters;
|
3073 |
}
|
@@ -3075,38 +3303,59 @@ if ( ! function_exists( 'wp_review_register_data_exporter' ) ) {
|
|
3075 |
|
3076 |
add_filter( 'wp_privacy_personal_data_exporters', 'wp_review_register_data_exporter', 9 );
|
3077 |
|
3078 |
-
|
3079 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3080 |
$value = false;
|
3081 |
-
if(is_multisite() && !is_main_site()) {
|
3082 |
$site_id = get_current_blog_id();
|
3083 |
-
switch_to_blog(get_network()->site_id);
|
3084 |
-
$options
|
3085 |
-
$hide_options = isset($options['hide_global_options_'
|
3086 |
-
if($hide_options) {
|
3087 |
$value = true;
|
3088 |
-
} elseif($option) {
|
3089 |
-
$hide_options = isset($options[$option
|
3090 |
-
if($hide_options)
|
|
|
|
|
|
|
|
|
|
|
3091 |
}
|
3092 |
-
if($value) restore_current_blog();
|
3093 |
}
|
3094 |
return $value;
|
3095 |
}
|
3096 |
|
3097 |
-
|
3098 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3099 |
$value = false;
|
3100 |
-
if(is_multisite() && !is_main_site()) {
|
3101 |
$site_id = get_current_blog_id();
|
3102 |
-
switch_to_blog(get_network()->site_id);
|
3103 |
-
$options = get_option('wp_review_options');
|
3104 |
-
$value
|
3105 |
restore_current_blog();
|
3106 |
}
|
3107 |
return $value;
|
3108 |
}
|
3109 |
|
|
|
|
|
|
|
|
|
|
|
3110 |
function wp_review_get_capabilities() {
|
3111 |
return array(
|
3112 |
'wp_review_global_options' => esc_html__( 'Global Options', 'wp-review' ),
|
@@ -3121,57 +3370,69 @@ function wp_review_get_capabilities() {
|
|
3121 |
);
|
3122 |
}
|
3123 |
|
3124 |
-
add_filter(
|
3125 |
-
|
3126 |
-
|
3127 |
-
|
3128 |
-
|
3129 |
-
|
3130 |
-
'wp_review',
|
3131 |
-
array(
|
3132 |
-
'label' => __( 'WP Review', 'wp-review' ),
|
3133 |
-
'caps' => array(),
|
3134 |
-
'icon' => 'dashicons-star-filled',
|
3135 |
-
'priority' => 10
|
3136 |
-
)
|
3137 |
-
);
|
3138 |
-
});
|
3139 |
|
3140 |
-
add_action(
|
3141 |
-
|
3142 |
-
|
3143 |
-
|
|
|
3144 |
array(
|
3145 |
-
'label'
|
3146 |
-
'
|
|
|
|
|
3147 |
)
|
3148 |
);
|
3149 |
}
|
3150 |
-
|
3151 |
-
|
3152 |
-
add_action(
|
3153 |
-
|
3154 |
-
|
3155 |
-
|
3156 |
-
|
3157 |
-
|
3158 |
-
|
3159 |
-
|
|
|
|
|
|
|
3160 |
}
|
3161 |
-
|
3162 |
-
|
3163 |
-
|
3164 |
-
|
3165 |
-
|
3166 |
-
|
3167 |
-
|
3168 |
-
|
3169 |
-
'
|
3170 |
-
|
3171 |
-
|
3172 |
-
|
3173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3174 |
}
|
3175 |
-
update_option( 'wp_review_compatibility', true );
|
3176 |
}
|
3177 |
-
|
39 |
* @return array
|
40 |
*/
|
41 |
function wp_review_get_default_colors() {
|
42 |
+
$default_colors = array(
|
43 |
+
'color' => '#1e73be',
|
44 |
'inactive_color' => '#95bae0',
|
45 |
+
'fontcolor' => '#555555',
|
46 |
+
'bgcolor1' => '#e7e7e7',
|
47 |
+
'bgcolor2' => '#ffffff',
|
48 |
+
'bordercolor' => '#e7e7e7',
|
49 |
+
);
|
50 |
+
|
51 |
+
$custom_default_colors = apply_filters( 'wp_review_default_colors', $default_colors );
|
52 |
+
|
53 |
+
return array_merge( $default_colors, $custom_default_colors );
|
54 |
}
|
55 |
|
56 |
|
91 |
*
|
92 |
* @since 3.0.0
|
93 |
*
|
94 |
+
* @return array
|
95 |
*/
|
96 |
function wp_review_get_default_criteria() {
|
97 |
$default_criteria = apply_filters( 'wp_review_default_criteria', array() );
|
130 |
add_image_size( 'wp_review_small', 65, 65, true );
|
131 |
|
132 |
// Filter to add custom images sizes in Thumbnail selection box.
|
133 |
+
add_filter(
|
134 |
+
'image_size_names_choose',
|
135 |
+
function( $sizes ) {
|
136 |
+
return array_merge(
|
137 |
+
$sizes,
|
138 |
+
apply_filters(
|
139 |
+
'wp_review_custom_image_sizes',
|
140 |
+
array(
|
141 |
+
'wp_review_small' => __( 'WP Review Small', 'wp-review' ),
|
142 |
+
'wp_review_large' => __( 'WP Review Large', 'wp-review' ),
|
143 |
+
)
|
144 |
+
)
|
145 |
+
);
|
146 |
+
}
|
147 |
+
);
|
148 |
|
149 |
|
150 |
/**
|
154 |
* @since 1.0
|
155 |
*
|
156 |
* @param int $post_id Post ID.
|
157 |
+
* @return string
|
158 |
*/
|
159 |
function wp_review_get_data( $post_id = null ) {
|
160 |
return wp_review_get_review_box( $post_id );
|
168 |
* @return string
|
169 |
*/
|
170 |
function wp_review_inject_data( $content ) {
|
171 |
+
$post_id = get_the_ID();
|
172 |
+
$options = get_option( 'wp_review_options' );
|
173 |
$custom_location = get_post_meta( $post_id, 'wp_review_custom_location', true );
|
174 |
+
$location = get_post_meta( $post_id, 'wp_review_location', true );
|
175 |
if ( ! $custom_location && ! empty( $options['review_location'] ) ) {
|
176 |
$location = $options['review_location'];
|
177 |
}
|
186 |
global $multipage, $numpages, $page;
|
187 |
if ( $multipage ) {
|
188 |
if ( $page == $numpages ) {
|
189 |
+
return $content . $review;
|
190 |
} else {
|
191 |
return $content;
|
192 |
}
|
193 |
} else {
|
194 |
+
return $content . $review;
|
195 |
}
|
196 |
} elseif ( 'top' == $location ) {
|
197 |
+
return $review . $content;
|
198 |
} else {
|
199 |
return $content;
|
200 |
}
|
220 |
$post_id = get_the_ID();
|
221 |
}
|
222 |
|
223 |
+
$type = wp_review_get_post_review_type( $post_id );
|
224 |
$user_type = wp_review_get_post_user_review_type( $post_id );
|
225 |
if ( ! $type && ! $user_type ) {
|
226 |
return '';
|
230 |
|
231 |
// Fix for themes.
|
232 |
if ( false !== strpos( $class, 'latestPost-review-wrapper' ) ) {
|
233 |
+
$args['color'] = '#fff';
|
234 |
$args['inactive_color'] = '#dedcdc';
|
235 |
}
|
236 |
// Fix for rank-math.
|
237 |
if ( false !== strpos( $class, 'rank-math-snippet' ) ) {
|
238 |
+
$args['color'] = '#fff';
|
239 |
$args['inactive_color'] = '#dedcdc';
|
240 |
}
|
241 |
|
242 |
$show_on_thumbnails_type = 'author';
|
243 |
$show_on_thumbnails_type = apply_filters( 'wp_review_thumbnails_total', $show_on_thumbnails_type, $post_id, $args ); // Will override option.
|
244 |
|
245 |
+
$rating = '';
|
246 |
+
$total = '';
|
247 |
switch ( $show_on_thumbnails_type ) {
|
248 |
case 'author':
|
249 |
$total = get_post_meta( $post_id, 'wp_review_total', true );
|
302 |
* @return array
|
303 |
*/
|
304 |
function mts_get_post_reviews( $post_id, $force = false ) {
|
305 |
+
$post_reviews = get_post_meta( $post_id, 'wp_review_user_reviews', true );
|
306 |
+
$review_count = (int) get_post_meta( $post_id, 'wp_review_review_count', true );
|
307 |
$positive_count = (int) get_post_meta( $post_id, 'wp_review_positive_count', true );
|
308 |
$negative_count = (int) get_post_meta( $post_id, 'wp_review_negative_count', true );
|
309 |
|
317 |
}
|
318 |
|
319 |
if ( is_numeric( $post_id ) && $post_id > 0 ) {
|
320 |
+
$comments = get_comments(
|
321 |
+
array(
|
322 |
+
'post_id' => $post_id,
|
323 |
+
'type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
|
324 |
+
'status' => 'approve',
|
325 |
+
)
|
326 |
+
);
|
327 |
+
$rating = array_reduce( $comments, 'wpreview_visitor_ratings_callback', 0 );
|
328 |
+
$count = count( $comments );
|
329 |
$post_reviews = array(
|
330 |
'rating' => $count > 0 ? round( $rating / $count, 2 ) : 0,
|
331 |
'count' => $count,
|
332 |
);
|
333 |
|
334 |
+
$positive_comments = get_comments(
|
335 |
+
array(
|
336 |
+
'post_id' => $post_id,
|
337 |
+
'type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
|
338 |
+
'status' => 'approve',
|
339 |
+
'fields' => 'ids',
|
340 |
+
'meta_key' => WP_REVIEW_VISITOR_RATING_METAKEY,
|
341 |
+
'meta_value' => 100,
|
342 |
+
)
|
343 |
+
);
|
344 |
+
|
345 |
$post_reviews['positive_count'] = count( $positive_comments );
|
346 |
|
347 |
+
$negative_comments = get_comments(
|
348 |
+
array(
|
349 |
+
'post_id' => $post_id,
|
350 |
+
'type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
|
351 |
+
'status' => 'approve',
|
352 |
+
'fields' => 'ids',
|
353 |
+
'meta_key' => WP_REVIEW_VISITOR_RATING_METAKEY,
|
354 |
+
'meta_value' => 0,
|
355 |
+
)
|
356 |
+
);
|
357 |
+
|
358 |
$post_reviews['negative_count'] = count( $negative_comments );
|
359 |
|
360 |
update_post_meta( $post_id, 'wp_review_user_reviews', $post_reviews['rating'] );
|
375 |
* @return array
|
376 |
*/
|
377 |
function mts_get_post_comments_reviews( $post_id, $force = false ) {
|
378 |
+
$post_reviews = get_post_meta( $post_id, 'wp_review_comments_rating_value', true );
|
379 |
+
$review_count = (int) get_post_meta( $post_id, 'wp_review_comments_rating_count', true );
|
380 |
$positive_count = (int) get_post_meta( $post_id, 'wp_review_comments_positive_count', true );
|
381 |
$negative_count = (int) get_post_meta( $post_id, 'wp_review_comments_negative_count', true );
|
382 |
|
383 |
if ( ! $force && $post_reviews && $review_count ) {
|
384 |
return array(
|
385 |
+
'rating' => $post_reviews,
|
386 |
+
'count' => $review_count,
|
387 |
'positive_count' => $positive_count,
|
388 |
'negative_count' => $negative_count,
|
389 |
);
|
390 |
}
|
391 |
|
392 |
if ( is_numeric( $post_id ) && $post_id > 0 ) {
|
393 |
+
$comments = get_comments(
|
394 |
+
array(
|
395 |
+
'post_id' => $post_id,
|
396 |
+
'type' => WP_REVIEW_COMMENT_TYPE_COMMENT,
|
397 |
+
'status' => 'approve',
|
398 |
+
)
|
399 |
+
);
|
400 |
+
$rating = array_reduce( $comments, 'wpreview_comment_ratings_callback', 0 );
|
401 |
+
$count = count( $comments );
|
402 |
$post_reviews = array(
|
403 |
'rating' => $count > 0 ? round( $rating / $count, 2 ) : 0,
|
404 |
+
'count' => $count,
|
405 |
+
);
|
406 |
+
|
407 |
+
$positive_comments = get_comments(
|
408 |
+
array(
|
409 |
+
'post_id' => $post_id,
|
410 |
+
'type' => WP_REVIEW_COMMENT_TYPE_COMMENT,
|
411 |
+
'status' => 'approve',
|
412 |
+
'fields' => 'ids',
|
413 |
+
'meta_key' => WP_REVIEW_COMMENT_RATING_METAKEY,
|
414 |
+
'meta_value' => 100,
|
415 |
+
)
|
416 |
);
|
417 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
418 |
$post_reviews['positive_count'] = count( $positive_comments );
|
419 |
|
420 |
+
$negative_comments = get_comments(
|
421 |
+
array(
|
422 |
+
'post_id' => $post_id,
|
423 |
+
'type' => WP_REVIEW_COMMENT_TYPE_COMMENT,
|
424 |
+
'status' => 'approve',
|
425 |
+
'fields' => 'ids',
|
426 |
+
'meta_key' => WP_REVIEW_COMMENT_RATING_METAKEY,
|
427 |
+
'meta_value' => 0,
|
428 |
+
)
|
429 |
+
);
|
430 |
+
|
431 |
$post_reviews['negative_count'] = count( $negative_comments );
|
432 |
|
433 |
update_post_meta( $post_id, 'wp_review_comments_rating_value', $post_reviews['rating'] );
|
454 |
}
|
455 |
|
456 |
$post_meta_key = "wp_review_{$type}_feature_reviews";
|
457 |
+
$reviews = get_post_meta( $post_id, $post_meta_key, true );
|
458 |
if ( ! $force && $reviews ) {
|
459 |
return $reviews;
|
460 |
}
|
463 |
if ( ! $features ) {
|
464 |
return array();
|
465 |
}
|
466 |
+
$comments = get_comments(
|
467 |
+
array(
|
468 |
+
'post_id' => $post_id,
|
469 |
+
'type' => 'comment' === $type ? WP_REVIEW_COMMENT_TYPE_COMMENT : WP_REVIEW_COMMENT_TYPE_VISITOR,
|
470 |
+
'status' => 'approve',
|
471 |
+
)
|
472 |
+
);
|
473 |
+
$reviews = array();
|
474 |
foreach ( $features as $value ) {
|
475 |
$reviews[ $value['id'] ] = array(
|
476 |
'total' => 0,
|
535 |
}
|
536 |
add_action( 'transition_comment_status', 'wp_review_on_change_comment_status', 10, 3 );
|
537 |
|
538 |
+
/**
|
539 |
+
* Comments rating callback for array_reduce().
|
540 |
+
*
|
541 |
+
* @param float $carry Rating.
|
542 |
+
* @param object $comment Comment object.
|
543 |
+
* @return float
|
544 |
+
*/
|
545 |
function wpreview_comment_ratings_callback( $carry, $comment ) {
|
546 |
$rating = get_comment_meta( $comment->comment_ID, WP_REVIEW_COMMENT_RATING_METAKEY, true );
|
547 |
$carry += floatval( $rating );
|
548 |
return $carry;
|
549 |
}
|
550 |
|
551 |
+
/**
|
552 |
+
* Visitors rating callback for array_reduce().
|
553 |
+
*
|
554 |
+
* @param float $carry Rating.
|
555 |
+
* @param object $comment Comment object.
|
556 |
+
* @return float
|
557 |
+
*/
|
558 |
function wpreview_visitor_ratings_callback( $carry, $comment ) {
|
559 |
$rating = get_comment_meta( $comment->comment_ID, WP_REVIEW_VISITOR_RATING_METAKEY, true );
|
560 |
$carry += floatval( $rating );
|
571 |
* @param string $type Rating type.
|
572 |
* @return bool
|
573 |
*/
|
574 |
+
function hasPreviousReview( $post_id, $user_id, $ip, $type = 'any' ) { // phpcs:ignore
|
575 |
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_review_has_reviewed' );
|
576 |
return wp_review_has_reviewed( $post_id, $user_id, $ip, $type );
|
577 |
}
|
638 |
* @return WP_Comment|false
|
639 |
*/
|
640 |
function wp_review_get_previous_review_comment( $comment ) {
|
641 |
+
$post_id = $comment->comment_post_ID;
|
642 |
$query_args = array(
|
643 |
+
'post_id' => $post_id,
|
644 |
+
'type_in' => array( WP_REVIEW_COMMENT_TYPE_COMMENT ),
|
645 |
+
'meta_key' => WP_REVIEW_COMMENT_RATING_METAKEY,
|
646 |
+
'meta_value' => 0,
|
647 |
'meta_compare' => '>',
|
648 |
);
|
649 |
|
671 |
* @param WP_Comment_Query $query Comment query.
|
672 |
* @return WP_Comment_Query
|
673 |
*/
|
674 |
+
function wp_review_add_comment_type_to_query( WP_Comment_Query $query ) {
|
675 |
$commenttype = get_query_var( 'wp_review_commenttype' );
|
676 |
if ( 'any' === $commenttype ) {
|
677 |
$query->query_vars['type__in'] = array( WP_REVIEW_COMMENT_TYPE_COMMENT, WP_REVIEW_COMMENT_TYPE_VISITOR );
|
693 |
return $clauses;
|
694 |
}
|
695 |
|
696 |
+
/**
|
697 |
+
* Gets previous preview.
|
698 |
+
*
|
699 |
+
* @param int $post_id Post ID.
|
700 |
+
* @param int $user_id User ID.
|
701 |
+
* @param string $ip IP Address.
|
702 |
+
* @param string $type Review type.
|
703 |
+
* @return bool
|
704 |
+
*/
|
705 |
+
function getPreviousReview( $post_id, $user_id, $ip, $type = 'any' ) { // phpcs:ignore
|
706 |
+
if ( is_numeric( $post_id ) && $post_id > 0 ) {
|
707 |
+
$args = array(
|
708 |
+
'post_id' => $post_id,
|
709 |
+
'user_id' => 0,
|
710 |
+
);
|
711 |
set_query_var( 'wp_review_commenttype', $type );
|
712 |
add_filter( 'pre_get_comments', 'wp_review_add_comment_type_to_query' );
|
713 |
if ( $user_id ) {
|
728 |
return false;
|
729 |
}
|
730 |
|
731 |
+
/**
|
732 |
+
* Sets theme defaults.
|
733 |
+
*
|
734 |
+
* @param array $new_options New options.
|
735 |
+
* @param bool $force_change Force changes.
|
736 |
+
*/
|
737 |
function wp_review_theme_defaults( $new_options, $force_change = false ) {
|
738 |
global $pagenow;
|
739 |
$opt_name = 'wp_review_options_' . wp_get_theme();
|
740 |
+
$options = get_option( 'wp_review_options' );
|
741 |
if ( empty( $options ) ) {
|
742 |
$options = array();
|
743 |
}
|
744 |
$options_updated = get_option( $opt_name );
|
745 |
// If the theme was just activated OR options weren't updated yet.
|
746 |
+
if ( empty( $options_updated ) || $options_updated != $new_options || $force_change || ( isset( $_GET['activated'] ) && 'themes.php' == $pagenow ) ) {
|
747 |
update_option( 'wp_review_options', array_merge( $options, $new_options ) );
|
748 |
update_option( $opt_name, $new_options );
|
749 |
}
|
750 |
}
|
751 |
|
752 |
+
/**
|
753 |
+
* Gets all image sizes.
|
754 |
+
*
|
755 |
+
* @return array
|
756 |
+
*/
|
757 |
function wp_review_get_all_image_sizes() {
|
758 |
global $_wp_additional_image_sizes;
|
759 |
|
760 |
$default_image_sizes = array( 'thumbnail', 'medium', 'large' );
|
761 |
|
762 |
foreach ( $default_image_sizes as $size ) {
|
763 |
+
$image_sizes[ $size ]['width'] = intval( get_option( "{$size}_size_w" ) );
|
764 |
$image_sizes[ $size ]['height'] = intval( get_option( "{$size}_size_h" ) );
|
765 |
+
$image_sizes[ $size ]['crop'] = get_option( "{$size}_crop" ) ? get_option( "{$size}_crop" ) : false;
|
766 |
}
|
767 |
|
768 |
if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) {
|
775 |
/**
|
776 |
* Exclude review-type comments from being included in the comment query.
|
777 |
*
|
778 |
+
* @param WP_Comment_Query $query Comment query.
|
779 |
*/
|
780 |
+
function wp_review_exclude_review_comments( WP_Comment_Query $query ) {
|
781 |
+
if ( ! is_admin() && ( WP_REVIEW_COMMENT_TYPE_VISITOR !== $query->query_vars['type'] && ! in_array( WP_REVIEW_COMMENT_TYPE_VISITOR, (array) $query->query_vars['type__in'] ) ) ) {
|
782 |
$query->query_vars['type__not_in'] = array_merge(
|
783 |
is_array( $query->query_vars['type__not_in'] ) ? $query->query_vars['type__not_in'] : array(),
|
784 |
array( WP_REVIEW_COMMENT_TYPE_VISITOR )
|
790 |
/**
|
791 |
* Add "Reviews" to comments table view.
|
792 |
*
|
793 |
+
* @param array $comment_types Comment types.
|
|
|
794 |
* @return mixed
|
795 |
*/
|
796 |
function wp_review_add_to_comment_table_dropdown( $comment_types ) {
|
816 |
* 3 - Both
|
817 |
*/
|
818 |
function wp_review_get_user_rating_setup( $post_id ) {
|
819 |
+
$default = wp_review_option( 'default_user_review_type', WP_REVIEW_REVIEW_DISABLED );
|
820 |
$user_reviews = get_post_meta( $post_id, 'wp_review_userReview', true );
|
821 |
+
$enabled = '' === $user_reviews ? $default : (int) $user_reviews;
|
822 |
if ( is_array( $user_reviews ) ) {
|
823 |
$enabled = (int) $user_reviews[0];
|
824 |
}
|
825 |
|
826 |
// Reviews through comments: enabled by default.
|
827 |
$review_through_comment = get_post_meta( $post_id, 'wp_review_through_comment', true );
|
828 |
+
$custom_fields = get_post_custom();
|
829 |
if ( ! isset( $custom_fields['wp_review_through_comment'] ) ) {
|
830 |
$review_through_comment = 0;
|
831 |
}
|
843 |
|
844 |
/**
|
845 |
* Exclude visitor ratings when updating a post's comment count.
|
846 |
+
*
|
847 |
+
* @param int $post_id Post ID.
|
848 |
+
* @param object $new New comment.
|
849 |
+
* @param object $old Old comment.
|
850 |
*
|
851 |
* @internal param $comment_id
|
852 |
* @internal param $comment
|
853 |
*/
|
854 |
function wp_review_exclude_visitor_review_count( $post_id, $new, $old ) {
|
855 |
global $wpdb;
|
856 |
+
$count = get_comments(
|
857 |
+
array(
|
858 |
+
'type__not_in' => array( WP_REVIEW_COMMENT_TYPE_VISITOR ),
|
859 |
+
'post_id' => $post_id,
|
860 |
+
'count' => true,
|
861 |
+
)
|
862 |
+
);
|
863 |
$wpdb->update( $wpdb->posts, array( 'comment_count' => $count ), array( 'ID' => $post_id ) );
|
864 |
|
865 |
// Update user review count.
|
876 |
* @return string
|
877 |
*/
|
878 |
function wp_review_get_review_schema( $post_id ) {
|
879 |
+
$schema = get_post_meta( $post_id, 'wp_review_schema', true );
|
880 |
$schemas = wp_review_schema_types();
|
881 |
|
882 |
if ( empty( $schema ) || ! isset( $schemas[ $schema ] ) ) {
|
918 |
return $review;
|
919 |
}
|
920 |
|
921 |
+
$allowed_class = 'allowed-to-rate';
|
922 |
+
$has_not_rated_class = ' has-not-rated-yet';
|
923 |
+
$post_reviews = mts_get_post_reviews( $post_id );
|
924 |
+
$user_total = $post_reviews['rating'];
|
925 |
$users_reviews_count = $post_reviews['count'];
|
926 |
+
$positive_rating = $post_reviews['positive_count'];
|
927 |
+
$negative_rating = $post_reviews['negative_count'];
|
928 |
+
$total = get_post_meta( $post_id, 'wp_review_total', true );
|
929 |
+
$type = get_post_meta( $post_id, 'wp_review_user_review_type', true );
|
930 |
|
931 |
$options = get_option( 'wp_review_options' );
|
932 |
+
$colors = wp_review_get_colors( $post_id );
|
933 |
+
$color = $colors['color'];
|
934 |
|
935 |
$user_id = '';
|
936 |
if ( is_user_logged_in() ) {
|
955 |
$review = ob_get_contents();
|
956 |
ob_end_clean();
|
957 |
|
958 |
+
if ( '0.0' !== $user_total && '' === $total ) { // Dont'show if no user ratings and there is review.
|
959 |
$review .= '<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
|
960 |
<meta itemprop="ratingValue" content="' . $user_total . '" />
|
961 |
<meta itemprop="reviewCount" content="' . $users_reviews_count . '" />
|
967 |
|
968 |
|
969 |
/**
|
970 |
+
* Get the path to a rating template prioritizing theme directory first.
|
971 |
*
|
972 |
+
* @param string $type Rating type.
|
973 |
+
* @param string $default Default rating type.
|
974 |
*
|
975 |
* @return string
|
976 |
*/
|
1023 |
return true;
|
1024 |
}
|
1025 |
|
1026 |
+
/**
|
1027 |
+
* Registers default rating types.
|
1028 |
+
*/
|
1029 |
function wp_review_register_default_rating_types() {
|
1030 |
+
wp_review_register_rating_type(
|
1031 |
+
'star',
|
1032 |
+
array(
|
1033 |
+
'label' => __( 'Star', 'wp-review' ),
|
1034 |
+
'max' => 5,
|
1035 |
+
'decimals' => 1,
|
1036 |
+
// translators: rating value text.
|
1037 |
+
'value_text' => _x( '%s Stars', 'star rating value text', 'wp-review' ),
|
1038 |
+
// translators: rating value singular text.
|
1039 |
+
'value_text_singular' => _x( '%s Star', 'star rating value text singular', 'wp-review' ),
|
1040 |
+
'input_template' => WP_REVIEW_DIR . 'rating-types/star-input.php',
|
1041 |
+
'output_template' => WP_REVIEW_DIR . 'rating-types/star-output.php',
|
1042 |
+
)
|
1043 |
+
);
|
1044 |
+
|
1045 |
+
wp_review_register_rating_type(
|
1046 |
+
'point',
|
1047 |
+
array(
|
1048 |
+
'label' => __( 'Point', 'wp-review' ),
|
1049 |
+
'max' => 10,
|
1050 |
+
'decimals' => 1,
|
1051 |
+
// translators: rating value text.
|
1052 |
+
'value_text' => _x( '%s/10', 'point rating value text', 'wp-review' ),
|
1053 |
+
// translators: rating value singular text.
|
1054 |
+
'value_text_singular' => _x( '%s/10', 'point rating value text singular', 'wp-review' ),
|
1055 |
+
'input_template' => WP_REVIEW_DIR . 'rating-types/point-input.php',
|
1056 |
+
'output_template' => WP_REVIEW_DIR . 'rating-types/point-output.php',
|
1057 |
+
)
|
1058 |
+
);
|
1059 |
+
|
1060 |
+
wp_review_register_rating_type(
|
1061 |
+
'percentage',
|
1062 |
+
array(
|
1063 |
+
'label' => __( 'Percentage', 'wp-review' ),
|
1064 |
+
'max' => 100,
|
1065 |
+
'decimals' => 1,
|
1066 |
+
// translators: rating value text.
|
1067 |
+
'value_text' => _x( '%s%%', 'percentage rating value text', 'wp-review' ),
|
1068 |
+
// translators: rating value singular text.
|
1069 |
+
'value_text_singular' => _x( '%s%%', 'percentage rating value text singular', 'wp-review' ),
|
1070 |
+
'input_template' => WP_REVIEW_DIR . 'rating-types/percentage-input.php',
|
1071 |
+
'output_template' => WP_REVIEW_DIR . 'rating-types/percentage-output.php',
|
1072 |
+
)
|
1073 |
+
);
|
1074 |
+
|
1075 |
+
wp_review_register_rating_type(
|
1076 |
+
'circle',
|
1077 |
+
array(
|
1078 |
+
'label' => __( 'Circle', 'wp-review' ),
|
1079 |
+
'max' => 100,
|
1080 |
+
'decimals' => 2,
|
1081 |
+
// translators: rating value text.
|
1082 |
+
'value_text' => _x( '%s', 'circle rating value text', 'wp-review' ), // phpcs:ignore
|
1083 |
+
// translators: rating value singular text.
|
1084 |
+
'value_text_singular' => _x( '%s', 'circle rating value text singular', 'wp-review' ), // phpcs:ignore
|
1085 |
+
'input_template' => WP_REVIEW_DIR . 'rating-types/circle-input.php',
|
1086 |
+
'output_template' => WP_REVIEW_DIR . 'rating-types/circle-output.php',
|
1087 |
+
)
|
1088 |
+
);
|
1089 |
+
|
1090 |
+
wp_review_register_rating_type(
|
1091 |
+
'thumbs',
|
1092 |
+
array(
|
1093 |
+
'label' => __( 'Thumbs', 'wp-review' ),
|
1094 |
+
'max' => 100,
|
1095 |
+
'decimals' => 0,
|
1096 |
+
// translators: rating value text.
|
1097 |
+
'value_text' => _x( '%s/100', 'thumbs rating value text', 'wp-review' ),
|
1098 |
+
// translators: rating value singular text.
|
1099 |
+
'value_text_singular' => _x( '%s/100', 'thumbs rating value text singular', 'wp-review' ),
|
1100 |
+
'input_template' => WP_REVIEW_DIR . 'rating-types/thumbs-input.php',
|
1101 |
+
'output_template' => WP_REVIEW_DIR . 'rating-types/thumbs-output.php',
|
1102 |
+
)
|
1103 |
+
);
|
1104 |
}
|
1105 |
add_action( 'init', 'wp_review_register_default_rating_types' );
|
1106 |
|
1132 |
if ( ! isset( $rating_types[ $type ] ) ) {
|
1133 |
return false;
|
1134 |
}
|
1135 |
+
return wp_parse_args(
|
1136 |
+
$rating_types[ $type ],
|
1137 |
+
array(
|
1138 |
+
'label' => '',
|
1139 |
+
'max' => 5,
|
1140 |
+
'decimals' => 0,
|
1141 |
+
'value_text' => '',
|
1142 |
+
'value_text_singular' => '',
|
1143 |
+
'input_template' => '',
|
1144 |
+
'output_template' => '',
|
1145 |
+
)
|
1146 |
+
);
|
1147 |
}
|
1148 |
|
1149 |
|
1199 |
$type = get_post_meta( $post_id, 'wp_review_user_review_type', true );
|
1200 |
|
1201 |
$user_rating_setup = wp_review_get_user_rating_setup( $post_id );
|
1202 |
+
$user_reviews = in_array( $user_rating_setup, array( WP_REVIEW_REVIEW_VISITOR_ONLY, WP_REVIEW_REVIEW_COMMENT_ONLY, WP_REVIEW_REVIEW_ALLOW_BOTH ) );
|
1203 |
if ( ! $user_reviews ) {
|
1204 |
return ''; // User ratings not enabled.
|
1205 |
}
|
1217 |
* @param int $post_id Post ID.
|
1218 |
* @return string
|
1219 |
*/
|
1220 |
+
function wp_review_get_post_box_template( $post_id = null ) {
|
1221 |
+
global $post;
|
1222 |
|
1223 |
if ( empty( $post_id ) ) {
|
1224 |
$post_id = $post->ID;
|
1225 |
}
|
1226 |
|
1227 |
+
$template = wp_review_get_box_template( $post_id );
|
1228 |
$template .= '.php';
|
1229 |
if ( empty( $template ) || ! wp_review_locate_box_template( $template ) ) {
|
1230 |
+
$template = 'default.php'; // fallback to default.php.
|
1231 |
}
|
1232 |
|
1233 |
return apply_filters( 'wp_review_get_box_template', $template, $post_id );
|
1234 |
}
|
1235 |
|
1236 |
+
/**
|
1237 |
+
* Gets template file path.
|
1238 |
+
*
|
1239 |
+
* @param string $template_name Template file name.
|
1240 |
+
* @param bool $return_full_path Return full path or not.
|
1241 |
+
* @return string
|
1242 |
+
*/
|
1243 |
function wp_review_locate_box_template( $template_name, $return_full_path = true ) {
|
1244 |
// We look for box templates in:
|
1245 |
// 1. plugins_dir/box-templates
|
1246 |
// 2. theme_dir/wp-review
|
1247 |
// 3. childtheme_dir/wp-review
|
1248 |
+
// 4... Use filter to add more.
|
1249 |
+
$default_paths = array(
|
1250 |
WP_REVIEW_DIR . 'box-templates',
|
1251 |
get_template_directory() . '/wp-review',
|
1252 |
get_stylesheet_directory() . '/wp-review',
|
1253 |
);
|
1254 |
$template_paths = apply_filters( 'wp_review_box_template_paths', $default_paths );
|
1255 |
|
1256 |
+
$paths = array_reverse( $template_paths );
|
1257 |
+
$located = '';
|
|
|
1258 |
$path_partial = '';
|
1259 |
foreach ( $paths as $path ) {
|
1260 |
+
$full_path = trailingslashit( $path ) . $template_name;
|
1261 |
+
if ( file_exists( $full_path ) ) {
|
1262 |
+
$located = $full_path;
|
1263 |
$path_partial = $path;
|
1264 |
break;
|
1265 |
}
|
1295 |
function wp_review_load_template( $template_name, $data = array() ) {
|
1296 |
$path = wp_review_locate_template( $template_name, true );
|
1297 |
if ( $path ) {
|
1298 |
+
extract( $data ); // phpcs:ignore
|
1299 |
+
include $path; // phpcs:ignore
|
1300 |
}
|
1301 |
}
|
1302 |
|
1336 |
}
|
1337 |
|
1338 |
$colors = apply_filters( 'wp_review_colors', $colors, $post_id );
|
1339 |
+
$color = $colors['color'];
|
1340 |
|
1341 |
// Don't allow higher rating than max.
|
1342 |
if ( $value > $rating_type['max'] ) {
|
1343 |
$value = $rating_type['max'];
|
1344 |
}
|
1345 |
+
$template = $rating_type['output_template'];
|
1346 |
$comment_rating = false;
|
1347 |
set_query_var( 'rating', compact( 'value', 'post_id', 'type', 'args', 'comment_rating', 'color', 'colors' ) );
|
1348 |
ob_start();
|
1352 |
return $review;
|
1353 |
}
|
1354 |
|
1355 |
+
/**
|
1356 |
+
* Gets user rating.
|
1357 |
+
*
|
1358 |
+
* @param int $post_id Post ID.
|
1359 |
+
* @param array $args Custom args.
|
1360 |
+
* @return string
|
1361 |
+
*/
|
1362 |
function wp_review_user_rating( $post_id = null, $args = array() ) {
|
1363 |
$options = get_option( 'wp_review_options' );
|
1364 |
+
$type = wp_review_get_post_user_review_type( $post_id );
|
1365 |
if ( empty( $type ) ) {
|
1366 |
return '';
|
1367 |
}
|
1368 |
|
1369 |
$rating_type = wp_review_get_rating_type_data( $type );
|
|
|
1370 |
|
1371 |
+
$post_reviews = mts_get_post_reviews( $post_id );
|
1372 |
+
$value = ! empty( $post_reviews['rating'] ) ? $post_reviews['rating'] : '0.0';
|
1373 |
$args['positive_count'] = isset( $post_reviews['positive_count'] ) ? $post_reviews['positive_count'] : 0;
|
1374 |
$args['negative_count'] = isset( $post_reviews['negative_count'] ) ? $post_reviews['negative_count'] : 0;
|
|
|
|
|
1375 |
|
1376 |
$user_id = '';
|
1377 |
if ( is_user_logged_in() ) {
|
1379 |
}
|
1380 |
|
1381 |
if ( wp_review_has_reviewed( $post_id, $user_id, wp_review_get_user_ip(), WP_REVIEW_COMMENT_TYPE_VISITOR ) || ( ! is_user_logged_in() && ! empty( $options['registered_only'] ) ) ) {
|
1382 |
+
$output = wp_review_rating(
|
1383 |
+
$value,
|
1384 |
+
$post_id,
|
1385 |
+
array(
|
1386 |
+
'user_rating' => true,
|
1387 |
+
'positive_count' => $args['positive_count'],
|
1388 |
+
'negative_count' => $args['negative_count'],
|
1389 |
+
)
|
1390 |
+
); // Return just output template.
|
1391 |
return $output;
|
1392 |
}
|
1393 |
|
1394 |
$colors = wp_review_get_colors( $post_id );
|
1395 |
+
$color = $colors['color'];
|
1396 |
|
1397 |
$rating_type_template = $rating_type['input_template'];
|
1398 |
+
$comment_rating = false;
|
1399 |
set_query_var( 'rating', compact( 'value', 'post_id', 'comment_rating', 'args', 'color', 'colors' ) );
|
1400 |
ob_start();
|
1401 |
load_template( $rating_type_template, false );
|
1422 |
|
1423 |
$args = wp_parse_args( $args, array( 'type' => 'user' ) );
|
1424 |
|
1425 |
+
$type = wp_review_get_post_user_review_type( $post_id );
|
1426 |
$rating_type = wp_review_get_rating_type_data( $type );
|
1427 |
if ( empty( $rating_type ) ) {
|
1428 |
return '';
|
1429 |
}
|
1430 |
|
1431 |
$colors = wp_review_get_colors( $post_id );
|
1432 |
+
$color = $colors['color'];
|
1433 |
|
1434 |
+
$user_has_reviewed = wp_review_has_reviewed( $post_id, get_current_user_id(), wp_review_get_user_ip(), 'comment' === $args['type'] ? WP_REVIEW_COMMENT_TYPE_COMMENT : WP_REVIEW_COMMENT_TYPE_VISITOR );
|
1435 |
+
$is_output = $user_has_reviewed;
|
1436 |
$rating_type_template = $is_output ? $rating_type['output_template'] : $rating_type['input_template'];
|
1437 |
+
$comment_rating = false;
|
1438 |
|
1439 |
$args['hide_button'] = true;
|
1440 |
|
1441 |
+
$output = sprintf(
|
1442 |
'<div class="wpr-%1$s-features-rating" data-type="%2$s" data-nonce="%3$s" data-post_id="%4$s">',
|
1443 |
esc_attr( $args['type'] ),
|
1444 |
esc_attr( $type ),
|
1449 |
$output .= '<ul class="features-rating-list review-list">';
|
1450 |
|
1451 |
$features = wp_review_get_review_items( $post_id );
|
1452 |
+
$reviews = wp_review_get_post_feature_reviews( $post_id, false, $args['type'] );
|
1453 |
+
if ( is_array( $features ) && ! empty( $features ) ) {
|
1454 |
foreach ( $features as $feature_id => $feature ) {
|
1455 |
if ( ! isset( $reviews[ $feature_id ] ) ) {
|
1456 |
$review = array(
|
1457 |
+
'total' => 0,
|
1458 |
+
'count' => 0,
|
1459 |
'positive' => 0,
|
1460 |
'negative' => 0,
|
1461 |
);
|
1468 |
$value = intval( $review['count'] ) ? $review['total'] / $review['count'] : 0;
|
1469 |
}
|
1470 |
$value_text = '<span>' . sprintf( $rating_type['value_text'], $value ) . '</span> - ';
|
1471 |
+
$output .= '<li>';
|
1472 |
|
1473 |
$rating_output = '';
|
1474 |
+
$title_output = '';
|
1475 |
|
1476 |
if ( ! $user_has_reviewed ) {
|
1477 |
$rating_output .= sprintf(
|
1483 |
}
|
1484 |
|
1485 |
if ( ! empty( $feature['wp_review_item_color'] ) ) {
|
1486 |
+
$color = $feature['wp_review_item_color'];
|
1487 |
$colors['color'] = $color;
|
1488 |
}
|
1489 |
|
1490 |
if ( ! empty( $feature['wp_review_item_inactive_color'] ) ) {
|
1491 |
+
$inactive_color = $feature['wp_review_item_inactive_color'];
|
1492 |
$colors['inactive_color'] = $inactive_color;
|
1493 |
}
|
1494 |
|
1531 |
return $output;
|
1532 |
}
|
1533 |
|
1534 |
+
/**
|
1535 |
+
* Gets user comments rating.
|
1536 |
+
*
|
1537 |
+
* @param int $post_id Post ID.
|
1538 |
+
* @param array $args Custom args.
|
1539 |
+
* @return string
|
1540 |
+
*/
|
1541 |
function wp_review_user_comments_rating( $post_id = null, $args = array() ) {
|
1542 |
$type = wp_review_get_post_user_review_type( $post_id );
|
1543 |
|
1545 |
return '';
|
1546 |
}
|
1547 |
|
1548 |
+
$post_reviews = mts_get_post_comments_reviews( $post_id );
|
1549 |
+
$value = $post_reviews['rating'];
|
|
|
|
|
|
|
1550 |
$args['positive_count'] = isset( $post_reviews['positive_count'] ) ? $post_reviews['positive_count'] : 0;
|
1551 |
$args['negative_count'] = isset( $post_reviews['negative_count'] ) ? $post_reviews['negative_count'] : 0;
|
1552 |
+
$args['user_rating'] = true;
|
1553 |
$args['comment_rating'] = true;
|
1554 |
|
|
|
|
|
|
|
|
|
|
|
1555 |
if ( '' == $value ) {
|
1556 |
$value = '0.0';
|
1557 |
}
|
1584 |
$post_id = get_the_ID();
|
1585 |
}
|
1586 |
|
|
|
1587 |
$data = array();
|
1588 |
|
1589 |
$data['post_id'] = $post_id;
|
1600 |
|
1601 |
$data['product_price'] = wp_review_get_product_price( $post_id );
|
1602 |
|
1603 |
+
$data['items'] = wp_review_get_review_items( $post_id );
|
1604 |
$data['disable_features'] = get_post_meta( $post_id, 'wp_review_disable_features', true );
|
1605 |
|
1606 |
$data['type'] = wp_review_get_post_review_type( $post_id );
|
1620 |
|
1621 |
$data['links'] = wp_review_get_review_links( $post_id );
|
1622 |
|
1623 |
+
$custom_author = get_post_meta( $post_id, 'wp_review_custom_author', true );
|
1624 |
+
$author_field = get_post_meta( $post_id, 'wp_review_author', true );
|
1625 |
$data['author'] = ( ! $author_field || empty( $author_field ) || ! $custom_author ) ? get_the_author() : $author_field;
|
1626 |
|
1627 |
+
$colors = wp_review_get_colors( $post_id );
|
1628 |
$data['colors'] = $colors;
|
1629 |
|
1630 |
$data['width'] = 100;
|
1631 |
$data['align'] = 'left';
|
1632 |
|
1633 |
+
$user_review = in_array( wp_review_get_user_rating_setup( $post_id ), array( WP_REVIEW_REVIEW_VISITOR_ONLY, WP_REVIEW_REVIEW_ALLOW_BOTH ) );
|
1634 |
+
$comments_review = in_array( wp_review_get_user_rating_setup( $post_id ), array( WP_REVIEW_REVIEW_COMMENT_ONLY, WP_REVIEW_REVIEW_ALLOW_BOTH ) );
|
1635 |
+
$user_review_type = '';
|
1636 |
+
$user_review_total = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
1637 |
$user_review_positive = '';
|
1638 |
$user_review_negative = '';
|
1639 |
+
$user_review_count = 0;
|
1640 |
+
$user_has_reviewed = false;
|
1641 |
if ( $user_review || $comments_review ) {
|
1642 |
$user_review_type = wp_review_get_post_user_review_type( $post_id );
|
1643 |
}
|
1644 |
|
1645 |
if ( $user_review ) {
|
1646 |
+
$post_reviews = mts_get_post_reviews( $post_id );
|
1647 |
+
$user_review_total = $post_reviews['rating'];
|
1648 |
+
$user_review_count = $post_reviews['count'];
|
1649 |
$user_review_positive = $post_reviews['positive_count'];
|
1650 |
$user_review_negative = $post_reviews['negative_count'];
|
1651 |
+
$user_id = is_user_logged_in() ? get_current_user_id() : 0;
|
1652 |
+
$uip = wp_review_get_user_ip();
|
1653 |
if ( wp_review_has_reviewed( $post_id, $user_id, $uip, WP_REVIEW_COMMENT_TYPE_VISITOR ) ) {
|
1654 |
$user_has_reviewed = true;
|
1655 |
}
|
1656 |
}
|
1657 |
+
$data['user_review'] = $user_review;
|
1658 |
+
$data['comments_review'] = $comments_review;
|
1659 |
+
$data['user_review_type'] = $user_review_type;
|
1660 |
+
$data['user_review_total'] = $user_review_total;
|
1661 |
+
$data['user_review_count'] = $user_review_count;
|
1662 |
$data['user_review_positive'] = $user_review_positive;
|
1663 |
$data['user_review_negative'] = $user_review_negative;
|
1664 |
+
$data['user_has_reviewed'] = $user_has_reviewed;
|
1665 |
$data['hide_comments_rating'] = get_post_meta( $post_id, 'wp_review_hide_comments_total', true );
|
1666 |
|
1667 |
+
$hide_user_reviews = wp_review_network_option( 'hide_user_reviews_' );
|
1668 |
+
if ( $hide_user_reviews ) {
|
1669 |
+
$data['user_review'] = false;
|
1670 |
$data['comments_review'] = false;
|
1671 |
}
|
1672 |
+
$hide_desc = wp_review_network_option( 'hide_review_description_' );
|
1673 |
+
if ( $hide_desc ) {
|
1674 |
$data['hide_desc'] = true;
|
1675 |
}
|
1676 |
+
$hide_links = wp_review_network_option( 'hide_review_links_' );
|
1677 |
+
if ( $hide_links ) {
|
1678 |
$data['links'] = true;
|
1679 |
}
|
1680 |
+
$hide_features = wp_review_network_option( 'hide_features_' );
|
1681 |
+
if ( $hide_features ) {
|
1682 |
$data['disable_features'] = true;
|
1683 |
}
|
1684 |
/**
|
1707 |
$color_options = wp_review_get_global_colors();
|
1708 |
$custom_colors = get_post_meta( $post_id, 'wp_review_custom_colors', true );
|
1709 |
|
1710 |
+
$colors = array();
|
1711 |
+
$colors['custom_colors'] = $custom_colors;
|
1712 |
$colors['custom_location'] = get_post_meta( $post_id, 'wp_review_custom_location', true );
|
1713 |
+
$colors['custom_width'] = get_post_meta( $post_id, 'wp_review_custom_width', true );
|
1714 |
+
$colors['color'] = get_post_meta( $post_id, 'wp_review_color', true );
|
1715 |
$colors['inactive_color'] = get_post_meta( $post_id, 'wp_review_inactive_color', true );
|
1716 |
+
$colors['type'] = wp_review_get_post_review_type( $post_id );
|
1717 |
+
$colors['fontcolor'] = get_post_meta( $post_id, 'wp_review_fontcolor', true );
|
1718 |
+
$colors['bgcolor1'] = get_post_meta( $post_id, 'wp_review_bgcolor1', true );
|
1719 |
+
$colors['bgcolor2'] = get_post_meta( $post_id, 'wp_review_bgcolor2', true );
|
1720 |
+
$colors['bordercolor'] = get_post_meta( $post_id, 'wp_review_bordercolor', true );
|
1721 |
|
1722 |
if ( ! $custom_colors && is_array( $color_options ) ) {
|
1723 |
$colors = array_merge( $colors, $color_options );
|
1752 |
}
|
1753 |
|
1754 |
if ( ! empty( $args['hide_rating_box'] ) ) {
|
1755 |
+
$review['user_review'] = false;
|
1756 |
$review['comments_review'] = false;
|
1757 |
}
|
1758 |
|
1773 |
* @return string Review box output.
|
1774 |
*/
|
1775 |
function wp_review_get_review_box( $post_id = null ) {
|
1776 |
+
$hide_user_reviews = wp_review_network_option( 'hide_ratings_in_posts_' );
|
1777 |
if ( ! wp_review_is_enable( $post_id ) || $hide_user_reviews ) {
|
1778 |
+
return '';
|
1779 |
}
|
1780 |
|
1781 |
+
// WPML workaround to show translated post data instead of original post.
|
1782 |
+
if ( is_singular() && function_exists( 'icl_object_id' ) ) {
|
1783 |
global $post;
|
1784 |
$post_id = $post->ID;
|
1785 |
}
|
1786 |
|
1787 |
$review_data = wp_review_get_review_data( $post_id );
|
1788 |
|
1789 |
+
$template = wp_review_get_post_box_template( $post_id );
|
1790 |
$box_template_path = wp_review_locate_box_template( $template );
|
1791 |
|
1792 |
$template_id = rtrim( $template, '.php' );
|
1811 |
return $review;
|
1812 |
}
|
1813 |
|
1814 |
+
/**
|
1815 |
+
* Gets box template info.
|
1816 |
+
*
|
1817 |
+
* @param bool $template Template name.
|
1818 |
+
* @return array
|
1819 |
+
*/
|
1820 |
function wp_review_get_box_template_info( $template = false ) {
|
1821 |
$default_template_headers = array(
|
1822 |
'Name' => 'WP Review',
|
1863 |
}
|
1864 |
|
1865 |
|
1866 |
+
/**
|
1867 |
+
* Gets box templates list.
|
1868 |
+
*
|
1869 |
+
* @return array
|
1870 |
+
*/
|
1871 |
function wp_review_get_box_templates_list() {
|
1872 |
|
1873 |
$default_paths = array(
|
1875 |
get_template_directory() . '/wp-review',
|
1876 |
get_stylesheet_directory() . '/wp-review',
|
1877 |
);
|
1878 |
+
$paths = apply_filters( 'wp_review_box_template_paths', $default_paths );
|
1879 |
|
1880 |
$templates = array();
|
1881 |
|
1883 |
$path = trailingslashit( $path );
|
1884 |
// Look for files containing our header 'Launcher template'.
|
1885 |
$files = (array) wp_review_scandir( $path, 'php', 2 );
|
1886 |
+
foreach ( $files as $file => $full_path ) {
|
1887 |
if ( ! $full_path || ! preg_match( '|WP Review:(.*)$|mi', file_get_contents( $full_path ), $header ) ) {
|
1888 |
continue;
|
1889 |
}
|
1890 |
|
1891 |
+
$templates[ $file ] = wp_review_get_box_template_info( $file );
|
1892 |
$templates[ $file ]['path'] = $path;
|
1893 |
}
|
1894 |
}
|
1895 |
return $templates;
|
1896 |
}
|
1897 |
|
1898 |
+
/**
|
1899 |
+
* Scans directory.
|
1900 |
+
*
|
1901 |
+
* @param string $path Directory path.
|
1902 |
+
* @param array $extensions Extensions.
|
1903 |
+
* @param int $depth Depth.
|
1904 |
+
* @param string $relative_path Relative path.
|
1905 |
+
* @return array|bool
|
1906 |
+
*/
|
1907 |
function wp_review_scandir( $path, $extensions = null, $depth = 0, $relative_path = '' ) {
|
1908 |
+
if ( ! is_dir( $path ) ) {
|
1909 |
return false;
|
1910 |
+
}
|
1911 |
+
|
1912 |
if ( $extensions ) {
|
1913 |
+
$extensions = (array) $extensions;
|
1914 |
$_extensions = implode( '|', $extensions );
|
1915 |
}
|
1916 |
+
|
1917 |
$relative_path = trailingslashit( $relative_path );
|
1918 |
+
if ( '/' == $relative_path ) {
|
1919 |
$relative_path = '';
|
1920 |
+
}
|
1921 |
+
|
1922 |
$results = scandir( $path );
|
1923 |
+
$files = array();
|
1924 |
foreach ( $results as $result ) {
|
1925 |
+
if ( '.' == $result[0] ) {
|
1926 |
continue;
|
1927 |
+
}
|
1928 |
if ( is_dir( $path . '/' . $result ) ) {
|
1929 |
+
if ( ! $depth || 'CVS' == $result ) {
|
1930 |
continue;
|
1931 |
+
}
|
1932 |
+
$found = wp_review_scandir( $path . '/' . $result, $extensions, $depth - 1, $relative_path . $result );
|
1933 |
$files = array_merge_recursive( $files, $found );
|
1934 |
} elseif ( ! $extensions || preg_match( '~\.(' . $_extensions . ')$~', $result ) ) {
|
1935 |
$files[ $relative_path . $result ] = $path . '/' . $result;
|
1938 |
return $files;
|
1939 |
}
|
1940 |
|
1941 |
+
/**
|
1942 |
+
* Adds admin columns.
|
1943 |
+
*/
|
1944 |
function wp_review_add_admin_columns() {
|
1945 |
+
$post_types = get_post_types( array( 'public' => true ), 'names' );
|
1946 |
$excluded_post_types = apply_filters( 'wp_review_excluded_post_types', array( 'attachment' ) );
|
1947 |
+
$allowed_post_types = array_diff( $post_types, $excluded_post_types );
|
1948 |
foreach ( $allowed_post_types as $key => $value ) {
|
1949 |
// Add post list table column.
|
1950 |
add_filter( 'manage_' . $value . '_posts_columns', 'wp_review_post_list_column' );
|
1954 |
}
|
1955 |
add_action( 'init', 'wp_review_add_admin_columns' );
|
1956 |
|
1957 |
+
/**
|
1958 |
+
* Adds posts list columns.
|
1959 |
+
*
|
1960 |
+
* @param array $columns Posts list columns.
|
1961 |
+
* @return array
|
1962 |
+
*/
|
1963 |
function wp_review_post_list_column( $columns ) {
|
1964 |
$columns['wp_review_rating'] = __( 'Rating', 'wp-review' );
|
1965 |
return $columns;
|
1966 |
}
|
1967 |
|
1968 |
+
/**
|
1969 |
+
* Shows posts list column content.
|
1970 |
+
*
|
1971 |
+
* @param string $column_name Column name.
|
1972 |
+
* @param int $post_id Post ID.
|
1973 |
+
*/
|
1974 |
function wp_review_post_list_column_content( $column_name, $post_id ) {
|
1975 |
if ( 'wp_review_rating' === $column_name ) {
|
1976 |
$total = get_post_meta( $post_id, 'wp_review_total', true );
|
1985 |
}
|
1986 |
}
|
1987 |
|
1988 |
+
/**
|
1989 |
+
* Ignores migrate notice.
|
|
|
|
|
1990 |
*/
|
|
|
1991 |
function wp_review_migrate_notice_ignore() {
|
1992 |
global $current_user;
|
1993 |
$user_id = $current_user->ID;
|
1994 |
/* If user clicks to ignore the notice, add that to their user meta */
|
1995 |
+
if ( isset( $_GET['wp_review_migrate_notice_ignore'] ) && '1' == $_GET['wp_review_migrate_notice_ignore'] ) {
|
1996 |
add_user_meta( $user_id, 'wp_review_migrate_notice_ignore', 'true', true );
|
1997 |
}
|
1998 |
}
|
1999 |
add_action( 'admin_init', 'wp_review_migrate_notice_ignore' );
|
2000 |
|
2001 |
|
2002 |
+
/**
|
2003 |
+
* Shows migrate notice.
|
2004 |
+
*/
|
2005 |
function wp_review_migrate_notice() {
|
2006 |
// Migrate.
|
2007 |
global $wpdb, $current_user;
|
2016 |
}
|
2017 |
|
2018 |
$current_blog_id = get_current_blog_id();
|
2019 |
+
$rows_left = 0;
|
2020 |
+
$migrated_rows = get_option( 'wp_review_migrated_rows', 0 );
|
2021 |
+
if ( ! $has_migrated && $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->base_prefix}mts_wp_reviews'" ) == "{$wpdb->base_prefix}mts_wp_reviews" ) {
|
2022 |
+
// Table exists and not migrated (fully) yet.
|
2023 |
+
$total_rows = $wpdb->get_var( 'SELECT COUNT(*) FROM ' . $wpdb->base_prefix . 'mts_wp_reviews WHERE blog_id = ' . $current_blog_id ); // WPCS: unprepared SQL ok.
|
2024 |
+
$rows_left = $total_rows - $migrated_rows;
|
|
|
2025 |
}
|
2026 |
|
2027 |
if ( ! $rows_left ) {
|
2029 |
}
|
2030 |
?>
|
2031 |
<div class="updated notice-info wp-review-notice">
|
2032 |
+
<p>
|
2033 |
+
<?php
|
2034 |
+
// translators: settings link.
|
2035 |
+
printf( __( 'Thank you for updating WP Review Pro. Your existing user ratings will show up after importing them in %s.', 'wp-review' ), '<a href="' . admin_url( 'options-general.php?page=wp-review-pro%2Fadmin%2Foptions.php#migrate' ) . '">' . __( 'Settings > WP Review Pro > Migrate Ratings', 'wp-review' ) . '</a>' );
|
2036 |
+
?>
|
2037 |
+
</p>
|
2038 |
<a class="notice-dismiss" href="<?php echo esc_url( add_query_arg( 'wp_review_migrate_notice_ignore', '1' ) ); ?>"></a>
|
2039 |
</div>
|
2040 |
<?php
|
2041 |
}
|
2042 |
add_action( 'admin_notices', 'wp_review_migrate_notice' );
|
2043 |
|
2044 |
+
/**
|
2045 |
+
* Gets schema.
|
2046 |
+
*
|
2047 |
+
* @param array $review Review data.
|
2048 |
+
* @return string
|
2049 |
+
*/
|
2050 |
function wp_review_get_schema( $review ) {
|
2051 |
if ( 'none' === $review['schema'] ) {
|
2052 |
return '';
|
2098 |
|
2099 |
}
|
2100 |
|
2101 |
+
/**
|
2102 |
+
* Gets schema type.
|
2103 |
+
*
|
2104 |
+
* @param array $review Review data.
|
2105 |
+
* @param bool $nested_rating Is nested rating or not.
|
2106 |
+
* @return array
|
2107 |
+
*/
|
2108 |
function wp_review_get_schema_type( $review, $nested_rating = false ) {
|
2109 |
|
2110 |
+
if ( empty( $review['schema'] ) || 'Thing' === $review['schema'] || ! isset( $review['schema_data'] ) ) {
|
2111 |
+
return;
|
2112 |
+
}
|
2113 |
|
2114 |
$args = array(
|
2115 |
'@context' => 'http://schema.org',
|
2121 |
$args += $ldjson_data;
|
2122 |
} else {
|
2123 |
$schemas = wp_review_schema_types();
|
2124 |
+
$fields = isset( $schemas[ $review['schema'] ] ) && isset( $schemas[ $review['schema'] ]['fields'] ) ? $schemas[ $review['schema'] ]['fields'] : array();
|
2125 |
|
2126 |
foreach ( $fields as $key => $data ) {
|
2127 |
if ( ! empty( $data['omit'] ) ) {
|
2132 |
$review['schema_data'][ $review['schema'] ][ $data['name'] ] = preg_split( '/\r\n|[\r\n]/', $review['schema_data'][ $review['schema'] ][ $data['name'] ] );
|
2133 |
}
|
2134 |
if ( isset( $data['part_of'] ) ) {
|
2135 |
+
$args[ $data['part_of'] ]['@type'] = $data['@type'];
|
2136 |
if ( 'image' === $data['type'] ) {
|
2137 |
$args[ $data['part_of'] ][ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ]['url'];
|
2138 |
+
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) { // phpcs:ignore
|
2139 |
$args[ $data['part_of'] ][ $data['name'] ] = 'PT' . $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
2140 |
} else {
|
2141 |
$args[ $data['part_of'] ][ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
2143 |
} else {
|
2144 |
if ( 'image' === $data['type'] ) {
|
2145 |
$args[ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ]['url'];
|
2146 |
+
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) { // phpcs:ignore
|
2147 |
$args[ $data['name'] ] = 'PT' . $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
2148 |
} else {
|
2149 |
$args[ $data['name'] ] = $review['schema_data'][ $review['schema'] ][ $data['name'] ];
|
2153 |
}
|
2154 |
}
|
2155 |
|
2156 |
+
// Nested aggregateRating is required in some types ( SoftwareApplication, Recipe ).
|
2157 |
+
$force_user_rating = in_array( $review['schema'], apply_filters( 'wp_review_schema_force_nested_user_rating_types', array( 'SoftwareApplication', 'Recipe' ) ) );
|
2158 |
if ( $force_user_rating ) {
|
2159 |
if ( $review['user_review'] || $review['comments_review'] ) {
|
2160 |
+
$aggregate_rating = wp_review_get_schema_nested_user_rating_args( $review );
|
2161 |
+
if ( ! empty( $aggregate_rating ) ) {
|
2162 |
+
$args['aggregateRating'] = $aggregate_rating;
|
2163 |
}
|
2164 |
}
|
2165 |
if ( 'author' === $review['rating_schema'] ) {
|
2168 |
} elseif ( $nested_rating ) {
|
2169 |
if ( in_array( $review['rating_schema'], array( 'visitors' ) ) ) {
|
2170 |
if ( $review['user_review'] || $review['comments_review'] ) {
|
2171 |
+
$aggregate_rating = wp_review_get_schema_nested_user_rating_args( $review );
|
2172 |
+
if ( ! empty( $aggregate_rating ) ) {
|
2173 |
+
$args['aggregateRating'] = $aggregate_rating;
|
2174 |
}
|
2175 |
}
|
2176 |
} else {
|
2180 |
|
2181 |
$args = apply_filters( 'wp_review_get_schema_type_args', $args, $review, $nested_rating );
|
2182 |
|
2183 |
+
$output = '<script type="application/ld+json">' . PHP_EOL;
|
2184 |
$output .= wp_json_encode( $args, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ) . PHP_EOL;
|
2185 |
$output .= '</script>' . PHP_EOL;
|
2186 |
|
2187 |
return apply_filters( 'wp_review_get_schema_type', $output, $args, $review, $nested_rating );
|
2188 |
}
|
2189 |
|
2190 |
+
/**
|
2191 |
+
* Gets schema review rating.
|
2192 |
+
*
|
2193 |
+
* @param array $review Review data.
|
2194 |
+
* @param bool $nested_item Is nested item or not.
|
2195 |
+
* @return mixed|void
|
2196 |
+
*/
|
2197 |
function wp_review_get_schema_review_rating( $review, $nested_item = false ) {
|
2198 |
|
2199 |
+
if ( ! $nested_item && in_array( $review['schema'], apply_filters( 'wp_review_schema_force_nested_user_rating_types', array( 'SoftwareApplication', 'Recipe' ) ) ) ) {
|
2200 |
+
return; // Requires nested aggregateRating.
|
2201 |
+
}
|
2202 |
|
2203 |
global $wp_review_rating_types;
|
2204 |
|
2229 |
|
2230 |
$args = apply_filters( 'wp_review_get_schema_review_rating_args', $args, $review );
|
2231 |
|
2232 |
+
$output = '<script type="application/ld+json">' . PHP_EOL;
|
2233 |
$output .= wp_json_encode( $args, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ) . PHP_EOL;
|
2234 |
$output .= '</script>' . PHP_EOL;
|
2235 |
|
2236 |
return apply_filters( 'wp_review_get_schema_review_rating', $output, $args, $review );
|
2237 |
}
|
2238 |
|
2239 |
+
/**
|
2240 |
+
* Gets schema user rating.
|
2241 |
+
*
|
2242 |
+
* @param array $review Review data.
|
2243 |
+
* @param bool $nested_item Is nested item or not.
|
2244 |
+
* @return mixed|void
|
2245 |
+
*/
|
2246 |
function wp_review_get_schema_user_rating( $review, $nested_item = false ) {
|
2247 |
|
2248 |
+
if ( ! $nested_item && in_array( $review['schema'], apply_filters( 'wp_review_schema_force_nested_user_rating_types', array( 'SoftwareApplication', 'Recipe' ) ) ) ) {
|
2249 |
+
return; // Requires nested aggregateRating.
|
2250 |
+
}
|
2251 |
|
2252 |
global $wp_review_rating_types;
|
2253 |
|
2287 |
return apply_filters( 'wp_review_get_schema_user_rating', $output, $args, $review );
|
2288 |
}
|
2289 |
|
2290 |
+
/**
|
2291 |
+
* Gets reviewed item name.
|
2292 |
+
*
|
2293 |
+
* @param array $review Review data.
|
2294 |
+
* @return mixed|void
|
2295 |
+
*/
|
2296 |
function wp_review_get_reviewed_item_name( $review ) {
|
2297 |
|
2298 |
$item_reviewed = empty( $review['heading'] ) ? get_the_title( $review['post_id'] ) : esc_html( $review['heading'] );
|
2299 |
|
2300 |
+
if ( ! empty( $review['schema'] ) && 'Thing' !== $review['schema'] ) {
|
2301 |
|
2302 |
+
if ( isset( $review['schema_data'][ $review['schema'] ]['name'] ) && ! empty( $review['schema_data'][ $review['schema'] ]['name'] ) ) {
|
2303 |
$item_reviewed = $review['schema_data'][ $review['schema'] ]['name'];
|
2304 |
}
|
2305 |
}
|
2307 |
return apply_filters( 'wp_review_get_reviewed_item_name', $item_reviewed, $review );
|
2308 |
}
|
2309 |
|
2310 |
+
/**
|
2311 |
+
* Gets schema nested user rating args.
|
2312 |
+
*
|
2313 |
+
* @param array $review Review data.
|
2314 |
+
* @return array
|
2315 |
+
*/
|
2316 |
function wp_review_get_schema_nested_user_rating_args( $review ) {
|
2317 |
|
2318 |
global $wp_review_rating_types;
|
2329 |
return apply_filters( 'wp_review_get_schema_nested_user_rating_args', $args, $review );
|
2330 |
}
|
2331 |
|
2332 |
+
/**
|
2333 |
+
* Gets schema nested review args.
|
2334 |
+
*
|
2335 |
+
* @param array $review Review data.
|
2336 |
+
* @return array
|
2337 |
+
*/
|
2338 |
function wp_review_get_schema_nested_review_args( $review ) {
|
2339 |
global $wp_review_rating_types;
|
2340 |
|
2355 |
return apply_filters( 'wp_review_get_schema_nested_review_args', $args, $review );
|
2356 |
}
|
2357 |
|
2358 |
+
/**
|
2359 |
+
* Gets schema nested item args.
|
2360 |
+
*
|
2361 |
+
* @param array $review Review data.
|
2362 |
+
* @return array
|
2363 |
+
*/
|
2364 |
function wp_review_get_schema_nested_item_args( $review ) {
|
2365 |
|
2366 |
$args = array(
|
2367 |
+
'@type' => $review['schema'],
|
2368 |
);
|
2369 |
|
2370 |
$schema_data = ! empty( $review['schema_data'][ $review['schema'] ] ) ? $review['schema_data'][ $review['schema'] ] : array();
|
2373 |
$args += $ldjson_data;
|
2374 |
} else {
|
2375 |
$schemas = wp_review_schema_types();
|
2376 |
+
$fields = isset( $schemas[ $review['schema'] ] ) && isset( $schemas[ $review['schema'] ]['fields'] ) ? $schemas[ $review['schema'] ]['fields'] : array();
|
2377 |
+
if ( is_array( $fields ) && ! empty( $fields ) ) {
|
2378 |
foreach ( $fields as $key => $data ) {
|
2379 |
if ( ! empty( $data['omit'] ) ) {
|
2380 |
continue;
|
2381 |
}
|
2382 |
+
if ( isset( $schema_data[ $data['name'] ] ) && ! empty( $schema_data[ $data['name'] ] ) ) {
|
2383 |
if ( isset( $data['multiline'] ) && $data['multiline'] ) {
|
2384 |
+
$schema_data[ $data['name'] ] = preg_split( '/\r\n|[\r\n]/', $schema_data[ $data['name'] ] );
|
2385 |
}
|
2386 |
if ( isset( $data['part_of'] ) ) {
|
2387 |
+
$args[ $data['part_of'] ]['@type'] = $data['@type'];
|
2388 |
if ( 'image' === $data['type'] ) {
|
2389 |
$args[ $data['part_of'] ][ $data['name'] ] = $schema_data[ $data['name'] ]['url'];
|
2390 |
+
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) { // phpcs:ignore
|
2391 |
+
$args[ $data['part_of'] ][ $data['name'] ] = 'PT' . $schema_data[ $data['name'] ];
|
2392 |
} else {
|
2393 |
$args[ $data['part_of'] ][ $data['name'] ] = $schema_data[ $data['name'] ];
|
2394 |
}
|
2395 |
} else {
|
2396 |
if ( 'image' === $data['type'] ) {
|
2397 |
$args[ $data['name'] ] = $schema_data[ $data['name'] ]['url'];
|
2398 |
+
} elseif ( in_array( $data['name'], apply_filters( 'wp_reviev_schema_ISO_8601_duration_items', array( 'prepTime', 'cookTime', 'totalTime', 'duration' ) ) ) ) { // phpcs:ignore
|
2399 |
+
$args[ $data['name'] ] = 'PT' . $schema_data[ $data['name'] ];
|
2400 |
} else {
|
2401 |
$args[ $data['name'] ] = $schema_data[ $data['name'] ];
|
2402 |
}
|
2406 |
}
|
2407 |
}
|
2408 |
|
2409 |
+
// Nested aggregateRating is recommended in some types ( SoftwareApplication, Recipe ).
|
2410 |
+
if ( in_array( $review['schema'], apply_filters( 'wp_review_schema_force_nested_user_rating_types', array( 'SoftwareApplication', 'Recipe' ) ) ) && ( $review['user_review'] || $review['comments_review'] ) ) {
|
2411 |
+
$aggregate_rating = wp_review_get_schema_nested_user_rating_args( $review );
|
2412 |
+
if ( ! empty( $aggregate_rating ) ) {
|
2413 |
+
$args['aggregateRating'] = $aggregate_rating;
|
2414 |
+
}
|
|
|
|
|
2415 |
}
|
2416 |
|
2417 |
return apply_filters( 'wp_review_get_schema_nested_item_args', $args, $review );
|
2429 |
*/
|
2430 |
function wp_review_get_ldjson_data( $type, $data, $review ) {
|
2431 |
$ldjson_data = array();
|
2432 |
+
$post_id = $review['post_id'];
|
2433 |
|
2434 |
switch ( $type ) {
|
2435 |
case 'Article':
|
2438 |
'@type' => 'Webpage',
|
2439 |
'@id' => get_permalink( $post_id ),
|
2440 |
),
|
2441 |
+
'headline' => ! empty( $data['headline'] ) ? $data['headline'] : '',
|
2442 |
+
'image' => array(
|
2443 |
'@type' => 'ImageObject',
|
2444 |
'url' => ! empty( $data['image']['url'] ) ? esc_url( $data['image']['url'] ) : '',
|
2445 |
),
|
2446 |
+
'datePublished' => get_the_time( 'Y-m-d H:i:s', $post_id ),
|
2447 |
+
'dateModified' => get_the_modified_time( 'Y-m-d H:i:s', $post_id ),
|
2448 |
+
'author' => array(
|
2449 |
'@type' => 'Person',
|
2450 |
'name' => ! empty( $data['author'] ) ? $data['author'] : '',
|
2451 |
),
|
2452 |
+
'publisher' => array(
|
2453 |
'@type' => 'Organization',
|
2454 |
'name' => ! empty( $data['publisher'] ) ? $data['publisher'] : '',
|
2455 |
'logo' => array(
|
2457 |
'url' => ! empty( $data['publisher_logo']['url'] ) ? esc_url( $data['publisher_logo']['url'] ) : '',
|
2458 |
),
|
2459 |
),
|
2460 |
+
'description' => ! empty( $data['description'] ) ? $data['description'] : '',
|
2461 |
);
|
2462 |
break;
|
2463 |
|
2491 |
function wp_review_get_rating_image() {
|
2492 |
|
2493 |
$rating_image = wp_review_option( 'rating_image', apply_filters( 'wp_review_default_rating_image', '' ) );
|
2494 |
+
if ( $rating_image ) {
|
2495 |
+
$rating_img_src = wp_get_attachment_image_src( $rating_image );
|
2496 |
|
2497 |
+
if ( ! empty( $rating_img_src ) ) {
|
2498 |
$rating_image = $rating_img_src[0];
|
2499 |
}
|
2500 |
}
|
2516 |
$post_id = get_the_ID();
|
2517 |
}
|
2518 |
|
2519 |
+
return ! ! wp_review_get_post_review_type( $post_id );
|
2520 |
}
|
2521 |
|
2522 |
|
2693 |
$post_id = get_the_ID();
|
2694 |
}
|
2695 |
$template = get_post_meta( $post_id, 'wp_review_box_template', true );
|
2696 |
+
$custom = get_post_meta( $post_id, 'wp_review_custom_colors', true );
|
2697 |
if ( ! $custom || ! $template ) {
|
2698 |
$template = wp_review_option( 'box_template', 'default' );
|
2699 |
}
|
2719 |
* @since 3.0.0
|
2720 |
*/
|
2721 |
function wp_review_clear_cache() {
|
2722 |
+
// phpcs:disable
|
2723 |
// delete_transient( 'wp_review_recent_reviews_query' );
|
2724 |
// delete_transient( 'wp_review_toprated_reviews_query' );
|
2725 |
// delete_transient( 'wp_review_mostvoted_reviews_query' );
|
2726 |
// delete_transient( 'wp_review_custom_reviews_query' );
|
2727 |
+
// phpcs:enable
|
2728 |
}
|
2729 |
|
2730 |
|
2738 |
return;
|
2739 |
}
|
2740 |
wp_review_clear_cache();
|
|
|
|
|
2741 |
}
|
2742 |
add_action( 'template_redirect', 'wp_review_clear_cache_via_url' );
|
2743 |
|
2752 |
* @return WP_Query
|
2753 |
*/
|
2754 |
function wp_review_get_reviews_query( $type, $options ) {
|
2755 |
+
$key = 'wp_review_' . md5(
|
2756 |
+
sprintf(
|
2757 |
+
'%1$s_%2$s_reviews_query',
|
2758 |
+
$type,
|
2759 |
+
serialize( $options )
|
2760 |
+
)
|
2761 |
+
);
|
2762 |
|
2763 |
if ( ! empty( $options['clear_cache'] ) ) {
|
2764 |
delete_transient( $key );
|
2770 |
}
|
2771 |
|
2772 |
$options['review_type'] = $options['review_type'] ? (array) $options['review_type'] : array();
|
2773 |
+
$options['cat'] = $options['cat'] ? (array) $options['cat'] : array();
|
2774 |
|
2775 |
switch ( $type ) {
|
2776 |
case 'mostvoted':
|
2791 |
|
2792 |
case 'cat':
|
2793 |
$query_args = array(
|
2794 |
+
'orderby' => 'date',
|
2795 |
+
'order' => 'desc',
|
|
|
2796 |
'category__in' => $options['cat'],
|
2797 |
);
|
2798 |
break;
|
2812 |
}
|
2813 |
|
2814 |
$query_args['ignore_sticky_posts'] = true;
|
2815 |
+
$query_args['post_type'] = isset( $options['post_type'] ) ? $options['post_type'] : 'post';
|
2816 |
+
$query_args['post_status'] = 'publish';
|
2817 |
+
$query_args['posts_per_page'] = intval( $options['post_num'] );
|
2818 |
+
$query_args['paged'] = intval( $options['page'] );
|
2819 |
|
2820 |
if ( ! empty( $options['number_of_days'] ) && intval( $options['number_of_days'] ) ) {
|
2821 |
+
$date_str = $options['number_of_days'] > 1 ? '%s days ago' : '%s day ago';
|
2822 |
$query_args['date_query'] = array(
|
2823 |
array(
|
2824 |
'after' => sprintf( $date_str, intval( $options['number_of_days'] ) ),
|
2832 |
if ( ! empty( $options['review_type'] ) ) {
|
2833 |
$meta_query[] = array(
|
2834 |
'key' => 'wp_review_type',
|
|
|
2835 |
'compare' => 'IN',
|
2836 |
'value' => $options['review_type'],
|
2837 |
);
|
2953 |
* }
|
2954 |
*/
|
2955 |
function wp_review_visitor_rate( $post_id, $rating_data ) {
|
2956 |
+
$rating_data = wp_parse_args(
|
2957 |
+
$rating_data,
|
2958 |
+
array(
|
2959 |
+
'total' => '',
|
2960 |
+
'type' => '',
|
2961 |
+
'features' => array(),
|
2962 |
+
)
|
2963 |
+
);
|
2964 |
+
|
2965 |
$output = array(
|
2966 |
'status' => '',
|
2967 |
'html' => '',
|
2974 |
exit;
|
2975 |
}
|
2976 |
|
2977 |
+
$type = wp_review_get_post_user_review_type( $post_id );
|
2978 |
$rating_type = wp_review_get_rating_type_data( $type );
|
2979 |
if ( ! $rating_type ) {
|
2980 |
echo wp_json_encode( $output );
|
2996 |
}
|
2997 |
|
2998 |
$user_id = is_user_logged_in() ? get_current_user_id() : 0;
|
2999 |
+
$review = $rating_data['total'];
|
3000 |
+
$uip = wp_review_get_user_ip();
|
3001 |
|
3002 |
if ( ! function_exists( 'wp_review_comment_duplicate_trigger' ) ) {
|
3003 |
/**
|
3006 |
* @param array $commentdata Comment data.
|
3007 |
*/
|
3008 |
function wp_review_comment_duplicate_trigger( $commentdata ) {
|
3009 |
+
$post_reviews = mts_get_post_reviews( $commentdata['comment_post_ID'] );
|
3010 |
+
$output['status'] = 'fail';
|
3011 |
+
$output['error'] = 'duplicate';
|
3012 |
$output['rating_total'] = $post_reviews['rating'];
|
3013 |
$output['rating_count'] = $post_reviews['count'];
|
3014 |
+
$output['html'] = wp_review_rating( $post_reviews['rating'], $commentdata['comment_post_ID'], array( 'user_rating' => true ) );
|
3015 |
echo wp_json_encode( $output );
|
3016 |
exit;
|
3017 |
}
|
3051 |
$approve_comment = true;
|
3052 |
}
|
3053 |
|
3054 |
+
$insert = wp_insert_comment(
|
3055 |
+
array(
|
3056 |
+
'user_id' => $user_id,
|
3057 |
+
'comment_type' => WP_REVIEW_COMMENT_TYPE_VISITOR,
|
3058 |
+
'comment_post_ID' => $post_id,
|
3059 |
+
'comment_parent' => 0,
|
3060 |
+
'comment_author_IP' => $uip,
|
3061 |
+
'comment_content' => $comment_content,
|
3062 |
+
'comment_agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '',
|
3063 |
+
'comment_date' => current_time( 'mysql' ),
|
3064 |
+
'comment_date_gmt' => current_time( 'mysql', 1 ),
|
3065 |
+
'comment_approved' => $approve_comment,
|
3066 |
+
)
|
3067 |
+
);
|
3068 |
|
3069 |
if ( $insert ) {
|
3070 |
if ( update_comment_meta( $insert, WP_REVIEW_VISITOR_RATING_METAKEY, $review ) ) {
|
3071 |
if ( ! empty( $rating_data['features'] ) ) {
|
3072 |
update_comment_meta( $insert, WP_REVIEW_COMMENT_FEATURES_RATING_METAKEY, $rating_data['features'] );
|
3073 |
}
|
|
|
3074 |
|
3075 |
$output['status'] = 'ok';
|
3076 |
+
|
3077 |
if ( ! empty( $rating_data['features'] ) ) {
|
3078 |
+
$reviews = wp_review_get_post_feature_reviews( $post_id, true );
|
3079 |
+
$output['html'] = wp_review_get_review_box( $post_id );
|
3080 |
+
$output['reviews'] = $reviews;
|
3081 |
} else {
|
3082 |
+
$post_reviews = mts_get_post_reviews( $post_id );
|
3083 |
+
$output['html'] = wp_review_rating( $post_reviews['rating'], $post_id, array( 'user_rating' => true ) );
|
3084 |
+
$output['rating_total'] = $post_reviews['rating'];
|
3085 |
+
$output['rating_count'] = $post_reviews['count'];
|
3086 |
}
|
3087 |
+
|
3088 |
if ( ! $approve_comment ) {
|
3089 |
$output['awaiting_moderation'] = __( 'Your rating is awaiting moderation.', 'wp-review' );
|
3090 |
}
|
3096 |
}
|
3097 |
} // End if().
|
3098 |
|
3099 |
+
$post_reviews = mts_get_post_reviews( $post_id );
|
3100 |
+
$output['status'] = 'fail';
|
3101 |
+
$output['error'] = 'db_error';
|
3102 |
$output['rating_total'] = $post_reviews['rating'];
|
3103 |
$output['rating_count'] = $post_reviews['count'];
|
3104 |
+
$output['html'] = wp_review_rating( $post_reviews['rating'], $post_id, array( 'user_rating' => true ) );
|
3105 |
echo wp_json_encode( $output );
|
3106 |
exit;
|
3107 |
}
|
3203 |
}
|
3204 |
}
|
3205 |
|
3206 |
+
// GDPR Compliant - Export User Information.
|
|
|
3207 |
if ( ! function_exists( 'wp_review_data_exporter' ) ) {
|
3208 |
+
/**
|
3209 |
+
* Exports review data.
|
3210 |
+
*
|
3211 |
+
* @param string $email_address Email address.
|
3212 |
+
* @param int $page Page number.
|
3213 |
+
* @return array
|
3214 |
+
*/
|
3215 |
function wp_review_data_exporter( $email_address, $page = 1 ) {
|
3216 |
// Limit us to 500 comments at a time to avoid timing out.
|
3217 |
+
$number = 500;
|
3218 |
+
$page = (int) $page;
|
3219 |
$data_to_export = array();
|
3220 |
+
$comments = get_comments(
|
3221 |
array(
|
3222 |
'author_email' => $email_address,
|
3223 |
'number' => $number,
|
3227 |
'update_comment_meta_cache' => false,
|
3228 |
)
|
3229 |
);
|
3230 |
+
|
3231 |
$comment_prop_to_export = array(
|
3232 |
+
'comment_rating' => __( 'Comment Rating', 'wp-review' ),
|
3233 |
+
'features_rating' => __( 'Features Ratings', 'wp-review' ),
|
3234 |
+
'comment_title' => __( 'Comment Title', 'wp-review' ),
|
3235 |
);
|
3236 |
+
|
3237 |
foreach ( (array) $comments as $comment ) {
|
3238 |
$comment_data_to_export = array();
|
3239 |
foreach ( $comment_prop_to_export as $key => $name ) {
|
3240 |
$comment_id = $comment->comment_ID;
|
3241 |
+
$value = get_comment_meta( $comment_id, 'wp_review_' . $key, true );
|
3242 |
if ( ! empty( $value ) ) {
|
3243 |
if ( 'features_rating' !== $key ) {
|
3244 |
$comment_data_to_export[] = array(
|
3246 |
'value' => $value,
|
3247 |
);
|
3248 |
} else {
|
3249 |
+
$post_id = $comment->comment_post_ID;
|
3250 |
+
$type = wp_review_get_post_user_review_type( $post_id );
|
3251 |
+
$rating_type = wp_review_get_rating_type_data( $type );
|
3252 |
+
$items = wp_review_get_review_items( $post_id );
|
3253 |
$rating_items = get_comment_meta( $comment_id, WP_REVIEW_COMMENT_FEATURES_RATING_METAKEY, true );
|
3254 |
+
|
3255 |
$review_ratings = array();
|
3256 |
foreach ( $items as $item_id => $item ) {
|
3257 |
if ( isset( $rating_items[ $item_id ] ) ) {
|
|
|
3258 |
$review_ratings[ $item['wp_review_item_title'] ] = $rating_items[ $item_id ] . ' of ' . $rating_type['max'];
|
3259 |
}
|
3260 |
}
|
3284 |
}
|
3285 |
}
|
3286 |
|
3287 |
+
// Filter function to register data exporter.
|
3288 |
if ( ! function_exists( 'wp_review_register_data_exporter' ) ) {
|
3289 |
+
/**
|
3290 |
+
* Registers data exporter.
|
3291 |
+
*
|
3292 |
+
* @param array $exporters Exporters.
|
3293 |
+
* @return mixed
|
3294 |
+
*/
|
3295 |
function wp_review_register_data_exporter( $exporters ) {
|
3296 |
$exporters['wp-review'] = array(
|
3297 |
+
'exporter_friendly_name' => apply_filters( 'wp_review_exporter_friendly_name', __( 'WordPress Comments', 'wp-review' ) ),
|
3298 |
+
'callback' => 'wp_review_data_exporter',
|
3299 |
);
|
3300 |
return $exporters;
|
3301 |
}
|
3303 |
|
3304 |
add_filter( 'wp_privacy_personal_data_exporters', 'wp_review_register_data_exporter', 9 );
|
3305 |
|
3306 |
+
/**
|
3307 |
+
* Switches to the main network site.
|
3308 |
+
* Function to switch to Network site, if global option is disabled in sub-site.
|
3309 |
+
*
|
3310 |
+
* @param string $option Option name.
|
3311 |
+
* @return bool
|
3312 |
+
*/
|
3313 |
+
function wp_review_switch_to_main( $option = '' ) {
|
3314 |
$value = false;
|
3315 |
+
if ( is_multisite() && ! is_main_site() ) {
|
3316 |
$site_id = get_current_blog_id();
|
3317 |
+
switch_to_blog( get_network()->site_id );
|
3318 |
+
$options = get_option( 'wp_review_options' );
|
3319 |
+
$hide_options = isset( $options[ 'hide_global_options_' . $site_id ] ) ? $options[ 'hide_global_options_' . $site_id ] : false;
|
3320 |
+
if ( $hide_options ) {
|
3321 |
$value = true;
|
3322 |
+
} elseif ( $option ) {
|
3323 |
+
$hide_options = isset( $options[ $option . $site_id ] ) ? $options[ $option . $site_id ] : false;
|
3324 |
+
if ( $hide_options ) {
|
3325 |
+
$value = true;
|
3326 |
+
}
|
3327 |
+
}
|
3328 |
+
if ( $value ) {
|
3329 |
+
restore_current_blog();
|
3330 |
}
|
|
|
3331 |
}
|
3332 |
return $value;
|
3333 |
}
|
3334 |
|
3335 |
+
/**
|
3336 |
+
* Gets network option.
|
3337 |
+
* Function to get option value from main-network site.
|
3338 |
+
*
|
3339 |
+
* @param string $key Option key.
|
3340 |
+
* @return mixed
|
3341 |
+
*/
|
3342 |
+
function wp_review_network_option( $key ) {
|
3343 |
$value = false;
|
3344 |
+
if ( is_multisite() && ! is_main_site() ) {
|
3345 |
$site_id = get_current_blog_id();
|
3346 |
+
switch_to_blog( get_network()->site_id );
|
3347 |
+
$options = get_option( 'wp_review_options' );
|
3348 |
+
$value = isset( $options[ $key . $site_id ] ) ? $options[ $key . $site_id ] : '';
|
3349 |
restore_current_blog();
|
3350 |
}
|
3351 |
return $value;
|
3352 |
}
|
3353 |
|
3354 |
+
/**
|
3355 |
+
* Gets capabilities.
|
3356 |
+
*
|
3357 |
+
* @return array
|
3358 |
+
*/
|
3359 |
function wp_review_get_capabilities() {
|
3360 |
return array(
|
3361 |
'wp_review_global_options' => esc_html__( 'Global Options', 'wp-review' ),
|
3370 |
);
|
3371 |
}
|
3372 |
|
3373 |
+
add_filter(
|
3374 |
+
'option_page_capability_wpreview-settings-group',
|
3375 |
+
function( $cap ) {
|
3376 |
+
return 'wp_review_global_options';
|
3377 |
+
}
|
3378 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3379 |
|
3380 |
+
add_action(
|
3381 |
+
'members_register_cap_groups',
|
3382 |
+
function() {
|
3383 |
+
members_register_cap_group(
|
3384 |
+
'wp_review',
|
3385 |
array(
|
3386 |
+
'label' => __( 'WP Review', 'wp-review' ),
|
3387 |
+
'caps' => array(),
|
3388 |
+
'icon' => 'dashicons-star-filled',
|
3389 |
+
'priority' => 10,
|
3390 |
)
|
3391 |
);
|
3392 |
}
|
3393 |
+
);
|
3394 |
+
|
3395 |
+
add_action(
|
3396 |
+
'members_register_caps',
|
3397 |
+
function() {
|
3398 |
+
foreach ( wp_review_get_capabilities() as $key => $cap ) {
|
3399 |
+
members_register_cap(
|
3400 |
+
$key,
|
3401 |
+
array(
|
3402 |
+
'label' => $cap,
|
3403 |
+
'group' => 'wp_review',
|
3404 |
+
)
|
3405 |
+
);
|
3406 |
}
|
3407 |
+
}
|
3408 |
+
);
|
3409 |
+
|
3410 |
+
add_action(
|
3411 |
+
'admin_init',
|
3412 |
+
function() {
|
3413 |
+
$wpr_compatibility = get_option( 'wp_review_compatibility' );
|
3414 |
+
if ( ! $wpr_compatibility ) {
|
3415 |
+
$role = get_role( 'administrator' );
|
3416 |
+
if ( $role ) {
|
3417 |
+
foreach ( wp_review_get_capabilities() as $key => $cap ) {
|
3418 |
+
$role->add_cap( $key );
|
3419 |
+
}
|
3420 |
+
}
|
3421 |
+
$role = get_role( 'editor' );
|
3422 |
+
$editor_caps = array(
|
3423 |
+
'wp_review_notification_bar',
|
3424 |
+
'wp_review_single_page',
|
3425 |
+
'wp_review_features',
|
3426 |
+
'wp_review_links',
|
3427 |
+
'wp_review_description',
|
3428 |
+
'wp_review_user_reviews',
|
3429 |
+
'wp_review_purge_visitor_ratings',
|
3430 |
+
'wp_review_purge_comment_ratings',
|
3431 |
+
);
|
3432 |
+
foreach ( $editor_caps as $cap ) {
|
3433 |
+
$role->add_cap( $cap );
|
3434 |
+
}
|
3435 |
+
update_option( 'wp_review_compatibility', true );
|
3436 |
}
|
|
|
3437 |
}
|
3438 |
+
);
|
includes/schemas.php
CHANGED
@@ -7,52 +7,52 @@
|
|
7 |
*/
|
8 |
|
9 |
return array(
|
10 |
-
'none'
|
11 |
'label' => __( 'None', 'wp-review' ),
|
12 |
),
|
13 |
-
'Article'
|
14 |
'label' => __( 'Article', 'wp-review' ),
|
15 |
),
|
16 |
-
'Book'
|
17 |
'label' => __( 'Book', 'wp-review' ),
|
18 |
),
|
19 |
-
'Game'
|
20 |
'label' => __( 'Game', 'wp-review' ),
|
21 |
),
|
22 |
-
'Movie'
|
23 |
'label' => __( 'Movie', 'wp-review' ),
|
24 |
),
|
25 |
-
'MusicRecording'
|
26 |
'label' => __( 'MusicRecording', 'wp-review' ),
|
27 |
),
|
28 |
-
'Painting'
|
29 |
'label' => __( 'Painting', 'wp-review' ),
|
30 |
),
|
31 |
-
'Place'
|
32 |
'label' => __( 'Place', 'wp-review' ),
|
33 |
),
|
34 |
-
'Product'
|
35 |
'label' => __( 'Product', 'wp-review' ),
|
36 |
),
|
37 |
-
'Recipe'
|
38 |
'label' => __( 'Recipe', 'wp-review' ),
|
39 |
),
|
40 |
-
'Restaurant'
|
41 |
'label' => __( 'Restaurant', 'wp-review' ),
|
42 |
),
|
43 |
'SoftwareApplication' => array(
|
44 |
'label' => __( 'SoftwareApplication', 'wp-review' ),
|
45 |
),
|
46 |
-
'Store'
|
47 |
'label' => __( 'Store', 'wp-review' ),
|
48 |
),
|
49 |
-
'Thing'
|
50 |
'label' => __( 'Thing (Default)', 'wp-review' ),
|
51 |
),
|
52 |
-
'TVSeries'
|
53 |
'label' => __( 'TVSeries', 'wp-review' ),
|
54 |
),
|
55 |
-
'WebSite'
|
56 |
'label' => __( 'WebSite', 'wp-review' ),
|
57 |
),
|
58 |
);
|
7 |
*/
|
8 |
|
9 |
return array(
|
10 |
+
'none' => array(
|
11 |
'label' => __( 'None', 'wp-review' ),
|
12 |
),
|
13 |
+
'Article' => array(
|
14 |
'label' => __( 'Article', 'wp-review' ),
|
15 |
),
|
16 |
+
'Book' => array(
|
17 |
'label' => __( 'Book', 'wp-review' ),
|
18 |
),
|
19 |
+
'Game' => array(
|
20 |
'label' => __( 'Game', 'wp-review' ),
|
21 |
),
|
22 |
+
'Movie' => array(
|
23 |
'label' => __( 'Movie', 'wp-review' ),
|
24 |
),
|
25 |
+
'MusicRecording' => array(
|
26 |
'label' => __( 'MusicRecording', 'wp-review' ),
|
27 |
),
|
28 |
+
'Painting' => array(
|
29 |
'label' => __( 'Painting', 'wp-review' ),
|
30 |
),
|
31 |
+
'Place' => array(
|
32 |
'label' => __( 'Place', 'wp-review' ),
|
33 |
),
|
34 |
+
'Product' => array(
|
35 |
'label' => __( 'Product', 'wp-review' ),
|
36 |
),
|
37 |
+
'Recipe' => array(
|
38 |
'label' => __( 'Recipe', 'wp-review' ),
|
39 |
),
|
40 |
+
'Restaurant' => array(
|
41 |
'label' => __( 'Restaurant', 'wp-review' ),
|
42 |
),
|
43 |
'SoftwareApplication' => array(
|
44 |
'label' => __( 'SoftwareApplication', 'wp-review' ),
|
45 |
),
|
46 |
+
'Store' => array(
|
47 |
'label' => __( 'Store', 'wp-review' ),
|
48 |
),
|
49 |
+
'Thing' => array(
|
50 |
'label' => __( 'Thing (Default)', 'wp-review' ),
|
51 |
),
|
52 |
+
'TVSeries' => array(
|
53 |
'label' => __( 'TVSeries', 'wp-review' ),
|
54 |
),
|
55 |
+
'WebSite' => array(
|
56 |
'label' => __( 'WebSite', 'wp-review' ),
|
57 |
),
|
58 |
);
|
includes/shortcodes.php
CHANGED
@@ -10,7 +10,7 @@ add_shortcode( 'wp-review', 'wp_review_shortcode' );
|
|
10 |
add_shortcode( 'wp-review-total', 'wp_review_total_shortcode' );
|
11 |
add_shortcode( 'wp-review-visitor-rating', 'wp_review_visitor_rating_shortcode' );
|
12 |
|
13 |
-
//
|
14 |
add_shortcode( 'wp_review', 'wp_review_shortcode' );
|
15 |
add_shortcode( 'wp_review_total', 'wp_review_total_shortcode' );
|
16 |
add_shortcode( 'wp_review_visitor_rating', 'wp_review_visitor_rating_shortcode' );
|
@@ -49,8 +49,8 @@ function wp_review_shortcode( $atts ) {
|
|
49 |
function wp_review_total_shortcode( $atts ) {
|
50 |
$atts = shortcode_atts(
|
51 |
array(
|
52 |
-
'id'
|
53 |
-
'class'
|
54 |
'context' => '',
|
55 |
),
|
56 |
$atts,
|
@@ -63,7 +63,7 @@ function wp_review_total_shortcode( $atts ) {
|
|
63 |
|
64 |
if ( 'product-rating' === $atts['context'] ) {
|
65 |
$args = array(
|
66 |
-
'color'
|
67 |
'inactive_color' => '#dedcdc',
|
68 |
'context' => 'product-rating',
|
69 |
);
|
@@ -96,8 +96,8 @@ function wp_review_visitor_rating_shortcode( $atts ) {
|
|
96 |
|
97 |
ob_start();
|
98 |
$post_reviews = mts_get_post_reviews( $atts['id'] );
|
99 |
-
$value
|
100 |
-
$count
|
101 |
?>
|
102 |
<div class="user-review-area wp-review-<?php echo esc_attr( $atts['id'] ); ?> review-wrapper">
|
103 |
<div class="visitor-rating-shortcode">
|
10 |
add_shortcode( 'wp-review-total', 'wp_review_total_shortcode' );
|
11 |
add_shortcode( 'wp-review-visitor-rating', 'wp_review_visitor_rating_shortcode' );
|
12 |
|
13 |
+
// Aliases.
|
14 |
add_shortcode( 'wp_review', 'wp_review_shortcode' );
|
15 |
add_shortcode( 'wp_review_total', 'wp_review_total_shortcode' );
|
16 |
add_shortcode( 'wp_review_visitor_rating', 'wp_review_visitor_rating_shortcode' );
|
49 |
function wp_review_total_shortcode( $atts ) {
|
50 |
$atts = shortcode_atts(
|
51 |
array(
|
52 |
+
'id' => null,
|
53 |
+
'class' => 'review-total-only review-total-shortcode',
|
54 |
'context' => '',
|
55 |
),
|
56 |
$atts,
|
63 |
|
64 |
if ( 'product-rating' === $atts['context'] ) {
|
65 |
$args = array(
|
66 |
+
'color' => '#fff',
|
67 |
'inactive_color' => '#dedcdc',
|
68 |
'context' => 'product-rating',
|
69 |
);
|
96 |
|
97 |
ob_start();
|
98 |
$post_reviews = mts_get_post_reviews( $atts['id'] );
|
99 |
+
$value = $post_reviews['rating'];
|
100 |
+
$count = $post_reviews['count'];
|
101 |
?>
|
102 |
<div class="user-review-area wp-review-<?php echo esc_attr( $atts['id'] ); ?> review-wrapper">
|
103 |
<div class="visitor-rating-shortcode">
|
includes/widgets/class-wp-review-tab-widget.php
CHANGED
@@ -23,17 +23,22 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
23 |
add_action( 'admin_enqueue_scripts', array( $this, 'wp_review_tab_admin_scripts' ) );
|
24 |
add_action( 'customize_controls_enqueue_scripts', array( $this, 'wp_review_tab_admin_scripts' ) );
|
25 |
|
26 |
-
$widget_ops
|
27 |
-
'classname'
|
28 |
'description' => __( 'Display Reviews in tabbed format.', 'wp-review' ),
|
29 |
);
|
30 |
$control_ops = array(
|
31 |
-
'width'
|
32 |
'height' => 350,
|
33 |
);
|
34 |
parent::__construct( 'wp_review_tab_widget', __( 'WP Review Widget', 'wp-review' ), $widget_ops, $control_ops );
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
public function wp_review_tab_admin_scripts( $hook ) {
|
38 |
if ( 'widgets.php' !== $hook ) {
|
39 |
return;
|
@@ -42,45 +47,60 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
42 |
wp_enqueue_script( 'wp_review_tab_widget_admin' );
|
43 |
}
|
44 |
|
|
|
|
|
|
|
45 |
public function wp_review_tab_register_scripts() {
|
46 |
// JS.
|
47 |
wp_register_script( 'wp_review_tab_widget', WP_REVIEW_ASSETS . 'js/wp-review-tab-widget.js', array( 'jquery' ), '3.0.0', true );
|
48 |
-
wp_localize_script(
|
49 |
-
'
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
public function form( $instance ) {
|
54 |
-
$instance = wp_parse_args(
|
55 |
-
|
56 |
-
|
57 |
-
'
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
'
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
'
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
84 |
|
85 |
// Fix notice when switch to new version.
|
86 |
if ( ! isset( $instance['tabs']['recent_ratings'] ) ) {
|
@@ -92,27 +112,27 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
92 |
if ( ! isset( $instance['tab_titles']['recent_ratings'] ) ) {
|
93 |
$instance['tab_titles']['recent_ratings'] = __( 'Comments', 'wp-review' );
|
94 |
}
|
95 |
-
extract( $instance );
|
96 |
$review_type = (array) $review_type;
|
97 |
?>
|
98 |
<div class="wp_review_tab_options_form">
|
99 |
<h4><?php esc_html_e( 'Select Tabs', 'wp-review' ); ?></h4>
|
100 |
|
101 |
<div class="wp_review_tab_select_tabs">
|
102 |
-
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id(
|
103 |
-
<input type="checkbox" class="checkbox wp_review_tab_enable_toprated" id="<?php echo $this->get_field_id(
|
104 |
<?php esc_html_e( 'Top Rated', 'wp-review' ); ?>
|
105 |
</label>
|
106 |
-
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id(
|
107 |
-
<input type="checkbox" class="checkbox wp_review_tab_enable_recent" id="<?php echo $this->get_field_id(
|
108 |
<?php esc_html_e( 'Recent Reviews', 'wp-review' ); ?>
|
109 |
</label>
|
110 |
-
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id(
|
111 |
-
<input type="checkbox" class="checkbox wp_review_tab_enable_mostvoted" id="<?php echo $this->get_field_id(
|
112 |
<?php esc_html_e( 'Most Voted', 'wp-review' ); ?>
|
113 |
</label>
|
114 |
-
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id(
|
115 |
-
<input type="checkbox" class="checkbox wp_review_tab_enable_custom" id="<?php echo $this->get_field_id(
|
116 |
<?php esc_html_e( 'Custom', 'wp-review' ); ?>
|
117 |
</label>
|
118 |
</div>
|
@@ -130,13 +150,13 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
130 |
</p>
|
131 |
|
132 |
<p class="wp_review_tab_top_rated_filter">
|
133 |
-
<label for="<?php echo $this->get_field_id('top_rated_posts'); ?>"><?php _e('Top Rated Posts By:', 'wp-review'); ?></label>
|
134 |
<?php wp_review_print_pro_text(); ?>
|
135 |
|
136 |
<span class="wp-review-disabled inline-block has-bg">
|
137 |
-
<select id="<?php echo $this->get_field_id('top_rated_posts'); ?>" name="<?php echo $this->get_field_name('top_rated_posts'); ?>" style="margin-left: 12px;" disabled>
|
138 |
-
<option value="visitors"><?php _e('Visitors', 'wp-review'); ?></option>
|
139 |
-
<option value="comments"><?php _e('Comments', 'wp-review'); ?></option>
|
140 |
</select>
|
141 |
</span>
|
142 |
</p>
|
@@ -162,7 +182,7 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
162 |
|
163 |
<p>
|
164 |
<label for="<?php echo $this->get_field_id( 'allow_pagination' ); ?>">
|
165 |
-
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'allow_pagination' ); ?>" name="<?php echo $this->get_field_name( 'allow_pagination' ); ?>" value="1" <?php if (isset( $allow_pagination)) { checked( 1, $allow_pagination, true ); } ?> />
|
166 |
<?php _e( 'Allow pagination', 'wp-review' ); ?>
|
167 |
</label>
|
168 |
</p>
|
@@ -186,13 +206,13 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
186 |
<p class="wp_review_tab_thumbnail_size">
|
187 |
<label for="<?php echo $this->get_field_id( 'thumb_size' ); ?>"><?php _e( 'Thumbnail size:', 'wp-review' ); ?></label>
|
188 |
<select id="<?php echo $this->get_field_id( 'thumb_size' ); ?>" name="<?php echo $this->get_field_name( 'thumb_size' ); ?>" style="margin-left: 12px;">
|
189 |
-
<option value="small" <?php selected( $thumb_size, 'small', true); ?>><?php _e( 'Small', 'wp-review' ); ?></option>
|
190 |
-
<option value="large" <?php selected( $thumb_size, 'large', true); ?>><?php _e( 'Large', 'wp-review' ); ?></option>
|
191 |
</select>
|
192 |
</p>
|
193 |
|
194 |
<p>
|
195 |
-
<label for="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ) ?>"><?php esc_html_e( 'Extra information', 'wp-review' ); ?></label>
|
196 |
<select name="<?php echo esc_attr( $this->get_field_name( 'show_date' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>" class="widefat">
|
197 |
<option value=""><?php esc_html_e( 'None', 'wp-review' ); ?></option>
|
198 |
<option value="1" <?php selected( $instance['show_date'], 1 ); ?>><?php esc_html_e( 'Post date', 'wp-review' ); ?></option>
|
@@ -200,7 +220,7 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
200 |
</select>
|
201 |
</p>
|
202 |
|
203 |
-
<p class="wp_review_tab_custom_reviews"<?php echo
|
204 |
<label for="<?php echo $this->get_field_id( 'custom_reviews' ); ?>"><?php _e( 'Reviews on Custom tab:', 'wp-review' ); ?>
|
205 |
<br />
|
206 |
<input id="<?php echo $this->get_field_id( 'custom_reviews' ); ?>" name="<?php echo $this->get_field_name( 'custom_reviews' ); ?>" type="text" value="<?php echo $custom_reviews; ?>" />
|
@@ -215,24 +235,23 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
215 |
|
216 |
<div class="wp_review_tab_order" style="display: none;">
|
217 |
|
218 |
-
<label class="alignleft wp_review_tab_toprated_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_toprated" style="width: 50%;<?php echo
|
219 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_toprated" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[toprated]" type="number" min="1" step="1" value="<?php echo $tab_order['toprated']; ?>" style="width: 48px;" />
|
220 |
<?php _e( 'Top Rated', 'wp-review' ); ?>
|
221 |
</label>
|
222 |
-
<label class="alignleft wp_review_tab_recent_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_recent" style="width: 50%;<?php echo
|
223 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_recent" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[recent]" type="number" min="1" step="1" value="<?php echo $tab_order['recent']; ?>" style="width: 48px;" />
|
224 |
<?php _e( 'Recent', 'wp-review' ); ?>
|
225 |
</label>
|
226 |
-
<label class="alignleft wp_review_tab_mostvoted_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_mostvoted" style="width: 50%;<?php echo
|
227 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_mostvoted" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[mostvoted]" type="number" min="1" step="1" value="<?php echo $tab_order['mostvoted']; ?>" style="width: 48px;" />
|
228 |
<?php _e( 'Most Voted', 'wp-review' ); ?>
|
229 |
</label>
|
|
|
|
|
|
|
230 |
</label>
|
231 |
-
<label class="alignleft
|
232 |
-
<input id="<?php echo $this->get_field_id('tab_order'); ?>_mostvoted" name="<?php echo $this->get_field_name('tab_order'); ?>[recent_ratings]" type="number" min="1" step="1" value="<?php echo $tab_order['recent_ratings']; ?>" style="width: 48px;" />
|
233 |
-
<?php _e('Recent Ratings', 'wp-review'); ?>
|
234 |
-
</label>
|
235 |
-
<label class="alignleft wp_review_tab_custom_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_custom" style="width: 50%;<?php echo (empty( $tabs['custom']) ? ' display: none;' : '' ); ?>">
|
236 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_custom" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[custom]" type="number" min="1" step="1" value="<?php echo $tab_order['custom']; ?>" style="width: 48px;" />
|
237 |
<?php _e( 'Custom', 'wp-review' ); ?>
|
238 |
</label>
|
@@ -241,25 +260,25 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
241 |
|
242 |
<div class="wp_review_tab_titles" style="display: none;">
|
243 |
|
244 |
-
<label class="alignleft wp_review_tab_toprated_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_toprated" style="width: 50%;<?php echo
|
245 |
<?php _e( 'Top Rated', 'wp-review' ); ?>
|
246 |
-
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_toprated" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[toprated]" type="text" value="<?php echo esc_attr( $tab_titles['toprated']); ?>" style="width: 98%;" />
|
247 |
</label>
|
248 |
-
<label class="alignleft wp_review_tab_recent_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_recent" style="width: 50%;<?php echo
|
249 |
<?php _e( 'Recent', 'wp-review' ); ?>
|
250 |
-
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_recent" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[recent]" type="text" value="<?php echo esc_attr( $tab_titles['recent']); ?>" style="width: 98%;" />
|
251 |
</label>
|
252 |
-
<label class="alignleft wp_review_tab_mostvoted_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_mostvoted" style="width: 50%;<?php echo
|
253 |
<?php _e( 'Most Voted', 'wp-review' ); ?>
|
254 |
-
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_mostvoted" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[mostvoted]" type="text" value="<?php echo esc_attr( $tab_titles['mostvoted']); ?>" style="width: 98%;" />
|
255 |
</label>
|
256 |
-
<label class="alignleft wp_review_tab_recent_ratings_title" for="<?php echo $this->get_field_id('tab_titles'); ?>_recent_ratings" style="width: 50%;<?php echo
|
257 |
-
<?php _e('Recent Ratings', 'wp-review'); ?>
|
258 |
-
|
259 |
-
|
260 |
-
<label class="alignleft wp_review_tab_custom_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_custom" style="width: 50%;<?php echo
|
261 |
<?php _e( 'Custom', 'wp-review' ); ?>
|
262 |
-
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_custom" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[custom]" type="text" value="<?php echo esc_attr( $tab_titles['custom']); ?>" style="width: 98%;" />
|
263 |
</label>
|
264 |
</div>
|
265 |
<div class="clear" style="margin-bottom: 15px;"></div>
|
@@ -269,27 +288,40 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
269 |
<?php
|
270 |
}
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
public function update( $new_instance, $old_instance ) {
|
273 |
-
$instance
|
274 |
-
$instance['tabs']
|
275 |
-
$instance['tab_order']
|
276 |
-
$instance['tab_titles']
|
277 |
-
$instance['review_type']
|
278 |
-
$instance['allow_pagination']
|
279 |
-
$instance['post_num']
|
280 |
-
$instance['title_length']
|
281 |
-
$instance['thumb_size']
|
282 |
-
$instance['show_date']
|
283 |
-
$instance['custom_reviews']
|
284 |
$instance['restrict_recent_reviews'] = $new_instance['restrict_recent_reviews'];
|
285 |
-
$instance['top_rated_posts']
|
286 |
return $instance;
|
287 |
}
|
288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
public function widget( $args, $instance ) {
|
290 |
global $post;
|
291 |
-
extract( $args, EXTR_SKIP );
|
292 |
-
extract( $instance, EXTR_SKIP );
|
293 |
wp_enqueue_script( 'wp_review_tab_widget' );
|
294 |
wp_enqueue_script( 'wp_review-js' );
|
295 |
wp_enqueue_style( 'wp_review-style' );
|
@@ -297,7 +329,7 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
297 |
|
298 |
if ( empty( $tabs ) ) {
|
299 |
$tabs = array(
|
300 |
-
'recent'
|
301 |
'toprated' => 1,
|
302 |
);
|
303 |
}
|
@@ -308,12 +340,15 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
308 |
$tabs_count = 5;
|
309 |
}
|
310 |
|
311 |
-
$tab_titles = wp_parse_args(
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
|
|
|
|
|
|
317 |
|
318 |
$available_tabs = array(
|
319 |
'toprated' => $tab_titles['toprated'],
|
@@ -383,12 +418,15 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
383 |
$( '#<?php echo esc_attr( $widget_id ); ?>_content' ).data( 'args', <?php echo wp_json_encode( $instance ); ?>);
|
384 |
});
|
385 |
</script>
|
386 |
-
<?php
|
|
|
387 |
}
|
388 |
|
389 |
-
|
|
|
|
|
390 |
public function ajax_wp_review_tab_widget_content() {
|
391 |
-
$tab
|
392 |
$args = $_POST['args'];
|
393 |
$page = intval( $_POST['page'] );
|
394 |
if ( $page < 1 ) {
|
@@ -404,10 +442,10 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
404 |
|
405 |
$title_length = ! empty( $args['title_length'] ) ? $args['title_length'] : apply_filters( 'wpt_title_length_default', '15' );
|
406 |
|
407 |
-
$show_date
|
408 |
$allow_pagination = ! empty( $args['allow_pagination'] );
|
409 |
|
410 |
-
$post_num
|
411 |
$review_type = ! empty( $args['review_type'] ) ? (array) $args['review_type'] : array();
|
412 |
|
413 |
// Normal tabs.
|
@@ -442,8 +480,9 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
442 |
<ul>
|
443 |
<?php
|
444 |
$last_page = $query->max_num_pages;
|
445 |
-
while ( $query->have_posts() ) :
|
446 |
-
$
|
|
|
447 |
$classes[] = 'wp_review_tab_thumb_' . $thumb_size;
|
448 |
if ( ! has_post_thumbnail() ) {
|
449 |
$classes[] = 'wp-review-no-thumb';
|
@@ -464,19 +503,26 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
464 |
<div class="entry-title"><a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php echo $this->post_title( $title_length ); ?></div></a>
|
465 |
<?php
|
466 |
$rating_args = array(
|
467 |
-
'in_widget'
|
468 |
);
|
469 |
wp_review_show_total( true, 'review-total-only ' . $thumb_size . '-thumb', null, $rating_args );
|
470 |
|
471 |
-
wp_review_extra_info(
|
472 |
-
|
473 |
-
|
474 |
-
|
|
|
|
|
|
|
|
|
475 |
?>
|
476 |
</div>
|
477 |
<div class="clear"></div>
|
478 |
</li>
|
479 |
-
|
|
|
|
|
|
|
480 |
</ul>
|
481 |
|
482 |
<div class="clear"></div>
|
@@ -488,6 +534,12 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
488 |
die(); // required to return a proper result.
|
489 |
}
|
490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
public function tab_pagination( $page, $last_page ) {
|
492 |
if ( $last_page <= 1 ) {
|
493 |
return;
|
@@ -506,6 +558,12 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
506 |
<?php
|
507 |
}
|
508 |
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
public function post_title( $limit = 15 ) {
|
510 |
$title = get_the_title();
|
511 |
if ( ! $title ) {
|
@@ -519,9 +577,16 @@ class WP_Review_Tab_Widget extends WP_Widget {
|
|
519 |
} else {
|
520 |
$title = implode( ' ', $title );
|
521 |
}
|
522 |
-
|
523 |
}
|
524 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
525 |
public function truncate( $str, $length = 24 ) {
|
526 |
if ( mb_strlen( $str ) > $length ) {
|
527 |
return mb_substr( $str, 0, $length ) . '…';
|
23 |
add_action( 'admin_enqueue_scripts', array( $this, 'wp_review_tab_admin_scripts' ) );
|
24 |
add_action( 'customize_controls_enqueue_scripts', array( $this, 'wp_review_tab_admin_scripts' ) );
|
25 |
|
26 |
+
$widget_ops = array(
|
27 |
+
'classname' => 'widget_wp_review_tab',
|
28 |
'description' => __( 'Display Reviews in tabbed format.', 'wp-review' ),
|
29 |
);
|
30 |
$control_ops = array(
|
31 |
+
'width' => 200,
|
32 |
'height' => 350,
|
33 |
);
|
34 |
parent::__construct( 'wp_review_tab_widget', __( 'WP Review Widget', 'wp-review' ), $widget_ops, $control_ops );
|
35 |
}
|
36 |
|
37 |
+
/**
|
38 |
+
* Enqueues admin scripts.
|
39 |
+
*
|
40 |
+
* @param string $hook Admin page hook.
|
41 |
+
*/
|
42 |
public function wp_review_tab_admin_scripts( $hook ) {
|
43 |
if ( 'widgets.php' !== $hook ) {
|
44 |
return;
|
47 |
wp_enqueue_script( 'wp_review_tab_widget_admin' );
|
48 |
}
|
49 |
|
50 |
+
/**
|
51 |
+
* Registers scripts.
|
52 |
+
*/
|
53 |
public function wp_review_tab_register_scripts() {
|
54 |
// JS.
|
55 |
wp_register_script( 'wp_review_tab_widget', WP_REVIEW_ASSETS . 'js/wp-review-tab-widget.js', array( 'jquery' ), '3.0.0', true );
|
56 |
+
wp_localize_script(
|
57 |
+
'wp_review_tab_widget',
|
58 |
+
'wp_review_tab',
|
59 |
+
array(
|
60 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
61 |
+
)
|
62 |
+
);
|
63 |
}
|
64 |
|
65 |
+
/**
|
66 |
+
* Shows widget form.
|
67 |
+
*
|
68 |
+
* @param array $instance Widget instance.
|
69 |
+
*/
|
70 |
public function form( $instance ) {
|
71 |
+
$instance = wp_parse_args(
|
72 |
+
(array) $instance,
|
73 |
+
array(
|
74 |
+
'tabs' => array(
|
75 |
+
'toprated' => 1,
|
76 |
+
'recent' => 1,
|
77 |
+
'mostvoted' => 0,
|
78 |
+
'custom' => 0,
|
79 |
+
),
|
80 |
+
'tab_order' => array(
|
81 |
+
'toprated' => 1,
|
82 |
+
'recent' => 2,
|
83 |
+
'mostvoted' => 3,
|
84 |
+
'custom' => 4,
|
85 |
+
),
|
86 |
+
'tab_titles' => array(
|
87 |
+
'toprated' => __( 'Top Rated', 'wp-review' ),
|
88 |
+
'recent' => __( 'Recent', 'wp-review' ),
|
89 |
+
'mostvoted' => __( 'Most Voted', 'wp-review' ),
|
90 |
+
'custom' => __( 'Editor\'s choice', 'wp-review' ),
|
91 |
+
),
|
92 |
+
'allow_pagination' => 1,
|
93 |
+
'review_type' => array(),
|
94 |
+
'post_num' => '5',
|
95 |
+
'comment_num' => '5',
|
96 |
+
'thumb_size' => 'small',
|
97 |
+
'show_date' => 1,
|
98 |
+
'top_rated_posts' => 'visitors',
|
99 |
+
'restrict_recent_reviews' => 0,
|
100 |
+
'custom_reviews' => '',
|
101 |
+
'title_length' => apply_filters( 'wpt_title_length_default', '15' ),
|
102 |
+
)
|
103 |
+
);
|
104 |
|
105 |
// Fix notice when switch to new version.
|
106 |
if ( ! isset( $instance['tabs']['recent_ratings'] ) ) {
|
112 |
if ( ! isset( $instance['tab_titles']['recent_ratings'] ) ) {
|
113 |
$instance['tab_titles']['recent_ratings'] = __( 'Comments', 'wp-review' );
|
114 |
}
|
115 |
+
extract( $instance ); // phpcs:ignore
|
116 |
$review_type = (array) $review_type;
|
117 |
?>
|
118 |
<div class="wp_review_tab_options_form">
|
119 |
<h4><?php esc_html_e( 'Select Tabs', 'wp-review' ); ?></h4>
|
120 |
|
121 |
<div class="wp_review_tab_select_tabs">
|
122 |
+
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id( 'tabs' ); ?>_toprated">
|
123 |
+
<input type="checkbox" class="checkbox wp_review_tab_enable_toprated" id="<?php echo $this->get_field_id( 'tabs' ); ?>_toprated" name="<?php echo $this->get_field_name( 'tabs' ); ?>[toprated]" value="1" <?php if ( isset( $tabs['toprated'] ) ) checked( 1, $tabs['toprated'], true ); // phpcs:ignore ?> />
|
124 |
<?php esc_html_e( 'Top Rated', 'wp-review' ); ?>
|
125 |
</label>
|
126 |
+
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id( 'tabs' ); ?>_recent">
|
127 |
+
<input type="checkbox" class="checkbox wp_review_tab_enable_recent" id="<?php echo $this->get_field_id( 'tabs' ); ?>_recent" name="<?php echo $this->get_field_name( 'tabs' ); ?>[recent]" value="1" <?php if ( isset( $tabs['recent'] ) ) checked( 1, $tabs['recent'], true ); // phpcs:ignore ?> />
|
128 |
<?php esc_html_e( 'Recent Reviews', 'wp-review' ); ?>
|
129 |
</label>
|
130 |
+
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id( 'tabs' ); ?>_mostvoted">
|
131 |
+
<input type="checkbox" class="checkbox wp_review_tab_enable_mostvoted" id="<?php echo $this->get_field_id( 'tabs' ); ?>_mostvoted" name="<?php echo $this->get_field_name( 'tabs' ); ?>[mostvoted]" value="1" <?php if ( isset( $tabs['mostvoted'] ) ) checked( 1, $tabs['mostvoted'], true ); // phpcs:ignore ?> />
|
132 |
<?php esc_html_e( 'Most Voted', 'wp-review' ); ?>
|
133 |
</label>
|
134 |
+
<label class="alignleft" style="display: block; width: 50%; margin-bottom: 7px;" for="<?php echo $this->get_field_id( 'tabs' ); ?>_custom">
|
135 |
+
<input type="checkbox" class="checkbox wp_review_tab_enable_custom" id="<?php echo $this->get_field_id( 'tabs' ); ?>_custom" name="<?php echo $this->get_field_name( 'tabs' ); ?>[custom]" value="1" <?php if ( isset( $tabs['custom'] ) ) { checked( 1, $tabs['custom'], true ); } // phpcs:ignore ?> />
|
136 |
<?php esc_html_e( 'Custom', 'wp-review' ); ?>
|
137 |
</label>
|
138 |
</div>
|
150 |
</p>
|
151 |
|
152 |
<p class="wp_review_tab_top_rated_filter">
|
153 |
+
<label for="<?php echo $this->get_field_id( 'top_rated_posts' ); ?>"><?php _e( 'Top Rated Posts By:', 'wp-review' ); ?></label>
|
154 |
<?php wp_review_print_pro_text(); ?>
|
155 |
|
156 |
<span class="wp-review-disabled inline-block has-bg">
|
157 |
+
<select id="<?php echo $this->get_field_id( 'top_rated_posts' ); ?>" name="<?php echo $this->get_field_name( 'top_rated_posts' ); ?>" style="margin-left: 12px;" disabled>
|
158 |
+
<option value="visitors"><?php _e( 'Visitors', 'wp-review' ); ?></option>
|
159 |
+
<option value="comments"><?php _e( 'Comments', 'wp-review' ); ?></option>
|
160 |
</select>
|
161 |
</span>
|
162 |
</p>
|
182 |
|
183 |
<p>
|
184 |
<label for="<?php echo $this->get_field_id( 'allow_pagination' ); ?>">
|
185 |
+
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'allow_pagination' ); ?>" name="<?php echo $this->get_field_name( 'allow_pagination' ); ?>" value="1" <?php if ( isset( $allow_pagination ) ) { checked( 1, $allow_pagination, true ); } // phpcs:ignore ?> />
|
186 |
<?php _e( 'Allow pagination', 'wp-review' ); ?>
|
187 |
</label>
|
188 |
</p>
|
206 |
<p class="wp_review_tab_thumbnail_size">
|
207 |
<label for="<?php echo $this->get_field_id( 'thumb_size' ); ?>"><?php _e( 'Thumbnail size:', 'wp-review' ); ?></label>
|
208 |
<select id="<?php echo $this->get_field_id( 'thumb_size' ); ?>" name="<?php echo $this->get_field_name( 'thumb_size' ); ?>" style="margin-left: 12px;">
|
209 |
+
<option value="small" <?php selected( $thumb_size, 'small', true ); ?>><?php _e( 'Small', 'wp-review' ); ?></option>
|
210 |
+
<option value="large" <?php selected( $thumb_size, 'large', true ); ?>><?php _e( 'Large', 'wp-review' ); ?></option>
|
211 |
</select>
|
212 |
</p>
|
213 |
|
214 |
<p>
|
215 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>"><?php esc_html_e( 'Extra information', 'wp-review' ); ?></label>
|
216 |
<select name="<?php echo esc_attr( $this->get_field_name( 'show_date' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'show_date' ) ); ?>" class="widefat">
|
217 |
<option value=""><?php esc_html_e( 'None', 'wp-review' ); ?></option>
|
218 |
<option value="1" <?php selected( $instance['show_date'], 1 ); ?>><?php esc_html_e( 'Post date', 'wp-review' ); ?></option>
|
220 |
</select>
|
221 |
</p>
|
222 |
|
223 |
+
<p class="wp_review_tab_custom_reviews"<?php echo empty( $tabs['custom'] ) ? ' style="display: none;"' : ''; ?>>
|
224 |
<label for="<?php echo $this->get_field_id( 'custom_reviews' ); ?>"><?php _e( 'Reviews on Custom tab:', 'wp-review' ); ?>
|
225 |
<br />
|
226 |
<input id="<?php echo $this->get_field_id( 'custom_reviews' ); ?>" name="<?php echo $this->get_field_name( 'custom_reviews' ); ?>" type="text" value="<?php echo $custom_reviews; ?>" />
|
235 |
|
236 |
<div class="wp_review_tab_order" style="display: none;">
|
237 |
|
238 |
+
<label class="alignleft wp_review_tab_toprated_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_toprated" style="width: 50%;<?php echo empty( $tabs['toprated'] ) ? ' display: none;' : ''; ?>">
|
239 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_toprated" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[toprated]" type="number" min="1" step="1" value="<?php echo $tab_order['toprated']; ?>" style="width: 48px;" />
|
240 |
<?php _e( 'Top Rated', 'wp-review' ); ?>
|
241 |
</label>
|
242 |
+
<label class="alignleft wp_review_tab_recent_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_recent" style="width: 50%;<?php echo empty( $tabs['recent'] ) ? ' display: none;' : ''; ?>">
|
243 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_recent" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[recent]" type="number" min="1" step="1" value="<?php echo $tab_order['recent']; ?>" style="width: 48px;" />
|
244 |
<?php _e( 'Recent', 'wp-review' ); ?>
|
245 |
</label>
|
246 |
+
<label class="alignleft wp_review_tab_mostvoted_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_mostvoted" style="width: 50%;<?php echo empty( $tabs['mostvoted'] ) ? ' display: none;' : ''; ?>">
|
247 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_mostvoted" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[mostvoted]" type="number" min="1" step="1" value="<?php echo $tab_order['mostvoted']; ?>" style="width: 48px;" />
|
248 |
<?php _e( 'Most Voted', 'wp-review' ); ?>
|
249 |
</label>
|
250 |
+
<label class="alignleft wp_review_tab_recent_ratings_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_recent_ratings" style="width: 50%;<?php echo empty( $tabs['recent_ratings'] ) ? ' display: none;' : ''; ?>">
|
251 |
+
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_mostvoted" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[recent_ratings]" type="number" min="1" step="1" value="<?php echo $tab_order['recent_ratings']; ?>" style="width: 48px;" />
|
252 |
+
<?php _e( 'Recent Ratings', 'wp-review' ); ?>
|
253 |
</label>
|
254 |
+
<label class="alignleft wp_review_tab_custom_order" for="<?php echo $this->get_field_id( 'tab_order' ); ?>_custom" style="width: 50%;<?php echo empty( $tabs['custom'] ) ? ' display: none;' : ''; ?>">
|
|
|
|
|
|
|
|
|
255 |
<input id="<?php echo $this->get_field_id( 'tab_order' ); ?>_custom" name="<?php echo $this->get_field_name( 'tab_order' ); ?>[custom]" type="number" min="1" step="1" value="<?php echo $tab_order['custom']; ?>" style="width: 48px;" />
|
256 |
<?php _e( 'Custom', 'wp-review' ); ?>
|
257 |
</label>
|
260 |
|
261 |
<div class="wp_review_tab_titles" style="display: none;">
|
262 |
|
263 |
+
<label class="alignleft wp_review_tab_toprated_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_toprated" style="width: 50%;<?php echo empty( $tabs['toprated'] ) ? ' display: none;' : ''; ?>">
|
264 |
<?php _e( 'Top Rated', 'wp-review' ); ?>
|
265 |
+
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_toprated" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[toprated]" type="text" value="<?php echo esc_attr( $tab_titles['toprated'] ); ?>" style="width: 98%;" />
|
266 |
</label>
|
267 |
+
<label class="alignleft wp_review_tab_recent_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_recent" style="width: 50%;<?php echo empty( $tabs['recent'] ) ? ' display: none;' : ''; ?>">
|
268 |
<?php _e( 'Recent', 'wp-review' ); ?>
|
269 |
+
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_recent" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[recent]" type="text" value="<?php echo esc_attr( $tab_titles['recent'] ); ?>" style="width: 98%;" />
|
270 |
</label>
|
271 |
+
<label class="alignleft wp_review_tab_mostvoted_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_mostvoted" style="width: 50%;<?php echo empty( $tabs['mostvoted'] ) ? ' display: none;' : ''; ?>">
|
272 |
<?php _e( 'Most Voted', 'wp-review' ); ?>
|
273 |
+
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_mostvoted" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[mostvoted]" type="text" value="<?php echo esc_attr( $tab_titles['mostvoted'] ); ?>" style="width: 98%;" />
|
274 |
</label>
|
275 |
+
<label class="alignleft wp_review_tab_recent_ratings_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_recent_ratings" style="width: 50%;<?php echo empty( $tabs['recent_ratings'] ) ? ' display: none;' : ''; ?>">
|
276 |
+
<?php _e( 'Recent Ratings', 'wp-review' ); ?>
|
277 |
+
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_recent_ratings" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[recent_ratings]" type="text" value="<?php echo esc_attr( $tab_titles['recent_ratings'] ); ?>" style="width: 98%;" />
|
278 |
+
</label>
|
279 |
+
<label class="alignleft wp_review_tab_custom_title" for="<?php echo $this->get_field_id( 'tab_titles' ); ?>_custom" style="width: 50%;<?php echo empty( $tabs['custom'] ) ? ' display: none;' : ''; ?>">
|
280 |
<?php _e( 'Custom', 'wp-review' ); ?>
|
281 |
+
<input id="<?php echo $this->get_field_id( 'tab_titles' ); ?>_custom" name="<?php echo $this->get_field_name( 'tab_titles' ); ?>[custom]" type="text" value="<?php echo esc_attr( $tab_titles['custom'] ); ?>" style="width: 98%;" />
|
282 |
</label>
|
283 |
</div>
|
284 |
<div class="clear" style="margin-bottom: 15px;"></div>
|
288 |
<?php
|
289 |
}
|
290 |
|
291 |
+
/**
|
292 |
+
* Updates widget values.
|
293 |
+
*
|
294 |
+
* @param array $new_instance New instance.
|
295 |
+
* @param array $old_instance Old instance.
|
296 |
+
* @return array
|
297 |
+
*/
|
298 |
public function update( $new_instance, $old_instance ) {
|
299 |
+
$instance = $old_instance;
|
300 |
+
$instance['tabs'] = $new_instance['tabs'];
|
301 |
+
$instance['tab_order'] = $new_instance['tab_order'];
|
302 |
+
$instance['tab_titles'] = wp_kses_post( $new_instance['tab_titles'] );
|
303 |
+
$instance['review_type'] = isset( $new_instance['review_type'] ) ? $new_instance['review_type'] : '';
|
304 |
+
$instance['allow_pagination'] = $new_instance['allow_pagination'];
|
305 |
+
$instance['post_num'] = $new_instance['post_num'];
|
306 |
+
$instance['title_length'] = $new_instance['title_length'];
|
307 |
+
$instance['thumb_size'] = $new_instance['thumb_size'];
|
308 |
+
$instance['show_date'] = isset( $new_instance['show_date'] ) ? intval( $new_instance['show_date'] ) : 1;
|
309 |
+
$instance['custom_reviews'] = $new_instance['custom_reviews'];
|
310 |
$instance['restrict_recent_reviews'] = $new_instance['restrict_recent_reviews'];
|
311 |
+
$instance['top_rated_posts'] = $new_instance['top_rated_posts'];
|
312 |
return $instance;
|
313 |
}
|
314 |
|
315 |
+
/**
|
316 |
+
* Shows widget template.
|
317 |
+
*
|
318 |
+
* @param array $args Widget args.
|
319 |
+
* @param array $instance Widget instance.
|
320 |
+
*/
|
321 |
public function widget( $args, $instance ) {
|
322 |
global $post;
|
323 |
+
extract( $args, EXTR_SKIP ); // phpcs:ignore
|
324 |
+
extract( $instance, EXTR_SKIP ); // phpcs:ignore
|
325 |
wp_enqueue_script( 'wp_review_tab_widget' );
|
326 |
wp_enqueue_script( 'wp_review-js' );
|
327 |
wp_enqueue_style( 'wp_review-style' );
|
329 |
|
330 |
if ( empty( $tabs ) ) {
|
331 |
$tabs = array(
|
332 |
+
'recent' => 1,
|
333 |
'toprated' => 1,
|
334 |
);
|
335 |
}
|
340 |
$tabs_count = 5;
|
341 |
}
|
342 |
|
343 |
+
$tab_titles = wp_parse_args(
|
344 |
+
$tab_titles,
|
345 |
+
array(
|
346 |
+
'toprated' => __( 'Top Rated', 'wp-review' ),
|
347 |
+
'recent' => __( 'Recent', 'wp-review' ),
|
348 |
+
'mostvoted' => __( 'Most Voted', 'wp-review' ),
|
349 |
+
'custom' => __( 'Editor\'s choice', 'wp-review' ),
|
350 |
+
)
|
351 |
+
);
|
352 |
|
353 |
$available_tabs = array(
|
354 |
'toprated' => $tab_titles['toprated'],
|
418 |
$( '#<?php echo esc_attr( $widget_id ); ?>_content' ).data( 'args', <?php echo wp_json_encode( $instance ); ?>);
|
419 |
});
|
420 |
</script>
|
421 |
+
<?php
|
422 |
+
echo wp_kses_post( $after_widget );
|
423 |
}
|
424 |
|
425 |
+
/**
|
426 |
+
* AJAX gets tab content.
|
427 |
+
*/
|
428 |
public function ajax_wp_review_tab_widget_content() {
|
429 |
+
$tab = $_POST['tab'];
|
430 |
$args = $_POST['args'];
|
431 |
$page = intval( $_POST['page'] );
|
432 |
if ( $page < 1 ) {
|
442 |
|
443 |
$title_length = ! empty( $args['title_length'] ) ? $args['title_length'] : apply_filters( 'wpt_title_length_default', '15' );
|
444 |
|
445 |
+
$show_date = intval( $args['show_date'] );
|
446 |
$allow_pagination = ! empty( $args['allow_pagination'] );
|
447 |
|
448 |
+
$post_num = ( empty( $args['post_num'] ) || $args['post_num'] > 20 || $args['post_num'] < 1 ) ? 5 : intval( $args['post_num'] );
|
449 |
$review_type = ! empty( $args['review_type'] ) ? (array) $args['review_type'] : array();
|
450 |
|
451 |
// Normal tabs.
|
480 |
<ul>
|
481 |
<?php
|
482 |
$last_page = $query->max_num_pages;
|
483 |
+
while ( $query->have_posts() ) :
|
484 |
+
$query->the_post();
|
485 |
+
$classes = array( 'wp_review_tab_thumbnail' );
|
486 |
$classes[] = 'wp_review_tab_thumb_' . $thumb_size;
|
487 |
if ( ! has_post_thumbnail() ) {
|
488 |
$classes[] = 'wp-review-no-thumb';
|
503 |
<div class="entry-title"><a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php echo $this->post_title( $title_length ); ?></div></a>
|
504 |
<?php
|
505 |
$rating_args = array(
|
506 |
+
'in_widget' => true,
|
507 |
);
|
508 |
wp_review_show_total( true, 'review-total-only ' . $thumb_size . '-thumb', null, $rating_args );
|
509 |
|
510 |
+
wp_review_extra_info(
|
511 |
+
get_the_ID(),
|
512 |
+
$show_date,
|
513 |
+
array(
|
514 |
+
'date_format' => 'M j, Y',
|
515 |
+
'class' => 'wp-review-tab-postmeta',
|
516 |
+
)
|
517 |
+
); // Using `show_date` to keep compatibility.
|
518 |
?>
|
519 |
</div>
|
520 |
<div class="clear"></div>
|
521 |
</li>
|
522 |
+
<?php
|
523 |
+
endwhile;
|
524 |
+
wp_reset_postdata();
|
525 |
+
?>
|
526 |
</ul>
|
527 |
|
528 |
<div class="clear"></div>
|
534 |
die(); // required to return a proper result.
|
535 |
}
|
536 |
|
537 |
+
/**
|
538 |
+
* Shows tab pagination.
|
539 |
+
*
|
540 |
+
* @param int $page Current page.
|
541 |
+
* @param int $last_page Last page.
|
542 |
+
*/
|
543 |
public function tab_pagination( $page, $last_page ) {
|
544 |
if ( $last_page <= 1 ) {
|
545 |
return;
|
558 |
<?php
|
559 |
}
|
560 |
|
561 |
+
/**
|
562 |
+
* Gets post title.
|
563 |
+
*
|
564 |
+
* @param int $limit Limit words.
|
565 |
+
* @return string
|
566 |
+
*/
|
567 |
public function post_title( $limit = 15 ) {
|
568 |
$title = get_the_title();
|
569 |
if ( ! $title ) {
|
577 |
} else {
|
578 |
$title = implode( ' ', $title );
|
579 |
}
|
580 |
+
return $title;
|
581 |
}
|
582 |
|
583 |
+
/**
|
584 |
+
* Truncates string.
|
585 |
+
*
|
586 |
+
* @param string $str String.
|
587 |
+
* @param int $length Length.
|
588 |
+
* @return string
|
589 |
+
*/
|
590 |
public function truncate( $str, $length = 24 ) {
|
591 |
if ( mb_strlen( $str ) > $length ) {
|
592 |
return mb_substr( $str, 0, $length ) . '…';
|
public/css/wp-review.css
CHANGED
@@ -1,352 +1,3 @@
|
|
1 |
-
/*
|
2 |
-
|
3 |
-
|
4 |
-
*/
|
5 |
-
.review-list li:after, .wp-reviews-list .item:after, .wp-reviews-list .reviews-pagination:after, [data-ui-tabs] .ui-tabs-nav:after, [data-wp-review-tabs] .tab-titles:after { content: " "; display: block; height: 0; visibility: hidden; clear: both; }
|
6 |
-
.review-wrapper { border: 1px solid #e7e7e7; margin-bottom: 30px; clear: both; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
7 |
-
.review-wrapper .review-list { margin: 0; list-style: none; padding: 0; clear: both; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
8 |
-
.review-wrapper .review-list li { margin: 0; list-style: none; }
|
9 |
-
.review-wrapper li:after { content: ''; display: block; clear: both; }
|
10 |
-
.review-wrapper .review-desc li:after { display: none; }
|
11 |
-
.review-wrapper .review-total-wrapper h5 { font-family: inherit; }
|
12 |
-
.review-title { background-color: #f6f6f6; border-bottom: 1px solid #e7e7e7; margin: 0; padding: 15px; -webkit-box-sizing: border-box; box-sizing: border-box; font-family: inherit; }
|
13 |
-
.review-price { float: right; }
|
14 |
-
.review-links { list-style: none; padding: 15px 15px 8px !important; margin: 0 !important; overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; width: 100%; }
|
15 |
-
.review-links li { display: inline-block; margin-bottom: 10px; }
|
16 |
-
.review-links li a { display: block; padding: 4px 10px; margin: 0 10px 0 0; border: 1px solid; border-radius: 5px; outline: 0; }
|
17 |
-
.review-links li:last-child a { margin-right: 0; }
|
18 |
-
.review-links .review-links:not(:last-child) a { margin-right: 10px; }
|
19 |
-
.entry-content .review-wrapper li:last-child a { margin-right: 0; }
|
20 |
-
.wpr-error { background: #f9ada7; padding: 10px; margin: 10px 0; }
|
21 |
-
.review-list li { -webkit-box-sizing: border-box; box-sizing: border-box; border-bottom: 1px solid #e7e7e7; padding: 10px 15px; position: relative; list-style: none !important; }
|
22 |
-
.review-list li:nth-child(even) { background-color: #fafafa; }
|
23 |
-
.review-list li:last-child { border-bottom: 1px solid #e7e7e7; }
|
24 |
-
.wp_review_comment .review-list, .widefat .column-comment ul.review-list { margin: 0; padding: 0; }
|
25 |
-
.wp_review_comment .review-list li, .wp-review-comment-form .review-list li { padding: 10px; margin: 0; background: #f9f9f9; border-bottom: 1px solid #e7e7e7; }
|
26 |
-
.review-summary-title { margin-bottom: 5px; }
|
27 |
-
.review-desc { padding: 10px 15px; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
28 |
-
.review-desc p:last-child { margin-bottom: 0; }
|
29 |
-
.review-pros-cons { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; padding: 10px 15px 30px; clear: both; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
30 |
-
.review-pros-cons .review-pros { -webkit-box-flex: 0; -ms-flex: 0 0 50%; flex: 0 0 50%; padding-right: 10px; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
31 |
-
.review-pros-cons .review-pros p:last-of-type { margin-bottom: 0; }
|
32 |
-
.review-pros-cons .review-cons { -webkit-box-flex: 0; -ms-flex: 0 0 50%; flex: 0 0 50%; padding-left: 10px; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
33 |
-
.review-pros-cons .review-cons p:last-of-type { margin-bottom: 0; }
|
34 |
-
.review-pros-cons .review-pros .mb-5 strong:before, .review-pros-cons .review-cons .mb-5 strong:before { content: "\f164"; font-family: "FontAwesome"; font-weight: normal; margin-right: 5px; opacity: 0.7; }
|
35 |
-
.review-pros-cons .review-cons .mb-5 strong:before { content: "\f165"; }
|
36 |
-
.review-pros-cons ul, .review-pros-cons ol { margin: 0; margin-left: 0; padding: 0; list-style: none; }
|
37 |
-
.review-pros-cons li { list-style-type: none !important; }
|
38 |
-
.review-pros-cons .review-pros ul li:before, .review-pros-cons .review-cons ul li:before { content: "\f00c"; font-family: "FontAwesome"; opacity: .4; margin-right: 7px; }
|
39 |
-
.review-pros-cons .review-cons ul li:before { content: "\f00d"; }
|
40 |
-
.wp_review_comment .review-pros-cons { padding-left: 0; padding-right: 0; }
|
41 |
-
textarea#wp_review_comment_pros, textarea#wp_review_comment_cons { height: 100px; }
|
42 |
-
.wp-review-comment-form-qualifier label { display: block; }
|
43 |
-
.wp-review-comment-form-qualifier select { display: block; width: 100%; }
|
44 |
-
#review .review-desc ul, #review .review-desc ol { margin: 0; margin-left: 0; padding: 0; }
|
45 |
-
.review-result-wrapper { white-space: nowrap; position: relative; }
|
46 |
-
.review-star .review-result-wrapper { display: inline-block; }
|
47 |
-
.review-star .review-result-wrapper img.wp-review-image { max-width: 20px; max-height: 20px; display: inline-block; opacity: 0.6; }
|
48 |
-
.wp-review-usercomment-rating-star .review-result-wrapper img { opacity: 0.6; }
|
49 |
-
.wp-review-usercomment-rating-star .review-result-wrapper .review-result img { opacity: 1; }
|
50 |
-
.review-star .wpr-count { margin-left: 3px; vertical-align: top; }
|
51 |
-
.review-result-wrapper i, .review-result-wrapper img.wp-review-image { font-style: normal; font-size: 16px; padding: 0; line-height: inherit; }
|
52 |
-
.reviewed-item { display: inline-block; padding: 10px 15px; border-bottom: 1px solid #e7e7e7; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
53 |
-
.reviewed-item .review-links { border: 0; background: transparent !important; }
|
54 |
-
.reviewed-item .review-links li { margin: 0; }
|
55 |
-
.reviewed-item .reviewed-item-data img { vertical-align: top; }
|
56 |
-
.reviewed-item-image { float: right; max-width: 40%; margin-left: 15px; }
|
57 |
-
.rtl .reviewed-item-image { float: left; margin-left: 0; margin-right: 15px; }
|
58 |
-
.reviewed-item-data-label { display: inline-block; }
|
59 |
-
.reviewed-item-data p:last-of-type { margin-bottom: 0; }
|
60 |
-
.review-result { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; }
|
61 |
-
.rtl .review-result { left: auto; right: 0; }
|
62 |
-
.review-total-wrapper { float: right; padding-right: 0; clear: both; position: relative; -webkit-box-sizing: border-box; box-sizing: border-box; padding: 10px 15px 20px 15px; }
|
63 |
-
.rtl .review-total-wrapper { float: left; }
|
64 |
-
.review-total-wrapper span.review-total-box { border: 0; display: block; font-size: 40px; font-weight: 700; text-align: right; margin: 0; padding: 35px 0 20px; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; overflow: hidden; }
|
65 |
-
.circle-point span.review-total-box { height: 180px; }
|
66 |
-
.review-total-wrapper span.review-total-box small { font-size: 12px; display: block; }
|
67 |
-
.percentage-icon { font-size: 22px; position: relative; top: -14px; }
|
68 |
-
.review-total-star { position: relative; margin-top: 5px; margin: 0 auto; float: right; }
|
69 |
-
.review-star.review-total { position: relative; }
|
70 |
-
.wp-review-loading-msg, .wp-review-loading .review-result-wrapper { display: none; }
|
71 |
-
.wp-review-loading .wp-review-loading-msg { display: block; }
|
72 |
-
.review-total { z-index: 99; }
|
73 |
-
.rtl .review-total { left: auto; right: 0; }
|
74 |
-
.review-star, .wp-review-user-feature-rating-star { position: relative; margin-top: 5px; margin: 0 auto; display: inline-block; }
|
75 |
-
.postbox .review-star { position: relative; right: auto; top: auto; }
|
76 |
-
.review-list .review-star, .user-review-area .review-star, .wp-review-point-type .review-total-circle .review-star, .wp-review-percentage-type .review-total-circle .review-star, .review-list .wp-review-user-feature-rating-star { float: right; }
|
77 |
-
.rtl .review-list .review-star, .rtl .user-review-area .review-star, .rtl .review-total-circle .review-star, .rtl .wp-review-point-type .review-total-circle .review-star, .rtl .wp-review-percentage-type .review-total-circle .review-star { float: left; margin-right: 10px; margin-left: 0; }
|
78 |
-
/** Bar & Percentage Point */
|
79 |
-
.circle-point .review-list li { padding: 14px 15px; }
|
80 |
-
.review-point .review-result-wrapper, .review-percentage .review-result-wrapper { background: rgba(0, 0, 0, 0.1); width: 100%; height: 22px; }
|
81 |
-
.review-point .review-result-wrapper { background-color: rgba(0, 0, 0, 0.1); }
|
82 |
-
.wp-review-point-type .review-result, .wp-review-percentage-type .review-result, .review-total-point .review-result { position: absolute; top: 0px; left: 0px; height: 22px; }
|
83 |
-
.rtl .wp-review-point-type .review-result, .rtl .wp-review-percentage-type .review-result, .rtl .review-total-point .review-result { left: auto; right: 0px; }
|
84 |
-
.review-total-star.allowed-to-rate .review-result-wrapper { background: none; }
|
85 |
-
.wp-review-point-type .review-total-point .review-result-wrapper { background: none; }
|
86 |
-
.review-total-percentage.allowed-to-rate.has-not-rated-yet, .review-total-point.allowed-to-rate.has-not-rated-yet { float: none; cursor: pointer; }
|
87 |
-
.review-percentage .review-result-wrapper, .review-point .review-result-wrapper { position: relative; width: 100%; }
|
88 |
-
.review-percentage .review-result, .review-point .review-result { background: currentColor; height: 22px; }
|
89 |
-
.wp-review-comment-rating.wp-review-comment-rating-point .review-result-wrapper, .wp-review-user-rating.wp-review-user-rating-point .review-result-wrapper, .wp-review-comment-rating.wp-review-comment-rating-percentage .review-result-wrapper, .wp-review-user-rating.wp-review-user-rating-percentage .review-result-wrapper { cursor: pointer; }
|
90 |
-
.wp-review-user-rating.wp-review-user-rating-point.has-rated .review-result-wrapper, .wp-review-user-rating.wp-review-user-rating-percentage.has-rated .review-result-wrapper { cursor: default; }
|
91 |
-
.wp-review-comment-rating.wp-review-comment-rating-point .review-result-wrapper:hover .review-result, .wp-review-user-rating.wp-review-user-rating-point .review-result-wrapper:hover .review-result, .wp-review-comment-rating.wp-review-comment-rating-percentage .review-result-wrapper:hover .review-result, .wp-review-user-rating.wp-review-user-rating-percentage .review-result-wrapper:hover .review-result { display: block; -webkit-transition: none; transition: none; }
|
92 |
-
.review-point, .review-percentage { position: relative; clear: both; }
|
93 |
-
.wp-review-your-rating { position: absolute; top: 102%; left: 45%; margin-left: -20px; font-size: 12px; line-height: 18px; background: #f0f0f0; color: #fff; pointer-events: none; z-index: 999; display: none; white-space: nowrap; padding: 2px 4px; }
|
94 |
-
.rtl .wp-review-your-rating { left: auto; right: 45%; }
|
95 |
-
.column-wp_review_rating .wp-review-circle-rating { -webkit-box-shadow: none; box-shadow: none; }
|
96 |
-
.review-point:hover .wp-review-your-rating, .review-percentage:hover .wp-review-your-rating { display: block; }
|
97 |
-
.review-result-text { position: absolute; left: 4px; top: 0px; font-size: 16px; line-height: 22px; display: none; }
|
98 |
-
.rtl .review-result-text { left: auto; right: 4px; }
|
99 |
-
.wp-review-usercomment-rating .review-result-text, .wp-admin .review-result-text { display: block; }
|
100 |
-
/** Circle */
|
101 |
-
.review-total-circle.allowed-to-rate.has-not-rated-yet .review-result-wrapper { cursor: pointer; }
|
102 |
-
.wp-review-user-rating-circle .review-result-wrapper { text-align: right; }
|
103 |
-
.wp-review-user-rating.wp-review-user-rating-circle.wp-review-input-set { float: right; }
|
104 |
-
.wp-review-circle-type .user-total-wrapper { overflow: hidden; margin-top: 3px; }
|
105 |
-
.review-wrapper .wp-review-circle-rating { padding: 0; width: auto; display: inline; }
|
106 |
-
.user-review-area .review-circle { float: right; height: 32px; }
|
107 |
-
.review-list .review-circle { float: right; margin-top: -4px; }
|
108 |
-
.wp-review-circle-type .review-total-wrapper > .review-total-box { display: none; }
|
109 |
-
.review-circle.review-total { height: 100px; width: 100px; }
|
110 |
-
/** Twenty series themes compatibilty */
|
111 |
-
.entry-content .review-wrapper h1, .entry-content .review-wrapper h2, .entry-content .review-wrapper h3, .entry-content .review-wrapper h4, .entry-content .review-wrapper h5, .entry-content .review-wrapper h6 { margin: 0; }
|
112 |
-
.entry-content .review-summary-title, #content .review-summary-title, .entry-content .reviewed-item p, #content .reviewed-item p { margin-bottom: 5px; }
|
113 |
-
#content .review-desc p:last-child { margin-bottom: 0; }
|
114 |
-
#review .review-desc ul { margin: 0; margin-left: 20px; padding-left: 0; }
|
115 |
-
/** Basic styling for wp_review_display_total */
|
116 |
-
.review-total-only { padding: 3px 8px; background: #fff; display: inline-block; border-radius: 3px; }
|
117 |
-
.review-total-only .percentage-icon { font-size: inherit; top: 0; }
|
118 |
-
.review-total-only .review-type-star { font-size: 12px; padding: 3px 6px; }
|
119 |
-
.review-total-only .review-total-star { font-size: 12px; margin: 0; }
|
120 |
-
.review-result-wrapper .review-result i, .review-result-wrapper .review-result img.wp-review-image { opacity: 1; filter: alpha(opacity=100); }
|
121 |
-
.wp-review-box-float-left { margin-right: 20px; }
|
122 |
-
.wp-review-box-float-right { margin-left: 20px; }
|
123 |
-
/** Users review area */
|
124 |
-
.wpr-user-features-rating { clear: both; }
|
125 |
-
.wpr-user-features-rating .user-review-title { padding: 10px 15px; margin: 0; font-weight: bold; }
|
126 |
-
.wpr-user-features-rating .user-total-wrapper { margin: 0; display: inline-block; }
|
127 |
-
.wpr-user-features-rating .wp-review-user-feature-rating-circle + span { display: inline-block; margin-top: 10px; }
|
128 |
-
.wpr-user-features-rating .wp-review-user-feature-rating-circle .review-result-wrapper { height: 50px; }
|
129 |
-
.user-review-area { border-top: 1px solid #e7e7e7; padding: 10px 15px; position: relative; clear: both; float: left; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
130 |
-
.user-review-area .wp-review-user-rating-star { float: right; }
|
131 |
-
.wp-review-user-rating .review-star .review-result-wrapper:hover span img { opacity: 1; }
|
132 |
-
.wp-review-user-rating .review-star .review-result-wrapper:hover span:hover ~ span img { opacity: 0.6; }
|
133 |
-
.review-total-star.allowed-to-rate { float: right; margin: 0; }
|
134 |
-
.user-review-title { margin: 15px 15px 10px; padding: 0; font-family: inherit; }
|
135 |
-
.user-total-wrapper .user-review-title { font-weight: bold; margin: 0; display: inline-block; }
|
136 |
-
.wp-review-user-rating .review-result-wrapper span { cursor: pointer; padding: 0 0 0 4px; }
|
137 |
-
.wp-review-user-rating .review-result-wrapper span img.wp-review-image { opacity: 0.6; }
|
138 |
-
.wp-review-user-rating .review-result-wrapper span:hover i, .wp-review-user-rating .review-result-wrapper span:hover img.wp-review-image, .wp-review-user-rating .review-result-wrapper span.active i, .wp-review-user-rating .review-result-wrapper span.active img.wp-review-image { opacity: 1 !important; }
|
139 |
-
.wp-review-user-rating .review-result-wrapper .review-result i, .wp-review-user-rating .review-result-wrapper .review-result img.wp-review-image { padding-left: 4px; }
|
140 |
-
.wp-review-user-rating.has-rated .review-result-wrapper:hover .review-result { display: block; }
|
141 |
-
.wp-review-user-rating .review-result-wrapper:hover .review-result, .wp-review-user-rating.wp-review-loading .review-result-wrapper, .wp-review-user-rating.wp-review-loading .wp-review-your-rating { display: none; }
|
142 |
-
.wp-review-user-rating .review-list li { border-top: 1px solid; }
|
143 |
-
.wpr-rating-accept-btn { width: 100%; float: right; border-radius: 0; padding: 14px; border: 0; color: #fff; font-size: inherit; cursor: pointer; }
|
144 |
-
.wpr-rating-accept-btn[disabled] { cursor: not-allowed; }
|
145 |
-
.wp-review-rating-input.review-point .review-result-wrapper, .wp-review-rating-input.review-percentage .review-result-wrapper, .wp-review-rating-input.review-circle canvas { cursor: pointer; }
|
146 |
-
/** Review in comments */
|
147 |
-
.wp-review-comment-form-rating { margin-bottom: 15px; }
|
148 |
-
.wp-review-comment-form-rating .review-list li { padding: 10px; background: #f9f9f9; }
|
149 |
-
.wp-review-comment-form-rating .user-review-title { margin: 0; margin-bottom: 10px; }
|
150 |
-
.wp-review-comment-form-rating .features-rating-list { margin: 0; padding: 0; }
|
151 |
-
.wp-review-comment-field { margin-bottom: 10px; }
|
152 |
-
.review-total-star-comments { position: relative; display: inline-block; }
|
153 |
-
.wp-review-comment-title { font-size: 18px; }
|
154 |
-
.comment-text-inner { clear: both; }
|
155 |
-
.comment .review-list li { margin-bottom: 0; }
|
156 |
-
.wp-review-comment-rating .review-result-wrapper span { cursor: pointer; padding-left: 4px; }
|
157 |
-
.wp-review-comment-rating .review-result-wrapper span i, .wp-review-comment-rating .review-result-wrapper span img.wp-review-image { opacity: 0.6; }
|
158 |
-
.wp-review-comment-rating .review-result-wrapper span:hover i, .wp-review-comment-rating .review-result-wrapper span.active i, .wp-review-comment-rating .review-result-wrapper span:hover img.wp-review-image, .wp-review-comment-rating .review-result-wrapper span.active img.wp-review-image { opacity: 1 !important; color: #FFB300; }
|
159 |
-
.wp-review-comment-rating .review-result-wrapper span:hover ~ span i { opacity: 1; color: currentColor; }
|
160 |
-
.wp-review-comment-rating .review-result-wrapper:hover .review-result { display: none; }
|
161 |
-
.wp-review-comment-rating .review-result-wrapper .review-result { letter-spacing: -1.9px; }
|
162 |
-
.wp-review-comment-rating .review-result-wrapper .review-result i, .wp-review-comment-rating .review-result-wrapper .review-result img.wp-review-image { padding-left: 4px; }
|
163 |
-
.wp-review-comment-rating .review-result-wrapper:hover span img { opacity: 1; }
|
164 |
-
.wp-review-comment-rating .review-result-wrapper:hover span:hover ~ span img { opacity: 0.6; }
|
165 |
-
.wpr-comment-features-rating .wp-review-user-feature-rating-circle { height: 50px; }
|
166 |
-
.wpr-comment-features-rating .review-list .review-circle { margin-top: 0; height: 50px; }
|
167 |
-
.wpr-comment-features-rating li .wp-review-user-feature-rating-circle + span { margin-top: 14px; display: inline-block; }
|
168 |
-
.rtl .wp-review-comment-rating .review-result-wrapper span i { float: right; }
|
169 |
-
.wp-review-feedback { margin-top: 10px; }
|
170 |
-
.wp-review-feedback .review-btn { display: inline-block; text-decoration: none; background: #eee; padding: 3px 9px; color: #333; border-radius: 4px; font-size: 14px; }
|
171 |
-
.wp-review-feedback .review-btn.voted, .wp-review-feedback .review-btn.voted ~ a { cursor: default; }
|
172 |
-
.wp-review-feedback .review-btn:hover, .wp-review-feedback .review-btn.voted { text-decoration: none; background: #81C784; color: #fff !important; }
|
173 |
-
.wp-review-feedback .review-btn:nth-child(2) { margin-left: 5px; }
|
174 |
-
.rtl .wp-review-feedback .review-btn:nth-child(2) { margin-left: auto; margin-right: 5px; }
|
175 |
-
.wp-review-feedback .review-btn:nth-child(2):hover, .wp-review-feedback .review-btn.voted:nth-child(2) { text-decoration: none; background-color: #E57373; color: #fff !important; }
|
176 |
-
.wp-review-comment-form-title { clear: both; margin-bottom: 15px; }
|
177 |
-
.wp-review-comment-form-author label, .wp-review-comment-form-email label, .wp-review-comment-form-url label { padding-left: 0 !important; margin-left: 0 !important; }
|
178 |
-
.wp-review-comment-rating-circle-wrapper .review-comment-field-msg { vertical-align: middle; margin-right: 0; }
|
179 |
-
.wp-review-comment-rating-circle-wrapper .wp-review-comment-field-inner { display: inline-block; vertical-align: middle; }
|
180 |
-
.wp-review-comment-rating .review-result-wrapper a { text-decoration: none; border: none; }
|
181 |
-
.wp-review-comment-rating-star .review-total-star { float: none; }
|
182 |
-
.wp-review-comment-rating-circle-wrapper .wp-review-comment-field-inner, .wp-review-comment-rating-star-wrapper .wp-review-comment-field-inner { display: inline-block; }
|
183 |
-
.wp-review-comment-form .wp-review-comment-field-inner { display: block; }
|
184 |
-
.wp-review-comment-form .user-review-title { margin: 0 0 10px; }
|
185 |
-
.wp-review-comment-form .wpr-comment-features-rating > ul { margin: 0; }
|
186 |
-
#comments .wp-review-comment-qualifier, #comments .wp-review-usercomment-image { margin-bottom: 15px; }
|
187 |
-
#comments .wp-review-usercomment-image img { float: left !important; max-width: 100%; }
|
188 |
-
.wp-review-usercomment-rating, #comments .wp-review-usercomment-rating { margin-bottom: 15px; }
|
189 |
-
.wp-review-usercomment-rating ul, .wp-review-usercomment-rating ol, #comments .wp-review-usercomment-rating ul, #comments .wp-review-usercomment-rating ol { margin: 0; margin-bottom: 10px; padding-left: 0; list-style-type: none; }
|
190 |
-
.wp-review-usercomment-rating li, #comments .wp-review-usercomment-rating li { display: block; margin-bottom: 15px; }
|
191 |
-
.wp-review-usercomment-rating .review-star, #comments .wp-review-usercomment-rating .review-star { position: relative; top: 0; right: 0; display: inline-block; }
|
192 |
-
.wp-review-comment-rating-star { display: inline-block; }
|
193 |
-
form.wp-review-comment-form input, #commentform.wp-review-comment-form input, #commentform.wp-review-comment-form select { width: 100%; max-width: 100%; height: 44px; font-size: 16px; padding-left: 2.5%; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
194 |
-
.rtl form.wp-review-comment-form input, .rtl #commentform.wp-review-comment-form input { padding-left: auto; padding-right: 2.5%; }
|
195 |
-
form.wp-review-comment-form textarea, #commentform.wp-review-comment-form textarea { width: 100%; background: rgba(0, 0, 0, 0.035); border: 1px solid rgba(0, 0, 0, 0.05); color: rgba(0, 0, 0, 0.31); max-width: 100%; font-size: 16px; padding-left: 2.5%; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
196 |
-
.rtl form.wp-review-comment-form textarea, .rtl #commentform.wp-review-comment-form textarea { padding-left: auto; padding-right: 2.5%; }
|
197 |
-
form.wp-review-comment-form > div, #commentform.wp-review-comment-form > div { width: 100%; margin-bottom: 10px; float: left; }
|
198 |
-
.rtl form.wp-review-comment-form > div, .rtl #commentform.wp-review-comment-form > div { float: right; }
|
199 |
-
/** Show on thumbnails */
|
200 |
-
.wp-review-thumbnail-wrapper { position: relative; }
|
201 |
-
.wp-review-on-thumbnail { position: absolute; top: 0; right: 0; background: #fff; padding: 2px 4px; }
|
202 |
-
.wp-review-on-thumbnail.review-type-star .review-total-star { margin: 0; }
|
203 |
-
.review-type-circle.latestPost-review-wrapper, .review-type-circle.wp-review-on-thumbnail { height: 44px; }
|
204 |
-
.latestPost-review-wrapper .wp-review-circle-rating, .wp-review-on-thumbnail .wp-review-circle-rating { font-size: 11px !important; }
|
205 |
-
.review-type-circle.review-total-only, .review-type-circle.wp-review-show-total { padding-top: 6px; height: 32px; }
|
206 |
-
.latestPost-review-wrapper { padding: 2px 8px; background: #444; color: #fff; }
|
207 |
-
.review-type-star.latestPost-review-wrapper .review-result-wrapper { color: #fff !important; }
|
208 |
-
.review-type-star.latestPost-review-wrapper .review-result-wrapper i, .review-type-star.latestPost-review-wrapper .review-result-wrapper img.wp-review-image { opacity: 0.6; }
|
209 |
-
.review-type-star.latestPost-review-wrapper .review-result-wrapper .review-result { color: #fff !important; }
|
210 |
-
.review-type-star.latestPost-review-wrapper .review-result-wrapper .review-result i, .review-type-star.latestPost-review-wrapper .review-result-wrapper .review-result img.wp-review-image { opacity: 1; }
|
211 |
-
.widget .wp-review-show-total .review-star, .widget .wp-review-user-rating .review-star { position: relative; top: auto; right: auto; }
|
212 |
-
/* Spin Animation For Loader */
|
213 |
-
.animate-spin { -webkit-animation: spin 1s infinite linear; animation: spin 1s infinite linear; display: inline-block; }
|
214 |
-
@-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg);
|
215 |
-
transform: rotate(0deg); }
|
216 |
-
100% { -webkit-transform: rotate(359deg);
|
217 |
-
transform: rotate(359deg); } }
|
218 |
-
@keyframes spin { 0% { -webkit-transform: rotate(0deg);
|
219 |
-
transform: rotate(0deg); }
|
220 |
-
100% { -webkit-transform: rotate(359deg);
|
221 |
-
transform: rotate(359deg); } }
|
222 |
-
/*-----------------------------------------------------*/
|
223 |
-
/* Responsvie
|
224 |
-
/*-----------------------------------------------------*/
|
225 |
-
@media screen and (max-width: 600px) { #review.review-wrapper .user-review-area .review-percentage, #review.review-wrapper .user-review-area .review-point { width: 100% !important; max-width: 100%; margin-bottom: 10px; }
|
226 |
-
.user-review-area .user-total-wrapper { width: 100%; max-width: 100%; } }
|
227 |
-
@media screen and (max-width: 480px) { .review-total-wrapper { text-align: right; }
|
228 |
-
.user-review-area .user-total-wrapper { max-width: 60%; line-height: 1.2; }
|
229 |
-
.user-review-area .user-total-wrapper .user-review-title { margin-top: 0 !important; }
|
230 |
-
.review-price { float: none; }
|
231 |
-
.review-wrapper .review-title { font-size: 16px; }
|
232 |
-
.review-total-wrapper span.review-total-box { padding: 10px 0 20px; text-align: right; padding-left: 10px; }
|
233 |
-
.reviewed-item-image { max-width: 100%; width: 100%; margin: 0 0 10px 0; float: left; }
|
234 |
-
.rtl .review-total-wrapper span.review-total-box { padding: 10px 0 20px; text-align: right; padding-left: 0; padding-right: 10px; }
|
235 |
-
.review-total-star.allowed-to-rate { position: relative; right: auto; left: 0; float: left; }
|
236 |
-
.rtl .review-total-star.allowed-to-rate { right: 0; left: auto; float: right; }
|
237 |
-
.review-pros-cons .review-pros, .review-pros-cons .review-cons { -webkit-box-flex: 0; -ms-flex: 0 0 100%; flex: 0 0 100%; padding: 0; }
|
238 |
-
.review-pros-cons .review-pros p:last-child, .review-pros-cons .review-cons p:last-child { margin-bottom: 0; }
|
239 |
-
.review-pros-cons .review-pros { padding-bottom: 20px; } }
|
240 |
-
.rtl .review-total-box { unicode-bidi: isolate-override; }
|
241 |
-
.rtl .wp-review-user-rating-total { unicode-bidi: -webkit-isolate; unicode-bidi: isolate; }
|
242 |
-
.rtl .wp-review-user-rating-total + small { unicode-bidi: plaintext; }
|
243 |
-
.rtl .review-links li a { margin: 0 0 0 10px; }
|
244 |
-
/*--------------------------- Reviews list --------------------------*/
|
245 |
-
.wp-reviews-list { position: relative; border: 1px solid #e4e4e4; background-color: #fff; /* Loading... */ }
|
246 |
-
.wp-reviews-list * { -webkit-box-sizing: border-box; box-sizing: border-box; }
|
247 |
-
.wp-reviews-list ul { list-style-type: none; }
|
248 |
-
.wp-reviews-list .item { padding: 10px 15px; border-bottom: 1px solid #e4e4e4; border-top: 0; position: relative; list-style-type: none; margin: 0; }
|
249 |
-
.wp-reviews-list .item:last-child { border: none; }
|
250 |
-
.wp-reviews-list img { max-width: 100%; height: auto; }
|
251 |
-
.wp-reviews-list a { color: #444; }
|
252 |
-
.wp-reviews-list .thumb_small { float: left; margin-right: 12px; padding-top: 2px; width: 65px; height: 65px; overflow: hidden; }
|
253 |
-
.wp-reviews-list .thumb_large { float: none; max-width: 100%; display: inline-block; margin-bottom: 4px; position: relative; }
|
254 |
-
.wp-reviews-list .entry-title { font-weight: 700; margin: 0; padding: 0; overflow: hidden; }
|
255 |
-
.wp-reviews-list .entry-title span { font-weight: normal; }
|
256 |
-
.wp-reviews-list .entry-title a { display: block; }
|
257 |
-
.wp-reviews-list .postmeta { color: #999; font-size: 13px; margin-top: 5px; font-weight: normal; float: right; }
|
258 |
-
.wp-reviews-list .review-count { float: left; }
|
259 |
-
.wp-reviews-list .review-total-only { display: inline-block; font-weight: normal; background: #eee; }
|
260 |
-
.wp-reviews-list .wp-post-image { margin: 0 !important; }
|
261 |
-
.wp-reviews-list .loading { min-height: 120px; }
|
262 |
-
.wp-reviews-list .loading:before { content: ""; display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(255, 255, 255, 0.8); z-index: 11; }
|
263 |
-
.wp-reviews-list .loading:after { content: ""; margin: 0 auto 3em auto; font-size: 10px; position: absolute; top: 45%; left: 49%; z-index: 12; text-indent: -9999em; border-top: 0.4em solid rgba(0, 0, 0, 0.2); border-right: 0.4em solid rgba(0, 0, 0, 0.2); border-bottom: 0.4em solid rgba(0, 0, 0, 0.2); border-left: 0.4em solid #000; -webkit-animation: load8 0.5s infinite linear; animation: load8 0.5s infinite linear; border-radius: 50%; width: 2em; height: 2em; }
|
264 |
-
.wp-reviews-list .reviews-pagination { padding-bottom: 15px; }
|
265 |
-
.wp-reviews-list .reviews-pagination a { margin: 0 15px; }
|
266 |
-
.wp-reviews-list .reviews-pagination .next { float: right; }
|
267 |
-
[data-ui-tabs] .ui-tabs-nav { list-style: none; padding: 0 30px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin: 10px 0; }
|
268 |
-
[data-ui-tabs] .ui-tabs-nav li { float: left; margin: 0; list-style-type: none; }
|
269 |
-
[data-ui-tabs] .ui-tabs-nav a { -webkit-box-shadow: none; box-shadow: none; padding: 8px 15px; background-color: rgba(0, 0, 0, 0.15); outline: 0; float: left; border: 0; color: inherit; }
|
270 |
-
[data-ui-tabs] .ui-tabs-nav .ui-state-active a { background-color: rgba(255, 255, 255, 0.45); }
|
271 |
-
[data-wp-review-tabs] .tab-titles { list-style: none; padding: 0 30px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin: 10px 0; }
|
272 |
-
[data-wp-review-tabs] .tab-title { float: left; margin: 0; list-style-type: none; }
|
273 |
-
[data-wp-review-tabs] .tab-title button { -webkit-box-shadow: none; box-shadow: none; padding: 8px 15px; background-color: rgba(0, 0, 0, 0.15); outline: 0; float: left; border: 0; color: inherit; cursor: pointer; font-size: inherit; }
|
274 |
-
[data-wp-review-tabs] .tab-title.active a { background-color: rgba(255, 255, 255, 0.45); }
|
275 |
-
.wp_review_tab_widget_content { position: relative; border: 1px solid #E4E4E4; }
|
276 |
-
.wp_review_tab_widget_content img { max-width: 100%; height: auto; }
|
277 |
-
.wp_review_tab_widget_content a { color: #444; }
|
278 |
-
.wp_review_tab_widget_content ul.wp-review-tabs li { list-style: none; display: block; width: 50%; float: left; text-align: center; margin: 0 !important; padding: 0 !important; border: 0; }
|
279 |
-
.wp_review_tab_widget_content ul.has-1-tabs li { width: 100%; float: none; margin: 0 auto; }
|
280 |
-
.wp_review_tab_widget_content ul.has-3-tabs li { width: 33.33%; }
|
281 |
-
.wp_review_tab_widget_content ul.has-4-tabs li { width: 50%; }
|
282 |
-
.wp_review_tab_widget_content .tab_title a { display: block; background: #f0f0f0; border-left: 1px solid #E4E4E4; border-bottom: 1px solid #E4E4E4; padding: 2px 0 4px; line-height: 2.4; text-decoration: none; position: relative; font-weight: bold; }
|
283 |
-
.wp_review_tab_widget_content .tab_title:first-child a { margin-left: 0; border-left: 0; }
|
284 |
-
.wp_review_tab_widget_content .tab_title.selected a { background: #fff; border-bottom: 1px solid #fff; }
|
285 |
-
.wp_review_tab_widget_content .inside { background: #fff; }
|
286 |
-
.wp_review_tab_widget_content .tab-content li, .widget .wp_review_tab_widget_content .tab-content li { list-style-type: none; float: left; width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; margin: 0; padding: 10px 15px 15px; border-bottom: 1px solid #E4E4E4; text-align: left; color: #444; background: none; position: relative; }
|
287 |
-
.wp_review_tab_widget_content .tab-content li:last-child { border: none; margin-bottom: 0; }
|
288 |
-
.wp_review_tab_thumb_small { float: left; margin-right: 12px; padding-top: 4px; width: 65px; height: 65px; overflow: hidden; }
|
289 |
-
.wp_review_tab_thumb_large { float: none; max-width: 100%; display: inline-block; margin-bottom: 4px; position: relative; }
|
290 |
-
.wp_review_tab_widget_content .entry-title { font-size: inherit; font-weight: bold; margin: 0; padding: 0; }
|
291 |
-
.wp_review_tab_widget_content .entry-title span { color: #999; }
|
292 |
-
.wp_review_tab_widget_content .wp-review-tab-postmeta { color: #999; font-size: 13px; float: right; margin-top: 5px; }
|
293 |
-
.wp_review_tab_widget_content .wp-post-image { margin: 0 !important; }
|
294 |
-
/* Pagination */
|
295 |
-
.wp_review_tab_widget_content .wp-review-tab-pagination { margin: 0; width: 100%; padding-top: 0; padding-bottom: 15px; float: left; }
|
296 |
-
.wp_review_tab_widget_content .wp-review-tab-pagination a { margin: 0 15px; }
|
297 |
-
.wp-review-tab-pagination a.next { float: right; }
|
298 |
-
/* Loading... */
|
299 |
-
.wp-review-tab-loading { min-height: 120px; }
|
300 |
-
.wp-review-tab-loading:before { content: ""; display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(255, 255, 255, 0.8); z-index: 11; }
|
301 |
-
.clear { clear: both; }
|
302 |
-
.wp-review-tab-loading:after { content: ""; margin: 0 auto 3em auto; font-size: 10px; position: absolute; top: 45%; left: 49%; z-index: 12; text-indent: -9999em; border-top: 0.4em solid rgba(0, 0, 0, 0.2); border-right: 0.4em solid rgba(0, 0, 0, 0.2); border-bottom: 0.4em solid rgba(0, 0, 0, 0.2); border-left: 0.4em solid #000; -webkit-animation: load8 0.5s infinite linear; animation: load8 0.5s infinite linear; border-radius: 50%; width: 2em; height: 2em; }
|
303 |
-
@-webkit-keyframes load8 { 0% { -webkit-transform: rotate(0deg);
|
304 |
-
transform: rotate(0deg); }
|
305 |
-
100% { -webkit-transform: rotate(360deg);
|
306 |
-
transform: rotate(360deg); } }
|
307 |
-
@keyframes load8 { 0% { -webkit-transform: rotate(0deg);
|
308 |
-
transform: rotate(0deg); }
|
309 |
-
100% { -webkit-transform: rotate(360deg);
|
310 |
-
transform: rotate(360deg); } }
|
311 |
-
/* Rating... */
|
312 |
-
.review-total-only.small-thumb { font-size: 13px; font-weight: bold; padding: 1px 0; float: left; -webkit-box-sizing: border-box; box-sizing: border-box; margin-top: 3px; }
|
313 |
-
.review-total-only.large-thumb { position: absolute; top: 10px; right: 15px; border-radius: 0; }
|
314 |
-
.wp_review_tab_widget_content .has-4-tabs .tab_title.selected a { border-bottom: 1px solid #E4E4E4; }
|
315 |
-
.wp_review_tab_widget_content .has-4-tabs .tab_title:nth-child(3) a { border-left: 0; }
|
316 |
-
.title-right { overflow: hidden; }
|
317 |
-
/* WooCommerce */
|
318 |
-
.wp-review-product-rating { margin-bottom: 10px; }
|
319 |
-
.wp-review-comment-form-photo { margin-bottom: 15px; float: left; width: 100%; clear: both; margin-right: 0; margin-left: 0; }
|
320 |
-
.wp-review-comment-form-photo p { margin-bottom: 0; }
|
321 |
-
.wp-review-comment-form-photo { position: relative; }
|
322 |
-
.wp-review-comment-form-photo a { position: absolute; top: 0; right: 0; }
|
323 |
-
.wp-review-comment-form-photo #wp_review_comment_attachment_url { width: 100%; box-sizing: border-box; -webkit-box-sizing: border-box; }
|
324 |
-
.wp-review-comment-form-photo input { margin-top: 8px; }
|
325 |
-
.wp-review-comment-form-photo input.input-file { padding-left: 0; }
|
326 |
-
.wp-review-comment-form-photo .hide { display: none; }
|
327 |
-
#comments .wp-review-usercomment-image { display: block; float: left; width: 100%; }
|
328 |
-
.wp_review_comments_template #comments .is_verified { color: #b75c21; font-weight: bold; }
|
329 |
-
#commentform.wp-review-comment-form .comment-form-cookies-consent input { width: auto; height: auto; }
|
330 |
-
#commentform.wp-review-comment-form .comment-form-cookies-consent label { margin-left: 8px; }
|
331 |
-
body.rtl .review-wrapper .review-star .wpr-count { margin-left: 0; margin-right: 3px; }
|
332 |
-
body.rtl .review-wrapper .review-total-wrapper span.review-total-box { text-align: left; }
|
333 |
-
body.rtl .review-wrapper .review-pros-cons .review-pros { padding-right: 0; padding-left: 10px; }
|
334 |
-
body.rtl .review-wrapper .review-pros-cons .review-cons { padding-left: 0; padding-right: 10px; }
|
335 |
-
body.rtl .review-wrapper .user-review-area .wp-review-user-rating-star { float: left; }
|
336 |
-
body.rtl .wp-review-comment-form-photo a { right: auto; left: 0; }
|
337 |
-
body.rtl .review-pros-cons .review-pros { padding-right: 0; padding-left: 10px; }
|
338 |
-
body.rtl .review-pros-cons .review-cons { padding-right: 10px; padding-left: 0; }
|
339 |
-
body.rtl #comments .wp-review-usercomment-image img { float: right !important; }
|
340 |
-
body.rtl .wpr-businesses .business-data { padding-right: 10px; padding-left: 5px; }
|
341 |
-
body.rtl .wp-reviews-list .thumb_small { float: right; margin-right: 0; margin-left: 12px; }
|
342 |
-
body.rtl .wp-reviews-list .review-count { float: right; }
|
343 |
-
body.rtl .wp-reviews-list .postmeta { float: left; }
|
344 |
-
body.rtl .wp-reviews-list .reviews-pagination .next { float: left; }
|
345 |
-
body.rtl .review-total-only.large-thumb { right: auto; left: 15px; }
|
346 |
-
body.rtl .wpr-place-reviews .review-image { float: right; margin-right: 0; margin-left: 10px; }
|
347 |
-
/** Font icon */
|
348 |
-
@font-face { font-family: 'font-icons'; src: url("../fonts/font-icons.eot"); src: url("../fonts/font-icons.eot") format("embedded-opentype"), url("../fonts/font-icons.woff") format("woff"), url("../fonts/font-icons.ttf") format("truetype"), url("../fonts/font-icons.svg") format("svg"); font-weight: normal; font-style: normal; }
|
349 |
-
[class^="mts-icon-"]:before, [class*=" mts-icon-"]:before { font-family: "font-icons"; font-style: normal; font-weight: normal; speak: none; display: inline-block; text-decoration: inherit; width: 1em; margin-right: 0; text-align: center; font-variant: normal; text-transform: none; line-height: 1em; }
|
350 |
-
[class*="mts-icon-loader"]:before { font-family: "font-icons"; font-style: normal; font-weight: normal; speak: none; display: inline-block; text-decoration: inherit; width: 1em; margin-right: .2em; text-align: center; font-variant: normal; text-transform: none; line-height: 1em; margin-left: .2em; }
|
351 |
-
.mts-icon-star:before { content: '\e800'; }
|
352 |
-
.mts-icon-loader:before { content: '\e801'; }
|
1 |
+
.review-list li:after,.wp-reviews-list .item:after,.wp-reviews-list .reviews-pagination:after,[data-ui-tabs] .ui-tabs-nav:after,[data-wp-review-tabs] .tab-titles:after{content:" ";display:block;height:0;visibility:hidden;clear:both}.review-wrapper{border:1px solid #e7e7e7;margin-bottom:30px;clear:both;box-sizing:border-box}.review-wrapper .review-list{margin:0;list-style:none;padding:0;clear:both;box-sizing:border-box}.review-wrapper .review-list li{margin:0;list-style:none}.review-wrapper li:after{content:'';display:block;clear:both}.review-wrapper .review-desc li:after{display:none}.review-wrapper .review-total-wrapper h5{font-family:inherit}.review-title{background-color:#f6f6f6;border-bottom:1px solid #e7e7e7;margin:0;padding:15px;box-sizing:border-box;font-family:inherit}.review-price{float:right}.review-links{list-style:none;padding:15px 15px 8px !important;margin:0 !important;overflow:hidden;box-sizing:border-box;width:100%}.review-links li{display:inline-block;margin-bottom:10px}.review-links li a{display:block;padding:4px 10px;margin:0 10px 0 0;border:1px solid;border-radius:5px;outline:0}.review-links li:last-child a{margin-right:0}.review-links .review-links:not(:last-child) a{margin-right:10px}.entry-content .review-wrapper li:last-child a{margin-right:0}.wpr-error{background:#f9ada7;padding:10px;margin:10px 0}.review-list li{box-sizing:border-box;border-bottom:1px solid #e7e7e7;padding:10px 15px;position:relative;list-style:none !important}.review-list li:nth-child(even){background-color:#fafafa}.review-list li:last-child{border-bottom:1px solid #e7e7e7}.wp_review_comment .review-list,.widefat .column-comment ul.review-list{margin:0;padding:0}.wp_review_comment .review-list li,.wp-review-comment-form .review-list li{padding:10px;margin:0;background:#f9f9f9;border-bottom:1px solid #e7e7e7}.review-summary-title{margin-bottom:5px}.review-desc{padding:10px 15px;box-sizing:border-box}.review-desc p:last-child{margin-bottom:0}.review-pros-cons{display:flex;flex-wrap:wrap;padding:10px 15px 30px;clear:both;box-sizing:border-box}.review-pros-cons .review-pros{flex:0 0 50%;padding-right:10px;box-sizing:border-box}.review-pros-cons .review-pros p:last-of-type{margin-bottom:0}.review-pros-cons .review-cons{flex:0 0 50%;padding-left:10px;box-sizing:border-box}.review-pros-cons .review-cons p:last-of-type{margin-bottom:0}.review-pros-cons .review-pros .mb-5 strong:before,.review-pros-cons .review-cons .mb-5 strong:before{content:"\f164";font-family:"FontAwesome";font-weight:normal;margin-right:5px;opacity:0.7}.review-pros-cons .review-cons .mb-5 strong:before{content:"\f165"}.review-pros-cons ul,.review-pros-cons ol{margin:0;margin-left:0;padding:0;list-style:none}.review-pros-cons li{list-style-type:none !important}.review-pros-cons .review-pros ul li:before,.review-pros-cons .review-cons ul li:before{content:"\f00c";font-family:"FontAwesome";opacity:.4;margin-right:7px}.review-pros-cons .review-cons ul li:before{content:"\f00d"}.wp_review_comment .review-pros-cons{padding-left:0;padding-right:0}textarea#wp_review_comment_pros,textarea#wp_review_comment_cons{height:100px}.wp-review-comment-form-qualifier label{display:block}.wp-review-comment-form-qualifier select{display:block;width:100%}#review .review-desc ul,#review .review-desc ol{margin:0;margin-left:0;padding:0}.review-result-wrapper{white-space:nowrap;position:relative}.review-star .review-result-wrapper{display:inline-block}.review-star .review-result-wrapper img.wp-review-image{max-width:20px;max-height:20px;display:inline-block;opacity:0.6}.wp-review-usercomment-rating-star .review-result-wrapper img{opacity:0.6}.wp-review-usercomment-rating-star .review-result-wrapper .review-result img{opacity:1}.review-star .wpr-count{margin-left:3px;vertical-align:top}.review-result-wrapper i,.review-result-wrapper img.wp-review-image{font-style:normal;font-size:16px;padding:0;line-height:inherit}.reviewed-item{display:inline-block;padding:10px 15px;border-bottom:1px solid #e7e7e7;width:100%;box-sizing:border-box}.reviewed-item .review-links{border:0;background:transparent !important}.reviewed-item .review-links li{margin:0}.reviewed-item .reviewed-item-data img{vertical-align:top}.reviewed-item-image{float:right;max-width:40%;margin-left:15px}.rtl .reviewed-item-image{float:left;margin-left:0;margin-right:15px}.reviewed-item-data-label{display:inline-block}.reviewed-item-data p:last-of-type{margin-bottom:0}.review-result{position:absolute;top:0;left:0;overflow:hidden;white-space:nowrap}.rtl .review-result{left:auto;right:0}.review-total-wrapper{float:right;padding-right:0;clear:both;position:relative;box-sizing:border-box;padding:10px 15px 20px 15px}.rtl .review-total-wrapper{float:left}.review-total-wrapper span.review-total-box{border:0;display:block;font-size:40px;font-weight:700;text-align:right;margin:0;padding:35px 0 20px;width:100%;box-sizing:border-box;overflow:hidden}.circle-point span.review-total-box{height:180px}.review-total-wrapper span.review-total-box small{font-size:12px;display:block}.percentage-icon{font-size:22px;position:relative;top:-14px}.review-total-star{position:relative;margin-top:5px;margin:0 auto;float:right}.review-star.review-total{position:relative}.wp-review-loading-msg,.wp-review-loading .review-result-wrapper{display:none}.wp-review-loading .wp-review-loading-msg{display:block}.review-total{z-index:99}.rtl .review-total{left:auto;right:0}.review-star,.wp-review-user-feature-rating-star{position:relative;margin-top:5px;margin:0 auto;display:inline-block}.postbox .review-star{position:relative;right:auto;top:auto}.review-list .review-star,.user-review-area .review-star,.wp-review-point-type .review-total-circle .review-star,.wp-review-percentage-type .review-total-circle .review-star,.review-list .wp-review-user-feature-rating-star{float:right}.rtl .review-list .review-star,.rtl .user-review-area .review-star,.rtl .review-total-circle .review-star,.rtl .wp-review-point-type .review-total-circle .review-star,.rtl .wp-review-percentage-type .review-total-circle .review-star{float:left;margin-right:10px;margin-left:0}.circle-point .review-list li{padding:14px 15px}.review-point .review-result-wrapper,.review-percentage .review-result-wrapper{background:rgba(0,0,0,0.1);width:100%;height:22px}.review-point .review-result-wrapper{background-color:rgba(0,0,0,0.1)}.wp-review-point-type .review-result,.wp-review-percentage-type .review-result,.review-total-point .review-result{position:absolute;top:0px;left:0px;height:22px}.rtl .wp-review-point-type .review-result,.rtl .wp-review-percentage-type .review-result,.rtl .review-total-point .review-result{left:auto;right:0px}.review-total-star.allowed-to-rate .review-result-wrapper{background:none}.wp-review-point-type .review-total-point .review-result-wrapper{background:none}.review-total-percentage.allowed-to-rate.has-not-rated-yet,.review-total-point.allowed-to-rate.has-not-rated-yet{float:none;cursor:pointer}.review-percentage .review-result-wrapper,.review-point .review-result-wrapper{position:relative;width:100%}.review-percentage .review-result,.review-point .review-result{background:currentColor;height:22px}.wp-review-comment-rating.wp-review-comment-rating-point .review-result-wrapper,.wp-review-user-rating.wp-review-user-rating-point .review-result-wrapper,.wp-review-comment-rating.wp-review-comment-rating-percentage .review-result-wrapper,.wp-review-user-rating.wp-review-user-rating-percentage .review-result-wrapper{cursor:pointer}.wp-review-user-rating.wp-review-user-rating-point.has-rated .review-result-wrapper,.wp-review-user-rating.wp-review-user-rating-percentage.has-rated .review-result-wrapper{cursor:default}.wp-review-comment-rating.wp-review-comment-rating-point .review-result-wrapper:hover .review-result,.wp-review-user-rating.wp-review-user-rating-point .review-result-wrapper:hover .review-result,.wp-review-comment-rating.wp-review-comment-rating-percentage .review-result-wrapper:hover .review-result,.wp-review-user-rating.wp-review-user-rating-percentage .review-result-wrapper:hover .review-result{display:block;transition:none}.review-point,.review-percentage{position:relative;clear:both}.wp-review-your-rating{position:absolute;top:102%;left:45%;margin-left:-20px;font-size:12px;line-height:18px;background:#f0f0f0;color:#fff;pointer-events:none;z-index:999;display:none;white-space:nowrap;padding:2px 4px}.rtl .wp-review-your-rating{left:auto;right:45%}.column-wp_review_rating .wp-review-circle-rating{box-shadow:none}.review-point:hover .wp-review-your-rating,.review-percentage:hover .wp-review-your-rating{display:block}.review-result-text{position:absolute;left:4px;top:0px;font-size:16px;line-height:22px;display:none}.rtl .review-result-text{left:auto;right:4px}.wp-review-usercomment-rating .review-result-text,.wp-admin .review-result-text{display:block}.review-total-circle.allowed-to-rate.has-not-rated-yet .review-result-wrapper{cursor:pointer}.wp-review-user-rating-circle .review-result-wrapper{text-align:right}.wp-review-user-rating.wp-review-user-rating-circle.wp-review-input-set{float:right}.wp-review-circle-type .user-total-wrapper{overflow:hidden;margin-top:3px}.review-wrapper .wp-review-circle-rating{padding:0;width:auto;display:inline}.user-review-area .review-circle{float:right;height:32px}.review-list .review-circle{float:right;margin-top:-4px}.wp-review-circle-type .review-total-wrapper>.review-total-box{display:none}.review-circle.review-total{height:100px;width:100px}.entry-content .review-wrapper h1,.entry-content .review-wrapper h2,.entry-content .review-wrapper h3,.entry-content .review-wrapper h4,.entry-content .review-wrapper h5,.entry-content .review-wrapper h6{margin:0}.entry-content .review-summary-title,#content .review-summary-title,.entry-content .reviewed-item p,#content .reviewed-item p{margin-bottom:5px}#content .review-desc p:last-child{margin-bottom:0}#review .review-desc ul{margin:0;margin-left:20px;padding-left:0}.review-total-only{padding:3px 8px;background:#fff;display:inline-block;border-radius:3px}.review-total-only .percentage-icon{font-size:inherit;top:0}.review-total-only .review-type-star{font-size:12px;padding:3px 6px}.review-total-only .review-total-star{font-size:12px;margin:0}.review-result-wrapper .review-result i,.review-result-wrapper .review-result img.wp-review-image{opacity:1;filter:alpha(opacity=100)}.wp-review-box-float-left{margin-right:20px}.wp-review-box-float-right{margin-left:20px}.wpr-user-features-rating{clear:both}.wpr-user-features-rating .user-review-title{padding:10px 15px;margin:0;font-weight:bold}.wpr-user-features-rating .user-total-wrapper{margin:0;display:inline-block}.wpr-user-features-rating .wp-review-user-feature-rating-circle+span{display:inline-block;margin-top:10px}.wpr-user-features-rating .wp-review-user-feature-rating-circle .review-result-wrapper{height:50px}.user-review-area{border-top:1px solid #e7e7e7;padding:10px 15px;position:relative;clear:both;float:left;width:100%;box-sizing:border-box}.user-review-area .wp-review-user-rating-star{float:right}.wp-review-user-rating .review-star .review-result-wrapper:hover span img{opacity:1}.wp-review-user-rating .review-star .review-result-wrapper:hover span:hover ~ span img{opacity:0.6}.review-total-star.allowed-to-rate{float:right;margin:0}.user-review-title{margin:15px 15px 10px;padding:0;font-family:inherit}.user-total-wrapper .user-review-title{font-weight:bold;margin:0;display:inline-block}.wp-review-user-rating .review-result-wrapper span{cursor:pointer;padding:0 0 0 4px}.wp-review-user-rating .review-result-wrapper span img.wp-review-image{opacity:0.6}.wp-review-user-rating .review-result-wrapper span:hover i,.wp-review-user-rating .review-result-wrapper span:hover img.wp-review-image,.wp-review-user-rating .review-result-wrapper span.active i,.wp-review-user-rating .review-result-wrapper span.active img.wp-review-image{opacity:1 !important}.wp-review-user-rating .review-result-wrapper .review-result i,.wp-review-user-rating .review-result-wrapper .review-result img.wp-review-image{padding-left:4px}.wp-review-user-rating.has-rated .review-result-wrapper:hover .review-result{display:block}.wp-review-user-rating .review-result-wrapper:hover .review-result,.wp-review-user-rating.wp-review-loading .review-result-wrapper,.wp-review-user-rating.wp-review-loading .wp-review-your-rating{display:none}.wp-review-user-rating .review-list li{border-top:1px solid}.wpr-rating-accept-btn{width:100%;float:right;border-radius:0;padding:14px;border:0;color:#fff;font-size:inherit;cursor:pointer}.wpr-rating-accept-btn[disabled]{cursor:not-allowed}.wp-review-rating-input.review-point .review-result-wrapper,.wp-review-rating-input.review-percentage .review-result-wrapper,.wp-review-rating-input.review-circle canvas{cursor:pointer}.wp-review-comment-form-rating{margin-bottom:15px}.wp-review-comment-form-rating .review-list li{padding:10px;background:#f9f9f9}.wp-review-comment-form-rating .user-review-title{margin:0;margin-bottom:10px}.wp-review-comment-form-rating .features-rating-list{margin:0;padding:0}.wp-review-comment-field{margin-bottom:10px}.review-total-star-comments{position:relative;display:inline-block}.wp-review-comment-title{font-size:18px}.comment-text-inner{clear:both}.comment .review-list li{margin-bottom:0}.wp-review-comment-rating .review-result-wrapper span{cursor:pointer;padding-left:4px}.wp-review-comment-rating .review-result-wrapper span i,.wp-review-comment-rating .review-result-wrapper span img.wp-review-image{opacity:0.6}.wp-review-comment-rating .review-result-wrapper span:hover i,.wp-review-comment-rating .review-result-wrapper span.active i,.wp-review-comment-rating .review-result-wrapper span:hover img.wp-review-image,.wp-review-comment-rating .review-result-wrapper span.active img.wp-review-image{opacity:1 !important;color:#FFB300}.wp-review-comment-rating .review-result-wrapper span:hover ~ span i{opacity:1;color:currentColor}.wp-review-comment-rating .review-result-wrapper:hover .review-result{display:none}.wp-review-comment-rating .review-result-wrapper .review-result{letter-spacing:-1.9px}.wp-review-comment-rating .review-result-wrapper .review-result i,.wp-review-comment-rating .review-result-wrapper .review-result img.wp-review-image{padding-left:4px}.wp-review-comment-rating .review-result-wrapper:hover span img{opacity:1}.wp-review-comment-rating .review-result-wrapper:hover span:hover ~ span img{opacity:0.6}.wpr-comment-features-rating .wp-review-user-feature-rating-circle{height:50px}.wpr-comment-features-rating .review-list .review-circle{margin-top:0;height:50px}.wpr-comment-features-rating li .wp-review-user-feature-rating-circle+span{margin-top:14px;display:inline-block}.rtl .wp-review-comment-rating .review-result-wrapper span i{float:right}.wp-review-feedback{margin-top:10px}.wp-review-feedback .review-btn{display:inline-block;text-decoration:none;background:#eee;padding:3px 9px;color:#333;border-radius:4px;font-size:14px}.wp-review-feedback .review-btn.voted,.wp-review-feedback .review-btn.voted ~ a{cursor:default}.wp-review-feedback .review-btn:hover,.wp-review-feedback .review-btn.voted{text-decoration:none;background:#81C784;color:#fff !important}.wp-review-feedback .review-btn:nth-child(2){margin-left:5px}.rtl .wp-review-feedback .review-btn:nth-child(2){margin-left:auto;margin-right:5px}.wp-review-feedback .review-btn:nth-child(2):hover,.wp-review-feedback .review-btn.voted:nth-child(2){text-decoration:none;background-color:#E57373;color:#fff !important}.wp-review-comment-form-title{clear:both;margin-bottom:15px}.wp-review-comment-form-author label,.wp-review-comment-form-email label,.wp-review-comment-form-url label{padding-left:0 !important;margin-left:0 !important}.wp-review-comment-rating-circle-wrapper .review-comment-field-msg{vertical-align:middle;margin-right:0}.wp-review-comment-rating-circle-wrapper .wp-review-comment-field-inner{display:inline-block;vertical-align:middle}.wp-review-comment-rating .review-result-wrapper a{text-decoration:none;border:none}.wp-review-comment-rating-star .review-total-star{float:none}.wp-review-comment-rating-circle-wrapper .wp-review-comment-field-inner,.wp-review-comment-rating-star-wrapper .wp-review-comment-field-inner{display:inline-block}.wp-review-comment-form .wp-review-comment-field-inner{display:block}.wp-review-comment-form .user-review-title{margin:0 0 10px}.wp-review-comment-form .wpr-comment-features-rating>ul{margin:0}#comments .wp-review-comment-qualifier,#comments .wp-review-usercomment-image{margin-bottom:15px}#comments .wp-review-usercomment-image img{float:left !important;max-width:100%}.wp-review-usercomment-rating,#comments .wp-review-usercomment-rating{margin-bottom:15px}.wp-review-usercomment-rating ul,.wp-review-usercomment-rating ol,#comments .wp-review-usercomment-rating ul,#comments .wp-review-usercomment-rating ol{margin:0;margin-bottom:10px;padding-left:0;list-style-type:none}.wp-review-usercomment-rating li,#comments .wp-review-usercomment-rating li{display:block;margin-bottom:15px}.wp-review-usercomment-rating .review-star,#comments .wp-review-usercomment-rating .review-star{position:relative;top:0;right:0;display:inline-block}.wp-review-comment-rating-star{display:inline-block}form.wp-review-comment-form input,#commentform.wp-review-comment-form input,#commentform.wp-review-comment-form select{width:100%;max-width:100%;height:44px;font-size:16px;padding-left:2.5%;box-sizing:border-box}.rtl form.wp-review-comment-form input,.rtl #commentform.wp-review-comment-form input{padding-left:auto;padding-right:2.5%}form.wp-review-comment-form textarea,#commentform.wp-review-comment-form textarea{width:100%;background:rgba(0,0,0,0.035);border:1px solid rgba(0,0,0,0.05);color:rgba(0,0,0,0.31);max-width:100%;font-size:16px;padding-left:2.5%;box-sizing:border-box}.rtl form.wp-review-comment-form textarea,.rtl #commentform.wp-review-comment-form textarea{padding-left:auto;padding-right:2.5%}form.wp-review-comment-form>div,#commentform.wp-review-comment-form>div{width:100%;margin-bottom:10px;float:left}.rtl form.wp-review-comment-form>div,.rtl #commentform.wp-review-comment-form>div{float:right}.wp-review-thumbnail-wrapper{position:relative}.wp-review-on-thumbnail{position:absolute;top:0;right:0;background:#fff;padding:2px 4px}.wp-review-on-thumbnail.review-type-star .review-total-star{margin:0}.review-type-circle.latestPost-review-wrapper,.review-type-circle.wp-review-on-thumbnail{height:44px}.latestPost-review-wrapper .wp-review-circle-rating,.wp-review-on-thumbnail .wp-review-circle-rating{font-size:11px !important}.review-type-circle.review-total-only,.review-type-circle.wp-review-show-total{padding-top:6px;height:32px}.latestPost-review-wrapper{padding:2px 8px;background:#444;color:#fff}.review-type-star.latestPost-review-wrapper .review-result-wrapper{color:#fff !important}.review-type-star.latestPost-review-wrapper .review-result-wrapper i,.review-type-star.latestPost-review-wrapper .review-result-wrapper img.wp-review-image{opacity:0.6}.review-type-star.latestPost-review-wrapper .review-result-wrapper .review-result{color:#fff !important}.review-type-star.latestPost-review-wrapper .review-result-wrapper .review-result i,.review-type-star.latestPost-review-wrapper .review-result-wrapper .review-result img.wp-review-image{opacity:1}.widget .wp-review-show-total .review-star,.widget .wp-review-user-rating .review-star{position:relative;top:auto;right:auto}.animate-spin{-webkit-animation:spin 1s infinite linear;animation:spin 1s infinite linear;display:inline-block}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@media screen and (max-width: 600px){#review.review-wrapper .user-review-area .review-percentage,#review.review-wrapper .user-review-area .review-point{width:100% !important;max-width:100%;margin-bottom:10px}.user-review-area .user-total-wrapper{width:100%;max-width:100%}}@media screen and (max-width: 480px){.review-total-wrapper{text-align:right}.user-review-area .user-total-wrapper{max-width:60%;line-height:1.2}.user-review-area .user-total-wrapper .user-review-title{margin-top:0 !important}.review-price{float:none}.review-wrapper .review-title{font-size:16px}.review-total-wrapper span.review-total-box{padding:10px 0 20px;text-align:right;padding-left:10px}.reviewed-item-image{max-width:100%;width:100%;margin:0 0 10px 0;float:left}.rtl .review-total-wrapper span.review-total-box{padding:10px 0 20px;text-align:right;padding-left:0;padding-right:10px}.review-total-star.allowed-to-rate{position:relative;right:auto;left:0;float:left}.rtl .review-total-star.allowed-to-rate{right:0;left:auto;float:right}.review-pros-cons .review-pros,.review-pros-cons .review-cons{flex:0 0 100%;padding:0}.review-pros-cons .review-pros p:last-child,.review-pros-cons .review-cons p:last-child{margin-bottom:0}.review-pros-cons .review-pros{padding-bottom:20px}}.rtl .review-total-box{unicode-bidi:isolate-override}.rtl .wp-review-user-rating-total{unicode-bidi:-webkit-isolate;unicode-bidi:isolate}.rtl .wp-review-user-rating-total+small{unicode-bidi:plaintext}.rtl .review-links li a{margin:0 0 0 10px}.wp-reviews-list{position:relative;border:1px solid #e4e4e4;background-color:#fff}.wp-reviews-list *{box-sizing:border-box}.wp-reviews-list ul{list-style-type:none}.wp-reviews-list .item{padding:10px 15px;border-bottom:1px solid #e4e4e4;border-top:0;position:relative;list-style-type:none;margin:0}.wp-reviews-list .item:last-child{border:none}.wp-reviews-list img{max-width:100%;height:auto}.wp-reviews-list a{color:#444}.wp-reviews-list .thumb_small{float:left;margin-right:12px;padding-top:2px;width:65px;height:65px;overflow:hidden}.wp-reviews-list .thumb_large{float:none;max-width:100%;display:inline-block;margin-bottom:4px;position:relative}.wp-reviews-list .entry-title{font-weight:700;margin:0;padding:0;overflow:hidden}.wp-reviews-list .entry-title span{font-weight:normal}.wp-reviews-list .entry-title a{display:block}.wp-reviews-list .postmeta{color:#999;font-size:13px;margin-top:5px;font-weight:normal;float:right}.wp-reviews-list .review-count{float:left}.wp-reviews-list .review-total-only{display:inline-block;font-weight:normal;background:#eee}.wp-reviews-list .wp-post-image{margin:0 !important}.wp-reviews-list .loading{min-height:120px}.wp-reviews-list .loading:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(255,255,255,0.8);z-index:11}.wp-reviews-list .loading:after{content:"";margin:0 auto 3em auto;font-size:10px;position:absolute;top:45%;left:49%;z-index:12;text-indent:-9999em;border-top:0.4em solid rgba(0,0,0,0.2);border-right:0.4em solid rgba(0,0,0,0.2);border-bottom:0.4em solid rgba(0,0,0,0.2);border-left:0.4em solid #000;-webkit-animation:load8 0.5s infinite linear;animation:load8 0.5s infinite linear;border-radius:50%;width:2em;height:2em}.wp-reviews-list .reviews-pagination{padding-bottom:15px}.wp-reviews-list .reviews-pagination a{margin:0 15px}.wp-reviews-list .reviews-pagination .next{float:right}[data-ui-tabs] .ui-tabs-nav{list-style:none;padding:0 30px 0;border-bottom:1px solid rgba(255,255,255,0.1);margin:10px 0}[data-ui-tabs] .ui-tabs-nav li{float:left;margin:0;list-style-type:none}[data-ui-tabs] .ui-tabs-nav a{box-shadow:none;padding:8px 15px;background-color:rgba(0,0,0,0.15);outline:0;float:left;border:0;color:inherit}[data-ui-tabs] .ui-tabs-nav .ui-state-active a{background-color:rgba(255,255,255,0.45)}[data-wp-review-tabs] .tab-titles{list-style:none;padding:0 30px 0;border-bottom:1px solid rgba(255,255,255,0.1);margin:10px 0}[data-wp-review-tabs] .tab-title{float:left;margin:0;list-style-type:none}[data-wp-review-tabs] .tab-title button{box-shadow:none;padding:8px 15px;background-color:rgba(0,0,0,0.15);outline:0;float:left;border:0;color:inherit;cursor:pointer;font-size:inherit}[data-wp-review-tabs] .tab-title.active a{background-color:rgba(255,255,255,0.45)}.wp_review_tab_widget_content{position:relative;border:1px solid #E4E4E4}.wp_review_tab_widget_content img{max-width:100%;height:auto}.wp_review_tab_widget_content a{color:#444}.wp_review_tab_widget_content ul.wp-review-tabs li{list-style:none;display:block;width:50%;float:left;text-align:center;margin:0 !important;padding:0 !important;border:0}.wp_review_tab_widget_content ul.has-1-tabs li{width:100%;float:none;margin:0 auto}.wp_review_tab_widget_content ul.has-3-tabs li{width:33.33%}.wp_review_tab_widget_content ul.has-4-tabs li{width:50%}.wp_review_tab_widget_content .tab_title a{display:block;background:#f0f0f0;border-left:1px solid #E4E4E4;border-bottom:1px solid #E4E4E4;padding:2px 0 4px;line-height:2.4;text-decoration:none;position:relative;font-weight:bold}.wp_review_tab_widget_content .tab_title:first-child a{margin-left:0;border-left:0}.wp_review_tab_widget_content .tab_title.selected a{background:#fff;border-bottom:1px solid #fff}.wp_review_tab_widget_content .inside{background:#fff}.wp_review_tab_widget_content .tab-content li,.widget .wp_review_tab_widget_content .tab-content li{list-style-type:none;float:left;width:100%;box-sizing:border-box;margin:0;padding:10px 15px 15px;border-bottom:1px solid #E4E4E4;text-align:left;color:#444;background:none;position:relative}.wp_review_tab_widget_content .tab-content li:last-child{border:none;margin-bottom:0}.wp_review_tab_thumb_small{float:left;margin-right:12px;padding-top:4px;width:65px;height:65px;overflow:hidden}.wp_review_tab_thumb_large{float:none;max-width:100%;display:inline-block;margin-bottom:4px;position:relative}.wp_review_tab_widget_content .entry-title{font-size:inherit;font-weight:bold;margin:0;padding:0}.wp_review_tab_widget_content .entry-title span{color:#999}.wp_review_tab_widget_content .wp-review-tab-postmeta{color:#999;font-size:13px;float:right;margin-top:5px}.wp_review_tab_widget_content .wp-post-image{margin:0 !important}.wp_review_tab_widget_content .wp-review-tab-pagination{margin:0;width:100%;padding-top:0;padding-bottom:15px;float:left}.wp_review_tab_widget_content .wp-review-tab-pagination a{margin:0 15px}.wp-review-tab-pagination a.next{float:right}.wp-review-tab-loading{min-height:120px}.wp-review-tab-loading:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(255,255,255,0.8);z-index:11}.clear{clear:both}.wp-review-tab-loading:after{content:"";margin:0 auto 3em auto;font-size:10px;position:absolute;top:45%;left:49%;z-index:12;text-indent:-9999em;border-top:0.4em solid rgba(0,0,0,0.2);border-right:0.4em solid rgba(0,0,0,0.2);border-bottom:0.4em solid rgba(0,0,0,0.2);border-left:0.4em solid #000;-webkit-animation:load8 0.5s infinite linear;animation:load8 0.5s infinite linear;border-radius:50%;width:2em;height:2em}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.review-total-only.small-thumb{font-size:13px;font-weight:bold;padding:1px 0;float:left;box-sizing:border-box;margin-top:3px}.review-total-only.large-thumb{position:absolute;top:10px;right:15px;border-radius:0}.wp_review_tab_widget_content .has-4-tabs .tab_title.selected a{border-bottom:1px solid #E4E4E4}.wp_review_tab_widget_content .has-4-tabs .tab_title:nth-child(3) a{border-left:0}.title-right{overflow:hidden}.wp-review-product-rating{margin-bottom:10px}.wp-review-comment-form-photo{margin-bottom:15px;float:left;width:100%;clear:both;margin-right:0;margin-left:0}.wp-review-comment-form-photo p{margin-bottom:0}.wp-review-comment-form-photo{position:relative}.wp-review-comment-form-photo a{position:absolute;top:0;right:0}.wp-review-comment-form-photo #wp_review_comment_attachment_url{width:100%;box-sizing:border-box;-webkit-box-sizing:border-box}.wp-review-comment-form-photo input{margin-top:8px}.wp-review-comment-form-photo input.input-file{padding-left:0}.wp-review-comment-form-photo .hide{display:none}#comments .wp-review-usercomment-image{display:block;float:left;width:100%}.wp_review_comments_template #comments .is_verified{color:#b75c21;font-weight:bold}#commentform.wp-review-comment-form .comment-form-cookies-consent input{width:auto;height:auto}#commentform.wp-review-comment-form .comment-form-cookies-consent label{margin-left:8px}body.rtl .review-wrapper .review-star .wpr-count{margin-left:0;margin-right:3px}body.rtl .review-wrapper .review-total-wrapper span.review-total-box{text-align:left}body.rtl .review-wrapper .review-pros-cons .review-pros{padding-right:0;padding-left:10px}body.rtl .review-wrapper .review-pros-cons .review-cons{padding-left:0;padding-right:10px}body.rtl .review-wrapper .user-review-area .wp-review-user-rating-star{float:left}body.rtl .wp-review-comment-form-photo a{right:auto;left:0}body.rtl .review-pros-cons .review-pros{padding-right:0;padding-left:10px}body.rtl .review-pros-cons .review-cons{padding-right:10px;padding-left:0}body.rtl #comments .wp-review-usercomment-image img{float:right !important}body.rtl .wpr-businesses .business-data{padding-right:10px;padding-left:5px}body.rtl .wp-reviews-list .thumb_small{float:right;margin-right:0;margin-left:12px}body.rtl .wp-reviews-list .review-count{float:right}body.rtl .wp-reviews-list .postmeta{float:left}body.rtl .wp-reviews-list .reviews-pagination .next{float:left}body.rtl .review-total-only.large-thumb{right:auto;left:15px}body.rtl .wpr-place-reviews .review-image{float:right;margin-right:0;margin-left:10px}@font-face{font-family:'font-icons';src:url("../fonts/font-icons.eot");src:url("../fonts/font-icons.eot") format("embedded-opentype"),url("../fonts/font-icons.woff") format("woff"),url("../fonts/font-icons.ttf") format("truetype"),url("../fonts/font-icons.svg") format("svg");font-weight:normal;font-style:normal}[class^="mts-icon-"]:before,[class*=" mts-icon-"]:before{font-family:"font-icons";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:0;text-align:center;font-variant:normal;text-transform:none;line-height:1em}[class*="mts-icon-loader"]:before{font-family:"font-icons";font-style:normal;font-weight:normal;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.mts-icon-star:before{content:'\e800'}.mts-icon-loader:before{content:'\e801'}
|
2 |
+
|
3 |
+
/*# sourceMappingURL=../sourcemaps/wp-review.css.map */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rating-types/circle-input.php
CHANGED
@@ -1 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Circle input
|
4 |
+
*
|
5 |
+
* @package WP_Review
|
6 |
+
*/
|
7 |
+
|
8 |
+
?>
|
9 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
rating-types/circle-output.php
CHANGED
@@ -1 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Circle output
|
4 |
+
*
|
5 |
+
* @package WP_Review
|
6 |
+
*/
|
7 |
+
|
8 |
+
?>
|
9 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
rating-types/percentage-input.php
CHANGED
@@ -29,7 +29,7 @@ $bg_color = '';
|
|
29 |
|
30 |
if ( ! empty( $rating['colors']['inactive_color'] ) ) {
|
31 |
$inactive_color = $rating['colors']['inactive_color'];
|
32 |
-
$bg_color
|
33 |
}
|
34 |
?>
|
35 |
<div class="<?php echo esc_attr( $class ); ?>">
|
@@ -45,7 +45,7 @@ if ( ! empty( $rating['colors']['inactive_color'] ) ) {
|
|
45 |
<div class="wp-review-your-rating" style="background-color: <?php echo esc_attr( $rating['colors']['color'] ); ?>; color: <?php echo esc_attr( $rating['colors']['inactive_color'] ); ?>;">
|
46 |
<?php
|
47 |
// Translators: rating value.
|
48 |
-
printf( esc_html__( '%s' ), '<span class="wp-review-your-rating-value"></span>' );
|
49 |
?>
|
50 |
</div>
|
51 |
|
29 |
|
30 |
if ( ! empty( $rating['colors']['inactive_color'] ) ) {
|
31 |
$inactive_color = $rating['colors']['inactive_color'];
|
32 |
+
$bg_color = "background-color: {$inactive_color};";
|
33 |
}
|
34 |
?>
|
35 |
<div class="<?php echo esc_attr( $class ); ?>">
|
45 |
<div class="wp-review-your-rating" style="background-color: <?php echo esc_attr( $rating['colors']['color'] ); ?>; color: <?php echo esc_attr( $rating['colors']['inactive_color'] ); ?>;">
|
46 |
<?php
|
47 |
// Translators: rating value.
|
48 |
+
printf( esc_html__( '%s', 'wp-review' ), '<span class="wp-review-your-rating-value"></span>' ); // phpcs:ignore
|
49 |
?>
|
50 |
</div>
|
51 |
|
rating-types/percentage-output.php
CHANGED
@@ -15,9 +15,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
15 |
exit;
|
16 |
}
|
17 |
|
18 |
-
$percentage
|
19 |
$rating_value = isset( $rating['value'] ) ? $rating['value'] : 0;
|
20 |
-
$value
|
21 |
|
22 |
$class = 'review-percentage';
|
23 |
if ( ! empty( $rating['args']['class'] ) ) {
|
@@ -28,7 +28,7 @@ $inactive_color = ! empty( $rating['colors']['inactive_color'] ) ? $rating['colo
|
|
28 |
$bar_text_color = ! empty( $rating['colors']['bar_text_color'] ) ? $rating['colors']['bar_text_color'] : $rating['colors']['bgcolor1'];
|
29 |
?>
|
30 |
<div class="<?php echo esc_attr( $class ); ?>">
|
31 |
-
<div class="review-result-wrapper"<?php if ( $inactive_color ) echo "style=\"background-color: {$inactive_color}
|
32 |
<div class="review-result" style="width:<?php echo esc_attr( $value ); ?>%; background-color: <?php echo esc_attr( $rating['color'] ); ?>;"></div>
|
33 |
<div class="review-result-text" style="color: <?php echo esc_attr( $bar_text_color ); ?>;"><?php echo sprintf( wp_kses_post( $percentage['value_text'] ), floatval( $value ) ); ?></div>
|
34 |
</div>
|
15 |
exit;
|
16 |
}
|
17 |
|
18 |
+
$percentage = wp_review_get_rating_type_data( 'percentage' );
|
19 |
$rating_value = isset( $rating['value'] ) ? $rating['value'] : 0;
|
20 |
+
$value = wp_review_normalize_rating_value( $rating_value, 'percentage' );
|
21 |
|
22 |
$class = 'review-percentage';
|
23 |
if ( ! empty( $rating['args']['class'] ) ) {
|
28 |
$bar_text_color = ! empty( $rating['colors']['bar_text_color'] ) ? $rating['colors']['bar_text_color'] : $rating['colors']['bgcolor1'];
|
29 |
?>
|
30 |
<div class="<?php echo esc_attr( $class ); ?>">
|
31 |
+
<div class="review-result-wrapper"<?php if ( $inactive_color ) echo " style=\"background-color: {$inactive_color};\""; // phpcs:ignore ?>>
|
32 |
<div class="review-result" style="width:<?php echo esc_attr( $value ); ?>%; background-color: <?php echo esc_attr( $rating['color'] ); ?>;"></div>
|
33 |
<div class="review-result-text" style="color: <?php echo esc_attr( $bar_text_color ); ?>;"><?php echo sprintf( wp_kses_post( $percentage['value_text'] ), floatval( $value ) ); ?></div>
|
34 |
</div>
|
rating-types/point-input.php
CHANGED
@@ -26,7 +26,7 @@ if ( ! empty( $rating['args']['class'] ) ) {
|
|
26 |
$bg_color = '';
|
27 |
if ( ! empty( $rating['colors']['inactive_color'] ) ) {
|
28 |
$inactive_color = $rating['colors']['inactive_color'];
|
29 |
-
$bg_color
|
30 |
}
|
31 |
?>
|
32 |
<div class="<?php echo esc_attr( $class ); ?>">
|
@@ -42,7 +42,7 @@ if ( ! empty( $rating['colors']['inactive_color'] ) ) {
|
|
42 |
<div class="wp-review-your-rating" style="background-color: <?php echo esc_attr( $rating['colors']['color'] ); ?>; color: <?php echo esc_attr( $rating['colors']['inactive_color'] ); ?>;">
|
43 |
<?php
|
44 |
// Translators: rating value.
|
45 |
-
printf( esc_html__( '%s' ), '<span class="wp-review-your-rating-value"></span>' );
|
46 |
?>
|
47 |
</div>
|
48 |
|
26 |
$bg_color = '';
|
27 |
if ( ! empty( $rating['colors']['inactive_color'] ) ) {
|
28 |
$inactive_color = $rating['colors']['inactive_color'];
|
29 |
+
$bg_color = "background-color: {$inactive_color};";
|
30 |
}
|
31 |
?>
|
32 |
<div class="<?php echo esc_attr( $class ); ?>">
|
42 |
<div class="wp-review-your-rating" style="background-color: <?php echo esc_attr( $rating['colors']['color'] ); ?>; color: <?php echo esc_attr( $rating['colors']['inactive_color'] ); ?>;">
|
43 |
<?php
|
44 |
// Translators: rating value.
|
45 |
+
printf( esc_html__( '%s', 'wp-review' ), '<span class="wp-review-your-rating-value"></span>' ); // phpcs:ignore
|
46 |
?>
|
47 |
</div>
|
48 |
|
rating-types/point-output.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
/**
|
3 |
* Star rating type output template
|
4 |
*
|
|
|
5 |
* @since 2.0
|
6 |
* @copyright Copyright (c) 2013, MyThemesShop
|
7 |
* @author MyThemesShop
|
@@ -13,9 +14,9 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
13 |
exit;
|
14 |
}
|
15 |
|
16 |
-
$rating_type
|
17 |
$rating_value = isset( $rating['value'] ) ? $rating['value'] : 0;
|
18 |
-
$value
|
19 |
|
20 |
$class = 'review-point';
|
21 |
if ( ! empty( $rating['args']['class'] ) ) {
|
@@ -26,8 +27,8 @@ $inactive_color = ! empty( $rating['colors']['inactive_color'] ) ? $rating['colo
|
|
26 |
$bar_text_color = ! empty( $rating['colors']['bar_text_color'] ) ? $rating['colors']['bar_text_color'] : $rating['colors']['bgcolor1'];
|
27 |
?>
|
28 |
<div class="<?php echo esc_attr( $class ); ?>">
|
29 |
-
<div class="review-result-wrapper"<?php if ( $inactive_color ) echo "style=\"background-color: {$inactive_color}
|
30 |
<div class="review-result" style="width:<?php echo esc_attr( $value * 10 ); ?>%; background-color: <?php echo esc_attr( $rating['color'] ); ?>;"></div>
|
31 |
-
<div class="review-result-text" style="color: <?php echo esc_attr( $bar_text_color ); ?>;"><?php echo sprintf( $rating_type['value_text'], $value ); ?></div>
|
32 |
</div>
|
33 |
</div><!-- .review-percentage -->
|
2 |
/**
|
3 |
* Star rating type output template
|
4 |
*
|
5 |
+
* @package WP_Review
|
6 |
* @since 2.0
|
7 |
* @copyright Copyright (c) 2013, MyThemesShop
|
8 |
* @author MyThemesShop
|
14 |
exit;
|
15 |
}
|
16 |
|
17 |
+
$rating_type = wp_review_get_rating_type_data( 'point' );
|
18 |
$rating_value = isset( $rating['value'] ) ? $rating['value'] : 0;
|
19 |
+
$value = wp_review_normalize_rating_value( $rating_value, 'point' );
|
20 |
|
21 |
$class = 'review-point';
|
22 |
if ( ! empty( $rating['args']['class'] ) ) {
|
27 |
$bar_text_color = ! empty( $rating['colors']['bar_text_color'] ) ? $rating['colors']['bar_text_color'] : $rating['colors']['bgcolor1'];
|
28 |
?>
|
29 |
<div class="<?php echo esc_attr( $class ); ?>">
|
30 |
+
<div class="review-result-wrapper"<?php if ( $inactive_color ) echo " style=\"background-color: {$inactive_color};\""; // phpcs:ignore ?>>
|
31 |
<div class="review-result" style="width:<?php echo esc_attr( $value * 10 ); ?>%; background-color: <?php echo esc_attr( $rating['color'] ); ?>;"></div>
|
32 |
+
<div class="review-result-text" style="color: <?php echo esc_attr( $bar_text_color ); ?>;"><?php echo sprintf( $rating_type['value_text'], $value ); // WPCS: xss ok. ?></div>
|
33 |
</div>
|
34 |
</div><!-- .review-percentage -->
|
rating-types/star-input.php
CHANGED
@@ -19,15 +19,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
19 |
wp_enqueue_script( 'wp-review-star-input', trailingslashit( WP_REVIEW_URI ) . 'rating-types/star-input.js', array( 'jquery' ) );
|
20 |
|
21 |
// $feature_selector = empty( $rating['feature_id'] ) ? '' : "[data-feature-id=\"{$rating['feature_id']}\"]";
|
22 |
-
|
23 |
$class = 'wp-review-rating-input review-star';
|
24 |
if ( ! empty( $rating['args']['class'] ) ) {
|
25 |
$class .= sanitize_html_class( $rating['args']['class'] );
|
26 |
}
|
27 |
|
28 |
-
$rating_icon
|
29 |
-
$rating_image
|
30 |
-
$id
|
31 |
$wrapper_selector = '#' . $id;
|
32 |
?>
|
33 |
<div id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?>" data-post-id="<?php echo esc_attr( $rating['post_id'] ); ?>" data-token="<?php echo esc_attr( wp_create_nonce( 'wp-review-security' ) ); ?>">
|
@@ -44,7 +43,7 @@ $wrapper_selector = '#' . $id;
|
|
44 |
'<span class="wpr-has-image" data-input-value="%1$s" title="%1$s/5"><img src="%2$s" class="wp-review-image" /></span>',
|
45 |
esc_attr( $i ),
|
46 |
$rating_image
|
47 |
-
);
|
48 |
} else {
|
49 |
printf(
|
50 |
'<span data-input-value="%1$s" title="%1$s/5"><i class="%2$s"></i></span>',
|
19 |
wp_enqueue_script( 'wp-review-star-input', trailingslashit( WP_REVIEW_URI ) . 'rating-types/star-input.js', array( 'jquery' ) );
|
20 |
|
21 |
// $feature_selector = empty( $rating['feature_id'] ) ? '' : "[data-feature-id=\"{$rating['feature_id']}\"]";
|
|
|
22 |
$class = 'wp-review-rating-input review-star';
|
23 |
if ( ! empty( $rating['args']['class'] ) ) {
|
24 |
$class .= sanitize_html_class( $rating['args']['class'] );
|
25 |
}
|
26 |
|
27 |
+
$rating_icon = wp_review_get_rating_icon();
|
28 |
+
$rating_image = wp_review_get_rating_image();
|
29 |
+
$id = 'wp-review-star-rating-' . mt_rand( 1000, 9999 );
|
30 |
$wrapper_selector = '#' . $id;
|
31 |
?>
|
32 |
<div id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?>" data-post-id="<?php echo esc_attr( $rating['post_id'] ); ?>" data-token="<?php echo esc_attr( wp_create_nonce( 'wp-review-security' ) ); ?>">
|
43 |
'<span class="wpr-has-image" data-input-value="%1$s" title="%1$s/5"><img src="%2$s" class="wp-review-image" /></span>',
|
44 |
esc_attr( $i ),
|
45 |
$rating_image
|
46 |
+
); // WPCS: xss ok.
|
47 |
} else {
|
48 |
printf(
|
49 |
'<span data-input-value="%1$s" title="%1$s/5"><i class="%2$s"></i></span>',
|
rating-types/star-output.php
CHANGED
@@ -19,34 +19,42 @@ if ( ! empty( $rating['args']['class'] ) ) {
|
|
19 |
$class .= ' ' . sanitize_html_class( $rating['args']['class'] );
|
20 |
}
|
21 |
|
22 |
-
$rating_icon
|
23 |
-
$rating_image
|
24 |
$inactive_color = ! empty( $rating['colors']['inactive_color'] ) ? $rating['colors']['inactive_color'] : '';
|
25 |
-
$rating_value
|
26 |
-
$rating_color
|
27 |
?>
|
28 |
<div class="<?php echo esc_attr( $class ); ?>">
|
29 |
-
<div class="review-result-wrapper"<?php if ( $inactive_color ) echo
|
30 |
-
<?php for ( $i = 1; $i <= 5; $i++ ) :
|
31 |
-
if($rating_image) {
|
32 |
-
?>
|
33 |
-
<img src="<?php echo esc_url($rating_image); ?>" class="wp-review-image" />
|
34 |
-
<?php } else { ?>
|
35 |
-
<i class="<?php echo esc_attr( $rating_icon ); ?>"></i>
|
36 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
-
endfor;
|
|
|
39 |
|
40 |
-
<div class="review-result" style="width:<?php echo ( $rating_value * 20 ); ?>%; color:<?php echo $rating_color; ?>;">
|
41 |
-
<?php
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
?>
|
44 |
-
<img src="<?php echo esc_url($rating_image); ?>" class="wp-review-image" />
|
45 |
-
<?php } else { ?>
|
46 |
-
<i class="<?php echo esc_attr( $rating_icon ); ?>"></i>
|
47 |
-
<?php
|
48 |
-
}
|
49 |
-
endfor; ?>
|
50 |
</div><!-- .review-result -->
|
51 |
|
52 |
</div><!-- .review-result-wrapper -->
|
19 |
$class .= ' ' . sanitize_html_class( $rating['args']['class'] );
|
20 |
}
|
21 |
|
22 |
+
$rating_icon = wp_review_get_rating_icon();
|
23 |
+
$rating_image = wp_review_get_rating_image();
|
24 |
$inactive_color = ! empty( $rating['colors']['inactive_color'] ) ? $rating['colors']['inactive_color'] : '';
|
25 |
+
$rating_value = isset( $rating['value'] ) ? floatval( $rating['value'] ) : 0;
|
26 |
+
$rating_color = isset( $rating['color'] ) ? $rating['color'] : '';
|
27 |
?>
|
28 |
<div class="<?php echo esc_attr( $class ); ?>">
|
29 |
+
<div class="review-result-wrapper"<?php if ( $inactive_color ) echo " style=\"color: {$inactive_color};\""; // phpcs:ignore ?>>
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
<?php
|
31 |
+
for ( $i = 1; $i <= 5; $i++ ) :
|
32 |
+
if ( $rating_image ) {
|
33 |
+
?>
|
34 |
+
<img src="<?php echo esc_url( $rating_image ); ?>" class="wp-review-image" />
|
35 |
+
<?php
|
36 |
+
} else {
|
37 |
+
?>
|
38 |
+
<i class="<?php echo esc_attr( $rating_icon ); ?>"></i>
|
39 |
+
<?php
|
40 |
}
|
41 |
+
endfor;
|
42 |
+
?>
|
43 |
|
44 |
+
<div class="review-result" style="width:<?php echo floatval( ( $rating_value * 20 ) ); ?>%; color:<?php echo esc_attr( $rating_color ); ?>;">
|
45 |
+
<?php
|
46 |
+
for ( $i = 1; $i <= 5; $i++ ) :
|
47 |
+
if ( $rating_image ) {
|
48 |
+
?>
|
49 |
+
<img src="<?php echo esc_url( $rating_image ); ?>" class="wp-review-image" />
|
50 |
+
<?php
|
51 |
+
} else {
|
52 |
+
?>
|
53 |
+
<i class="<?php echo esc_attr( $rating_icon ); ?>"></i>
|
54 |
+
<?php
|
55 |
+
}
|
56 |
+
endfor;
|
57 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
</div><!-- .review-result -->
|
59 |
|
60 |
</div><!-- .review-result-wrapper -->
|
rating-types/thumbs-input.php
CHANGED
@@ -1 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Thumbs input
|
4 |
+
*
|
5 |
+
* @package WP_Review
|
6 |
+
*/
|
7 |
+
|
8 |
+
?>
|
9 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
rating-types/thumbs-output.php
CHANGED
@@ -1 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Thumbs output
|
4 |
+
*
|
5 |
+
* @package WP_Review
|
6 |
+
*/
|
7 |
+
|
8 |
+
?>
|
9 |
<p class="pro-only-notice"><?php esc_html_e( 'This rating type is not supported in the WP Review Free version', 'wp-review' ); ?></p>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Creator's website link: http://mythemeshop.com/plugins/wp-review/
|
|
4 |
Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.9.8
|
7 |
-
Stable tag: 5.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -103,6 +103,13 @@ Please disable all plugins and check if rating is working properly. Then you can
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
= v5.0.8 (Oct 3, 2018) =
|
107 |
* Fixed adding unnecessary custom field values if the review is not enabled in the post
|
108 |
* Removed blank review links section
|
4 |
Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.9.8
|
7 |
+
Stable tag: 5.1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
103 |
|
104 |
== Changelog ==
|
105 |
|
106 |
+
= v5.1.0 (Oct 13, 2018) =
|
107 |
+
* Removed unnecessary scripts from the non WP Review admin pages
|
108 |
+
* Fixed total rating disappearing issue if there are no features
|
109 |
+
* Fixed inactive color issue bug if color filter is used in the theme
|
110 |
+
* Fixed no space between HTML attributes
|
111 |
+
* Fixed compatibility issue with Rank Math plugin
|
112 |
+
|
113 |
= v5.0.8 (Oct 3, 2018) =
|
114 |
* Fixed adding unnecessary custom field values if the review is not enabled in the post
|
115 |
* Removed blank review links section
|
template-list.php
CHANGED
@@ -14,186 +14,189 @@
|
|
14 |
*/
|
15 |
function wp_review_get_box_templates() {
|
16 |
$default = array(
|
17 |
-
'title'
|
18 |
-
'image'
|
19 |
-
'color'
|
20 |
-
'inactive_color'
|
21 |
-
'fontcolor'
|
22 |
-
'bgcolor1'
|
23 |
-
'bgcolor2'
|
24 |
-
'bordercolor'
|
25 |
-
'width'
|
26 |
-
'align'
|
27 |
-
'custom_comment_colors'
|
28 |
-
'rating_icon'
|
29 |
-
'comment_color'
|
30 |
'comment_inactive_color' => '#ffb300',
|
31 |
);
|
32 |
|
33 |
-
$templates = apply_filters(
|
34 |
-
'
|
35 |
-
|
36 |
-
'
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
'
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
'
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
'
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
'
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
'
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
'
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
'
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
'
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
'
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
'
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
'
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
'
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
'
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
'
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
'
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
197 |
|
198 |
foreach ( $templates as $index => $template ) {
|
199 |
$templates[ $index ] = wp_parse_args( $template, $default );
|
14 |
*/
|
15 |
function wp_review_get_box_templates() {
|
16 |
$default = array(
|
17 |
+
'title' => __( 'Default', 'wp-review' ),
|
18 |
+
'image' => WP_REVIEW_ASSETS . 'images/default.jpg',
|
19 |
+
'color' => '#1e73be',
|
20 |
+
'inactive_color' => '#95bae0',
|
21 |
+
'fontcolor' => '#555',
|
22 |
+
'bgcolor1' => '#e7e7e7',
|
23 |
+
'bgcolor2' => '#fff',
|
24 |
+
'bordercolor' => '#e7e7e7',
|
25 |
+
'width' => 100, // In percentage.
|
26 |
+
'align' => 'left',
|
27 |
+
'custom_comment_colors' => false,
|
28 |
+
'rating_icon' => 'fa fa-star',
|
29 |
+
'comment_color' => '#ffb300',
|
30 |
'comment_inactive_color' => '#ffb300',
|
31 |
);
|
32 |
|
33 |
+
$templates = apply_filters(
|
34 |
+
'wp_review_box_templates',
|
35 |
+
array(
|
36 |
+
'amazon' => array(
|
37 |
+
'title' => __( 'Amazon', 'wp-review' ),
|
38 |
+
'image' => WP_REVIEW_ASSETS . 'images/amazon.jpg',
|
39 |
+
'color' => '#ffbe01',
|
40 |
+
'inactive_color' => '#f4f4f4',
|
41 |
+
'fontcolor' => '#111111',
|
42 |
+
'bgcolor1' => '#ffbe01',
|
43 |
+
'bgcolor2' => '#ffffff',
|
44 |
+
'bordercolor' => '#ffffff',
|
45 |
+
),
|
46 |
+
'aqua' => array(
|
47 |
+
'title' => __( 'Aqua', 'wp-review' ),
|
48 |
+
'image' => WP_REVIEW_ASSETS . 'images/aqua.jpg',
|
49 |
+
'color' => '#de5ea4',
|
50 |
+
'inactive_color' => '#f5d9e8',
|
51 |
+
'fontcolor' => '#4e565b',
|
52 |
+
'bgcolor1' => '#8e74ea',
|
53 |
+
'bgcolor2' => '#ffffff',
|
54 |
+
'bordercolor' => '#dfdaea',
|
55 |
+
),
|
56 |
+
'blue' => array(
|
57 |
+
'title' => __( 'Blue', 'wp-review' ),
|
58 |
+
'image' => WP_REVIEW_ASSETS . 'images/blue.jpg',
|
59 |
+
'color' => '#689FCE',
|
60 |
+
'inactive_color' => '#b1c6dc',
|
61 |
+
'fontcolor' => '#999999',
|
62 |
+
'bgcolor1' => '#f3f3f3',
|
63 |
+
'bgcolor2' => '#f3f3f3',
|
64 |
+
'bordercolor' => '#f3f3f3',
|
65 |
+
),
|
66 |
+
'darkside' => array(
|
67 |
+
'title' => __( 'Darkside', 'wp-review' ),
|
68 |
+
'image' => WP_REVIEW_ASSETS . 'images/darkside.jpg',
|
69 |
+
'color' => '#ed576c',
|
70 |
+
'fontcolor' => '#d0d0d0',
|
71 |
+
'bgcolor1' => '#20253b',
|
72 |
+
'bgcolor2' => '#20253b',
|
73 |
+
'bordercolor' => '#41465c',
|
74 |
+
'inactive_color' => '#41465c',
|
75 |
+
'comment_inactive_color' => '',
|
76 |
+
),
|
77 |
+
'dash' => array(
|
78 |
+
'title' => __( 'Dash', 'wp-review' ),
|
79 |
+
'image' => WP_REVIEW_ASSETS . 'images/dash.jpg',
|
80 |
+
'color' => '#378bcb',
|
81 |
+
'inactive_color' => '#8bbddb',
|
82 |
+
'fontcolor' => '#3f3f3f',
|
83 |
+
'bgcolor1' => '#378bcb',
|
84 |
+
'bgcolor2' => '#ffffff',
|
85 |
+
'bordercolor' => '#e8e8e8',
|
86 |
+
),
|
87 |
+
'edge' => array(
|
88 |
+
'title' => __( 'Edge', 'wp-review' ),
|
89 |
+
'image' => WP_REVIEW_ASSETS . 'images/edge.jpg',
|
90 |
+
'color' => '#f1c274',
|
91 |
+
'inactive_color' => '#f1e3cd',
|
92 |
+
'fontcolor' => '#6a788a',
|
93 |
+
'bgcolor1' => '#e77e34',
|
94 |
+
'bgcolor2' => '#ffffff',
|
95 |
+
'bordercolor' => '#edf2f9',
|
96 |
+
),
|
97 |
+
'enterprise' => array(
|
98 |
+
'title' => __( 'Enterprise', 'wp-review' ),
|
99 |
+
'image' => WP_REVIEW_ASSETS . 'images/enterprise.jpg',
|
100 |
+
'color' => '#f8937e',
|
101 |
+
'fontcolor' => '#666666',
|
102 |
+
'bgcolor1' => '#f8937e',
|
103 |
+
'bgcolor2' => '#f7e4c5',
|
104 |
+
'bordercolor' => '#ead7bb',
|
105 |
+
'inactive_color' => '#efbfa7',
|
106 |
+
),
|
107 |
+
'facebook' => array(
|
108 |
+
'title' => __( 'Facebook', 'wp-review' ),
|
109 |
+
'image' => WP_REVIEW_ASSETS . 'images/facebook.jpg',
|
110 |
+
'color' => '#4267b2',
|
111 |
+
'fontcolor' => '#333333',
|
112 |
+
'bgcolor1' => '#4267b2',
|
113 |
+
'bgcolor2' => '#ffffff',
|
114 |
+
'bordercolor' => '#e9eaed',
|
115 |
+
'inactive_color' => '#b7ceff',
|
116 |
+
),
|
117 |
+
'fizzy' => array(
|
118 |
+
'title' => __( 'Fizzy', 'wp-review' ),
|
119 |
+
'image' => WP_REVIEW_ASSETS . 'images/fizzy.jpg',
|
120 |
+
'color' => '#71CD7B',
|
121 |
+
'inactive_color' => '#cde6cf',
|
122 |
+
'fontcolor' => '#658694',
|
123 |
+
'bgcolor1' => '#F5F8F8',
|
124 |
+
'bgcolor2' => '#ffffff',
|
125 |
+
'bordercolor' => '#c8dde6',
|
126 |
+
),
|
127 |
+
'gamer' => array(
|
128 |
+
'title' => __( 'Gamer', 'wp-review' ),
|
129 |
+
'image' => WP_REVIEW_ASSETS . 'images/gamer.jpg',
|
130 |
+
'color' => '#d04622',
|
131 |
+
'inactive_color' => '#e2d4d1',
|
132 |
+
'fontcolor' => '#262626',
|
133 |
+
'bgcolor1' => '#2c2d31',
|
134 |
+
'bgcolor2' => '#f2f2f3',
|
135 |
+
'bordercolor' => '#cececf',
|
136 |
+
),
|
137 |
+
'gravity' => array(
|
138 |
+
'title' => __( 'Gravity', 'wp-review' ),
|
139 |
+
'image' => WP_REVIEW_ASSETS . 'images/gravity.jpg',
|
140 |
+
'color' => '#f2b852',
|
141 |
+
'fontcolor' => '#243a23',
|
142 |
+
'bgcolor1' => '#243a24',
|
143 |
+
'bgcolor2' => '#f1f0ec',
|
144 |
+
'bordercolor' => '#e3e2df',
|
145 |
+
'inactive_color' => '#f9e097',
|
146 |
+
'comment_inactive_color' => '',
|
147 |
+
),
|
148 |
+
'shell' => array(
|
149 |
+
'title' => __( 'Shell', 'wp-review' ),
|
150 |
+
'image' => WP_REVIEW_ASSETS . 'images/shell.jpg',
|
151 |
+
'color' => '#ec7d77',
|
152 |
+
'inactive_color' => '#d1eaef',
|
153 |
+
'fontcolor' => '#459cad',
|
154 |
+
'bgcolor1' => '#ffffff',
|
155 |
+
'bgcolor2' => '#f2f8f9',
|
156 |
+
'bordercolor' => '#d1eaef',
|
157 |
+
),
|
158 |
+
'tabbed-layout' => array(
|
159 |
+
'title' => __( 'Tabbed layout', 'wp-review' ),
|
160 |
+
'image' => WP_REVIEW_ASSETS . 'images/tabbed.jpg',
|
161 |
+
'color' => '#1e73be',
|
162 |
+
'inactive_color' => '#95bae0',
|
163 |
+
'fontcolor' => '#555',
|
164 |
+
'bgcolor1' => '#e7e7e7',
|
165 |
+
'bgcolor2' => '#fff',
|
166 |
+
'bordercolor' => '#e7e7e7',
|
167 |
+
),
|
168 |
+
'tabbed-layout2' => array(
|
169 |
+
'title' => __( 'Tabbed layout 2', 'wp-review' ),
|
170 |
+
'image' => WP_REVIEW_ASSETS . 'images/tabbed2.jpg',
|
171 |
+
'color' => '#98ba3b',
|
172 |
+
'inactive_color' => '#eff1e9',
|
173 |
+
'fontcolor' => '#413a43',
|
174 |
+
'bgcolor1' => '#615a63',
|
175 |
+
'bgcolor2' => '#ffffff',
|
176 |
+
'bordercolor' => '#f1edf1',
|
177 |
+
),
|
178 |
+
'xiaomi' => array(
|
179 |
+
'title' => __( 'Xiaomi', 'wp-review' ),
|
180 |
+
'image' => WP_REVIEW_ASSETS . 'images/xiaomi.jpg',
|
181 |
+
'color' => '#795548',
|
182 |
+
'inactive_color' => '#bcaaa4',
|
183 |
+
'fontcolor' => '#474747',
|
184 |
+
'bgcolor1' => '#efebe9',
|
185 |
+
'bgcolor2' => '#efebe9',
|
186 |
+
'bordercolor' => '#efebe9',
|
187 |
+
),
|
188 |
+
'zine' => array(
|
189 |
+
'title' => __( 'Zine', 'wp-review' ),
|
190 |
+
'image' => WP_REVIEW_ASSETS . 'images/zine.jpg',
|
191 |
+
'color' => '#04A9F5',
|
192 |
+
'inactive_color' => '#B3E5FC',
|
193 |
+
'fontcolor' => '#6a6a6a',
|
194 |
+
'bgcolor1' => '#f3fafb',
|
195 |
+
'bgcolor2' => '#f3fafb',
|
196 |
+
'bordercolor' => '#ffffff',
|
197 |
+
),
|
198 |
+
)
|
199 |
+
);
|
200 |
|
201 |
foreach ( $templates as $index => $template ) {
|
202 |
$templates[ $index ] = wp_parse_args( $template, $default );
|
wp-review.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP Review
|
4 |
* Plugin URI: http://mythemeshop.com/plugins/wp-review/
|
5 |
* Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
|
6 |
-
* Version: 5.0
|
7 |
* Author: MyThemeShop
|
8 |
* Author URI: http://mythemeshop.com/
|
9 |
* Text Domain: wp-review
|
@@ -45,7 +45,7 @@ if ( version_compare( phpversion(), '5.6', '<' ) ) {
|
|
45 |
}
|
46 |
|
47 |
/* Plugin version */
|
48 |
-
define( 'WP_REVIEW_PLUGIN_VERSION', '5.0
|
49 |
|
50 |
/* Sets the custom db table name. */
|
51 |
define( 'MTS_WP_REVIEW_DB_TABLE', 'mts_wp_reviews' );
|
@@ -160,7 +160,7 @@ if ( ! function_exists( 'wp_review_includes_libraries' ) ) :
|
|
160 |
require_once( WP_REVIEW_ADMIN . 'class-wp-review-form-field.php' );
|
161 |
|
162 |
/* Loads the importer. */
|
163 |
-
require_once( WP_REVIEW_ADMIN . '
|
164 |
|
165 |
/* Loads the demo importer. */
|
166 |
require_once( WP_REVIEW_ADMIN . 'demo-importer.php' );
|
3 |
* Plugin Name: WP Review
|
4 |
* Plugin URI: http://mythemeshop.com/plugins/wp-review/
|
5 |
* Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
|
6 |
+
* Version: 5.1.0
|
7 |
* Author: MyThemeShop
|
8 |
* Author URI: http://mythemeshop.com/
|
9 |
* Text Domain: wp-review
|
45 |
}
|
46 |
|
47 |
/* Plugin version */
|
48 |
+
define( 'WP_REVIEW_PLUGIN_VERSION', '5.1.0' );
|
49 |
|
50 |
/* Sets the custom db table name. */
|
51 |
define( 'MTS_WP_REVIEW_DB_TABLE', 'mts_wp_reviews' );
|
160 |
require_once( WP_REVIEW_ADMIN . 'class-wp-review-form-field.php' );
|
161 |
|
162 |
/* Loads the importer. */
|
163 |
+
require_once( WP_REVIEW_ADMIN . 'class-wp-review-importer.php' );
|
164 |
|
165 |
/* Loads the demo importer. */
|
166 |
require_once( WP_REVIEW_ADMIN . 'demo-importer.php' );
|