Changed source root directory
674
html/wp-content/plugins/post-smtp/freemius/LICENSE.txt
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
289
html/wp-content/plugins/post-smtp/freemius/README.md
Normal file
@@ -0,0 +1,289 @@
|
||||
Freemius WordPress SDK
|
||||
======================
|
||||
|
||||
Welcome to the official repository for the Freemius SDK! Adding the SDK to your WordPress plugin, theme, or add-ons, enables all the benefits that come with using the [Freemius platform](https://freemius.com) such as:
|
||||
|
||||
* [Software Licensing](https://freemius.com/wordpress/software-licensing/)
|
||||
* [Secure Checkout](https://freemius.com/wordpress/checkout/)
|
||||
* [Subscriptions](https://freemius.com/wordpress/recurring-payments-subscriptions/)
|
||||
* [Automatic Updates](https://freemius.com/wordpress/automatic-software-updates/)
|
||||
* [Seamless EU VAT](https://freemius.com/wordpress/collecting-eu-vat-europe/)
|
||||
* [Cart Abandonment Recovery](https://freemius.com/wordpress/cart-abandonment-recovery/)
|
||||
* [Affiliate Platform](https://freemius.com/wordpress/affiliate-platform/)
|
||||
* [Analytics & Usage Tracking](https://freemius.com/wordpress/insights/)
|
||||
* [User Dashboard](https://freemius.com/wordpress/user-dashboard/)
|
||||
|
||||
* [Monetization](https://freemius.com/wordpress/)
|
||||
* [Analytics](https://freemius.com/wordpress/insights/)
|
||||
* [More...](https://freemius.com/wordpress/features-comparison/)
|
||||
|
||||
Freemius truly empowers developers to create prosperous subscription-based businesses.
|
||||
|
||||
If you're new to Freemius then we recommend taking a look at our [Getting Started](https://freemius.com/help/documentation/getting-started/) guide first.
|
||||
|
||||
If you're a WordPress plugin or theme developer and are interested in monetizing with Freemius then you can [sign-up for a FREE account](https://dashboard.freemius.com/register/):
|
||||
|
||||
https://dashboard.freemius.com/register/
|
||||
|
||||
Once you have your account setup and are familiar with how it all works you're ready to begin [integrating Freemius](https://freemius.com/help/documentation/wordpress-sdk/integrating-freemius-sdk/) into your WordPress product
|
||||
|
||||
You can see some of the existing WordPress.org plugins & themes that are already utilizing the power of Freemius here:
|
||||
|
||||
* https://profiles.wordpress.org/freemius/#content-plugins
|
||||
* https://includewp.com/freemius/#focus
|
||||
|
||||
## Code Documentation
|
||||
|
||||
You can find the SDK's documentation here:
|
||||
https://freemius.com/help/documentation/wordpress-sdk/
|
||||
|
||||
## Integrating & Initializing the SDK
|
||||
|
||||
As part of the integration process, you'll need to [add the latest version](https://freemius.com/help/documentation/getting-started/#add_the_latest_wordpress_sdk_into_your_product) of the Freemius SDK into your WordPress project.
|
||||
|
||||
Then, when you've completed the [SDK integration form](https://freemius.com/help/documentation/getting-started/#fill_out_the_sdk_integration_form) a snippet of code is generated which you'll need to copy and paste into the top of your main plugin's PHP file, right after the plugin's header comment.
|
||||
|
||||
Note: For themes, this will be in the root `functions.php` file instead.
|
||||
|
||||
A typical SDK snippet will look similar to the following (your particular snippet may differ slightly depending on your integration):
|
||||
|
||||
```php
|
||||
if ( ! function_exists( 'my_prefix_fs' ) ) {
|
||||
// Create a helper function for easy SDK access.
|
||||
function my_prefix_fs() {
|
||||
global $my_prefix_fs;
|
||||
|
||||
if ( ! isset( $my_prefix_fs ) ) {
|
||||
// Include Freemius SDK.
|
||||
require_once dirname(__FILE__) . '/freemius/start.php';
|
||||
|
||||
$my_prefix_fs = fs_dynamic_init( array(
|
||||
'id' => '1234',
|
||||
'slug' => 'my-new-plugin',
|
||||
'premium_slug' => 'my-new-plugin-premium',
|
||||
'type' => 'plugin',
|
||||
'public_key' => 'pk_bAEfta69seKymZzmf2xtqq8QXHz9y',
|
||||
'is_premium' => true,
|
||||
// If your plugin is a serviceware, set this option to false.
|
||||
'has_premium_version' => true,
|
||||
'has_paid_plans' => true,
|
||||
'is_org_compliant' => true,
|
||||
'menu' => array(
|
||||
'slug' => 'my-new-plugin',
|
||||
'parent' => array(
|
||||
'slug' => 'options-general.php',
|
||||
),
|
||||
),
|
||||
// Set the SDK to work in a sandbox mode (for development & testing).
|
||||
// IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
|
||||
'secret_key' => 'sk_ubb4yN3mzqGR2x8#P7r5&@*xC$utE',
|
||||
) );
|
||||
}
|
||||
|
||||
return $my_prefix_fs;
|
||||
}
|
||||
|
||||
// Init Freemius.
|
||||
my_prefix_fs();
|
||||
// Signal that SDK was initiated.
|
||||
do_action( 'my_prefix_fs_loaded' );
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Usage example
|
||||
|
||||
You can call any SDK methods by prefixing them with the shortcode function for your particular plugin/theme (specified when completing the SDK integration form in the Developer Dashboard):
|
||||
|
||||
```php
|
||||
<?php my_prefix_fs()->get_upgrade_url(); ?>
|
||||
```
|
||||
|
||||
Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
|
||||
|
||||
```php
|
||||
<?php
|
||||
global $my_prefix_fs;
|
||||
$my_prefix_fs->get_account_url();
|
||||
?>
|
||||
```
|
||||
|
||||
There are many other SDK methods available that you can use to enhance the functionality of your WordPress product. Some of the more common use-cases are covered in the [Freemius SDK Gists](https://freemius.com/help/documentation/wordpress-sdk/gists/) documentation.
|
||||
|
||||
## Adding license-based logic examples
|
||||
|
||||
Add marketing content that encourages your users to upgrade to a paid version:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_not_paying() ) {
|
||||
echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
|
||||
echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
|
||||
esc_html__('Upgrade Now!', 'my-plugin-slug') .
|
||||
'</a>';
|
||||
echo '</section>';
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be available in your premium plugin version:
|
||||
|
||||
```php
|
||||
<?php
|
||||
// This "if" block will be auto removed from the Free version.
|
||||
if ( my_prefix_fs()->is__premium_only() ) {
|
||||
|
||||
// ... premium only logic ...
|
||||
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
To add a function which will only be available in your premium plugin version, add `__premium_only` as the suffix of the function name. Ensure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
|
||||
|
||||
```php
|
||||
<?php
|
||||
class My_Plugin {
|
||||
function init() {
|
||||
...
|
||||
|
||||
// This "if" block will be auto removed from the free version.
|
||||
if ( my_prefix_fs()->is__premium_only() ) {
|
||||
// Init premium version.
|
||||
$this->admin_init__premium_only();
|
||||
|
||||
add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
|
||||
}
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
// This method will be only included in the premium version.
|
||||
function admin_init__premium_only() {
|
||||
...
|
||||
}
|
||||
|
||||
// This method will be only included in the premium version.
|
||||
function admin_init_hook__premium_only() {
|
||||
...
|
||||
}
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be executed for customers in your 'professional' plan:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_plan('professional', true) ) {
|
||||
// .. logic related to Professional plan only ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be executed for customers in your 'professional' plan or higher plans:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_plan('professional') ) {
|
||||
// ... logic related to Professional plan and higher plans ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
|
||||
|
||||
```php
|
||||
<?php
|
||||
// This "if" block will be auto removed from the Free version.
|
||||
if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
|
||||
// ... logic related to Professional plan and higher plans ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic only for users in trial:
|
||||
|
||||
```php
|
||||
<?php
|
||||
if ( my_prefix_fs()->is_trial() ) {
|
||||
// ... logic for users in trial ...
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
Add logic for specified paid plan:
|
||||
|
||||
```php
|
||||
<?php
|
||||
// This "if" block will be auto removed from the Free version.
|
||||
if ( my_prefix_fs()->is__premium_only() ) {
|
||||
if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
|
||||
|
||||
// ... logic related to Professional plan only ...
|
||||
|
||||
} else if ( my_prefix_fs()->is_plan( 'business' ) ) {
|
||||
|
||||
// ... logic related to Business plan and higher plans ...
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
```
|
||||
|
||||
## Excluding files and folders from the free plugin version
|
||||
There are [two ways](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/#excluding_files_and_folders_from_the_free_plugin_version) to exclude files from your free version.
|
||||
|
||||
1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be included only in the premium plugin version. This works for all types of files, not only PHP.
|
||||
2. Add `@fs_premium_only` a special meta tag to the plugin's main PHP file header. Example:
|
||||
```php
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: My Very Awesome Plugin
|
||||
* Plugin URI: http://my-awesome-plugin.com
|
||||
* Description: Create and manage Awesomeness right in WordPress.
|
||||
* Version: 1.0.0
|
||||
* Author: Awesomattic
|
||||
* Author URI: http://my-awesome-plugin.com/me/
|
||||
* License: GPLv2
|
||||
* Text Domain: myplugin
|
||||
* Domain Path: /langs
|
||||
*
|
||||
* @fs_premium_only /lib/functions.php, /premium-files/
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// ... my code ...
|
||||
?>
|
||||
```
|
||||
In the example plugin header above, the file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
|
||||
|
||||
## Hooks: Actions and Filters
|
||||
Similar to WordPress’ filters and actions hooks, the Freemius WordPress SDK provides a [collection of filters and actions](https://freemius.com/help/documentation/wordpress-sdk/filters-actions-hooks/) that enable you to customize and extend its functionality in your WordPress plugins or themes.
|
||||
|
||||
## WordPress.org Compliance
|
||||
Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
|
||||
> All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
|
||||
|
||||
Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or use [some of the other methods](https://freemius.com/help/documentation/wordpress-sdk/software-licensing/) provided by the SDK to exclude premium features & files from the free version.
|
||||
|
||||
## Deployment
|
||||
Zip your Freemius product’s root folder and [upload it in the Deployment section](https://freemius.com/help/documentation/selling-with-freemius/deployment/) in the *Freemius Developer's Dashboard*.
|
||||
The plugin/theme will automatically be scanned and processed by a custom-developed *PHP Processor* which will auto-generate two versions of your plugin:
|
||||
|
||||
1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
|
||||
2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
|
||||
|
||||
The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org compliant and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
|
||||
|
||||
## License
|
||||
Copyright (c) Freemius®, Inc.
|
||||
|
||||
Licensed under the GNU general public license (version 3).
|
||||
|
||||
## Contributing
|
||||
|
||||
Please see our [contributing guide](CONTRIBUTING.md).
|
||||
@@ -0,0 +1 @@
|
||||
#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;margin-left:0;padding:0}#fs_affiliation_content_wrapper ul li{box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:"✓";font-weight:700;margin-right:10px}#fs_affiliation_content_wrapper label,#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper p:not(.description){font-size:16px!important;line-height:26px!important}#fs_affiliation_content_wrapper .button{font-size:16px;height:40px;line-height:35px;margin-bottom:7px;margin-top:20px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{display:block;font-weight:700;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{display:inline-block;margin-top:3px;text-decoration:none}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
|
||||
@@ -0,0 +1 @@
|
||||
.fs-ajax-loader{height:20px;margin:auto;position:relative;width:170px}.fs-ajax-loader .fs-ajax-loader-bar{animation-direction:normal;animation-duration:1.5s;animation-iteration-count:infinite;animation-name:bounce_ajaxLoader;background-color:#fff;height:20px;position:absolute;top:0;transform:scale(.3);width:20px}.fs-ajax-loader .fs-ajax-loader-bar-1{animation-delay:.6s;left:0}.fs-ajax-loader .fs-ajax-loader-bar-2{animation-delay:.75s;left:19px}.fs-ajax-loader .fs-ajax-loader-bar-3{animation-delay:.9s;left:38px}.fs-ajax-loader .fs-ajax-loader-bar-4{animation-delay:1.05s;left:57px}.fs-ajax-loader .fs-ajax-loader-bar-5{animation-delay:1.2s;left:76px}.fs-ajax-loader .fs-ajax-loader-bar-6{animation-delay:1.35s;left:95px}.fs-ajax-loader .fs-ajax-loader-bar-7{animation-delay:1.5s;left:114px}.fs-ajax-loader .fs-ajax-loader-bar-8{animation-delay:1.65s;left:133px}@keyframes bounce_ajaxLoader{0%{background-color:#0074a3;transform:scale(1)}to{background-color:#fff;transform:scale(.3)}}@media screen and (max-width:782px){#wpbody-content{padding-bottom:0!important}}.fs-checkout-process-redirect{padding:40px;text-align:center}
|
||||
@@ -0,0 +1 @@
|
||||
.fs-notice[data-id^=clone_resolution_options_notice]{color:inherit!important;padding:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-notice-body{margin-bottom:0;padding:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-notice-header{padding:5px 10px}.fs-notice[data-id^=clone_resolution_options_notice] ol{margin-bottom:0;margin-top:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-options-container{display:flex;flex-direction:row;padding:0 10px 10px}@media(max-width:750px){.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-options-container{flex-direction:column}}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option{border:1px solid #ccc;flex:auto;margin:5px;padding:10px 10px 15px}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option:first-child{margin-left:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option:last-child{margin-right:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-resolution-option strong{font-size:1.2em;line-height:1.5em;padding:2px}.fs-notice[data-id^=clone_resolution_options_notice] a{text-decoration:none}.fs-notice[data-id^=clone_resolution_options_notice] .button{margin-right:10px}.rtl .fs-notice[data-id^=clone_resolution_options_notice] .button{margin-left:10px;margin-right:0}.fs-notice[data-id^=clone_resolution_options_notice] .fs-clone-documentation-container{padding:0 10px 15px}.fs-notice[data-id=temporary_duplicate_notice] #fs_clone_resolution_error_message{background:#fee;border:1px solid #d3135a;color:#d3135a;padding:10px}.fs-notice[data-id=temporary_duplicate_notice] ol{margin-top:0}.fs-notice[data-id=temporary_duplicate_notice] a{position:relative}.fs-notice[data-id=temporary_duplicate_notice] a:focus{box-shadow:none}.fs-notice[data-id=temporary_duplicate_notice] a.disabled{color:gray}.fs-notice[data-id=temporary_duplicate_notice] a .fs-ajax-spinner{bottom:0;left:8px;margin-left:100%;position:absolute;right:0;top:-1px}
|
||||
@@ -0,0 +1 @@
|
||||
label.fs-tag,span.fs-tag{background:#ffba00;border-radius:3px;color:#fff;display:inline-block;font-size:11px;line-height:11px;padding:5px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.fs-switch-label{font-size:20px;line-height:31px;margin:0 5px}.fs-debug-table-toggle-button{background:transparent;border:none;cursor:pointer;font-size:1.2em}.fs-debug-table{overflow:hidden}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:700}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac!important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}
|
||||
@@ -0,0 +1 @@
|
||||
.fs-notice[data-id^=gdpr_optin_actions] .underlined{text-decoration:underline}.fs-notice[data-id^=gdpr_optin_actions] ul .action-description,.fs-notice[data-id^=gdpr_optin_actions] ul .button{vertical-align:middle}.fs-notice[data-id^=gdpr_optin_actions] ul .action-description{display:inline-block;margin-left:3px}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1 @@
|
||||
.fs-tooltip-trigger{position:relative}.fs-tooltip-trigger:not(a){cursor:help}.fs-tooltip-trigger .dashicons{float:none!important}.fs-tooltip-trigger .fs-tooltip{background:rgba(0,0,0,.8);border-radius:5px;bottom:100%;box-shadow:1px 1px 1px rgba(0,0,0,.2);color:#fff!important;font-family:arial,serif;font-size:12px;font-weight:700;left:-17px;line-height:1.3em;margin-bottom:5px;opacity:0;padding:10px;position:absolute;right:0;text-align:left;text-transform:none!important;transition:opacity .3s ease-in-out;visibility:hidden;z-index:999999}.rtl .fs-tooltip-trigger .fs-tooltip{left:auto;right:-17px;text-align:right}.fs-tooltip-trigger .fs-tooltip:after{border-color:rgba(0,0,0,.8) transparent transparent;border-style:solid;border-width:5px 5px 0;content:" ";display:block;height:0;left:21px;position:absolute;top:100%;width:0}.rtl .fs-tooltip-trigger .fs-tooltip:after{left:auto;right:21px}.fs-tooltip-trigger:hover .fs-tooltip{opacity:1;visibility:visible}.fs-permissions .fs-permission.fs-disabled,.fs-permissions .fs-permission.fs-disabled .fs-permission-description span{color:#aaa}.fs-permissions .fs-permission .fs-switch-feedback{position:absolute;right:15px;top:52px}.fs-permissions ul{height:0;margin:0;overflow:hidden}.fs-permissions ul li{margin:0;padding:17px 15px;position:relative}.fs-permissions ul li>i.dashicons{float:left;font-size:30px;height:30px;padding:5px;width:30px}.fs-permissions ul li .fs-switch{float:right}.fs-permissions ul li .fs-permission-description{margin-left:55px}.fs-permissions ul li .fs-permission-description span{color:#23282d;font-size:14px;font-weight:500}.fs-permissions ul li .fs-permission-description .fs-tooltip{font-size:13px;font-weight:700}.fs-permissions ul li .fs-permission-description .fs-tooltip-trigger .dashicons{margin:-1px 2px 0}.fs-permissions ul li .fs-permission-description p{margin:2px 0 0}.fs-permissions.fs-open{background:#fff}.fs-permissions.fs-open ul{height:auto;margin:20px 0 10px;overflow:initial}.fs-permissions .fs-switch-feedback .fs-ajax-spinner{margin-right:10px}.fs-permissions .fs-switch-feedback.success{color:#71ae00}.rtl .fs-permissions .fs-switch-feedback{left:15px;right:auto}.rtl .fs-permissions .fs-switch-feedback .fs-ajax-spinner{margin-left:10px;margin-right:0}.rtl .fs-permissions ul li .fs-permission-description{margin-left:0;margin-right:55px}.rtl .fs-permissions ul li .fs-switch{float:left}.rtl .fs-permissions ul li i.dashicons{float:right}.fs-modal-opt-out .fs-modal-footer .fs-opt-out-button{line-height:30px;margin-right:10px}.fs-modal-opt-out .fs-permissions{margin-top:0!important}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header .fs-group-opt-out-button{float:right;line-height:1.1em}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header .fs-switch-feedback{float:right;line-height:1.1em;margin-right:10px}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header .fs-switch-feedback .fs-ajax-spinner{margin:-2px 0 0}.fs-modal-opt-out .fs-permissions .fs-permissions-section--header-title{display:block;font-size:1.1em;font-weight:600;line-height:1.1em;margin:.5em 0;text-transform:uppercase}.fs-modal-opt-out .fs-permissions .fs-permissions-section--desc{margin-top:0}.fs-modal-opt-out .fs-permissions hr{border:0;border-top:1px solid #eee;margin:25px 0 20px}.fs-modal-opt-out .fs-permissions ul{border:1px solid #c3c4c7;border-radius:3px;box-shadow:0 1px 1px rgba(0,0,0,.04);margin:10px 0 0}.fs-modal-opt-out .fs-permissions ul li{border-bottom:1px solid #d7dde1;border-left:4px solid #72aee6}.rtl .fs-modal-opt-out .fs-permissions ul li{border-left:none;border-right:4px solid #72aee6}.fs-modal-opt-out .fs-permissions ul li.fs-disabled{border-left-color:rgba(114,174,230,0)}.fs-modal-opt-out .fs-permissions ul li:last-child{border-bottom:none}
|
||||
@@ -0,0 +1 @@
|
||||
label.fs-tag,span.fs-tag{background:#ffba00;border-radius:3px;color:#fff;display:inline-block;font-size:11px;line-height:11px;padding:5px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.wp-list-table.plugins .plugin-title span.fs-tag{display:inline-block;line-height:10px;margin-left:5px}
|
||||
@@ -0,0 +1 @@
|
||||
#fs_customizer_upsell .fs-customizer-plan{background:#fff;border-radius:3px;padding:10px 20px 20px}#fs_customizer_upsell .fs-customizer-plan h2{line-height:2em;margin:0;position:relative;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;margin-left:-7px;margin-right:10px;vertical-align:bottom}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{background:#000;border-radius:5px;bottom:100%;box-shadow:1px 1px 1px rgba(0,0,0,.2);color:#fff;font-family:arial,serif;font-size:12px;font-weight:700;left:0;line-height:1.3em;margin-bottom:5px;opacity:0;padding:10px;position:absolute;right:0;text-align:left;transition:opacity .3s ease-in-out;visibility:hidden;z-index:999999}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc:after{border-color:#000 transparent transparent;border-style:solid;border-width:5px 5px 0;content:" ";display:block;height:0;left:21px;position:absolute;top:100%;width:0}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc:after{left:auto;right:21px}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{opacity:1;visibility:visible}#fs_customizer_upsell .button-primary{display:block;margin-top:10px;text-align:center}#fs_customizer_support{display:block!important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{display:block;margin-top:10px;width:100%}#fs_customizer_support .button-group .button{float:none;text-align:center;width:50%}#customize-theme-controls #accordion-section-freemius_upsell{border-bottom:1px solid #0085ba!important;border-top:1px solid #0085ba!important}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title{background-color:#0085ba;border-bottom:none!important;border-left:4px solid #0085ba;color:#fff;outline:none;transition:background-color .15s ease-in-out,border-color .15s ease-in-out}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title:hover{background-color:#008ec2;border-left-color:#0073aa}#customize-theme-controls #accordion-section-freemius_upsell h3.accordion-section-title:after{color:#fff}#customize-theme-controls #accordion-section-freemius_upsell .rtl h3.accordion-section-title{border-left:none;border-right:4px solid #0085ba}#customize-theme-controls #accordion-section-freemius_upsell .rtl h3.accordion-section-title:hover{border-right-color:#0073aa}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1 @@
|
||||
!function(n){n.extend({form:function(r,e,t){null==t&&(t="POST"),null==e&&(e={});var o=n("<form>").attr({method:t,action:r}).css({display:"none"}),a=function(r,e){if(n.isArray(e))for(var t=0;t<e.length;t++){var i=e[t];a(r+"[]",i)}else if("object"==typeof e)for(var f in e)e.hasOwnProperty(f)&&a(r+"["+f+"]",e[f]);else null!=e&&o.append(n("<input>").attr({type:"hidden",name:String(r),value:String(e)}))};for(var i in e)e.hasOwnProperty(i)&&a(i,e[i]);return o.appendTo("body")}})}(jQuery);
|
||||
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* jQuery postMessage - v0.5 - 9/11/2009
|
||||
* http://benalman.com/projects/jquery-postmessage-plugin/
|
||||
*
|
||||
* Copyright (c) 2009 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*
|
||||
* Non-jQuery fork by Jeff Lee
|
||||
*
|
||||
* This fork consists of the following changes:
|
||||
* 1. Basic code cleanup and restructuring, for legibility.
|
||||
* 2. The `postMessage` and `receiveMessage` functions can be bound arbitrarily,
|
||||
* in terms of both function names and object scope. Scope is specified by
|
||||
* the the "this" context of NoJQueryPostMessageMixin();
|
||||
* 3. I've removed the check for Opera 9.64, which used `$.browser`. There were
|
||||
* at least three different GitHub users requesting the removal of this
|
||||
* "Opera sniff" on the original project's Issues page, so I figured this
|
||||
* would be a relatively safe change.
|
||||
* 4. `postMessage` no longer uses `$.param` to serialize messages that are not
|
||||
* strings. I actually prefer this structure anyway. `receiveMessage` does
|
||||
* not implement a corresponding deserialization step, and as such it seems
|
||||
* cleaner and more symmetric to leave both data serialization and
|
||||
* deserialization to the client.
|
||||
* 5. The use of `$.isFunction` is replaced by a functionally-identical check.
|
||||
* 6. The `$:nomunge` YUI option is no longer necessary.
|
||||
*/
|
||||
function NoJQueryPostMessageMixin(n,e){var t,i,o,s,a,r=1;return window.postMessage?(window.addEventListener?(t=function(n){window.addEventListener("message",n,!1)},i=function(n){window.removeEventListener("message",n,!1)}):(t=function(n){window.attachEvent("onmessage",n)},i=function(n){window.detachEvent("onmessage",n)}),this[n]=function(n,e,t){e&&t.postMessage(n,e.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))},this[e]=function(n,e,s){if(o&&(i(o),o=null),!n)return!1;o=t((function(t){switch(Object.prototype.toString.call(e)){case"[object String]":if(e!==t.origin)return!1;break;case"[object Function]":if(e(t.origin))return!1}n(t)}))}):(this[n]=function(n,e,t){e&&(t.location=e.replace(/#.*$/,"")+"#"+ +new Date+r+++"&"+n)},this[e]=function(n,e,t){s&&(clearInterval(s),s=null),n&&(t="number"==typeof e?e:"number"==typeof t?t:100,s=setInterval((function(){var e=document.location.hash,t=/^#?\d+&/;e!==a&&t.test(e)&&(a=e,n({data:e.replace(t,"")}))}),t))}),this}
|
||||
@@ -0,0 +1 @@
|
||||
!function(t,e){var s,n,o,i,r,a,c,p,u=this;u.FS=u.FS||{},u.FS.PostMessage=(n=new NoJQueryPostMessageMixin("postMessage","receiveMessage"),o={},i=decodeURIComponent(document.location.hash.replace(/^#/,"")),r=i.substring(0,i.indexOf("/","https://"===i.substring(0,8)?8:7)),a=""!==i,c=t(window),p=t("html"),{init:function(t,e){s=t,n.receiveMessage((function(t){var e=JSON.parse(t.data);if(o[e.type])for(var s=0;s<o[e.type].length;s++)o[e.type][s](e.data)}),s),FS.PostMessage.receiveOnce("forward",(function(t){t.url&&(t.url.startsWith("http://")||t.url.startsWith("https://"))&&(window.location=t.url)})),(e=e||[]).length>0&&c.on("scroll",(function(){for(var t=0;t<e.length;t++)FS.PostMessage.postScroll(e[t])}))},init_child:function(){a&&(this.init(r),t(window).bind("load",(function(){FS.PostMessage.postHeight(),FS.PostMessage.post("loaded")})))},hasParent:function(){return a},postHeight:function(e,s){e=e||0,s=s||"#wrap_section",this.post("height",{height:e+t(s).outerHeight(!0)})},postScroll:function(t){this.post("scroll",{top:c.scrollTop(),height:c.height()-parseFloat(p.css("paddingTop"))-parseFloat(p.css("marginTop"))},t)},post:function(t,e,s){console.debug("PostMessage.post",t),s?n.postMessage(JSON.stringify({type:t,data:e}),s.src,s.contentWindow):n.postMessage(JSON.stringify({type:t,data:e}),i,window.parent)},receive:function(t,s){console.debug("PostMessage.receive",t),e===o[t]&&(o[t]=[]),o[t].push(s)},receiveOnce:function(t,e){this.is_set(t)||this.receive(t,e)},is_set:function(t){return e!=o[t]},parent_url:function(){return i},parent_subdomain:function(){return r}})}(jQuery);
|
||||
@@ -0,0 +1,227 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1000 1000" style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.25;}
|
||||
.st1{fill:#0a4b78;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<g>
|
||||
<path class="st1" d="M934.5,517.1c5.6-1.8,11.9,0.4,15.2,5.4c0.4-7.9,0.6-15.9,0.6-23.9l-20.8,6c-0.1,5.7-0.2,11.4-0.5,17.1
|
||||
C930.2,519.6,931.8,518,934.5,517.1z"/>
|
||||
<polygon class="st1" points="912.1,649.8 914,648.9 912,649.7 "/>
|
||||
<path class="st1" d="M367.4,908.8c9.3,4.4,17.9-0.1,26.7-1c3.8-0.4,7.5-0.8,11.3-1.2c2.9-0.3,5.8-0.5,8.7-0.8
|
||||
c-44.2-10.7-86.3-28.6-124.5-52.6l-1.6,4.5c0,0-0.1,0-0.1,0c-1-0.4-1.8-1-2.5-1.9l2.2-1.9l1.3-1.1c-50.6-32-94.5-75-127.8-126.7
|
||||
l-20.8,6C193,816.6,272.6,879.4,364,912.4C365.1,911.2,366.2,910,367.4,908.8z"/>
|
||||
<path class="st1" d="M754.9,859.2c-0.4-2,0.1-4.3,0.4-8.3c3.6,2.4,6.1,3.3,7.3,5c0.8,1,1.1,2.1,1,3.1
|
||||
c39.3-27.6,73.4-61.1,101.3-99.1c-3.3-0.3-6.6-2.1-7.6-4.7c-1.4-3.5,1.1-9.2,4.7-10.6c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c0.1,0.1,0.1,0.2,0.2,0.4
|
||||
c37.1-53.7,62.1-115.5,72.5-180.6c-0.7-0.3-1.3-0.5-1.7-1c-0.8-0.9-0.4-2,0.6-2.6c0.5-0.3,1.1-0.3,1.6-0.2
|
||||
c0.4-2.7,0.8-5.4,1.1-8.1c-0.5,0.7-1.3,1.2-2.1,1.6c-2.4,1.1-7.2-0.8-8.5-3.5c-1.3-2.6,0.3-6.2,3.3-7.5c3.1-1.3,6.3-0.3,7.8,2.6
|
||||
c0.1,0.2,0.2,0.3,0.2,0.5c0.5-4.6,1-9.2,1.4-13.8c-0.6,0.5-1.5,0.8-2.6,0.8c-3.3,2.7-7.3,1.9-10.8,2.4c-0.8,0.1-1.8-0.4-2.6-0.8
|
||||
c-1.7-0.9-3.4-2.9-4.6-5.1c-8.1,99-51.5,191.8-121,261.3c0,0,0,0,0,0.1l-0.1,0c-48.3,48.3-109.2,85.5-179.5,105.8
|
||||
c-68.4,19.7-137.7,21.1-202.7,7.2c-2.5,2.3-5.7,2.7-9,2.1c-4.9-0.9-9.2,0.1-13.4,2c-5.8,2.5-7.8,4.9-7.2,10
|
||||
c75.4,20.9,157.4,21.9,238.1-1.3c45.6-13.1,87.5-33.1,124.7-58.3C756.5,862.3,755.3,861,754.9,859.2z M939.8,590.7
|
||||
c-1.6-0.3-2.5-0.5-3.6-0.8C938,588.5,938,588.5,939.8,590.7z M929.9,614.7c0.4,0.1,0.9,0.1,1.2,0.3c0.2,0.2,0.1,0.7,0.1,1.4
|
||||
c-0.7-0.3-1.3-0.3-1.4-0.6C929.7,615.5,929.9,615.1,929.9,614.7z M909.1,644.6l0.3-0.2l0.4-0.1c2.5-0.6,4.8,0.2,6.2,2.2
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0v0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1v0
|
||||
c0,0.1,0.1,0.1,0.1,0.2c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0.1,0.2l-2.8,1.2l0.1,0l-2,0.9l0,0
|
||||
c-0.2,0.1-0.3,0.3-0.4,0.3l-0.1-0.1l-0.1,0c0,0,0.1,0,0.1,0.1c0,0-0.1,0-0.2,0l0,0l-0.1-0.4l-4.1-3.5
|
||||
C907.7,645.6,908.3,645,909.1,644.6z M791.2,818.1c0.8-0.6,2.7-0.1,3.8,0.5c0.5,0.3,0.7,2.7,0.1,3.1c-0.9,0.7-2.4,0.5-4.5,0.9
|
||||
C790.8,820.5,790.5,818.6,791.2,818.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M450.7,717.7c-0.4,0.1-0.7,0.7-1,1.1c0.6,0.4,1.2,0.7,1.9,1.1c0.2-0.5,0.4-1,0.6-1.4
|
||||
C451.6,718.2,451,717.7,450.7,717.7z"/>
|
||||
<path class="st1" d="M515.3,737.8L490.2,726l-1.7-27.7l-19,20.2l-5.9-1.5c3.3,8,1,16.8-5.1,19c-1,0.4-2,0.6-3.1,0.7l-13.2,20.7
|
||||
c0.1,0.3,0.1,0.7,0.1,1c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0,0l-0.7-0.1l-0.5,0.8l27.3-5.2l17.6,21.4l3.5-27.5L515.3,737.8z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st1" points="570.2,694.7 570.2,694.7 568.1,695.7 "/>
|
||||
<path class="st1" d="M612.1,728.8l4.5-1.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l16.8-6.6
|
||||
l-34.5-16.2l-1.3-20.9c-0.6-0.2-1.2-0.4-1.6-0.7c-2.3-1.6-2.4-4-0.5-5.7c0.5-0.5,1.1-0.7,1.6-0.8l-0.6-9.9l-26,27.6
|
||||
c0.1,0.1,0.1,0.3,0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1v0c0.2,0.8,0.1,1.7-0.2,2.5
|
||||
l-3.8-1.6l-0.6,0.2l-1,0.5l0.7-0.3l-0.7,0.3l0.7-0.3l0,0l0,0l0.3-0.1l0,0l0.5-0.2l0,0l0,0l1.2-0.5l2.1-0.9l-36.3-9.4l18.3,33.4
|
||||
l-20.5,32.1l37.4-7.1l24.2,29.4l4.8-37.8l14.4-5.7L612.1,728.8z M588.4,715.2l-4.6-3.8c0,0,0,0.1-0.1,0.1
|
||||
c-0.1,0.1-0.1,0.3-0.1,0.3c0,0,0-0.2-0.1-0.5l5.7-1.3l0,0h0c0.1,0.3,0.1,0.7,0.2,1C589.7,713.1,589.1,714.4,588.4,715.2z
|
||||
M593.2,730.4c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C594.1,729.2,593.8,729.9,593.2,730.4z"
|
||||
/>
|
||||
</g>
|
||||
<path class="st1" d="M691.1,639.9l-19,20.2l-26.8-7l13.4,24.3l-14.9,23.4l27.3-5.2l0.4,0.5c0.2-1.6,0.7-3.5,1-6
|
||||
c3.9,1.8,6.8,2.2,8.4,3.9c2.2,2.3,0.8,6.4-2.1,7.6c-0.8,0.3-1.5,0.5-2.2,0.5l12.3,14.9l3.5-27.5l25.8-10.1l-25.1-11.8L691.1,639.9z
|
||||
M685.1,654.4l0.4,0.5l-0.2-0.2l0.2,0.2L685.1,654.4l-0.1,0l0.5,0.5c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0l-0.6-0.5l-0.3,0.1l-0.2-0.5
|
||||
l-3.4-2.9c0.2-0.2,0.4-0.4,0.6-0.6c0,0,0.1-0.1,0.1-0.1l0.6-0.6l0.5-0.2c2.8-1,5.3,0.1,6.5,2.6c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0.1,0.1,0.1,0.3,0.2,0.5L685.1,654.4z"/>
|
||||
<path class="st1" d="M75.3,605.9l6.9,23.9l18-5.2l9.6,33.4c-4.2,2.4-8.5,4.3-12.9,5.5c-8.3,2.4-15.9-0.1-22.7-7.6
|
||||
c-6.8-7.4-12.6-19.3-17.3-35.7c-4.6-15.9-5.2-29.3-1.8-40.2c3.4-10.9,10.2-17.9,20.5-20.8c7.2-2.1,15.6-1.9,25.2,0.5l2.2-24.6
|
||||
c-12.3-2.9-24.2-2.7-35.8,0.6C48.3,541.2,35.6,552,29,568.3c-6.6,16.2-6.6,36,0.1,59.4c7,24.2,16.9,41.5,29.7,51.7
|
||||
c12.8,10.2,27.7,12.9,44.6,8.1c14.2-4.1,26.8-10.6,37.9-19.7l-21.5-74.7L75.3,605.9z M51.9,563.3c-3.6-2.2-6.2-3.1-7.6-4.9
|
||||
c-0.8-1,0.1-4.4,1.2-5.1c2.7-1.6,5.6-0.2,6.8,2.6C53,557.4,52.2,559.5,51.9,563.3z M108.3,669.5c-0.1-0.4-0.2-0.8-0.3-1.2
|
||||
c0-0.1,0.5-0.3,0.6-0.2c0.3,0.3,0.6,0.6,0.8,1C109,669.2,108.7,669.3,108.3,669.5z"/>
|
||||
<path class="st1" d="M213.9,495.8l-26.9,7.7l27.8,96.4c2.5,8.7,2.9,15.9,1.1,21.5c-1.8,5.6-5.5,9.2-11.2,10.9
|
||||
c-8.4,2.4-15.2-0.3-20.4-8.3c-3.6,2.8-7.5,4.6-12.5,5c-5.3,0.4-7.5-2-5.7-6.8c1-2.6,3-5.7,5.4-6.6c2.6-1,5.4-1.3,8.2-1.2
|
||||
c-0.5-1.4-1-3-1.5-4.6l-19.2-66.6c-1.8-0.4-3-0.4-3.9-1c-0.4-0.3-0.2-2.4,0.2-2.5c0.8-0.2,1.8-0.2,2.7,0l-7.4-25.7l-26.9,7.7
|
||||
l15.3,53.3c1.2,0.6,2.1,1.2,2.7,2c1.8,2.1,1.6,4.6-0.4,6.1l9.3,32.4c5.1,17.7,12.7,30,22.9,36.9c10.2,6.9,22.5,8.2,37,4.1
|
||||
c14.8-4.3,24.8-12.1,30-23.5c5.2-11.4,5.3-25.7,0.3-43.1L213.9,495.8z M208.1,543.9l-2.7,1c-0.4-1.1-0.7-1.4-0.7-1.4l2.6-5.3
|
||||
c2.1,1.1,3,3.2,3.6,4.7L208.1,543.9z"/>
|
||||
<path class="st1" d="M331.9,579.7l18.9,34.3l27.2-7.8l-78.2-135.7L263,481l3.2,83.2c0,0,0.1-0.1,0.1-0.1c2.6-2.9,8.6-2.7,11.9,0.3
|
||||
c3.1,2.9,3.5,9.1,0.7,11.7c-2.8,2.6-7.9,2.1-11.2-1.1c-0.4-0.4-0.8-0.8-1.1-1.3l2.5,63.8l27.1-7.8l-2.2-39.1L331.9,579.7z
|
||||
M343.3,593.3l0.2-0.1c0.7-0.1,1.5,0,2.2,0.3c0,0,0,0,0,0l0.4,0.2l0.2,0.2l-2,3.4l0.7,1.8l-0.5-1l0.1,0.3l0.2,0.8l-0.5-1.5l0-0.1
|
||||
l0-0.1l0,0.1l0,0l-0.2,0.4l-0.6,1.1l0.8-1.6l0,0l-1.8-3.8L343.3,593.3z M320.6,529.5c0.9-0.1,1.8-0.2,2.8-0.3
|
||||
c2.6-0.1,4.7,0.9,5.7,3.3c0.7,1.7,1.8,2.9,3.2,4.1c0.9,0.8,1.7,2,2.1,3.2c1.2,3.3-0.4,6.8-3.4,7.7c-4,1.3-7.9-0.3-9.3-3.9
|
||||
c-0.5-1.2-0.9-2.4-1.4-3.8c-3.3,0.5-3.3,0.4-3.7-2.2c-0.1-1-0.3-2-0.3-3.1C316.2,531.6,317.7,529.9,320.6,529.5z M283.6,623.2
|
||||
l-2,1.4l0,0l-0.4,0.3l0.4-0.3l-1.1-2.1c0,0,0,0,0,0v0c0,0,0,0,0,0l-1.4-2.7c2.4-1.3,5.3-0.5,6.8,1.7L283.6,623.2z M289.2,515
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c0.9,2.1,2.6,5.6,5.1,10.7c0.4,0.1,0.8,0.3,1.1,0.5c0.4,0.2,0.6,1.6,0.4,2.5c0.3,0.7,0.7,1.4,1.1,2.1
|
||||
c4,7.8,6.5,12.7,7.6,14.6l5.8,10.4c0.2,0,0.5,0.1,0.7,0.1c-0.1,0.3-0.1,0.6-0.2,0.8l11.2,20.2l-22.3,6.4l1,0.3l0,0.2
|
||||
c-0.2,0.6-0.4,1.2-0.7,1.6c-0.1,0.2-0.2,0.3-0.2,0.5l0,0l-3.6-1.5l-1.6,0.5c0-0.4,0-0.7-0.1-1.1l-0.2-0.1c0-0.1,0.1-0.3,0.2-0.4
|
||||
C290.9,538.3,289.8,522.1,289.2,515z M296.6,579.1c2,4.2,0.5,6.5-3.7,9C291.6,583,292.7,580.6,296.6,579.1z"/>
|
||||
<path class="st1" d="M461.4,557L461.4,557c0-0.1,0-0.1-0.1-0.2c-0.1-0.2-0.1-0.3-0.2-0.3c0,0,0-0.1,0-0.1l1.5-1.4l-28.4-34.2
|
||||
c10.3-10.9,12.8-25.5,7.5-43.9c-4.2-14.6-10.9-24.4-20.1-29.5c-9.2-5-21.3-5.4-36.3-1.1l-35.4,10.2l7.1,24.5h0
|
||||
c0.1-0.1,0.2-0.2,0.3-0.2c0.1-0.1,0.2-0.2,0.4-0.2c1.5-0.7,3.6-0.1,4.2,1.2c0.6,1.3,0.1,3.1-1.2,3.8c-0.2,0.1-0.4,0.2-0.6,0.2
|
||||
c0,0-0.1,0-0.1,0c-0.2,0-0.3,0.1-0.5,0.1c0,0,0,0,0,0c-0.4,0-0.8-0.1-1.2-0.2l5.9,20.4l2.2-0.7c0.1,0.3,0.2,0.6,0.2,0.9
|
||||
c0,0.1,0,0.2,0,0.3c0,0.2,0.1,0.4,0.1,0.6c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.2-0.1,0.3
|
||||
c0,0.2-0.1,0.3-0.1,0.5c0,0.1,0,0.1-0.1,0.2c-0.2,0.6-0.5,1.2-0.9,1.7c0,0,0,0,0,0l7.9,27.4c0,0,0,0,0,0c0.2,0,0.5,0.1,0.8,0.1
|
||||
c0,0.1-0.1,0.3-0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c-0.1,0.4-0.2,0.6-0.3,0.8l17.9,62.2l27.1-7.8l-16.3-56.6l9.7-2.8l39.3,50
|
||||
l29-8.3l-16.9-20.3L461.4,557z M367.6,465.7c-0.1-0.2-0.1-0.3-0.2-0.5c1.1-0.5,2.2-1,3.3-1.5c0.1,0.3,0.2,0.6,0.4,0.9
|
||||
C369.9,465,368.8,465.4,367.6,465.7z M388,556.7c-0.2,0.1-0.6-0.2-0.8-0.3c0.1-0.3,0.2-0.7,0.4-0.8c0.2-0.1,0.6,0.1,1,0.3
|
||||
C388.3,556.3,388.2,556.7,388,556.7z M397,585l0,0.4c0,0.2,0,0.3,0,0.5l0,5l-4.7-2.7l-1.1-0.9l0-1.5c0-0.3,0-0.7,0.1-1l0-0.3
|
||||
c0,0,0,0,0-0.1c0,0,0-0.1,0-0.1c0,0,0,0,0,0v0l3.8-0.3l0.5,0l1.5-0.1c0,0.3,0,0.6,0,0.9C397,584.8,397,584.9,397,585z M415.1,503
|
||||
c-1.7,4.4-5.8,7.5-12.2,9.4l-7,2l-11-38.1l-2,0.7l0.3,0.5l-0.6,0.3l-0.2-0.6l-0.3,0.1l-0.7-2.9l-1.1-2.1l0.5-0.3l0.5-0.1
|
||||
c0.3,0,0.6-0.1,0.8,0c0.1,0,0.2,0,0.3,0c0.1,0,0.3,0,0.4,0c0.3,0,0.7,0.1,1,0.2c0,0,0,0,0,0l6.6-1.9c6.2-1.8,11.2-1.5,15,0.8
|
||||
c3.9,2.3,6.9,7.2,9,14.6C416.6,492.8,416.8,498.6,415.1,503z M433.2,476.7c-0.5,0.3-1.5-0.3-2.3-0.6c0.2-0.7,0.5-1.5,0.8-2.6
|
||||
c1,0.5,2.2,0.8,2.2,1.1C434,475.3,433.7,476.5,433.2,476.7z M460.6,577.8l0.2,0.8l-0.1-0.4l0.1,0.4l-0.2-0.7l0,0L460.6,577.8
|
||||
L460.6,577.8L460.6,577.8l0.1,0.8L460.6,577.8l0.1,0.8l-0.2-1.1l-0.5-1.8l-0.8-2.9l0.9,2.9l-0.8-2.9c0.1,0,0.2-0.1,0.3-0.1
|
||||
c0.1,0,0.2-0.1,0.4-0.1l0.4,3l-0.3-3c1.3-0.1,2.6,0.3,3.6,1.3l-3.1,3.6L460.6,577.8z"/>
|
||||
<path class="st1" d="M506.8,529.2l37.9-10.9l18.9,34.3l27.2-7.8l-56.1-97.3l-1.6,0.3l0-0.1c-0.1-0.7-0.1-1.3-0.1-1.8
|
||||
c0-0.2,0-0.3,0-0.5l-0.1-1l-20.4-35.4l-36.7,10.6l0.8,20c0.3,0,0.5,0.1,0.9,0.2c-0.3,0.7-0.4,1.3-0.6,1.4c-0.1,0-0.1,0-0.2,0
|
||||
l1.1,27.9l2,0.4c-0.2,1.4-0.9,2.6-1.8,3.5l4,103.3l27.1-7.8L506.8,529.2z M526.4,522.7c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6
|
||||
c0.2,0,0.5,0,0.6,0.1C526.5,522.2,526.4,522.5,526.4,522.7z M541.7,492c-0.2-0.3-0.4-0.7-0.6-1c0.1,0,0.2-0.1,0.2-0.1
|
||||
c0.3,0.3,0.5,0.6,0.8,0.9C541.9,491.8,541.8,491.9,541.7,492z M549.5,490.8c1.4-0.7,3.8,0.1,4.6,1.5c0.7,1.3,0,3.4-1.4,4.1
|
||||
c-1.4,0.7-3.6,0.1-4.4-1.1C547.5,494,548.2,491.5,549.5,490.8z M539.3,479.9c0.1-0.1,0.1-0.2,0.2-0.4c0,0,0-0.1,0.1-0.1
|
||||
c0.1-0.1,0.2-0.3,0.2-0.4c0,0,0,0,0,0l5.4,2.5c0,0,0,0,0,0l0,0c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.2-0.2,0.3l-0.2,0.3
|
||||
l-2.6-1.4L539.3,479.9L539.3,479.9z M524.3,439.5c0.6-0.4,1.8-0.2,2.7,0c0.3,0.1,0.6,1.6,0.3,1.9c-0.5,0.6-1.5,0.7-3.1,1.4
|
||||
C524.2,441.1,523.9,439.8,524.3,439.5z M517.7,458.9c1.8-3.1,4.7-4.4,8.3-4.3c3.3,0.1,5.3,2.4,6.9,4.8c1.3,1.9,0.4,3.9,0.1,6.1
|
||||
c-2.2,0-3.8,0.3-5.3,2.2c-1.8,2.2-6.2,1.8-8.3,0C517.2,465.8,516.3,461.3,517.7,458.9z M484.4,473.7c-0.2-0.1-0.4-0.3-0.5-0.4
|
||||
c-0.1-0.1,0.1-0.3,0.2-0.5c0.3,0.2,0.5,0.4,0.8,0.6C484.7,473.6,484.5,473.8,484.4,473.7z M492.7,472c-1.5,0.9-4,0.3-4.5-1.2
|
||||
c-0.3-0.8,0.3-1.7,0.3-2.2c2.1-1.1,4.5-0.6,5.1,0.8C494.2,470.7,493.7,471.5,492.7,472z M505.3,503.7c-1.5-26.1-2.6-42.8-3.2-50
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c1.1,2.7,3.7,7.9,7.7,15.7c4,7.8,6.5,12.7,7.6,14.6l5.5,9.9c1-0.1,2,0.3,2.3,1.1
|
||||
c0.2,0.5-0.2,1.1-0.3,1.5c-0.1,0.1-0.3,0.2-0.5,0.2l10.5,18.9l-21.2,6.1c0.7,0.2,1.3,0.4,1.9,0.8c0,0,0,0,0,0l0,0
|
||||
c1.1,0.7,1.8,1.8,2.1,3.2c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.2,0.1,0.3c0,0.3,0.1,0.5,0.1,0.8l-2.9,0.1l-1,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3c-0.1,0.1-0.3,0.3-0.4,0.4l-1.1-0.6l-0.2,0l0,0l-0.1,0l0,0l0.1,0v-0.1l-3.9-2.3c0,0,0,0,0-0.1
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.1-0.2,0.3-0.4,0.4-0.6c0,0,0,0,0,0l0,0c0.2-0.3,0.5-0.6,0.7-0.8c0.1-0.1,0.1-0.1,0.2-0.2L505.3,503.7z"
|
||||
/>
|
||||
<path class="st1" d="M671.8,476.8l-1.1,0.3l-74.7-91.5l-33.3,9.6l41.9,145.6l14.4-4.1c0.4-3.8,3.2-5.3,8.3-6.2
|
||||
c-0.2,1.6-0.5,3-1,4.1l3.4-1L606.9,454c-2.7-9.2-6-17.6-9.9-25.2l1.3-0.4l75.4,92.5l11.4-3.3l-0.5-1.5c0.1,0,0.1,0,0.2-0.1
|
||||
c0.2-0.1,0.2-0.5,0.1-0.8c-0.1-0.1-0.1-0.2-0.2-0.2c0,0,0,0,0,0l2.9-5.1c1.1,0.7,2,1.7,2.6,3.1l0.1,0.3l0.1,0.3
|
||||
c0.2,0.8,0.3,1.6,0.2,2.3l16-4.6l-11.6-40.2c-0.6,1.1-1.6,1.9-2.9,2.3h0c0,0-0.1,0-0.2,0c-0.1,0-0.2,0-0.3,0.1l-1-4.9l-0.2-1l0,0
|
||||
c-0.2,0-0.3,0.1-0.4,0.2c0,0,0,0-0.1,0c-0.1,0.1-0.1,0.1-0.1,0.2c0,0,0-0.1,0-0.2l0.2-13.4l-25.6-88.7l-24.9,7.2l22.9,79.5
|
||||
C665.6,462.1,668.6,470.2,671.8,476.8z M593.5,469.2c-0.2-0.1-0.5-0.1-0.6-0.2c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6-0.1
|
||||
C593.5,468.6,593.5,468.9,593.5,469.2z M600.9,412.4l-0.8-2.9l-0.8-2.9l0.8,2.9l0.8,2.9L600.9,412.4z M604.6,409.2L604.6,409.2
|
||||
C604.6,409.2,604.6,409.2,604.6,409.2c-0.7,1.6-1.9,2.7-3.6,3.2l-0.9-2.9l-0.8-2.9c0,0,0-0.2,0-0.5c-0.2-0.9-0.6-1.2-0.9-1.4
|
||||
c-0.1,0-0.2-0.1-0.2-0.1l1.7-5.7c0,0,0,0,0.1,0c2.6,0.9,4.5,3.1,5.2,6.2l0.1,0.5C605.3,406.9,605.1,408.1,604.6,409.2z M624,439.8
|
||||
c-2.9,1.3-7-0.3-8.6-3.3c-1.3-2.5,0.2-7,2.9-8.2c3.1-1.4,8.3,0.8,9.9,4.2C628.9,434.2,626.4,438.8,624,439.8z M647.4,473.3
|
||||
c-0.5,0.7-1.9,1.2-2.6,0.9c-2.7-0.9-5.2-2-6.2-5.4c1-0.7,1.9-1.5,3-1.9c1.5-0.6,2.9-0.4,4,1.1c0.6,0.8,1.4,1.6,1.8,2.6
|
||||
C647.6,471.4,647.8,472.7,647.4,473.3z M649.3,467.9c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6,0.1
|
||||
C649.3,467.6,649.3,467.8,649.3,467.9z M656.6,464.8C656.6,464.8,656.6,464.8,656.6,464.8L656.6,464.8
|
||||
C656.6,464.9,656.6,464.9,656.6,464.8c-0.1,0.3-0.1,0.4-0.2,0.6l-1.8-0.8c1.2,2,0.9,2.3-1.7,2.8c0.4-0.9,0.8-1.9,1.2-3l-3.2-1.3
|
||||
l0,0c0-0.1,0-0.2-0.1-0.5c-1.4-2.1-2.2-2-2.7-1.9c-0.2,0.1-0.4,0.1-0.5,0.2l-1.2-2.7l-1.2-2.7c0.4-0.2,0.9-0.4,1.4-0.5c0,0,0,0,0,0
|
||||
c1.5-0.4,3.5-0.5,5.5,0.7c0,0,0,0,0,0c0,0,0,0,0,0c1.3,0.8,2.6,2,3.9,4l0.2,0.3l0.1,0.4C656.9,462.1,657,463.5,656.6,464.8z"/>
|
||||
<path class="st1" d="M754.7,497.6l-0.1-2.2c0.9,0,2,0.1,3.2,0.6c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.5,0.3,0.8,0.4l19.5-5.6
|
||||
L743,369.1l18-5.2c-3.3,0.2-6.5,0.5-9.7,0.7c-0.1,0-0.2,0-0.3,0c-0.5,0-1,0.1-1.5,0.1c-0.2,0-0.3,0-0.5,0c-0.5,0-0.9,0-1.4,0
|
||||
c-0.2,0-0.4,0-0.6,0c-0.7,0-1.3,0-2,0c-3.1,0-6.3-0.9-7.1-4.8c-0.6-3.2,1.8-6.4,5.9-7.5c3.9-1,7.8-1.7,12.3-2.7
|
||||
c0,0.3,0.1,0.6,0.2,0.9c0,0.1,0,0.1,0.1,0.2c0.1,0.2,0.1,0.5,0.2,0.7c0,0,0,0,0,0c1.7,3.9,6.5,6.7,4.4,12.3c0,0,0,0,0,0l9.8-2.8
|
||||
l-6.9-23.8L717,350.8l2.3,1.2c0,0,0,0,0,0h0c-0.2,0.3-0.4,0.7-0.6,1l-0.2,0.4l0,0L716,352l-0.9-0.6l-33.7,9.7l6.9,23.8l27.9-8
|
||||
l35.1,121.8L754.7,497.6z M708.8,359.6c-0.3-0.5-0.4-1.4-0.2-2c0.2-0.4,1.1-0.5,1.6-0.8c0.2,0.8,0.5,1.7,0.9,2.9
|
||||
C709.9,359.7,709,359.9,708.8,359.6z M745.1,378c0,0.2,0,0.4,0,0.5v0c-0.2,1.9-1.2,3.5-2.7,4.3c-0.1,0.1-0.3,0.1-0.4,0.2l-2.1-5.4
|
||||
v0L745.1,378L745.1,378z"/>
|
||||
<g>
|
||||
<path class="st1" d="M860.2,372.5l-35.7,10.3l-10-34.6L853,337l-6.7-23.4l-65.6,18.9l41.9,145.6l65.6-18.9l-1.6-5.7l-0.5-0.9
|
||||
l-0.4,0.5c0,0,0,0,0,0v0c-0.3-0.3-0.6-0.6-0.9-0.9c-0.1-0.1-0.3-0.3-0.4-0.4c0,0,0,0,0,0l0.3-0.4c0,0,0-0.1,0-0.1l0,0v0l0.1,0
|
||||
l0-0.1l0.8-1.1l-4.2-14.7l-38.5,11.1l-11.6-40.3l23.1-6.7c0-0.2,0-0.4,0-0.6c0.5,0.1,1.1,0.1,1.6,0.1l11.1-3.2L860.2,372.5z
|
||||
M809.4,414.7l-3.8-1.3l4.9-3.6l1.6-1l1.7,1.1l1.1,0.4l0,0.4l2.4,1.6l-2,1.5l0.2,1.7l-5.8,0.5L809.4,414.7z M815.9,447L815.9,447
|
||||
c-0.1-0.1-0.1-0.3-0.2-0.4c-0.1-0.2-0.2-0.4-0.3-0.6c0-0.1-0.1-0.2-0.1-0.2c0-0.1-0.1-0.1-0.1-0.2l1.1-0.9l1.1-1l2.2-1.9l0.1,0.2
|
||||
c0.2,0.2,0.3,0.5,0.4,0.7c0,0,0,0,0,0l0,0c0.1,0.3,0.3,0.5,0.4,0.7c0.1,0.2,0.1,0.3,0.2,0.5l0,0L815.9,447z"/>
|
||||
<path class="st1" d="M884.7,451.3l0.6-0.1l-0.2-0.3C885,451,884.8,451.1,884.7,451.3z"/>
|
||||
</g>
|
||||
<polygon class="st1" points="969.2,410.2 930.6,421.3 919,380.9 954.8,370.6 948,347.1 912.3,357.4 902.3,322.8 940.8,311.7
|
||||
934.1,288.3 868.5,307.2 910.4,452.8 976,433.9 "/>
|
||||
<path class="st1" d="M405.3,270.3l-0.3,0.1l21.7,10.3l1.4,22.6c0-0.3,0.1-0.6,0.2-0.8c0.4,0.1,0.9,0.1,1.2,0.3
|
||||
c0.2,0.2,0.1,0.7,0.1,1.4c-0.7-0.3-1.3-0.3-1.4-0.6c0-0.1,0-0.1-0.1-0.2l0.9,15.4l26.1-27.7l4.5,1.2c-2.6-1.4-4.5-2.3-5.7-3.8
|
||||
c-0.7-1,0.1-4.4,1.2-5.2c2.7-1.6,5.6-0.2,6.9,2.6c0.6,1.5-0.1,3.5-0.4,6.8l30.3,7.9l-6.8-12.5c-0.4,0.5-1,1-1.7,1.4
|
||||
c-2.1,0.7-4.1,0.6-6-0.8c-0.6-0.4-1.3-1.4-1.2-2c0.4-2.1,1-4.1,1.7-6c0.2-0.5,1.3-0.8,2.1-0.8c0.2,0,0.4,0,0.6,0l-7-12.8l20.5-32.1
|
||||
l-37.4,7.1l-24.2-29.4l-4.8,37.8l-35.5,13.9l12.4,5.9L405.3,270.3z M434.4,277.6c1.9-1.4,1.9-1.4,3.6,0.8
|
||||
C436.5,278.1,435.6,277.9,434.4,277.6z M444.6,256.9c-1.4-0.7-2.5-0.9-3-1.6c-0.8-0.9-0.4-2,0.6-2.6c1-0.6,2.7-0.2,2.9,0.9
|
||||
C445.2,254.5,444.8,255.4,444.6,256.9z M448.8,285.2c0.6,0.3,1.2,0.6,1.7,0.9c0.1,0.1-0.3,1.1-0.4,1.1c-0.6-0.1-1.2-0.4-1.8-0.6
|
||||
C448.5,286.3,448.6,285.9,448.8,285.2z M437.6,235.1c3.1-1.3,6.3-0.3,7.8,2.6c1.7,3.2,0.5,6.9-2.7,8.4c-2.4,1.1-7.2-0.8-8.5-3.5
|
||||
C433,240,434.6,236.3,437.6,235.1z M415.3,266c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1-0.1,0.5-0.2,1c-0.5-0.2-0.9-0.3-1.3-0.5
|
||||
C415.1,266.7,415.2,266.4,415.3,266z"/>
|
||||
<path class="st1" d="M334.6,345.9l19-20.2l26.8,7l-13.3-24.3l15-23.4l-27.2,5.2l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
L334.6,345.9z M351.1,302.9c0.8,0.9,0.6,3.2,0,4.4c-0.3,0.6-3.2,0.6-3.9-0.1c-1-1-1-2.8-1.9-5.6C348.2,302.1,350.4,302,351.1,302.9
|
||||
z M339.5,298c0.2-0.2,1.1,0.4,2.3,0.8c-0.9,0.9-1.4,1.6-2.1,1.9c-0.3,0.2-0.9-0.4-1.4-0.7C338.7,299.4,339,298.5,339.5,298z"/>
|
||||
<path class="st1" d="M568.4,269.9c0.1,0.1,0.2,0.3,0.2,0.6l14.5,3.8l-13.3-24.3l13.4-21l-1.6-0.2l2.1-0.6l1-1.5l-17.2,3.3
|
||||
c0.1,0.3,0.2,0.6,0.3,0.9c-1,0.1-1.9,0.5-2.4,0.2c-0.2-0.1-0.3-0.3-0.4-0.6l-7.6,1.4l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
l1.7,27.7l19-20.2l9,2.3C566.2,269.4,567.5,269.5,568.4,269.9z M538.7,241.2c0.9-0.7,2.1-0.3,2.5,0.7c0.3,0.6-0.1,1.5-0.2,2.9
|
||||
c-1.4-0.7-2.5-0.9-3-1.5C537.7,242.9,538.1,241.6,538.7,241.2z M541.8,246.2c-0.1,0.3-0.3,0.6-0.5,0.9c0,0,0,0,0,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3l-5.5-2.1c0.2-0.7,0.6-1.2,0.8-1.6c0.1-0.1,0.2-0.2,0.2-0.4l0,0L541.8,246.2
|
||||
C541.8,246.2,541.8,246.2,541.8,246.2z M550.9,254.1c-0.5,1.8-1.6,3.2-3,4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0h0
|
||||
c-0.3,0.1-0.5,0.3-0.8,0.4c0,0-0.1,0-0.1,0.1l-1-2.8l-0.6-2.1c0,0,0,0,0,0c0,0-0.1,0-0.1,0l0-0.4l-0.1-0.4c0,0,0.1,0,0.1-0.1v-5.1
|
||||
c4.7,0.1,5.7,3.3,5.9,5.2l0.1,0.6L550.9,254.1z M557.2,259.6c-0.2-0.3-0.4-0.6-0.6-1c-0.1-0.2-0.2-0.4-0.3-0.5c0,0,0.3,0.4,0.9,0.5
|
||||
l0.8-2.9l0.8-2.9c0.3,0.1,0.6,0.2,0.8,0.4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0l0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0l0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0v0c0,0,0,0,0,0s0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.6,0.6,0.9,1.2,1.2,1.7c0.1,0.2,0.2,0.3,0.3,0.5c0,0,0,0,0,0l-2.4,1.7L557.2,259.6z"/>
|
||||
<g>
|
||||
<path class="st1" d="M456,117.5c0.2,0.7,0.4,1.4,0.5,2c67.8-10,135-1.4,195.9,22.5c1.2-1.5,3-2.8,5.6-4c6.8-3.1,16.9-0.1,19.9,5.8
|
||||
c1.1,2.2,1.1,5.8,0.3,9.4c31.8,15.3,61.5,34.8,88.1,58.3c0.3-0.4,0.6-0.7,1.1-0.9c1.5-0.7,3.6-0.1,4.3,1.2c0.6,1.2,0.1,2.9-1,3.6
|
||||
c16,14.5,30.8,30.4,44.3,47.6l12-3.5C768,182.5,682.6,129.8,588.2,111.3c0.2,0.1,0.3,0.3,0.5,0.4c2.2,2.3,0.8,6.4-2.1,7.6
|
||||
c-3.1,1.3-6,0.2-7.1-2.7c-0.6-1.8,0-3.9,0.5-6.9c-42.3-7.4-86.2-8-130.3-0.9C452.7,111.5,455,114.4,456,117.5z M685.1,144.4
|
||||
c0.7,0.2,1.7,0.2,2,0.6c0.3,0.5,0,1.3-0.1,2.4c-1-0.4-1.9-0.5-2-0.9C684.7,145.8,685,145.1,685.1,144.4z M537.6,107
|
||||
c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1,0,0.6-0.1,0.6c-0.4,0.1-0.9,0-1.3,0C537.5,107.8,537.5,107.4,537.6,107z"/>
|
||||
<path class="st1" d="M129.9,456c-3.2-3.1-4.6-13.5-2.1-16.3c1.1-1.3,2.9-2,4.9-2.2c7.3-44.3,22.4-86.8,44.1-125.5
|
||||
c-1-0.1-1.8-0.3-2.5-0.7c-2.3-1.3-2.7-3.7-0.9-5.7c1.8-1.9,4.3-2,6-0.1c0.2,0.3,0.4,0.6,0.6,1c48.1-82.5,126.7-147.3,225.6-175.8
|
||||
c15-4.3,30.1-7.7,45.1-10.1c-0.1-0.4-0.2-0.7-0.3-1.1c-0.9-2.9-4.4-6.3-8.9-9.1c-13.1,2.4-26.1,5.4-39.1,9.2
|
||||
c-84.3,24.3-154.3,74.2-204,138.8l1,0.5c-0.1,0.3-0.3,0.6-0.4,0.9c-0.8,1.6-1.7,3.1-2.8,4.4c-0.7,0.9-1.5,1.7-2.3,2.5c0,0,0,0,0,0
|
||||
l-0.9-1c-42.3,57.6-68.8,126.2-75.4,198.5l12-3.5c0.2-1.5,0.3-2.9,0.5-4.4C130,456.1,129.9,456.1,129.9,456z M134.9,403.2l1.8,1.9
|
||||
v0l-2.1,2l-2.1,2l-1.8-1.9L134.9,403.2z"/>
|
||||
</g>
|
||||
<path class="st1" d="M725.5,833.5c0.1,0,0.1,0,0.2,0c0.5-0.3,1-0.7,1.5-1l-2.8-0.7c0.7-2.9,1.1-5.9,1.4-8.9l5.8,0.7
|
||||
c-0.2,2.3-0.5,4.5-0.9,6.7c107.4-71,173.8-190.9,177.3-319.5l-11.7,3.4c-1.3,35-7.4,69.2-17.8,102c1.3,0,2.5,0.5,3.6,1.4
|
||||
c2.2,1.9,2.4,4.4,1.9,6.9c-0.4,2-3,4.2-5,3.8c-1.4-0.3-2.8-0.9-4-1.7C840,727,763.9,811.5,660.7,854.6c0,0.3,0,0.6,0.1,0.9
|
||||
c-0.6-0.1-1.1-0.2-1.5-0.3c-13.2,5.4-26.8,10.2-40.8,14.3c-163.7,47.2-333.3-19.4-424.3-153l-11.7,3.4
|
||||
c54.3,81.4,136.7,139.2,229.7,163.5l4.3-2.9c0.1,0.2,0.2,0.4,0.3,0.5l0-0.1l1.8,3.2l2.9,0.3l-0.6,1.1c4.4,1,8.8,2,13.2,2.9
|
||||
l-0.1-3.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.1,0,0.1,0,0.2,0c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0h0c0,0,0.1,0,0.1,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.6,0.2,0.9,0.3l0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0.6,0.3,1.1,0.7,1.5,1c0.1,0.1,0.3,0.2,0.4,0.3l0.9,0.6
|
||||
l0.3,1.1c0,0.2,0.1,0.3,0.1,0.5c58.8,11.1,121.1,8.9,182.5-8.8c37.5-10.8,72.2-26.7,103.6-46.7
|
||||
C725.4,833.7,725.5,833.5,725.5,833.5z M874.3,655.5c-3.1,2.4-4.7,2.8-7,1.7C868.9,655,870.4,654.6,874.3,655.5z M837.2,711.5
|
||||
c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2c-0.3-0.2-0.3-0.7-0.4-1.1C836.4,711.7,836.9,711.3,837.2,711.5z M407.5,874.8
|
||||
c0,0.3,0,0.6,0,0.9c0,0.2,0,0.3,0,0.5l-5.8,0.5v0c0-0.1,0-0.1,0-0.2c-0.1-0.7,0-1.4,0-2l0-0.5v0l0,0l5.8,0.4L407.5,874.8z
|
||||
M473.8,885.7l1.9,2.3c-0.5,0.4-0.8,0.8-0.9,1.3l-5.5-2.1c0.1-0.2,0.2-0.4,0.3-0.7c0,0,0,0,0,0v0c0.5-1.2,1.3-2.3,2.4-3.2l0.1-0.1
|
||||
L473.8,885.7l1.9,2.3L473.8,885.7l-1.9-2.3L473.8,885.7z"/>
|
||||
<path class="st1" d="M396.5,98.9c131.9-38,267.3-8,368.7,69.2c0.7-2.6,2.5-5,4.7-5.9c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c1.8,3.8,0.5,8.7-2.9,10.3c-0.2,0.1-0.5,0.2-0.8,0.3
|
||||
c5.8,4.7,11.5,9.7,17,14.7c0.9-2.2,2.4-4.1,4.1-5.9c1-1.1,2.1-1.5,3.6-1.5c5.2,0.1,5.5,0.3,7.2,5.4c0.1,0.3,0.4,0.6,0.5,0.9
|
||||
c0.2,0,0.4,0,0.6,0c-0.1-0.9-0.2-1.9-0.3-2.9c3,1.2,4.5,3.8,3.7,6.8c-0.1,0.3-0.2,0.5-0.3,0.8c2-0.7,4-1.8,6.3-2.7
|
||||
c1,3.4,2.3,6.2,2.4,9c0.2,5.4-3.5,8.1-9.1,7.1c-0.5-0.1-1-0.2-1.5-0.3c13.6,13.9,26.3,28.9,38,44.8l21.1-6.1
|
||||
C780.5,120.4,628.1,48.7,470.7,63.8c1.9,2.3,2,5.6,0.2,7.4c-2.5,2.4-7.9,2-10.5-0.8c-1.6-1.7-2.2-3.6-1.9-5.3
|
||||
c-22.5,2.8-45.1,7.4-67.7,13.9c-11,3.2-21.8,6.7-32.3,10.7c0.1,1,0,2.1,0.2,3c-1.6,0-3.2,0-5.6,0c0-0.3,0-0.6-0.1-0.9
|
||||
C227.1,140.7,135,243,95.4,364.7c1.4-0.5,2.9,0.2,3.9,1.7c0.9,1.5,1.2,3.4,2.2,6.7c-3.4-0.9-5.5-0.9-7-1.9
|
||||
c-0.4-0.3-0.7-0.6-0.9-0.9c-5.4,17.4-9.7,35.1-12.9,53.2l0.3-0.5l-0.3,0.6c0,0.1,0,0.1,0,0.2L81,423l0.2,0.1
|
||||
c0.5,0.4,0.9,0.8,1.3,1.3c0.7,0.9,1.1,2,1.4,3.4l0.1,0.5c0,1.7-0.3,3.2-1.1,4.3l-3.5-2.3c-2.4,15.2-4.1,30.5-5,46l21.1-6.1
|
||||
C107.7,300.7,223.5,148.7,396.5,98.9z M749.4,142.3c0.2-1.2,1.4-1.3,2.5-1.2c1.2,0.1,2.3,0.3,4,0.4c-1.1,1.1-1.8,2.4-3,3.1
|
||||
c-0.6,0.4-2,0.1-2.8-0.3C749.6,144.1,749.3,142.9,749.4,142.3z M745.2,129.2c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2
|
||||
c-0.3-0.2-0.3-0.7-0.4-1.1C744.4,129.3,744.9,129,745.2,129.2z M723.5,130.8c1.2-0.5,3.1,0.2,3.6,1.3c0.5,1-0.8,3.4-2,3.8
|
||||
c-1.4,0.4-2.2-0.4-2.8-1.5C721.4,133.1,722.1,131.3,723.5,130.8z M673,99.4c0.7-0.2,1.6,0.2,3,0.5c-0.6,1.4-0.8,2.4-1.4,3
|
||||
c-0.6,0.6-2.2,0-2.5-1C671.6,100.8,671.8,99.7,673,99.4z M571.9,68.8l0-1l0.2,0c0.3,0,0.5,0,0.6,0c0,0,0,0,0,0l0,0.8l2.6-0.5
|
||||
l-2.6,0.6l0,0l2.6-0.5l0,0c0.1,0.4,0.1,0.7,0.2,1.1v0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0.3,0,0.5,0.1,0.8l0.3,3.7l-3.5-0.1l-0.2-3
|
||||
l0.1,3c-0.2,0-0.4,0-0.5,0l-0.1,0l0.1-2.9l-2,0.1l0,0l0,0l0-0.5c0-0.5-0.1-0.9-0.1-1.3L571.9,68.8L571.9,68.8l-2.2,0.4L571.9,68.8z
|
||||
M230.9,174.4l1.8-0.4l-0.2-0.5c0,0,0,0,0,0c0.1,0,0.2-0.1,0.2-0.1c0,0,0.1,0,0.1,0h0l0.3,0.5l0.4-0.1l0,0l0.3-0.1l-0.3,0.1l0,0.7
|
||||
l2.3,4c-0.3,0.2-0.7,0.4-1.1,0.6l-0.5,0.2l-0.5,0c-2.8,0.1-5-1.5-5.7-4.1c0-0.1-0.1-0.2-0.1-0.3L230.9,174.4z M91.5,418.1
|
||||
c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C92.4,416.9,92.1,417.7,91.5,418.1z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
@@ -0,0 +1,227 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1000 1000" style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.25;}
|
||||
.st1{fill:#902af5;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<g>
|
||||
<path class="st1" d="M934.5,517.1c5.6-1.8,11.9,0.4,15.2,5.4c0.4-7.9,0.6-15.9,0.6-23.9l-20.8,6c-0.1,5.7-0.2,11.4-0.5,17.1
|
||||
C930.2,519.6,931.8,518,934.5,517.1z"/>
|
||||
<polygon class="st1" points="912.1,649.8 914,648.9 912,649.7 "/>
|
||||
<path class="st1" d="M367.4,908.8c9.3,4.4,17.9-0.1,26.7-1c3.8-0.4,7.5-0.8,11.3-1.2c2.9-0.3,5.8-0.5,8.7-0.8
|
||||
c-44.2-10.7-86.3-28.6-124.5-52.6l-1.6,4.5c0,0-0.1,0-0.1,0c-1-0.4-1.8-1-2.5-1.9l2.2-1.9l1.3-1.1c-50.6-32-94.5-75-127.8-126.7
|
||||
l-20.8,6C193,816.6,272.6,879.4,364,912.4C365.1,911.2,366.2,910,367.4,908.8z"/>
|
||||
<path class="st1" d="M754.9,859.2c-0.4-2,0.1-4.3,0.4-8.3c3.6,2.4,6.1,3.3,7.3,5c0.8,1,1.1,2.1,1,3.1
|
||||
c39.3-27.6,73.4-61.1,101.3-99.1c-3.3-0.3-6.6-2.1-7.6-4.7c-1.4-3.5,1.1-9.2,4.7-10.6c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c0.1,0.1,0.1,0.2,0.2,0.4
|
||||
c37.1-53.7,62.1-115.5,72.5-180.6c-0.7-0.3-1.3-0.5-1.7-1c-0.8-0.9-0.4-2,0.6-2.6c0.5-0.3,1.1-0.3,1.6-0.2
|
||||
c0.4-2.7,0.8-5.4,1.1-8.1c-0.5,0.7-1.3,1.2-2.1,1.6c-2.4,1.1-7.2-0.8-8.5-3.5c-1.3-2.6,0.3-6.2,3.3-7.5c3.1-1.3,6.3-0.3,7.8,2.6
|
||||
c0.1,0.2,0.2,0.3,0.2,0.5c0.5-4.6,1-9.2,1.4-13.8c-0.6,0.5-1.5,0.8-2.6,0.8c-3.3,2.7-7.3,1.9-10.8,2.4c-0.8,0.1-1.8-0.4-2.6-0.8
|
||||
c-1.7-0.9-3.4-2.9-4.6-5.1c-8.1,99-51.5,191.8-121,261.3c0,0,0,0,0,0.1l-0.1,0c-48.3,48.3-109.2,85.5-179.5,105.8
|
||||
c-68.4,19.7-137.7,21.1-202.7,7.2c-2.5,2.3-5.7,2.7-9,2.1c-4.9-0.9-9.2,0.1-13.4,2c-5.8,2.5-7.8,4.9-7.2,10
|
||||
c75.4,20.9,157.4,21.9,238.1-1.3c45.6-13.1,87.5-33.1,124.7-58.3C756.5,862.3,755.3,861,754.9,859.2z M939.8,590.7
|
||||
c-1.6-0.3-2.5-0.5-3.6-0.8C938,588.5,938,588.5,939.8,590.7z M929.9,614.7c0.4,0.1,0.9,0.1,1.2,0.3c0.2,0.2,0.1,0.7,0.1,1.4
|
||||
c-0.7-0.3-1.3-0.3-1.4-0.6C929.7,615.5,929.9,615.1,929.9,614.7z M909.1,644.6l0.3-0.2l0.4-0.1c2.5-0.6,4.8,0.2,6.2,2.2
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0v0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1v0
|
||||
c0,0.1,0.1,0.1,0.1,0.2c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0.1,0.2l-2.8,1.2l0.1,0l-2,0.9l0,0
|
||||
c-0.2,0.1-0.3,0.3-0.4,0.3l-0.1-0.1l-0.1,0c0,0,0.1,0,0.1,0.1c0,0-0.1,0-0.2,0l0,0l-0.1-0.4l-4.1-3.5
|
||||
C907.7,645.6,908.3,645,909.1,644.6z M791.2,818.1c0.8-0.6,2.7-0.1,3.8,0.5c0.5,0.3,0.7,2.7,0.1,3.1c-0.9,0.7-2.4,0.5-4.5,0.9
|
||||
C790.8,820.5,790.5,818.6,791.2,818.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M450.7,717.7c-0.4,0.1-0.7,0.7-1,1.1c0.6,0.4,1.2,0.7,1.9,1.1c0.2-0.5,0.4-1,0.6-1.4
|
||||
C451.6,718.2,451,717.7,450.7,717.7z"/>
|
||||
<path class="st1" d="M515.3,737.8L490.2,726l-1.7-27.7l-19,20.2l-5.9-1.5c3.3,8,1,16.8-5.1,19c-1,0.4-2,0.6-3.1,0.7l-13.2,20.7
|
||||
c0.1,0.3,0.1,0.7,0.1,1c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0,0l-0.7-0.1l-0.5,0.8l27.3-5.2l17.6,21.4l3.5-27.5L515.3,737.8z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st1" points="570.2,694.7 570.2,694.7 568.1,695.7 "/>
|
||||
<path class="st1" d="M612.1,728.8l4.5-1.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l16.8-6.6
|
||||
l-34.5-16.2l-1.3-20.9c-0.6-0.2-1.2-0.4-1.6-0.7c-2.3-1.6-2.4-4-0.5-5.7c0.5-0.5,1.1-0.7,1.6-0.8l-0.6-9.9l-26,27.6
|
||||
c0.1,0.1,0.1,0.3,0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1v0c0.2,0.8,0.1,1.7-0.2,2.5
|
||||
l-3.8-1.6l-0.6,0.2l-1,0.5l0.7-0.3l-0.7,0.3l0.7-0.3l0,0l0,0l0.3-0.1l0,0l0.5-0.2l0,0l0,0l1.2-0.5l2.1-0.9l-36.3-9.4l18.3,33.4
|
||||
l-20.5,32.1l37.4-7.1l24.2,29.4l4.8-37.8l14.4-5.7L612.1,728.8z M588.4,715.2l-4.6-3.8c0,0,0,0.1-0.1,0.1
|
||||
c-0.1,0.1-0.1,0.3-0.1,0.3c0,0,0-0.2-0.1-0.5l5.7-1.3l0,0h0c0.1,0.3,0.1,0.7,0.2,1C589.7,713.1,589.1,714.4,588.4,715.2z
|
||||
M593.2,730.4c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C594.1,729.2,593.8,729.9,593.2,730.4z"
|
||||
/>
|
||||
</g>
|
||||
<path class="st1" d="M691.1,639.9l-19,20.2l-26.8-7l13.4,24.3l-14.9,23.4l27.3-5.2l0.4,0.5c0.2-1.6,0.7-3.5,1-6
|
||||
c3.9,1.8,6.8,2.2,8.4,3.9c2.2,2.3,0.8,6.4-2.1,7.6c-0.8,0.3-1.5,0.5-2.2,0.5l12.3,14.9l3.5-27.5l25.8-10.1l-25.1-11.8L691.1,639.9z
|
||||
M685.1,654.4l0.4,0.5l-0.2-0.2l0.2,0.2L685.1,654.4l-0.1,0l0.5,0.5c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0l-0.6-0.5l-0.3,0.1l-0.2-0.5
|
||||
l-3.4-2.9c0.2-0.2,0.4-0.4,0.6-0.6c0,0,0.1-0.1,0.1-0.1l0.6-0.6l0.5-0.2c2.8-1,5.3,0.1,6.5,2.6c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0.1,0.1,0.1,0.3,0.2,0.5L685.1,654.4z"/>
|
||||
<path class="st1" d="M75.3,605.9l6.9,23.9l18-5.2l9.6,33.4c-4.2,2.4-8.5,4.3-12.9,5.5c-8.3,2.4-15.9-0.1-22.7-7.6
|
||||
c-6.8-7.4-12.6-19.3-17.3-35.7c-4.6-15.9-5.2-29.3-1.8-40.2c3.4-10.9,10.2-17.9,20.5-20.8c7.2-2.1,15.6-1.9,25.2,0.5l2.2-24.6
|
||||
c-12.3-2.9-24.2-2.7-35.8,0.6C48.3,541.2,35.6,552,29,568.3c-6.6,16.2-6.6,36,0.1,59.4c7,24.2,16.9,41.5,29.7,51.7
|
||||
c12.8,10.2,27.7,12.9,44.6,8.1c14.2-4.1,26.8-10.6,37.9-19.7l-21.5-74.7L75.3,605.9z M51.9,563.3c-3.6-2.2-6.2-3.1-7.6-4.9
|
||||
c-0.8-1,0.1-4.4,1.2-5.1c2.7-1.6,5.6-0.2,6.8,2.6C53,557.4,52.2,559.5,51.9,563.3z M108.3,669.5c-0.1-0.4-0.2-0.8-0.3-1.2
|
||||
c0-0.1,0.5-0.3,0.6-0.2c0.3,0.3,0.6,0.6,0.8,1C109,669.2,108.7,669.3,108.3,669.5z"/>
|
||||
<path class="st1" d="M213.9,495.8l-26.9,7.7l27.8,96.4c2.5,8.7,2.9,15.9,1.1,21.5c-1.8,5.6-5.5,9.2-11.2,10.9
|
||||
c-8.4,2.4-15.2-0.3-20.4-8.3c-3.6,2.8-7.5,4.6-12.5,5c-5.3,0.4-7.5-2-5.7-6.8c1-2.6,3-5.7,5.4-6.6c2.6-1,5.4-1.3,8.2-1.2
|
||||
c-0.5-1.4-1-3-1.5-4.6l-19.2-66.6c-1.8-0.4-3-0.4-3.9-1c-0.4-0.3-0.2-2.4,0.2-2.5c0.8-0.2,1.8-0.2,2.7,0l-7.4-25.7l-26.9,7.7
|
||||
l15.3,53.3c1.2,0.6,2.1,1.2,2.7,2c1.8,2.1,1.6,4.6-0.4,6.1l9.3,32.4c5.1,17.7,12.7,30,22.9,36.9c10.2,6.9,22.5,8.2,37,4.1
|
||||
c14.8-4.3,24.8-12.1,30-23.5c5.2-11.4,5.3-25.7,0.3-43.1L213.9,495.8z M208.1,543.9l-2.7,1c-0.4-1.1-0.7-1.4-0.7-1.4l2.6-5.3
|
||||
c2.1,1.1,3,3.2,3.6,4.7L208.1,543.9z"/>
|
||||
<path class="st1" d="M331.9,579.7l18.9,34.3l27.2-7.8l-78.2-135.7L263,481l3.2,83.2c0,0,0.1-0.1,0.1-0.1c2.6-2.9,8.6-2.7,11.9,0.3
|
||||
c3.1,2.9,3.5,9.1,0.7,11.7c-2.8,2.6-7.9,2.1-11.2-1.1c-0.4-0.4-0.8-0.8-1.1-1.3l2.5,63.8l27.1-7.8l-2.2-39.1L331.9,579.7z
|
||||
M343.3,593.3l0.2-0.1c0.7-0.1,1.5,0,2.2,0.3c0,0,0,0,0,0l0.4,0.2l0.2,0.2l-2,3.4l0.7,1.8l-0.5-1l0.1,0.3l0.2,0.8l-0.5-1.5l0-0.1
|
||||
l0-0.1l0,0.1l0,0l-0.2,0.4l-0.6,1.1l0.8-1.6l0,0l-1.8-3.8L343.3,593.3z M320.6,529.5c0.9-0.1,1.8-0.2,2.8-0.3
|
||||
c2.6-0.1,4.7,0.9,5.7,3.3c0.7,1.7,1.8,2.9,3.2,4.1c0.9,0.8,1.7,2,2.1,3.2c1.2,3.3-0.4,6.8-3.4,7.7c-4,1.3-7.9-0.3-9.3-3.9
|
||||
c-0.5-1.2-0.9-2.4-1.4-3.8c-3.3,0.5-3.3,0.4-3.7-2.2c-0.1-1-0.3-2-0.3-3.1C316.2,531.6,317.7,529.9,320.6,529.5z M283.6,623.2
|
||||
l-2,1.4l0,0l-0.4,0.3l0.4-0.3l-1.1-2.1c0,0,0,0,0,0v0c0,0,0,0,0,0l-1.4-2.7c2.4-1.3,5.3-0.5,6.8,1.7L283.6,623.2z M289.2,515
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c0.9,2.1,2.6,5.6,5.1,10.7c0.4,0.1,0.8,0.3,1.1,0.5c0.4,0.2,0.6,1.6,0.4,2.5c0.3,0.7,0.7,1.4,1.1,2.1
|
||||
c4,7.8,6.5,12.7,7.6,14.6l5.8,10.4c0.2,0,0.5,0.1,0.7,0.1c-0.1,0.3-0.1,0.6-0.2,0.8l11.2,20.2l-22.3,6.4l1,0.3l0,0.2
|
||||
c-0.2,0.6-0.4,1.2-0.7,1.6c-0.1,0.2-0.2,0.3-0.2,0.5l0,0l-3.6-1.5l-1.6,0.5c0-0.4,0-0.7-0.1-1.1l-0.2-0.1c0-0.1,0.1-0.3,0.2-0.4
|
||||
C290.9,538.3,289.8,522.1,289.2,515z M296.6,579.1c2,4.2,0.5,6.5-3.7,9C291.6,583,292.7,580.6,296.6,579.1z"/>
|
||||
<path class="st1" d="M461.4,557L461.4,557c0-0.1,0-0.1-0.1-0.2c-0.1-0.2-0.1-0.3-0.2-0.3c0,0,0-0.1,0-0.1l1.5-1.4l-28.4-34.2
|
||||
c10.3-10.9,12.8-25.5,7.5-43.9c-4.2-14.6-10.9-24.4-20.1-29.5c-9.2-5-21.3-5.4-36.3-1.1l-35.4,10.2l7.1,24.5h0
|
||||
c0.1-0.1,0.2-0.2,0.3-0.2c0.1-0.1,0.2-0.2,0.4-0.2c1.5-0.7,3.6-0.1,4.2,1.2c0.6,1.3,0.1,3.1-1.2,3.8c-0.2,0.1-0.4,0.2-0.6,0.2
|
||||
c0,0-0.1,0-0.1,0c-0.2,0-0.3,0.1-0.5,0.1c0,0,0,0,0,0c-0.4,0-0.8-0.1-1.2-0.2l5.9,20.4l2.2-0.7c0.1,0.3,0.2,0.6,0.2,0.9
|
||||
c0,0.1,0,0.2,0,0.3c0,0.2,0.1,0.4,0.1,0.6c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.2-0.1,0.3
|
||||
c0,0.2-0.1,0.3-0.1,0.5c0,0.1,0,0.1-0.1,0.2c-0.2,0.6-0.5,1.2-0.9,1.7c0,0,0,0,0,0l7.9,27.4c0,0,0,0,0,0c0.2,0,0.5,0.1,0.8,0.1
|
||||
c0,0.1-0.1,0.3-0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c-0.1,0.4-0.2,0.6-0.3,0.8l17.9,62.2l27.1-7.8l-16.3-56.6l9.7-2.8l39.3,50
|
||||
l29-8.3l-16.9-20.3L461.4,557z M367.6,465.7c-0.1-0.2-0.1-0.3-0.2-0.5c1.1-0.5,2.2-1,3.3-1.5c0.1,0.3,0.2,0.6,0.4,0.9
|
||||
C369.9,465,368.8,465.4,367.6,465.7z M388,556.7c-0.2,0.1-0.6-0.2-0.8-0.3c0.1-0.3,0.2-0.7,0.4-0.8c0.2-0.1,0.6,0.1,1,0.3
|
||||
C388.3,556.3,388.2,556.7,388,556.7z M397,585l0,0.4c0,0.2,0,0.3,0,0.5l0,5l-4.7-2.7l-1.1-0.9l0-1.5c0-0.3,0-0.7,0.1-1l0-0.3
|
||||
c0,0,0,0,0-0.1c0,0,0-0.1,0-0.1c0,0,0,0,0,0v0l3.8-0.3l0.5,0l1.5-0.1c0,0.3,0,0.6,0,0.9C397,584.8,397,584.9,397,585z M415.1,503
|
||||
c-1.7,4.4-5.8,7.5-12.2,9.4l-7,2l-11-38.1l-2,0.7l0.3,0.5l-0.6,0.3l-0.2-0.6l-0.3,0.1l-0.7-2.9l-1.1-2.1l0.5-0.3l0.5-0.1
|
||||
c0.3,0,0.6-0.1,0.8,0c0.1,0,0.2,0,0.3,0c0.1,0,0.3,0,0.4,0c0.3,0,0.7,0.1,1,0.2c0,0,0,0,0,0l6.6-1.9c6.2-1.8,11.2-1.5,15,0.8
|
||||
c3.9,2.3,6.9,7.2,9,14.6C416.6,492.8,416.8,498.6,415.1,503z M433.2,476.7c-0.5,0.3-1.5-0.3-2.3-0.6c0.2-0.7,0.5-1.5,0.8-2.6
|
||||
c1,0.5,2.2,0.8,2.2,1.1C434,475.3,433.7,476.5,433.2,476.7z M460.6,577.8l0.2,0.8l-0.1-0.4l0.1,0.4l-0.2-0.7l0,0L460.6,577.8
|
||||
L460.6,577.8L460.6,577.8l0.1,0.8L460.6,577.8l0.1,0.8l-0.2-1.1l-0.5-1.8l-0.8-2.9l0.9,2.9l-0.8-2.9c0.1,0,0.2-0.1,0.3-0.1
|
||||
c0.1,0,0.2-0.1,0.4-0.1l0.4,3l-0.3-3c1.3-0.1,2.6,0.3,3.6,1.3l-3.1,3.6L460.6,577.8z"/>
|
||||
<path class="st1" d="M506.8,529.2l37.9-10.9l18.9,34.3l27.2-7.8l-56.1-97.3l-1.6,0.3l0-0.1c-0.1-0.7-0.1-1.3-0.1-1.8
|
||||
c0-0.2,0-0.3,0-0.5l-0.1-1l-20.4-35.4l-36.7,10.6l0.8,20c0.3,0,0.5,0.1,0.9,0.2c-0.3,0.7-0.4,1.3-0.6,1.4c-0.1,0-0.1,0-0.2,0
|
||||
l1.1,27.9l2,0.4c-0.2,1.4-0.9,2.6-1.8,3.5l4,103.3l27.1-7.8L506.8,529.2z M526.4,522.7c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6
|
||||
c0.2,0,0.5,0,0.6,0.1C526.5,522.2,526.4,522.5,526.4,522.7z M541.7,492c-0.2-0.3-0.4-0.7-0.6-1c0.1,0,0.2-0.1,0.2-0.1
|
||||
c0.3,0.3,0.5,0.6,0.8,0.9C541.9,491.8,541.8,491.9,541.7,492z M549.5,490.8c1.4-0.7,3.8,0.1,4.6,1.5c0.7,1.3,0,3.4-1.4,4.1
|
||||
c-1.4,0.7-3.6,0.1-4.4-1.1C547.5,494,548.2,491.5,549.5,490.8z M539.3,479.9c0.1-0.1,0.1-0.2,0.2-0.4c0,0,0-0.1,0.1-0.1
|
||||
c0.1-0.1,0.2-0.3,0.2-0.4c0,0,0,0,0,0l5.4,2.5c0,0,0,0,0,0l0,0c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.2-0.2,0.3l-0.2,0.3
|
||||
l-2.6-1.4L539.3,479.9L539.3,479.9z M524.3,439.5c0.6-0.4,1.8-0.2,2.7,0c0.3,0.1,0.6,1.6,0.3,1.9c-0.5,0.6-1.5,0.7-3.1,1.4
|
||||
C524.2,441.1,523.9,439.8,524.3,439.5z M517.7,458.9c1.8-3.1,4.7-4.4,8.3-4.3c3.3,0.1,5.3,2.4,6.9,4.8c1.3,1.9,0.4,3.9,0.1,6.1
|
||||
c-2.2,0-3.8,0.3-5.3,2.2c-1.8,2.2-6.2,1.8-8.3,0C517.2,465.8,516.3,461.3,517.7,458.9z M484.4,473.7c-0.2-0.1-0.4-0.3-0.5-0.4
|
||||
c-0.1-0.1,0.1-0.3,0.2-0.5c0.3,0.2,0.5,0.4,0.8,0.6C484.7,473.6,484.5,473.8,484.4,473.7z M492.7,472c-1.5,0.9-4,0.3-4.5-1.2
|
||||
c-0.3-0.8,0.3-1.7,0.3-2.2c2.1-1.1,4.5-0.6,5.1,0.8C494.2,470.7,493.7,471.5,492.7,472z M505.3,503.7c-1.5-26.1-2.6-42.8-3.2-50
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c1.1,2.7,3.7,7.9,7.7,15.7c4,7.8,6.5,12.7,7.6,14.6l5.5,9.9c1-0.1,2,0.3,2.3,1.1
|
||||
c0.2,0.5-0.2,1.1-0.3,1.5c-0.1,0.1-0.3,0.2-0.5,0.2l10.5,18.9l-21.2,6.1c0.7,0.2,1.3,0.4,1.9,0.8c0,0,0,0,0,0l0,0
|
||||
c1.1,0.7,1.8,1.8,2.1,3.2c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.2,0.1,0.3c0,0.3,0.1,0.5,0.1,0.8l-2.9,0.1l-1,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3c-0.1,0.1-0.3,0.3-0.4,0.4l-1.1-0.6l-0.2,0l0,0l-0.1,0l0,0l0.1,0v-0.1l-3.9-2.3c0,0,0,0,0-0.1
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.1-0.2,0.3-0.4,0.4-0.6c0,0,0,0,0,0l0,0c0.2-0.3,0.5-0.6,0.7-0.8c0.1-0.1,0.1-0.1,0.2-0.2L505.3,503.7z"
|
||||
/>
|
||||
<path class="st1" d="M671.8,476.8l-1.1,0.3l-74.7-91.5l-33.3,9.6l41.9,145.6l14.4-4.1c0.4-3.8,3.2-5.3,8.3-6.2
|
||||
c-0.2,1.6-0.5,3-1,4.1l3.4-1L606.9,454c-2.7-9.2-6-17.6-9.9-25.2l1.3-0.4l75.4,92.5l11.4-3.3l-0.5-1.5c0.1,0,0.1,0,0.2-0.1
|
||||
c0.2-0.1,0.2-0.5,0.1-0.8c-0.1-0.1-0.1-0.2-0.2-0.2c0,0,0,0,0,0l2.9-5.1c1.1,0.7,2,1.7,2.6,3.1l0.1,0.3l0.1,0.3
|
||||
c0.2,0.8,0.3,1.6,0.2,2.3l16-4.6l-11.6-40.2c-0.6,1.1-1.6,1.9-2.9,2.3h0c0,0-0.1,0-0.2,0c-0.1,0-0.2,0-0.3,0.1l-1-4.9l-0.2-1l0,0
|
||||
c-0.2,0-0.3,0.1-0.4,0.2c0,0,0,0-0.1,0c-0.1,0.1-0.1,0.1-0.1,0.2c0,0,0-0.1,0-0.2l0.2-13.4l-25.6-88.7l-24.9,7.2l22.9,79.5
|
||||
C665.6,462.1,668.6,470.2,671.8,476.8z M593.5,469.2c-0.2-0.1-0.5-0.1-0.6-0.2c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6-0.1
|
||||
C593.5,468.6,593.5,468.9,593.5,469.2z M600.9,412.4l-0.8-2.9l-0.8-2.9l0.8,2.9l0.8,2.9L600.9,412.4z M604.6,409.2L604.6,409.2
|
||||
C604.6,409.2,604.6,409.2,604.6,409.2c-0.7,1.6-1.9,2.7-3.6,3.2l-0.9-2.9l-0.8-2.9c0,0,0-0.2,0-0.5c-0.2-0.9-0.6-1.2-0.9-1.4
|
||||
c-0.1,0-0.2-0.1-0.2-0.1l1.7-5.7c0,0,0,0,0.1,0c2.6,0.9,4.5,3.1,5.2,6.2l0.1,0.5C605.3,406.9,605.1,408.1,604.6,409.2z M624,439.8
|
||||
c-2.9,1.3-7-0.3-8.6-3.3c-1.3-2.5,0.2-7,2.9-8.2c3.1-1.4,8.3,0.8,9.9,4.2C628.9,434.2,626.4,438.8,624,439.8z M647.4,473.3
|
||||
c-0.5,0.7-1.9,1.2-2.6,0.9c-2.7-0.9-5.2-2-6.2-5.4c1-0.7,1.9-1.5,3-1.9c1.5-0.6,2.9-0.4,4,1.1c0.6,0.8,1.4,1.6,1.8,2.6
|
||||
C647.6,471.4,647.8,472.7,647.4,473.3z M649.3,467.9c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6,0.1
|
||||
C649.3,467.6,649.3,467.8,649.3,467.9z M656.6,464.8C656.6,464.8,656.6,464.8,656.6,464.8L656.6,464.8
|
||||
C656.6,464.9,656.6,464.9,656.6,464.8c-0.1,0.3-0.1,0.4-0.2,0.6l-1.8-0.8c1.2,2,0.9,2.3-1.7,2.8c0.4-0.9,0.8-1.9,1.2-3l-3.2-1.3
|
||||
l0,0c0-0.1,0-0.2-0.1-0.5c-1.4-2.1-2.2-2-2.7-1.9c-0.2,0.1-0.4,0.1-0.5,0.2l-1.2-2.7l-1.2-2.7c0.4-0.2,0.9-0.4,1.4-0.5c0,0,0,0,0,0
|
||||
c1.5-0.4,3.5-0.5,5.5,0.7c0,0,0,0,0,0c0,0,0,0,0,0c1.3,0.8,2.6,2,3.9,4l0.2,0.3l0.1,0.4C656.9,462.1,657,463.5,656.6,464.8z"/>
|
||||
<path class="st1" d="M754.7,497.6l-0.1-2.2c0.9,0,2,0.1,3.2,0.6c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.5,0.3,0.8,0.4l19.5-5.6
|
||||
L743,369.1l18-5.2c-3.3,0.2-6.5,0.5-9.7,0.7c-0.1,0-0.2,0-0.3,0c-0.5,0-1,0.1-1.5,0.1c-0.2,0-0.3,0-0.5,0c-0.5,0-0.9,0-1.4,0
|
||||
c-0.2,0-0.4,0-0.6,0c-0.7,0-1.3,0-2,0c-3.1,0-6.3-0.9-7.1-4.8c-0.6-3.2,1.8-6.4,5.9-7.5c3.9-1,7.8-1.7,12.3-2.7
|
||||
c0,0.3,0.1,0.6,0.2,0.9c0,0.1,0,0.1,0.1,0.2c0.1,0.2,0.1,0.5,0.2,0.7c0,0,0,0,0,0c1.7,3.9,6.5,6.7,4.4,12.3c0,0,0,0,0,0l9.8-2.8
|
||||
l-6.9-23.8L717,350.8l2.3,1.2c0,0,0,0,0,0h0c-0.2,0.3-0.4,0.7-0.6,1l-0.2,0.4l0,0L716,352l-0.9-0.6l-33.7,9.7l6.9,23.8l27.9-8
|
||||
l35.1,121.8L754.7,497.6z M708.8,359.6c-0.3-0.5-0.4-1.4-0.2-2c0.2-0.4,1.1-0.5,1.6-0.8c0.2,0.8,0.5,1.7,0.9,2.9
|
||||
C709.9,359.7,709,359.9,708.8,359.6z M745.1,378c0,0.2,0,0.4,0,0.5v0c-0.2,1.9-1.2,3.5-2.7,4.3c-0.1,0.1-0.3,0.1-0.4,0.2l-2.1-5.4
|
||||
v0L745.1,378L745.1,378z"/>
|
||||
<g>
|
||||
<path class="st1" d="M860.2,372.5l-35.7,10.3l-10-34.6L853,337l-6.7-23.4l-65.6,18.9l41.9,145.6l65.6-18.9l-1.6-5.7l-0.5-0.9
|
||||
l-0.4,0.5c0,0,0,0,0,0v0c-0.3-0.3-0.6-0.6-0.9-0.9c-0.1-0.1-0.3-0.3-0.4-0.4c0,0,0,0,0,0l0.3-0.4c0,0,0-0.1,0-0.1l0,0v0l0.1,0
|
||||
l0-0.1l0.8-1.1l-4.2-14.7l-38.5,11.1l-11.6-40.3l23.1-6.7c0-0.2,0-0.4,0-0.6c0.5,0.1,1.1,0.1,1.6,0.1l11.1-3.2L860.2,372.5z
|
||||
M809.4,414.7l-3.8-1.3l4.9-3.6l1.6-1l1.7,1.1l1.1,0.4l0,0.4l2.4,1.6l-2,1.5l0.2,1.7l-5.8,0.5L809.4,414.7z M815.9,447L815.9,447
|
||||
c-0.1-0.1-0.1-0.3-0.2-0.4c-0.1-0.2-0.2-0.4-0.3-0.6c0-0.1-0.1-0.2-0.1-0.2c0-0.1-0.1-0.1-0.1-0.2l1.1-0.9l1.1-1l2.2-1.9l0.1,0.2
|
||||
c0.2,0.2,0.3,0.5,0.4,0.7c0,0,0,0,0,0l0,0c0.1,0.3,0.3,0.5,0.4,0.7c0.1,0.2,0.1,0.3,0.2,0.5l0,0L815.9,447z"/>
|
||||
<path class="st1" d="M884.7,451.3l0.6-0.1l-0.2-0.3C885,451,884.8,451.1,884.7,451.3z"/>
|
||||
</g>
|
||||
<polygon class="st1" points="969.2,410.2 930.6,421.3 919,380.9 954.8,370.6 948,347.1 912.3,357.4 902.3,322.8 940.8,311.7
|
||||
934.1,288.3 868.5,307.2 910.4,452.8 976,433.9 "/>
|
||||
<path class="st1" d="M405.3,270.3l-0.3,0.1l21.7,10.3l1.4,22.6c0-0.3,0.1-0.6,0.2-0.8c0.4,0.1,0.9,0.1,1.2,0.3
|
||||
c0.2,0.2,0.1,0.7,0.1,1.4c-0.7-0.3-1.3-0.3-1.4-0.6c0-0.1,0-0.1-0.1-0.2l0.9,15.4l26.1-27.7l4.5,1.2c-2.6-1.4-4.5-2.3-5.7-3.8
|
||||
c-0.7-1,0.1-4.4,1.2-5.2c2.7-1.6,5.6-0.2,6.9,2.6c0.6,1.5-0.1,3.5-0.4,6.8l30.3,7.9l-6.8-12.5c-0.4,0.5-1,1-1.7,1.4
|
||||
c-2.1,0.7-4.1,0.6-6-0.8c-0.6-0.4-1.3-1.4-1.2-2c0.4-2.1,1-4.1,1.7-6c0.2-0.5,1.3-0.8,2.1-0.8c0.2,0,0.4,0,0.6,0l-7-12.8l20.5-32.1
|
||||
l-37.4,7.1l-24.2-29.4l-4.8,37.8l-35.5,13.9l12.4,5.9L405.3,270.3z M434.4,277.6c1.9-1.4,1.9-1.4,3.6,0.8
|
||||
C436.5,278.1,435.6,277.9,434.4,277.6z M444.6,256.9c-1.4-0.7-2.5-0.9-3-1.6c-0.8-0.9-0.4-2,0.6-2.6c1-0.6,2.7-0.2,2.9,0.9
|
||||
C445.2,254.5,444.8,255.4,444.6,256.9z M448.8,285.2c0.6,0.3,1.2,0.6,1.7,0.9c0.1,0.1-0.3,1.1-0.4,1.1c-0.6-0.1-1.2-0.4-1.8-0.6
|
||||
C448.5,286.3,448.6,285.9,448.8,285.2z M437.6,235.1c3.1-1.3,6.3-0.3,7.8,2.6c1.7,3.2,0.5,6.9-2.7,8.4c-2.4,1.1-7.2-0.8-8.5-3.5
|
||||
C433,240,434.6,236.3,437.6,235.1z M415.3,266c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1-0.1,0.5-0.2,1c-0.5-0.2-0.9-0.3-1.3-0.5
|
||||
C415.1,266.7,415.2,266.4,415.3,266z"/>
|
||||
<path class="st1" d="M334.6,345.9l19-20.2l26.8,7l-13.3-24.3l15-23.4l-27.2,5.2l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
L334.6,345.9z M351.1,302.9c0.8,0.9,0.6,3.2,0,4.4c-0.3,0.6-3.2,0.6-3.9-0.1c-1-1-1-2.8-1.9-5.6C348.2,302.1,350.4,302,351.1,302.9
|
||||
z M339.5,298c0.2-0.2,1.1,0.4,2.3,0.8c-0.9,0.9-1.4,1.6-2.1,1.9c-0.3,0.2-0.9-0.4-1.4-0.7C338.7,299.4,339,298.5,339.5,298z"/>
|
||||
<path class="st1" d="M568.4,269.9c0.1,0.1,0.2,0.3,0.2,0.6l14.5,3.8l-13.3-24.3l13.4-21l-1.6-0.2l2.1-0.6l1-1.5l-17.2,3.3
|
||||
c0.1,0.3,0.2,0.6,0.3,0.9c-1,0.1-1.9,0.5-2.4,0.2c-0.2-0.1-0.3-0.3-0.4-0.6l-7.6,1.4l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
l1.7,27.7l19-20.2l9,2.3C566.2,269.4,567.5,269.5,568.4,269.9z M538.7,241.2c0.9-0.7,2.1-0.3,2.5,0.7c0.3,0.6-0.1,1.5-0.2,2.9
|
||||
c-1.4-0.7-2.5-0.9-3-1.5C537.7,242.9,538.1,241.6,538.7,241.2z M541.8,246.2c-0.1,0.3-0.3,0.6-0.5,0.9c0,0,0,0,0,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3l-5.5-2.1c0.2-0.7,0.6-1.2,0.8-1.6c0.1-0.1,0.2-0.2,0.2-0.4l0,0L541.8,246.2
|
||||
C541.8,246.2,541.8,246.2,541.8,246.2z M550.9,254.1c-0.5,1.8-1.6,3.2-3,4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0h0
|
||||
c-0.3,0.1-0.5,0.3-0.8,0.4c0,0-0.1,0-0.1,0.1l-1-2.8l-0.6-2.1c0,0,0,0,0,0c0,0-0.1,0-0.1,0l0-0.4l-0.1-0.4c0,0,0.1,0,0.1-0.1v-5.1
|
||||
c4.7,0.1,5.7,3.3,5.9,5.2l0.1,0.6L550.9,254.1z M557.2,259.6c-0.2-0.3-0.4-0.6-0.6-1c-0.1-0.2-0.2-0.4-0.3-0.5c0,0,0.3,0.4,0.9,0.5
|
||||
l0.8-2.9l0.8-2.9c0.3,0.1,0.6,0.2,0.8,0.4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0l0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0l0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0v0c0,0,0,0,0,0s0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.6,0.6,0.9,1.2,1.2,1.7c0.1,0.2,0.2,0.3,0.3,0.5c0,0,0,0,0,0l-2.4,1.7L557.2,259.6z"/>
|
||||
<g>
|
||||
<path class="st1" d="M456,117.5c0.2,0.7,0.4,1.4,0.5,2c67.8-10,135-1.4,195.9,22.5c1.2-1.5,3-2.8,5.6-4c6.8-3.1,16.9-0.1,19.9,5.8
|
||||
c1.1,2.2,1.1,5.8,0.3,9.4c31.8,15.3,61.5,34.8,88.1,58.3c0.3-0.4,0.6-0.7,1.1-0.9c1.5-0.7,3.6-0.1,4.3,1.2c0.6,1.2,0.1,2.9-1,3.6
|
||||
c16,14.5,30.8,30.4,44.3,47.6l12-3.5C768,182.5,682.6,129.8,588.2,111.3c0.2,0.1,0.3,0.3,0.5,0.4c2.2,2.3,0.8,6.4-2.1,7.6
|
||||
c-3.1,1.3-6,0.2-7.1-2.7c-0.6-1.8,0-3.9,0.5-6.9c-42.3-7.4-86.2-8-130.3-0.9C452.7,111.5,455,114.4,456,117.5z M685.1,144.4
|
||||
c0.7,0.2,1.7,0.2,2,0.6c0.3,0.5,0,1.3-0.1,2.4c-1-0.4-1.9-0.5-2-0.9C684.7,145.8,685,145.1,685.1,144.4z M537.6,107
|
||||
c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1,0,0.6-0.1,0.6c-0.4,0.1-0.9,0-1.3,0C537.5,107.8,537.5,107.4,537.6,107z"/>
|
||||
<path class="st1" d="M129.9,456c-3.2-3.1-4.6-13.5-2.1-16.3c1.1-1.3,2.9-2,4.9-2.2c7.3-44.3,22.4-86.8,44.1-125.5
|
||||
c-1-0.1-1.8-0.3-2.5-0.7c-2.3-1.3-2.7-3.7-0.9-5.7c1.8-1.9,4.3-2,6-0.1c0.2,0.3,0.4,0.6,0.6,1c48.1-82.5,126.7-147.3,225.6-175.8
|
||||
c15-4.3,30.1-7.7,45.1-10.1c-0.1-0.4-0.2-0.7-0.3-1.1c-0.9-2.9-4.4-6.3-8.9-9.1c-13.1,2.4-26.1,5.4-39.1,9.2
|
||||
c-84.3,24.3-154.3,74.2-204,138.8l1,0.5c-0.1,0.3-0.3,0.6-0.4,0.9c-0.8,1.6-1.7,3.1-2.8,4.4c-0.7,0.9-1.5,1.7-2.3,2.5c0,0,0,0,0,0
|
||||
l-0.9-1c-42.3,57.6-68.8,126.2-75.4,198.5l12-3.5c0.2-1.5,0.3-2.9,0.5-4.4C130,456.1,129.9,456.1,129.9,456z M134.9,403.2l1.8,1.9
|
||||
v0l-2.1,2l-2.1,2l-1.8-1.9L134.9,403.2z"/>
|
||||
</g>
|
||||
<path class="st1" d="M725.5,833.5c0.1,0,0.1,0,0.2,0c0.5-0.3,1-0.7,1.5-1l-2.8-0.7c0.7-2.9,1.1-5.9,1.4-8.9l5.8,0.7
|
||||
c-0.2,2.3-0.5,4.5-0.9,6.7c107.4-71,173.8-190.9,177.3-319.5l-11.7,3.4c-1.3,35-7.4,69.2-17.8,102c1.3,0,2.5,0.5,3.6,1.4
|
||||
c2.2,1.9,2.4,4.4,1.9,6.9c-0.4,2-3,4.2-5,3.8c-1.4-0.3-2.8-0.9-4-1.7C840,727,763.9,811.5,660.7,854.6c0,0.3,0,0.6,0.1,0.9
|
||||
c-0.6-0.1-1.1-0.2-1.5-0.3c-13.2,5.4-26.8,10.2-40.8,14.3c-163.7,47.2-333.3-19.4-424.3-153l-11.7,3.4
|
||||
c54.3,81.4,136.7,139.2,229.7,163.5l4.3-2.9c0.1,0.2,0.2,0.4,0.3,0.5l0-0.1l1.8,3.2l2.9,0.3l-0.6,1.1c4.4,1,8.8,2,13.2,2.9
|
||||
l-0.1-3.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.1,0,0.1,0,0.2,0c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0h0c0,0,0.1,0,0.1,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.6,0.2,0.9,0.3l0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0.6,0.3,1.1,0.7,1.5,1c0.1,0.1,0.3,0.2,0.4,0.3l0.9,0.6
|
||||
l0.3,1.1c0,0.2,0.1,0.3,0.1,0.5c58.8,11.1,121.1,8.9,182.5-8.8c37.5-10.8,72.2-26.7,103.6-46.7
|
||||
C725.4,833.7,725.5,833.5,725.5,833.5z M874.3,655.5c-3.1,2.4-4.7,2.8-7,1.7C868.9,655,870.4,654.6,874.3,655.5z M837.2,711.5
|
||||
c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2c-0.3-0.2-0.3-0.7-0.4-1.1C836.4,711.7,836.9,711.3,837.2,711.5z M407.5,874.8
|
||||
c0,0.3,0,0.6,0,0.9c0,0.2,0,0.3,0,0.5l-5.8,0.5v0c0-0.1,0-0.1,0-0.2c-0.1-0.7,0-1.4,0-2l0-0.5v0l0,0l5.8,0.4L407.5,874.8z
|
||||
M473.8,885.7l1.9,2.3c-0.5,0.4-0.8,0.8-0.9,1.3l-5.5-2.1c0.1-0.2,0.2-0.4,0.3-0.7c0,0,0,0,0,0v0c0.5-1.2,1.3-2.3,2.4-3.2l0.1-0.1
|
||||
L473.8,885.7l1.9,2.3L473.8,885.7l-1.9-2.3L473.8,885.7z"/>
|
||||
<path class="st1" d="M396.5,98.9c131.9-38,267.3-8,368.7,69.2c0.7-2.6,2.5-5,4.7-5.9c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c1.8,3.8,0.5,8.7-2.9,10.3c-0.2,0.1-0.5,0.2-0.8,0.3
|
||||
c5.8,4.7,11.5,9.7,17,14.7c0.9-2.2,2.4-4.1,4.1-5.9c1-1.1,2.1-1.5,3.6-1.5c5.2,0.1,5.5,0.3,7.2,5.4c0.1,0.3,0.4,0.6,0.5,0.9
|
||||
c0.2,0,0.4,0,0.6,0c-0.1-0.9-0.2-1.9-0.3-2.9c3,1.2,4.5,3.8,3.7,6.8c-0.1,0.3-0.2,0.5-0.3,0.8c2-0.7,4-1.8,6.3-2.7
|
||||
c1,3.4,2.3,6.2,2.4,9c0.2,5.4-3.5,8.1-9.1,7.1c-0.5-0.1-1-0.2-1.5-0.3c13.6,13.9,26.3,28.9,38,44.8l21.1-6.1
|
||||
C780.5,120.4,628.1,48.7,470.7,63.8c1.9,2.3,2,5.6,0.2,7.4c-2.5,2.4-7.9,2-10.5-0.8c-1.6-1.7-2.2-3.6-1.9-5.3
|
||||
c-22.5,2.8-45.1,7.4-67.7,13.9c-11,3.2-21.8,6.7-32.3,10.7c0.1,1,0,2.1,0.2,3c-1.6,0-3.2,0-5.6,0c0-0.3,0-0.6-0.1-0.9
|
||||
C227.1,140.7,135,243,95.4,364.7c1.4-0.5,2.9,0.2,3.9,1.7c0.9,1.5,1.2,3.4,2.2,6.7c-3.4-0.9-5.5-0.9-7-1.9
|
||||
c-0.4-0.3-0.7-0.6-0.9-0.9c-5.4,17.4-9.7,35.1-12.9,53.2l0.3-0.5l-0.3,0.6c0,0.1,0,0.1,0,0.2L81,423l0.2,0.1
|
||||
c0.5,0.4,0.9,0.8,1.3,1.3c0.7,0.9,1.1,2,1.4,3.4l0.1,0.5c0,1.7-0.3,3.2-1.1,4.3l-3.5-2.3c-2.4,15.2-4.1,30.5-5,46l21.1-6.1
|
||||
C107.7,300.7,223.5,148.7,396.5,98.9z M749.4,142.3c0.2-1.2,1.4-1.3,2.5-1.2c1.2,0.1,2.3,0.3,4,0.4c-1.1,1.1-1.8,2.4-3,3.1
|
||||
c-0.6,0.4-2,0.1-2.8-0.3C749.6,144.1,749.3,142.9,749.4,142.3z M745.2,129.2c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2
|
||||
c-0.3-0.2-0.3-0.7-0.4-1.1C744.4,129.3,744.9,129,745.2,129.2z M723.5,130.8c1.2-0.5,3.1,0.2,3.6,1.3c0.5,1-0.8,3.4-2,3.8
|
||||
c-1.4,0.4-2.2-0.4-2.8-1.5C721.4,133.1,722.1,131.3,723.5,130.8z M673,99.4c0.7-0.2,1.6,0.2,3,0.5c-0.6,1.4-0.8,2.4-1.4,3
|
||||
c-0.6,0.6-2.2,0-2.5-1C671.6,100.8,671.8,99.7,673,99.4z M571.9,68.8l0-1l0.2,0c0.3,0,0.5,0,0.6,0c0,0,0,0,0,0l0,0.8l2.6-0.5
|
||||
l-2.6,0.6l0,0l2.6-0.5l0,0c0.1,0.4,0.1,0.7,0.2,1.1v0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0.3,0,0.5,0.1,0.8l0.3,3.7l-3.5-0.1l-0.2-3
|
||||
l0.1,3c-0.2,0-0.4,0-0.5,0l-0.1,0l0.1-2.9l-2,0.1l0,0l0,0l0-0.5c0-0.5-0.1-0.9-0.1-1.3L571.9,68.8L571.9,68.8l-2.2,0.4L571.9,68.8z
|
||||
M230.9,174.4l1.8-0.4l-0.2-0.5c0,0,0,0,0,0c0.1,0,0.2-0.1,0.2-0.1c0,0,0.1,0,0.1,0h0l0.3,0.5l0.4-0.1l0,0l0.3-0.1l-0.3,0.1l0,0.7
|
||||
l2.3,4c-0.3,0.2-0.7,0.4-1.1,0.6l-0.5,0.2l-0.5,0c-2.8,0.1-5-1.5-5.7-4.1c0-0.1-0.1-0.2-0.1-0.3L230.9,174.4z M91.5,418.1
|
||||
c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C92.4,416.9,92.1,417.7,91.5,418.1z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 7.1 KiB |
@@ -0,0 +1,402 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="250px" height="115.3px" viewBox="0 0 250 115.3" style="enable-background:new 0 0 250 115.3;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#969696;}
|
||||
.st1{fill:#999999;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
.st3{fill:#CCCCCC;}
|
||||
.st4{fill:#72AF00;}
|
||||
.st5{fill:#29ABE2;}
|
||||
.st6{fill:#D4145A;}
|
||||
.st7{fill:#333333;}
|
||||
.st8{fill:#009ADE;}
|
||||
.st9{fill:#002F87;}
|
||||
.st10{fill-rule:evenodd;clip-rule:evenodd;fill:#FBB231;}
|
||||
.st11{fill-rule:evenodd;clip-rule:evenodd;fill:#EC1B2E;}
|
||||
.st12{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
|
||||
.st13{fill:#2FABF7;}
|
||||
.st14{fill:#228FE0;}
|
||||
.st15{fill:#0571C1;}
|
||||
.st16{fill:#1174CE;}
|
||||
.st17{fill:#1BCC38;}
|
||||
.st18{fill:#E20E37;}
|
||||
.st19{fill:#00579F;}
|
||||
.st20{fill:#FAA61A;}
|
||||
.st21{fill:#F4F4F4;}
|
||||
.st22{fill:none;stroke:#969696;stroke-width:7;stroke-miterlimit:10;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st4" d="M225.4,36c-1,0-1.4-0.5-1.2-1.6l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8
|
||||
c-0.2,1.1-0.8,1.6-1.9,1.6H225.4z"/>
|
||||
<path class="st4" d="M218.3,70.4c-1,0-1.4-0.5-1.2-1.6l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8
|
||||
c-0.2,1.1-0.8,1.6-1.9,1.6H218.3z"/>
|
||||
<path class="st7" d="M187.1,38h-3c-1,0-1.9,0.7-2,1.7l-2.8,15.9h-3l2.1-11.8c0.7-3.9-0.9-5.8-4.7-5.8h-21.5
|
||||
c-3.8,0-6.1,1.9-6.7,5.8l-2.1,11.8h-6.6h-5.7c-0.9,0-1.2-0.4-1-1.2l0.3-1.8c0.3,0.2,0.8,0.3,1.2,0.3h5.3c3.6,0,6.1-1.9,6.7-5.7
|
||||
l0.6-3.6c0.6-3.7-0.8-5.6-4.4-5.6h-8.5c-3.8,0-6,1.9-6.7,5.8l-2.1,11.9h-11.4c-0.9,0-1.2-0.4-1-1.2l0.3-1.8
|
||||
c0.3,0.2,0.8,0.3,1.2,0.3h4.9c3.6,0,5.7-1.9,6.4-5.7l0.6-3.6c0.6-3.7-0.8-5.6-4.4-5.6h-7.1h-0.7h-6.8h-7.1H85.6l0.1-0.3
|
||||
c0.2-1.1,0.9-1.7,1.9-1.7h3.1c1,0,1.8-0.7,1.9-1.6l0.8-4.3h-7.9c-1.8,0-3.3,0.5-4.5,1.5c-1.2,1-1.9,2.4-2.3,4.3l-4.7,26.6h7.2
|
||||
l3.1-17.8h6.4l-3.1,17.8h7.2l3-16.6c0.1-0.8,0.5-1.2,1.2-1.2h4.3l0,0h1.4l-2.2,12.1c-0.5,3.2,1.6,5.8,4.8,5.8h19.9h8.2h6.6h1.8
|
||||
h2.9c1.4,0,2.6-1,2.8-2.4l2.4-13.6c0.2-0.9,0.6-1.2,1.5-1.2h4.5l-2.7,15.9c-0.1,0.7,0.4,1.3,1.2,1.3h4.7c0.6,0,1.1-0.4,1.2-1
|
||||
l2.9-16.3h4.6c0.9,0,1.2,0.4,1,1.2l-2.4,13.4c-0.2,1.1,0.5,2.2,1.6,2.5v0.1h0.6h4.4h5.4h3h0.4v-0.1c0.9-0.2,1.5-0.8,1.7-1.7
|
||||
l3.6-20.3C189.3,39.2,188.4,38,187.1,38z M131.3,47.3l0.3-1.7c0.1-0.5,0.4-0.8,1-0.8h3c0.5,0,0.8,0.3,0.7,0.8l-0.3,1.7
|
||||
c-0.1,0.5-0.4,0.8-1,0.8h-3C131.4,48.1,131.2,47.8,131.3,47.3z M111.5,47.3l0.3-1.7c0.1-0.5,0.4-0.8,1-0.8h2.6
|
||||
c0.5,0,0.8,0.3,0.7,0.8l-0.3,1.7c-0.1,0.5-0.4,0.8-1,0.8h-2.6C111.6,48.1,111.4,47.8,111.5,47.3z"/>
|
||||
<path class="st7" d="M214,38l-3.3,18.8c-0.6,3.8-2.9,5.7-6.6,5.7h-10.3c-3.9,0-5.5-1.8-4.8-5.5l3.3-19h7.2l-2.8,15.9
|
||||
c-0.2,0.9,0.2,1.3,1,1.3h4.9c0.9,0,1.3-0.4,1.5-1.2l2.9-16H214z"/>
|
||||
<path class="st5" d="M183,34.4l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8c-0.2,1.1-0.8,1.6-1.9,1.6
|
||||
h-4.1C183.2,36,182.8,35.5,183,34.4z"/>
|
||||
<path class="st6" d="M68.7,42.9l0.5-2.8c0.2-1.1,0.9-1.6,1.9-1.6h3.9c1.1,0,1.5,0.5,1.3,1.6l-0.5,2.8c-0.2,1.1-0.8,1.6-1.9,1.6
|
||||
h-4.1C68.9,44.5,68.6,43.9,68.7,42.9z"/>
|
||||
<path class="st7" d="M212.1,62.6l1.2-6.8h13.8c0.5,0,0.8-0.3,0.9-0.8l0.3-1.5c0.1-0.4-0.1-0.6-0.6-0.6h-9.2
|
||||
c-1.9,0-3.1-0.4-3.7-1.3c-0.5-0.9-0.7-2.2-0.4-4l0.6-3.7c0.6-3.8,2.9-5.7,6.7-5.7h15.8l-1.2,6.8h-13.7c-0.5,0-0.8,0.3-0.9,0.8
|
||||
l-0.3,1.5c-0.1,0.4,0.1,0.6,0.6,0.6h9.2c3.4,0,4.8,1.8,4.3,5.3l-0.6,3.8c-0.7,3.8-2.7,5.8-6.2,5.8L212.1,62.6L212.1,62.6z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st0" d="M244.4,115.2H5.6c-3.1,0-5.6-2.5-5.6-5.6V14.1C0,11,2.5,8.5,5.6,8.5h34.7v0.7H5.6c-2.7,0-4.8,2.2-4.8,4.8
|
||||
v95.6c0,2.7,2.2,4.8,4.8,4.8h238.9c2.7,0,4.8-2.2,4.8-4.8V14.1c0-2.7-2.2-4.8-4.8-4.8h-35.9V8.5h35.9c3.1,0,5.6,2.5,5.6,5.6v95.6
|
||||
C250,112.7,247.5,115.2,244.4,115.2z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st0" d="M51.3,13.2c-0.7-0.2-1.3-0.5-1.8-0.8l0.8-1.7c0.4,0.3,0.9,0.6,1.5,0.8c0.6,0.2,1.2,0.3,1.8,0.3
|
||||
c0.7,0,1.1-0.1,1.4-0.3c0.3-0.2,0.5-0.5,0.5-0.8c0-0.2-0.1-0.4-0.3-0.6c-0.2-0.2-0.4-0.3-0.7-0.4c-0.3-0.1-0.7-0.2-1.2-0.3
|
||||
c-0.8-0.2-1.4-0.4-1.9-0.5c-0.5-0.2-0.9-0.5-1.2-0.9C50,7.5,49.8,7,49.8,6.3c0-0.6,0.2-1.1,0.5-1.6c0.3-0.5,0.8-0.8,1.4-1.1
|
||||
c0.6-0.3,1.4-0.4,2.3-0.4c0.6,0,1.3,0.1,1.9,0.2c0.6,0.2,1.1,0.4,1.6,0.7l-0.7,1.7c-0.9-0.5-1.8-0.8-2.8-0.8
|
||||
c-0.6,0-1.1,0.1-1.4,0.3c-0.3,0.2-0.5,0.5-0.5,0.8c0,0.3,0.2,0.6,0.5,0.8c0.4,0.2,0.9,0.3,1.6,0.5C55,7.6,55.6,7.8,56.1,8
|
||||
c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.5,0.9,0.5,1.6c0,0.6-0.2,1.1-0.5,1.6c-0.3,0.5-0.8,0.8-1.4,1.1c-0.6,0.3-1.4,0.4-2.3,0.4
|
||||
C52.8,13.5,52.1,13.4,51.3,13.2z"/>
|
||||
<path class="st0" d="M66.7,10.1h-5.8c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
|
||||
c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
|
||||
c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
|
||||
c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C66.8,9.6,66.7,9.8,66.7,10.1z M61.5,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
|
||||
C64.6,8.3,64.4,8,64,7.7c-0.3-0.3-0.8-0.4-1.2-0.4C62.3,7.2,61.9,7.4,61.5,7.7z"/>
|
||||
<path class="st0" d="M69.7,12.9c-0.6-0.3-1.2-0.8-1.5-1.4c-0.4-0.6-0.5-1.3-0.5-2c0-0.8,0.2-1.4,0.5-2c0.4-0.6,0.9-1.1,1.5-1.4
|
||||
c0.6-0.3,1.4-0.5,2.2-0.5c0.8,0,1.5,0.2,2.1,0.5c0.6,0.3,1,0.8,1.3,1.4l-1.7,0.9c-0.4-0.7-1-1.1-1.7-1.1c-0.6,0-1.1,0.2-1.4,0.6
|
||||
c-0.4,0.4-0.6,0.9-0.6,1.5c0,0.7,0.2,1.2,0.6,1.5c0.4,0.4,0.9,0.6,1.4,0.6c0.8,0,1.3-0.4,1.7-1.1l1.7,0.9
|
||||
c-0.3,0.6-0.7,1.1-1.3,1.4c-0.6,0.3-1.3,0.5-2.1,0.5C71.1,13.4,70.4,13.3,69.7,12.9z"/>
|
||||
<path class="st0" d="M84.3,5.7v7.6h-2.1v-0.9c-0.3,0.3-0.6,0.6-1.1,0.8c-0.4,0.2-0.8,0.3-1.3,0.3c-1,0-1.8-0.3-2.4-0.9
|
||||
c-0.6-0.6-0.9-1.4-0.9-2.6V5.7h2.2v4c0,1.2,0.5,1.8,1.5,1.8c0.5,0,1-0.2,1.3-0.5c0.3-0.3,0.5-0.9,0.5-1.5V5.7H84.3z"/>
|
||||
<path class="st0" d="M89.6,5.8c0.4-0.2,1-0.3,1.6-0.3v2c-0.2,0-0.4,0-0.5,0c-0.6,0-1.1,0.2-1.5,0.5c-0.4,0.4-0.5,0.9-0.5,1.6v3.6
|
||||
h-2.2V5.7h2.1v1C88.8,6.3,89.1,6,89.6,5.8z"/>
|
||||
<path class="st0" d="M99.8,10.1H94c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
|
||||
c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
|
||||
c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
|
||||
c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C99.9,9.6,99.8,9.8,99.8,10.1z M94.6,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
|
||||
c-0.1-0.5-0.3-0.9-0.6-1.2c-0.3-0.3-0.8-0.4-1.2-0.4C95.4,7.2,95,7.4,94.6,7.7z"/>
|
||||
<path class="st0" d="M111.8,6.1c0.6,0.3,1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1c0,0.8-0.2,1.5-0.5,2.1c-0.3,0.6-0.8,1.1-1.4,1.4
|
||||
s-1.2,0.5-1.9,0.5c-1,0-1.7-0.3-2.3-0.9v3.6h-2.2V5.7h2.1v0.9c0.5-0.7,1.3-1,2.4-1C110.6,5.6,111.2,5.7,111.8,6.1z M110.9,11
|
||||
c0.4-0.4,0.5-0.9,0.5-1.5c0-0.6-0.2-1.2-0.5-1.5c-0.4-0.4-0.8-0.6-1.4-0.6c-0.6,0-1,0.2-1.4,0.6c-0.4,0.4-0.5,0.9-0.5,1.5
|
||||
c0,0.6,0.2,1.2,0.5,1.5c0.4,0.4,0.8,0.6,1.4,0.6C110.1,11.6,110.5,11.4,110.9,11z"/>
|
||||
<path class="st0" d="M120.8,6.4c0.6,0.6,1,1.4,1,2.5v4.4h-2.1v-1c-0.4,0.7-1.2,1.1-2.3,1.1c-0.6,0-1.1-0.1-1.5-0.3
|
||||
c-0.4-0.2-0.8-0.5-1-0.8c-0.2-0.4-0.3-0.7-0.3-1.2c0-0.7,0.3-1.3,0.8-1.7c0.5-0.4,1.4-0.6,2.5-0.6h1.8c0-0.5-0.1-0.9-0.4-1.1
|
||||
c-0.3-0.3-0.7-0.4-1.3-0.4c-0.4,0-0.8,0.1-1.2,0.2c-0.4,0.1-0.7,0.3-1,0.5l-0.8-1.5c0.4-0.3,0.9-0.5,1.5-0.7
|
||||
c0.6-0.2,1.2-0.2,1.8-0.2C119.3,5.6,120.2,5.8,120.8,6.4z M118.9,11.7c0.3-0.2,0.5-0.4,0.6-0.8v-0.8h-1.5c-0.9,0-1.4,0.3-1.4,0.9
|
||||
c0,0.3,0.1,0.5,0.3,0.7c0.2,0.2,0.5,0.2,0.9,0.2C118.3,11.9,118.7,11.9,118.9,11.7z"/>
|
||||
<path class="st0" d="M131.2,5.7l-3.5,8.1c-0.4,0.9-0.8,1.5-1.3,1.9c-0.5,0.4-1.1,0.5-1.9,0.5c-0.4,0-0.8-0.1-1.2-0.2
|
||||
c-0.4-0.1-0.7-0.3-1-0.5l0.8-1.6c0.2,0.2,0.4,0.3,0.6,0.4c0.2,0.1,0.4,0.1,0.7,0.1c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.4-0.4,0.5-0.7
|
||||
l0-0.1l-3.3-7.7h2.3l2.1,5.2l2.2-5.2H131.2z"/>
|
||||
<path class="st0" d="M144.2,6.4c0.6,0.6,0.8,1.4,0.8,2.5v4.4h-2.2v-4c0-0.6-0.1-1.1-0.4-1.4c-0.3-0.3-0.6-0.4-1.1-0.4
|
||||
c-0.5,0-0.9,0.2-1.2,0.5c-0.3,0.3-0.5,0.8-0.5,1.5v3.8h-2.2v-4c0-1.2-0.5-1.8-1.4-1.8c-0.5,0-0.9,0.2-1.2,0.5
|
||||
c-0.3,0.3-0.5,0.8-0.5,1.5v3.8h-2.2V5.7h2.1v0.9c0.3-0.3,0.6-0.6,1-0.7c0.4-0.2,0.9-0.3,1.4-0.3c0.5,0,1,0.1,1.5,0.3
|
||||
c0.4,0.2,0.8,0.5,1.1,0.9c0.3-0.4,0.7-0.7,1.2-0.9c0.5-0.2,1-0.3,1.6-0.3C142.9,5.6,143.6,5.8,144.2,6.4z"/>
|
||||
<path class="st0" d="M154.6,10.1h-5.8c0.1,0.5,0.4,0.8,0.7,1.1c0.4,0.3,0.9,0.4,1.4,0.4c0.4,0,0.8-0.1,1.1-0.2
|
||||
c0.3-0.1,0.6-0.3,0.9-0.6l1.2,1.3c-0.7,0.8-1.8,1.2-3.2,1.2c-0.9,0-1.6-0.2-2.3-0.5c-0.7-0.3-1.2-0.8-1.5-1.4
|
||||
c-0.4-0.6-0.5-1.3-0.5-2c0-0.7,0.2-1.4,0.5-2c0.4-0.6,0.8-1.1,1.5-1.4c0.6-0.3,1.3-0.5,2.1-0.5c0.7,0,1.4,0.2,2,0.5
|
||||
c0.6,0.3,1.1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1C154.6,9.6,154.6,9.8,154.6,10.1z M149.4,7.7c-0.3,0.3-0.5,0.7-0.6,1.2h3.8
|
||||
c-0.1-0.5-0.3-0.9-0.6-1.2c-0.3-0.3-0.8-0.4-1.2-0.4C150.1,7.2,149.7,7.4,149.4,7.7z"/>
|
||||
<path class="st0" d="M163,6.4c0.6,0.6,0.9,1.4,0.9,2.5v4.4h-2.2v-4c0-0.6-0.1-1.1-0.4-1.4c-0.3-0.3-0.6-0.4-1.2-0.4
|
||||
c-0.6,0-1,0.2-1.3,0.5c-0.3,0.3-0.5,0.9-0.5,1.5v3.8h-2.2V5.7h2.1v0.9c0.3-0.3,0.7-0.6,1.1-0.7c0.4-0.2,0.9-0.3,1.4-0.3
|
||||
C161.7,5.6,162.4,5.8,163,6.4z"/>
|
||||
<path class="st0" d="M170.8,12.9c-0.2,0.2-0.5,0.3-0.8,0.4c-0.3,0.1-0.7,0.1-1,0.1c-0.9,0-1.6-0.2-2.1-0.7c-0.5-0.5-0.7-1.1-0.7-2
|
||||
V7.6H165V5.8h1.2V4h2.2v1.9h1.9v1.7h-1.9v3.1c0,0.3,0.1,0.6,0.2,0.7c0.2,0.2,0.4,0.3,0.7,0.3c0.4,0,0.6-0.1,0.9-0.3L170.8,12.9z"
|
||||
/>
|
||||
<path class="st0" d="M172.8,13.2c-0.6-0.2-1.1-0.4-1.4-0.6l0.7-1.6c0.3,0.2,0.8,0.4,1.2,0.5c0.5,0.1,1,0.2,1.4,0.2
|
||||
c0.9,0,1.4-0.2,1.4-0.7c0-0.2-0.1-0.4-0.4-0.5c-0.3-0.1-0.6-0.2-1.2-0.2c-0.6-0.1-1.1-0.2-1.5-0.3c-0.4-0.1-0.8-0.3-1.1-0.7
|
||||
c-0.3-0.3-0.4-0.8-0.4-1.3c0-0.5,0.1-0.9,0.4-1.3c0.3-0.4,0.7-0.7,1.2-0.9c0.5-0.2,1.2-0.3,1.9-0.3c0.5,0,1.1,0.1,1.6,0.2
|
||||
c0.5,0.1,1,0.3,1.3,0.5l-0.7,1.6c-0.7-0.4-1.4-0.6-2.2-0.6c-0.5,0-0.8,0.1-1.1,0.2c-0.2,0.1-0.4,0.3-0.4,0.5
|
||||
c0,0.2,0.1,0.4,0.4,0.5c0.3,0.1,0.7,0.2,1.2,0.3c0.6,0.1,1.1,0.2,1.5,0.3c0.4,0.1,0.7,0.3,1,0.6c0.3,0.3,0.4,0.7,0.4,1.3
|
||||
c0,0.5-0.1,0.9-0.4,1.3c-0.3,0.4-0.7,0.7-1.2,0.9c-0.5,0.2-1.2,0.3-1.9,0.3C174,13.4,173.4,13.4,172.8,13.2z"/>
|
||||
<path class="st0" d="M190.1,6.1c0.6,0.3,1,0.8,1.4,1.4c0.3,0.6,0.5,1.3,0.5,2.1c0,0.8-0.2,1.5-0.5,2.1c-0.3,0.6-0.8,1.1-1.4,1.4
|
||||
c-0.6,0.3-1.2,0.5-1.9,0.5c-1.1,0-1.9-0.3-2.4-1v0.9h-2.1V2.8h2.2v3.7c0.6-0.6,1.3-0.9,2.3-0.9C188.9,5.6,189.5,5.7,190.1,6.1z
|
||||
M189.2,11c0.4-0.4,0.5-0.9,0.5-1.5c0-0.6-0.2-1.2-0.5-1.5c-0.4-0.4-0.8-0.6-1.4-0.6s-1,0.2-1.4,0.6c-0.4,0.4-0.5,0.9-0.5,1.5
|
||||
c0,0.6,0.2,1.2,0.5,1.5c0.4,0.4,0.8,0.6,1.4,0.6S188.8,11.4,189.2,11z"/>
|
||||
<path class="st0" d="M200.8,5.7l-3.5,8.1c-0.4,0.9-0.8,1.5-1.3,1.9c-0.5,0.4-1.1,0.5-1.9,0.5c-0.4,0-0.8-0.1-1.2-0.2
|
||||
c-0.4-0.1-0.7-0.3-1-0.5l0.8-1.6c0.2,0.2,0.4,0.3,0.6,0.4c0.2,0.1,0.4,0.1,0.7,0.1c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.4-0.4,0.5-0.7
|
||||
l0-0.1l-3.3-7.7h2.3l2.1,5.2l2.2-5.2H200.8z"/>
|
||||
</g>
|
||||
<path class="st4" d="M51,41.7h-2.3v-4.8c0-8.2-6.7-14.8-14.8-14.8S19,28.8,19,36.9v4.8h-2.3c-2.6,0-4.7,2.1-4.7,4.7v18.7
|
||||
c0,2.6,2.1,4.7,4.7,4.7H51c2.6,0,4.7-2.1,4.7-4.7V46.4C55.7,43.8,53.6,41.7,51,41.7z M26.8,36.9c0-3.9,3.2-7,7-7s7,3.2,7,7v4.8
|
||||
H26.8V36.9z M44.1,51L31.9,63.2c-0.4,0.4-1.1,0.4-1.5,0l-6.9-6.9c-0.4-0.4-0.4-1.1,0-1.5l1.5-1.5c0.4-0.4,1.1-0.4,1.5,0l4.6,4.6
|
||||
l10-10c0.4-0.4,1.1-0.4,1.5,0l1.5,1.5C44.6,49.9,44.6,50.6,44.1,51z"/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st8" d="M53.9,87h-4.8c-0.3,0-0.6,0.2-0.7,0.6l-2,12.4c0,0.2,0.2,0.5,0.4,0.5h2.5c0.2,0,0.4-0.2,0.5-0.4l0.6-3.5
|
||||
c0.1-0.3,0.3-0.6,0.7-0.6h1.5c3.2,0,5-1.5,5.5-4.6c0.2-1.3,0-2.4-0.6-3.1C56.7,87.4,55.5,87,53.9,87z M54.5,91.5
|
||||
c-0.3,1.7-1.6,1.7-2.9,1.7h-0.7l0.5-3.2c0-0.2,0.2-0.3,0.4-0.3h0.3c0.9,0,1.7,0,2.1,0.5C54.5,90.5,54.5,90.9,54.5,91.5z"/>
|
||||
<path class="st9" d="M19.4,87h-4.8c-0.3,0-0.6,0.2-0.7,0.6l-2,12.4c0,0.2,0.2,0.5,0.4,0.5h2.3c0.3,0,0.6-0.2,0.7-0.6l0.5-3.3
|
||||
c0.1-0.3,0.3-0.6,0.7-0.6h1.5c3.2,0,5-1.5,5.5-4.6c0.2-1.3,0-2.4-0.6-3.1C22.3,87.4,21,87,19.4,87z M20,91.5
|
||||
c-0.3,1.7-1.6,1.7-2.9,1.7h-0.7l0.5-3.2c0-0.2,0.2-0.3,0.4-0.3h0.3c0.9,0,1.7,0,2.1,0.5C20,90.5,20.1,90.9,20,91.5z"/>
|
||||
<path class="st9" d="M33.9,91.5h-2.3c-0.2,0-0.4,0.1-0.4,0.3l-0.1,0.6l-0.2-0.2c-0.5-0.7-1.6-1-2.7-1c-2.6,0-4.7,1.9-5.2,4.7
|
||||
c-0.2,1.4,0.1,2.7,0.9,3.6c0.7,0.8,1.7,1.2,2.9,1.2c2.1,0,3.2-1.3,3.2-1.3l-0.1,0.6c0,0.2,0.2,0.5,0.4,0.5h2.1
|
||||
c0.3,0,0.6-0.2,0.7-0.6l1.3-7.9C34.3,91.7,34.1,91.5,33.9,91.5z M30.6,96c-0.2,1.3-1.3,2.2-2.6,2.2c-0.7,0-1.2-0.2-1.6-0.6
|
||||
c-0.3-0.4-0.5-1-0.4-1.6c0.2-1.3,1.3-2.2,2.6-2.2c0.7,0,1.2,0.2,1.5,0.6C30.6,94.7,30.8,95.3,30.6,96z"/>
|
||||
<path class="st8" d="M68.3,91.5H66c-0.2,0-0.4,0.1-0.4,0.3l-0.1,0.6l-0.2-0.2c-0.5-0.7-1.6-1-2.7-1c-2.6,0-4.7,1.9-5.2,4.7
|
||||
c-0.2,1.4,0.1,2.7,0.9,3.6c0.7,0.8,1.7,1.2,2.9,1.2c2.1,0,3.2-1.3,3.2-1.3l-0.1,0.6c0,0.2,0.2,0.5,0.4,0.5h2.1
|
||||
c0.3,0,0.6-0.2,0.7-0.6l1.3-7.9C68.8,91.7,68.6,91.5,68.3,91.5z M65.1,96c-0.2,1.3-1.3,2.2-2.6,2.2c-0.7,0-1.2-0.2-1.6-0.6
|
||||
c-0.3-0.4-0.5-1-0.4-1.6c0.2-1.3,1.3-2.2,2.6-2.2c0.7,0,1.2,0.2,1.5,0.6C65.1,94.7,65.2,95.3,65.1,96z"/>
|
||||
<path class="st9" d="M46.2,91.5h-2.3c-0.2,0-0.4,0.1-0.6,0.3l-3.2,4.7l-1.4-4.5c-0.1-0.3-0.3-0.5-0.6-0.5h-2.3
|
||||
c-0.3,0-0.5,0.3-0.4,0.5l2.6,7.5l-2.4,3.4c-0.2,0.3,0,0.6,0.3,0.6h2.3c0.2,0,0.4-0.1,0.6-0.3l7.7-11.2
|
||||
C46.7,91.8,46.5,91.5,46.2,91.5z"/>
|
||||
<path class="st8" d="M71.1,87.3l-2,12.6c0,0.2,0.2,0.5,0.4,0.5h2c0.3,0,0.6-0.2,0.7-0.6l2-12.4c0-0.2-0.2-0.5-0.4-0.5h-2.2
|
||||
C71.3,87,71.1,87.1,71.1,87.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st10" points="150.3,102.3 150.8,102.2 151.3,102.2 151.7,102.1 152.2,102.1 152.6,102 153,101.8 153.4,101.7
|
||||
153.8,101.5 154.2,101.4 154.6,101.2 155,100.9 155.4,100.7 155.7,100.5 156.1,100.2 156.4,99.9 156.7,99.6 157,99.3 157.3,99
|
||||
157.6,98.6 157.8,98.3 158,97.9 158.3,97.5 158.5,97.2 158.6,96.8 158.8,96.3 158.9,95.9 159.1,95.5 159.2,95.1 159.2,94.6
|
||||
159.3,94.2 159.3,93.7 159.3,93.2 159.3,92.8 159.3,92.3 159.2,91.9 159.2,91.4 159.1,91 158.9,90.6 158.8,90.2 158.6,89.8
|
||||
158.5,89.4 158.3,89 158,88.6 157.8,88.2 157.6,87.9 157.3,87.5 157,87.2 156.7,86.9 156.4,86.6 156.1,86.3 155.7,86.1
|
||||
155.4,85.8 155,85.6 154.6,85.4 154.2,85.2 153.8,85 153.4,84.8 153,84.7 152.6,84.6 152.2,84.5 151.7,84.4 151.3,84.3
|
||||
150.8,84.3 150.3,84.3 149.9,84.3 149.4,84.3 149,84.4 148.5,84.5 148.1,84.6 147.7,84.7 147.3,84.8 146.8,85 146.4,85.2
|
||||
146.1,85.4 145.7,85.6 145.3,85.8 145,86.1 144.6,86.3 144.3,86.6 144,86.9 143.7,87.2 143.4,87.5 143.1,87.9 142.9,88.2
|
||||
142.7,88.6 142.4,89 142.2,89.4 142.1,89.8 141.9,90.2 141.8,90.6 141.6,91 141.5,91.4 141.5,91.9 141.4,92.3 141.4,92.8
|
||||
141.4,93.2 141.4,93.7 141.4,94.2 141.5,94.6 141.5,95.1 141.6,95.5 141.8,95.9 141.9,96.3 142.1,96.8 142.2,97.2 142.4,97.5
|
||||
142.7,97.9 142.9,98.3 143.1,98.6 143.4,99 143.7,99.3 144,99.6 144.3,99.9 144.6,100.2 145,100.5 145.3,100.7 145.7,100.9
|
||||
146.1,101.2 146.4,101.4 146.8,101.5 147.3,101.7 147.7,101.8 148.1,102 148.5,102.1 149,102.1 149.4,102.2 149.9,102.2
|
||||
150.3,102.3 150.3,102.3 "/>
|
||||
<polygon class="st11" points="138.3,102.3 138.8,102.2 139.2,102.2 139.7,102.1 140.1,102.1 140.6,102 141,101.8 141.4,101.7
|
||||
141.8,101.5 142.2,101.4 142.6,101.2 143,100.9 143.3,100.7 143.7,100.5 144,100.2 144.3,99.9 144.7,99.6 145,99.3 145.2,99
|
||||
145.5,98.6 145.8,98.3 146,97.9 146.2,97.5 146.4,97.2 146.6,96.8 146.7,96.3 146.9,95.9 147,95.5 147.1,95.1 147.2,94.6
|
||||
147.2,94.2 147.3,93.7 147.3,93.2 147.3,92.8 147.2,92.3 147.2,91.9 147.1,91.4 147,91 146.9,90.6 146.7,90.2 146.6,89.8
|
||||
146.4,89.4 146.2,89 146,88.6 145.8,88.2 145.5,87.9 145.2,87.5 145,87.2 144.7,86.9 144.3,86.6 144,86.3 143.7,86.1 143.3,85.8
|
||||
143,85.6 142.6,85.4 142.2,85.2 141.8,85 141.4,84.8 141,84.7 140.6,84.6 140.1,84.5 139.7,84.4 139.2,84.3 138.8,84.3
|
||||
138.3,84.3 137.8,84.3 137.4,84.3 136.9,84.4 136.5,84.5 136.1,84.6 135.6,84.7 135.2,84.8 134.8,85 134.4,85.2 134,85.4
|
||||
133.6,85.6 133.3,85.8 132.9,86.1 132.6,86.3 132.3,86.6 131.9,86.9 131.6,87.2 131.4,87.5 131.1,87.9 130.8,88.2 130.6,88.6
|
||||
130.4,89 130.2,89.4 130,89.8 129.9,90.2 129.7,90.6 129.6,91 129.5,91.4 129.4,91.9 129.3,92.3 129.3,92.8 129.3,93.2
|
||||
129.3,93.7 129.3,94.2 129.4,94.6 129.5,95.1 129.6,95.5 129.7,95.9 129.9,96.3 130,96.8 130.2,97.2 130.4,97.5 130.6,97.9
|
||||
130.8,98.3 131.1,98.6 131.4,99 131.6,99.3 131.9,99.6 132.3,99.9 132.6,100.2 132.9,100.5 133.3,100.7 133.6,100.9 134,101.2
|
||||
134.4,101.4 134.8,101.5 135.2,101.7 135.6,101.8 136.1,102 136.5,102.1 136.9,102.1 137.4,102.2 137.8,102.2 138.3,102.3
|
||||
138.3,102.3 "/>
|
||||
<polygon class="st10" points="143.3,87.7 148,87.7 148,87.2 143.7,87.2 143.3,87.7 143.3,87.7 "/>
|
||||
<polygon class="st10" points="142.6,88.8 148,88.8 148,88.3 142.8,88.3 142.6,88.8 142.6,88.8 "/>
|
||||
<polygon class="st10" points="142,89.9 148,89.9 148,89.4 142.2,89.4 142,89.9 142,89.9 "/>
|
||||
<polygon class="st10" points="141.7,91 148,91 148,90.5 141.8,90.5 141.7,91 141.7,91 "/>
|
||||
<polygon class="st10" points="141.9,96.2 148.1,96.2 148.1,95.7 141.7,95.7 141.9,96.2 141.9,96.2 "/>
|
||||
<polygon class="st10" points="142.3,97.3 148.1,97.3 148.1,96.8 142.1,96.8 142.3,97.3 142.3,97.3 "/>
|
||||
<polygon class="st10" points="143,98.4 148.1,98.4 148.1,97.9 142.7,97.9 143,98.4 143,98.4 "/>
|
||||
<polygon class="st10" points="143.9,99.5 148.1,99.5 148.1,99 143.4,99 143.9,99.5 143.9,99.5 "/>
|
||||
<polygon class="st10" points="141.4,92.1 148,92.1 148,91.6 141.5,91.6 141.4,92.1 141.4,92.1 "/>
|
||||
<polygon class="st10" points="145.5,95.1 148,95.1 148,94.6 145.6,94.6 145.5,95.1 145.5,95.1 "/>
|
||||
<polygon class="st10" points="145.7,94.1 148,94.1 148,93.6 145.8,93.6 145.7,94.1 145.7,94.1 "/>
|
||||
<polygon class="st10" points="141.3,93.6 141.9,93.6 141.9,94.1 141.3,94.1 141.3,93.6 141.3,93.6 "/>
|
||||
<g>
|
||||
<polygon class="st12" points="140.1,93 140,93 140,93 139.9,93 139.9,93 139.9,92.9 139.8,92.9 139.8,92.9 139.7,92.9
|
||||
139.7,92.9 139.6,92.9 139.6,92.9 139.5,92.9 139.5,92.9 139.4,92.9 139.3,92.9 139.2,92.9 139.2,92.9 139.1,92.9 139.1,93
|
||||
139,93 139,93 138.9,93 138.9,93.1 138.9,93.1 138.9,93.1 138.8,93.2 138.8,93.2 138.8,93.2 138.8,93.3 138.9,93.3 138.9,93.3
|
||||
138.9,93.4 139,93.4 139,93.5 139.1,93.5 139.2,93.6 139.3,93.6 139.4,93.6 139.5,93.7 139.6,93.7 139.7,93.7 139.8,93.8
|
||||
139.9,93.9 139.9,94 140,94.1 140,94.2 140,94.4 140,94.6 140,94.7 139.9,94.9 139.9,95 139.8,95.1 139.8,95.2 139.7,95.2
|
||||
139.6,95.3 139.5,95.4 139.4,95.4 139.3,95.4 139.2,95.5 139.1,95.5 139,95.5 138.9,95.5 138.8,95.5 138.7,95.5 138.6,95.5
|
||||
138.5,95.5 138.4,95.5 138.3,95.5 138.2,95.5 138.1,95.5 138,95.5 137.9,95.5 137.9,95.5 137.8,95.5 137.8,95.5 137.7,95.5
|
||||
137.7,95.4 137.6,95.4 137.6,95.4 137.5,95.4 137.6,94.7 137.7,94.7 137.7,94.7 137.7,94.8 137.8,94.8 137.9,94.8 137.9,94.8
|
||||
138,94.8 138.1,94.8 138.1,94.8 138.2,94.8 138.3,94.8 138.4,94.9 138.5,94.9 138.5,94.9 138.6,94.9 138.7,94.9 138.8,94.8
|
||||
138.9,94.8 138.9,94.8 139,94.7 139,94.7 139,94.7 139,94.6 139.1,94.6 139.1,94.5 139,94.4 139,94.3 138.9,94.3 138.8,94.2
|
||||
138.7,94.2 138.6,94.1 138.5,94.1 138.4,94 138.2,94 138.1,93.9 138,93.8 138,93.7 137.9,93.6 137.9,93.4 137.9,93.2 137.9,93.1
|
||||
137.9,93 138,92.9 138,92.8 138,92.7 138.1,92.6 138.2,92.5 138.2,92.5 138.3,92.4 138.4,92.4 138.5,92.3 138.6,92.3 138.8,92.2
|
||||
138.9,92.2 139.1,92.2 139.3,92.2 139.4,92.2 139.5,92.2 139.6,92.2 139.7,92.2 139.7,92.2 139.8,92.2 139.9,92.2 139.9,92.2
|
||||
140,92.2 140,92.3 140.1,92.3 140.1,92.3 140.1,92.3 140.2,92.3 140.2,92.3 140.2,92.3 140.1,93 140.1,93 "/>
|
||||
<polygon class="st12" points="140.8,91.5 141.6,91.5 141.5,92.3 142,92.3 141.9,93 141.3,92.9 141.1,94.6 141.1,94.7 141.1,94.7
|
||||
141.1,94.8 141.1,94.8 141.2,94.8 141.3,94.9 141.3,94.9 141.4,94.9 141.5,94.9 141.5,94.9 141.6,94.9 141.6,94.8 141.7,94.8
|
||||
141.7,94.8 141.7,94.8 141.7,94.8 141.6,95.4 141.6,95.4 141.6,95.4 141.5,95.4 141.5,95.4 141.5,95.4 141.5,95.4 141.5,95.5
|
||||
141.4,95.5 141.4,95.5 141.4,95.5 141.3,95.5 141.3,95.5 141.3,95.5 141.2,95.5 141.2,95.5 141.1,95.5 140.9,95.5 140.8,95.5
|
||||
140.6,95.5 140.6,95.5 140.5,95.5 140.4,95.4 140.3,95.4 140.3,95.4 140.3,95.3 140.2,95.3 140.2,95.2 140.2,95.2 140.2,95.1
|
||||
140.2,95.1 140.2,95 140.2,94.9 140.2,94.8 140.8,91.5 140.8,91.5 "/>
|
||||
<polygon class="st12" points="149.9,92.5 149.9,92.4 149.8,92.4 149.8,92.4 149.7,92.4 149.7,92.4 149.6,92.3 149.6,92.3
|
||||
149.5,92.3 149.5,92.3 149.4,92.3 149.3,92.3 149.3,92.3 149.2,92.2 149.1,92.2 149.1,92.2 149,92.2 148.9,92.2 148.8,92.2
|
||||
148.8,92.3 148.7,92.3 148.6,92.3 148.5,92.3 148.4,92.4 148.3,92.4 148.3,92.5 148.2,92.6 148.1,92.7 148,92.8 148,92.9
|
||||
147.9,93.1 147.8,93.2 147.8,93.4 147.8,93.5 147.8,93.6 147.8,93.7 147.8,93.9 147.8,94 147.8,94.1 147.8,94.1 147.8,94.2
|
||||
147.9,94.3 147.9,94.4 148,94.5 148.1,94.5 148.2,94.6 148.3,94.6 148.4,94.7 148.5,94.7 148.5,94.7 148.6,94.7 148.6,94.7
|
||||
148.7,94.7 148.7,94.7 148.8,94.7 148.9,94.7 149,94.7 149,94.7 149.1,94.7 149.2,94.7 149.3,94.7 149.3,94.6 149.4,94.6
|
||||
149.5,94.5 149.5,94.5 149.4,95.3 149.4,95.3 149.4,95.3 149.3,95.3 149.3,95.4 149.3,95.4 149.2,95.4 149.2,95.4 149.1,95.4
|
||||
149.1,95.5 149,95.5 148.9,95.5 148.8,95.5 148.7,95.5 148.5,95.5 148.4,95.5 148.2,95.5 148.1,95.5 147.9,95.5 147.8,95.4
|
||||
147.7,95.4 147.5,95.3 147.4,95.2 147.3,95.1 147.2,95 147.1,94.8 147,94.7 146.9,94.5 146.9,94.3 146.8,94.1 146.8,93.9
|
||||
146.8,93.7 146.8,93.4 146.9,93.3 146.9,93.2 146.9,93 147,92.9 147,92.8 147,92.7 147.1,92.6 147.1,92.5 147.2,92.4 147.2,92.3
|
||||
147.3,92.3 147.3,92.2 147.4,92.1 147.4,92 147.5,92 147.5,91.9 147.6,91.8 147.7,91.8 147.8,91.7 147.8,91.7 147.9,91.6
|
||||
148,91.6 148.1,91.6 148.2,91.5 148.3,91.5 148.4,91.5 148.5,91.5 148.6,91.4 148.7,91.4 148.8,91.4 148.9,91.4 149,91.4
|
||||
149.1,91.4 149.2,91.4 149.3,91.4 149.4,91.4 149.5,91.4 149.5,91.5 149.6,91.5 149.7,91.5 149.8,91.5 149.8,91.5 149.9,91.5
|
||||
149.9,91.6 150,91.6 150,91.6 150,91.6 150,91.6 149.9,92.5 149.9,92.5 "/>
|
||||
<path class="st12" d="M157.2,91.6l-0.2,1.2l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
|
||||
l-0.1,0.2l-0.1,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.2l0,0.1l0,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1
|
||||
l0.1,0l0.2,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1-0.1l0-0.1v0l-0.1,0.3h0.8
|
||||
l0.7-4H157.2z M156.8,93.8L156.8,93.8l0,0.2l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l-0.1,0.1l-0.1,0.1l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1-0.1l-0.1-0.1l-0.1-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1
|
||||
l0-0.1l0-0.1l0.1-0.1l0.1-0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1
|
||||
l0,0.1l0,0.1L156.8,93.8L156.8,93.8z"/>
|
||||
<path class="st12" d="M137.7,92.9L137.7,92.9l-0.1-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1h-0.1h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.2,0.7l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0
|
||||
l0.1,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0h0l0,0l0,0l-0.1,0h-0.1l-0.1,0l-0.1,0h-0.1h0l0,0l0,0l0,0l0,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l0,0l0,0l0,0l0,0l0,0l0,0h0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
|
||||
l-0.1,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1v0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0.1,0.1l0.1,0l0.1,0l0.1,0
|
||||
l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0.1l0,0.1
|
||||
l0,0.1h0.8l0.1-0.7l0.3-1.6l0-0.1V93L137.7,92.9z M136.6,94.1L136.6,94.1l0,0.2l0,0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0
|
||||
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0l0,0l-0.1,0l0,0l0,0l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0
|
||||
l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0.1,0l0,0h0h0l0,0l0,0l0,0l0,0V94.1L136.6,94.1L136.6,94.1z"/>
|
||||
<polygon class="st12" points="131,95.5 130.2,95.5 130.8,91.5 132.3,91.5 132.4,93.9 133.4,91.5 134.9,91.5 134.2,95.5
|
||||
133.4,95.5 133.9,92.5 133.9,92.5 132.6,95.5 131.7,95.5 131.7,95.4 131.7,95.1 131.6,94.6 131.6,94.1 131.6,93.5 131.6,93
|
||||
131.5,92.7 131.5,92.5 131.5,92.5 131.5,92.5 131.5,92.5 131.5,92.5 131,95.5 131,95.5 "/>
|
||||
<path class="st12" d="M152.7,92.9L152.7,92.9l-0.1-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1h-0.1h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.2,0.7l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0
|
||||
l0.1,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0h0l0,0l0,0l-0.1,0h-0.1l-0.1,0l-0.1,0h-0.1h0l0,0l0,0l0,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0h0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1
|
||||
l-0.1,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1v0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0,0.1l0.1,0.1l0.1,0l0.1,0l0.1,0
|
||||
l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0v0.1l0,0.1l0,0.1
|
||||
h0.8l0.1-0.7l0.3-1.6l0-0.1V93L152.7,92.9z M151.7,94.1L151.7,94.1l0,0.2l0,0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0,0
|
||||
l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0h0l0,0l0,0l0,0l0,0L151.7,94.1L151.7,94.1L151.7,94.1z"/>
|
||||
<polygon class="st12" points="152.6,95.5 153.5,95.5 153.5,95.5 153.8,93.8 153.8,93.7 153.8,93.7 153.9,93.6 153.9,93.5
|
||||
153.9,93.5 153.9,93.4 154,93.3 154,93.3 154.1,93.2 154.1,93.2 154.2,93.1 154.3,93.1 154.4,93.1 154.5,93 154.6,93 154.7,93
|
||||
154.7,93 154.8,93 154.8,93 154.8,93 154.9,92.2 154.8,92.2 154.8,92.3 154.7,92.3 154.6,92.3 154.5,92.3 154.5,92.3 154.4,92.4
|
||||
154.4,92.4 154.3,92.5 154.2,92.5 154.2,92.5 154.2,92.6 154.1,92.6 154.1,92.7 154,92.8 154,92.8 154.1,92.3 153.2,92.3
|
||||
152.6,95.5 152.6,95.5 152.6,95.5 "/>
|
||||
<polygon class="st12" points="144.6,95.5 145.5,95.5 145.5,95.5 145.8,93.8 145.8,93.7 145.8,93.7 145.8,93.6 145.8,93.5
|
||||
145.9,93.5 145.9,93.4 145.9,93.4 146,93.3 146,93.3 146.1,93.2 146.1,93.2 146.2,93.2 146.3,93.1 146.4,93.1 146.5,93.1
|
||||
146.6,93.1 146.6,93.1 146.6,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93.1 146.7,93
|
||||
146.7,93 146.7,92.9 146.8,92.8 146.8,92.8 146.8,92.7 146.8,92.6 146.9,92.5 146.9,92.5 146.9,92.4 147,92.4 147,92.3 147,92.3
|
||||
147,92.3 147,92.3 147,92.3 147,92.3 147,92.2 147,92.2 147,92.2 146.9,92.2 146.9,92.2 146.9,92.2 146.8,92.2 146.7,92.3
|
||||
146.6,92.3 146.6,92.3 146.5,92.3 146.4,92.3 146.4,92.4 146.3,92.4 146.3,92.4 146.2,92.5 146.2,92.5 146.1,92.6 146.1,92.6
|
||||
146,92.7 146,92.8 145.9,92.8 146.1,92.3 145.2,92.3 144.6,95.5 144.6,95.5 144.6,95.5 "/>
|
||||
<path class="st12" d="M144.7,93.2l0-0.2l0-0.2l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1-0.1l-0.1,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l-0.2,0l-0.2,0l-0.2,0.1l-0.2,0.1l-0.2,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l-0.1,0.1l0,0.1l0,0.1
|
||||
l0,0.1l0,0.1l0,0.1l0,0.2l0,0.2l0,0.2l0.1,0.2l0.1,0.2l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0.1l0.1,0l0.2,0l0.2,0l0.2,0
|
||||
l0.1,0h0.1l0.1,0h0.1l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0l0,0l0,0l0,0l0.1-0.7l-0.1,0.1l-0.1,0l-0.1,0l-0.1,0
|
||||
l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0h-0.1l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l-0.1,0l0,0
|
||||
l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0,0h0.5v0h1.4l0-0.2l0-0.3l0-0.2L144.7,93.2z M143.9,93.5h-0.7l0,0h-0.4
|
||||
l0,0l0-0.1l0-0.1l0-0.1l0-0.1l0-0.1l0,0l0,0l0,0l0,0l0,0l0,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0.1,0l0,0l0,0l0,0l0,0l0,0l0,0
|
||||
l0,0l0,0l0,0.1l0,0.1l0,0.1l0,0.1L143.9,93.5L143.9,93.5z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st13" points="168.8,89.4 170.4,89.4 169.6,87.5 "/>
|
||||
<path class="st14" d="M187.7,87.8c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1s0.2-0.3,0.2-0.5
|
||||
C188,88,187.8,87.8,187.7,87.8z"/>
|
||||
<path class="st15" d="M202.4,85.7v0.8l-0.4-0.8h-3.2v0.8l-0.4-0.8H194c-0.8,0-1.4,0.1-1.9,0.4v-0.4h-3.1v0.4
|
||||
c-0.3-0.3-0.8-0.4-1.3-0.4h-11.1l-0.8,1.7l-0.8-1.7h-3.5v0.8l-0.4-0.8h-3l-1.4,3.2l-1.6,3.6h1.6h1.9l0.4-1.1h1l0.4,1.1h4v-0.8
|
||||
l0.3,0.8h2l0.3-0.8v0.8h9.6v-1.8h0.1c0.1,0,0.1,0,0.1,0.2v1.5h5v-0.4c0.4,0.2,1,0.4,1.9,0.4h2.1l0.4-1.1h1l0.4,1.1h4v-1l0.6,1h3.2
|
||||
v-6.8H202.4L202.4,85.7z M179.1,91.5H178v-3.8l-1.7,3.8h-1l-1.7-3.8v3.8h-2.3l-0.5-1h-2.3l-0.4,1.1h-1.3l2.1-4.9h1.7l1.9,4.6v-4.6
|
||||
h1.9l1.5,3.3l1.4-3.3h1.9V91.5z M183.8,87.7h-2.7v0.9h2.6v1h-2.6v1h2.7v1H180v-4.9h3.9V87.7z M189,89.7c0.1,0.3,0.2,0.5,0.2,0.9v1
|
||||
H188V91c0-0.3,0-0.7-0.2-1c-0.2-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
|
||||
c0,0.8-0.5,1.2-0.8,1.3C188.6,89.4,188.9,89.6,189,89.7z M191.1,91.5h-1.2v-4.9h1.2V91.5z M204.7,91.5H203l-2.2-3.7v3.7h-2.3
|
||||
l-0.4-1h-2.4l-0.4,1.1h-1.3c-0.6,0-1.2-0.1-1.7-0.6c-0.4-0.4-0.6-1-0.6-1.9c0-0.7,0.1-1.4,0.6-1.9c0.3-0.4,1-0.6,1.7-0.6h1.1v1
|
||||
H194c-0.4,0-0.6,0.1-0.9,0.3c-0.2,0.2-0.3,0.6-0.3,1.1c0,0.6,0.1,0.9,0.3,1.2c0.2,0.2,0.5,0.3,0.8,0.3h0.5l1.6-3.8h1.7l1.9,4.6
|
||||
v-4.6h1.7l2,3.4v-3.4h1.2v4.8H204.7L204.7,91.5z"/>
|
||||
<g>
|
||||
<polygon class="st14" points="196,89.4 197.6,89.4 196.9,87.5 "/>
|
||||
<polygon class="st14" points="184.3,99.4 184.3,95.4 182.5,97.4 "/>
|
||||
</g>
|
||||
<polygon class="st13" points="176.9,95.9 176.9,96.8 179.5,96.8 179.5,97.8 176.9,97.8 176.9,98.8 179.7,98.8 181.1,97.4
|
||||
179.8,95.9 "/>
|
||||
<path id="SVGCleanerId_0_3_" class="st14" d="M186.9,95.9h-1.4v1.2h1.5c0.4,0,0.7-0.2,0.7-0.6C187.6,96.1,187.3,95.9,186.9,95.9z"
|
||||
/>
|
||||
<path class="st15" d="M208.2,97.1V94h-0.8h-2.1c-0.6,0-1.1,0.1-1.4,0.4V94h-3.2c-0.5,0-1.1,0.1-1.4,0.4V94h-5.6v0.4
|
||||
c-0.4-0.3-1.2-0.4-1.5-0.4h-3.7v0.4c-0.3-0.3-1.2-0.4-1.6-0.4h-4.1l-1,1l-0.9-1h-6.2v6.8h6.1l1-1l0.9,1h3.7v-1.6h0.5
|
||||
c0.5,0,1.1,0,1.6-0.2v1.9h3.1V99h0.1c0.2,0,0.2,0,0.2,0.2v1.6h9.4c0.6,0,1.2-0.1,1.6-0.4v0.4h3c0.6,0,1.2-0.1,1.7-0.3l0,0
|
||||
c0.7-0.4,1.1-1.2,1.1-2.1C208.6,97.9,208.5,97.4,208.2,97.1z M186.9,98.2h-1.4v1.7h-2.2l-1.4-1.6l-1.4,1.6h-4.6V95h4.6l1.4,1.6
|
||||
l1.4-1.6h3.7c0.9,0,1.9,0.3,1.9,1.6C188.9,97.9,187.9,98.2,186.9,98.2z M193.8,97.9c0.1,0.2,0.2,0.5,0.2,0.9v1h-1.2v-0.6
|
||||
c0-0.3,0-0.8-0.2-1c-0.1-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
|
||||
c0,0.8-0.5,1.2-0.8,1.3C193.5,97.6,193.7,97.8,193.8,97.9z M198.5,95.9h-2.7v0.9h2.6v1h-2.6v1h2.7v1h-3.9v-4.9h3.9V95.9z
|
||||
M201.4,99.8h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
|
||||
c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1c-0.1,0.1-0.1,0.2-0.1,0.3c0,0.2,0.1,0.3,0.3,0.3
|
||||
c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.2,0.2,0.3,0.6,0.3,1C203.2,99.3,202.6,99.8,201.4,99.8z M207.3,99.3
|
||||
c-0.3,0.3-0.8,0.5-1.4,0.5h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3
|
||||
c-0.1-0.1-0.2-0.1-0.4-0.1c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1s-0.1,0.2-0.1,0.3
|
||||
c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.1,0,0.1,0.1,0.1,0.1c0.2,0.3,0.3,0.6,0.3,1
|
||||
C207.8,98.7,207.6,99,207.3,99.3z"/>
|
||||
<path id="SVGCleanerId_1_3_" class="st14" d="M192.5,96.1c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1
|
||||
s0.2-0.3,0.2-0.5C192.8,96.3,192.7,96.1,192.5,96.1z"/>
|
||||
<g>
|
||||
<path class="st14" d="M187.7,87.8c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1s0.2-0.3,0.2-0.5
|
||||
C188,88,187.8,87.8,187.7,87.8z"/>
|
||||
<polygon class="st14" points="196,89.4 197.6,89.4 196.9,87.5 "/>
|
||||
<polygon class="st14" points="184.3,99.4 184.3,95.4 182.5,97.4 "/>
|
||||
</g>
|
||||
<g>
|
||||
<path id="SVGCleanerId_0_2_" class="st14" d="M186.9,95.9h-1.4v1.2h1.5c0.4,0,0.7-0.2,0.7-0.6C187.6,96.1,187.3,95.9,186.9,95.9z
|
||||
"/>
|
||||
</g>
|
||||
<g>
|
||||
<path id="SVGCleanerId_1_2_" class="st14" d="M192.5,96.1c-0.1-0.1-0.3-0.1-0.6-0.1h-1.4v1.1h1.4c0.2,0,0.4,0,0.6-0.1
|
||||
s0.2-0.3,0.2-0.5C192.8,96.3,192.7,96.1,192.5,96.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st13" points="186.4,99.6 185.5,98.6 185.5,99.8 183.2,99.8 181.8,98.2 180.3,99.8 175.7,99.8 175.7,95 180.4,95
|
||||
181.8,96.5 182.5,95.7 180.8,94 174.7,94 174.7,100.7 180.8,100.7 181.8,99.7 182.7,100.7 186.4,100.7 "/>
|
||||
<polygon class="st13" points="179.3,92.5 178.4,91.5 178,91.5 178,91.1 176.9,90.1 176.2,91.5 175.3,91.5 173.6,87.7 173.6,91.5
|
||||
171.3,91.5 170.8,90.5 168.4,90.5 168,91.5 166.7,91.5 168.8,86.7 170.5,86.7 172.4,91.3 172.4,86.7 173.5,86.7 172.5,85.7
|
||||
171.5,85.7 171.5,86.5 171.1,85.7 168.1,85.7 166.7,88.9 165.1,92.5 166.7,92.5 168.7,92.5 169.1,91.4 170.1,91.4 170.6,92.5
|
||||
174.4,92.5 174.4,91.6 174.8,92.5 176.8,92.5 177.1,91.6 177.1,92.5 "/>
|
||||
<polygon class="st13" points="176.1,89.3 175,88.2 175.8,90 "/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st14" d="M207.5,100.4c0.6-0.4,1-1.1,1.1-1.9l-1-1c0.1,0.2,0.1,0.4,0.1,0.7c0,0.4-0.1,0.8-0.4,1s-0.8,0.5-1.4,0.5
|
||||
h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
|
||||
c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.3,1.4-1.4l-0.8-0.8c-0.1,0.1-0.2,0.1-0.3,0.1v-0.4h-3.2c-0.5,0-1.1,0.1-1.4,0.4v-0.4h-5.7
|
||||
v0.4c-0.4-0.3-1.2-0.4-1.5-0.4h-3.7v0.4c-0.3-0.3-1.2-0.4-1.6-0.4h-4.1l-1,1l-0.9-1h-0.8l2.1,2.1l1-1.1h3.7
|
||||
c0.9,0,1.9,0.3,1.9,1.6c0,1.4-1,1.7-2,1.7h-1.4v1l1,1v-1h0.3c0.5,0,1.1,0,1.6-0.2v1.9h3.1v-1.8h0.1c0.2,0,0.2,0,0.2,0.2v1.6h9.4
|
||||
c0.6,0,1.2-0.1,1.6-0.4v0.4h3C206.4,100.7,207,100.7,207.5,100.4L207.5,100.4z M193.8,97.9c0.1,0.2,0.2,0.5,0.2,0.9v1h-1.2v-0.6
|
||||
c0-0.3,0-0.8-0.2-1c-0.1-0.2-0.4-0.2-0.8-0.2h-1.2v1.8h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2c0.3,0.2,0.6,0.6,0.6,1.1
|
||||
c0,0.8-0.5,1.2-0.8,1.3C193.5,97.6,193.7,97.8,193.8,97.9z M198.5,95.9h-2.7v0.9h2.6v1h-2.6v1h2.7v1h-3.9v-4.9h3.9V95.9z
|
||||
M201.4,99.8h-2.2v-1h2.2c0.2,0,0.3,0,0.5-0.1c0.1-0.1,0.1-0.2,0.1-0.3c0-0.1-0.1-0.3-0.1-0.3c-0.1-0.1-0.2-0.1-0.4-0.1
|
||||
c-1.1-0.1-2.4,0-2.4-1.5c0-0.7,0.4-1.4,1.7-1.4h2.3V96h-2.1c-0.2,0-0.3,0-0.5,0.1c-0.1,0.1-0.1,0.2-0.1,0.3
|
||||
c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.6,0,1,0.1,1.3,0.4c0.2,0.2,0.3,0.6,0.3,1
|
||||
C203.2,99.3,202.6,99.8,201.4,99.8z"/>
|
||||
<path class="st14" d="M204.7,96.4c0,0.2,0.1,0.3,0.3,0.3c0.1,0.1,0.3,0.1,0.4,0.1h0.6c0.4,0,0.7,0.1,1,0.2l-1-1h-0.6
|
||||
c-0.2,0-0.3,0-0.5,0.1C204.8,96.1,204.7,96.3,204.7,96.4z"/>
|
||||
<polygon class="st14" points="202.3,92.3 202.4,92.5 202.5,92.5 "/>
|
||||
<polygon class="st14" points="198.5,88.5 199.7,91.3 199.7,89.6 "/>
|
||||
<path class="st14" d="M186.7,90.7h0.1c0.1,0,0.1,0,0.1,0.2v1.5h5v-0.4c0.4,0.2,1,0.4,1.9,0.4h2.1l0.4-1.1h1l0.4,1.1h4v-0.7l-1-1
|
||||
v0.8h-2.3l-0.3-1.1h-2.4l-0.4,1.1h-1.3c-0.6,0-1.2-0.1-1.7-0.6c-0.4-0.4-0.6-1-0.6-1.9c0-0.7,0.1-1.4,0.6-1.9
|
||||
c0.3-0.4,1-0.6,1.7-0.6h1.1v1H194c-0.4,0-0.6,0.1-0.9,0.3c-0.2,0.2-0.3,0.6-0.3,1.1c0,0.6,0.1,0.9,0.3,1.2
|
||||
c0.2,0.2,0.5,0.3,0.8,0.3h0.5l1.6-3.8h0.7l-1-1h-1.8c-0.8,0-1.4,0.1-1.9,0.4v-0.4h-3v0.4c-0.3-0.3-0.8-0.4-1.3-0.4h-11.1
|
||||
l-0.8,1.7l-0.8-1.7h-3l1,1h1.4l1.2,2.6l0.4,0.4l1.2-3h1.9v4.9h-1.2v-3.8l-1.2,2.8l2,2h7.9L186.7,90.7z M189.9,86.7h1.2v4.9h-1.2
|
||||
V86.7z M183.8,87.7h-2.7v0.9h2.6v1h-2.6v1h2.7v1H180v-4.9h3.9V87.7z M185.8,91.5h-1.2v-4.9h2.6c0.6,0,1,0,1.4,0.2
|
||||
c0.3,0.2,0.6,0.6,0.6,1.1c0,0.8-0.5,1.2-0.8,1.3c0.3,0.1,0.5,0.3,0.6,0.4c0.1,0.3,0.2,0.5,0.2,0.9v1h-1.2v-0.6c0-0.3,0-0.7-0.2-1
|
||||
c-0.1-0.1-0.3-0.1-0.7-0.1h-1.2V91.5L185.8,91.5z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st16" d="M217.5,85c-1.8,0-3.1,1.1-3.1,3.1v5.7c0.1,0.7,0.9,1.2,1.7,1.2c0.9,0,1.6-0.7,1.6-1.5v-2.9h2.5v2.9
|
||||
c0,1.6-2,2.4-3.5,2.4c-0.9,0-1.7-0.3-2.3-0.7v6.3h4c1.4,0,3-1.3,3-3V85L217.5,85L217.5,85z"/>
|
||||
<path class="st17" d="M231.5,95h1.7c0.4,0,0.9-0.4,0.9-0.9s-0.4-0.9-0.9-0.9h-1.7V95z"/>
|
||||
<path class="st17" d="M233.5,85c-1.8,0-3.1,1.1-3.1,3.1v2.6h4.7c0.7,0,1.2,0.6,1.2,1.2s-0.6,1.2-1.2,1.2c0.7,0,1.3,0.5,1.3,1.2
|
||||
s-0.6,1.2-1.3,1.2h-4.7v6h4c1.4,0,3-1.3,3-3V85L233.5,85L233.5,85z"/>
|
||||
<g>
|
||||
<path class="st17" d="M234.1,92.1c0-0.4-0.4-0.9-0.9-0.9h-1.7v1.7h1.7C233.7,92.9,234.1,92.5,234.1,92.1z"/>
|
||||
</g>
|
||||
<path class="st18" d="M225.4,85c-1.8,0-3.1,1.1-3.1,3.1v3.2c0.4-0.4,1-0.6,1.6-0.6h4.2v0.9c-1-0.2-2-0.3-2.4-0.3
|
||||
c-1,0-1.9,0.9-1.9,1.9s0.9,1.9,1.9,1.9c0.5,0,1.4-0.1,2.4-0.3v0.8h-4.2c-0.6,0-1.2-0.2-1.6-0.6v6.7h4c1.4,0,3-1.3,3-3V85L225.4,85
|
||||
L225.4,85z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st19" d="M97.6,86.4L95.4,100h3.5l2.2-13.7H97.6z M108.2,91.9c-1.2-0.6-2-1-2-1.6c0-0.6,0.6-1.1,2-1.1
|
||||
c1.1,0,2,0.2,2.6,0.5l0.3,0.1l0.5-2.9c-0.7-0.3-1.8-0.6-3.1-0.6c-3.5,0-5.9,1.8-5.9,4.4c0,1.9,1.7,3,3.1,3.6
|
||||
c1.4,0.6,1.8,1.1,1.8,1.6c0,0.9-1.1,1.3-2.1,1.3c-1.4,0-2.2-0.2-3.3-0.7l-0.5-0.2l-0.5,3c0.8,0.4,2.3,0.7,3.9,0.7
|
||||
c3.7,0,6.1-1.8,6.1-4.5C111.2,94,110.2,92.9,108.2,91.9z M120.6,86.4h-2.7c-0.8,0-1.5,0.2-1.8,1.1l-5.2,12.5h3.7l1-2.7h4.1
|
||||
l0.5,2.7h3.2L120.6,86.4z M116.6,94.6c0.1,0,1.4-4.4,1.4-4.4l1.1,4.4C119.1,94.6,117.3,94.6,116.6,94.6z M92.5,86.4l-3.4,9.3
|
||||
l-0.4-1.8c-0.6-2.1-2.6-4.4-4.8-5.5L87,100h3.7l5.5-13.6L92.5,86.4L92.5,86.4z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st20" d="M87.5,88.1c-0.3-1-1.1-1.7-2.3-1.8h-5.4l-0.1,0.3c4.2,1,7.8,4.3,9,7.3L87.5,88.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 6.1 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,227 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1000 1000" style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.25;}
|
||||
.st1{fill:#1FBC99;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<g>
|
||||
<path class="st1" d="M934.5,517.1c5.6-1.8,11.9,0.4,15.2,5.4c0.4-7.9,0.6-15.9,0.6-23.9l-20.8,6c-0.1,5.7-0.2,11.4-0.5,17.1
|
||||
C930.2,519.6,931.8,518,934.5,517.1z"/>
|
||||
<polygon class="st1" points="912.1,649.8 914,648.9 912,649.7 "/>
|
||||
<path class="st1" d="M367.4,908.8c9.3,4.4,17.9-0.1,26.7-1c3.8-0.4,7.5-0.8,11.3-1.2c2.9-0.3,5.8-0.5,8.7-0.8
|
||||
c-44.2-10.7-86.3-28.6-124.5-52.6l-1.6,4.5c0,0-0.1,0-0.1,0c-1-0.4-1.8-1-2.5-1.9l2.2-1.9l1.3-1.1c-50.6-32-94.5-75-127.8-126.7
|
||||
l-20.8,6C193,816.6,272.6,879.4,364,912.4C365.1,911.2,366.2,910,367.4,908.8z"/>
|
||||
<path class="st1" d="M754.9,859.2c-0.4-2,0.1-4.3,0.4-8.3c3.6,2.4,6.1,3.3,7.3,5c0.8,1,1.1,2.1,1,3.1
|
||||
c39.3-27.6,73.4-61.1,101.3-99.1c-3.3-0.3-6.6-2.1-7.6-4.7c-1.4-3.5,1.1-9.2,4.7-10.6c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c0.1,0.1,0.1,0.2,0.2,0.4
|
||||
c37.1-53.7,62.1-115.5,72.5-180.6c-0.7-0.3-1.3-0.5-1.7-1c-0.8-0.9-0.4-2,0.6-2.6c0.5-0.3,1.1-0.3,1.6-0.2
|
||||
c0.4-2.7,0.8-5.4,1.1-8.1c-0.5,0.7-1.3,1.2-2.1,1.6c-2.4,1.1-7.2-0.8-8.5-3.5c-1.3-2.6,0.3-6.2,3.3-7.5c3.1-1.3,6.3-0.3,7.8,2.6
|
||||
c0.1,0.2,0.2,0.3,0.2,0.5c0.5-4.6,1-9.2,1.4-13.8c-0.6,0.5-1.5,0.8-2.6,0.8c-3.3,2.7-7.3,1.9-10.8,2.4c-0.8,0.1-1.8-0.4-2.6-0.8
|
||||
c-1.7-0.9-3.4-2.9-4.6-5.1c-8.1,99-51.5,191.8-121,261.3c0,0,0,0,0,0.1l-0.1,0c-48.3,48.3-109.2,85.5-179.5,105.8
|
||||
c-68.4,19.7-137.7,21.1-202.7,7.2c-2.5,2.3-5.7,2.7-9,2.1c-4.9-0.9-9.2,0.1-13.4,2c-5.8,2.5-7.8,4.9-7.2,10
|
||||
c75.4,20.9,157.4,21.9,238.1-1.3c45.6-13.1,87.5-33.1,124.7-58.3C756.5,862.3,755.3,861,754.9,859.2z M939.8,590.7
|
||||
c-1.6-0.3-2.5-0.5-3.6-0.8C938,588.5,938,588.5,939.8,590.7z M929.9,614.7c0.4,0.1,0.9,0.1,1.2,0.3c0.2,0.2,0.1,0.7,0.1,1.4
|
||||
c-0.7-0.3-1.3-0.3-1.4-0.6C929.7,615.5,929.9,615.1,929.9,614.7z M909.1,644.6l0.3-0.2l0.4-0.1c2.5-0.6,4.8,0.2,6.2,2.2
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0v0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1v0
|
||||
c0,0.1,0.1,0.1,0.1,0.2c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0.1,0.2l-2.8,1.2l0.1,0l-2,0.9l0,0
|
||||
c-0.2,0.1-0.3,0.3-0.4,0.3l-0.1-0.1l-0.1,0c0,0,0.1,0,0.1,0.1c0,0-0.1,0-0.2,0l0,0l-0.1-0.4l-4.1-3.5
|
||||
C907.7,645.6,908.3,645,909.1,644.6z M791.2,818.1c0.8-0.6,2.7-0.1,3.8,0.5c0.5,0.3,0.7,2.7,0.1,3.1c-0.9,0.7-2.4,0.5-4.5,0.9
|
||||
C790.8,820.5,790.5,818.6,791.2,818.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M450.7,717.7c-0.4,0.1-0.7,0.7-1,1.1c0.6,0.4,1.2,0.7,1.9,1.1c0.2-0.5,0.4-1,0.6-1.4
|
||||
C451.6,718.2,451,717.7,450.7,717.7z"/>
|
||||
<path class="st1" d="M515.3,737.8L490.2,726l-1.7-27.7l-19,20.2l-5.9-1.5c3.3,8,1,16.8-5.1,19c-1,0.4-2,0.6-3.1,0.7l-13.2,20.7
|
||||
c0.1,0.3,0.1,0.7,0.1,1c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0,0l-0.7-0.1l-0.5,0.8l27.3-5.2l17.6,21.4l3.5-27.5L515.3,737.8z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st1" points="570.2,694.7 570.2,694.7 568.1,695.7 "/>
|
||||
<path class="st1" d="M612.1,728.8l4.5-1.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l16.8-6.6
|
||||
l-34.5-16.2l-1.3-20.9c-0.6-0.2-1.2-0.4-1.6-0.7c-2.3-1.6-2.4-4-0.5-5.7c0.5-0.5,1.1-0.7,1.6-0.8l-0.6-9.9l-26,27.6
|
||||
c0.1,0.1,0.1,0.3,0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1v0c0.2,0.8,0.1,1.7-0.2,2.5
|
||||
l-3.8-1.6l-0.6,0.2l-1,0.5l0.7-0.3l-0.7,0.3l0.7-0.3l0,0l0,0l0.3-0.1l0,0l0.5-0.2l0,0l0,0l1.2-0.5l2.1-0.9l-36.3-9.4l18.3,33.4
|
||||
l-20.5,32.1l37.4-7.1l24.2,29.4l4.8-37.8l14.4-5.7L612.1,728.8z M588.4,715.2l-4.6-3.8c0,0,0,0.1-0.1,0.1
|
||||
c-0.1,0.1-0.1,0.3-0.1,0.3c0,0,0-0.2-0.1-0.5l5.7-1.3l0,0h0c0.1,0.3,0.1,0.7,0.2,1C589.7,713.1,589.1,714.4,588.4,715.2z
|
||||
M593.2,730.4c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C594.1,729.2,593.8,729.9,593.2,730.4z"
|
||||
/>
|
||||
</g>
|
||||
<path class="st1" d="M691.1,639.9l-19,20.2l-26.8-7l13.4,24.3l-14.9,23.4l27.3-5.2l0.4,0.5c0.2-1.6,0.7-3.5,1-6
|
||||
c3.9,1.8,6.8,2.2,8.4,3.9c2.2,2.3,0.8,6.4-2.1,7.6c-0.8,0.3-1.5,0.5-2.2,0.5l12.3,14.9l3.5-27.5l25.8-10.1l-25.1-11.8L691.1,639.9z
|
||||
M685.1,654.4l0.4,0.5l-0.2-0.2l0.2,0.2L685.1,654.4l-0.1,0l0.5,0.5c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0l-0.6-0.5l-0.3,0.1l-0.2-0.5
|
||||
l-3.4-2.9c0.2-0.2,0.4-0.4,0.6-0.6c0,0,0.1-0.1,0.1-0.1l0.6-0.6l0.5-0.2c2.8-1,5.3,0.1,6.5,2.6c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0.1,0.1,0.1,0.3,0.2,0.5L685.1,654.4z"/>
|
||||
<path class="st1" d="M75.3,605.9l6.9,23.9l18-5.2l9.6,33.4c-4.2,2.4-8.5,4.3-12.9,5.5c-8.3,2.4-15.9-0.1-22.7-7.6
|
||||
c-6.8-7.4-12.6-19.3-17.3-35.7c-4.6-15.9-5.2-29.3-1.8-40.2c3.4-10.9,10.2-17.9,20.5-20.8c7.2-2.1,15.6-1.9,25.2,0.5l2.2-24.6
|
||||
c-12.3-2.9-24.2-2.7-35.8,0.6C48.3,541.2,35.6,552,29,568.3c-6.6,16.2-6.6,36,0.1,59.4c7,24.2,16.9,41.5,29.7,51.7
|
||||
c12.8,10.2,27.7,12.9,44.6,8.1c14.2-4.1,26.8-10.6,37.9-19.7l-21.5-74.7L75.3,605.9z M51.9,563.3c-3.6-2.2-6.2-3.1-7.6-4.9
|
||||
c-0.8-1,0.1-4.4,1.2-5.1c2.7-1.6,5.6-0.2,6.8,2.6C53,557.4,52.2,559.5,51.9,563.3z M108.3,669.5c-0.1-0.4-0.2-0.8-0.3-1.2
|
||||
c0-0.1,0.5-0.3,0.6-0.2c0.3,0.3,0.6,0.6,0.8,1C109,669.2,108.7,669.3,108.3,669.5z"/>
|
||||
<path class="st1" d="M213.9,495.8l-26.9,7.7l27.8,96.4c2.5,8.7,2.9,15.9,1.1,21.5c-1.8,5.6-5.5,9.2-11.2,10.9
|
||||
c-8.4,2.4-15.2-0.3-20.4-8.3c-3.6,2.8-7.5,4.6-12.5,5c-5.3,0.4-7.5-2-5.7-6.8c1-2.6,3-5.7,5.4-6.6c2.6-1,5.4-1.3,8.2-1.2
|
||||
c-0.5-1.4-1-3-1.5-4.6l-19.2-66.6c-1.8-0.4-3-0.4-3.9-1c-0.4-0.3-0.2-2.4,0.2-2.5c0.8-0.2,1.8-0.2,2.7,0l-7.4-25.7l-26.9,7.7
|
||||
l15.3,53.3c1.2,0.6,2.1,1.2,2.7,2c1.8,2.1,1.6,4.6-0.4,6.1l9.3,32.4c5.1,17.7,12.7,30,22.9,36.9c10.2,6.9,22.5,8.2,37,4.1
|
||||
c14.8-4.3,24.8-12.1,30-23.5c5.2-11.4,5.3-25.7,0.3-43.1L213.9,495.8z M208.1,543.9l-2.7,1c-0.4-1.1-0.7-1.4-0.7-1.4l2.6-5.3
|
||||
c2.1,1.1,3,3.2,3.6,4.7L208.1,543.9z"/>
|
||||
<path class="st1" d="M331.9,579.7l18.9,34.3l27.2-7.8l-78.2-135.7L263,481l3.2,83.2c0,0,0.1-0.1,0.1-0.1c2.6-2.9,8.6-2.7,11.9,0.3
|
||||
c3.1,2.9,3.5,9.1,0.7,11.7c-2.8,2.6-7.9,2.1-11.2-1.1c-0.4-0.4-0.8-0.8-1.1-1.3l2.5,63.8l27.1-7.8l-2.2-39.1L331.9,579.7z
|
||||
M343.3,593.3l0.2-0.1c0.7-0.1,1.5,0,2.2,0.3c0,0,0,0,0,0l0.4,0.2l0.2,0.2l-2,3.4l0.7,1.8l-0.5-1l0.1,0.3l0.2,0.8l-0.5-1.5l0-0.1
|
||||
l0-0.1l0,0.1l0,0l-0.2,0.4l-0.6,1.1l0.8-1.6l0,0l-1.8-3.8L343.3,593.3z M320.6,529.5c0.9-0.1,1.8-0.2,2.8-0.3
|
||||
c2.6-0.1,4.7,0.9,5.7,3.3c0.7,1.7,1.8,2.9,3.2,4.1c0.9,0.8,1.7,2,2.1,3.2c1.2,3.3-0.4,6.8-3.4,7.7c-4,1.3-7.9-0.3-9.3-3.9
|
||||
c-0.5-1.2-0.9-2.4-1.4-3.8c-3.3,0.5-3.3,0.4-3.7-2.2c-0.1-1-0.3-2-0.3-3.1C316.2,531.6,317.7,529.9,320.6,529.5z M283.6,623.2
|
||||
l-2,1.4l0,0l-0.4,0.3l0.4-0.3l-1.1-2.1c0,0,0,0,0,0v0c0,0,0,0,0,0l-1.4-2.7c2.4-1.3,5.3-0.5,6.8,1.7L283.6,623.2z M289.2,515
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c0.9,2.1,2.6,5.6,5.1,10.7c0.4,0.1,0.8,0.3,1.1,0.5c0.4,0.2,0.6,1.6,0.4,2.5c0.3,0.7,0.7,1.4,1.1,2.1
|
||||
c4,7.8,6.5,12.7,7.6,14.6l5.8,10.4c0.2,0,0.5,0.1,0.7,0.1c-0.1,0.3-0.1,0.6-0.2,0.8l11.2,20.2l-22.3,6.4l1,0.3l0,0.2
|
||||
c-0.2,0.6-0.4,1.2-0.7,1.6c-0.1,0.2-0.2,0.3-0.2,0.5l0,0l-3.6-1.5l-1.6,0.5c0-0.4,0-0.7-0.1-1.1l-0.2-0.1c0-0.1,0.1-0.3,0.2-0.4
|
||||
C290.9,538.3,289.8,522.1,289.2,515z M296.6,579.1c2,4.2,0.5,6.5-3.7,9C291.6,583,292.7,580.6,296.6,579.1z"/>
|
||||
<path class="st1" d="M461.4,557L461.4,557c0-0.1,0-0.1-0.1-0.2c-0.1-0.2-0.1-0.3-0.2-0.3c0,0,0-0.1,0-0.1l1.5-1.4l-28.4-34.2
|
||||
c10.3-10.9,12.8-25.5,7.5-43.9c-4.2-14.6-10.9-24.4-20.1-29.5c-9.2-5-21.3-5.4-36.3-1.1l-35.4,10.2l7.1,24.5h0
|
||||
c0.1-0.1,0.2-0.2,0.3-0.2c0.1-0.1,0.2-0.2,0.4-0.2c1.5-0.7,3.6-0.1,4.2,1.2c0.6,1.3,0.1,3.1-1.2,3.8c-0.2,0.1-0.4,0.2-0.6,0.2
|
||||
c0,0-0.1,0-0.1,0c-0.2,0-0.3,0.1-0.5,0.1c0,0,0,0,0,0c-0.4,0-0.8-0.1-1.2-0.2l5.9,20.4l2.2-0.7c0.1,0.3,0.2,0.6,0.2,0.9
|
||||
c0,0.1,0,0.2,0,0.3c0,0.2,0.1,0.4,0.1,0.6c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.2-0.1,0.3
|
||||
c0,0.2-0.1,0.3-0.1,0.5c0,0.1,0,0.1-0.1,0.2c-0.2,0.6-0.5,1.2-0.9,1.7c0,0,0,0,0,0l7.9,27.4c0,0,0,0,0,0c0.2,0,0.5,0.1,0.8,0.1
|
||||
c0,0.1-0.1,0.3-0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c-0.1,0.4-0.2,0.6-0.3,0.8l17.9,62.2l27.1-7.8l-16.3-56.6l9.7-2.8l39.3,50
|
||||
l29-8.3l-16.9-20.3L461.4,557z M367.6,465.7c-0.1-0.2-0.1-0.3-0.2-0.5c1.1-0.5,2.2-1,3.3-1.5c0.1,0.3,0.2,0.6,0.4,0.9
|
||||
C369.9,465,368.8,465.4,367.6,465.7z M388,556.7c-0.2,0.1-0.6-0.2-0.8-0.3c0.1-0.3,0.2-0.7,0.4-0.8c0.2-0.1,0.6,0.1,1,0.3
|
||||
C388.3,556.3,388.2,556.7,388,556.7z M397,585l0,0.4c0,0.2,0,0.3,0,0.5l0,5l-4.7-2.7l-1.1-0.9l0-1.5c0-0.3,0-0.7,0.1-1l0-0.3
|
||||
c0,0,0,0,0-0.1c0,0,0-0.1,0-0.1c0,0,0,0,0,0v0l3.8-0.3l0.5,0l1.5-0.1c0,0.3,0,0.6,0,0.9C397,584.8,397,584.9,397,585z M415.1,503
|
||||
c-1.7,4.4-5.8,7.5-12.2,9.4l-7,2l-11-38.1l-2,0.7l0.3,0.5l-0.6,0.3l-0.2-0.6l-0.3,0.1l-0.7-2.9l-1.1-2.1l0.5-0.3l0.5-0.1
|
||||
c0.3,0,0.6-0.1,0.8,0c0.1,0,0.2,0,0.3,0c0.1,0,0.3,0,0.4,0c0.3,0,0.7,0.1,1,0.2c0,0,0,0,0,0l6.6-1.9c6.2-1.8,11.2-1.5,15,0.8
|
||||
c3.9,2.3,6.9,7.2,9,14.6C416.6,492.8,416.8,498.6,415.1,503z M433.2,476.7c-0.5,0.3-1.5-0.3-2.3-0.6c0.2-0.7,0.5-1.5,0.8-2.6
|
||||
c1,0.5,2.2,0.8,2.2,1.1C434,475.3,433.7,476.5,433.2,476.7z M460.6,577.8l0.2,0.8l-0.1-0.4l0.1,0.4l-0.2-0.7l0,0L460.6,577.8
|
||||
L460.6,577.8L460.6,577.8l0.1,0.8L460.6,577.8l0.1,0.8l-0.2-1.1l-0.5-1.8l-0.8-2.9l0.9,2.9l-0.8-2.9c0.1,0,0.2-0.1,0.3-0.1
|
||||
c0.1,0,0.2-0.1,0.4-0.1l0.4,3l-0.3-3c1.3-0.1,2.6,0.3,3.6,1.3l-3.1,3.6L460.6,577.8z"/>
|
||||
<path class="st1" d="M506.8,529.2l37.9-10.9l18.9,34.3l27.2-7.8l-56.1-97.3l-1.6,0.3l0-0.1c-0.1-0.7-0.1-1.3-0.1-1.8
|
||||
c0-0.2,0-0.3,0-0.5l-0.1-1l-20.4-35.4l-36.7,10.6l0.8,20c0.3,0,0.5,0.1,0.9,0.2c-0.3,0.7-0.4,1.3-0.6,1.4c-0.1,0-0.1,0-0.2,0
|
||||
l1.1,27.9l2,0.4c-0.2,1.4-0.9,2.6-1.8,3.5l4,103.3l27.1-7.8L506.8,529.2z M526.4,522.7c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6
|
||||
c0.2,0,0.5,0,0.6,0.1C526.5,522.2,526.4,522.5,526.4,522.7z M541.7,492c-0.2-0.3-0.4-0.7-0.6-1c0.1,0,0.2-0.1,0.2-0.1
|
||||
c0.3,0.3,0.5,0.6,0.8,0.9C541.9,491.8,541.8,491.9,541.7,492z M549.5,490.8c1.4-0.7,3.8,0.1,4.6,1.5c0.7,1.3,0,3.4-1.4,4.1
|
||||
c-1.4,0.7-3.6,0.1-4.4-1.1C547.5,494,548.2,491.5,549.5,490.8z M539.3,479.9c0.1-0.1,0.1-0.2,0.2-0.4c0,0,0-0.1,0.1-0.1
|
||||
c0.1-0.1,0.2-0.3,0.2-0.4c0,0,0,0,0,0l5.4,2.5c0,0,0,0,0,0l0,0c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.2-0.2,0.3l-0.2,0.3
|
||||
l-2.6-1.4L539.3,479.9L539.3,479.9z M524.3,439.5c0.6-0.4,1.8-0.2,2.7,0c0.3,0.1,0.6,1.6,0.3,1.9c-0.5,0.6-1.5,0.7-3.1,1.4
|
||||
C524.2,441.1,523.9,439.8,524.3,439.5z M517.7,458.9c1.8-3.1,4.7-4.4,8.3-4.3c3.3,0.1,5.3,2.4,6.9,4.8c1.3,1.9,0.4,3.9,0.1,6.1
|
||||
c-2.2,0-3.8,0.3-5.3,2.2c-1.8,2.2-6.2,1.8-8.3,0C517.2,465.8,516.3,461.3,517.7,458.9z M484.4,473.7c-0.2-0.1-0.4-0.3-0.5-0.4
|
||||
c-0.1-0.1,0.1-0.3,0.2-0.5c0.3,0.2,0.5,0.4,0.8,0.6C484.7,473.6,484.5,473.8,484.4,473.7z M492.7,472c-1.5,0.9-4,0.3-4.5-1.2
|
||||
c-0.3-0.8,0.3-1.7,0.3-2.2c2.1-1.1,4.5-0.6,5.1,0.8C494.2,470.7,493.7,471.5,492.7,472z M505.3,503.7c-1.5-26.1-2.6-42.8-3.2-50
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c1.1,2.7,3.7,7.9,7.7,15.7c4,7.8,6.5,12.7,7.6,14.6l5.5,9.9c1-0.1,2,0.3,2.3,1.1
|
||||
c0.2,0.5-0.2,1.1-0.3,1.5c-0.1,0.1-0.3,0.2-0.5,0.2l10.5,18.9l-21.2,6.1c0.7,0.2,1.3,0.4,1.9,0.8c0,0,0,0,0,0l0,0
|
||||
c1.1,0.7,1.8,1.8,2.1,3.2c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.2,0.1,0.3c0,0.3,0.1,0.5,0.1,0.8l-2.9,0.1l-1,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3c-0.1,0.1-0.3,0.3-0.4,0.4l-1.1-0.6l-0.2,0l0,0l-0.1,0l0,0l0.1,0v-0.1l-3.9-2.3c0,0,0,0,0-0.1
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.1-0.2,0.3-0.4,0.4-0.6c0,0,0,0,0,0l0,0c0.2-0.3,0.5-0.6,0.7-0.8c0.1-0.1,0.1-0.1,0.2-0.2L505.3,503.7z"
|
||||
/>
|
||||
<path class="st1" d="M671.8,476.8l-1.1,0.3l-74.7-91.5l-33.3,9.6l41.9,145.6l14.4-4.1c0.4-3.8,3.2-5.3,8.3-6.2
|
||||
c-0.2,1.6-0.5,3-1,4.1l3.4-1L606.9,454c-2.7-9.2-6-17.6-9.9-25.2l1.3-0.4l75.4,92.5l11.4-3.3l-0.5-1.5c0.1,0,0.1,0,0.2-0.1
|
||||
c0.2-0.1,0.2-0.5,0.1-0.8c-0.1-0.1-0.1-0.2-0.2-0.2c0,0,0,0,0,0l2.9-5.1c1.1,0.7,2,1.7,2.6,3.1l0.1,0.3l0.1,0.3
|
||||
c0.2,0.8,0.3,1.6,0.2,2.3l16-4.6l-11.6-40.2c-0.6,1.1-1.6,1.9-2.9,2.3h0c0,0-0.1,0-0.2,0c-0.1,0-0.2,0-0.3,0.1l-1-4.9l-0.2-1l0,0
|
||||
c-0.2,0-0.3,0.1-0.4,0.2c0,0,0,0-0.1,0c-0.1,0.1-0.1,0.1-0.1,0.2c0,0,0-0.1,0-0.2l0.2-13.4l-25.6-88.7l-24.9,7.2l22.9,79.5
|
||||
C665.6,462.1,668.6,470.2,671.8,476.8z M593.5,469.2c-0.2-0.1-0.5-0.1-0.6-0.2c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6-0.1
|
||||
C593.5,468.6,593.5,468.9,593.5,469.2z M600.9,412.4l-0.8-2.9l-0.8-2.9l0.8,2.9l0.8,2.9L600.9,412.4z M604.6,409.2L604.6,409.2
|
||||
C604.6,409.2,604.6,409.2,604.6,409.2c-0.7,1.6-1.9,2.7-3.6,3.2l-0.9-2.9l-0.8-2.9c0,0,0-0.2,0-0.5c-0.2-0.9-0.6-1.2-0.9-1.4
|
||||
c-0.1,0-0.2-0.1-0.2-0.1l1.7-5.7c0,0,0,0,0.1,0c2.6,0.9,4.5,3.1,5.2,6.2l0.1,0.5C605.3,406.9,605.1,408.1,604.6,409.2z M624,439.8
|
||||
c-2.9,1.3-7-0.3-8.6-3.3c-1.3-2.5,0.2-7,2.9-8.2c3.1-1.4,8.3,0.8,9.9,4.2C628.9,434.2,626.4,438.8,624,439.8z M647.4,473.3
|
||||
c-0.5,0.7-1.9,1.2-2.6,0.9c-2.7-0.9-5.2-2-6.2-5.4c1-0.7,1.9-1.5,3-1.9c1.5-0.6,2.9-0.4,4,1.1c0.6,0.8,1.4,1.6,1.8,2.6
|
||||
C647.6,471.4,647.8,472.7,647.4,473.3z M649.3,467.9c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6,0.1
|
||||
C649.3,467.6,649.3,467.8,649.3,467.9z M656.6,464.8C656.6,464.8,656.6,464.8,656.6,464.8L656.6,464.8
|
||||
C656.6,464.9,656.6,464.9,656.6,464.8c-0.1,0.3-0.1,0.4-0.2,0.6l-1.8-0.8c1.2,2,0.9,2.3-1.7,2.8c0.4-0.9,0.8-1.9,1.2-3l-3.2-1.3
|
||||
l0,0c0-0.1,0-0.2-0.1-0.5c-1.4-2.1-2.2-2-2.7-1.9c-0.2,0.1-0.4,0.1-0.5,0.2l-1.2-2.7l-1.2-2.7c0.4-0.2,0.9-0.4,1.4-0.5c0,0,0,0,0,0
|
||||
c1.5-0.4,3.5-0.5,5.5,0.7c0,0,0,0,0,0c0,0,0,0,0,0c1.3,0.8,2.6,2,3.9,4l0.2,0.3l0.1,0.4C656.9,462.1,657,463.5,656.6,464.8z"/>
|
||||
<path class="st1" d="M754.7,497.6l-0.1-2.2c0.9,0,2,0.1,3.2,0.6c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.5,0.3,0.8,0.4l19.5-5.6
|
||||
L743,369.1l18-5.2c-3.3,0.2-6.5,0.5-9.7,0.7c-0.1,0-0.2,0-0.3,0c-0.5,0-1,0.1-1.5,0.1c-0.2,0-0.3,0-0.5,0c-0.5,0-0.9,0-1.4,0
|
||||
c-0.2,0-0.4,0-0.6,0c-0.7,0-1.3,0-2,0c-3.1,0-6.3-0.9-7.1-4.8c-0.6-3.2,1.8-6.4,5.9-7.5c3.9-1,7.8-1.7,12.3-2.7
|
||||
c0,0.3,0.1,0.6,0.2,0.9c0,0.1,0,0.1,0.1,0.2c0.1,0.2,0.1,0.5,0.2,0.7c0,0,0,0,0,0c1.7,3.9,6.5,6.7,4.4,12.3c0,0,0,0,0,0l9.8-2.8
|
||||
l-6.9-23.8L717,350.8l2.3,1.2c0,0,0,0,0,0h0c-0.2,0.3-0.4,0.7-0.6,1l-0.2,0.4l0,0L716,352l-0.9-0.6l-33.7,9.7l6.9,23.8l27.9-8
|
||||
l35.1,121.8L754.7,497.6z M708.8,359.6c-0.3-0.5-0.4-1.4-0.2-2c0.2-0.4,1.1-0.5,1.6-0.8c0.2,0.8,0.5,1.7,0.9,2.9
|
||||
C709.9,359.7,709,359.9,708.8,359.6z M745.1,378c0,0.2,0,0.4,0,0.5v0c-0.2,1.9-1.2,3.5-2.7,4.3c-0.1,0.1-0.3,0.1-0.4,0.2l-2.1-5.4
|
||||
v0L745.1,378L745.1,378z"/>
|
||||
<g>
|
||||
<path class="st1" d="M860.2,372.5l-35.7,10.3l-10-34.6L853,337l-6.7-23.4l-65.6,18.9l41.9,145.6l65.6-18.9l-1.6-5.7l-0.5-0.9
|
||||
l-0.4,0.5c0,0,0,0,0,0v0c-0.3-0.3-0.6-0.6-0.9-0.9c-0.1-0.1-0.3-0.3-0.4-0.4c0,0,0,0,0,0l0.3-0.4c0,0,0-0.1,0-0.1l0,0v0l0.1,0
|
||||
l0-0.1l0.8-1.1l-4.2-14.7l-38.5,11.1l-11.6-40.3l23.1-6.7c0-0.2,0-0.4,0-0.6c0.5,0.1,1.1,0.1,1.6,0.1l11.1-3.2L860.2,372.5z
|
||||
M809.4,414.7l-3.8-1.3l4.9-3.6l1.6-1l1.7,1.1l1.1,0.4l0,0.4l2.4,1.6l-2,1.5l0.2,1.7l-5.8,0.5L809.4,414.7z M815.9,447L815.9,447
|
||||
c-0.1-0.1-0.1-0.3-0.2-0.4c-0.1-0.2-0.2-0.4-0.3-0.6c0-0.1-0.1-0.2-0.1-0.2c0-0.1-0.1-0.1-0.1-0.2l1.1-0.9l1.1-1l2.2-1.9l0.1,0.2
|
||||
c0.2,0.2,0.3,0.5,0.4,0.7c0,0,0,0,0,0l0,0c0.1,0.3,0.3,0.5,0.4,0.7c0.1,0.2,0.1,0.3,0.2,0.5l0,0L815.9,447z"/>
|
||||
<path class="st1" d="M884.7,451.3l0.6-0.1l-0.2-0.3C885,451,884.8,451.1,884.7,451.3z"/>
|
||||
</g>
|
||||
<polygon class="st1" points="969.2,410.2 930.6,421.3 919,380.9 954.8,370.6 948,347.1 912.3,357.4 902.3,322.8 940.8,311.7
|
||||
934.1,288.3 868.5,307.2 910.4,452.8 976,433.9 "/>
|
||||
<path class="st1" d="M405.3,270.3l-0.3,0.1l21.7,10.3l1.4,22.6c0-0.3,0.1-0.6,0.2-0.8c0.4,0.1,0.9,0.1,1.2,0.3
|
||||
c0.2,0.2,0.1,0.7,0.1,1.4c-0.7-0.3-1.3-0.3-1.4-0.6c0-0.1,0-0.1-0.1-0.2l0.9,15.4l26.1-27.7l4.5,1.2c-2.6-1.4-4.5-2.3-5.7-3.8
|
||||
c-0.7-1,0.1-4.4,1.2-5.2c2.7-1.6,5.6-0.2,6.9,2.6c0.6,1.5-0.1,3.5-0.4,6.8l30.3,7.9l-6.8-12.5c-0.4,0.5-1,1-1.7,1.4
|
||||
c-2.1,0.7-4.1,0.6-6-0.8c-0.6-0.4-1.3-1.4-1.2-2c0.4-2.1,1-4.1,1.7-6c0.2-0.5,1.3-0.8,2.1-0.8c0.2,0,0.4,0,0.6,0l-7-12.8l20.5-32.1
|
||||
l-37.4,7.1l-24.2-29.4l-4.8,37.8l-35.5,13.9l12.4,5.9L405.3,270.3z M434.4,277.6c1.9-1.4,1.9-1.4,3.6,0.8
|
||||
C436.5,278.1,435.6,277.9,434.4,277.6z M444.6,256.9c-1.4-0.7-2.5-0.9-3-1.6c-0.8-0.9-0.4-2,0.6-2.6c1-0.6,2.7-0.2,2.9,0.9
|
||||
C445.2,254.5,444.8,255.4,444.6,256.9z M448.8,285.2c0.6,0.3,1.2,0.6,1.7,0.9c0.1,0.1-0.3,1.1-0.4,1.1c-0.6-0.1-1.2-0.4-1.8-0.6
|
||||
C448.5,286.3,448.6,285.9,448.8,285.2z M437.6,235.1c3.1-1.3,6.3-0.3,7.8,2.6c1.7,3.2,0.5,6.9-2.7,8.4c-2.4,1.1-7.2-0.8-8.5-3.5
|
||||
C433,240,434.6,236.3,437.6,235.1z M415.3,266c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1-0.1,0.5-0.2,1c-0.5-0.2-0.9-0.3-1.3-0.5
|
||||
C415.1,266.7,415.2,266.4,415.3,266z"/>
|
||||
<path class="st1" d="M334.6,345.9l19-20.2l26.8,7l-13.3-24.3l15-23.4l-27.2,5.2l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
L334.6,345.9z M351.1,302.9c0.8,0.9,0.6,3.2,0,4.4c-0.3,0.6-3.2,0.6-3.9-0.1c-1-1-1-2.8-1.9-5.6C348.2,302.1,350.4,302,351.1,302.9
|
||||
z M339.5,298c0.2-0.2,1.1,0.4,2.3,0.8c-0.9,0.9-1.4,1.6-2.1,1.9c-0.3,0.2-0.9-0.4-1.4-0.7C338.7,299.4,339,298.5,339.5,298z"/>
|
||||
<path class="st1" d="M568.4,269.9c0.1,0.1,0.2,0.3,0.2,0.6l14.5,3.8l-13.3-24.3l13.4-21l-1.6-0.2l2.1-0.6l1-1.5l-17.2,3.3
|
||||
c0.1,0.3,0.2,0.6,0.3,0.9c-1,0.1-1.9,0.5-2.4,0.2c-0.2-0.1-0.3-0.3-0.4-0.6l-7.6,1.4l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
l1.7,27.7l19-20.2l9,2.3C566.2,269.4,567.5,269.5,568.4,269.9z M538.7,241.2c0.9-0.7,2.1-0.3,2.5,0.7c0.3,0.6-0.1,1.5-0.2,2.9
|
||||
c-1.4-0.7-2.5-0.9-3-1.5C537.7,242.9,538.1,241.6,538.7,241.2z M541.8,246.2c-0.1,0.3-0.3,0.6-0.5,0.9c0,0,0,0,0,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3l-5.5-2.1c0.2-0.7,0.6-1.2,0.8-1.6c0.1-0.1,0.2-0.2,0.2-0.4l0,0L541.8,246.2
|
||||
C541.8,246.2,541.8,246.2,541.8,246.2z M550.9,254.1c-0.5,1.8-1.6,3.2-3,4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0h0
|
||||
c-0.3,0.1-0.5,0.3-0.8,0.4c0,0-0.1,0-0.1,0.1l-1-2.8l-0.6-2.1c0,0,0,0,0,0c0,0-0.1,0-0.1,0l0-0.4l-0.1-0.4c0,0,0.1,0,0.1-0.1v-5.1
|
||||
c4.7,0.1,5.7,3.3,5.9,5.2l0.1,0.6L550.9,254.1z M557.2,259.6c-0.2-0.3-0.4-0.6-0.6-1c-0.1-0.2-0.2-0.4-0.3-0.5c0,0,0.3,0.4,0.9,0.5
|
||||
l0.8-2.9l0.8-2.9c0.3,0.1,0.6,0.2,0.8,0.4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0l0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0l0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0v0c0,0,0,0,0,0s0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.6,0.6,0.9,1.2,1.2,1.7c0.1,0.2,0.2,0.3,0.3,0.5c0,0,0,0,0,0l-2.4,1.7L557.2,259.6z"/>
|
||||
<g>
|
||||
<path class="st1" d="M456,117.5c0.2,0.7,0.4,1.4,0.5,2c67.8-10,135-1.4,195.9,22.5c1.2-1.5,3-2.8,5.6-4c6.8-3.1,16.9-0.1,19.9,5.8
|
||||
c1.1,2.2,1.1,5.8,0.3,9.4c31.8,15.3,61.5,34.8,88.1,58.3c0.3-0.4,0.6-0.7,1.1-0.9c1.5-0.7,3.6-0.1,4.3,1.2c0.6,1.2,0.1,2.9-1,3.6
|
||||
c16,14.5,30.8,30.4,44.3,47.6l12-3.5C768,182.5,682.6,129.8,588.2,111.3c0.2,0.1,0.3,0.3,0.5,0.4c2.2,2.3,0.8,6.4-2.1,7.6
|
||||
c-3.1,1.3-6,0.2-7.1-2.7c-0.6-1.8,0-3.9,0.5-6.9c-42.3-7.4-86.2-8-130.3-0.9C452.7,111.5,455,114.4,456,117.5z M685.1,144.4
|
||||
c0.7,0.2,1.7,0.2,2,0.6c0.3,0.5,0,1.3-0.1,2.4c-1-0.4-1.9-0.5-2-0.9C684.7,145.8,685,145.1,685.1,144.4z M537.6,107
|
||||
c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1,0,0.6-0.1,0.6c-0.4,0.1-0.9,0-1.3,0C537.5,107.8,537.5,107.4,537.6,107z"/>
|
||||
<path class="st1" d="M129.9,456c-3.2-3.1-4.6-13.5-2.1-16.3c1.1-1.3,2.9-2,4.9-2.2c7.3-44.3,22.4-86.8,44.1-125.5
|
||||
c-1-0.1-1.8-0.3-2.5-0.7c-2.3-1.3-2.7-3.7-0.9-5.7c1.8-1.9,4.3-2,6-0.1c0.2,0.3,0.4,0.6,0.6,1c48.1-82.5,126.7-147.3,225.6-175.8
|
||||
c15-4.3,30.1-7.7,45.1-10.1c-0.1-0.4-0.2-0.7-0.3-1.1c-0.9-2.9-4.4-6.3-8.9-9.1c-13.1,2.4-26.1,5.4-39.1,9.2
|
||||
c-84.3,24.3-154.3,74.2-204,138.8l1,0.5c-0.1,0.3-0.3,0.6-0.4,0.9c-0.8,1.6-1.7,3.1-2.8,4.4c-0.7,0.9-1.5,1.7-2.3,2.5c0,0,0,0,0,0
|
||||
l-0.9-1c-42.3,57.6-68.8,126.2-75.4,198.5l12-3.5c0.2-1.5,0.3-2.9,0.5-4.4C130,456.1,129.9,456.1,129.9,456z M134.9,403.2l1.8,1.9
|
||||
v0l-2.1,2l-2.1,2l-1.8-1.9L134.9,403.2z"/>
|
||||
</g>
|
||||
<path class="st1" d="M725.5,833.5c0.1,0,0.1,0,0.2,0c0.5-0.3,1-0.7,1.5-1l-2.8-0.7c0.7-2.9,1.1-5.9,1.4-8.9l5.8,0.7
|
||||
c-0.2,2.3-0.5,4.5-0.9,6.7c107.4-71,173.8-190.9,177.3-319.5l-11.7,3.4c-1.3,35-7.4,69.2-17.8,102c1.3,0,2.5,0.5,3.6,1.4
|
||||
c2.2,1.9,2.4,4.4,1.9,6.9c-0.4,2-3,4.2-5,3.8c-1.4-0.3-2.8-0.9-4-1.7C840,727,763.9,811.5,660.7,854.6c0,0.3,0,0.6,0.1,0.9
|
||||
c-0.6-0.1-1.1-0.2-1.5-0.3c-13.2,5.4-26.8,10.2-40.8,14.3c-163.7,47.2-333.3-19.4-424.3-153l-11.7,3.4
|
||||
c54.3,81.4,136.7,139.2,229.7,163.5l4.3-2.9c0.1,0.2,0.2,0.4,0.3,0.5l0-0.1l1.8,3.2l2.9,0.3l-0.6,1.1c4.4,1,8.8,2,13.2,2.9
|
||||
l-0.1-3.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.1,0,0.1,0,0.2,0c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0h0c0,0,0.1,0,0.1,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.6,0.2,0.9,0.3l0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0.6,0.3,1.1,0.7,1.5,1c0.1,0.1,0.3,0.2,0.4,0.3l0.9,0.6
|
||||
l0.3,1.1c0,0.2,0.1,0.3,0.1,0.5c58.8,11.1,121.1,8.9,182.5-8.8c37.5-10.8,72.2-26.7,103.6-46.7
|
||||
C725.4,833.7,725.5,833.5,725.5,833.5z M874.3,655.5c-3.1,2.4-4.7,2.8-7,1.7C868.9,655,870.4,654.6,874.3,655.5z M837.2,711.5
|
||||
c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2c-0.3-0.2-0.3-0.7-0.4-1.1C836.4,711.7,836.9,711.3,837.2,711.5z M407.5,874.8
|
||||
c0,0.3,0,0.6,0,0.9c0,0.2,0,0.3,0,0.5l-5.8,0.5v0c0-0.1,0-0.1,0-0.2c-0.1-0.7,0-1.4,0-2l0-0.5v0l0,0l5.8,0.4L407.5,874.8z
|
||||
M473.8,885.7l1.9,2.3c-0.5,0.4-0.8,0.8-0.9,1.3l-5.5-2.1c0.1-0.2,0.2-0.4,0.3-0.7c0,0,0,0,0,0v0c0.5-1.2,1.3-2.3,2.4-3.2l0.1-0.1
|
||||
L473.8,885.7l1.9,2.3L473.8,885.7l-1.9-2.3L473.8,885.7z"/>
|
||||
<path class="st1" d="M396.5,98.9c131.9-38,267.3-8,368.7,69.2c0.7-2.6,2.5-5,4.7-5.9c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c1.8,3.8,0.5,8.7-2.9,10.3c-0.2,0.1-0.5,0.2-0.8,0.3
|
||||
c5.8,4.7,11.5,9.7,17,14.7c0.9-2.2,2.4-4.1,4.1-5.9c1-1.1,2.1-1.5,3.6-1.5c5.2,0.1,5.5,0.3,7.2,5.4c0.1,0.3,0.4,0.6,0.5,0.9
|
||||
c0.2,0,0.4,0,0.6,0c-0.1-0.9-0.2-1.9-0.3-2.9c3,1.2,4.5,3.8,3.7,6.8c-0.1,0.3-0.2,0.5-0.3,0.8c2-0.7,4-1.8,6.3-2.7
|
||||
c1,3.4,2.3,6.2,2.4,9c0.2,5.4-3.5,8.1-9.1,7.1c-0.5-0.1-1-0.2-1.5-0.3c13.6,13.9,26.3,28.9,38,44.8l21.1-6.1
|
||||
C780.5,120.4,628.1,48.7,470.7,63.8c1.9,2.3,2,5.6,0.2,7.4c-2.5,2.4-7.9,2-10.5-0.8c-1.6-1.7-2.2-3.6-1.9-5.3
|
||||
c-22.5,2.8-45.1,7.4-67.7,13.9c-11,3.2-21.8,6.7-32.3,10.7c0.1,1,0,2.1,0.2,3c-1.6,0-3.2,0-5.6,0c0-0.3,0-0.6-0.1-0.9
|
||||
C227.1,140.7,135,243,95.4,364.7c1.4-0.5,2.9,0.2,3.9,1.7c0.9,1.5,1.2,3.4,2.2,6.7c-3.4-0.9-5.5-0.9-7-1.9
|
||||
c-0.4-0.3-0.7-0.6-0.9-0.9c-5.4,17.4-9.7,35.1-12.9,53.2l0.3-0.5l-0.3,0.6c0,0.1,0,0.1,0,0.2L81,423l0.2,0.1
|
||||
c0.5,0.4,0.9,0.8,1.3,1.3c0.7,0.9,1.1,2,1.4,3.4l0.1,0.5c0,1.7-0.3,3.2-1.1,4.3l-3.5-2.3c-2.4,15.2-4.1,30.5-5,46l21.1-6.1
|
||||
C107.7,300.7,223.5,148.7,396.5,98.9z M749.4,142.3c0.2-1.2,1.4-1.3,2.5-1.2c1.2,0.1,2.3,0.3,4,0.4c-1.1,1.1-1.8,2.4-3,3.1
|
||||
c-0.6,0.4-2,0.1-2.8-0.3C749.6,144.1,749.3,142.9,749.4,142.3z M745.2,129.2c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2
|
||||
c-0.3-0.2-0.3-0.7-0.4-1.1C744.4,129.3,744.9,129,745.2,129.2z M723.5,130.8c1.2-0.5,3.1,0.2,3.6,1.3c0.5,1-0.8,3.4-2,3.8
|
||||
c-1.4,0.4-2.2-0.4-2.8-1.5C721.4,133.1,722.1,131.3,723.5,130.8z M673,99.4c0.7-0.2,1.6,0.2,3,0.5c-0.6,1.4-0.8,2.4-1.4,3
|
||||
c-0.6,0.6-2.2,0-2.5-1C671.6,100.8,671.8,99.7,673,99.4z M571.9,68.8l0-1l0.2,0c0.3,0,0.5,0,0.6,0c0,0,0,0,0,0l0,0.8l2.6-0.5
|
||||
l-2.6,0.6l0,0l2.6-0.5l0,0c0.1,0.4,0.1,0.7,0.2,1.1v0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0.3,0,0.5,0.1,0.8l0.3,3.7l-3.5-0.1l-0.2-3
|
||||
l0.1,3c-0.2,0-0.4,0-0.5,0l-0.1,0l0.1-2.9l-2,0.1l0,0l0,0l0-0.5c0-0.5-0.1-0.9-0.1-1.3L571.9,68.8L571.9,68.8l-2.2,0.4L571.9,68.8z
|
||||
M230.9,174.4l1.8-0.4l-0.2-0.5c0,0,0,0,0,0c0.1,0,0.2-0.1,0.2-0.1c0,0,0.1,0,0.1,0h0l0.3,0.5l0.4-0.1l0,0l0.3-0.1l-0.3,0.1l0,0.7
|
||||
l2.3,4c-0.3,0.2-0.7,0.4-1.1,0.6l-0.5,0.2l-0.5,0c-2.8,0.1-5-1.5-5.7-4.1c0-0.1-0.1-0.2-0.1-0.3L230.9,174.4z M91.5,418.1
|
||||
c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C92.4,416.9,92.1,417.7,91.5,418.1z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
@@ -0,0 +1,227 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1000 1000" style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.25;}
|
||||
.st1{fill:#1FBC99;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<g>
|
||||
<path class="st1" d="M934.5,517.1c5.6-1.8,11.9,0.4,15.2,5.4c0.4-7.9,0.6-15.9,0.6-23.9l-20.8,6c-0.1,5.7-0.2,11.4-0.5,17.1
|
||||
C930.2,519.6,931.8,518,934.5,517.1z"/>
|
||||
<polygon class="st1" points="912.1,649.8 914,648.9 912,649.7 "/>
|
||||
<path class="st1" d="M367.4,908.8c9.3,4.4,17.9-0.1,26.7-1c3.8-0.4,7.5-0.8,11.3-1.2c2.9-0.3,5.8-0.5,8.7-0.8
|
||||
c-44.2-10.7-86.3-28.6-124.5-52.6l-1.6,4.5c0,0-0.1,0-0.1,0c-1-0.4-1.8-1-2.5-1.9l2.2-1.9l1.3-1.1c-50.6-32-94.5-75-127.8-126.7
|
||||
l-20.8,6C193,816.6,272.6,879.4,364,912.4C365.1,911.2,366.2,910,367.4,908.8z"/>
|
||||
<path class="st1" d="M754.9,859.2c-0.4-2,0.1-4.3,0.4-8.3c3.6,2.4,6.1,3.3,7.3,5c0.8,1,1.1,2.1,1,3.1
|
||||
c39.3-27.6,73.4-61.1,101.3-99.1c-3.3-0.3-6.6-2.1-7.6-4.7c-1.4-3.5,1.1-9.2,4.7-10.6c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c0.1,0.1,0.1,0.2,0.2,0.4
|
||||
c37.1-53.7,62.1-115.5,72.5-180.6c-0.7-0.3-1.3-0.5-1.7-1c-0.8-0.9-0.4-2,0.6-2.6c0.5-0.3,1.1-0.3,1.6-0.2
|
||||
c0.4-2.7,0.8-5.4,1.1-8.1c-0.5,0.7-1.3,1.2-2.1,1.6c-2.4,1.1-7.2-0.8-8.5-3.5c-1.3-2.6,0.3-6.2,3.3-7.5c3.1-1.3,6.3-0.3,7.8,2.6
|
||||
c0.1,0.2,0.2,0.3,0.2,0.5c0.5-4.6,1-9.2,1.4-13.8c-0.6,0.5-1.5,0.8-2.6,0.8c-3.3,2.7-7.3,1.9-10.8,2.4c-0.8,0.1-1.8-0.4-2.6-0.8
|
||||
c-1.7-0.9-3.4-2.9-4.6-5.1c-8.1,99-51.5,191.8-121,261.3c0,0,0,0,0,0.1l-0.1,0c-48.3,48.3-109.2,85.5-179.5,105.8
|
||||
c-68.4,19.7-137.7,21.1-202.7,7.2c-2.5,2.3-5.7,2.7-9,2.1c-4.9-0.9-9.2,0.1-13.4,2c-5.8,2.5-7.8,4.9-7.2,10
|
||||
c75.4,20.9,157.4,21.9,238.1-1.3c45.6-13.1,87.5-33.1,124.7-58.3C756.5,862.3,755.3,861,754.9,859.2z M939.8,590.7
|
||||
c-1.6-0.3-2.5-0.5-3.6-0.8C938,588.5,938,588.5,939.8,590.7z M929.9,614.7c0.4,0.1,0.9,0.1,1.2,0.3c0.2,0.2,0.1,0.7,0.1,1.4
|
||||
c-0.7-0.3-1.3-0.3-1.4-0.6C929.7,615.5,929.9,615.1,929.9,614.7z M909.1,644.6l0.3-0.2l0.4-0.1c2.5-0.6,4.8,0.2,6.2,2.2
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0v0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0.1v0
|
||||
c0,0.1,0.1,0.1,0.1,0.2c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0.1,0.2l-2.8,1.2l0.1,0l-2,0.9l0,0
|
||||
c-0.2,0.1-0.3,0.3-0.4,0.3l-0.1-0.1l-0.1,0c0,0,0.1,0,0.1,0.1c0,0-0.1,0-0.2,0l0,0l-0.1-0.4l-4.1-3.5
|
||||
C907.7,645.6,908.3,645,909.1,644.6z M791.2,818.1c0.8-0.6,2.7-0.1,3.8,0.5c0.5,0.3,0.7,2.7,0.1,3.1c-0.9,0.7-2.4,0.5-4.5,0.9
|
||||
C790.8,820.5,790.5,818.6,791.2,818.1z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M450.7,717.7c-0.4,0.1-0.7,0.7-1,1.1c0.6,0.4,1.2,0.7,1.9,1.1c0.2-0.5,0.4-1,0.6-1.4
|
||||
C451.6,718.2,451,717.7,450.7,717.7z"/>
|
||||
<path class="st1" d="M515.3,737.8L490.2,726l-1.7-27.7l-19,20.2l-5.9-1.5c3.3,8,1,16.8-5.1,19c-1,0.4-2,0.6-3.1,0.7l-13.2,20.7
|
||||
c0.1,0.3,0.1,0.7,0.1,1c0,0,0,0,0,0c0,0,0,0.1,0,0.1l0,0l-0.7-0.1l-0.5,0.8l27.3-5.2l17.6,21.4l3.5-27.5L515.3,737.8z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st1" points="570.2,694.7 570.2,694.7 568.1,695.7 "/>
|
||||
<path class="st1" d="M612.1,728.8l4.5-1.1c0,0,0,0,0,0c0,0,0,0.1,0,0.1c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1l16.8-6.6
|
||||
l-34.5-16.2l-1.3-20.9c-0.6-0.2-1.2-0.4-1.6-0.7c-2.3-1.6-2.4-4-0.5-5.7c0.5-0.5,1.1-0.7,1.6-0.8l-0.6-9.9l-26,27.6
|
||||
c0.1,0.1,0.1,0.3,0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0.1,0,0.1v0c0.2,0.8,0.1,1.7-0.2,2.5
|
||||
l-3.8-1.6l-0.6,0.2l-1,0.5l0.7-0.3l-0.7,0.3l0.7-0.3l0,0l0,0l0.3-0.1l0,0l0.5-0.2l0,0l0,0l1.2-0.5l2.1-0.9l-36.3-9.4l18.3,33.4
|
||||
l-20.5,32.1l37.4-7.1l24.2,29.4l4.8-37.8l14.4-5.7L612.1,728.8z M588.4,715.2l-4.6-3.8c0,0,0,0.1-0.1,0.1
|
||||
c-0.1,0.1-0.1,0.3-0.1,0.3c0,0,0-0.2-0.1-0.5l5.7-1.3l0,0h0c0.1,0.3,0.1,0.7,0.2,1C589.7,713.1,589.1,714.4,588.4,715.2z
|
||||
M593.2,730.4c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C594.1,729.2,593.8,729.9,593.2,730.4z"
|
||||
/>
|
||||
</g>
|
||||
<path class="st1" d="M691.1,639.9l-19,20.2l-26.8-7l13.4,24.3l-14.9,23.4l27.3-5.2l0.4,0.5c0.2-1.6,0.7-3.5,1-6
|
||||
c3.9,1.8,6.8,2.2,8.4,3.9c2.2,2.3,0.8,6.4-2.1,7.6c-0.8,0.3-1.5,0.5-2.2,0.5l12.3,14.9l3.5-27.5l25.8-10.1l-25.1-11.8L691.1,639.9z
|
||||
M685.1,654.4l0.4,0.5l-0.2-0.2l0.2,0.2L685.1,654.4l-0.1,0l0.5,0.5c0,0-0.1,0.1-0.1,0.1c0,0,0,0,0,0l-0.6-0.5l-0.3,0.1l-0.2-0.5
|
||||
l-3.4-2.9c0.2-0.2,0.4-0.4,0.6-0.6c0,0,0.1-0.1,0.1-0.1l0.6-0.6l0.5-0.2c2.8-1,5.3,0.1,6.5,2.6c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0.1,0.1,0.1,0.3,0.2,0.5L685.1,654.4z"/>
|
||||
<path class="st1" d="M75.3,605.9l6.9,23.9l18-5.2l9.6,33.4c-4.2,2.4-8.5,4.3-12.9,5.5c-8.3,2.4-15.9-0.1-22.7-7.6
|
||||
c-6.8-7.4-12.6-19.3-17.3-35.7c-4.6-15.9-5.2-29.3-1.8-40.2c3.4-10.9,10.2-17.9,20.5-20.8c7.2-2.1,15.6-1.9,25.2,0.5l2.2-24.6
|
||||
c-12.3-2.9-24.2-2.7-35.8,0.6C48.3,541.2,35.6,552,29,568.3c-6.6,16.2-6.6,36,0.1,59.4c7,24.2,16.9,41.5,29.7,51.7
|
||||
c12.8,10.2,27.7,12.9,44.6,8.1c14.2-4.1,26.8-10.6,37.9-19.7l-21.5-74.7L75.3,605.9z M51.9,563.3c-3.6-2.2-6.2-3.1-7.6-4.9
|
||||
c-0.8-1,0.1-4.4,1.2-5.1c2.7-1.6,5.6-0.2,6.8,2.6C53,557.4,52.2,559.5,51.9,563.3z M108.3,669.5c-0.1-0.4-0.2-0.8-0.3-1.2
|
||||
c0-0.1,0.5-0.3,0.6-0.2c0.3,0.3,0.6,0.6,0.8,1C109,669.2,108.7,669.3,108.3,669.5z"/>
|
||||
<path class="st1" d="M213.9,495.8l-26.9,7.7l27.8,96.4c2.5,8.7,2.9,15.9,1.1,21.5c-1.8,5.6-5.5,9.2-11.2,10.9
|
||||
c-8.4,2.4-15.2-0.3-20.4-8.3c-3.6,2.8-7.5,4.6-12.5,5c-5.3,0.4-7.5-2-5.7-6.8c1-2.6,3-5.7,5.4-6.6c2.6-1,5.4-1.3,8.2-1.2
|
||||
c-0.5-1.4-1-3-1.5-4.6l-19.2-66.6c-1.8-0.4-3-0.4-3.9-1c-0.4-0.3-0.2-2.4,0.2-2.5c0.8-0.2,1.8-0.2,2.7,0l-7.4-25.7l-26.9,7.7
|
||||
l15.3,53.3c1.2,0.6,2.1,1.2,2.7,2c1.8,2.1,1.6,4.6-0.4,6.1l9.3,32.4c5.1,17.7,12.7,30,22.9,36.9c10.2,6.9,22.5,8.2,37,4.1
|
||||
c14.8-4.3,24.8-12.1,30-23.5c5.2-11.4,5.3-25.7,0.3-43.1L213.9,495.8z M208.1,543.9l-2.7,1c-0.4-1.1-0.7-1.4-0.7-1.4l2.6-5.3
|
||||
c2.1,1.1,3,3.2,3.6,4.7L208.1,543.9z"/>
|
||||
<path class="st1" d="M331.9,579.7l18.9,34.3l27.2-7.8l-78.2-135.7L263,481l3.2,83.2c0,0,0.1-0.1,0.1-0.1c2.6-2.9,8.6-2.7,11.9,0.3
|
||||
c3.1,2.9,3.5,9.1,0.7,11.7c-2.8,2.6-7.9,2.1-11.2-1.1c-0.4-0.4-0.8-0.8-1.1-1.3l2.5,63.8l27.1-7.8l-2.2-39.1L331.9,579.7z
|
||||
M343.3,593.3l0.2-0.1c0.7-0.1,1.5,0,2.2,0.3c0,0,0,0,0,0l0.4,0.2l0.2,0.2l-2,3.4l0.7,1.8l-0.5-1l0.1,0.3l0.2,0.8l-0.5-1.5l0-0.1
|
||||
l0-0.1l0,0.1l0,0l-0.2,0.4l-0.6,1.1l0.8-1.6l0,0l-1.8-3.8L343.3,593.3z M320.6,529.5c0.9-0.1,1.8-0.2,2.8-0.3
|
||||
c2.6-0.1,4.7,0.9,5.7,3.3c0.7,1.7,1.8,2.9,3.2,4.1c0.9,0.8,1.7,2,2.1,3.2c1.2,3.3-0.4,6.8-3.4,7.7c-4,1.3-7.9-0.3-9.3-3.9
|
||||
c-0.5-1.2-0.9-2.4-1.4-3.8c-3.3,0.5-3.3,0.4-3.7-2.2c-0.1-1-0.3-2-0.3-3.1C316.2,531.6,317.7,529.9,320.6,529.5z M283.6,623.2
|
||||
l-2,1.4l0,0l-0.4,0.3l0.4-0.3l-1.1-2.1c0,0,0,0,0,0v0c0,0,0,0,0,0l-1.4-2.7c2.4-1.3,5.3-0.5,6.8,1.7L283.6,623.2z M289.2,515
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c0.9,2.1,2.6,5.6,5.1,10.7c0.4,0.1,0.8,0.3,1.1,0.5c0.4,0.2,0.6,1.6,0.4,2.5c0.3,0.7,0.7,1.4,1.1,2.1
|
||||
c4,7.8,6.5,12.7,7.6,14.6l5.8,10.4c0.2,0,0.5,0.1,0.7,0.1c-0.1,0.3-0.1,0.6-0.2,0.8l11.2,20.2l-22.3,6.4l1,0.3l0,0.2
|
||||
c-0.2,0.6-0.4,1.2-0.7,1.6c-0.1,0.2-0.2,0.3-0.2,0.5l0,0l-3.6-1.5l-1.6,0.5c0-0.4,0-0.7-0.1-1.1l-0.2-0.1c0-0.1,0.1-0.3,0.2-0.4
|
||||
C290.9,538.3,289.8,522.1,289.2,515z M296.6,579.1c2,4.2,0.5,6.5-3.7,9C291.6,583,292.7,580.6,296.6,579.1z"/>
|
||||
<path class="st1" d="M461.4,557L461.4,557c0-0.1,0-0.1-0.1-0.2c-0.1-0.2-0.1-0.3-0.2-0.3c0,0,0-0.1,0-0.1l1.5-1.4l-28.4-34.2
|
||||
c10.3-10.9,12.8-25.5,7.5-43.9c-4.2-14.6-10.9-24.4-20.1-29.5c-9.2-5-21.3-5.4-36.3-1.1l-35.4,10.2l7.1,24.5h0
|
||||
c0.1-0.1,0.2-0.2,0.3-0.2c0.1-0.1,0.2-0.2,0.4-0.2c1.5-0.7,3.6-0.1,4.2,1.2c0.6,1.3,0.1,3.1-1.2,3.8c-0.2,0.1-0.4,0.2-0.6,0.2
|
||||
c0,0-0.1,0-0.1,0c-0.2,0-0.3,0.1-0.5,0.1c0,0,0,0,0,0c-0.4,0-0.8-0.1-1.2-0.2l5.9,20.4l2.2-0.7c0.1,0.3,0.2,0.6,0.2,0.9
|
||||
c0,0.1,0,0.2,0,0.3c0,0.2,0.1,0.4,0.1,0.6c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.3,0,0.4c0,0.1,0,0.2-0.1,0.3
|
||||
c0,0.2-0.1,0.3-0.1,0.5c0,0.1,0,0.1-0.1,0.2c-0.2,0.6-0.5,1.2-0.9,1.7c0,0,0,0,0,0l7.9,27.4c0,0,0,0,0,0c0.2,0,0.5,0.1,0.8,0.1
|
||||
c0,0.1-0.1,0.3-0.1,0.4c0,0,0,0.1,0,0.1c0,0,0,0,0,0.1c-0.1,0.4-0.2,0.6-0.3,0.8l17.9,62.2l27.1-7.8l-16.3-56.6l9.7-2.8l39.3,50
|
||||
l29-8.3l-16.9-20.3L461.4,557z M367.6,465.7c-0.1-0.2-0.1-0.3-0.2-0.5c1.1-0.5,2.2-1,3.3-1.5c0.1,0.3,0.2,0.6,0.4,0.9
|
||||
C369.9,465,368.8,465.4,367.6,465.7z M388,556.7c-0.2,0.1-0.6-0.2-0.8-0.3c0.1-0.3,0.2-0.7,0.4-0.8c0.2-0.1,0.6,0.1,1,0.3
|
||||
C388.3,556.3,388.2,556.7,388,556.7z M397,585l0,0.4c0,0.2,0,0.3,0,0.5l0,5l-4.7-2.7l-1.1-0.9l0-1.5c0-0.3,0-0.7,0.1-1l0-0.3
|
||||
c0,0,0,0,0-0.1c0,0,0-0.1,0-0.1c0,0,0,0,0,0v0l3.8-0.3l0.5,0l1.5-0.1c0,0.3,0,0.6,0,0.9C397,584.8,397,584.9,397,585z M415.1,503
|
||||
c-1.7,4.4-5.8,7.5-12.2,9.4l-7,2l-11-38.1l-2,0.7l0.3,0.5l-0.6,0.3l-0.2-0.6l-0.3,0.1l-0.7-2.9l-1.1-2.1l0.5-0.3l0.5-0.1
|
||||
c0.3,0,0.6-0.1,0.8,0c0.1,0,0.2,0,0.3,0c0.1,0,0.3,0,0.4,0c0.3,0,0.7,0.1,1,0.2c0,0,0,0,0,0l6.6-1.9c6.2-1.8,11.2-1.5,15,0.8
|
||||
c3.9,2.3,6.9,7.2,9,14.6C416.6,492.8,416.8,498.6,415.1,503z M433.2,476.7c-0.5,0.3-1.5-0.3-2.3-0.6c0.2-0.7,0.5-1.5,0.8-2.6
|
||||
c1,0.5,2.2,0.8,2.2,1.1C434,475.3,433.7,476.5,433.2,476.7z M460.6,577.8l0.2,0.8l-0.1-0.4l0.1,0.4l-0.2-0.7l0,0L460.6,577.8
|
||||
L460.6,577.8L460.6,577.8l0.1,0.8L460.6,577.8l0.1,0.8l-0.2-1.1l-0.5-1.8l-0.8-2.9l0.9,2.9l-0.8-2.9c0.1,0,0.2-0.1,0.3-0.1
|
||||
c0.1,0,0.2-0.1,0.4-0.1l0.4,3l-0.3-3c1.3-0.1,2.6,0.3,3.6,1.3l-3.1,3.6L460.6,577.8z"/>
|
||||
<path class="st1" d="M506.8,529.2l37.9-10.9l18.9,34.3l27.2-7.8l-56.1-97.3l-1.6,0.3l0-0.1c-0.1-0.7-0.1-1.3-0.1-1.8
|
||||
c0-0.2,0-0.3,0-0.5l-0.1-1l-20.4-35.4l-36.7,10.6l0.8,20c0.3,0,0.5,0.1,0.9,0.2c-0.3,0.7-0.4,1.3-0.6,1.4c-0.1,0-0.1,0-0.2,0
|
||||
l1.1,27.9l2,0.4c-0.2,1.4-0.9,2.6-1.8,3.5l4,103.3l27.1-7.8L506.8,529.2z M526.4,522.7c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6
|
||||
c0.2,0,0.5,0,0.6,0.1C526.5,522.2,526.4,522.5,526.4,522.7z M541.7,492c-0.2-0.3-0.4-0.7-0.6-1c0.1,0,0.2-0.1,0.2-0.1
|
||||
c0.3,0.3,0.5,0.6,0.8,0.9C541.9,491.8,541.8,491.9,541.7,492z M549.5,490.8c1.4-0.7,3.8,0.1,4.6,1.5c0.7,1.3,0,3.4-1.4,4.1
|
||||
c-1.4,0.7-3.6,0.1-4.4-1.1C547.5,494,548.2,491.5,549.5,490.8z M539.3,479.9c0.1-0.1,0.1-0.2,0.2-0.4c0,0,0-0.1,0.1-0.1
|
||||
c0.1-0.1,0.2-0.3,0.2-0.4c0,0,0,0,0,0l5.4,2.5c0,0,0,0,0,0l0,0c-0.1,0.2-0.2,0.4-0.3,0.6c-0.1,0.1-0.1,0.2-0.2,0.3l-0.2,0.3
|
||||
l-2.6-1.4L539.3,479.9L539.3,479.9z M524.3,439.5c0.6-0.4,1.8-0.2,2.7,0c0.3,0.1,0.6,1.6,0.3,1.9c-0.5,0.6-1.5,0.7-3.1,1.4
|
||||
C524.2,441.1,523.9,439.8,524.3,439.5z M517.7,458.9c1.8-3.1,4.7-4.4,8.3-4.3c3.3,0.1,5.3,2.4,6.9,4.8c1.3,1.9,0.4,3.9,0.1,6.1
|
||||
c-2.2,0-3.8,0.3-5.3,2.2c-1.8,2.2-6.2,1.8-8.3,0C517.2,465.8,516.3,461.3,517.7,458.9z M484.4,473.7c-0.2-0.1-0.4-0.3-0.5-0.4
|
||||
c-0.1-0.1,0.1-0.3,0.2-0.5c0.3,0.2,0.5,0.4,0.8,0.6C484.7,473.6,484.5,473.8,484.4,473.7z M492.7,472c-1.5,0.9-4,0.3-4.5-1.2
|
||||
c-0.3-0.8,0.3-1.7,0.3-2.2c2.1-1.1,4.5-0.6,5.1,0.8C494.2,470.7,493.7,471.5,492.7,472z M505.3,503.7c-1.5-26.1-2.6-42.8-3.2-50
|
||||
c-0.7-7.3-1.4-13.9-2.1-19.8c1.1,2.7,3.7,7.9,7.7,15.7c4,7.8,6.5,12.7,7.6,14.6l5.5,9.9c1-0.1,2,0.3,2.3,1.1
|
||||
c0.2,0.5-0.2,1.1-0.3,1.5c-0.1,0.1-0.3,0.2-0.5,0.2l10.5,18.9l-21.2,6.1c0.7,0.2,1.3,0.4,1.9,0.8c0,0,0,0,0,0l0,0
|
||||
c1.1,0.7,1.8,1.8,2.1,3.2c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.2,0.1,0.3c0,0.3,0.1,0.5,0.1,0.8l-2.9,0.1l-1,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3c-0.1,0.1-0.3,0.3-0.4,0.4l-1.1-0.6l-0.2,0l0,0l-0.1,0l0,0l0.1,0v-0.1l-3.9-2.3c0,0,0,0,0-0.1
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.1-0.2,0.3-0.4,0.4-0.6c0,0,0,0,0,0l0,0c0.2-0.3,0.5-0.6,0.7-0.8c0.1-0.1,0.1-0.1,0.2-0.2L505.3,503.7z"
|
||||
/>
|
||||
<path class="st1" d="M671.8,476.8l-1.1,0.3l-74.7-91.5l-33.3,9.6l41.9,145.6l14.4-4.1c0.4-3.8,3.2-5.3,8.3-6.2
|
||||
c-0.2,1.6-0.5,3-1,4.1l3.4-1L606.9,454c-2.7-9.2-6-17.6-9.9-25.2l1.3-0.4l75.4,92.5l11.4-3.3l-0.5-1.5c0.1,0,0.1,0,0.2-0.1
|
||||
c0.2-0.1,0.2-0.5,0.1-0.8c-0.1-0.1-0.1-0.2-0.2-0.2c0,0,0,0,0,0l2.9-5.1c1.1,0.7,2,1.7,2.6,3.1l0.1,0.3l0.1,0.3
|
||||
c0.2,0.8,0.3,1.6,0.2,2.3l16-4.6l-11.6-40.2c-0.6,1.1-1.6,1.9-2.9,2.3h0c0,0-0.1,0-0.2,0c-0.1,0-0.2,0-0.3,0.1l-1-4.9l-0.2-1l0,0
|
||||
c-0.2,0-0.3,0.1-0.4,0.2c0,0,0,0-0.1,0c-0.1,0.1-0.1,0.1-0.1,0.2c0,0,0-0.1,0-0.2l0.2-13.4l-25.6-88.7l-24.9,7.2l22.9,79.5
|
||||
C665.6,462.1,668.6,470.2,671.8,476.8z M593.5,469.2c-0.2-0.1-0.5-0.1-0.6-0.2c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6-0.1
|
||||
C593.5,468.6,593.5,468.9,593.5,469.2z M600.9,412.4l-0.8-2.9l-0.8-2.9l0.8,2.9l0.8,2.9L600.9,412.4z M604.6,409.2L604.6,409.2
|
||||
C604.6,409.2,604.6,409.2,604.6,409.2c-0.7,1.6-1.9,2.7-3.6,3.2l-0.9-2.9l-0.8-2.9c0,0,0-0.2,0-0.5c-0.2-0.9-0.6-1.2-0.9-1.4
|
||||
c-0.1,0-0.2-0.1-0.2-0.1l1.7-5.7c0,0,0,0,0.1,0c2.6,0.9,4.5,3.1,5.2,6.2l0.1,0.5C605.3,406.9,605.1,408.1,604.6,409.2z M624,439.8
|
||||
c-2.9,1.3-7-0.3-8.6-3.3c-1.3-2.5,0.2-7,2.9-8.2c3.1-1.4,8.3,0.8,9.9,4.2C628.9,434.2,626.4,438.8,624,439.8z M647.4,473.3
|
||||
c-0.5,0.7-1.9,1.2-2.6,0.9c-2.7-0.9-5.2-2-6.2-5.4c1-0.7,1.9-1.5,3-1.9c1.5-0.6,2.9-0.4,4,1.1c0.6,0.8,1.4,1.6,1.8,2.6
|
||||
C647.6,471.4,647.8,472.7,647.4,473.3z M649.3,467.9c-0.2,0-0.5,0-0.6-0.1c-0.1-0.1,0-0.4,0-0.6c0.2,0,0.4,0,0.6,0.1
|
||||
C649.3,467.6,649.3,467.8,649.3,467.9z M656.6,464.8C656.6,464.8,656.6,464.8,656.6,464.8L656.6,464.8
|
||||
C656.6,464.9,656.6,464.9,656.6,464.8c-0.1,0.3-0.1,0.4-0.2,0.6l-1.8-0.8c1.2,2,0.9,2.3-1.7,2.8c0.4-0.9,0.8-1.9,1.2-3l-3.2-1.3
|
||||
l0,0c0-0.1,0-0.2-0.1-0.5c-1.4-2.1-2.2-2-2.7-1.9c-0.2,0.1-0.4,0.1-0.5,0.2l-1.2-2.7l-1.2-2.7c0.4-0.2,0.9-0.4,1.4-0.5c0,0,0,0,0,0
|
||||
c1.5-0.4,3.5-0.5,5.5,0.7c0,0,0,0,0,0c0,0,0,0,0,0c1.3,0.8,2.6,2,3.9,4l0.2,0.3l0.1,0.4C656.9,462.1,657,463.5,656.6,464.8z"/>
|
||||
<path class="st1" d="M754.7,497.6l-0.1-2.2c0.9,0,2,0.1,3.2,0.6c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.5,0.3,0.8,0.4l19.5-5.6
|
||||
L743,369.1l18-5.2c-3.3,0.2-6.5,0.5-9.7,0.7c-0.1,0-0.2,0-0.3,0c-0.5,0-1,0.1-1.5,0.1c-0.2,0-0.3,0-0.5,0c-0.5,0-0.9,0-1.4,0
|
||||
c-0.2,0-0.4,0-0.6,0c-0.7,0-1.3,0-2,0c-3.1,0-6.3-0.9-7.1-4.8c-0.6-3.2,1.8-6.4,5.9-7.5c3.9-1,7.8-1.7,12.3-2.7
|
||||
c0,0.3,0.1,0.6,0.2,0.9c0,0.1,0,0.1,0.1,0.2c0.1,0.2,0.1,0.5,0.2,0.7c0,0,0,0,0,0c1.7,3.9,6.5,6.7,4.4,12.3c0,0,0,0,0,0l9.8-2.8
|
||||
l-6.9-23.8L717,350.8l2.3,1.2c0,0,0,0,0,0h0c-0.2,0.3-0.4,0.7-0.6,1l-0.2,0.4l0,0L716,352l-0.9-0.6l-33.7,9.7l6.9,23.8l27.9-8
|
||||
l35.1,121.8L754.7,497.6z M708.8,359.6c-0.3-0.5-0.4-1.4-0.2-2c0.2-0.4,1.1-0.5,1.6-0.8c0.2,0.8,0.5,1.7,0.9,2.9
|
||||
C709.9,359.7,709,359.9,708.8,359.6z M745.1,378c0,0.2,0,0.4,0,0.5v0c-0.2,1.9-1.2,3.5-2.7,4.3c-0.1,0.1-0.3,0.1-0.4,0.2l-2.1-5.4
|
||||
v0L745.1,378L745.1,378z"/>
|
||||
<g>
|
||||
<path class="st1" d="M860.2,372.5l-35.7,10.3l-10-34.6L853,337l-6.7-23.4l-65.6,18.9l41.9,145.6l65.6-18.9l-1.6-5.7l-0.5-0.9
|
||||
l-0.4,0.5c0,0,0,0,0,0v0c-0.3-0.3-0.6-0.6-0.9-0.9c-0.1-0.1-0.3-0.3-0.4-0.4c0,0,0,0,0,0l0.3-0.4c0,0,0-0.1,0-0.1l0,0v0l0.1,0
|
||||
l0-0.1l0.8-1.1l-4.2-14.7l-38.5,11.1l-11.6-40.3l23.1-6.7c0-0.2,0-0.4,0-0.6c0.5,0.1,1.1,0.1,1.6,0.1l11.1-3.2L860.2,372.5z
|
||||
M809.4,414.7l-3.8-1.3l4.9-3.6l1.6-1l1.7,1.1l1.1,0.4l0,0.4l2.4,1.6l-2,1.5l0.2,1.7l-5.8,0.5L809.4,414.7z M815.9,447L815.9,447
|
||||
c-0.1-0.1-0.1-0.3-0.2-0.4c-0.1-0.2-0.2-0.4-0.3-0.6c0-0.1-0.1-0.2-0.1-0.2c0-0.1-0.1-0.1-0.1-0.2l1.1-0.9l1.1-1l2.2-1.9l0.1,0.2
|
||||
c0.2,0.2,0.3,0.5,0.4,0.7c0,0,0,0,0,0l0,0c0.1,0.3,0.3,0.5,0.4,0.7c0.1,0.2,0.1,0.3,0.2,0.5l0,0L815.9,447z"/>
|
||||
<path class="st1" d="M884.7,451.3l0.6-0.1l-0.2-0.3C885,451,884.8,451.1,884.7,451.3z"/>
|
||||
</g>
|
||||
<polygon class="st1" points="969.2,410.2 930.6,421.3 919,380.9 954.8,370.6 948,347.1 912.3,357.4 902.3,322.8 940.8,311.7
|
||||
934.1,288.3 868.5,307.2 910.4,452.8 976,433.9 "/>
|
||||
<path class="st1" d="M405.3,270.3l-0.3,0.1l21.7,10.3l1.4,22.6c0-0.3,0.1-0.6,0.2-0.8c0.4,0.1,0.9,0.1,1.2,0.3
|
||||
c0.2,0.2,0.1,0.7,0.1,1.4c-0.7-0.3-1.3-0.3-1.4-0.6c0-0.1,0-0.1-0.1-0.2l0.9,15.4l26.1-27.7l4.5,1.2c-2.6-1.4-4.5-2.3-5.7-3.8
|
||||
c-0.7-1,0.1-4.4,1.2-5.2c2.7-1.6,5.6-0.2,6.9,2.6c0.6,1.5-0.1,3.5-0.4,6.8l30.3,7.9l-6.8-12.5c-0.4,0.5-1,1-1.7,1.4
|
||||
c-2.1,0.7-4.1,0.6-6-0.8c-0.6-0.4-1.3-1.4-1.2-2c0.4-2.1,1-4.1,1.7-6c0.2-0.5,1.3-0.8,2.1-0.8c0.2,0,0.4,0,0.6,0l-7-12.8l20.5-32.1
|
||||
l-37.4,7.1l-24.2-29.4l-4.8,37.8l-35.5,13.9l12.4,5.9L405.3,270.3z M434.4,277.6c1.9-1.4,1.9-1.4,3.6,0.8
|
||||
C436.5,278.1,435.6,277.9,434.4,277.6z M444.6,256.9c-1.4-0.7-2.5-0.9-3-1.6c-0.8-0.9-0.4-2,0.6-2.6c1-0.6,2.7-0.2,2.9,0.9
|
||||
C445.2,254.5,444.8,255.4,444.6,256.9z M448.8,285.2c0.6,0.3,1.2,0.6,1.7,0.9c0.1,0.1-0.3,1.1-0.4,1.1c-0.6-0.1-1.2-0.4-1.8-0.6
|
||||
C448.5,286.3,448.6,285.9,448.8,285.2z M437.6,235.1c3.1-1.3,6.3-0.3,7.8,2.6c1.7,3.2,0.5,6.9-2.7,8.4c-2.4,1.1-7.2-0.8-8.5-3.5
|
||||
C433,240,434.6,236.3,437.6,235.1z M415.3,266c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1-0.1,0.5-0.2,1c-0.5-0.2-0.9-0.3-1.3-0.5
|
||||
C415.1,266.7,415.2,266.4,415.3,266z"/>
|
||||
<path class="st1" d="M334.6,345.9l19-20.2l26.8,7l-13.3-24.3l15-23.4l-27.2,5.2l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
L334.6,345.9z M351.1,302.9c0.8,0.9,0.6,3.2,0,4.4c-0.3,0.6-3.2,0.6-3.9-0.1c-1-1-1-2.8-1.9-5.6C348.2,302.1,350.4,302,351.1,302.9
|
||||
z M339.5,298c0.2-0.2,1.1,0.4,2.3,0.8c-0.9,0.9-1.4,1.6-2.1,1.9c-0.3,0.2-0.9-0.4-1.4-0.7C338.7,299.4,339,298.5,339.5,298z"/>
|
||||
<path class="st1" d="M568.4,269.9c0.1,0.1,0.2,0.3,0.2,0.6l14.5,3.8l-13.3-24.3l13.4-21l-1.6-0.2l2.1-0.6l1-1.5l-17.2,3.3
|
||||
c0.1,0.3,0.2,0.6,0.3,0.9c-1,0.1-1.9,0.5-2.4,0.2c-0.2-0.1-0.3-0.3-0.4-0.6l-7.6,1.4l-17.6-21.4l-3.5,27.5l-25.8,10.1l25.1,11.8
|
||||
l1.7,27.7l19-20.2l9,2.3C566.2,269.4,567.5,269.5,568.4,269.9z M538.7,241.2c0.9-0.7,2.1-0.3,2.5,0.7c0.3,0.6-0.1,1.5-0.2,2.9
|
||||
c-1.4-0.7-2.5-0.9-3-1.5C537.7,242.9,538.1,241.6,538.7,241.2z M541.8,246.2c-0.1,0.3-0.3,0.6-0.5,0.9c0,0,0,0,0,0
|
||||
c-0.1,0.1-0.1,0.2-0.2,0.3l-5.5-2.1c0.2-0.7,0.6-1.2,0.8-1.6c0.1-0.1,0.2-0.2,0.2-0.4l0,0L541.8,246.2
|
||||
C541.8,246.2,541.8,246.2,541.8,246.2z M550.9,254.1c-0.5,1.8-1.6,3.2-3,4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0h0
|
||||
c-0.3,0.1-0.5,0.3-0.8,0.4c0,0-0.1,0-0.1,0.1l-1-2.8l-0.6-2.1c0,0,0,0,0,0c0,0-0.1,0-0.1,0l0-0.4l-0.1-0.4c0,0,0.1,0,0.1-0.1v-5.1
|
||||
c4.7,0.1,5.7,3.3,5.9,5.2l0.1,0.6L550.9,254.1z M557.2,259.6c-0.2-0.3-0.4-0.6-0.6-1c-0.1-0.2-0.2-0.4-0.3-0.5c0,0,0.3,0.4,0.9,0.5
|
||||
l0.8-2.9l0.8-2.9c0.3,0.1,0.6,0.2,0.8,0.4c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0l0,0l0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0l0,0l0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0l0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0v0c0,0,0,0,0,0s0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0l0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.6,0.6,0.9,1.2,1.2,1.7c0.1,0.2,0.2,0.3,0.3,0.5c0,0,0,0,0,0l-2.4,1.7L557.2,259.6z"/>
|
||||
<g>
|
||||
<path class="st1" d="M456,117.5c0.2,0.7,0.4,1.4,0.5,2c67.8-10,135-1.4,195.9,22.5c1.2-1.5,3-2.8,5.6-4c6.8-3.1,16.9-0.1,19.9,5.8
|
||||
c1.1,2.2,1.1,5.8,0.3,9.4c31.8,15.3,61.5,34.8,88.1,58.3c0.3-0.4,0.6-0.7,1.1-0.9c1.5-0.7,3.6-0.1,4.3,1.2c0.6,1.2,0.1,2.9-1,3.6
|
||||
c16,14.5,30.8,30.4,44.3,47.6l12-3.5C768,182.5,682.6,129.8,588.2,111.3c0.2,0.1,0.3,0.3,0.5,0.4c2.2,2.3,0.8,6.4-2.1,7.6
|
||||
c-3.1,1.3-6,0.2-7.1-2.7c-0.6-1.8,0-3.9,0.5-6.9c-42.3-7.4-86.2-8-130.3-0.9C452.7,111.5,455,114.4,456,117.5z M685.1,144.4
|
||||
c0.7,0.2,1.7,0.2,2,0.6c0.3,0.5,0,1.3-0.1,2.4c-1-0.4-1.9-0.5-2-0.9C684.7,145.8,685,145.1,685.1,144.4z M537.6,107
|
||||
c0.4,0.2,0.8,0.3,1.2,0.5c0.1,0.1,0,0.6-0.1,0.6c-0.4,0.1-0.9,0-1.3,0C537.5,107.8,537.5,107.4,537.6,107z"/>
|
||||
<path class="st1" d="M129.9,456c-3.2-3.1-4.6-13.5-2.1-16.3c1.1-1.3,2.9-2,4.9-2.2c7.3-44.3,22.4-86.8,44.1-125.5
|
||||
c-1-0.1-1.8-0.3-2.5-0.7c-2.3-1.3-2.7-3.7-0.9-5.7c1.8-1.9,4.3-2,6-0.1c0.2,0.3,0.4,0.6,0.6,1c48.1-82.5,126.7-147.3,225.6-175.8
|
||||
c15-4.3,30.1-7.7,45.1-10.1c-0.1-0.4-0.2-0.7-0.3-1.1c-0.9-2.9-4.4-6.3-8.9-9.1c-13.1,2.4-26.1,5.4-39.1,9.2
|
||||
c-84.3,24.3-154.3,74.2-204,138.8l1,0.5c-0.1,0.3-0.3,0.6-0.4,0.9c-0.8,1.6-1.7,3.1-2.8,4.4c-0.7,0.9-1.5,1.7-2.3,2.5c0,0,0,0,0,0
|
||||
l-0.9-1c-42.3,57.6-68.8,126.2-75.4,198.5l12-3.5c0.2-1.5,0.3-2.9,0.5-4.4C130,456.1,129.9,456.1,129.9,456z M134.9,403.2l1.8,1.9
|
||||
v0l-2.1,2l-2.1,2l-1.8-1.9L134.9,403.2z"/>
|
||||
</g>
|
||||
<path class="st1" d="M725.5,833.5c0.1,0,0.1,0,0.2,0c0.5-0.3,1-0.7,1.5-1l-2.8-0.7c0.7-2.9,1.1-5.9,1.4-8.9l5.8,0.7
|
||||
c-0.2,2.3-0.5,4.5-0.9,6.7c107.4-71,173.8-190.9,177.3-319.5l-11.7,3.4c-1.3,35-7.4,69.2-17.8,102c1.3,0,2.5,0.5,3.6,1.4
|
||||
c2.2,1.9,2.4,4.4,1.9,6.9c-0.4,2-3,4.2-5,3.8c-1.4-0.3-2.8-0.9-4-1.7C840,727,763.9,811.5,660.7,854.6c0,0.3,0,0.6,0.1,0.9
|
||||
c-0.6-0.1-1.1-0.2-1.5-0.3c-13.2,5.4-26.8,10.2-40.8,14.3c-163.7,47.2-333.3-19.4-424.3-153l-11.7,3.4
|
||||
c54.3,81.4,136.7,139.2,229.7,163.5l4.3-2.9c0.1,0.2,0.2,0.4,0.3,0.5l0-0.1l1.8,3.2l2.9,0.3l-0.6,1.1c4.4,1,8.8,2,13.2,2.9
|
||||
l-0.1-3.1c0,0,0,0,0,0l0,0c0,0,0,0,0,0c0.1,0,0.1,0,0.2,0c0,0,0.1,0,0.1,0l0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0,0,0,0,0c0,0,0,0,0,0h0c0,0,0.1,0,0.1,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0.3,0.1,0.6,0.2,0.9,0.3l0,0c0,0,0,0,0,0s0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0,0,0,0,0,0c0.6,0.3,1.1,0.7,1.5,1c0.1,0.1,0.3,0.2,0.4,0.3l0.9,0.6
|
||||
l0.3,1.1c0,0.2,0.1,0.3,0.1,0.5c58.8,11.1,121.1,8.9,182.5-8.8c37.5-10.8,72.2-26.7,103.6-46.7
|
||||
C725.4,833.7,725.5,833.5,725.5,833.5z M874.3,655.5c-3.1,2.4-4.7,2.8-7,1.7C868.9,655,870.4,654.6,874.3,655.5z M837.2,711.5
|
||||
c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2c-0.3-0.2-0.3-0.7-0.4-1.1C836.4,711.7,836.9,711.3,837.2,711.5z M407.5,874.8
|
||||
c0,0.3,0,0.6,0,0.9c0,0.2,0,0.3,0,0.5l-5.8,0.5v0c0-0.1,0-0.1,0-0.2c-0.1-0.7,0-1.4,0-2l0-0.5v0l0,0l5.8,0.4L407.5,874.8z
|
||||
M473.8,885.7l1.9,2.3c-0.5,0.4-0.8,0.8-0.9,1.3l-5.5-2.1c0.1-0.2,0.2-0.4,0.3-0.7c0,0,0,0,0,0v0c0.5-1.2,1.3-2.3,2.4-3.2l0.1-0.1
|
||||
L473.8,885.7l1.9,2.3L473.8,885.7l-1.9-2.3L473.8,885.7z"/>
|
||||
<path class="st1" d="M396.5,98.9c131.9-38,267.3-8,368.7,69.2c0.7-2.6,2.5-5,4.7-5.9c0,0,0,0,0,0c-0.4-1.2,0-2.4,1.2-3.1
|
||||
c1.3-0.8,3-0.4,3.7,0.8c0.4,0.6,0.4,1.5,0.1,2.3c2.2,0.7,4.3,2.3,5.2,4.4c1.8,3.8,0.5,8.7-2.9,10.3c-0.2,0.1-0.5,0.2-0.8,0.3
|
||||
c5.8,4.7,11.5,9.7,17,14.7c0.9-2.2,2.4-4.1,4.1-5.9c1-1.1,2.1-1.5,3.6-1.5c5.2,0.1,5.5,0.3,7.2,5.4c0.1,0.3,0.4,0.6,0.5,0.9
|
||||
c0.2,0,0.4,0,0.6,0c-0.1-0.9-0.2-1.9-0.3-2.9c3,1.2,4.5,3.8,3.7,6.8c-0.1,0.3-0.2,0.5-0.3,0.8c2-0.7,4-1.8,6.3-2.7
|
||||
c1,3.4,2.3,6.2,2.4,9c0.2,5.4-3.5,8.1-9.1,7.1c-0.5-0.1-1-0.2-1.5-0.3c13.6,13.9,26.3,28.9,38,44.8l21.1-6.1
|
||||
C780.5,120.4,628.1,48.7,470.7,63.8c1.9,2.3,2,5.6,0.2,7.4c-2.5,2.4-7.9,2-10.5-0.8c-1.6-1.7-2.2-3.6-1.9-5.3
|
||||
c-22.5,2.8-45.1,7.4-67.7,13.9c-11,3.2-21.8,6.7-32.3,10.7c0.1,1,0,2.1,0.2,3c-1.6,0-3.2,0-5.6,0c0-0.3,0-0.6-0.1-0.9
|
||||
C227.1,140.7,135,243,95.4,364.7c1.4-0.5,2.9,0.2,3.9,1.7c0.9,1.5,1.2,3.4,2.2,6.7c-3.4-0.9-5.5-0.9-7-1.9
|
||||
c-0.4-0.3-0.7-0.6-0.9-0.9c-5.4,17.4-9.7,35.1-12.9,53.2l0.3-0.5l-0.3,0.6c0,0.1,0,0.1,0,0.2L81,423l0.2,0.1
|
||||
c0.5,0.4,0.9,0.8,1.3,1.3c0.7,0.9,1.1,2,1.4,3.4l0.1,0.5c0,1.7-0.3,3.2-1.1,4.3l-3.5-2.3c-2.4,15.2-4.1,30.5-5,46l21.1-6.1
|
||||
C107.7,300.7,223.5,148.7,396.5,98.9z M749.4,142.3c0.2-1.2,1.4-1.3,2.5-1.2c1.2,0.1,2.3,0.3,4,0.4c-1.1,1.1-1.8,2.4-3,3.1
|
||||
c-0.6,0.4-2,0.1-2.8-0.3C749.6,144.1,749.3,142.9,749.4,142.3z M745.2,129.2c0.3,0.2,0.3,0.7,0.4,1.1c-0.4,0.1-0.9,0.4-1.1,0.2
|
||||
c-0.3-0.2-0.3-0.7-0.4-1.1C744.4,129.3,744.9,129,745.2,129.2z M723.5,130.8c1.2-0.5,3.1,0.2,3.6,1.3c0.5,1-0.8,3.4-2,3.8
|
||||
c-1.4,0.4-2.2-0.4-2.8-1.5C721.4,133.1,722.1,131.3,723.5,130.8z M673,99.4c0.7-0.2,1.6,0.2,3,0.5c-0.6,1.4-0.8,2.4-1.4,3
|
||||
c-0.6,0.6-2.2,0-2.5-1C671.6,100.8,671.8,99.7,673,99.4z M571.9,68.8l0-1l0.2,0c0.3,0,0.5,0,0.6,0c0,0,0,0,0,0l0,0.8l2.6-0.5
|
||||
l-2.6,0.6l0,0l2.6-0.5l0,0c0.1,0.4,0.1,0.7,0.2,1.1v0c0,0,0,0,0,0c0,0,0,0,0,0v0c0,0.3,0,0.5,0.1,0.8l0.3,3.7l-3.5-0.1l-0.2-3
|
||||
l0.1,3c-0.2,0-0.4,0-0.5,0l-0.1,0l0.1-2.9l-2,0.1l0,0l0,0l0-0.5c0-0.5-0.1-0.9-0.1-1.3L571.9,68.8L571.9,68.8l-2.2,0.4L571.9,68.8z
|
||||
M230.9,174.4l1.8-0.4l-0.2-0.5c0,0,0,0,0,0c0.1,0,0.2-0.1,0.2-0.1c0,0,0.1,0,0.1,0h0l0.3,0.5l0.4-0.1l0,0l0.3-0.1l-0.3,0.1l0,0.7
|
||||
l2.3,4c-0.3,0.2-0.7,0.4-1.1,0.6l-0.5,0.2l-0.5,0c-2.8,0.1-5-1.5-5.7-4.1c0-0.1-0.1-0.2-0.1-0.3L230.9,174.4z M91.5,418.1
|
||||
c-0.2,0.1-1.4-0.4-1.5-0.7c-0.2-0.7,0.1-1.5,0.2-2.7c1.2,0.7,1.9,1.1,2.6,1.6C92.4,416.9,92.1,417.7,91.5,418.1z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Determine if an object is a Buffer
|
||||
*
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
|
||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
||||
*/
|
||||
|
||||
/** @license React v0.20.2
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v17.0.2
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v17.0.2
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
40
html/wp-content/plugins/post-smtp/freemius/composer.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "freemius/wordpress-sdk",
|
||||
"description": "Freemius WordPress SDK",
|
||||
"keywords": ["freemius", "wordpress", "plugin", "wordpress-plugin", "theme", "wordpress-theme", "sdk"],
|
||||
"homepage": "https://freemius.com",
|
||||
"license": "GPL-3.0-only",
|
||||
"scripts": {
|
||||
"phpcs": ["Composer\\Config::disableProcessTimeout", "phpcs -p -s --colors"],
|
||||
"phpcs:ci": ["Composer\\Config::disableProcessTimeout", "phpcs --standard=phpcompat.xml -p -s --colors"],
|
||||
"phpstan": "./vendor/bin/phpstan analyse phpstan.neon --memory-limit 2G",
|
||||
"phpstan:log": "./vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 2G > error-phpstan.xml"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"start.php"
|
||||
]
|
||||
},
|
||||
"require-dev": {
|
||||
"wp-coding-standards/wpcs": "^2.3",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
|
||||
"squizlabs/php_codesniffer": "^3.7",
|
||||
"phpcompatibility/php-compatibility": "^9.3",
|
||||
"phpcompatibility/phpcompatibility-wp": "^2.1",
|
||||
"szepeviktor/phpstan-wordpress": "^1.3",
|
||||
"phpstan/extension-installer": "^1.3"
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true,
|
||||
"phpstan/extension-installer": true
|
||||
},
|
||||
"platform": {
|
||||
"php": "8.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
391
html/wp-content/plugins/post-smtp/freemius/config.php
Normal file
@@ -0,0 +1,391 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__SLUG' ) ) {
|
||||
define( 'WP_FS__SLUG', 'freemius' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DEV_MODE' ) ) {
|
||||
define( 'WP_FS__DEV_MODE', false );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region API Connectivity Issues Simulation
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY' ) ) {
|
||||
define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__SIMULATE_NO_CURL' ) ) {
|
||||
define( 'WP_FS__SIMULATE_NO_CURL', false );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
|
||||
define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
|
||||
define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
|
||||
}
|
||||
if ( WP_FS__SIMULATE_NO_CURL ) {
|
||||
define( 'FS_SDK__SIMULATE_NO_CURL', true );
|
||||
}
|
||||
if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
|
||||
define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true );
|
||||
}
|
||||
if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
|
||||
define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if ( ! defined( 'WP_FS__SIMULATE_FREEMIUS_OFF' ) ) {
|
||||
define( 'WP_FS__SIMULATE_FREEMIUS_OFF', false );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES' ) ) {
|
||||
/**
|
||||
* @since 1.1.7.3
|
||||
* @author Vova Feldman (@svovaf)
|
||||
*
|
||||
* I'm not sure if shared servers periodically change IP, or the subdomain of the
|
||||
* admin dashboard. Also, I've seen sites that have strange loop of switching
|
||||
* between domains on a daily basis. Therefore, to eliminate the risk of
|
||||
* multiple unwanted connectivity test pings, temporary ignore domain or
|
||||
* server IP changes.
|
||||
*/
|
||||
define( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false );
|
||||
}
|
||||
|
||||
/**
|
||||
* If your dev environment supports custom public network IP setup
|
||||
* like VVV, please update WP_FS__LOCALHOST_IP with your public IP
|
||||
* and uncomment it during dev.
|
||||
*/
|
||||
if ( ! defined( 'WP_FS__LOCALHOST_IP' ) ) {
|
||||
// VVV default public network IP.
|
||||
define( 'WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4' );
|
||||
|
||||
// define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP );
|
||||
}
|
||||
|
||||
/**
|
||||
* If true and running with secret key, the opt-in process
|
||||
* will skip the email activation process which is invoked
|
||||
* when the email of the context user already exist in Freemius
|
||||
* database (as a security precaution, to prevent sharing user
|
||||
* secret with unauthorized entity).
|
||||
*
|
||||
* IMPORTANT:
|
||||
* AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST.
|
||||
* THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S
|
||||
* CLOCK IS SYNCED.
|
||||
*/
|
||||
if ( ! defined( 'WP_FS__SKIP_EMAIL_ACTIVATION' ) ) {
|
||||
define( 'WP_FS__SKIP_EMAIL_ACTIVATION', false );
|
||||
}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Directories
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
if ( ! defined( 'WP_FS__DIR' ) ) {
|
||||
define( 'WP_FS__DIR', dirname( __FILE__ ) );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DIR_INCLUDES' ) ) {
|
||||
define( 'WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DIR_TEMPLATES' ) ) {
|
||||
define( 'WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DIR_ASSETS' ) ) {
|
||||
define( 'WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DIR_CSS' ) ) {
|
||||
define( 'WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DIR_JS' ) ) {
|
||||
define( 'WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DIR_IMG' ) ) {
|
||||
define( 'WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DIR_SDK' ) ) {
|
||||
define( 'WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk' );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/**
|
||||
* Domain / URL / Address
|
||||
*/
|
||||
define( 'WP_FS__ROOT_DOMAIN_PRODUCTION', 'freemius.com' );
|
||||
define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
|
||||
define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
|
||||
|
||||
if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
|
||||
define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
|
||||
define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
|
||||
define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region HTTP
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
|
||||
define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_METHOD'] ) );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
|
||||
define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
|
||||
// Checks if CloudFlare's HTTPS (Flexible SSL support).
|
||||
isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
|
||||
'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
|
||||
) ||
|
||||
// Check if HTTPS request.
|
||||
( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
|
||||
( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
|
||||
define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
|
||||
strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
|
||||
define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
|
||||
if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
|
||||
define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
|
||||
} else {
|
||||
define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
|
||||
is_string( WP_FS__REMOTE_ADDR ) &&
|
||||
( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
|
||||
WP_FS__REMOTE_ADDR === '::1' )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
|
||||
define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
|
||||
false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
|
||||
// By default, run with Freemius production servers.
|
||||
define( 'WP_FS__IS_PRODUCTION_MODE', true );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__ADDRESS' ) ) {
|
||||
define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
|
||||
}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region API
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
|
||||
define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius-local.com:8080' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
|
||||
define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
|
||||
}
|
||||
|
||||
// Set API address for local testing.
|
||||
if ( ! WP_FS__IS_PRODUCTION_MODE ) {
|
||||
if ( ! defined( 'FS_API__ADDRESS' ) ) {
|
||||
define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
|
||||
}
|
||||
if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
|
||||
define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Checkout
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
|
||||
define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
|
||||
}
|
||||
|
||||
if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
|
||||
define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius-local.com:8080' );
|
||||
}
|
||||
|
||||
if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
|
||||
define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
|
||||
|
||||
if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
|
||||
define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
|
||||
define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__GDPR_OPTION_NAME' ) ) {
|
||||
define( 'WP_FS__GDPR_OPTION_NAME', WP_FS___OPTION_PREFIX . 'gdpr' );
|
||||
}
|
||||
define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
|
||||
|
||||
/**
|
||||
* Module types
|
||||
*
|
||||
* @since 1.2.2
|
||||
*/
|
||||
define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
|
||||
define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
|
||||
|
||||
/**
|
||||
* Billing Frequencies
|
||||
*/
|
||||
define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
|
||||
define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
|
||||
define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
|
||||
|
||||
/**
|
||||
* Plans
|
||||
*/
|
||||
define( 'WP_FS__PLAN_DEFAULT_PAID', false );
|
||||
define( 'WP_FS__PLAN_FREE', 'free' );
|
||||
define( 'WP_FS__PLAN_TRIAL', 'trial' );
|
||||
|
||||
/**
|
||||
* Times in seconds
|
||||
*/
|
||||
if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
|
||||
define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
|
||||
define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
|
||||
}
|
||||
// define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
|
||||
if ( ! defined( 'WP_FS__TIME_12_HOURS_IN_SEC' ) ) {
|
||||
define( 'WP_FS__TIME_12_HOURS_IN_SEC', 43200 );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
|
||||
define( 'WP_FS__TIME_24_HOURS_IN_SEC', WP_FS__TIME_12_HOURS_IN_SEC * 2 );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__TIME_WEEK_IN_SEC' ) ) {
|
||||
define( 'WP_FS__TIME_WEEK_IN_SEC', 7 * WP_FS__TIME_24_HOURS_IN_SEC );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Debugging
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
|
||||
$debug_mode = get_option( 'fs_debug_mode', null );
|
||||
|
||||
if ( $debug_mode === null ) {
|
||||
$debug_mode = false;
|
||||
add_option( 'fs_debug_mode', $debug_mode );
|
||||
}
|
||||
|
||||
define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
|
||||
define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
|
||||
define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
|
||||
}
|
||||
if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
|
||||
define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
|
||||
}
|
||||
|
||||
if ( WP_FS__ECHO_DEBUG_SDK ) {
|
||||
error_reporting( E_ALL );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
|
||||
define( 'WP_FS__SCRIPT_START_TIME', time() );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
|
||||
define( 'WP_FS__DEFAULT_PRIORITY', 10 );
|
||||
}
|
||||
if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
|
||||
define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Multisite Network
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Do not use this define directly, it will have the wrong value
|
||||
* during plugin uninstall/deletion when the inclusion of the plugin
|
||||
* is triggered due to registration with register_uninstall_hook().
|
||||
*
|
||||
* Instead, use fs_is_network_admin().
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
*/
|
||||
if ( ! defined( 'WP_FS__IS_NETWORK_ADMIN' ) ) {
|
||||
define( 'WP_FS__IS_NETWORK_ADMIN',
|
||||
is_multisite() &&
|
||||
( is_network_admin() ||
|
||||
( ( defined( 'DOING_AJAX' ) && DOING_AJAX &&
|
||||
( isset( $_REQUEST['_fs_network_admin'] ) && 'true' === $_REQUEST['_fs_network_admin'] /*||
|
||||
( ! empty( $_REQUEST['action'] ) && 'delete-plugin' === $_REQUEST['action'] )*/ )
|
||||
) ||
|
||||
// Plugin uninstall.
|
||||
defined( 'WP_UNINSTALL_PLUGIN' ) )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not use this define directly, it will have the wrong value
|
||||
* during plugin uninstall/deletion when the inclusion of the plugin
|
||||
* is triggered due to registration with register_uninstall_hook().
|
||||
*
|
||||
* Instead, use fs_is_blog_admin().
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
*/
|
||||
if ( ! defined( 'WP_FS__IS_BLOG_ADMIN' ) ) {
|
||||
define( 'WP_FS__IS_BLOG_ADMIN', is_blog_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX && isset( $_REQUEST['_fs_blog_admin'] ) ) );
|
||||
}
|
||||
|
||||
if ( ! defined( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED' ) ) {
|
||||
// Set to true to show network level settings even if delegated to site admins.
|
||||
define( 'WP_FS__SHOW_NETWORK_EVEN_WHEN_DELEGATED', false );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
|
||||
define( 'WP_FS__DEMO_MODE', false );
|
||||
}
|
||||
if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
|
||||
define( 'FS_SDK__SSLVERIFY', false );
|
||||
}
|
||||
@@ -0,0 +1,538 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* - Each instance of Freemius class represents a single plugin
|
||||
* install by a single user (the installer of the plugin).
|
||||
*
|
||||
* - Each website can only have one install of the same plugin.
|
||||
*
|
||||
* - Install entity is only created after a user connects his account with Freemius.
|
||||
*
|
||||
* Class Freemius_Abstract
|
||||
*/
|
||||
abstract class Freemius_Abstract {
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Identity
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Check if user has connected his account (opted-in).
|
||||
*
|
||||
* Note:
|
||||
* If the user opted-in and opted-out on a later stage,
|
||||
* this will still return true. If you want to check if the
|
||||
* user is currently opted-in, use:
|
||||
* `$fs->is_registered() && $fs->is_tracking_allowed()`
|
||||
*
|
||||
* @since 1.0.1
|
||||
*
|
||||
* @param bool $ignore_anonymous_state Since 2.5.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_registered( $ignore_anonymous_state = false );
|
||||
|
||||
/**
|
||||
* Check if the user skipped connecting the account with Freemius.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_anonymous();
|
||||
|
||||
/**
|
||||
* Check if the user currently in activation mode.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_activation_mode();
|
||||
|
||||
#endregion
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Module Type
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Checks if the plugin's type is "plugin". The other type is "theme".
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_plugin();
|
||||
|
||||
/**
|
||||
* Checks if the module type is "theme". The other type is "plugin".
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_theme() {
|
||||
return ( ! $this->is_plugin() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Permissions
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Check if plugin must be WordPress.org compliant.
|
||||
*
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_org_repo_compliant();
|
||||
|
||||
/**
|
||||
* Check if plugin is allowed to install executable files.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.5
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_allowed_to_install() {
|
||||
return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/**
|
||||
* Check if user in trial or in free plan (not paying).
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.4
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_not_paying() {
|
||||
return ( $this->is_trial() || $this->is_free_plan() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user has an activated and valid paid license on current plugin's install.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_paying();
|
||||
|
||||
/**
|
||||
* Check if the user is paying or in trial.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_paying_or_trial() {
|
||||
return ( $this->is_paying() || $this->is_trial() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user in a trial or have feature enabled license.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function can_use_premium_code();
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Premium Only
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* All logic wrapped in methods with "__premium_only()" suffix will be only
|
||||
* included in the premium code.
|
||||
*
|
||||
* Example:
|
||||
* if ( freemius()->is__premium_only() ) {
|
||||
* ...
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns true when running premium plugin code.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is__premium_only() {
|
||||
return $this->is_premium();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user has an activated and valid paid license on current plugin's install.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
function is_paying__premium_only() {
|
||||
return ( $this->is__premium_only() && $this->is_paying() );
|
||||
}
|
||||
|
||||
/**
|
||||
* All code wrapped in this statement will be only included in the premium code.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param string $plan Plan name.
|
||||
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_plan__premium_only( $plan, $exact = false ) {
|
||||
return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if plan matches active license' plan or active trial license' plan.
|
||||
*
|
||||
* All code wrapped in this statement will be only included in the premium code.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param string $plan Plan name.
|
||||
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_plan_or_trial__premium_only( $plan, $exact = false ) {
|
||||
return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user is paying or in trial.
|
||||
*
|
||||
* All code wrapped in this statement will be only included in the premium code.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_paying_or_trial__premium_only() {
|
||||
return $this->is_premium() && $this->is_paying_or_trial();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user has an activated and valid paid license on current plugin's install.
|
||||
*
|
||||
* @since 1.0.4
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @deprecated Method name is confusing since it's not clear from the name the code will be removed.
|
||||
* @using Alias to is_paying__premium_only()
|
||||
*/
|
||||
function is_paying__fs__() {
|
||||
return $this->is_paying__premium_only();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user in a trial or have feature enabled license.
|
||||
*
|
||||
* All code wrapped in this statement will be only included in the premium code.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function can_use_premium_code__premium_only() {
|
||||
return $this->is_premium() && $this->can_use_premium_code();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Trial
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Check if the user in a trial.
|
||||
*
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_trial();
|
||||
|
||||
/**
|
||||
* Check if trial already utilized.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_trial_utilized();
|
||||
|
||||
#endregion
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Plans
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Check if the user is on the free plan of the product.
|
||||
*
|
||||
* @since 1.0.4
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_free_plan();
|
||||
|
||||
/**
|
||||
* @since 1.0.2
|
||||
*
|
||||
* @param string $plan Plan name.
|
||||
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_plan( $plan, $exact = false );
|
||||
|
||||
/**
|
||||
* Check if plan based on trial. If not in trial mode, should return false.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param string $plan Plan name.
|
||||
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_trial_plan( $plan, $exact = false );
|
||||
|
||||
/**
|
||||
* Check if plan matches active license' plan or active trial license' plan.
|
||||
*
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param string $plan Plan name.
|
||||
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_plan_or_trial( $plan, $exact = false ) {
|
||||
return $this->is_plan( $plan, $exact ) ||
|
||||
$this->is_trial_plan( $plan, $exact );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if plugin has any paid plans.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function has_paid_plan();
|
||||
|
||||
/**
|
||||
* Check if plugin has any free plan, or is it premium only.
|
||||
*
|
||||
* Note: If no plans configured, assume plugin is free.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function has_free_plan();
|
||||
|
||||
/**
|
||||
* Check if plugin is premium only (no free plans).
|
||||
*
|
||||
* NOTE: is__premium_only() is very different method, don't get confused.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_only_premium();
|
||||
|
||||
/**
|
||||
* Check if module has a premium code version.
|
||||
*
|
||||
* Serviceware module might be freemium without any
|
||||
* premium code version, where the paid features
|
||||
* are all part of the service.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function has_premium_version();
|
||||
|
||||
/**
|
||||
* Check if module has any release on Freemius,
|
||||
* or all plugin's code is on WordPress.org (Serviceware).
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_release_on_freemius() {
|
||||
return ! $this->is_org_repo_compliant() ||
|
||||
$this->has_premium_version();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if it's a freemium plugin.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_freemium() {
|
||||
return $this->has_paid_plan() &&
|
||||
$this->has_free_plan();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if module has only one plan.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_single_plan();
|
||||
|
||||
#endregion
|
||||
|
||||
/**
|
||||
* Check if running payments in sandbox mode.
|
||||
*
|
||||
* @since 1.0.4
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_payments_sandbox();
|
||||
|
||||
/**
|
||||
* Check if running test vs. live plugin.
|
||||
*
|
||||
* @since 1.0.5
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_live();
|
||||
|
||||
/**
|
||||
* Check if running premium plugin code.
|
||||
*
|
||||
* @since 1.0.5
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_premium();
|
||||
|
||||
/**
|
||||
* Get upgrade URL.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.2
|
||||
*
|
||||
* @param string $period Billing cycle.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
|
||||
|
||||
/**
|
||||
* Check if Freemius was first added in a plugin update.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.5
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_plugin_update() {
|
||||
return ! $this->is_plugin_new_install();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Freemius was part of the plugin when the user installed it first.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.5
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_plugin_new_install();
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Marketing
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Check if current user purchased any other plugins before.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function has_purchased_before();
|
||||
|
||||
/**
|
||||
* Check if current user classified as an agency.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_agency();
|
||||
|
||||
/**
|
||||
* Check if current user classified as a developer.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_developer();
|
||||
|
||||
/**
|
||||
* Check if current user classified as a business.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract function is_business();
|
||||
|
||||
#endregion
|
||||
}
|
||||
26330
html/wp-content/plugins/post-smtp/freemius/includes/class-freemius.php
Normal file
@@ -0,0 +1,353 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* WP Admin notices manager both for site level and network level.
|
||||
*
|
||||
* Class FS_Admin_Notices
|
||||
*/
|
||||
class FS_Admin_Notices {
|
||||
/**
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_module_unique_affix;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_title;
|
||||
/**
|
||||
* @var FS_Admin_Notice_Manager
|
||||
*/
|
||||
protected $_notices;
|
||||
/**
|
||||
* @var FS_Admin_Notice_Manager
|
||||
*/
|
||||
protected $_network_notices;
|
||||
/**
|
||||
* @var int The ID of the blog that is associated with the current site level options.
|
||||
*/
|
||||
private $_blog_id = 0;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_multisite;
|
||||
/**
|
||||
* @var FS_Admin_Notices[]
|
||||
*/
|
||||
private static $_instances = array();
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $title
|
||||
* @param string $module_unique_affix
|
||||
* @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
|
||||
* blog admin pages.
|
||||
*
|
||||
* @return FS_Admin_Notices
|
||||
*/
|
||||
static function instance( $id, $title = '', $module_unique_affix = '', $is_network_and_blog_admins = false ) {
|
||||
if ( ! isset( self::$_instances[ $id ] ) ) {
|
||||
self::$_instances[ $id ] = new FS_Admin_Notices( $id, $title, $module_unique_affix, $is_network_and_blog_admins );
|
||||
}
|
||||
|
||||
return self::$_instances[ $id ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $title
|
||||
* @param string $module_unique_affix
|
||||
* @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
|
||||
* blog admin pages.
|
||||
*/
|
||||
protected function __construct( $id, $title = '', $module_unique_affix = '', $is_network_and_blog_admins = false ) {
|
||||
$this->_id = $id;
|
||||
$this->_title = $title;
|
||||
$this->_module_unique_affix = $module_unique_affix;
|
||||
$this->_is_multisite = is_multisite();
|
||||
|
||||
if ( $this->_is_multisite ) {
|
||||
$this->_blog_id = get_current_blog_id();
|
||||
|
||||
$this->_network_notices = FS_Admin_Notice_Manager::instance(
|
||||
$id,
|
||||
$title,
|
||||
$module_unique_affix,
|
||||
$is_network_and_blog_admins,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$this->_notices = FS_Admin_Notice_Manager::instance(
|
||||
$id,
|
||||
$title,
|
||||
$module_unique_affix,
|
||||
false,
|
||||
$this->_blog_id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.4
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $title
|
||||
* @param string $type
|
||||
* @param bool $is_sticky
|
||||
* @param string $id Message ID
|
||||
* @param bool $store_if_sticky
|
||||
* @param int|null $network_level_or_blog_id
|
||||
*
|
||||
* @uses add_action()
|
||||
*/
|
||||
function add(
|
||||
$message,
|
||||
$title = '',
|
||||
$type = 'success',
|
||||
$is_sticky = false,
|
||||
$id = '',
|
||||
$store_if_sticky = true,
|
||||
$network_level_or_blog_id = null,
|
||||
$is_dimissible = null
|
||||
) {
|
||||
$notices = $this->get_site_or_network_notices( $id, $network_level_or_blog_id );
|
||||
|
||||
$notices->add(
|
||||
$message,
|
||||
$title,
|
||||
$type,
|
||||
$is_sticky,
|
||||
$id,
|
||||
$store_if_sticky,
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$is_dimissible
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param string|string[] $ids
|
||||
* @param int|null $network_level_or_blog_id
|
||||
* @param bool $store
|
||||
*/
|
||||
function remove_sticky( $ids, $network_level_or_blog_id = null, $store = true ) {
|
||||
if ( ! is_array( $ids ) ) {
|
||||
$ids = array( $ids );
|
||||
}
|
||||
|
||||
if ( $this->should_use_network_notices( $ids[0], $network_level_or_blog_id ) ) {
|
||||
$notices = $this->_network_notices;
|
||||
} else {
|
||||
$notices = $this->get_site_notices( $network_level_or_blog_id );
|
||||
}
|
||||
|
||||
return $notices->remove_sticky( $ids, $store );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if sticky message exists by id.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param string $id
|
||||
* @param int|null $network_level_or_blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_sticky( $id, $network_level_or_blog_id = null ) {
|
||||
$notices = $this->get_site_or_network_notices( $id, $network_level_or_blog_id );
|
||||
|
||||
return $notices->has_sticky( $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds sticky admin notification.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $id Message ID
|
||||
* @param string $title
|
||||
* @param string $type
|
||||
* @param int|null $network_level_or_blog_id
|
||||
* @param number|null $wp_user_id
|
||||
* @param string|null $plugin_title
|
||||
* @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
|
||||
* blog admin pages.
|
||||
* @param bool $is_dismissible
|
||||
*/
|
||||
function add_sticky(
|
||||
$message,
|
||||
$id,
|
||||
$title = '',
|
||||
$type = 'success',
|
||||
$network_level_or_blog_id = null,
|
||||
$wp_user_id = null,
|
||||
$plugin_title = null,
|
||||
$is_network_and_blog_admins = false,
|
||||
$is_dismissible = true,
|
||||
$data = array()
|
||||
) {
|
||||
$notices = $this->get_site_or_network_notices( $id, $network_level_or_blog_id );
|
||||
|
||||
$notices->add_sticky( $message, $id, $title, $type, $wp_user_id, $plugin_title, $is_network_and_blog_admins, $is_dismissible, $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the data of a sticky notice.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.4.3
|
||||
*
|
||||
* @param string $id
|
||||
* @param int|null $network_level_or_blog_id
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
function get_sticky( $id, $network_level_or_blog_id ) {
|
||||
$notices = $this->get_site_or_network_notices( $id, $network_level_or_blog_id );
|
||||
|
||||
return $notices->get_sticky( $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all sticky messages.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int|null $network_level_or_blog_id
|
||||
* @param bool $is_temporary
|
||||
*/
|
||||
function clear_all_sticky( $network_level_or_blog_id = null, $is_temporary = false ) {
|
||||
if ( ! $this->_is_multisite ||
|
||||
false === $network_level_or_blog_id ||
|
||||
0 == $network_level_or_blog_id ||
|
||||
is_null( $network_level_or_blog_id )
|
||||
) {
|
||||
$notices = $this->get_site_notices( $network_level_or_blog_id );
|
||||
$notices->clear_all_sticky( $is_temporary );
|
||||
}
|
||||
|
||||
if ( $this->_is_multisite &&
|
||||
( true === $network_level_or_blog_id || is_null( $network_level_or_blog_id ) )
|
||||
) {
|
||||
$this->_network_notices->clear_all_sticky( $is_temporary );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.4
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $title
|
||||
* @param string $type
|
||||
* @param bool $is_sticky
|
||||
* @param string $id Message ID
|
||||
*/
|
||||
function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
|
||||
$this->add( $message, $title, $type, $is_sticky, true, $id );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Helper Methods
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int $blog_id
|
||||
*
|
||||
* @return FS_Admin_Notice_Manager
|
||||
*/
|
||||
private function get_site_notices( $blog_id = 0 ) {
|
||||
if ( 0 == $blog_id || $blog_id == $this->_blog_id ) {
|
||||
return $this->_notices;
|
||||
}
|
||||
|
||||
return FS_Admin_Notice_Manager::instance(
|
||||
$this->_id,
|
||||
$this->_title,
|
||||
$this->_module_unique_affix,
|
||||
false,
|
||||
$blog_id
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the network notices should be used.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $id
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite notices (if there's a network). When `false`, use the current context blog notices. When `null`, the decision which notices manager to use (MS vs. Current S) will be handled internally and determined based on the $id and the context admin (blog admin vs. network level admin).
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function should_use_network_notices( $id = '', $network_level_or_blog_id = null ) {
|
||||
if ( ! $this->_is_multisite ) {
|
||||
// Not a multisite environment.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is_numeric( $network_level_or_blog_id ) ) {
|
||||
// Explicitly asked to use a specified blog storage.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is_bool( $network_level_or_blog_id ) ) {
|
||||
// Explicitly specified whether should use the network or blog level storage.
|
||||
return $network_level_or_blog_id;
|
||||
}
|
||||
|
||||
return fs_is_network_admin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves an instance of FS_Admin_Notice_Manager.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param string $id
|
||||
* @param int|null $network_level_or_blog_id
|
||||
*
|
||||
* @return FS_Admin_Notice_Manager
|
||||
*/
|
||||
private function get_site_or_network_notices( $id, $network_level_or_blog_id ) {
|
||||
return $this->should_use_network_notices( $id, $network_level_or_blog_id ) ?
|
||||
$this->_network_notices :
|
||||
$this->get_site_notices( $network_level_or_blog_id );
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,724 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Api
|
||||
*
|
||||
* Wraps Freemius API SDK to handle:
|
||||
* 1. Clock sync.
|
||||
* 2. Fallback to HTTP when HTTPS fails.
|
||||
* 3. Adds caching layer to GET requests.
|
||||
* 4. Adds consistency for failed requests by using last cached version.
|
||||
*/
|
||||
class FS_Api {
|
||||
/**
|
||||
* @var FS_Api[]
|
||||
*/
|
||||
private static $_instances = array();
|
||||
|
||||
/**
|
||||
* @var FS_Option_Manager Freemius options, options-manager.
|
||||
*/
|
||||
private static $_options;
|
||||
|
||||
/**
|
||||
* @var FS_Cache_Manager API Caching layer
|
||||
*/
|
||||
private static $_cache;
|
||||
|
||||
/**
|
||||
* @var int Clock diff in seconds between current server to API server.
|
||||
*/
|
||||
private static $_clock_diff;
|
||||
|
||||
/**
|
||||
* @var Freemius_Api_WordPress
|
||||
*/
|
||||
private $_api;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_slug;
|
||||
|
||||
/**
|
||||
* @var FS_Logger
|
||||
* @since 1.0.4
|
||||
*/
|
||||
private $_logger;
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_sdk_version;
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_url;
|
||||
|
||||
/**
|
||||
* @param string $slug
|
||||
* @param string $scope 'app', 'developer', 'user' or 'install'.
|
||||
* @param number $id Element's id.
|
||||
* @param string $public_key Public key.
|
||||
* @param bool $is_sandbox
|
||||
* @param bool|string $secret_key Element's secret key.
|
||||
* @param null|string $sdk_version
|
||||
* @param null|string $url
|
||||
*
|
||||
* @return FS_Api
|
||||
*/
|
||||
static function instance(
|
||||
$slug,
|
||||
$scope,
|
||||
$id,
|
||||
$public_key,
|
||||
$is_sandbox,
|
||||
$secret_key = false,
|
||||
$sdk_version = null,
|
||||
$url = null
|
||||
) {
|
||||
$identifier = md5( $slug . $scope . $id . $public_key . ( is_string( $secret_key ) ? $secret_key : '' ) . json_encode( $is_sandbox ) );
|
||||
|
||||
if ( ! isset( self::$_instances[ $identifier ] ) ) {
|
||||
self::_init();
|
||||
|
||||
self::$_instances[ $identifier ] = new FS_Api( $slug, $scope, $id, $public_key, $secret_key, $is_sandbox, $sdk_version, $url );
|
||||
}
|
||||
|
||||
return self::$_instances[ $identifier ];
|
||||
}
|
||||
|
||||
private static function _init() {
|
||||
if ( isset( self::$_options ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Freemius_Api_WordPress' ) ) {
|
||||
require_once WP_FS__DIR_SDK . '/FreemiusWordPress.php';
|
||||
}
|
||||
|
||||
self::$_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
|
||||
self::$_cache = FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME );
|
||||
|
||||
self::$_clock_diff = self::$_options->get_option( 'api_clock_diff', 0 );
|
||||
Freemius_Api_WordPress::SetClockDiff( self::$_clock_diff );
|
||||
|
||||
if ( self::$_options->get_option( 'api_force_http', false ) ) {
|
||||
Freemius_Api_WordPress::SetHttp();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $slug
|
||||
* @param string $scope 'app', 'developer', 'user' or 'install'.
|
||||
* @param number $id Element's id.
|
||||
* @param string $public_key Public key.
|
||||
* @param bool|string $secret_key Element's secret key.
|
||||
* @param bool $is_sandbox
|
||||
* @param null|string $sdk_version
|
||||
* @param null|string $url
|
||||
*/
|
||||
private function __construct(
|
||||
$slug,
|
||||
$scope,
|
||||
$id,
|
||||
$public_key,
|
||||
$secret_key,
|
||||
$is_sandbox,
|
||||
$sdk_version,
|
||||
$url
|
||||
) {
|
||||
$this->_api = new Freemius_Api_WordPress( $scope, $id, $public_key, $secret_key, $is_sandbox );
|
||||
|
||||
$this->_slug = $slug;
|
||||
$this->_sdk_version = $sdk_version;
|
||||
$this->_url = $url;
|
||||
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_api', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find clock diff between server and API server, and store the diff locally.
|
||||
*
|
||||
* @param bool|int $diff
|
||||
*
|
||||
* @return bool|int False if clock diff didn't change, otherwise returns the clock diff in seconds.
|
||||
*/
|
||||
private function _sync_clock_diff( $diff = false ) {
|
||||
$this->_logger->entrance();
|
||||
|
||||
// Sync clock and store.
|
||||
$new_clock_diff = ( false === $diff ) ?
|
||||
Freemius_Api_WordPress::FindClockDiff() :
|
||||
$diff;
|
||||
|
||||
if ( $new_clock_diff === self::$_clock_diff ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
self::$_clock_diff = $new_clock_diff;
|
||||
|
||||
// Update API clock's diff.
|
||||
Freemius_Api_WordPress::SetClockDiff( self::$_clock_diff );
|
||||
|
||||
// Store new clock diff in storage.
|
||||
self::$_options->set_option( 'api_clock_diff', self::$_clock_diff, true );
|
||||
|
||||
return $new_clock_diff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override API call to enable retry with servers' clock auto sync method.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $method
|
||||
* @param array $params
|
||||
* @param bool $in_retry Is in retry or first call attempt.
|
||||
*
|
||||
* @return array|mixed|string|void
|
||||
*/
|
||||
private function _call( $path, $method = 'GET', $params = array(), $in_retry = false ) {
|
||||
$this->_logger->entrance( $method . ':' . $path );
|
||||
|
||||
$force_http = ( ! $in_retry && self::$_options->get_option( 'api_force_http', false ) );
|
||||
|
||||
if ( self::is_temporary_down() ) {
|
||||
$result = $this->get_temporary_unavailable_error();
|
||||
} else {
|
||||
/**
|
||||
* @since 2.3.0 Include the SDK version with all API requests that going through the API manager. IMPORTANT: Only pass the SDK version if the caller didn't include it yet.
|
||||
*/
|
||||
if ( ! empty( $this->_sdk_version ) ) {
|
||||
if ( false === strpos( $path, 'sdk_version=' ) &&
|
||||
! isset( $params['sdk_version'] )
|
||||
) {
|
||||
// Always add the sdk_version param in the querystring. DO NOT INCLUDE IT IN THE BODY PARAMS, OTHERWISE, IT MAY LEAD TO AN UNEXPECTED PARAMS PARSING IN CASES WHERE THE $params IS A REGULAR NON-ASSOCIATIVE ARRAY.
|
||||
$path = add_query_arg( 'sdk_version', $this->_sdk_version, $path );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.5.0 Include the site's URL, if available, in all API requests that are going through the API manager.
|
||||
*/
|
||||
if ( ! empty( $this->_url ) ) {
|
||||
if ( false === strpos( $path, 'url=' ) &&
|
||||
! isset( $params['url'] )
|
||||
) {
|
||||
$path = add_query_arg( 'url', $this->_url, $path );
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->_api->Api( $path, $method, $params );
|
||||
|
||||
if (
|
||||
! $in_retry &&
|
||||
null !== $result &&
|
||||
isset( $result->error ) &&
|
||||
isset( $result->error->code )
|
||||
) {
|
||||
$retry = false;
|
||||
|
||||
if ( 'request_expired' === $result->error->code ) {
|
||||
$diff = isset( $result->error->timestamp ) ?
|
||||
( time() - strtotime( $result->error->timestamp ) ) :
|
||||
false;
|
||||
|
||||
// Try to sync clock diff.
|
||||
if ( false !== $this->_sync_clock_diff( $diff ) ) {
|
||||
// Retry call with new synced clock.
|
||||
$retry = true;
|
||||
}
|
||||
} else if (
|
||||
Freemius_Api_WordPress::IsHttps() &&
|
||||
FS_Api::is_ssl_error_response( $result )
|
||||
) {
|
||||
$force_http = true;
|
||||
$retry = true;
|
||||
}
|
||||
|
||||
if ( $retry ) {
|
||||
if ( $force_http ) {
|
||||
$this->toggle_force_http( true );
|
||||
}
|
||||
|
||||
$result = $this->_call( $path, $method, $params, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( self::is_api_error( $result ) ) {
|
||||
if ( $this->_logger->is_on() ) {
|
||||
// Log API errors.
|
||||
$this->_logger->api_error( $result );
|
||||
}
|
||||
|
||||
if ( $force_http ) {
|
||||
$this->toggle_force_http( false );
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override API call to wrap it in servers' clock sync method.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $method
|
||||
* @param array $params
|
||||
*
|
||||
* @return array|mixed|string|void
|
||||
* @throws Freemius_Exception
|
||||
*/
|
||||
function call( $path, $method = 'GET', $params = array() ) {
|
||||
return $this->_call( $path, $method, $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get API request URL signed via query string.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_signed_url( $path ) {
|
||||
return $this->_api->GetSignedUrl( $path );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param bool $flush
|
||||
* @param int $expiration (optional) Time until expiration in seconds from now, defaults to 24 hours
|
||||
*
|
||||
* @return stdClass|mixed
|
||||
*/
|
||||
function get( $path = '/', $flush = false, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
|
||||
$this->_logger->entrance( $path );
|
||||
|
||||
$cache_key = $this->get_cache_key( $path );
|
||||
|
||||
// Always flush during development.
|
||||
if ( WP_FS__DEV_MODE || $this->_api->IsSandbox() ) {
|
||||
$flush = true;
|
||||
}
|
||||
|
||||
$has_valid_cache = self::$_cache->has_valid( $cache_key, $expiration );
|
||||
$cached_result = $has_valid_cache ?
|
||||
self::$_cache->get( $cache_key ) :
|
||||
null;
|
||||
|
||||
if ( $flush || is_null( $cached_result ) ) {
|
||||
$result = $this->call( $path );
|
||||
|
||||
if ( ! is_object( $result ) || isset( $result->error ) ) {
|
||||
// Api returned an error.
|
||||
if ( is_object( $cached_result ) &&
|
||||
! isset( $cached_result->error )
|
||||
) {
|
||||
// If there was an error during a newer data fetch,
|
||||
// fallback to older data version.
|
||||
$result = $cached_result;
|
||||
|
||||
if ( $this->_logger->is_on() ) {
|
||||
$this->_logger->warn( 'Fallback to cached API result: ' . var_export( $cached_result, true ) );
|
||||
}
|
||||
} else {
|
||||
if ( is_object( $result ) && isset( $result->error->http ) && 404 == $result->error->http ) {
|
||||
/**
|
||||
* If the response code is 404, cache the result for half of the `$expiration`.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.2.4
|
||||
*/
|
||||
$expiration /= 2;
|
||||
} else {
|
||||
// If no older data version and the response code is not 404, return result without
|
||||
// caching the error.
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_numeric( $expiration ) ) {
|
||||
self::$_cache->set( $cache_key, $result, $expiration );
|
||||
}
|
||||
|
||||
$cached_result = $result;
|
||||
} else {
|
||||
$this->_logger->log( 'Using cached API result.' );
|
||||
}
|
||||
|
||||
return $cached_result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Remove this method after migrating Freemius::safe_remote_post() to FS_Api::call().
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.4
|
||||
*
|
||||
* @param string $url
|
||||
* @param array $remote_args
|
||||
*
|
||||
* @return array|WP_Error The response array or a WP_Error on failure.
|
||||
*/
|
||||
static function remote_request( $url, $remote_args ) {
|
||||
if ( ! class_exists( 'Freemius_Api_WordPress' ) ) {
|
||||
require_once WP_FS__DIR_SDK . '/FreemiusWordPress.php';
|
||||
}
|
||||
|
||||
if ( method_exists( 'Freemius_Api_WordPress', 'RemoteRequest' ) ) {
|
||||
return Freemius_Api_WordPress::RemoteRequest( $url, $remote_args );
|
||||
}
|
||||
|
||||
// The following is for backward compatibility when a modified PHP SDK version is in use and the `Freemius_Api_WordPress:RemoteRequest()` method doesn't exist.
|
||||
$response = wp_remote_request( $url, $remote_args );
|
||||
|
||||
if (
|
||||
is_array( $response ) &&
|
||||
(
|
||||
empty( $response['headers'] ) ||
|
||||
empty( $response['headers']['x-api-server'] )
|
||||
)
|
||||
) {
|
||||
// API is considered blocked if the response doesn't include the `x-api-server` header. When there's no error but this header doesn't exist, the response is usually not in the expected form (e.g., cannot be JSON-decoded).
|
||||
$response = new WP_Error( 'api_blocked', htmlentities( $response['body'] ) );
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there's a cached version of the API request.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $method
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_cached( $path, $method = 'GET', $params = array() ) {
|
||||
$cache_key = $this->get_cache_key( $path, $method, $params );
|
||||
|
||||
return self::$_cache->has_valid( $cache_key );
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate a cached version of the API request.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.5
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $method
|
||||
* @param array $params
|
||||
*/
|
||||
function purge_cache( $path, $method = 'GET', $params = array() ) {
|
||||
$this->_logger->entrance( "{$method}:{$path}" );
|
||||
|
||||
$cache_key = $this->get_cache_key( $path, $method, $params );
|
||||
|
||||
self::$_cache->purge( $cache_key );
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate a cached version of the API request.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $path
|
||||
* @param int $expiration
|
||||
* @param string $method
|
||||
* @param array $params
|
||||
*/
|
||||
function update_cache_expiration( $path, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $method = 'GET', $params = array() ) {
|
||||
$this->_logger->entrance( "{$method}:{$path}:{$expiration}" );
|
||||
|
||||
$cache_key = $this->get_cache_key( $path, $method, $params );
|
||||
|
||||
self::$_cache->update_expiration( $cache_key, $expiration );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param string $method
|
||||
* @param array $params
|
||||
*
|
||||
* @return string
|
||||
* @throws \Freemius_Exception
|
||||
*/
|
||||
private function get_cache_key( $path, $method = 'GET', $params = array() ) {
|
||||
$canonized = $this->_api->CanonizePath( $path );
|
||||
// $exploded = explode('/', $canonized);
|
||||
// return $method . '_' . array_pop($exploded) . '_' . md5($canonized . json_encode($params));
|
||||
return strtolower( $method . ':' . $canonized ) . ( ! empty( $params ) ? '#' . md5( json_encode( $params ) ) : '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.4
|
||||
*
|
||||
* @param bool $is_http
|
||||
*/
|
||||
private function toggle_force_http( $is_http ) {
|
||||
self::$_options->set_option( 'api_force_http', $is_http, true );
|
||||
|
||||
if ( $is_http ) {
|
||||
Freemius_Api_WordPress::SetHttp();
|
||||
} else if ( method_exists( 'Freemius_Api_WordPress', 'SetHttps' ) ) {
|
||||
Freemius_Api_WordPress::SetHttps();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.4
|
||||
*
|
||||
* @param mixed $response
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_blocked( $response ) {
|
||||
return (
|
||||
self::is_api_error_object( $response, true ) &&
|
||||
isset( $response->error->code ) &&
|
||||
'api_blocked' === $response->error->code
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if API is temporary down.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_temporary_down() {
|
||||
self::_init();
|
||||
|
||||
$test = self::$_cache->get_valid( 'ping_test', null );
|
||||
|
||||
return ( false === $test );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
private function get_temporary_unavailable_error() {
|
||||
return (object) array(
|
||||
'error' => (object) array(
|
||||
'type' => 'TemporaryUnavailable',
|
||||
'message' => 'API is temporary unavailable, please retry in ' . ( self::$_cache->get_record_expiration( 'ping_test' ) - WP_FS__SCRIPT_START_TIME ) . ' sec.',
|
||||
'code' => 'temporary_unavailable',
|
||||
'http' => 503
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if based on the API result we should try
|
||||
* to re-run the same request with HTTP instead of HTTPS.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param $result
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private static function should_try_with_http( $result ) {
|
||||
if ( ! Freemius_Api_WordPress::IsHttps() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ( ! is_object( $result ) ||
|
||||
! isset( $result->error ) ||
|
||||
! isset( $result->error->code ) ||
|
||||
! in_array( $result->error->code, array(
|
||||
'curl_missing',
|
||||
'cloudflare_ddos_protection',
|
||||
'maintenance_mode',
|
||||
'squid_cache_block',
|
||||
'too_many_requests',
|
||||
) ) );
|
||||
|
||||
}
|
||||
|
||||
function get_url( $path = '' ) {
|
||||
return Freemius_Api_WordPress::GetUrl( $path, $this->_api->IsSandbox() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear API cache.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*/
|
||||
static function clear_cache() {
|
||||
self::_init();
|
||||
|
||||
self::$_cache = FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME );
|
||||
self::$_cache->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.4
|
||||
*/
|
||||
static function clear_force_http_flag() {
|
||||
self::$_options->unset_option( 'api_force_http' );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------------
|
||||
#region Error Handling
|
||||
#----------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.5
|
||||
*
|
||||
* @param mixed $result
|
||||
*
|
||||
* @return bool Is API result contains an error.
|
||||
*/
|
||||
static function is_api_error( $result ) {
|
||||
return ( is_object( $result ) && isset( $result->error ) ) ||
|
||||
is_string( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param mixed $result
|
||||
* @param bool $ignore_message
|
||||
*
|
||||
* @return bool Is API result contains an error.
|
||||
*/
|
||||
static function is_api_error_object( $result, $ignore_message = false ) {
|
||||
return (
|
||||
is_object( $result ) &&
|
||||
isset( $result->error ) &&
|
||||
( $ignore_message || isset( $result->error->message ) )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.4
|
||||
*
|
||||
* @param WP_Error|object|string $response
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_ssl_error_response( $response ) {
|
||||
$http_error = null;
|
||||
|
||||
if ( $response instanceof WP_Error ) {
|
||||
if (
|
||||
isset( $response->errors ) &&
|
||||
isset( $response->errors['http_request_failed'] )
|
||||
) {
|
||||
$http_error = strtolower( $response->errors['http_request_failed'][0] );
|
||||
}
|
||||
} else if (
|
||||
self::is_api_error_object( $response ) &&
|
||||
! empty( $response->error->message )
|
||||
) {
|
||||
$http_error = $response->error->message;
|
||||
}
|
||||
|
||||
return (
|
||||
! empty( $http_error ) &&
|
||||
(
|
||||
false !== strpos( $http_error, 'curl error 35' ) ||
|
||||
(
|
||||
false === strpos( $http_error, '</html>' ) &&
|
||||
false !== strpos( $http_error, 'ssl' )
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given API result is a non-empty and not an error object.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.5
|
||||
*
|
||||
* @param mixed $result
|
||||
* @param string|null $required_property Optional property we want to verify that is set.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_api_result_object( $result, $required_property = null ) {
|
||||
return (
|
||||
is_object( $result ) &&
|
||||
! isset( $result->error ) &&
|
||||
( empty( $required_property ) || isset( $result->{$required_property} ) )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given API result is a non-empty entity object with non-empty ID.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.5
|
||||
*
|
||||
* @param mixed $result
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_api_result_entity( $result ) {
|
||||
return self::is_api_result_object( $result, 'id' ) &&
|
||||
FS_Entity::is_valid_id( $result->id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get API result error code. If failed to get code, returns an empty string.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param mixed $result
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function get_error_code( $result ) {
|
||||
if ( is_object( $result ) &&
|
||||
isset( $result->error ) &&
|
||||
is_object( $result->error ) &&
|
||||
! empty( $result->error->code )
|
||||
) {
|
||||
return $result->error->code;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,439 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.6.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
interface FS_I_Garbage_Collector {
|
||||
function clean();
|
||||
}
|
||||
|
||||
class FS_Product_Garbage_Collector implements FS_I_Garbage_Collector {
|
||||
/**
|
||||
* @var FS_Options
|
||||
*/
|
||||
private $_accounts;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $_options_names;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_type;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_plural_type;
|
||||
|
||||
/**
|
||||
* @var array<string, int> Map of product slugs to their last load timestamp, only for products that are not active.
|
||||
*/
|
||||
private $_gc_timestamp;
|
||||
|
||||
/**
|
||||
* @var array<string, array<string, mixed>> Map of product slugs to their data, as stored by the primary storage of `Freemius` class.
|
||||
*/
|
||||
private $_storage_data;
|
||||
|
||||
function __construct( FS_Options $_accounts, $option_names, $type ) {
|
||||
$this->_accounts = $_accounts;
|
||||
$this->_options_names = $option_names;
|
||||
$this->_type = $type;
|
||||
$this->_plural_type = ( $type . 's' );
|
||||
}
|
||||
|
||||
function clean() {
|
||||
$this->_gc_timestamp = $this->_accounts->get_option( 'gc_timestamp', array() );
|
||||
$this->_storage_data = $this->_accounts->get_option( $this->_type . '_data', array() );
|
||||
|
||||
$options = $this->load_options();
|
||||
$has_updated_option = false;
|
||||
|
||||
$filtered_products = $this->get_filtered_products();
|
||||
$products_to_clean = $filtered_products['products_to_clean'];
|
||||
$active_products_by_id_map = $filtered_products['active_products_by_id_map'];
|
||||
|
||||
foreach( $products_to_clean as $product ) {
|
||||
$slug = $product->slug;
|
||||
|
||||
// Clear the product's data.
|
||||
foreach( $options as $option_name => $option ) {
|
||||
$updated = false;
|
||||
|
||||
/**
|
||||
* We expect to deal with only array like options here.
|
||||
* @todo - Refactor this to create dedicated GC classes for every option, then we can make the code mode predictable.
|
||||
* For example, depending on data integrity of `plugins` we can still miss something entirely in the `plugin_data` or vice-versa.
|
||||
* A better algorithm is to iterate over all options individually in separate classes and check against primary storage to see if those can be garbage collected.
|
||||
* But given the chance of data integrity issue is very low, we let this run for now and gather feedback.
|
||||
*/
|
||||
if ( ! is_array( $option ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( array_key_exists( $slug, $option ) ) {
|
||||
unset( $option[ $slug ] );
|
||||
$updated = true;
|
||||
} else if ( array_key_exists( "{$slug}:{$this->_type}", $option ) ) { /* admin_notices */
|
||||
unset( $option[ "{$slug}:{$this->_type}" ] );
|
||||
$updated = true;
|
||||
} else if ( isset( $product->id ) && array_key_exists( $product->id, $option ) ) { /* all_licenses, add-ons, and id_slug_type_path_map */
|
||||
$is_inactive_by_id = ! isset( $active_products_by_id_map[ $product->id ] );
|
||||
$is_inactive_by_slug = (
|
||||
'id_slug_type_path_map' === $option_name &&
|
||||
(
|
||||
! isset( $option[ $product->id ]['slug'] ) ||
|
||||
$slug === $option[ $product->id ]['slug']
|
||||
)
|
||||
);
|
||||
|
||||
if ( $is_inactive_by_id || $is_inactive_by_slug ) {
|
||||
unset( $option[ $product->id ] );
|
||||
$updated = true;
|
||||
}
|
||||
} else if ( /* file_slug_map */
|
||||
isset( $product->file ) &&
|
||||
array_key_exists( $product->file, $option ) &&
|
||||
$slug === $option[ $product->file ]
|
||||
) {
|
||||
unset( $option[ $product->file ] );
|
||||
$updated = true;
|
||||
}
|
||||
|
||||
if ( $updated ) {
|
||||
$this->_accounts->set_option( $option_name, $option );
|
||||
|
||||
$options[ $option_name ] = $option;
|
||||
|
||||
$has_updated_option = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Clear the product's data from the primary storage.
|
||||
if ( isset( $this->_storage_data[ $slug ] ) ) {
|
||||
unset( $this->_storage_data[ $slug ] );
|
||||
$has_updated_option = true;
|
||||
}
|
||||
|
||||
// Clear from GC timestamp.
|
||||
// @todo - This perhaps needs a separate garbage collector for all expired products. But the chance of left-over is very slim.
|
||||
if ( isset( $this->_gc_timestamp[ $slug ] ) ) {
|
||||
unset( $this->_gc_timestamp[ $slug ] );
|
||||
$has_updated_option = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_accounts->set_option( 'gc_timestamp', $this->_gc_timestamp );
|
||||
$this->_accounts->set_option( $this->_type . '_data', $this->_storage_data );
|
||||
|
||||
return $has_updated_option;
|
||||
}
|
||||
|
||||
private function get_all_option_names() {
|
||||
return array_merge(
|
||||
array(
|
||||
'admin_notices',
|
||||
'updates',
|
||||
'all_licenses',
|
||||
'addons',
|
||||
'id_slug_type_path_map',
|
||||
'file_slug_map',
|
||||
),
|
||||
$this->_options_names
|
||||
);
|
||||
}
|
||||
|
||||
private function get_products() {
|
||||
$products = $this->_accounts->get_option( $this->_plural_type, array() );
|
||||
|
||||
// Fill any missing product found in the primary storage.
|
||||
// @todo - This wouldn't be needed if we use dedicated GC design for every options. The options themselves would provide such information.
|
||||
foreach( $this->_storage_data as $slug => $product_data ) {
|
||||
if ( ! isset( $products[ $slug ] ) ) {
|
||||
$products[ $slug ] = (object) $product_data;
|
||||
}
|
||||
|
||||
// This is needed to handle a scenario in which there are duplicate sets of data for the same product, but one of them needs to be removed.
|
||||
$products[ $slug ] = clone $products[ $slug ];
|
||||
|
||||
// The reason for having the line above. This also handles a scenario in which the slug is either empty or not empty but incorrect.
|
||||
$products[ $slug ]->slug = $slug;
|
||||
}
|
||||
|
||||
$this->update_gc_timestamp( $products );
|
||||
|
||||
return $products;
|
||||
}
|
||||
|
||||
private function get_filtered_products() {
|
||||
$products_to_clean = array();
|
||||
$active_products_by_id_map = array();
|
||||
|
||||
$products = $this->get_products();
|
||||
|
||||
foreach ( $products as $slug => $product_data ) {
|
||||
if ( ! is_object( $product_data ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $this->is_product_active( $slug ) ) {
|
||||
$active_products_by_id_map[ $product_data->id ] = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_addon = ( ! empty( $product_data->parent_plugin_id ) );
|
||||
|
||||
if ( ! $is_addon ) {
|
||||
$products_to_clean[] = $product_data;
|
||||
} else {
|
||||
/**
|
||||
* If add-on, add to the beginning of the array so that add-ons are removed before their parent. This is to prevent an unexpected issue when an add-on exists but its parent was already removed.
|
||||
*/
|
||||
array_unshift( $products_to_clean, $product_data );
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'products_to_clean' => $products_to_clean,
|
||||
'active_products_by_id_map' => $active_products_by_id_map,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $slug
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function is_product_active( $slug ) {
|
||||
$instances = Freemius::_get_all_instances();
|
||||
|
||||
foreach ( $instances as $instance ) {
|
||||
if ( $instance->get_slug() === $slug ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$expiration_time = fs_get_optional_constant( 'WP_FS__GARBAGE_COLLECTOR_EXPIRATION_TIME_SECS', ( WP_FS__TIME_WEEK_IN_SEC * 4 ) );
|
||||
|
||||
if ( $this->get_last_load_timestamp( $slug ) > ( time() - $expiration_time ) ) {
|
||||
// Last activation was within the last 4 weeks.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function load_options() {
|
||||
$options = array();
|
||||
$option_names = $this->get_all_option_names();
|
||||
|
||||
foreach ( $option_names as $option_name ) {
|
||||
$options[ $option_name ] = $this->_accounts->get_option( $option_name, array() );
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the garbage collector timestamp, only if it was not already set by the product's primary storage.
|
||||
*
|
||||
* @param array $products
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function update_gc_timestamp( $products ) {
|
||||
foreach ($products as $slug => $product_data) {
|
||||
if ( ! is_object( $product_data ) && ! is_array( $product_data ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// If the product is active, we don't need to update the gc_timestamp.
|
||||
if ( isset( $this->_storage_data[ $slug ]['last_load_timestamp'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// First try to check if the product is present in the primary storage. If so update that.
|
||||
if ( isset( $this->_storage_data[ $slug ] ) ) {
|
||||
$this->_storage_data[ $slug ]['last_load_timestamp'] = time();
|
||||
} else if ( ! isset( $this->_gc_timestamp[ $slug ] ) ) {
|
||||
// If not, fallback to the gc_timestamp, but we don't want to update it more than once.
|
||||
$this->_gc_timestamp[ $slug ] = time();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function get_last_load_timestamp( $slug ) {
|
||||
if ( isset( $this->_storage_data[ $slug ]['last_load_timestamp'] ) ) {
|
||||
return $this->_storage_data[ $slug ]['last_load_timestamp'];
|
||||
}
|
||||
|
||||
return isset( $this->_gc_timestamp[ $slug ] ) ?
|
||||
$this->_gc_timestamp[ $slug ] :
|
||||
// This should never happen, but if it does, let's assume the product is not expired.
|
||||
time();
|
||||
}
|
||||
}
|
||||
|
||||
class FS_User_Garbage_Collector implements FS_I_Garbage_Collector {
|
||||
private $_accounts;
|
||||
|
||||
private $_types;
|
||||
|
||||
function __construct( FS_Options $_accounts, array $types ) {
|
||||
$this->_accounts = $_accounts;
|
||||
$this->_types = $types;
|
||||
}
|
||||
|
||||
function clean() {
|
||||
$users = Freemius::get_all_users();
|
||||
|
||||
$user_has_install_map = $this->get_user_has_install_map();
|
||||
|
||||
if ( count( $users ) === count( $user_has_install_map ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$products_user_id_license_ids_map = $this->_accounts->get_option( 'user_id_license_ids_map', array() );
|
||||
|
||||
$has_updated_option = false;
|
||||
|
||||
foreach ( $users as $user_id => $user ) {
|
||||
if ( ! isset( $user_has_install_map[ $user_id ] ) ) {
|
||||
unset( $users[ $user_id ] );
|
||||
|
||||
foreach( $products_user_id_license_ids_map as $product_id => $user_id_license_ids_map ) {
|
||||
unset( $user_id_license_ids_map[ $user_id ] );
|
||||
|
||||
if ( empty( $user_id_license_ids_map ) ) {
|
||||
unset( $products_user_id_license_ids_map[ $product_id ] );
|
||||
} else {
|
||||
$products_user_id_license_ids_map[ $product_id ] = $user_id_license_ids_map;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_accounts->set_option( 'users', $users );
|
||||
$this->_accounts->set_option( 'user_id_license_ids_map', $products_user_id_license_ids_map );
|
||||
|
||||
$has_updated_option = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $has_updated_option;
|
||||
}
|
||||
|
||||
private function get_user_has_install_map() {
|
||||
$user_has_install_map = array();
|
||||
|
||||
foreach ( $this->_types as $product_type ) {
|
||||
$option_name = ( WP_FS__MODULE_TYPE_PLUGIN !== $product_type ) ?
|
||||
"{$product_type}_sites" :
|
||||
'sites';
|
||||
|
||||
$installs = $this->_accounts->get_option( $option_name, array() );
|
||||
|
||||
foreach ( $installs as $install ) {
|
||||
$user_has_install_map[ $install->user_id ] = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $user_has_install_map;
|
||||
}
|
||||
}
|
||||
|
||||
// Main entry-level class.
|
||||
class FS_Garbage_Collector implements FS_I_Garbage_Collector {
|
||||
/**
|
||||
* @var FS_Garbage_Collector
|
||||
* @since 2.6.0
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
/**
|
||||
* @return FS_Garbage_Collector
|
||||
*/
|
||||
static function instance() {
|
||||
if ( ! isset( self::$_instance ) ) {
|
||||
self::$_instance = new self();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private function __construct() {
|
||||
}
|
||||
|
||||
function clean() {
|
||||
$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
||||
|
||||
$products_cleaners = $this->get_product_cleaners( $_accounts );
|
||||
|
||||
$has_cleaned = false;
|
||||
|
||||
foreach ( $products_cleaners as $products_cleaner ) {
|
||||
if ( $products_cleaner->clean() ) {
|
||||
$has_cleaned = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $has_cleaned ) {
|
||||
$user_cleaner = new FS_User_Garbage_Collector(
|
||||
$_accounts,
|
||||
array_keys( $products_cleaners )
|
||||
);
|
||||
|
||||
$user_cleaner->clean();
|
||||
}
|
||||
|
||||
// @todo - We need a garbage collector for `all_plugins` and `active_plugins` (and variants of themes).
|
||||
|
||||
// Always store regardless of whether there were cleaned products or not since during the process, the logic may set the last load timestamp of some products.
|
||||
$_accounts->store();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FS_Options $_accounts
|
||||
*
|
||||
* @return FS_I_Garbage_Collector[]
|
||||
*/
|
||||
private function get_product_cleaners( FS_Options $_accounts ) {
|
||||
/**
|
||||
* @var FS_I_Garbage_Collector[] $products_cleaners
|
||||
*/
|
||||
$products_cleaners = array();
|
||||
|
||||
$products_cleaners[ WP_FS__MODULE_TYPE_PLUGIN ] = new FS_Product_Garbage_Collector(
|
||||
$_accounts,
|
||||
array(
|
||||
'sites',
|
||||
'plans',
|
||||
'plugins',
|
||||
),
|
||||
WP_FS__MODULE_TYPE_PLUGIN
|
||||
);
|
||||
|
||||
$products_cleaners[ WP_FS__MODULE_TYPE_THEME ] = new FS_Product_Garbage_Collector(
|
||||
$_accounts,
|
||||
array(
|
||||
'theme_sites',
|
||||
'theme_plans',
|
||||
'themes',
|
||||
),
|
||||
WP_FS__MODULE_TYPE_THEME
|
||||
);
|
||||
|
||||
return $products_cleaners;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.5.1
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Lock
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.5.1
|
||||
*/
|
||||
class FS_Lock {
|
||||
/**
|
||||
* @var int Random ID representing the current PHP thread.
|
||||
*/
|
||||
private static $_thread_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_lock_id;
|
||||
|
||||
/**
|
||||
* @param string $lock_id
|
||||
*/
|
||||
function __construct( $lock_id ) {
|
||||
if ( ! fs_starts_with( $lock_id, WP_FS___OPTION_PREFIX ) ) {
|
||||
$lock_id = WP_FS___OPTION_PREFIX . $lock_id;
|
||||
}
|
||||
|
||||
$this->_lock_id = $lock_id;
|
||||
|
||||
if ( ! isset( self::$_thread_id ) ) {
|
||||
self::$_thread_id = mt_rand( 0, 32000 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to acquire lock. If the lock is already set or is being acquired by another locker, don't do anything.
|
||||
*
|
||||
* @param int $expiration
|
||||
*
|
||||
* @return bool TRUE if successfully acquired lock.
|
||||
*/
|
||||
function try_lock( $expiration = 0 ) {
|
||||
if ( $this->is_locked() ) {
|
||||
// Already locked.
|
||||
return false;
|
||||
}
|
||||
|
||||
set_site_transient( $this->_lock_id, self::$_thread_id, $expiration );
|
||||
|
||||
if ( $this->has_lock() ) {
|
||||
$this->lock($expiration);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Acquire lock regardless if it's already acquired by another locker or not.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param int $expiration
|
||||
*/
|
||||
function lock( $expiration = 0 ) {
|
||||
set_site_transient( $this->_lock_id, true, $expiration );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if lock is currently acquired.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_locked() {
|
||||
return ( false !== get_site_transient( $this->_lock_id ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlock the lock.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*/
|
||||
function unlock() {
|
||||
delete_site_transient( $this->_lock_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if lock is currently acquired by the current locker.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function has_lock() {
|
||||
return ( self::$_thread_id == get_site_transient( $this->_lock_id ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,728 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Logger {
|
||||
private $_id;
|
||||
private $_on = false;
|
||||
private $_echo = false;
|
||||
private $_file_start = 0;
|
||||
/**
|
||||
* @var int PHP Process ID.
|
||||
*/
|
||||
private static $_processID;
|
||||
/**
|
||||
* @var string PHP Script user name.
|
||||
*/
|
||||
private static $_ownerName;
|
||||
/**
|
||||
* @var bool Is storage logging turned on.
|
||||
*/
|
||||
private static $_isStorageLoggingOn;
|
||||
/**
|
||||
* @var int ABSPATH length.
|
||||
*/
|
||||
private static $_abspathLength;
|
||||
|
||||
/**
|
||||
* @var FS_Logger[] $LOGGERS
|
||||
*/
|
||||
private static $LOGGERS = array();
|
||||
private static $LOG = array();
|
||||
private static $CNT = 0;
|
||||
private static $_HOOKED_FOOTER = false;
|
||||
|
||||
private function __construct( $id, $on = false, $echo = false ) {
|
||||
$bt = debug_backtrace();
|
||||
|
||||
$this->_id = $id;
|
||||
|
||||
$caller = $bt[2];
|
||||
|
||||
if ( false !== strpos( $caller['file'], 'plugins' ) ) {
|
||||
$this->_file_start = strpos( $caller['file'], 'plugins' ) + strlen( 'plugins/' );
|
||||
} else {
|
||||
$this->_file_start = strpos( $caller['file'], 'themes' ) + strlen( 'themes/' );
|
||||
}
|
||||
|
||||
if ( $on ) {
|
||||
$this->on();
|
||||
}
|
||||
if ( $echo ) {
|
||||
$this->echo_on();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param bool $on
|
||||
* @param bool $echo
|
||||
*
|
||||
* @return FS_Logger
|
||||
*/
|
||||
public static function get_logger( $id, $on = false, $echo = false ) {
|
||||
$id = strtolower( $id );
|
||||
|
||||
if ( ! isset( self::$_processID ) ) {
|
||||
self::init();
|
||||
}
|
||||
|
||||
if ( ! isset( self::$LOGGERS[ $id ] ) ) {
|
||||
self::$LOGGERS[ $id ] = new FS_Logger( $id, $on, $echo );
|
||||
}
|
||||
|
||||
return self::$LOGGERS[ $id ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize logging global info.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*/
|
||||
private static function init() {
|
||||
self::$_ownerName = function_exists( 'get_current_user' ) ?
|
||||
get_current_user() :
|
||||
'unknown';
|
||||
self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
|
||||
self::$_abspathLength = strlen( ABSPATH );
|
||||
self::$_processID = mt_rand( 0, 32000 );
|
||||
|
||||
// Process ID may be `false` on errors.
|
||||
if ( ! is_numeric( self::$_processID ) ) {
|
||||
self::$_processID = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static function hook_footer() {
|
||||
if ( self::$_HOOKED_FOOTER ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( is_admin() ) {
|
||||
add_action( 'admin_footer', 'FS_Logger::dump', 100 );
|
||||
} else {
|
||||
add_action( 'wp_footer', 'FS_Logger::dump', 100 );
|
||||
}
|
||||
}
|
||||
|
||||
function is_on() {
|
||||
return $this->_on;
|
||||
}
|
||||
|
||||
function on() {
|
||||
$this->_on = true;
|
||||
|
||||
if ( ! function_exists( 'dbDelta' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||
}
|
||||
|
||||
self::hook_footer();
|
||||
}
|
||||
function echo_on() {
|
||||
$this->on();
|
||||
|
||||
$this->_echo = true;
|
||||
}
|
||||
|
||||
function is_echo_on() {
|
||||
return $this->_echo;
|
||||
}
|
||||
|
||||
function get_id() {
|
||||
return $this->_id;
|
||||
}
|
||||
|
||||
function get_file() {
|
||||
return $this->_file_start;
|
||||
}
|
||||
|
||||
private function _log( &$message, $type, $wrapper = false ) {
|
||||
if ( ! $this->is_on() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$bt = debug_backtrace();
|
||||
$depth = $wrapper ? 3 : 2;
|
||||
while ( $depth < count( $bt ) - 1 && 'eval' === $bt[ $depth ]['function'] ) {
|
||||
$depth ++;
|
||||
}
|
||||
|
||||
$caller = $bt[ $depth ];
|
||||
|
||||
/**
|
||||
* Retrieve the correct call file & line number from backtrace
|
||||
* when logging from a wrapper method.
|
||||
*
|
||||
* @author Vova Feldman
|
||||
* @since 1.2.1.6
|
||||
*/
|
||||
if ( empty( $caller['line'] ) ) {
|
||||
$depth --;
|
||||
|
||||
while ( $depth >= 0 ) {
|
||||
if ( ! empty( $bt[ $depth ]['line'] ) ) {
|
||||
$caller['line'] = $bt[ $depth ]['line'];
|
||||
$caller['file'] = $bt[ $depth ]['file'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$log = array_merge( $caller, array(
|
||||
'cnt' => self::$CNT ++,
|
||||
'logger' => $this,
|
||||
'timestamp' => microtime( true ),
|
||||
'log_type' => $type,
|
||||
'msg' => $message,
|
||||
) );
|
||||
|
||||
if ( self::$_isStorageLoggingOn ) {
|
||||
$this->db_log( $type, $message, self::$CNT, $caller );
|
||||
}
|
||||
|
||||
self::$LOG[] = $log;
|
||||
|
||||
if ( $this->is_echo_on() && ! Freemius::is_ajax() ) {
|
||||
echo self::format_html( $log ) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
function log( $message, $wrapper = false ) {
|
||||
$this->_log( $message, 'log', $wrapper );
|
||||
}
|
||||
|
||||
function info( $message, $wrapper = false ) {
|
||||
$this->_log( $message, 'info', $wrapper );
|
||||
}
|
||||
|
||||
function warn( $message, $wrapper = false ) {
|
||||
$this->_log( $message, 'warn', $wrapper );
|
||||
}
|
||||
|
||||
function error( $message, $wrapper = false ) {
|
||||
$this->_log( $message, 'error', $wrapper );
|
||||
}
|
||||
|
||||
/**
|
||||
* Log API error.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.5
|
||||
*
|
||||
* @param mixed $api_result
|
||||
* @param bool $wrapper
|
||||
*/
|
||||
function api_error( $api_result, $wrapper = false ) {
|
||||
$message = '';
|
||||
if ( is_object( $api_result ) &&
|
||||
! empty( $api_result->error ) &&
|
||||
! empty( $api_result->error->message )
|
||||
) {
|
||||
$message = $api_result->error->message;
|
||||
} else if ( is_object( $api_result ) ) {
|
||||
$message = var_export( $api_result, true );
|
||||
} else if ( is_string( $api_result ) ) {
|
||||
$message = $api_result;
|
||||
} else if ( empty( $api_result ) ) {
|
||||
$message = 'Empty API result.';
|
||||
}
|
||||
|
||||
$message = 'API Error: ' . $message;
|
||||
|
||||
$this->_log( $message, 'error', $wrapper );
|
||||
}
|
||||
|
||||
function entrance( $message = '', $wrapper = false ) {
|
||||
$msg = 'Entrance' . ( empty( $message ) ? '' : ' > ' ) . $message;
|
||||
|
||||
$this->_log( $msg, 'log', $wrapper );
|
||||
}
|
||||
|
||||
function departure( $message = '', $wrapper = false ) {
|
||||
$msg = 'Departure' . ( empty( $message ) ? '' : ' > ' ) . $message;
|
||||
|
||||
$this->_log( $msg, 'log', $wrapper );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Log Formatting
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
private static function format( $log, $show_type = true ) {
|
||||
return '[' . str_pad( $log['cnt'], strlen( self::$CNT ), '0', STR_PAD_LEFT ) . '] [' . $log['logger']->_id . '] ' . ( $show_type ? '[' . $log['log_type'] . ']' : '' ) . ( ! empty( $log['class'] ) ? $log['class'] . $log['type'] : '' ) . $log['function'] . ' >> ' . $log['msg'] . ( isset( $log['file'] ) ? ' (' . substr( $log['file'], $log['logger']->_file_start ) . ' ' . $log['line'] . ') ' : '' ) . ' [' . $log['timestamp'] . ']';
|
||||
}
|
||||
|
||||
private static function format_html( $log ) {
|
||||
return '<div style="font-size: 13px; font-family: monospace; color: #7da767; padding: 8px 3px; background: #000; border-bottom: 1px solid #555;">[' . $log['cnt'] . '] [' . $log['logger']->_id . '] [' . $log['log_type'] . '] <b><code style="color: #c4b1e0;">' . ( ! empty( $log['class'] ) ? $log['class'] . $log['type'] : '' ) . $log['function'] . '</code> >> <b style="color: #f59330;">' . esc_html( $log['msg'] ) . '</b></b>' . ( isset( $log['file'] ) ? ' (' . substr( $log['file'], $log['logger']->_file_start ) . ' ' . $log['line'] . ')' : '' ) . ' [' . $log['timestamp'] . ']</div>';
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
static function dump() {
|
||||
?>
|
||||
<!-- BEGIN: Freemius PHP Console Log -->
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
foreach ( self::$LOG as $log ) {
|
||||
echo 'console.' . $log['log_type'] . '(' . json_encode( self::format( $log, false ) ) . ')' . "\n";
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
<!-- END: Freemius PHP Console Log -->
|
||||
<?php
|
||||
}
|
||||
|
||||
static function get_log() {
|
||||
return self::$LOG;
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Database Logging
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_storage_logging_on() {
|
||||
if ( ! isset( self::$_isStorageLoggingOn ) ) {
|
||||
self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
|
||||
}
|
||||
|
||||
return self::$_isStorageLoggingOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns on/off database persistent debugging to capture
|
||||
* multi-session logs to debug complex flows like
|
||||
* plugin auto-deactivate on premium version activation.
|
||||
*
|
||||
* @todo Check if Theme Check has issues with DB tables for themes.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param bool $is_on
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function _set_storage_logging( $is_on = true ) {
|
||||
global $wpdb;
|
||||
|
||||
$table = "{$wpdb->prefix}fs_logger";
|
||||
|
||||
/**
|
||||
* Drop logging table in any case.
|
||||
*/
|
||||
$result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
|
||||
|
||||
if ( $is_on ) {
|
||||
/**
|
||||
* Create logging table.
|
||||
*
|
||||
* NOTE:
|
||||
* dbDelta must use KEY and not INDEX for indexes.
|
||||
*
|
||||
* @link https://core.trac.wordpress.org/ticket/2695
|
||||
*/
|
||||
$result = $wpdb->query( "CREATE TABLE IF NOT EXISTS {$table} (
|
||||
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`process_id` INT UNSIGNED NOT NULL,
|
||||
`user_name` VARCHAR(64) NOT NULL,
|
||||
`logger` VARCHAR(128) NOT NULL,
|
||||
`log_order` INT UNSIGNED NOT NULL,
|
||||
`type` ENUM('log','info','warn','error') NOT NULL DEFAULT 'log',
|
||||
`message` TEXT NOT NULL,
|
||||
`file` VARCHAR(256) NOT NULL,
|
||||
`line` INT UNSIGNED NOT NULL,
|
||||
`function` VARCHAR(256) NOT NULL,
|
||||
`request_type` ENUM('call','ajax','cron') NOT NULL DEFAULT 'call',
|
||||
`request_url` VARCHAR(1024) NOT NULL,
|
||||
`created` DECIMAL(16, 6) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `process_id` (`process_id` ASC),
|
||||
KEY `process_logger` (`process_id` ASC, `logger` ASC),
|
||||
KEY `function` (`function` ASC),
|
||||
KEY `type` (`type` ASC))" );
|
||||
}
|
||||
|
||||
if ( false !== $result ) {
|
||||
update_option( 'fs_storage_logger', ( $is_on ? 1 : 0 ) );
|
||||
self::$_isStorageLoggingOn = $is_on;
|
||||
}
|
||||
|
||||
return ( false !== $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $message
|
||||
* @param int $log_order
|
||||
* @param array $caller
|
||||
*
|
||||
* @return false|int
|
||||
*/
|
||||
private function db_log(
|
||||
&$type,
|
||||
&$message,
|
||||
&$log_order,
|
||||
&$caller
|
||||
) {
|
||||
global $wpdb;
|
||||
|
||||
$request_type = 'call';
|
||||
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
||||
$request_type = 'cron';
|
||||
} else if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
||||
$request_type = 'ajax';
|
||||
}
|
||||
|
||||
$request_url = WP_FS__IS_HTTP_REQUEST ?
|
||||
$_SERVER['REQUEST_URI'] :
|
||||
'';
|
||||
|
||||
return $wpdb->insert(
|
||||
"{$wpdb->prefix}fs_logger",
|
||||
array(
|
||||
'process_id' => self::$_processID,
|
||||
'user_name' => self::$_ownerName,
|
||||
'logger' => $this->_id,
|
||||
'log_order' => $log_order,
|
||||
'type' => $type,
|
||||
'request_type' => $request_type,
|
||||
'request_url' => $request_url,
|
||||
'message' => $message,
|
||||
'file' => isset( $caller['file'] ) ?
|
||||
substr( $caller['file'], self::$_abspathLength ) :
|
||||
'',
|
||||
'line' => $caller['line'],
|
||||
'function' => ( ! empty( $caller['class'] ) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
|
||||
'created' => microtime( true ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Persistent DB logger columns.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $_log_columns = array(
|
||||
'id',
|
||||
'process_id',
|
||||
'user_name',
|
||||
'logger',
|
||||
'log_order',
|
||||
'type',
|
||||
'message',
|
||||
'file',
|
||||
'line',
|
||||
'function',
|
||||
'request_type',
|
||||
'request_url',
|
||||
'created',
|
||||
);
|
||||
|
||||
/**
|
||||
* Create DB logs query.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param bool $filters
|
||||
* @param int $limit
|
||||
* @param int $offset
|
||||
* @param bool $order
|
||||
* @param bool $escape_eol
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function build_db_logs_query(
|
||||
$filters = false,
|
||||
$limit = 200,
|
||||
$offset = 0,
|
||||
$order = false,
|
||||
$escape_eol = false
|
||||
) {
|
||||
global $wpdb;
|
||||
|
||||
$select = '*';
|
||||
|
||||
if ( $escape_eol ) {
|
||||
$select = '';
|
||||
for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
|
||||
if ( $i > 0 ) {
|
||||
$select .= ', ';
|
||||
}
|
||||
|
||||
if ( 'message' !== self::$_log_columns[ $i ] ) {
|
||||
$select .= self::$_log_columns[ $i ];
|
||||
} else {
|
||||
$select .= 'REPLACE(message , \'\n\', \' \') AS message';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query = "SELECT {$select} FROM {$wpdb->prefix}fs_logger";
|
||||
if ( is_array( $filters ) ) {
|
||||
$criteria = array();
|
||||
|
||||
if ( ! empty( $filters['type'] ) && 'all' !== $filters['type'] ) {
|
||||
$filters['type'] = strtolower( $filters['type'] );
|
||||
|
||||
switch ( $filters['type'] ) {
|
||||
case 'warn_error':
|
||||
$criteria[] = array( 'col' => 'type', 'val' => array( 'warn', 'error' ) );
|
||||
break;
|
||||
case 'error':
|
||||
case 'warn':
|
||||
$criteria[] = array( 'col' => 'type', 'val' => $filters['type'] );
|
||||
break;
|
||||
case 'info':
|
||||
default:
|
||||
$criteria[] = array( 'col' => 'type', 'val' => array( 'info', 'log' ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $filters['request_type'] ) ) {
|
||||
$filters['request_type'] = strtolower( $filters['request_type'] );
|
||||
|
||||
if ( in_array( $filters['request_type'], array( 'call', 'ajax', 'cron' ) ) ) {
|
||||
$criteria[] = array( 'col' => 'request_type', 'val' => $filters['request_type'] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $filters['file'] ) ) {
|
||||
$criteria[] = array(
|
||||
'col' => 'file',
|
||||
'op' => 'LIKE',
|
||||
'val' => '%' . esc_sql( $filters['file'] ),
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! empty( $filters['function'] ) ) {
|
||||
$criteria[] = array(
|
||||
'col' => 'function',
|
||||
'op' => 'LIKE',
|
||||
'val' => '%' . esc_sql( $filters['function'] ),
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! empty( $filters['process_id'] ) && is_numeric( $filters['process_id'] ) ) {
|
||||
$criteria[] = array( 'col' => 'process_id', 'val' => $filters['process_id'] );
|
||||
}
|
||||
|
||||
if ( ! empty( $filters['logger'] ) ) {
|
||||
$criteria[] = array(
|
||||
'col' => 'logger',
|
||||
'op' => 'LIKE',
|
||||
'val' => '%' . esc_sql( $filters['logger'] ) . '%',
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! empty( $filters['message'] ) ) {
|
||||
$criteria[] = array(
|
||||
'col' => 'message',
|
||||
'op' => 'LIKE',
|
||||
'val' => '%' . esc_sql( $filters['message'] ) . '%',
|
||||
);
|
||||
}
|
||||
|
||||
if ( 0 < count( $criteria ) ) {
|
||||
$query .= "\nWHERE\n";
|
||||
|
||||
$first = true;
|
||||
foreach ( $criteria as $c ) {
|
||||
if ( ! $first ) {
|
||||
$query .= "AND\n";
|
||||
}
|
||||
|
||||
if ( is_array( $c['val'] ) ) {
|
||||
$operator = 'IN';
|
||||
|
||||
for ( $i = 0, $len = count( $c['val'] ); $i < $len; $i ++ ) {
|
||||
$c['val'][ $i ] = "'" . esc_sql( $c['val'][ $i ] ) . "'";
|
||||
}
|
||||
|
||||
$val = '(' . implode( ',', $c['val'] ) . ')';
|
||||
} else {
|
||||
$operator = ! empty( $c['op'] ) ? $c['op'] : '=';
|
||||
$val = "'" . esc_sql( $c['val'] ) . "'";
|
||||
}
|
||||
|
||||
$query .= "`{$c['col']}` {$operator} {$val}\n";
|
||||
|
||||
$first = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! is_array( $order ) ) {
|
||||
$order = array(
|
||||
'col' => 'id',
|
||||
'order' => 'desc'
|
||||
);
|
||||
}
|
||||
|
||||
$query .= " ORDER BY {$order['col']} {$order['order']} LIMIT {$offset},{$limit}";
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load logs from DB.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param bool $filters
|
||||
* @param int $limit
|
||||
* @param int $offset
|
||||
* @param bool $order
|
||||
*
|
||||
* @return object[]|null
|
||||
*/
|
||||
public static function load_db_logs(
|
||||
$filters = false,
|
||||
$limit = 200,
|
||||
$offset = 0,
|
||||
$order = false
|
||||
) {
|
||||
global $wpdb;
|
||||
|
||||
$query = self::build_db_logs_query(
|
||||
$filters,
|
||||
$limit,
|
||||
$offset,
|
||||
$order
|
||||
);
|
||||
|
||||
return $wpdb->get_results( $query );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load logs from DB.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param bool $filters
|
||||
* @param string $filename
|
||||
* @param int $limit
|
||||
* @param int $offset
|
||||
* @param bool $order
|
||||
*
|
||||
* @return false|string File download URL or false on failure.
|
||||
*/
|
||||
public static function download_db_logs(
|
||||
$filters = false,
|
||||
$filename = '',
|
||||
$limit = 10000,
|
||||
$offset = 0,
|
||||
$order = false
|
||||
) {
|
||||
if ( empty( $filename ) ) {
|
||||
$filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
|
||||
}
|
||||
|
||||
$upload_dir = wp_upload_dir();
|
||||
$filepath = rtrim( $upload_dir['path'], '/' ) . "/{$filename}";
|
||||
|
||||
WP_Filesystem();
|
||||
if ( ! $GLOBALS['wp_filesystem']->is_writable( dirname( $filepath ) ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$query = self::build_db_logs_query(
|
||||
$filters,
|
||||
$limit,
|
||||
$offset,
|
||||
$order,
|
||||
true
|
||||
);
|
||||
|
||||
$columns = '';
|
||||
for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
|
||||
if ( $i > 0 ) {
|
||||
$columns .= ', ';
|
||||
}
|
||||
|
||||
$columns .= "'" . self::$_log_columns[ $i ] . "'";
|
||||
}
|
||||
|
||||
$query = "SELECT {$columns} UNION ALL " . $query;
|
||||
|
||||
$result = $GLOBALS['wpdb']->get_results( $query );
|
||||
|
||||
if ( false === $result ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! self::write_csv_to_filesystem( $filepath, $result ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return rtrim( $upload_dir['url'], '/' ) . '/' . $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_logs_download_url( $filename = '' ) {
|
||||
$upload_dir = wp_upload_dir();
|
||||
if ( empty( $filename ) ) {
|
||||
$filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
|
||||
}
|
||||
|
||||
return rtrim( $upload_dir['url'], '/' ) . $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $file_path
|
||||
* @param array $query_results
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private static function write_csv_to_filesystem( $file_path, $query_results ) {
|
||||
if ( empty( $query_results ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$content = '';
|
||||
|
||||
foreach ( $query_results as $row ) {
|
||||
$row_data = array_map( function ( $value ) {
|
||||
return str_replace( "\n", ' ', $value );
|
||||
}, (array) $row );
|
||||
$content .= implode( "\t", $row_data ) . "\n";
|
||||
}
|
||||
|
||||
if ( ! $GLOBALS['wp_filesystem']->put_contents( $file_path, $content, FS_CHMOD_FILE ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,431 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.2.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Options
|
||||
*
|
||||
* A wrapper class for handling network level and single site level options.
|
||||
*/
|
||||
class FS_Options {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_id;
|
||||
|
||||
/**
|
||||
* @var array[string]FS_Options {
|
||||
* @key string
|
||||
* @value FS_Options
|
||||
* }
|
||||
*/
|
||||
private static $_instances;
|
||||
|
||||
/**
|
||||
* @var FS_Option_Manager Site level options.
|
||||
*/
|
||||
private $_options;
|
||||
|
||||
/**
|
||||
* @var FS_Option_Manager Network level options.
|
||||
*/
|
||||
private $_network_options;
|
||||
|
||||
/**
|
||||
* @var int The ID of the blog that is associated with the current site level options.
|
||||
*/
|
||||
private $_blog_id = 0;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_multisite;
|
||||
|
||||
/**
|
||||
* @var string[] Lazy collection of params on the site level.
|
||||
*/
|
||||
private static $_SITE_OPTIONS_MAP;
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $id
|
||||
* @param bool $load
|
||||
*
|
||||
* @return FS_Options
|
||||
*/
|
||||
static function instance( $id, $load = false ) {
|
||||
if ( ! isset( self::$_instances[ $id ] ) ) {
|
||||
self::$_instances[ $id ] = new FS_Options( $id, $load );
|
||||
}
|
||||
|
||||
return self::$_instances[ $id ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $id
|
||||
* @param bool $load
|
||||
*/
|
||||
private function __construct( $id, $load = false ) {
|
||||
$this->_id = $id;
|
||||
$this->_is_multisite = is_multisite();
|
||||
|
||||
if ( $this->_is_multisite ) {
|
||||
$this->_blog_id = get_current_blog_id();
|
||||
$this->_network_options = FS_Option_Manager::get_manager( $id, $load, true );
|
||||
}
|
||||
|
||||
$this->_options = FS_Option_Manager::get_manager( $id, $load, $this->_blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch the context of the site level options manager.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param $blog_id
|
||||
*/
|
||||
function set_site_blog_context( $blog_id ) {
|
||||
$this->_blog_id = $blog_id;
|
||||
|
||||
$this->_options = FS_Option_Manager::get_manager( $this->_id, false, $this->_blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param string $option
|
||||
* @param mixed $default
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_SITE_LEVEL_PARAMS).
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function get_option( $option, $default = null, $network_level_or_blog_id = null ) {
|
||||
if ( $this->should_use_network_storage( $option, $network_level_or_blog_id ) ) {
|
||||
return $this->_network_options->get_option( $option, $default );
|
||||
}
|
||||
|
||||
$site_options = $this->get_site_options( $network_level_or_blog_id );
|
||||
|
||||
return $site_options->get_option( $option, $default );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $option
|
||||
* @param mixed $value
|
||||
* @param bool $flush
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_SITE_LEVEL_PARAMS).
|
||||
*/
|
||||
function set_option( $option, $value, $flush = false, $network_level_or_blog_id = null ) {
|
||||
if ( $this->should_use_network_storage( $option, $network_level_or_blog_id ) ) {
|
||||
$this->_network_options->set_option( $option, $value, $flush );
|
||||
} else {
|
||||
$site_options = $this->get_site_options( $network_level_or_blog_id );
|
||||
$site_options->set_option( $option, $value, $flush );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $option
|
||||
* @param bool $flush
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_SITE_LEVEL_PARAMS).
|
||||
*/
|
||||
function unset_option( $option, $flush = false, $network_level_or_blog_id = null ) {
|
||||
if ( $this->should_use_network_storage( $option, $network_level_or_blog_id ) ) {
|
||||
$this->_network_options->unset_option( $option, $flush );
|
||||
} else {
|
||||
$site_options = $this->get_site_options( $network_level_or_blog_id );
|
||||
$site_options->unset_option( $option, $flush );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param bool $flush
|
||||
* @param bool $network_level
|
||||
*/
|
||||
function load( $flush = false, $network_level = true ) {
|
||||
if ( $this->_is_multisite && $network_level ) {
|
||||
$this->_network_options->load( $flush );
|
||||
} else {
|
||||
$this->_options->load( $flush );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, store both network storage and the current context blog storage.
|
||||
*/
|
||||
function store( $network_level_or_blog_id = null ) {
|
||||
if ( ! $this->_is_multisite ||
|
||||
false === $network_level_or_blog_id ||
|
||||
0 == $network_level_or_blog_id ||
|
||||
is_null( $network_level_or_blog_id )
|
||||
) {
|
||||
$site_options = $this->get_site_options( $network_level_or_blog_id );
|
||||
$site_options->store();
|
||||
}
|
||||
|
||||
if ( $this->_is_multisite &&
|
||||
( is_null( $network_level_or_blog_id ) || true === $network_level_or_blog_id )
|
||||
) {
|
||||
$this->_network_options->store();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int|null|bool $network_level_or_blog_id
|
||||
* @param bool $flush
|
||||
*/
|
||||
function clear( $network_level_or_blog_id = null, $flush = false ) {
|
||||
if ( ! $this->_is_multisite ||
|
||||
false === $network_level_or_blog_id ||
|
||||
is_null( $network_level_or_blog_id ) ||
|
||||
is_numeric( $network_level_or_blog_id )
|
||||
) {
|
||||
$site_options = $this->get_site_options( $network_level_or_blog_id );
|
||||
$site_options->clear( $flush );
|
||||
}
|
||||
|
||||
if ( $this->_is_multisite &&
|
||||
( true === $network_level_or_blog_id || is_null( $network_level_or_blog_id ) )
|
||||
) {
|
||||
$this->_network_options->clear( $flush );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migration script to the new storage data structure that is network compatible.
|
||||
*
|
||||
* IMPORTANT:
|
||||
* This method should be executed only after it is determined if this is a network
|
||||
* level compatible product activation.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int $blog_id
|
||||
*/
|
||||
function migrate_to_network( $blog_id = 0 ) {
|
||||
if ( ! $this->_is_multisite ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$updated = false;
|
||||
|
||||
$site_options = $this->get_site_options( $blog_id );
|
||||
|
||||
$keys = $site_options->get_options_keys();
|
||||
|
||||
foreach ( $keys as $option ) {
|
||||
if ( $this->is_site_option( $option ) ||
|
||||
// Don't move admin notices to the network storage.
|
||||
in_array($option, array(
|
||||
// Don't move admin notices to the network storage.
|
||||
'admin_notices',
|
||||
// Don't migrate the module specific data, it will be migrated by the FS_Storage.
|
||||
'plugin_data',
|
||||
'theme_data',
|
||||
))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$option_updated = false;
|
||||
|
||||
// Migrate option to the network storage.
|
||||
$site_option = $site_options->get_option( $option );
|
||||
|
||||
if ( ! $this->_network_options->has_option( $option ) ) {
|
||||
// Option not set on the network level, so just set it.
|
||||
$this->_network_options->set_option( $option, $site_option, false );
|
||||
|
||||
$option_updated = true;
|
||||
} else {
|
||||
// Option already set on the network level, so we need to merge it inelegantly.
|
||||
$network_option = $this->_network_options->get_option( $option );
|
||||
|
||||
if ( is_array( $network_option ) && is_array( $site_option ) ) {
|
||||
// Option is an array.
|
||||
foreach ( $site_option as $key => $value ) {
|
||||
if ( ! isset( $network_option[ $key ] ) ) {
|
||||
$network_option[ $key ] = $value;
|
||||
|
||||
$option_updated = true;
|
||||
} else if ( is_array( $network_option[ $key ] ) && is_array( $value ) ) {
|
||||
if ( empty( $network_option[ $key ] ) ) {
|
||||
$network_option[ $key ] = $value;
|
||||
|
||||
$option_updated = true;
|
||||
} else if ( empty( $value ) ) {
|
||||
// Do nothing.
|
||||
} else {
|
||||
reset($value);
|
||||
$first_key = key($value);
|
||||
if ( $value[$first_key] instanceof FS_Entity ) {
|
||||
// Merge entities by IDs.
|
||||
$network_entities_ids = array();
|
||||
foreach ( $network_option[ $key ] as $entity ) {
|
||||
$network_entities_ids[ $entity->id ] = true;
|
||||
}
|
||||
|
||||
foreach ( $value as $entity ) {
|
||||
if ( ! isset( $network_entities_ids[ $entity->id ] ) ) {
|
||||
$network_option[ $key ][] = $entity;
|
||||
|
||||
$option_updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $option_updated ) {
|
||||
$this->_network_options->set_option( $option, $network_option, false );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the option from site level storage.
|
||||
*
|
||||
* IMPORTANT:
|
||||
* The line below is intentionally commented since we want to preserve the option
|
||||
* on the site storage level for "downgrade compatibility". Basically, if the user
|
||||
* will downgrade to an older version of the plugin with the prev storage structure,
|
||||
* it will continue working.
|
||||
*
|
||||
* @todo After a few releases we can remove this.
|
||||
*/
|
||||
// $site_options->unset_option($option, false);
|
||||
|
||||
if ( $option_updated ) {
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $updated ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update network level storage.
|
||||
$this->_network_options->store();
|
||||
// $site_options->store();
|
||||
}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Helper Methods
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* We don't want to load the map right away since it's not even needed in a non-MS environment.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*/
|
||||
private static function load_site_options_map() {
|
||||
self::$_SITE_OPTIONS_MAP = array(
|
||||
'sites' => true,
|
||||
'theme_sites' => true,
|
||||
'unique_id' => true,
|
||||
'active_plugins' => true,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $option
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function is_site_option( $option ) {
|
||||
if ( WP_FS__ACCOUNTS_OPTION_NAME != $this->_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! isset( self::$_SITE_OPTIONS_MAP ) ) {
|
||||
self::load_site_options_map();
|
||||
}
|
||||
|
||||
return isset( self::$_SITE_OPTIONS_MAP[ $option ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int $blog_id
|
||||
*
|
||||
* @return FS_Option_Manager
|
||||
*/
|
||||
private function get_site_options( $blog_id = 0 ) {
|
||||
if ( 0 == $blog_id || $blog_id == $this->_blog_id ) {
|
||||
return $this->_options;
|
||||
}
|
||||
|
||||
return FS_Option_Manager::get_manager( $this->_id, true, $blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an option should be stored on the MS network storage.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $option
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_SITE_LEVEL_PARAMS).
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function should_use_network_storage( $option, $network_level_or_blog_id = null ) {
|
||||
if ( ! $this->_is_multisite ) {
|
||||
// Not a multisite environment.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is_numeric( $network_level_or_blog_id ) ) {
|
||||
// Explicitly asked to use a specified blog storage.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is_bool( $network_level_or_blog_id ) ) {
|
||||
// Explicitly specified whether should use the network or blog level storage.
|
||||
return $network_level_or_blog_id;
|
||||
}
|
||||
|
||||
// Determine which storage to use based on the option.
|
||||
return ! $this->is_site_option( $option );
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
define( 'WP_FS__SECURITY_PARAMS_PREFIX', 's_' );
|
||||
|
||||
/**
|
||||
* Class FS_Security
|
||||
*/
|
||||
class FS_Security {
|
||||
/**
|
||||
* @var FS_Security
|
||||
* @since 1.0.3
|
||||
*/
|
||||
private static $_instance;
|
||||
/**
|
||||
* @var FS_Logger
|
||||
* @since 1.0.3
|
||||
*/
|
||||
private static $_logger;
|
||||
|
||||
/**
|
||||
* @return \FS_Security
|
||||
*/
|
||||
public static function instance() {
|
||||
if ( ! isset( self::$_instance ) ) {
|
||||
self::$_instance = new FS_Security();
|
||||
self::$_logger = FS_Logger::get_logger(
|
||||
WP_FS__SLUG,
|
||||
WP_FS__DEBUG_SDK,
|
||||
WP_FS__ECHO_DEBUG_SDK
|
||||
);
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
private function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \FS_Scope_Entity $entity
|
||||
* @param int $timestamp
|
||||
* @param string $action
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_secure_token( FS_Scope_Entity $entity, $timestamp, $action = '' ) {
|
||||
return md5(
|
||||
$timestamp .
|
||||
$entity->id .
|
||||
$entity->secret_key .
|
||||
$entity->public_key .
|
||||
$action
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \FS_Scope_Entity $entity
|
||||
* @param int|bool $timestamp
|
||||
* @param string $action
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_context_params( FS_Scope_Entity $entity, $timestamp = false, $action = '' ) {
|
||||
if ( false === $timestamp ) {
|
||||
$timestamp = time();
|
||||
}
|
||||
|
||||
return array(
|
||||
's_ctx_type' => $entity->get_type(),
|
||||
's_ctx_id' => $entity->id,
|
||||
's_ctx_ts' => $timestamp,
|
||||
's_ctx_secure' => $this->get_secure_token( $entity, $timestamp, $action ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a sandbox trial token for a given plugin, plan, and trial timestamp.
|
||||
*
|
||||
* @param FS_Plugin $plugin
|
||||
* @param FS_Plugin_Plan $plan
|
||||
* @param int $trial_timestamp
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_trial_token( FS_Plugin $plugin, FS_Plugin_Plan $plan, $trial_timestamp ) {
|
||||
return md5(
|
||||
$plugin->secret_key . $plugin->public_key .
|
||||
$plan->trial_period .
|
||||
$plan->id .
|
||||
$trial_timestamp
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,560 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.2.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Storage
|
||||
*
|
||||
* A wrapper class for handling network level and single site level storage.
|
||||
*
|
||||
* @property bool $is_network_activation
|
||||
* @property int $network_install_blog_id
|
||||
* @property bool|null $is_extensions_tracking_allowed
|
||||
* @property bool|null $is_diagnostic_tracking_allowed
|
||||
* @property object $sync_cron
|
||||
* @property bool|int $install_timestamp
|
||||
*/
|
||||
class FS_Storage {
|
||||
/**
|
||||
* @var FS_Storage[]
|
||||
*/
|
||||
private static $_instances = array();
|
||||
/**
|
||||
* @var FS_Key_Value_Storage Site level storage.
|
||||
*/
|
||||
private $_storage;
|
||||
|
||||
/**
|
||||
* @var FS_Key_Value_Storage Network level storage.
|
||||
*/
|
||||
private $_network_storage;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_module_type;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_module_slug;
|
||||
|
||||
/**
|
||||
* @var int The ID of the blog that is associated with the current site level options.
|
||||
*/
|
||||
private $_blog_id = 0;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_multisite;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_network_active = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_delegated_connection = false;
|
||||
|
||||
/**
|
||||
* @var array {
|
||||
* @key string Option name.
|
||||
* @value int If 0 store on the network level. If 1, store on the network level only if module was network level activated. If 2, store on the network level only if network activated and NOT delegated the connection.
|
||||
* }
|
||||
*/
|
||||
private static $_NETWORK_OPTIONS_MAP;
|
||||
|
||||
const OPTION_LEVEL_UNDEFINED = -1;
|
||||
// The option should be stored on the network level.
|
||||
const OPTION_LEVEL_NETWORK = 0;
|
||||
// The option should be stored on the network level when the plugin is network-activated.
|
||||
const OPTION_LEVEL_NETWORK_ACTIVATED = 1;
|
||||
// The option should be stored on the network level when the plugin is network-activated and the opt-in connection was NOT delegated to the sub-site admin.
|
||||
const OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED = 2;
|
||||
// The option should be stored on the site level.
|
||||
const OPTION_LEVEL_SITE = 3;
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param string $module_type
|
||||
* @param string $slug
|
||||
*
|
||||
* @return FS_Storage
|
||||
*/
|
||||
static function instance( $module_type, $slug ) {
|
||||
$key = $module_type . ':' . $slug;
|
||||
|
||||
if ( ! isset( self::$_instances[ $key ] ) ) {
|
||||
self::$_instances[ $key ] = new FS_Storage( $module_type, $slug );
|
||||
}
|
||||
|
||||
return self::$_instances[ $key ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param string $module_type
|
||||
* @param string $slug
|
||||
*/
|
||||
private function __construct( $module_type, $slug ) {
|
||||
$this->_module_type = $module_type;
|
||||
$this->_module_slug = $slug;
|
||||
$this->_is_multisite = is_multisite();
|
||||
|
||||
if ( $this->_is_multisite ) {
|
||||
$this->_blog_id = get_current_blog_id();
|
||||
$this->_network_storage = FS_Key_Value_Storage::instance( $module_type . '_data', $slug, true );
|
||||
}
|
||||
|
||||
$this->_storage = FS_Key_Value_Storage::instance( $module_type . '_data', $slug, $this->_blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells this storage wrapper class that the context plugin is network active. This flag will affect how values
|
||||
* are retrieved/stored from/into the storage.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param bool $is_network_active
|
||||
* @param bool $is_delegated_connection
|
||||
*/
|
||||
function set_network_active( $is_network_active = true, $is_delegated_connection = false ) {
|
||||
$this->_is_network_active = $is_network_active;
|
||||
$this->_is_delegated_connection = $is_delegated_connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch the context of the site level storage manager.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int $blog_id
|
||||
*/
|
||||
function set_site_blog_context( $blog_id ) {
|
||||
$this->_storage = $this->get_site_storage( $blog_id );
|
||||
$this->_blog_id = $blog_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_BINARY_MAP).
|
||||
* @param int $option_level Since 2.5.1
|
||||
* @param bool $flush
|
||||
*/
|
||||
function store(
|
||||
$key,
|
||||
$value,
|
||||
$network_level_or_blog_id = null,
|
||||
$option_level = self::OPTION_LEVEL_UNDEFINED,
|
||||
$flush = true
|
||||
) {
|
||||
if ( $this->should_use_network_storage( $key, $network_level_or_blog_id, $option_level ) ) {
|
||||
$this->_network_storage->store( $key, $value, $flush );
|
||||
} else {
|
||||
$storage = $this->get_site_storage( $network_level_or_blog_id );
|
||||
$storage->store( $key, $value, $flush );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param bool $store
|
||||
* @param string[] $exceptions Set of keys to keep and not clear.
|
||||
* @param int|null|bool $network_level_or_blog_id
|
||||
*/
|
||||
function clear_all( $store = true, $exceptions = array(), $network_level_or_blog_id = null ) {
|
||||
if ( ! $this->_is_multisite ||
|
||||
false === $network_level_or_blog_id ||
|
||||
is_null( $network_level_or_blog_id ) ||
|
||||
is_numeric( $network_level_or_blog_id )
|
||||
) {
|
||||
$storage = $this->get_site_storage( $network_level_or_blog_id );
|
||||
$storage->clear_all( $store, $exceptions );
|
||||
}
|
||||
|
||||
if ( $this->_is_multisite &&
|
||||
( true === $network_level_or_blog_id || is_null( $network_level_or_blog_id ) )
|
||||
) {
|
||||
$this->_network_storage->clear_all( $store, $exceptions );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param string $key
|
||||
* @param bool $store
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_BINARY_MAP).
|
||||
*/
|
||||
function remove( $key, $store = true, $network_level_or_blog_id = null ) {
|
||||
if ( $this->should_use_network_storage( $key, $network_level_or_blog_id ) ) {
|
||||
$this->_network_storage->remove( $key, $store );
|
||||
} else {
|
||||
$storage = $this->get_site_storage( $network_level_or_blog_id );
|
||||
$storage->remove( $key, $store );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_BINARY_MAP).
|
||||
* @param int $option_level Since 2.5.1
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function get(
|
||||
$key,
|
||||
$default = false,
|
||||
$network_level_or_blog_id = null,
|
||||
$option_level = self::OPTION_LEVEL_UNDEFINED
|
||||
) {
|
||||
if ( $this->should_use_network_storage( $key, $network_level_or_blog_id, $option_level ) ) {
|
||||
return $this->_network_storage->get( $key, $default );
|
||||
} else {
|
||||
$storage = $this->get_site_storage( $network_level_or_blog_id );
|
||||
|
||||
return $storage->get( $key, $default );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Multisite activated:
|
||||
* true: Save network storage.
|
||||
* int: Save site specific storage.
|
||||
* false|0: Save current site storage.
|
||||
* null: Save network and current site storage.
|
||||
* Site level activated:
|
||||
* Save site storage.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param bool|int|null $network_level_or_blog_id
|
||||
*/
|
||||
function save( $network_level_or_blog_id = null ) {
|
||||
if ( $this->_is_network_active &&
|
||||
( true === $network_level_or_blog_id || is_null( $network_level_or_blog_id ) )
|
||||
) {
|
||||
$this->_network_storage->save();
|
||||
}
|
||||
|
||||
if ( ! $this->_is_network_active || true !== $network_level_or_blog_id ) {
|
||||
$storage = $this->get_site_storage( $network_level_or_blog_id );
|
||||
$storage->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_module_slug() {
|
||||
return $this->_module_slug;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_module_type() {
|
||||
return $this->_module_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Migration script to the new storage data structure that is network compatible.
|
||||
*
|
||||
* IMPORTANT:
|
||||
* This method should be executed only after it is determined if this is a network
|
||||
* level compatible product activation.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function migrate_to_network() {
|
||||
if ( ! $this->_is_multisite ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$updated = false;
|
||||
|
||||
if ( ! isset( self::$_NETWORK_OPTIONS_MAP ) ) {
|
||||
self::load_network_options_map();
|
||||
}
|
||||
|
||||
foreach ( self::$_NETWORK_OPTIONS_MAP as $option => $storage_level ) {
|
||||
if ( ! $this->is_multisite_option( $option ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $this->_storage->{$option} ) && ! isset( $this->_network_storage->{$option} ) ) {
|
||||
// Migrate option to the network storage.
|
||||
$this->_network_storage->store( $option, $this->_storage->{$option}, false );
|
||||
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $updated ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update network level storage.
|
||||
$this->_network_storage->save();
|
||||
// $this->_storage->save();
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Helper Methods
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* We don't want to load the map right away since it's not even needed in a non-MS environment.
|
||||
*
|
||||
* Example:
|
||||
* array(
|
||||
* 'option1' => 0, // Means that the option should always be stored on the network level.
|
||||
* 'option2' => 1, // Means that the option should be stored on the network level only when the module was network level activated.
|
||||
* 'option2' => 2, // Means that the option should be stored on the network level only when the module was network level activated AND the connection was NOT delegated.
|
||||
* 'option3' => 3, // Means that the option should always be stored on the site level.
|
||||
* )
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*/
|
||||
private static function load_network_options_map() {
|
||||
self::$_NETWORK_OPTIONS_MAP = array(
|
||||
// Network level options.
|
||||
'affiliate_application_data' => self::OPTION_LEVEL_NETWORK,
|
||||
'beta_data' => self::OPTION_LEVEL_NETWORK,
|
||||
'connectivity_test' => self::OPTION_LEVEL_NETWORK,
|
||||
'handle_gdpr_admin_notice' => self::OPTION_LEVEL_NETWORK,
|
||||
'has_trial_plan' => self::OPTION_LEVEL_NETWORK,
|
||||
'install_sync_timestamp' => self::OPTION_LEVEL_NETWORK,
|
||||
'install_sync_cron' => self::OPTION_LEVEL_NETWORK,
|
||||
'is_anonymous_ms' => self::OPTION_LEVEL_NETWORK,
|
||||
'is_network_activated' => self::OPTION_LEVEL_NETWORK,
|
||||
'is_on' => self::OPTION_LEVEL_NETWORK,
|
||||
'is_plugin_new_install' => self::OPTION_LEVEL_NETWORK,
|
||||
'last_load_timestamp' => self::OPTION_LEVEL_NETWORK,
|
||||
'network_install_blog_id' => self::OPTION_LEVEL_NETWORK,
|
||||
'pending_sites_info' => self::OPTION_LEVEL_NETWORK,
|
||||
'plugin_last_version' => self::OPTION_LEVEL_NETWORK,
|
||||
'plugin_main_file' => self::OPTION_LEVEL_NETWORK,
|
||||
'plugin_version' => self::OPTION_LEVEL_NETWORK,
|
||||
'sdk_downgrade_mode' => self::OPTION_LEVEL_NETWORK,
|
||||
'sdk_last_version' => self::OPTION_LEVEL_NETWORK,
|
||||
'sdk_upgrade_mode' => self::OPTION_LEVEL_NETWORK,
|
||||
'sdk_version' => self::OPTION_LEVEL_NETWORK,
|
||||
'sticky_optin_added_ms' => self::OPTION_LEVEL_NETWORK,
|
||||
'subscriptions' => self::OPTION_LEVEL_NETWORK,
|
||||
'sync_timestamp' => self::OPTION_LEVEL_NETWORK,
|
||||
'sync_cron' => self::OPTION_LEVEL_NETWORK,
|
||||
'was_plugin_loaded' => self::OPTION_LEVEL_NETWORK,
|
||||
'network_user_id' => self::OPTION_LEVEL_NETWORK,
|
||||
'plugin_upgrade_mode' => self::OPTION_LEVEL_NETWORK,
|
||||
'plugin_downgrade_mode' => self::OPTION_LEVEL_NETWORK,
|
||||
'is_network_connected' => self::OPTION_LEVEL_NETWORK,
|
||||
/**
|
||||
* Special flag that is used when a super-admin upgrades to the new version of the SDK that supports network level integration, when the connection decision wasn't made for all the sites in the network.
|
||||
*/
|
||||
'is_network_activation' => self::OPTION_LEVEL_NETWORK,
|
||||
'license_migration' => self::OPTION_LEVEL_NETWORK,
|
||||
|
||||
// When network activated, then network level.
|
||||
'install_timestamp' => self::OPTION_LEVEL_NETWORK_ACTIVATED,
|
||||
'prev_is_premium' => self::OPTION_LEVEL_NETWORK_ACTIVATED,
|
||||
'require_license_activation' => self::OPTION_LEVEL_NETWORK_ACTIVATED,
|
||||
|
||||
// If not network activated OR delegated, then site level.
|
||||
'activation_timestamp' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'expired_license_notice_shown' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'is_whitelabeled' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'last_license_key' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'last_license_user_id' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'prev_user_id' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'sticky_optin_added' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'uninstall_reason' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'is_pending_activation' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
'pending_license_key' => self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED,
|
||||
|
||||
// Site level options.
|
||||
'is_anonymous' => self::OPTION_LEVEL_SITE,
|
||||
'clone_id' => self::OPTION_LEVEL_SITE,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will and should only be executed when is_multisite() is true.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $key
|
||||
* @param int $option_level Since 2.5.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function is_multisite_option( $key, $option_level = self::OPTION_LEVEL_UNDEFINED ) {
|
||||
if ( ! isset( self::$_NETWORK_OPTIONS_MAP ) ) {
|
||||
self::load_network_options_map();
|
||||
}
|
||||
|
||||
if (
|
||||
self::OPTION_LEVEL_UNDEFINED === $option_level &&
|
||||
isset( self::$_NETWORK_OPTIONS_MAP[ $key ] )
|
||||
) {
|
||||
$option_level = self::$_NETWORK_OPTIONS_MAP[ $key ];
|
||||
}
|
||||
|
||||
if ( self::OPTION_LEVEL_UNDEFINED === $option_level ) {
|
||||
// Option not found -> use site level storage.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( self::OPTION_LEVEL_NETWORK === $option_level ) {
|
||||
// Option found and set to always use the network level storage on a multisite.
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( self::OPTION_LEVEL_SITE === $option_level ) {
|
||||
// Option found and set to always use the site level storage on a multisite.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $this->_is_network_active ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( self::OPTION_LEVEL_NETWORK_ACTIVATED === $option_level ) {
|
||||
// Network activated.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
self::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED === $option_level &&
|
||||
! $this->_is_delegated_connection
|
||||
) {
|
||||
// Network activated and not delegated.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo
|
||||
*
|
||||
* @param string $key
|
||||
* @param null|bool|int $network_level_or_blog_id When an integer, use the given blog storage. When `true` use the multisite storage (if there's a network). When `false`, use the current context blog storage. When `null`, the decision which storage to use (MS vs. Current S) will be handled internally and determined based on the $option (based on self::$_BINARY_MAP).
|
||||
* @param int $option_level Since 2.5.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function should_use_network_storage(
|
||||
$key,
|
||||
$network_level_or_blog_id = null,
|
||||
$option_level = self::OPTION_LEVEL_UNDEFINED
|
||||
) {
|
||||
if ( ! $this->_is_multisite ) {
|
||||
// Not a multisite environment.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is_numeric( $network_level_or_blog_id ) ) {
|
||||
// Explicitly asked to use a specified blog storage.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( is_bool( $network_level_or_blog_id ) ) {
|
||||
// Explicitly specified whether it should use the network or blog level storage.
|
||||
return $network_level_or_blog_id;
|
||||
}
|
||||
|
||||
// Determine which storage to use based on the option.
|
||||
return $this->is_multisite_option( $key, $option_level );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int $blog_id
|
||||
*
|
||||
* @return \FS_Key_Value_Storage
|
||||
*/
|
||||
private function get_site_storage( $blog_id = 0 ) {
|
||||
if ( ! is_numeric( $blog_id ) ||
|
||||
$blog_id == $this->_blog_id ||
|
||||
0 == $blog_id
|
||||
) {
|
||||
return $this->_storage;
|
||||
}
|
||||
|
||||
return FS_Key_Value_Storage::instance(
|
||||
$this->_module_type . '_data',
|
||||
$this->_storage->get_secondary_id(),
|
||||
$blog_id
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Magic methods
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
function __set( $k, $v ) {
|
||||
if ( $this->should_use_network_storage( $k ) ) {
|
||||
$this->_network_storage->{$k} = $v;
|
||||
} else {
|
||||
$this->_storage->{$k} = $v;
|
||||
}
|
||||
}
|
||||
|
||||
function __isset( $k ) {
|
||||
return $this->should_use_network_storage( $k ) ?
|
||||
isset( $this->_network_storage->{$k} ) :
|
||||
isset( $this->_storage->{$k} );
|
||||
}
|
||||
|
||||
function __unset( $k ) {
|
||||
if ( $this->should_use_network_storage( $k ) ) {
|
||||
unset( $this->_network_storage->{$k} );
|
||||
} else {
|
||||
unset( $this->_storage->{$k} );
|
||||
}
|
||||
}
|
||||
|
||||
function __get( $k ) {
|
||||
return $this->should_use_network_storage( $k ) ?
|
||||
$this->_network_storage->{$k} :
|
||||
$this->_storage->{$k};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once WP_FS__DIR_INCLUDES . '/class-fs-lock.php';
|
||||
|
||||
/**
|
||||
* Class FS_User_Lock
|
||||
*/
|
||||
class FS_User_Lock {
|
||||
/**
|
||||
* @var FS_Lock
|
||||
*/
|
||||
private $_lock;
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Singleton
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @var FS_User_Lock
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @return FS_User_Lock
|
||||
*/
|
||||
static function instance() {
|
||||
if ( ! isset( self::$_instance ) ) {
|
||||
self::$_instance = new self();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private function __construct() {
|
||||
$current_user_id = Freemius::get_current_wp_user_id();
|
||||
|
||||
$this->_lock = new FS_Lock( "locked_{$current_user_id}" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to acquire lock. If the lock is already set or is being acquired by another locker, don't do anything.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param int $expiration
|
||||
*
|
||||
* @return bool TRUE if successfully acquired lock.
|
||||
*/
|
||||
function try_lock( $expiration = 0 ) {
|
||||
return $this->_lock->try_lock( $expiration );
|
||||
}
|
||||
|
||||
/**
|
||||
* Acquire lock regardless if it's already acquired by another locker or not.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param int $expiration
|
||||
*/
|
||||
function lock( $expiration = 0 ) {
|
||||
$this->_lock->lock( $expiration );
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlock the lock.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*/
|
||||
function unlock() {
|
||||
$this->_lock->unlock();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.2.2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Zerif_Customizer_Theme_Info_Main
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
*/
|
||||
class FS_Customizer_Support_Section extends WP_Customize_Section {
|
||||
|
||||
function __construct( $manager, $id, $args = array() ) {
|
||||
$manager->register_section_type( 'FS_Customizer_Support_Section' );
|
||||
|
||||
parent::__construct( $manager, $id, $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of customize section being rendered.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'freemius-support-section';
|
||||
|
||||
/**
|
||||
* @var Freemius
|
||||
*/
|
||||
public $fs = null;
|
||||
|
||||
/**
|
||||
* Add custom parameters to pass to the JS via JSON.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function json() {
|
||||
$json = parent::json();
|
||||
|
||||
$is_contact_visible = $this->fs->is_page_visible( 'contact' );
|
||||
$is_support_visible = $this->fs->is_page_visible( 'support' );
|
||||
|
||||
$json['theme_title'] = $this->fs->get_plugin_name();
|
||||
|
||||
if ( $is_contact_visible && $is_support_visible ) {
|
||||
$json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
|
||||
}
|
||||
|
||||
if ( $is_contact_visible ) {
|
||||
$json['contact'] = array(
|
||||
'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
|
||||
'url' => $this->fs->contact_url(),
|
||||
);
|
||||
}
|
||||
|
||||
if ( $is_support_visible ) {
|
||||
$json['support'] = array(
|
||||
'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
|
||||
'url' => $this->fs->get_support_forum_url()
|
||||
);
|
||||
}
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
/**
|
||||
* Outputs the Underscore.js template.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected function render_template() {
|
||||
?>
|
||||
<li id="fs_customizer_support"
|
||||
class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
|
||||
<h3 class="accordion-section-title">
|
||||
<span>{{ data.theme_title }}</span>
|
||||
<# if ( data.contact && data.support ) { #>
|
||||
<div class="button-group">
|
||||
<# } #>
|
||||
<# if ( data.contact ) { #>
|
||||
<a class="button" href="{{ data.contact.url }}" target="_blank" rel="noopener noreferrer">{{ data.contact.label }} </a>
|
||||
<# } #>
|
||||
<# if ( data.support ) { #>
|
||||
<a class="button" href="{{ data.support.url }}" target="_blank" rel="noopener noreferrer">{{ data.support.label }} </a>
|
||||
<# } #>
|
||||
<# if ( data.contact && data.support ) { #>
|
||||
</div>
|
||||
<# } #>
|
||||
</h3>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.2.2.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Customizer_Upsell_Control
|
||||
*/
|
||||
class FS_Customizer_Upsell_Control extends WP_Customize_Control {
|
||||
|
||||
/**
|
||||
* Control type
|
||||
*
|
||||
* @var string control type
|
||||
*/
|
||||
public $type = 'freemius-upsell-control';
|
||||
|
||||
/**
|
||||
* @var Freemius
|
||||
*/
|
||||
public $fs = null;
|
||||
|
||||
/**
|
||||
* @param WP_Customize_Manager $manager the customize manager class.
|
||||
* @param string $id id.
|
||||
* @param array $args customizer manager parameters.
|
||||
*/
|
||||
public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
|
||||
$manager->register_control_type( 'FS_Customizer_Upsell_Control' );
|
||||
|
||||
parent::__construct( $manager, $id, $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue resources for the control.
|
||||
*/
|
||||
public function enqueue() {
|
||||
fs_enqueue_local_style( 'fs_customizer', 'customizer.css' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Json conversion
|
||||
*/
|
||||
public function to_json() {
|
||||
$pricing_cta = esc_html( $this->fs->get_pricing_cta_label() ) . ' ' . ( is_rtl() ? '←' : '➤' );
|
||||
|
||||
parent::to_json();
|
||||
|
||||
$this->json['button_text'] = $pricing_cta;
|
||||
$this->json['button_url'] = $this->fs->is_in_trial_promotion() ?
|
||||
$this->fs->get_trial_url() :
|
||||
$this->fs->get_upgrade_url();
|
||||
|
||||
$api = FS_Plugin::is_valid_id( $this->fs->get_bundle_id() ) ?
|
||||
$this->fs->get_api_bundle_scope() :
|
||||
$this->fs->get_api_plugin_scope();
|
||||
|
||||
// Load features.
|
||||
$pricing = $api->get( $this->fs->add_show_pending( "pricing.json" ) );
|
||||
|
||||
if ( $this->fs->is_api_result_object( $pricing, 'plans' ) ) {
|
||||
// Add support features.
|
||||
if ( is_array( $pricing->plans ) && 0 < count( $pricing->plans ) ) {
|
||||
$support_features = array(
|
||||
'kb' => 'Help Center',
|
||||
'forum' => 'Support Forum',
|
||||
'email' => 'Priority Email Support',
|
||||
'phone' => 'Phone Support',
|
||||
'is_success_manager' => 'Personal Success Manager',
|
||||
);
|
||||
|
||||
for ( $i = 0, $len = count( $pricing->plans ); $i < $len; $i ++ ) {
|
||||
if ( 'free' == $pricing->plans[$i]->name ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! isset( $pricing->plans[ $i ]->features ) ||
|
||||
! is_array( $pricing->plans[ $i ]->features ) ) {
|
||||
$pricing->plans[$i]->features = array();
|
||||
}
|
||||
|
||||
foreach ( $support_features as $key => $label ) {
|
||||
$key = ( 'is_success_manager' !== $key ) ?
|
||||
"support_{$key}" :
|
||||
$key;
|
||||
|
||||
if ( ! empty( $pricing->plans[ $i ]->{$key} ) ) {
|
||||
|
||||
$support_feature = new stdClass();
|
||||
$support_feature->title = $label;
|
||||
|
||||
$pricing->plans[ $i ]->features[] = $support_feature;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->json['plans'] = $pricing->plans;
|
||||
}
|
||||
}
|
||||
|
||||
$this->json['strings'] = array(
|
||||
'plan' => $this->fs->get_text_x_inline( 'Plan', 'as product pricing plan', 'plan' ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Control content
|
||||
*/
|
||||
public function content_template() {
|
||||
?>
|
||||
<div id="fs_customizer_upsell">
|
||||
<# if ( data.plans ) { #>
|
||||
<ul class="fs-customizer-plans">
|
||||
<# for (i in data.plans) { #>
|
||||
<# if ( 'free' != data.plans[i].name && (null != data.plans[i].features && 0 < data.plans[i].features.length) ) { #>
|
||||
<li class="fs-customizer-plan">
|
||||
<div class="fs-accordion-section-open">
|
||||
<h2 class="fs-accordion-section-title menu-item">
|
||||
<span>{{ data.plans[i].title }}</span>
|
||||
<button type="button" class="button-link item-edit" aria-expanded="true">
|
||||
<span class="screen-reader-text">Toggle section: {{ data.plans[i].title }} {{ data.strings.plan }}</span>
|
||||
<span class="toggle-indicator" aria-hidden="true"></span>
|
||||
</button>
|
||||
</h2>
|
||||
<div class="fs-accordion-section-content">
|
||||
<# if ( data.plans[i].description ) { #>
|
||||
<h3>{{ data.plans[i].description }}</h3>
|
||||
<# } #>
|
||||
<# if ( data.plans[i].features ) { #>
|
||||
<ul>
|
||||
<# for ( j in data.plans[i].features ) { #>
|
||||
<li><div class="fs-feature">
|
||||
<span class="dashicons dashicons-yes"></span><span><# if ( data.plans[i].features[j].value ) { #>{{ data.plans[i].features[j].value }} <# } #>{{ data.plans[i].features[j].title }}</span>
|
||||
<# if ( data.plans[i].features[j].description ) { #>
|
||||
<span class="dashicons dashicons-editor-help"><span class="fs-feature-desc">{{ data.plans[i].features[j].description }}</span></span>
|
||||
<# } #>
|
||||
</div></li>
|
||||
<# } #>
|
||||
</ul>
|
||||
<# } #>
|
||||
<# if ( 'free' != data.plans[i].name ) { #>
|
||||
<a href="{{ data.button_url }}" class="button button-primary" target="_blank">{{{ data.button_text }}}</a>
|
||||
<# } #>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<# } #>
|
||||
<# } #>
|
||||
</ul>
|
||||
<# } #>
|
||||
</div>
|
||||
<?php }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.1.7.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( class_exists( 'Debug_Bar_Panel' ) ) {
|
||||
|
||||
/**
|
||||
* Extends Debug Bar plugin by adding a panel to show all Freemius API requests.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.7.3
|
||||
*
|
||||
* Class Freemius_Debug_Bar_Panel
|
||||
*/
|
||||
class Freemius_Debug_Bar_Panel extends Debug_Bar_Panel {
|
||||
|
||||
public function init() {
|
||||
$this->title( 'Freemius' ); // @phpstan-ignore-line
|
||||
}
|
||||
|
||||
public static function requests_count() {
|
||||
if ( class_exists( 'Freemius_Api_WordPress' ) ) {
|
||||
$logger = Freemius_Api_WordPress::GetLogger();
|
||||
} else {
|
||||
$logger = array();
|
||||
}
|
||||
|
||||
return number_format( count( $logger ) );
|
||||
}
|
||||
|
||||
public static function total_time() {
|
||||
if ( class_exists( 'Freemius_Api_WordPress' ) ) {
|
||||
$logger = Freemius_Api_WordPress::GetLogger();
|
||||
} else {
|
||||
$logger = array();
|
||||
}
|
||||
|
||||
$total_time = .0;
|
||||
foreach ( $logger as $l ) {
|
||||
$total_time += $l['total'];
|
||||
}
|
||||
|
||||
return number_format( 100 * $total_time, 2 ) . ' ' . fs_text_x_inline( 'ms', 'milliseconds' );
|
||||
}
|
||||
|
||||
public function render() {
|
||||
?>
|
||||
<div id='debug-bar-php'>
|
||||
<?php fs_require_template( '/debug/api-calls.php' ) ?>
|
||||
<br>
|
||||
<?php fs_require_template( '/debug/scheduled-crons.php' ) ?>
|
||||
<br>
|
||||
<?php fs_require_template( '/debug/plugins-themes-sync.php' ) ?>
|
||||
<br>
|
||||
<?php fs_require_template( '/debug/logger.php' ) ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.1.7.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! WP_FS__DEBUG_SDK ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize Freemius custom debug panels.
|
||||
*
|
||||
* @param array $panels Debug bar panels objects
|
||||
*
|
||||
* @return array Debug bar panels with your custom panels
|
||||
*/
|
||||
function fs_custom_panels_init( $panels ) {
|
||||
if ( class_exists( 'Debug_Bar_Panel' ) ) {
|
||||
if ( FS_API__LOGGER_ON ) {
|
||||
require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
|
||||
$panels[] = new Freemius_Debug_Bar_Panel();
|
||||
}
|
||||
}
|
||||
|
||||
return $panels;
|
||||
}
|
||||
|
||||
function fs_custom_status_init( $statuses ) {
|
||||
if ( class_exists( 'Debug_Bar_Panel' ) ) {
|
||||
if ( FS_API__LOGGER_ON ) {
|
||||
require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
|
||||
$statuses[] = array(
|
||||
'fs_api_requests',
|
||||
fs_text_inline( 'Freemius API' ),
|
||||
Freemius_Debug_Bar_Panel::requests_count() . ' ' . fs_text_inline( 'Requests' ) .
|
||||
' (' . Freemius_Debug_Bar_Panel::total_time() . ')'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
add_filter( 'debug_bar_panels', 'fs_custom_panels_init' );
|
||||
add_filter( 'debug_bar_statuses', 'fs_custom_status_init' );
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.2.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_AffiliateTerms extends FS_Scope_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $is_active;
|
||||
/**
|
||||
* @var string Enum: `affiliation` or `rewards`. Defaults to `affiliation`.
|
||||
*/
|
||||
public $type;
|
||||
/**
|
||||
* @var string Enum: `payout` or `credit`. Defaults to `payout`.
|
||||
*/
|
||||
public $reward_type;
|
||||
/**
|
||||
* If `first`, the referral will be attributed to the first visited source containing the affiliation link that
|
||||
* was clicked.
|
||||
*
|
||||
* @var string Enum: `first` or `last`. Defaults to `first`.
|
||||
*/
|
||||
public $referral_attribution;
|
||||
/**
|
||||
* @var int Defaults to `30`, `0` for session cookie, and `null` for endless cookie (until cookies are cleaned).
|
||||
*/
|
||||
public $cookie_days;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $commission;
|
||||
/**
|
||||
* @var string Enum: `percentage` or `dollar`. Defaults to `percentage`.
|
||||
*/
|
||||
public $commission_type;
|
||||
/**
|
||||
* @var null|int Defaults to `0` (affiliate only on first payment). `null` for commission for all renewals. If
|
||||
* greater than `0`, affiliate will get paid for all renewals for `commission_renewals_days` days after
|
||||
* the initial upgrade/purchase.
|
||||
*/
|
||||
public $commission_renewals_days;
|
||||
/**
|
||||
* @var int Only cents and no percentage. In US cents, e.g.: 100 = $1.00. Defaults to `null`.
|
||||
*/
|
||||
public $install_commission;
|
||||
/**
|
||||
* @var string Required default target link, e.g.: pricing page.
|
||||
*/
|
||||
public $default_url;
|
||||
/**
|
||||
* @var string One of the following: 'all', 'new_customer', 'new_user'.
|
||||
* If 'all' - reward for any user type.
|
||||
* If 'new_customer' - reward only for new customers.
|
||||
* If 'new_user' - reward only for new users.
|
||||
*/
|
||||
public $reward_customer_type;
|
||||
/**
|
||||
* @var int Defaults to `0` (affiliate only on directly affiliated links). `null` if an affiliate will get
|
||||
* paid for all customers' lifetime payments. If greater than `0`, an affiliate will get paid for all
|
||||
* customer payments for `future_payments_days` days after the initial payment.
|
||||
*/
|
||||
public $future_payments_days;
|
||||
/**
|
||||
* @var bool If `true`, allow referrals from social sites.
|
||||
*/
|
||||
public $is_social_allowed;
|
||||
/**
|
||||
* @var bool If `true`, allow conversions without HTTP referrer header at all.
|
||||
*/
|
||||
public $is_app_allowed;
|
||||
/**
|
||||
* @var bool If `true`, allow referrals from any site.
|
||||
*/
|
||||
public $is_any_site_allowed;
|
||||
/**
|
||||
* @var string $plugin_title Title of the plugin. This is used in case we are showing affiliate form for a Bundle instead of the `plugin` in context.
|
||||
*/
|
||||
public $plugin_title;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_formatted_commission()
|
||||
{
|
||||
return ( 'dollar' === $this->commission_type ) ?
|
||||
( '$' . $this->commission ) :
|
||||
( $this->commission . '%' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_lifetime_commission() {
|
||||
return ( 0 !== $this->future_payments_days );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_session_cookie() {
|
||||
return ( 0 == $this->cookie_days );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_renewals_commission() {
|
||||
return ( is_null( $this->commission_renewals_days ) || $this->commission_renewals_days > 0 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.2.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Affiliate extends FS_Scope_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $paypal_email;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $custom_affiliate_terms_id;
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
public $is_using_custom_terms;
|
||||
/**
|
||||
* @var string status Enum: `pending`, `rejected`, `suspended`, or `active`. Defaults to `pending`.
|
||||
*/
|
||||
public $status;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $domain;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_active() {
|
||||
return ( 'active' === $this->status );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_pending() {
|
||||
return ( 'pending' === $this->status );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_suspended() {
|
||||
return ( 'suspended' === $this->status );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_rejected() {
|
||||
return ( 'rejected' === $this->status );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_blocked() {
|
||||
return ( 'blocked' === $this->status );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius for EDD Add-On
|
||||
* @copyright Copyright (c) 2016, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Billing extends FS_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $entity_id;
|
||||
/**
|
||||
* @var string (Enum) Linked entity type. One of: developer, plugin, user, install
|
||||
*/
|
||||
public $entity_type;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $business_name;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $first;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $last;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $phone;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $website;
|
||||
/**
|
||||
* @var string Tax or VAT ID.
|
||||
*/
|
||||
public $tax_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $address_street;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $address_apt;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $address_city;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $address_country;
|
||||
/**
|
||||
* @var string Two chars country code.
|
||||
*/
|
||||
public $address_country_code;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $address_state;
|
||||
/**
|
||||
* @var number Numeric ZIP code (cab be with leading zeros).
|
||||
*/
|
||||
public $address_zip;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
|
||||
/**
|
||||
* @param object|bool $event
|
||||
*/
|
||||
function __construct( $event = false ) {
|
||||
parent::__construct( $event );
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'billing';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get object's public variables.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param object $object
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function fs_get_object_public_vars( $object ) {
|
||||
return get_object_vars( $object );
|
||||
}
|
||||
|
||||
class FS_Entity {
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
|
||||
*/
|
||||
public $updated;
|
||||
/**
|
||||
* @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
|
||||
*/
|
||||
public $created;
|
||||
|
||||
/**
|
||||
* @param bool|object $entity
|
||||
*/
|
||||
function __construct( $entity = false ) {
|
||||
if ( ! ( $entity instanceof stdClass ) && ! ( $entity instanceof FS_Entity ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$props = fs_get_object_public_vars( $this );
|
||||
|
||||
foreach ( $props as $key => $def_value ) {
|
||||
$this->{$key} = isset( $entity->{$key} ) ?
|
||||
$entity->{$key} :
|
||||
$def_value;
|
||||
}
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'type';
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @param FS_Entity $entity1
|
||||
* @param FS_Entity $entity2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function equals( $entity1, $entity2 ) {
|
||||
if ( is_null( $entity1 ) && is_null( $entity2 ) ) {
|
||||
return true;
|
||||
} else if ( is_object( $entity1 ) && is_object( $entity2 ) ) {
|
||||
return ( $entity1->id == $entity2->id );
|
||||
} else if ( is_object( $entity1 ) ) {
|
||||
return is_null( $entity1->id );
|
||||
} else {
|
||||
return is_null( $entity2->id );
|
||||
}
|
||||
}
|
||||
|
||||
private $_is_updated = false;
|
||||
|
||||
/**
|
||||
* Update object property.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param string|array[string]mixed $key
|
||||
* @param string|bool $val
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function update( $key, $val = false ) {
|
||||
if ( ! is_array( $key ) ) {
|
||||
$key = array( $key => $val );
|
||||
}
|
||||
|
||||
$is_updated = false;
|
||||
|
||||
foreach ( $key as $k => $v ) {
|
||||
if ( $this->{$k} === $v ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ( is_string( $this->{$k} ) && is_numeric( $v ) ||
|
||||
( is_numeric( $this->{$k} ) && is_string( $v ) ) ) &&
|
||||
$this->{$k} == $v
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Update value.
|
||||
$this->{$k} = $v;
|
||||
|
||||
$is_updated = true;
|
||||
}
|
||||
|
||||
$this->_is_updated = $is_updated;
|
||||
|
||||
return $is_updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if entity was updated.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_updated() {
|
||||
return $this->_is_updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_valid_id($id){
|
||||
return is_numeric($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.1
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_class_name() {
|
||||
return get_called_class();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2016, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Payment extends FS_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plugin_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $user_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $install_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $subscription_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plan_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $license_id;
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $gross;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @var string One of the following: `usd`, `gbp`, `eur`.
|
||||
*/
|
||||
public $currency;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $bound_payment_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $external_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $gateway;
|
||||
/**
|
||||
* @var string ISO 3166-1 alpha-2 - two-letter country code.
|
||||
*
|
||||
* @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
|
||||
*/
|
||||
public $country_code;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $vat_id;
|
||||
/**
|
||||
* @var float Actual Tax / VAT in $$$
|
||||
*/
|
||||
public $vat;
|
||||
/**
|
||||
* @var int Payment source.
|
||||
*/
|
||||
public $source = 0;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
const CURRENCY_USD = 'usd';
|
||||
const CURRENCY_GBP = 'gbp';
|
||||
const CURRENCY_EUR = 'eur';
|
||||
|
||||
/**
|
||||
* @param object|bool $payment
|
||||
*/
|
||||
function __construct( $payment = false ) {
|
||||
parent::__construct( $payment );
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'payment';
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_refund() {
|
||||
return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the payment was migrated from another platform.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_migrated() {
|
||||
return ( 0 != $this->source );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the gross in this format:
|
||||
* `{symbol}{amount | 2 decimal digits} {currency | uppercase}`
|
||||
*
|
||||
* Examples: £9.99 GBP, -£9.99 GBP.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function formatted_gross()
|
||||
{
|
||||
return (
|
||||
( $this->gross < 0 ? '-' : '' ) .
|
||||
$this->get_symbol() .
|
||||
number_format( abs( $this->gross ), 2, '.', ',' ) . ' ' .
|
||||
strtoupper( $this->currency )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A map between supported currencies with their symbols.
|
||||
*
|
||||
* @var array<string,string>
|
||||
*/
|
||||
static $CURRENCY_2_SYMBOL;
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function get_symbol() {
|
||||
if ( ! isset( self::$CURRENCY_2_SYMBOL ) ) {
|
||||
// Lazy load.
|
||||
self::$CURRENCY_2_SYMBOL = array(
|
||||
self::CURRENCY_USD => '$',
|
||||
self::CURRENCY_GBP => '£',
|
||||
self::CURRENCY_EUR => '€',
|
||||
);
|
||||
}
|
||||
|
||||
return self::$CURRENCY_2_SYMBOL[ $this->currency ];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Plugin_Info extends FS_Entity {
|
||||
public $plugin_id;
|
||||
public $description;
|
||||
public $short_description;
|
||||
public $banner_url;
|
||||
public $card_banner_url;
|
||||
public $selling_point_0;
|
||||
public $selling_point_1;
|
||||
public $selling_point_2;
|
||||
public $screenshots;
|
||||
|
||||
/**
|
||||
* @param stdClass|bool $plugin_info
|
||||
*/
|
||||
function __construct( $plugin_info = false ) {
|
||||
parent::__construct( $plugin_info );
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'plugin';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.5
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Plugin_License
|
||||
*/
|
||||
class FS_Plugin_License extends FS_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plugin_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $user_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plan_id;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $parent_plan_name;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $parent_plan_title;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @var number
|
||||
*/
|
||||
public $parent_license_id;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.4.0
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $products;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $pricing_id;
|
||||
/**
|
||||
* @var int|null
|
||||
*/
|
||||
public $quota;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $activated;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $activated_local;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $expiration;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $secret_key;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $is_whitelabeled;
|
||||
/**
|
||||
* @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
|
||||
* license.
|
||||
*/
|
||||
public $is_free_localhost;
|
||||
/**
|
||||
* @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
|
||||
* block updates and support.
|
||||
*/
|
||||
public $is_block_features;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $is_cancelled;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/**
|
||||
* @param stdClass|bool $license
|
||||
*/
|
||||
function __construct( $license = false ) {
|
||||
parent::__construct( $license );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get entity type.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function get_type() {
|
||||
return 'license';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check how many site activations left.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.5
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function left() {
|
||||
if ( ! $this->is_features_enabled() ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( $this->is_unlimited() ) {
|
||||
return 999;
|
||||
}
|
||||
|
||||
return ( $this->quota - $this->activated - ( $this->is_free_localhost ? 0 : $this->activated_local ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if single site license.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_single_site() {
|
||||
return ( is_numeric( $this->quota ) && 1 == $this->quota );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.5
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_expired() {
|
||||
return ! $this->is_lifetime() && ( strtotime( $this->expiration ) < WP_FS__SCRIPT_START_TIME );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if license is not expired.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_valid() {
|
||||
return ! $this->is_expired();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_lifetime() {
|
||||
return is_null( $this->expiration );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_unlimited() {
|
||||
return is_null( $this->quota );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if license is fully utilized.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @param bool|null $is_localhost
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_utilized( $is_localhost = null ) {
|
||||
if ( is_null( $is_localhost ) ) {
|
||||
$is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
|
||||
}
|
||||
|
||||
if ( $this->is_unlimited() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ! ( $this->is_free_localhost && $is_localhost ) &&
|
||||
( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if license can be activated.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param bool|null $is_localhost
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function can_activate( $is_localhost = null ) {
|
||||
return ! $this->is_utilized( $is_localhost ) && $this->is_features_enabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if license can be activated on a given number of production and localhost sites.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param int $production_count
|
||||
* @param int $localhost_count
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function can_activate_bulk( $production_count, $localhost_count ) {
|
||||
if ( $this->is_unlimited() ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* For simplicity, the logic will work as following: when given X sites to activate the license on, if it's
|
||||
* possible to activate on ALL of them, do the activation. If it's not possible to activate on ALL of them,
|
||||
* do NOT activate on any of them.
|
||||
*/
|
||||
return ( $this->quota >= $this->activated + $production_count + ( $this->is_free_localhost ? 0 : $this->activated_local + $localhost_count ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_active() {
|
||||
return ( ! $this->is_cancelled );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if license's plan features are enabled.
|
||||
*
|
||||
* - Either if plan not expired
|
||||
* - If expired, based on the configuration to block features or not.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_features_enabled() {
|
||||
return $this->is_active() && ( ! $this->is_block_features || ! $this->is_expired() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscription considered to be new without any payments
|
||||
* if the license expires in less than 24 hours
|
||||
* from the license creation.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_first_payment_pending() {
|
||||
if ( $this->is_lifetime() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->expiration ) - strtotime( $this->created ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
function total_activations() {
|
||||
return ( $this->activated + $this->activated_local );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.3.1
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_html_escaped_masked_secret_key() {
|
||||
return self::mask_secret_key_for_html( $this->secret_key );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.3.1
|
||||
*
|
||||
* @param string $secret_key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static function mask_secret_key_for_html( $secret_key ) {
|
||||
return (
|
||||
// Initial 6 chars - sk_ABC
|
||||
htmlspecialchars( substr( $secret_key, 0, 6 ) ) .
|
||||
// Masking
|
||||
str_pad( '', ( strlen( $secret_key ) - 9 ) * 6, '•' ) .
|
||||
// Last 3 chars.
|
||||
htmlspecialchars( substr( $secret_key, - 3 ) )
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.5
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Plugin_Plan
|
||||
*
|
||||
*/
|
||||
class FS_Plugin_Plan extends FS_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plugin_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $description;
|
||||
/**
|
||||
* @var bool Defaults to true. If true, allow unlimited localhost installs with the same license.
|
||||
*/
|
||||
public $is_free_localhost;
|
||||
/**
|
||||
* @var bool Defaults to true. If false, don't block features after license expiry - only block updates and
|
||||
* support.
|
||||
*/
|
||||
public $is_block_features;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $license_type;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $is_https_support;
|
||||
/**
|
||||
* @var int Trial days.
|
||||
*/
|
||||
public $trial_period;
|
||||
/**
|
||||
* @var string If true, require payment for trial.
|
||||
*/
|
||||
public $is_require_subscription;
|
||||
/**
|
||||
* @var string Knowledge Base URL.
|
||||
*/
|
||||
public $support_kb;
|
||||
/**
|
||||
* @var string Support Forum URL.
|
||||
*/
|
||||
public $support_forum;
|
||||
/**
|
||||
* @var string Support email address.
|
||||
*/
|
||||
public $support_email;
|
||||
/**
|
||||
* @var string Support phone.
|
||||
*/
|
||||
public $support_phone;
|
||||
/**
|
||||
* @var bool Is personal success manager supported with the plan.
|
||||
*/
|
||||
public $is_success_manager;
|
||||
/**
|
||||
* @var bool Is featured plan.
|
||||
*/
|
||||
public $is_featured;
|
||||
/**
|
||||
* @var bool Is hidden plan.
|
||||
*/
|
||||
public $is_hidden;
|
||||
/**
|
||||
* @var FS_Pricing[]
|
||||
*/
|
||||
public $pricing;
|
||||
/**
|
||||
* @var object[]
|
||||
*/
|
||||
public $features;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/**
|
||||
* @param object|bool $plan
|
||||
*/
|
||||
function __construct( $plan = false ) {
|
||||
parent::__construct( $plan );
|
||||
|
||||
if ( is_object( $plan ) ) {
|
||||
$this->name = strtolower( $plan->name );
|
||||
}
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'plan';
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_free() {
|
||||
return ( 'free' === $this->name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this plan supports "Technical Support".
|
||||
*
|
||||
* @author Leo Fajardo (leorw)
|
||||
* @since 1.2.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_technical_support() {
|
||||
return ( ! empty( $this->support_email ) ||
|
||||
! empty( $this->support_phone ) ||
|
||||
! empty( $this->is_success_manager )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_trial() {
|
||||
return ! $this->is_free() &&
|
||||
is_numeric( $this->trial_period ) && ( $this->trial_period > 0 );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2018, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Plugin_Tag extends FS_Entity {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $version;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $url;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $requires_platform_version;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $requires_programming_language_version;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $tested_up_to_version;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $has_free;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $has_premium;
|
||||
/**
|
||||
* @var string One of the following: `pending`, `beta`, `unreleased`.
|
||||
*/
|
||||
public $release_mode;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $upgrade_notice;
|
||||
|
||||
function __construct( $tag = false ) {
|
||||
parent::__construct( $tag );
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'tag';
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_beta() {
|
||||
return ( 'beta' === $this->release_mode );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Plugin extends FS_Scope_Entity {
|
||||
/**
|
||||
* @since 1.0.6
|
||||
* @var null|number
|
||||
*/
|
||||
public $parent_plugin_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $slug;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.2.1
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $premium_slug;
|
||||
/**
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var string 'plugin' or 'theme'
|
||||
*/
|
||||
public $type;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @since 1.2.3
|
||||
*
|
||||
* @var string|false false if the module doesn't have an affiliate program or one of the following: 'selected', 'customers', or 'all'.
|
||||
*/
|
||||
public $affiliate_moderation;
|
||||
/**
|
||||
* @var bool Set to true if the free version of the module is hosted on WordPress.org. Defaults to true.
|
||||
*/
|
||||
public $is_wp_org_compliant = true;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.2.5
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $premium_releases_count;
|
||||
|
||||
#region Install Specific Properties
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $file;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $version;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $auto_update;
|
||||
/**
|
||||
* @var FS_Plugin_Info
|
||||
*/
|
||||
public $info;
|
||||
/**
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $is_premium;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.2.1
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $premium_suffix;
|
||||
/**
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $is_live;
|
||||
/**
|
||||
* @since 2.2.3
|
||||
* @var null|number
|
||||
*/
|
||||
public $bundle_id;
|
||||
/**
|
||||
* @since 2.3.1
|
||||
* @var null|string
|
||||
*/
|
||||
public $bundle_public_key;
|
||||
/**
|
||||
* @since 2.5.4
|
||||
* @var null|array
|
||||
*/
|
||||
public $opt_in_moderation;
|
||||
|
||||
const AFFILIATE_MODERATION_CUSTOMERS = 'customers';
|
||||
|
||||
#endregion Install Specific Properties
|
||||
|
||||
/**
|
||||
* @param stdClass|bool $plugin
|
||||
*/
|
||||
function __construct( $plugin = false ) {
|
||||
parent::__construct( $plugin );
|
||||
|
||||
$this->is_premium = false;
|
||||
$this->is_live = true;
|
||||
|
||||
if ( empty( $this->premium_slug ) && ! empty( $plugin->slug ) ) {
|
||||
$this->premium_slug = "{$this->slug}-premium";
|
||||
}
|
||||
|
||||
if ( empty( $this->premium_suffix ) ) {
|
||||
$this->premium_suffix = '(Premium)';
|
||||
}
|
||||
|
||||
if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
|
||||
$this->info = new FS_Plugin_Info( $plugin->info );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if plugin is an add-on (has parent).
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_addon() {
|
||||
return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.3
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_affiliate_program() {
|
||||
return ( ! empty( $this->affiliate_moderation ) );
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'plugin';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius for EDD Add-On
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Pricing extends FS_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plan_id;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $licenses;
|
||||
/**
|
||||
* @var null|float
|
||||
*/
|
||||
public $monthly_price;
|
||||
/**
|
||||
* @var null|float
|
||||
*/
|
||||
public $annual_price;
|
||||
/**
|
||||
* @var null|float
|
||||
*/
|
||||
public $lifetime_price;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.1
|
||||
*
|
||||
* @var string One of the following: `usd`, `gbp`, `eur`.
|
||||
*/
|
||||
public $currency;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/**
|
||||
* @param object|bool $pricing
|
||||
*/
|
||||
function __construct( $pricing = false ) {
|
||||
parent::__construct( $pricing );
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'pricing';
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_monthly() {
|
||||
return ( is_numeric( $this->monthly_price ) && $this->monthly_price > 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_annual() {
|
||||
return ( is_numeric( $this->annual_price ) && $this->annual_price > 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_lifetime() {
|
||||
return ( is_numeric( $this->lifetime_price ) && $this->lifetime_price > 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if unlimited licenses pricing.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_unlimited() {
|
||||
return is_null( $this->licenses );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if pricing has more than one billing cycle.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_multi_cycle() {
|
||||
$cycles = 0;
|
||||
if ( $this->has_monthly() ) {
|
||||
$cycles ++;
|
||||
}
|
||||
if ( $this->has_annual() ) {
|
||||
$cycles ++;
|
||||
}
|
||||
if ( $this->has_lifetime() ) {
|
||||
$cycles ++;
|
||||
}
|
||||
|
||||
return $cycles > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get annual over monthly discount.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function annual_discount_percentage() {
|
||||
return floor( $this->annual_savings() / ( $this->monthly_price * 12 * ( $this->is_unlimited() ? 1 : $this->licenses ) ) * 100 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get annual over monthly savings.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.8
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function annual_savings() {
|
||||
return ( $this->monthly_price * 12 - $this->annual_price ) * ( $this->is_unlimited() ? 1 : $this->licenses );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.3.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_usd() {
|
||||
return ( 'usd' === $this->currency );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.4
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Scope_Entity extends FS_Entity {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $public_key;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $secret_key;
|
||||
|
||||
/**
|
||||
* @param bool|stdClass $scope_entity
|
||||
*/
|
||||
function __construct( $scope_entity = false ) {
|
||||
parent::__construct( $scope_entity );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Site extends FS_Scope_Entity {
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $site_id;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $blog_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plugin_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $user_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $title;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $url;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $version;
|
||||
/**
|
||||
* @var string E.g. en-GB
|
||||
*/
|
||||
public $language;
|
||||
/**
|
||||
* @var string Platform version (e.g WordPress version).
|
||||
*/
|
||||
public $platform_version;
|
||||
/**
|
||||
* Freemius SDK version
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var string SDK version (e.g.: 1.2.2)
|
||||
*/
|
||||
public $sdk_version;
|
||||
/**
|
||||
* @var string Programming language version (e.g PHP version).
|
||||
*/
|
||||
public $programming_language_version;
|
||||
/**
|
||||
* @var number|null
|
||||
*/
|
||||
public $plan_id;
|
||||
/**
|
||||
* @var number|null
|
||||
*/
|
||||
public $license_id;
|
||||
/**
|
||||
* @var number|null
|
||||
*/
|
||||
public $trial_plan_id;
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
public $trial_ends;
|
||||
/**
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $is_premium = false;
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @since 1.2.1.5
|
||||
* @deprecated Since 2.5.1
|
||||
* @todo Remove after a few releases.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $is_disconnected = false;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $is_active = true;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $is_uninstalled = false;
|
||||
/**
|
||||
* @author Edgar Melkonyan
|
||||
*
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $is_beta;
|
||||
|
||||
/**
|
||||
* @param stdClass|bool $site
|
||||
*/
|
||||
function __construct( $site = false ) {
|
||||
parent::__construct( $site );
|
||||
|
||||
if ( is_object( $site ) ) {
|
||||
$this->plan_id = $site->plan_id;
|
||||
}
|
||||
|
||||
if ( ! is_bool( $this->is_disconnected ) ) {
|
||||
$this->is_disconnected = false;
|
||||
}
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'install';
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_localhost_by_address( $url ) {
|
||||
if ( false !== strpos( $url, '127.0.0.1' ) ||
|
||||
false !== strpos( $url, 'localhost' )
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( ! fs_starts_with( $url, 'http' ) ) {
|
||||
$url = 'http://' . $url;
|
||||
}
|
||||
|
||||
$url_parts = parse_url( $url );
|
||||
|
||||
$subdomain = $url_parts['host'];
|
||||
|
||||
return (
|
||||
// Starts with.
|
||||
fs_starts_with( $subdomain, 'local.' ) ||
|
||||
fs_starts_with( $subdomain, 'dev.' ) ||
|
||||
fs_starts_with( $subdomain, 'test.' ) ||
|
||||
fs_starts_with( $subdomain, 'stage.' ) ||
|
||||
fs_starts_with( $subdomain, 'staging.' ) ||
|
||||
|
||||
// Ends with.
|
||||
fs_ends_with( $subdomain, '.dev' ) ||
|
||||
fs_ends_with( $subdomain, '.test' ) ||
|
||||
fs_ends_with( $subdomain, '.staging' ) ||
|
||||
fs_ends_with( $subdomain, '.local' ) ||
|
||||
fs_ends_with( $subdomain, '.example' ) ||
|
||||
fs_ends_with( $subdomain, '.invalid' ) ||
|
||||
// GoDaddy test/dev.
|
||||
fs_ends_with( $subdomain, '.myftpupload.com' ) ||
|
||||
// ngrok tunneling.
|
||||
fs_ends_with( $subdomain, '.ngrok.io' ) ||
|
||||
// wpsandbox.
|
||||
fs_ends_with( $subdomain, '.wpsandbox.pro' ) ||
|
||||
// SiteGround staging.
|
||||
fs_starts_with( $subdomain, 'staging' ) ||
|
||||
// WPEngine staging.
|
||||
fs_ends_with( $subdomain, '.staging.wpengine.com' ) ||
|
||||
fs_ends_with( $subdomain, '.dev.wpengine.com' ) ||
|
||||
fs_ends_with( $subdomain, '.wpengine.com' ) ||
|
||||
fs_ends_with( $subdomain, '.wpenginepowered.com' ) ||
|
||||
// Pantheon
|
||||
( fs_ends_with( $subdomain, 'pantheonsite.io' ) &&
|
||||
( fs_starts_with( $subdomain, 'test-' ) || fs_starts_with( $subdomain, 'dev-' ) ) ) ||
|
||||
// Cloudways
|
||||
fs_ends_with( $subdomain, '.cloudwaysapps.com' ) ||
|
||||
// Kinsta
|
||||
(
|
||||
( fs_starts_with( $subdomain, 'stg-' ) || fs_starts_with( $subdomain, 'staging-' ) || fs_starts_with( $subdomain, 'env-' ) ) &&
|
||||
( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) )
|
||||
) ||
|
||||
// DesktopServer
|
||||
fs_ends_with( $subdomain, '.dev.cc' ) ||
|
||||
// Pressable
|
||||
fs_ends_with( $subdomain, '.mystagingwebsite.com' ) ||
|
||||
// WPMU DEV
|
||||
( fs_ends_with( $subdomain, '.tempurl.host' ) || fs_ends_with( $subdomain, '.wpmudev.host' ) ) ||
|
||||
// Vendasta
|
||||
( fs_ends_with( $subdomain, '.websitepro-staging.com' ) || fs_ends_with( $subdomain, '.websitepro.hosting' ) ) ||
|
||||
// InstaWP
|
||||
fs_ends_with( $subdomain, '.instawp.xyz' ) ||
|
||||
// 10Web Hosting
|
||||
( fs_ends_with( $subdomain, '-dev.10web.site' ) || fs_ends_with( $subdomain, '-dev.10web.cloud' ) )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.9.1
|
||||
*
|
||||
* @param string $host
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_playground_wp_environment_by_host( $host ) {
|
||||
// Services aimed at providing a WordPress sandbox environment.
|
||||
$sandbox_wp_environment_domains = array(
|
||||
// InstaWP
|
||||
'instawp.xyz',
|
||||
|
||||
// TasteWP
|
||||
'tastewp.com',
|
||||
|
||||
// WordPress Playground
|
||||
'playground.wordpress.net',
|
||||
);
|
||||
|
||||
foreach ( $sandbox_wp_environment_domains as $domain) {
|
||||
if (
|
||||
( $host === $domain ) ||
|
||||
fs_ends_with( $host, '.' . $domain ) ||
|
||||
fs_ends_with( $host, '-' . $domain )
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function is_localhost() {
|
||||
return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self::is_localhost_by_address( $this->url ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if site in trial.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_trial() {
|
||||
return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user already utilized the trial with the current install.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_trial_utilized() {
|
||||
return is_numeric( $this->trial_plan_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Edgar Melkonyan
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_beta() {
|
||||
return ( isset( $this->is_beta ) && true === $this->is_beta );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.1
|
||||
*
|
||||
* @param string $site_url
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_clone( $site_url ) {
|
||||
$clone_install_url = trailingslashit( fs_strip_url_protocol( $this->url ) );
|
||||
|
||||
return ( $clone_install_url !== $site_url );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.9
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Subscription extends FS_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $user_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $install_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $plan_id;
|
||||
/**
|
||||
* @var number
|
||||
*/
|
||||
public $license_id;
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $total_gross;
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $amount_per_cycle;
|
||||
/**
|
||||
* @var int # of months
|
||||
*/
|
||||
public $billing_cycle;
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $outstanding_balance;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $failed_payments;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $gateway;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $external_id;
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
public $trial_ends;
|
||||
/**
|
||||
* @var string|null Datetime of the next payment, or null if cancelled.
|
||||
*/
|
||||
public $next_payment;
|
||||
/**
|
||||
* @since 2.3.1
|
||||
*
|
||||
* @var string|null Datetime of the cancellation.
|
||||
*/
|
||||
public $canceled_at;
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
public $vat_id;
|
||||
/**
|
||||
* @var string Two characters country code
|
||||
*/
|
||||
public $country_code;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/**
|
||||
* @param object|bool $subscription
|
||||
*/
|
||||
function __construct( $subscription = false ) {
|
||||
parent::__construct( $subscription );
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'subscription';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if subscription is active.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_active() {
|
||||
if ( $this->is_canceled() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
! empty( $this->next_payment ) &&
|
||||
strtotime( $this->next_payment ) > WP_FS__SCRIPT_START_TIME
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.3.1
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_canceled() {
|
||||
return ! is_null( $this->canceled_at );
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscription considered to be new without any payments
|
||||
* if the next payment should be made within less than 24 hours
|
||||
* from the subscription creation.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_first_payment_pending() {
|
||||
return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->next_payment ) - strtotime( $this->created ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.7
|
||||
*/
|
||||
function has_trial() {
|
||||
return ! is_null( $this->trial_ends );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_User extends FS_Scope_Entity {
|
||||
|
||||
#region Properties
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $email;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $first;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $last;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $is_verified;
|
||||
/**
|
||||
* @var string|null
|
||||
*/
|
||||
public $customer_id;
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
public $gross;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
/**
|
||||
* @param object|bool $user
|
||||
*/
|
||||
function __construct( $user = false ) {
|
||||
parent::__construct( $user );
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes the deprecated 'is_beta' property from the serialized data.
|
||||
* Should clean up the serialized data to avoid PHP 8.2 warning on next execution.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function __wakeup() {
|
||||
if ( property_exists( $this, 'is_beta' ) ) {
|
||||
// If we enter here, and we are running PHP 8.2, we already had the warning. But we sanitize data for next execution.
|
||||
unset( $this->is_beta );
|
||||
}
|
||||
}
|
||||
|
||||
function get_name() {
|
||||
return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
|
||||
}
|
||||
|
||||
function is_verified() {
|
||||
return ( isset( $this->is_verified ) && true === $this->is_verified );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_beta() {
|
||||
// Return `false` since this is just for backward compatibility.
|
||||
return false;
|
||||
}
|
||||
|
||||
static function get_type() {
|
||||
return 'user';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
@@ -0,0 +1,418 @@
|
||||
<?php
|
||||
/**
|
||||
* IMPORTANT:
|
||||
* This file will be loaded based on the order of the plugins/themes load.
|
||||
* If there's a theme and a plugin using Freemius, the plugin's essential
|
||||
* file will always load first.
|
||||
*
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.1.5
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'fs_normalize_path' ) ) {
|
||||
if ( function_exists( 'wp_normalize_path' ) ) {
|
||||
/**
|
||||
* Normalize a filesystem path.
|
||||
*
|
||||
* Replaces backslashes with forward slashes for Windows systems, and ensures
|
||||
* no duplicate slashes exist.
|
||||
*
|
||||
* @param string $path Path to normalize.
|
||||
*
|
||||
* @return string Normalized path.
|
||||
*/
|
||||
function fs_normalize_path( $path ) {
|
||||
return wp_normalize_path( $path );
|
||||
}
|
||||
} else {
|
||||
function fs_normalize_path( $path ) {
|
||||
$path = str_replace( '\\', '/', $path );
|
||||
$path = preg_replace( '|/+|', '/', $path );
|
||||
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-2.2.1.php';
|
||||
|
||||
#region Core Redirect (copied from BuddyPress) -----------------------------------------
|
||||
|
||||
if ( ! function_exists( 'fs_redirect' ) ) {
|
||||
/**
|
||||
* Redirects to another page, with a workaround for the IIS Set-Cookie bug.
|
||||
*
|
||||
* @link http://support.microsoft.com/kb/q176113/
|
||||
* @since 1.5.1
|
||||
* @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
|
||||
*
|
||||
* @param string $location The path to redirect to.
|
||||
* @param bool $exit If true, exit after redirect (Since 1.2.1.5).
|
||||
* @param int $status Status code to use.
|
||||
*
|
||||
* @return bool False if $location is not set
|
||||
*/
|
||||
function fs_redirect( $location, $exit = true, $status = 302 ) {
|
||||
global $is_IIS;
|
||||
|
||||
$file = '';
|
||||
$line = '';
|
||||
if ( headers_sent($file, $line) ) {
|
||||
if ( WP_FS__DEBUG_SDK && class_exists( 'FS_Admin_Notices' ) ) {
|
||||
$notices = FS_Admin_Notices::instance( 'global' );
|
||||
|
||||
$notices->add( "Freemius failed to redirect the page because the headers have been already sent from line <b><code>{$line}</code></b> in file <b><code>{$file}</code></b>. If it's unexpected, it usually happens due to invalid space and/or EOL character(s).", 'Oops...', 'error' );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( defined( 'DOING_AJAX' ) ) {
|
||||
// Don't redirect on AJAX calls.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $location ) // allows the wp_redirect filter to cancel a redirect
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$location = fs_sanitize_redirect( $location );
|
||||
|
||||
if ( $is_IIS ) {
|
||||
header( "Refresh: 0;url=$location" );
|
||||
} else {
|
||||
if ( php_sapi_name() != 'cgi-fcgi' ) {
|
||||
status_header( $status );
|
||||
} // This causes problems on IIS and some FastCGI setups
|
||||
header( "Location: $location" );
|
||||
}
|
||||
|
||||
if ( $exit ) {
|
||||
exit();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_sanitize_redirect' ) ) {
|
||||
/**
|
||||
* Sanitizes a URL for use in a redirect.
|
||||
*
|
||||
* @since 2.3
|
||||
*
|
||||
* @param string $location
|
||||
*
|
||||
* @return string redirect-sanitized URL
|
||||
*/
|
||||
function fs_sanitize_redirect( $location ) {
|
||||
$location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location );
|
||||
$location = fs_kses_no_null( $location );
|
||||
|
||||
// remove %0d and %0a from location
|
||||
$strip = array( '%0d', '%0a' );
|
||||
$found = true;
|
||||
while ( $found ) {
|
||||
$found = false;
|
||||
foreach ( (array) $strip as $val ) {
|
||||
while ( strpos( $location, $val ) !== false ) {
|
||||
$found = true;
|
||||
$location = str_replace( $val, '', $location );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $location;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_kses_no_null' ) ) {
|
||||
/**
|
||||
* Removes any NULL characters in $string.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function fs_kses_no_null( $string ) {
|
||||
$string = preg_replace( '/\0+/', '', $string );
|
||||
$string = preg_replace( '/(\\\\0)+/', '', $string );
|
||||
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Core Redirect (copied from BuddyPress) -----------------------------------------
|
||||
|
||||
if ( ! function_exists( 'fs_get_ip' ) ) {
|
||||
/**
|
||||
* Get server IP.
|
||||
*
|
||||
* @since 2.5.1 This method returns the server IP.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.2
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
function fs_get_ip() {
|
||||
return empty( $_SERVER[ 'SERVER_ADDR' ] ) ?
|
||||
null :
|
||||
$_SERVER[ 'SERVER_ADDR' ];
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_find_caller_plugin_file' ) ) {
|
||||
/**
|
||||
* Leverage backtrace to find caller plugin main file path.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function fs_find_caller_plugin_file() {
|
||||
/**
|
||||
* All the code below will be executed once on activation.
|
||||
* If the user changes the main plugin's file name, the file_exists()
|
||||
* will catch it.
|
||||
*/
|
||||
if ( ! function_exists( 'get_plugins' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
}
|
||||
|
||||
$all_plugins = fs_get_plugins( true );
|
||||
$all_plugins_paths = array();
|
||||
|
||||
// Get active plugin's main files real full names (might be symlinks).
|
||||
foreach ( $all_plugins as $relative_path => $data ) {
|
||||
$all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
|
||||
}
|
||||
|
||||
$plugin_file = null;
|
||||
for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
|
||||
if ( empty( $bt[ $i ]['file'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( in_array( fs_normalize_path( $bt[ $i ]['file'] ), $all_plugins_paths ) ) {
|
||||
$plugin_file = $bt[ $i ]['file'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_null( $plugin_file ) ) {
|
||||
// Throw an error to the developer in case of some edge case dev environment.
|
||||
wp_die(
|
||||
'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.',
|
||||
'Error',
|
||||
array( 'back_link' => true )
|
||||
);
|
||||
}
|
||||
|
||||
return $plugin_file;
|
||||
}
|
||||
}
|
||||
|
||||
require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-1.1.7.1.php';
|
||||
|
||||
if ( ! function_exists( 'fs_update_sdk_newest_version' ) ) {
|
||||
/**
|
||||
* Update SDK newest version reference.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param string $sdk_relative_path
|
||||
* @param string|bool $plugin_file
|
||||
*
|
||||
* @global $fs_active_plugins
|
||||
*/
|
||||
function fs_update_sdk_newest_version( $sdk_relative_path, $plugin_file = false ) {
|
||||
/**
|
||||
* If there is a plugin running an older version of FS (1.2.1 or below), the `fs_update_sdk_newest_version()`
|
||||
* function in the older version will be used instead of this one. But since the older version is using
|
||||
* the `is_plugin_active` function to check if a plugin is active, passing the theme's `plugin_path` to the
|
||||
* `is_plugin_active` function will return false since the path is not a plugin path, so `in_activation` will be
|
||||
* `true` for theme modules and the upgrading of the SDK version to 1.2.2 or newer version will work fine.
|
||||
*
|
||||
* Future versions that will call this function will use the proper logic here instead of just relying on the
|
||||
* `is_plugin_active` function to fail for themes.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.2
|
||||
*/
|
||||
|
||||
global $fs_active_plugins;
|
||||
|
||||
$newest_sdk = $fs_active_plugins->plugins[ $sdk_relative_path ];
|
||||
|
||||
if ( ! is_string( $plugin_file ) ) {
|
||||
$plugin_file = plugin_basename( fs_find_caller_plugin_file() );
|
||||
}
|
||||
|
||||
if ( ! isset( $newest_sdk->type ) || 'theme' !== $newest_sdk->type ) {
|
||||
if ( ! function_exists( 'is_plugin_active' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
}
|
||||
|
||||
$in_activation = ( ! is_plugin_active( $plugin_file ) );
|
||||
} else {
|
||||
$theme = wp_get_theme();
|
||||
$in_activation = ( $newest_sdk->plugin_path == $theme->stylesheet );
|
||||
}
|
||||
|
||||
$fs_active_plugins->newest = (object) array(
|
||||
'plugin_path' => $plugin_file,
|
||||
'sdk_path' => $sdk_relative_path,
|
||||
'version' => $newest_sdk->version,
|
||||
'in_activation' => $in_activation,
|
||||
'timestamp' => time(),
|
||||
);
|
||||
|
||||
// Update DB with latest SDK version and path.
|
||||
update_option( 'fs_active_plugins', $fs_active_plugins );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_newest_sdk_plugin_first' ) ) {
|
||||
/**
|
||||
* Reorder the plugins load order so the plugin with the newest Freemius SDK is loaded first.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @return bool Was plugin order changed. Return false if plugin was loaded first anyways.
|
||||
*
|
||||
* @global $fs_active_plugins
|
||||
*/
|
||||
function fs_newest_sdk_plugin_first() {
|
||||
global $fs_active_plugins;
|
||||
|
||||
/**
|
||||
* @todo Multi-site network activated plugin are always loaded prior to site plugins so if there's a plugin activated in the network mode that has an older version of the SDK of another plugin which is site activated that has new SDK version, the fs-essential-functions.php will be loaded from the older SDK. Same thing about MU plugins (loaded even before network activated plugins).
|
||||
*
|
||||
* @link https://github.com/Freemius/wordpress-sdk/issues/26
|
||||
*/
|
||||
|
||||
$newest_sdk_plugin_path = $fs_active_plugins->newest->plugin_path;
|
||||
|
||||
$active_plugins = get_option( 'active_plugins', array() );
|
||||
$updated_active_plugins = array( $newest_sdk_plugin_path );
|
||||
|
||||
$plugin_found = false;
|
||||
$is_first_path = true;
|
||||
|
||||
foreach ( $active_plugins as $key => $plugin_path ) {
|
||||
if ( $plugin_path === $newest_sdk_plugin_path ) {
|
||||
if ( $is_first_path ) {
|
||||
// if it's the first plugin already, no need to continue
|
||||
return false;
|
||||
}
|
||||
|
||||
$plugin_found = true;
|
||||
|
||||
// Skip the plugin (it is already added as the 1st item of $updated_active_plugins).
|
||||
continue;
|
||||
}
|
||||
|
||||
$updated_active_plugins[] = $plugin_path;
|
||||
|
||||
if ( $is_first_path ) {
|
||||
$is_first_path = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $plugin_found ) {
|
||||
update_option( 'active_plugins', $updated_active_plugins );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( is_multisite() ) {
|
||||
// Plugin is network active.
|
||||
$network_active_plugins = get_site_option( 'active_sitewide_plugins', array() );
|
||||
|
||||
if ( isset( $network_active_plugins[ $newest_sdk_plugin_path ] ) ) {
|
||||
reset( $network_active_plugins );
|
||||
if ( $newest_sdk_plugin_path === key( $network_active_plugins ) ) {
|
||||
// Plugin is already activated first on the network level.
|
||||
return false;
|
||||
} else {
|
||||
$time = $network_active_plugins[ $newest_sdk_plugin_path ];
|
||||
|
||||
// Remove plugin from its current position.
|
||||
unset( $network_active_plugins[ $newest_sdk_plugin_path ] );
|
||||
|
||||
// Set it to be included first.
|
||||
$network_active_plugins = array( $newest_sdk_plugin_path => $time ) + $network_active_plugins;
|
||||
|
||||
update_site_option( 'active_sitewide_plugins', $network_active_plugins );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_fallback_to_newest_active_sdk' ) ) {
|
||||
/**
|
||||
* Go over all Freemius SDKs in the system and find and "remember"
|
||||
* the newest SDK which is associated with an active plugin.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @global $fs_active_plugins
|
||||
*/
|
||||
function fs_fallback_to_newest_active_sdk() {
|
||||
global $fs_active_plugins;
|
||||
|
||||
/**
|
||||
* @var object $newest_sdk_data
|
||||
*/
|
||||
$newest_sdk_data = null;
|
||||
$newest_sdk_path = null;
|
||||
|
||||
foreach ( $fs_active_plugins->plugins as $sdk_relative_path => $data ) {
|
||||
if ( is_null( $newest_sdk_data ) || version_compare( $data->version, $newest_sdk_data->version, '>' )
|
||||
) {
|
||||
// If plugin inactive or SDK starter file doesn't exist, remove SDK reference.
|
||||
if ( 'plugin' === $data->type ) {
|
||||
$is_module_active = is_plugin_active( $data->plugin_path );
|
||||
} else {
|
||||
$active_theme = wp_get_theme();
|
||||
$is_module_active = ( $data->plugin_path === $active_theme->get_template() );
|
||||
}
|
||||
|
||||
$is_sdk_exists = file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $sdk_relative_path . '/start.php' ) );
|
||||
|
||||
if ( ! $is_module_active || ! $is_sdk_exists ) {
|
||||
unset( $fs_active_plugins->plugins[ $sdk_relative_path ] );
|
||||
|
||||
// No need to store the data since it will be stored in fs_update_sdk_newest_version()
|
||||
// or explicitly with update_option().
|
||||
} else {
|
||||
$newest_sdk_data = $data;
|
||||
$newest_sdk_path = $sdk_relative_path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_null( $newest_sdk_data ) ) {
|
||||
// Couldn't find any SDK reference.
|
||||
$fs_active_plugins = new stdClass();
|
||||
update_option( 'fs_active_plugins', $fs_active_plugins );
|
||||
} else {
|
||||
fs_update_sdk_newest_version( $newest_sdk_path, $newest_sdk_data->plugin_path );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.5.10
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_html_get_allowed_kses_list' ) ) {
|
||||
/**
|
||||
* Get the allowed KSES list for sanitizing HTML output on the template files.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function fs_html_get_allowed_kses_list() {
|
||||
$common_attributes = array(
|
||||
'id' => true,
|
||||
'class' => true,
|
||||
'style' => true,
|
||||
'data-*' => true,
|
||||
);
|
||||
|
||||
return array(
|
||||
'a' => array_merge(
|
||||
$common_attributes,
|
||||
array(
|
||||
'href' => true,
|
||||
'title' => true,
|
||||
'target' => true,
|
||||
'rel' => true,
|
||||
)
|
||||
),
|
||||
'img' => array_merge(
|
||||
$common_attributes,
|
||||
array(
|
||||
'src' => true,
|
||||
'alt' => true,
|
||||
'title' => true,
|
||||
'width' => true,
|
||||
'height' => true,
|
||||
)
|
||||
),
|
||||
'br' => $common_attributes,
|
||||
'em' => $common_attributes,
|
||||
'small' => $common_attributes,
|
||||
'strong' => $common_attributes,
|
||||
'u' => $common_attributes,
|
||||
'b' => $common_attributes,
|
||||
'i' => $common_attributes,
|
||||
'hr' => $common_attributes,
|
||||
'span' => $common_attributes,
|
||||
'p' => $common_attributes,
|
||||
'div' => $common_attributes,
|
||||
'ul' => $common_attributes,
|
||||
'li' => $common_attributes,
|
||||
'ol' => $common_attributes,
|
||||
'h1' => $common_attributes,
|
||||
'h2' => $common_attributes,
|
||||
'h3' => $common_attributes,
|
||||
'h4' => $common_attributes,
|
||||
'h5' => $common_attributes,
|
||||
'h6' => $common_attributes,
|
||||
'button' => $common_attributes,
|
||||
'sup' => $common_attributes,
|
||||
'sub' => $common_attributes,
|
||||
'nobr' => $common_attributes,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_html_get_classname' ) ) {
|
||||
/**
|
||||
* Gets an HTML class attribute value.
|
||||
*
|
||||
* @param string|string[] $classes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function fs_html_get_classname( $classes ) {
|
||||
if ( is_array( $classes ) ) {
|
||||
$classes = implode( ' ', $classes );
|
||||
}
|
||||
|
||||
return esc_attr( $classes );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_html_get_attributes' ) ) {
|
||||
/**
|
||||
* Gets a properly escaped HTML attributes string from an associative array.
|
||||
*
|
||||
* @param array<string, string> $attributes A key/value pair array of attributes.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function fs_html_get_attributes( $attributes ) {
|
||||
$attribute_string = '';
|
||||
|
||||
foreach ( $attributes as $key => $value ) {
|
||||
$attribute_string .= sprintf(
|
||||
' %1$s="%2$s"',
|
||||
esc_attr( $key ),
|
||||
esc_attr( $value )
|
||||
);
|
||||
}
|
||||
|
||||
return $attribute_string;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'fs_html_get_sanitized_html' ) ) {
|
||||
/**
|
||||
* Get sanitized HTML for template files.
|
||||
*
|
||||
* @param string $raw_html
|
||||
*
|
||||
* @return string
|
||||
* @since 2.5.10
|
||||
*/
|
||||
function fs_html_get_sanitized_html( $raw_html ) {
|
||||
return wp_kses( $raw_html, fs_html_get_allowed_kses_list() );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||
48
html/wp-content/plugins/post-smtp/freemius/includes/l10n.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.2.1.6
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the translation of $text.
|
||||
*
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param string $text
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function _fs_text( $text ) {
|
||||
// Avoid misleading Theme Check warning.
|
||||
$fn = 'translate';
|
||||
return $fn( $text, 'freemius' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve translated string with gettext context.
|
||||
*
|
||||
* Quite a few times, there will be collisions with similar translatable text
|
||||
* found in more than two places, but with different translated context.
|
||||
*
|
||||
* By including the context in the pot file, translators can translate the two
|
||||
* strings differently.
|
||||
*
|
||||
* @since 1.2.1.6
|
||||
*
|
||||
* @param string $text
|
||||
* @param string $context
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function _fs_x( $text, $context ) {
|
||||
// Avoid misleading Theme Check warning.
|
||||
$fn = 'translate_with_gettext_context';
|
||||
return $fn( $text, $context, 'freemius' );
|
||||
}
|
||||
@@ -0,0 +1,538 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Admin_Notice_Manager {
|
||||
/**
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_module_unique_affix;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_title;
|
||||
/**
|
||||
* @var array[string]array
|
||||
*/
|
||||
private $_notices = array();
|
||||
/**
|
||||
* @var FS_Key_Value_Storage
|
||||
*/
|
||||
private $_sticky_storage;
|
||||
/**
|
||||
* @var FS_Logger
|
||||
*/
|
||||
protected $_logger;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @var int The ID of the blog that is associated with the current site level admin notices.
|
||||
*/
|
||||
private $_blog_id = 0;
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_network_notices;
|
||||
|
||||
/**
|
||||
* @var FS_Admin_Notice_Manager[]
|
||||
*/
|
||||
private static $_instances = array();
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $title
|
||||
* @param string $module_unique_affix
|
||||
* @param bool $is_network_and_blog_admins Whether or not the message should be shown both on
|
||||
* network and blog admin pages.
|
||||
* @param bool $network_level_or_blog_id Since 2.0.0
|
||||
*
|
||||
* @return \FS_Admin_Notice_Manager
|
||||
*/
|
||||
static function instance(
|
||||
$id,
|
||||
$title = '',
|
||||
$module_unique_affix = '',
|
||||
$is_network_and_blog_admins = false,
|
||||
$network_level_or_blog_id = false
|
||||
) {
|
||||
if ( $is_network_and_blog_admins ) {
|
||||
$network_level_or_blog_id = true;
|
||||
}
|
||||
|
||||
$key = strtolower( $id );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
if ( true === $network_level_or_blog_id ) {
|
||||
$key .= ':ms';
|
||||
} else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
|
||||
$key .= ":{$network_level_or_blog_id}";
|
||||
} else {
|
||||
$network_level_or_blog_id = get_current_blog_id();
|
||||
|
||||
$key .= ":{$network_level_or_blog_id}";
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( self::$_instances[ $key ] ) ) {
|
||||
self::$_instances[ $key ] = new FS_Admin_Notice_Manager(
|
||||
$id,
|
||||
$title,
|
||||
$module_unique_affix,
|
||||
$is_network_and_blog_admins,
|
||||
$network_level_or_blog_id
|
||||
);
|
||||
}
|
||||
|
||||
return self::$_instances[ $key ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $title
|
||||
* @param string $module_unique_affix
|
||||
* @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network and
|
||||
* blog admin pages.
|
||||
* @param bool|int $network_level_or_blog_id
|
||||
*/
|
||||
protected function __construct(
|
||||
$id,
|
||||
$title = '',
|
||||
$module_unique_affix = '',
|
||||
$is_network_and_blog_admins = false,
|
||||
$network_level_or_blog_id = false
|
||||
) {
|
||||
$this->_id = $id;
|
||||
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $this->_id . '_data', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
||||
$this->_title = ! empty( $title ) ? $title : '';
|
||||
$this->_module_unique_affix = $module_unique_affix;
|
||||
$this->_sticky_storage = FS_Key_Value_Storage::instance( 'admin_notices', $this->_id, $network_level_or_blog_id );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$this->_is_network_notices = ( true === $network_level_or_blog_id );
|
||||
|
||||
if ( is_numeric( $network_level_or_blog_id ) ) {
|
||||
$this->_blog_id = $network_level_or_blog_id;
|
||||
}
|
||||
} else {
|
||||
$this->_is_network_notices = false;
|
||||
}
|
||||
|
||||
$is_network_admin = fs_is_network_admin();
|
||||
$is_blog_admin = fs_is_blog_admin();
|
||||
|
||||
if ( ( $this->_is_network_notices && $is_network_admin ) ||
|
||||
( ! $this->_is_network_notices && $is_blog_admin ) ||
|
||||
( $is_network_and_blog_admins && ( $is_network_admin || $is_blog_admin ) )
|
||||
) {
|
||||
if ( 0 < count( $this->_sticky_storage ) ) {
|
||||
$ajax_action_suffix = str_replace( ':', '-', $this->_id );
|
||||
|
||||
// If there are sticky notices for the current slug, add a callback
|
||||
// to the AJAX action that handles message dismiss.
|
||||
add_action( "wp_ajax_fs_dismiss_notice_action_{$ajax_action_suffix}", array(
|
||||
&$this,
|
||||
'dismiss_notice_ajax_callback'
|
||||
) );
|
||||
|
||||
foreach ( $this->_sticky_storage as $msg ) {
|
||||
// Add admin notice.
|
||||
$this->add(
|
||||
$msg['message'],
|
||||
$msg['title'],
|
||||
$msg['type'],
|
||||
true,
|
||||
$msg['id'],
|
||||
false,
|
||||
isset( $msg['wp_user_id'] ) ? $msg['wp_user_id'] : null,
|
||||
! empty( $msg['plugin'] ) ? $msg['plugin'] : null,
|
||||
$is_network_and_blog_admins,
|
||||
isset( $msg['dismissible'] ) ?
|
||||
$msg['dismissible'] :
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove sticky message by ID.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
*/
|
||||
function dismiss_notice_ajax_callback() {
|
||||
check_admin_referer( 'fs_dismiss_notice_action' );
|
||||
|
||||
if ( ! is_numeric( $_POST['message_id'] ) ) {
|
||||
$this->_sticky_storage->remove( $_POST['message_id'] );
|
||||
}
|
||||
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rendered sticky message dismiss JavaScript.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*/
|
||||
static function _add_sticky_dismiss_javascript() {
|
||||
$sticky_admin_notice_js_template_name = 'sticky-admin-notice-js.php';
|
||||
|
||||
if ( ! file_exists( fs_get_template_path( $sticky_admin_notice_js_template_name ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$params = array();
|
||||
fs_require_once_template( $sticky_admin_notice_js_template_name, $params );
|
||||
}
|
||||
|
||||
private static $_added_sticky_javascript = false;
|
||||
|
||||
/**
|
||||
* Hook to the admin_footer to add sticky message dismiss JavaScript handler.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*/
|
||||
private static function has_sticky_messages() {
|
||||
if ( ! self::$_added_sticky_javascript ) {
|
||||
add_action( 'admin_footer', array( 'FS_Admin_Notice_Manager', '_add_sticky_dismiss_javascript' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle admin_notices by printing the admin messages stacked in the queue.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.4
|
||||
*
|
||||
*/
|
||||
function _admin_notices_hook() {
|
||||
if ( function_exists( 'current_user_can' ) &&
|
||||
! current_user_can( 'manage_options' )
|
||||
) {
|
||||
// Only show messages to admins.
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $this->_notices as $id => $msg ) {
|
||||
if ( isset( $msg['wp_user_id'] ) && is_numeric( $msg['wp_user_id'] ) ) {
|
||||
if ( get_current_user_id() != $msg['wp_user_id'] ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Added a filter to control the visibility of admin notices.
|
||||
*
|
||||
* Usage example:
|
||||
*
|
||||
* /**
|
||||
* * @param bool $show
|
||||
* * @param array $msg {
|
||||
* * @var string $message The actual message.
|
||||
* * @var string $title An optional message title.
|
||||
* * @var string $type The type of the message ('success', 'update', 'warning', 'promotion').
|
||||
* * @var string $id The unique identifier of the message.
|
||||
* * @var string $manager_id The unique identifier of the notices manager. For plugins it would be the plugin's slug, for themes - `<slug>-theme`.
|
||||
* * @var string $plugin The product's title.
|
||||
* * @var string $wp_user_id An optional WP user ID that this admin notice is for.
|
||||
* * }
|
||||
* *
|
||||
* * @return bool
|
||||
* *\/
|
||||
* function my_custom_show_admin_notice( $show, $msg ) {
|
||||
* if ('trial_promotion' != $msg['id']) {
|
||||
* return false;
|
||||
* }
|
||||
*
|
||||
* return $show;
|
||||
* }
|
||||
*
|
||||
* my_fs()->add_filter( 'show_admin_notice', 'my_custom_show_admin_notice', 10, 2 );
|
||||
*
|
||||
* @author Vova Feldman
|
||||
* @since 2.2.0
|
||||
*/
|
||||
$show_notice = call_user_func_array( 'fs_apply_filter', array(
|
||||
$this->_module_unique_affix,
|
||||
'show_admin_notice',
|
||||
$this->show_admin_notices(),
|
||||
$msg
|
||||
) );
|
||||
|
||||
if ( true !== $show_notice ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
fs_require_template( 'admin-notice.php', $msg );
|
||||
|
||||
if ( $msg['sticky'] ) {
|
||||
self::has_sticky_messages();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue common stylesheet to style admin notice.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*/
|
||||
function _enqueue_styles() {
|
||||
fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current page is the Gutenberg block editor.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.2.3
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_gutenberg_page() {
|
||||
if ( function_exists( 'is_gutenberg_page' ) &&
|
||||
is_gutenberg_page()
|
||||
) {
|
||||
// The Gutenberg plugin is on.
|
||||
return true;
|
||||
}
|
||||
|
||||
$current_screen = get_current_screen();
|
||||
|
||||
if ( method_exists( $current_screen, 'is_block_editor' ) &&
|
||||
$current_screen->is_block_editor()
|
||||
) {
|
||||
// Gutenberg page on 5+.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if admin notices should be shown on page. E.g., we don't want to show notices in the Visual Editor.
|
||||
*
|
||||
* @author Xiaheng Chen (@xhchen)
|
||||
* @since 2.4.2
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function show_admin_notices() {
|
||||
global $pagenow;
|
||||
|
||||
if ( 'about.php' === $pagenow ) {
|
||||
// Don't show admin notices on the About page.
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $this->is_gutenberg_page() ) {
|
||||
// Don't show admin notices in Gutenberg (visual editor).
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.4
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $title
|
||||
* @param string $type
|
||||
* @param bool $is_sticky
|
||||
* @param string $id Message ID
|
||||
* @param bool $store_if_sticky
|
||||
* @param number|null $wp_user_id
|
||||
* @param string|null $plugin_title
|
||||
* @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network
|
||||
* and blog admin pages.
|
||||
* @param bool|null $is_dismissible
|
||||
* @param array $data
|
||||
*
|
||||
* @uses add_action()
|
||||
*/
|
||||
function add(
|
||||
$message,
|
||||
$title = '',
|
||||
$type = 'success',
|
||||
$is_sticky = false,
|
||||
$id = '',
|
||||
$store_if_sticky = true,
|
||||
$wp_user_id = null,
|
||||
$plugin_title = null,
|
||||
$is_network_and_blog_admins = false,
|
||||
$is_dismissible = null,
|
||||
$data = array()
|
||||
) {
|
||||
$notices_type = $this->get_notices_type();
|
||||
|
||||
if ( empty( $this->_notices ) ) {
|
||||
if ( ! $is_network_and_blog_admins ) {
|
||||
add_action( $notices_type, array( &$this, "_admin_notices_hook" ) );
|
||||
} else {
|
||||
add_action( 'network_admin_notices', array( &$this, "_admin_notices_hook" ) );
|
||||
add_action( 'admin_notices', array( &$this, "_admin_notices_hook" ) );
|
||||
}
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_styles' ) );
|
||||
}
|
||||
|
||||
if ( '' === $id ) {
|
||||
$id = md5( $title . ' ' . $message . ' ' . $type );
|
||||
}
|
||||
|
||||
$message_object = array(
|
||||
'message' => $message,
|
||||
'title' => $title,
|
||||
'type' => $type,
|
||||
'sticky' => $is_sticky,
|
||||
'id' => $id,
|
||||
'manager_id' => $this->_id,
|
||||
'plugin' => ( ! is_null( $plugin_title ) ? $plugin_title : $this->_title ),
|
||||
'wp_user_id' => $wp_user_id,
|
||||
'dismissible' => $is_dismissible,
|
||||
'data' => $data
|
||||
);
|
||||
|
||||
if ( $is_sticky && $store_if_sticky ) {
|
||||
$this->_sticky_storage->{$id} = $message_object;
|
||||
}
|
||||
|
||||
$this->_notices[ $id ] = $message_object;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param string|string[] $ids
|
||||
* @param bool $store
|
||||
*/
|
||||
function remove_sticky( $ids, $store = true ) {
|
||||
if ( ! is_array( $ids ) ) {
|
||||
$ids = array( $ids );
|
||||
}
|
||||
|
||||
foreach ( $ids as $id ) {
|
||||
// Remove from sticky storage.
|
||||
$this->_sticky_storage->remove( $id, $store );
|
||||
|
||||
if ( isset( $this->_notices[ $id ] ) ) {
|
||||
unset( $this->_notices[ $id ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if sticky message exists by id.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param $id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_sticky( $id ) {
|
||||
return isset( $this->_sticky_storage[ $id ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds sticky admin notification.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $id Message ID
|
||||
* @param string $title
|
||||
* @param string $type
|
||||
* @param number|null $wp_user_id
|
||||
* @param string|null $plugin_title
|
||||
* @param bool $is_network_and_blog_admins Whether or not the message should be shown both on network
|
||||
* and blog admin pages.
|
||||
* @param bool $is_dimissible
|
||||
* @param array $data
|
||||
*/
|
||||
function add_sticky( $message, $id, $title = '', $type = 'success', $wp_user_id = null, $plugin_title = null, $is_network_and_blog_admins = false, $is_dimissible = true, $data = array() ) {
|
||||
if ( ! empty( $this->_module_unique_affix ) ) {
|
||||
$message = fs_apply_filter( $this->_module_unique_affix, "sticky_message_{$id}", $message );
|
||||
$title = fs_apply_filter( $this->_module_unique_affix, "sticky_title_{$id}", $title );
|
||||
}
|
||||
|
||||
$this->add( $message, $title, $type, true, $id, true, $wp_user_id, $plugin_title, $is_network_and_blog_admins, $is_dimissible, $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the data of an sticky notice.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.4.3
|
||||
*
|
||||
* @param string $id Message ID.
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
function get_sticky( $id ) {
|
||||
return isset( $this->_sticky_storage->{$id} ) ?
|
||||
$this->_sticky_storage->{$id} :
|
||||
null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all sticky messages.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.8
|
||||
*
|
||||
* @param bool $is_temporary @since 2.5.1
|
||||
*/
|
||||
function clear_all_sticky( $is_temporary = false ) {
|
||||
if ( $is_temporary ) {
|
||||
$this->_notices = array();
|
||||
} else {
|
||||
$this->_sticky_storage->clear_all();
|
||||
}
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Helper Method
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function get_notices_type() {
|
||||
return $this->_is_network_notices ?
|
||||
'network_admin_notices' :
|
||||
'admin_notices';
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.1.6
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Cache_Manager {
|
||||
/**
|
||||
* @var FS_Option_Manager
|
||||
*/
|
||||
private $_options;
|
||||
/**
|
||||
* @var FS_Logger
|
||||
*/
|
||||
private $_logger;
|
||||
|
||||
/**
|
||||
* @var FS_Cache_Manager[]
|
||||
*/
|
||||
private static $_MANAGERS = array();
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.3
|
||||
*
|
||||
* @param string $id
|
||||
*/
|
||||
private function __construct( $id ) {
|
||||
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_cach_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
||||
|
||||
$this->_logger->entrance();
|
||||
$this->_logger->log( 'id = ' . $id );
|
||||
|
||||
$this->_options = FS_Option_Manager::get_manager( $id, true, true, false );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param $id
|
||||
*
|
||||
* @return FS_Cache_Manager
|
||||
*/
|
||||
static function get_manager( $id ) {
|
||||
$id = strtolower( $id );
|
||||
|
||||
if ( ! isset( self::$_MANAGERS[ $id ] ) ) {
|
||||
self::$_MANAGERS[ $id ] = new FS_Cache_Manager( $id );
|
||||
}
|
||||
|
||||
return self::$_MANAGERS[ $id ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_empty() {
|
||||
$this->_logger->entrance();
|
||||
|
||||
return $this->_options->is_empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*/
|
||||
function clear() {
|
||||
$this->_logger->entrance();
|
||||
|
||||
$this->_options->clear( true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete cache manager from DB.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*/
|
||||
function delete() {
|
||||
$this->_options->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there's a cached item.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has( $key ) {
|
||||
$cache_entry = $this->_options->get_option( $key, false );
|
||||
|
||||
return ( is_object( $cache_entry ) &&
|
||||
isset( $cache_entry->timestamp ) &&
|
||||
is_numeric( $cache_entry->timestamp )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there's a valid cached item.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param string $key
|
||||
* @param null|int $expiration Since 1.2.2.7
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_valid( $key, $expiration = null ) {
|
||||
$cache_entry = $this->_options->get_option( $key, false );
|
||||
|
||||
$is_valid = ( is_object( $cache_entry ) &&
|
||||
isset( $cache_entry->timestamp ) &&
|
||||
is_numeric( $cache_entry->timestamp ) &&
|
||||
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
||||
);
|
||||
|
||||
if ( $is_valid &&
|
||||
is_numeric( $expiration ) &&
|
||||
isset( $cache_entry->created ) &&
|
||||
is_numeric( $cache_entry->created ) &&
|
||||
$cache_entry->created + $expiration < WP_FS__SCRIPT_START_TIME
|
||||
) {
|
||||
/**
|
||||
* Even if the cache is still valid, since we are checking for validity
|
||||
* with an explicit expiration period, if the period has past, return
|
||||
* `false` as if the cache is invalid.
|
||||
*
|
||||
* @since 1.2.2.7
|
||||
*/
|
||||
$is_valid = false;
|
||||
}
|
||||
|
||||
return $is_valid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function get( $key, $default = null ) {
|
||||
$this->_logger->entrance( 'key = ' . $key );
|
||||
|
||||
$cache_entry = $this->_options->get_option( $key, false );
|
||||
|
||||
if ( is_object( $cache_entry ) &&
|
||||
isset( $cache_entry->timestamp ) &&
|
||||
is_numeric( $cache_entry->timestamp )
|
||||
) {
|
||||
return $cache_entry->result;
|
||||
}
|
||||
|
||||
return is_object( $default ) ? clone $default : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function get_valid( $key, $default = null ) {
|
||||
$this->_logger->entrance( 'key = ' . $key );
|
||||
|
||||
$cache_entry = $this->_options->get_option( $key, false );
|
||||
|
||||
if ( is_object( $cache_entry ) &&
|
||||
isset( $cache_entry->timestamp ) &&
|
||||
is_numeric( $cache_entry->timestamp ) &&
|
||||
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
||||
) {
|
||||
return $cache_entry->result;
|
||||
}
|
||||
|
||||
return is_object( $default ) ? clone $default : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param int $expiration
|
||||
* @param int $created Since 2.0.0 Cache creation date.
|
||||
*/
|
||||
function set( $key, $value, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $created = WP_FS__SCRIPT_START_TIME ) {
|
||||
$this->_logger->entrance( 'key = ' . $key );
|
||||
|
||||
$cache_entry = new stdClass();
|
||||
|
||||
$cache_entry->result = $value;
|
||||
$cache_entry->created = $created;
|
||||
$cache_entry->timestamp = $created + $expiration;
|
||||
$this->_options->set_option( $key, $cache_entry, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cached record expiration, or false if not cached or expired.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.7.3
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool|int
|
||||
*/
|
||||
function get_record_expiration( $key ) {
|
||||
$this->_logger->entrance( 'key = ' . $key );
|
||||
|
||||
$cache_entry = $this->_options->get_option( $key, false );
|
||||
|
||||
if ( is_object( $cache_entry ) &&
|
||||
isset( $cache_entry->timestamp ) &&
|
||||
is_numeric( $cache_entry->timestamp ) &&
|
||||
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
||||
) {
|
||||
return $cache_entry->timestamp;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Purge cached item.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.1.6
|
||||
*
|
||||
* @param string $key
|
||||
*/
|
||||
function purge( $key ) {
|
||||
$this->_logger->entrance( 'key = ' . $key );
|
||||
|
||||
$this->_options->unset_option( $key, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend cached item caching period.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param string $key
|
||||
* @param int $expiration
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function update_expiration( $key, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
|
||||
$this->_logger->entrance( 'key = ' . $key );
|
||||
|
||||
$cache_entry = $this->_options->get_option( $key, false );
|
||||
|
||||
if ( ! is_object( $cache_entry ) ||
|
||||
! isset( $cache_entry->timestamp ) ||
|
||||
! is_numeric( $cache_entry->timestamp )
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->set( $key, $cache_entry->result, $expiration, $cache_entry->created );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cached item as expired.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.2.2.7
|
||||
*
|
||||
* @param string $key
|
||||
*/
|
||||
function expire( $key ) {
|
||||
$this->_logger->entrance( 'key = ' . $key );
|
||||
|
||||
$cache_entry = $this->_options->get_option( $key, false );
|
||||
|
||||
if ( is_object( $cache_entry ) &&
|
||||
isset( $cache_entry->timestamp ) &&
|
||||
is_numeric( $cache_entry->timestamp )
|
||||
) {
|
||||
// Set to expired.
|
||||
$cache_entry->timestamp = WP_FS__SCRIPT_START_TIME;
|
||||
$this->_options->set_option( $key, $cache_entry, true );
|
||||
}
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Migration
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Migrate options from site level.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function migrate_to_network() {
|
||||
$this->_options->migrate_to_network();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2024, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.9.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Checkout_Manager {
|
||||
|
||||
# region Singleton
|
||||
|
||||
/**
|
||||
* @var FS_Checkout_Manager
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
/**
|
||||
* @return FS_Checkout_Manager
|
||||
*/
|
||||
static function instance() {
|
||||
if ( ! isset( self::$_instance ) ) {
|
||||
self::$_instance = new FS_Checkout_Manager();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
private function __construct() {
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/**
|
||||
* Retrieves the query params needed to load the Freemius Checkout in the context of the plugin.
|
||||
*
|
||||
* @param Freemius $fs
|
||||
* @param number $plugin_id
|
||||
* @param number $plan_id
|
||||
* @param number $licenses
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_query_params( Freemius $fs, $plugin_id, $plan_id, $licenses ) {
|
||||
$timestamp = time();
|
||||
|
||||
$context_params = array(
|
||||
'plugin_id' => $fs->get_id(),
|
||||
'public_key' => $fs->get_public_key(),
|
||||
'plugin_version' => $fs->get_plugin_version(),
|
||||
'mode' => 'dashboard',
|
||||
'trial' => fs_request_get_bool( 'trial' ),
|
||||
'is_ms' => ( fs_is_network_admin() && $fs->is_network_active() ),
|
||||
);
|
||||
|
||||
if ( FS_Plugin_Plan::is_valid_id( $plan_id ) ) {
|
||||
$context_params['plan_id'] = $plan_id;
|
||||
}
|
||||
|
||||
if ( $licenses === strval( intval( $licenses ) ) && $licenses > 0 ) {
|
||||
$context_params['licenses'] = $licenses;
|
||||
}
|
||||
|
||||
if ( $plugin_id == $fs->get_id() ) {
|
||||
$is_premium = $fs->is_premium();
|
||||
|
||||
$bundle_id = $fs->get_bundle_id();
|
||||
if ( ! is_null( $bundle_id ) ) {
|
||||
$context_params['bundle_id'] = $bundle_id;
|
||||
}
|
||||
} else {
|
||||
// Identify the module code version of the checkout context module.
|
||||
if ( $fs->is_addon_activated( $plugin_id ) ) {
|
||||
$fs_addon = Freemius::get_instance_by_id( $plugin_id );
|
||||
$is_premium = $fs_addon->is_premium();
|
||||
} else {
|
||||
// If add-on isn't activated assume the premium version isn't installed.
|
||||
$is_premium = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Get site context secure params.
|
||||
if ( $fs->is_registered() ) {
|
||||
$site = $fs->get_site();
|
||||
|
||||
if ( $plugin_id != $fs->get_id() ) {
|
||||
if ( $fs->is_addon_activated( $plugin_id ) ) {
|
||||
$fs_addon = Freemius::get_instance_by_id( $plugin_id );
|
||||
$addon_site = $fs_addon->get_site();
|
||||
if ( is_object( $addon_site ) ) {
|
||||
$site = $addon_site;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$context_params = array_merge(
|
||||
$context_params,
|
||||
FS_Security::instance()->get_context_params(
|
||||
$site,
|
||||
$timestamp,
|
||||
'checkout'
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$current_user = Freemius::_get_current_wp_user();
|
||||
|
||||
// Add site and user info to the request, this information
|
||||
// is NOT being stored unless the user complete the purchase
|
||||
// and agrees to the TOS.
|
||||
$context_params = array_merge( $context_params, array(
|
||||
'user_firstname' => $current_user->user_firstname,
|
||||
'user_lastname' => $current_user->user_lastname,
|
||||
'user_email' => $current_user->user_email,
|
||||
'home_url' => home_url(),
|
||||
) );
|
||||
|
||||
$fs_user = Freemius::_get_user_by_email( $current_user->user_email );
|
||||
|
||||
if ( is_object( $fs_user ) && $fs_user->is_verified() ) {
|
||||
$context_params = array_merge(
|
||||
$context_params,
|
||||
FS_Security::instance()->get_context_params(
|
||||
$fs_user,
|
||||
$timestamp,
|
||||
'checkout'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $fs->is_payments_sandbox() ) {
|
||||
// Append plugin secure token for sandbox mode authentication.
|
||||
$context_params['sandbox'] = FS_Security::instance()->get_secure_token(
|
||||
$fs->get_plugin(),
|
||||
$timestamp,
|
||||
'checkout'
|
||||
);
|
||||
|
||||
/**
|
||||
* @since 1.1.7.3 Add security timestamp for sandbox even for anonymous user.
|
||||
*/
|
||||
if ( empty( $context_params['s_ctx_ts'] ) ) {
|
||||
$context_params['s_ctx_ts'] = $timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
$can_user_install = (
|
||||
( $fs->is_plugin() && current_user_can( 'install_plugins' ) ) ||
|
||||
( $fs->is_theme() && current_user_can( 'install_themes' ) )
|
||||
);
|
||||
|
||||
return array_merge( $context_params, $_GET, array(
|
||||
// Current plugin version.
|
||||
'plugin_version' => $fs->get_plugin_version(),
|
||||
'sdk_version' => WP_FS__SDK_VERSION,
|
||||
'is_premium' => $is_premium ? 'true' : 'false',
|
||||
'can_install' => $can_user_install ? 'true' : 'false',
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* The return URL to pass to the checkout when the checkout is loaded in "redirect" mode.
|
||||
*
|
||||
* @param Freemius $fs
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_checkout_redirect_return_url( Freemius $fs ) {
|
||||
$request_url = remove_query_arg( '_wp_http_referer' );
|
||||
|
||||
return fs_nonce_url(
|
||||
$fs->checkout_url(
|
||||
fs_request_get( 'billing_cycle' ),
|
||||
fs_request_get_bool( 'trial' ),
|
||||
array(
|
||||
'process_redirect' => 'true',
|
||||
'_wp_http_referer' => $request_url,
|
||||
)
|
||||
),
|
||||
$this->get_checkout_redirect_nonce_action( $fs )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $query_params
|
||||
* @param string $base_url
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_full_checkout_url( array $query_params, $base_url = FS_CHECKOUT__ADDRESS ) {
|
||||
return $base_url . '/?' . http_build_query( $query_params );
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies the redirect after a checkout with the nonce.
|
||||
*
|
||||
* @param Freemius $fs
|
||||
*/
|
||||
public function verify_checkout_redirect_nonce( Freemius $fs ) {
|
||||
check_admin_referer( $this->get_checkout_redirect_nonce_action( $fs ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL to process a new install after the checkout.
|
||||
*
|
||||
* @param Freemius $fs
|
||||
* @param number $plugin_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_install_url( Freemius $fs, $plugin_id ) {
|
||||
return fs_nonce_url( $fs->_get_admin_page_url( 'account', array(
|
||||
'fs_action' => $fs->get_unique_affix() . '_activate_new',
|
||||
'plugin_id' => $plugin_id,
|
||||
) ), $fs->get_unique_affix() . '_activate_new' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL to process a pending activation after the checkout.
|
||||
*
|
||||
* @param Freemius $fs
|
||||
* @param number $plugin_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_pending_activation_url( Freemius $fs, $plugin_id ) {
|
||||
return fs_nonce_url( $fs->_get_admin_page_url( 'account', array(
|
||||
'fs_action' => $fs->get_unique_affix() . '_activate_new',
|
||||
'plugin_id' => $plugin_id,
|
||||
'pending_activation' => true,
|
||||
'has_upgrade_context' => true,
|
||||
) ), $fs->get_unique_affix() . '_activate_new' );
|
||||
}
|
||||
|
||||
private function get_checkout_redirect_nonce_action( Freemius $fs ) {
|
||||
return $fs->get_unique_affix() . '_checkout_redirect';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2024, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.9.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Contact_Form_Manager {
|
||||
|
||||
# region Singleton
|
||||
|
||||
/**
|
||||
* @var FS_Contact_Form_Manager
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
/**
|
||||
* @return FS_Contact_Form_Manager
|
||||
*/
|
||||
static function instance() {
|
||||
if ( ! isset( self::$_instance ) ) {
|
||||
self::$_instance = new FS_Contact_Form_Manager();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
private function __construct() {
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/**
|
||||
* Retrieves the query params needed to load the Freemius Contact Form in the context of the plugin.
|
||||
*
|
||||
* @param Freemius $fs
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function get_query_params( Freemius $fs ) {
|
||||
$context_params = array(
|
||||
'plugin_id' => $fs->get_id(),
|
||||
'plugin_public_key' => $fs->get_public_key(),
|
||||
'plugin_version' => $fs->get_plugin_version(),
|
||||
);
|
||||
|
||||
// Get site context secure params.
|
||||
if ( $fs->is_registered() ) {
|
||||
$context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
|
||||
$fs->get_site(),
|
||||
time(),
|
||||
'contact'
|
||||
) );
|
||||
}
|
||||
|
||||
return array_merge( $_GET, array_merge( $context_params, array(
|
||||
'plugin_version' => $fs->get_plugin_version(),
|
||||
'wp_login_url' => wp_login_url(),
|
||||
'site_url' => Freemius::get_unfiltered_site_url(),
|
||||
// 'wp_admin_css' => get_bloginfo('wpurl') . "/wp-admin/load-styles.php?c=1&load=buttons,wp-admin,dashicons",
|
||||
) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the standalone link to the Freemius Contact Form.
|
||||
*
|
||||
* @param Freemius $fs
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_standalone_link( Freemius $fs ) {
|
||||
$query_params = $this->get_query_params( $fs );
|
||||
|
||||
$query_params['is_standalone'] = 'true';
|
||||
$query_params['parent_url'] = admin_url( add_query_arg( null, null ) );
|
||||
|
||||
return WP_FS__ADDRESS . '/contact/?' . http_build_query( $query_params );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,508 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
* @copyright Copyright (c) 2024, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @package Freemius
|
||||
* @since 2.6.2
|
||||
*/
|
||||
|
||||
class FS_DebugManager {
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @since 1.0.8
|
||||
*/
|
||||
static function _add_debug_section() {
|
||||
if ( ! is_super_admin() ) {
|
||||
// Add debug page only for super-admins.
|
||||
return;
|
||||
}
|
||||
|
||||
Freemius::get_static_logger()->entrance();
|
||||
|
||||
$title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION );
|
||||
|
||||
if ( WP_FS__DEV_MODE ) {
|
||||
// Add top-level debug menu item.
|
||||
$hook = FS_Admin_Menu_Manager::add_page(
|
||||
$title,
|
||||
$title,
|
||||
'manage_options',
|
||||
'freemius',
|
||||
array( self::class, '_debug_page_render' )
|
||||
);
|
||||
} else {
|
||||
// Add hidden debug page.
|
||||
$hook = FS_Admin_Menu_Manager::add_subpage(
|
||||
'',
|
||||
$title,
|
||||
$title,
|
||||
'manage_options',
|
||||
'freemius',
|
||||
array( self::class, '_debug_page_render' )
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! empty( $hook ) ) {
|
||||
add_action( "load-$hook", array( self::class, '_debug_page_actions' ) );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @since 1.0.8
|
||||
*/
|
||||
static function _debug_page_actions() {
|
||||
Freemius::_clean_admin_content_section();
|
||||
|
||||
if ( fs_request_is_action( 'restart_freemius' ) ) {
|
||||
check_admin_referer( 'restart_freemius' );
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
// Clear accounts data.
|
||||
Freemius::get_accounts()->clear( null, true );
|
||||
} else {
|
||||
$sites = Freemius::get_sites();
|
||||
foreach ( $sites as $site ) {
|
||||
$blog_id = Freemius::get_site_blog_id( $site );
|
||||
Freemius::get_accounts()->clear( $blog_id, true );
|
||||
}
|
||||
|
||||
// Clear network level storage.
|
||||
Freemius::get_accounts()->clear( true, true );
|
||||
}
|
||||
|
||||
// Clear SDK reference cache.
|
||||
delete_option( 'fs_active_plugins' );
|
||||
} else if ( fs_request_is_action( 'clear_updates_data' ) ) {
|
||||
check_admin_referer( 'clear_updates_data' );
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
set_site_transient( 'update_plugins', null );
|
||||
set_site_transient( 'update_themes', null );
|
||||
} else {
|
||||
$current_blog_id = get_current_blog_id();
|
||||
|
||||
$sites = Freemius::get_sites();
|
||||
foreach ( $sites as $site ) {
|
||||
switch_to_blog( Freemius::get_site_blog_id( $site ) );
|
||||
|
||||
set_site_transient( 'update_plugins', null );
|
||||
set_site_transient( 'update_themes', null );
|
||||
}
|
||||
|
||||
switch_to_blog( $current_blog_id );
|
||||
}
|
||||
} else if ( fs_request_is_action( 'reset_deactivation_snoozing' ) ) {
|
||||
check_admin_referer( 'reset_deactivation_snoozing' );
|
||||
|
||||
Freemius::reset_deactivation_snoozing();
|
||||
} else if ( fs_request_is_action( 'simulate_trial' ) ) {
|
||||
check_admin_referer( 'simulate_trial' );
|
||||
|
||||
$fs = freemius( fs_request_get( 'module_id' ) );
|
||||
|
||||
// Update SDK install to at least 24 hours before.
|
||||
$fs->get_storage()->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC );
|
||||
// Unset the trial shown timestamp.
|
||||
unset( $fs->get_storage()->trial_promotion_shown );
|
||||
} else if ( fs_request_is_action( 'simulate_network_upgrade' ) ) {
|
||||
check_admin_referer( 'simulate_network_upgrade' );
|
||||
|
||||
$fs = freemius( fs_request_get( 'module_id' ) );
|
||||
|
||||
Freemius::set_network_upgrade_mode( $fs->get_storage() );
|
||||
} else if ( fs_request_is_action( 'delete_install' ) ) {
|
||||
check_admin_referer( 'delete_install' );
|
||||
|
||||
Freemius::_delete_site_by_slug(
|
||||
fs_request_get( 'slug' ),
|
||||
fs_request_get( 'module_type' ),
|
||||
true,
|
||||
fs_request_get( 'blog_id', null )
|
||||
);
|
||||
} else if ( fs_request_is_action( 'delete_user' ) ) {
|
||||
check_admin_referer( 'delete_user' );
|
||||
|
||||
self::delete_user( fs_request_get( 'user_id' ) );
|
||||
} else if ( fs_request_is_action( 'download_logs' ) ) {
|
||||
check_admin_referer( 'download_logs' );
|
||||
|
||||
$download_url = FS_Logger::download_db_logs(
|
||||
fs_request_get( 'filters', false, 'post' )
|
||||
);
|
||||
|
||||
if ( false === $download_url ) {
|
||||
wp_die( 'Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.' );
|
||||
}
|
||||
|
||||
fs_redirect( $download_url );
|
||||
} else if ( fs_request_is_action( 'migrate_options_to_network' ) ) {
|
||||
check_admin_referer( 'migrate_options_to_network' );
|
||||
|
||||
Freemius::migrate_options_to_network();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @since 1.0.8
|
||||
*/
|
||||
static function _debug_page_render() {
|
||||
Freemius::get_static_logger()->entrance();
|
||||
|
||||
$all_modules_sites = self::get_all_modules_sites();
|
||||
|
||||
$licenses_by_module_type = self::get_all_licenses_by_module_type();
|
||||
|
||||
$vars = array(
|
||||
'plugin_sites' => $all_modules_sites[ WP_FS__MODULE_TYPE_PLUGIN ],
|
||||
'theme_sites' => $all_modules_sites[ WP_FS__MODULE_TYPE_THEME ],
|
||||
'users' => Freemius::get_all_users(),
|
||||
'addons' => Freemius::get_all_addons(),
|
||||
'account_addons' => Freemius::get_all_account_addons(),
|
||||
'plugin_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_PLUGIN ],
|
||||
'theme_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_THEME ],
|
||||
);
|
||||
|
||||
fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' );
|
||||
fs_require_once_template( 'debug.php', $vars );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @since 1.2.1.6
|
||||
*/
|
||||
static function _get_debug_log() {
|
||||
check_admin_referer( 'fs_get_debug_log' );
|
||||
|
||||
if ( ! is_super_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!FS_Logger::is_storage_logging_on()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$limit = min( ! empty( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 200, 200 );
|
||||
$offset = min( ! empty( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 200, 200 );
|
||||
|
||||
$logs = FS_Logger::load_db_logs(
|
||||
fs_request_get( 'filters', false, 'post' ),
|
||||
$limit,
|
||||
$offset
|
||||
);
|
||||
|
||||
Freemius::shoot_ajax_success( $logs );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @since 1.2.1.7
|
||||
*/
|
||||
static function _get_db_option() {
|
||||
check_admin_referer( 'fs_get_db_option' );
|
||||
|
||||
$option_name = fs_request_get( 'option_name' );
|
||||
|
||||
if ( ! is_super_admin() ||
|
||||
! fs_starts_with( $option_name, 'fs_' )
|
||||
) {
|
||||
Freemius::shoot_ajax_failure();
|
||||
}
|
||||
|
||||
$value = get_option( $option_name );
|
||||
|
||||
$result = array(
|
||||
'name' => $option_name,
|
||||
);
|
||||
|
||||
if ( false !== $value ) {
|
||||
if ( ! is_string( $value ) ) {
|
||||
$value = json_encode( $value );
|
||||
}
|
||||
|
||||
$result['value'] = $value;
|
||||
}
|
||||
|
||||
Freemius::shoot_ajax_success( $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @since 1.2.1.7
|
||||
*/
|
||||
static function _set_db_option() {
|
||||
check_admin_referer( 'fs_set_db_option' );
|
||||
|
||||
$option_name = fs_request_get( 'option_name' );
|
||||
|
||||
if ( ! is_super_admin() ||
|
||||
! fs_starts_with( $option_name, 'fs_' )
|
||||
) {
|
||||
Freemius::shoot_ajax_failure();
|
||||
}
|
||||
|
||||
$option_value = fs_request_get_raw( 'option_value' );
|
||||
|
||||
if ( ! empty( $option_value ) ) {
|
||||
update_option( $option_name, $option_value );
|
||||
}
|
||||
|
||||
Freemius::shoot_ajax_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @since 1.1.7.3
|
||||
*/
|
||||
static function _toggle_debug_mode() {
|
||||
check_admin_referer( 'fs_toggle_debug_mode' );
|
||||
|
||||
if ( ! is_super_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$is_on = fs_request_get( 'is_on', false, 'post' );
|
||||
|
||||
if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
|
||||
if ( $is_on ) {
|
||||
self::_turn_on_debug_mode();
|
||||
} else {
|
||||
self::_turn_off_debug_mode();
|
||||
}
|
||||
|
||||
// Logic to turn debugging off automatically
|
||||
if ( 1 == $is_on ) {
|
||||
// Plan a single event triggering after 24 hours to turn debugging off.
|
||||
wp_schedule_single_event( time() + 24 * HOUR_IN_SECONDS, 'fs_debug_turn_off_logging_hook' );
|
||||
} else {
|
||||
// Cancels any planned event when debugging is turned off manually.
|
||||
$timestamp = wp_next_scheduled( 'fs_debug_turn_off_logging_hook' );
|
||||
if ( $timestamp ) {
|
||||
wp_unschedule_event( $timestamp, 'fs_debug_turn_off_logging_hook' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
* @since 2.6.2
|
||||
*
|
||||
*/
|
||||
static function _turn_off_debug_mode() {
|
||||
self::update_debug_mode_option( 0 );
|
||||
FS_Logger::_set_storage_logging( false );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
* @since 2.6.2
|
||||
*
|
||||
*/
|
||||
static function _turn_on_debug_mode() {
|
||||
self::update_debug_mode_option( 1 );
|
||||
FS_Logger::_set_storage_logging();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @param string $url
|
||||
* @param array $request
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
*/
|
||||
public static function enrich_request_for_debug( &$url, &$request ) {
|
||||
if ( WP_FS__DEBUG_SDK || isset( $_COOKIE['XDEBUG_SESSION'] ) ) {
|
||||
$url = add_query_arg( 'XDEBUG_SESSION_START', rand( 0, 9999999 ), $url );
|
||||
$url = add_query_arg( 'XDEBUG_SESSION', 'PHPSTORM', $url );
|
||||
|
||||
$request['cookies'] = array(
|
||||
new WP_Http_Cookie( array(
|
||||
'name' => 'XDEBUG_SESSION',
|
||||
'value' => 'PHPSTORM',
|
||||
) ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* Moved from Freemius
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
*/
|
||||
private static function get_all_licenses_by_module_type() {
|
||||
$licenses = Freemius::get_account_option( 'all_licenses' );
|
||||
|
||||
$licenses_by_module_type = array(
|
||||
WP_FS__MODULE_TYPE_PLUGIN => array(),
|
||||
WP_FS__MODULE_TYPE_THEME => array(),
|
||||
);
|
||||
|
||||
if ( ! is_array( $licenses ) ) {
|
||||
return $licenses_by_module_type;
|
||||
}
|
||||
|
||||
foreach ( $licenses as $module_id => $module_licenses ) {
|
||||
$fs = Freemius::get_instance_by_id( $module_id );
|
||||
if ( false === $fs ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$licenses_by_module_type[ $fs->get_module_type() ] = array_merge( $licenses_by_module_type[ $fs->get_module_type() ],
|
||||
$module_licenses );
|
||||
}
|
||||
|
||||
return $licenses_by_module_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moved from the Freemius class.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 2.5.0
|
||||
*/
|
||||
static function get_all_modules_sites() {
|
||||
Freemius::get_static_logger()->entrance();
|
||||
|
||||
$sites_by_type = array(
|
||||
WP_FS__MODULE_TYPE_PLUGIN => array(),
|
||||
WP_FS__MODULE_TYPE_THEME => array(),
|
||||
);
|
||||
|
||||
$module_types = array_keys( $sites_by_type );
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
foreach ( $module_types as $type ) {
|
||||
$sites_by_type[ $type ] = Freemius::get_all_sites( $type );
|
||||
|
||||
foreach ( $sites_by_type[ $type ] as $slug => $install ) {
|
||||
$sites_by_type[ $type ][ $slug ] = array( $install );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sites = Freemius::get_sites();
|
||||
|
||||
foreach ( $sites as $site ) {
|
||||
$blog_id = Freemius::get_site_blog_id( $site );
|
||||
|
||||
foreach ( $module_types as $type ) {
|
||||
$installs = Freemius::get_all_sites( $type, $blog_id );
|
||||
|
||||
foreach ( $installs as $slug => $install ) {
|
||||
if ( ! isset( $sites_by_type[ $type ][ $slug ] ) ) {
|
||||
$sites_by_type[ $type ][ $slug ] = array();
|
||||
}
|
||||
|
||||
$install->blog_id = $blog_id;
|
||||
|
||||
$sites_by_type[ $type ][ $slug ][] = $install;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $sites_by_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
*
|
||||
* @param number $user_id
|
||||
* @param bool $store
|
||||
*
|
||||
* @return false|int The user ID if deleted. Otherwise, FALSE (when install not exist).
|
||||
* @since 2.0.0
|
||||
*
|
||||
*/
|
||||
public static function delete_user( $user_id, $store = true ) {
|
||||
$users = Freemius::get_all_users();
|
||||
|
||||
if ( ! is_array( $users ) || ! isset( $users[ $user_id ] ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
unset( $users[ $user_id ] );
|
||||
|
||||
self::$_accounts->set_option( 'users', $users, $store );
|
||||
|
||||
return $user_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
*
|
||||
* @return void
|
||||
* @since 2.6.2
|
||||
*
|
||||
*/
|
||||
public static function load_required_static() {
|
||||
if ( ! WP_FS__DEMO_MODE ) {
|
||||
add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array(
|
||||
self::class,
|
||||
'_add_debug_section',
|
||||
) );
|
||||
}
|
||||
|
||||
add_action( "wp_ajax_fs_toggle_debug_mode", array( self::class, '_toggle_debug_mode' ) );
|
||||
|
||||
Freemius::add_ajax_action_static( 'get_debug_log', array( self::class, '_get_debug_log' ) );
|
||||
Freemius::add_ajax_action_static( 'get_db_option', array( self::class, '_get_db_option' ) );
|
||||
Freemius::add_ajax_action_static( 'set_db_option', array( self::class, '_set_db_option' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 2.6.2
|
||||
*/
|
||||
public static function register_hooks() {
|
||||
add_action( 'fs_debug_turn_off_logging_hook', array( self::class, '_turn_off_debug_mode' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
*
|
||||
* @param int $is_on
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 2.6.2
|
||||
*/
|
||||
private static function update_debug_mode_option( $is_on ) {
|
||||
update_option( 'fs_debug_mode', $is_on );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.1.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_GDPR_Manager {
|
||||
/**
|
||||
* @var FS_Option_Manager
|
||||
*/
|
||||
private $_storage;
|
||||
/**
|
||||
* @var array {
|
||||
* @type bool $required Are GDPR rules apply on the current context admin.
|
||||
* @type bool $show_opt_in_notice Should the marketing and offers opt-in message be shown to the admin or not. If not set, defaults to `true`.
|
||||
* @type int $notice_shown_at Last time the special GDPR opt-in message was shown to the current admin.
|
||||
* }
|
||||
*/
|
||||
private $_data;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $_wp_user_id;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_option_name;
|
||||
/**
|
||||
* @var FS_Admin_Notices
|
||||
*/
|
||||
private $_notices;
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Singleton
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @var FS_GDPR_Manager
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
/**
|
||||
* @return FS_GDPR_Manager
|
||||
*/
|
||||
public static function instance() {
|
||||
if ( ! isset( self::$_instance ) ) {
|
||||
self::$_instance = new self();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private function __construct() {
|
||||
$this->_storage = FS_Option_Manager::get_manager( WP_FS__GDPR_OPTION_NAME, true, true );
|
||||
$this->_wp_user_id = Freemius::get_current_wp_user_id();
|
||||
$this->_option_name = "u{$this->_wp_user_id}";
|
||||
$this->_data = $this->_storage->get_option( $this->_option_name, array() );
|
||||
$this->_notices = FS_Admin_Notices::instance( 'all_admins', '', '', true );
|
||||
|
||||
if ( ! is_array( $this->_data ) ) {
|
||||
$this->_data = array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a GDPR option for the current admin and store it.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
*/
|
||||
private function update_option( $name, $value ) {
|
||||
$this->_data[ $name ] = $value;
|
||||
|
||||
$this->_storage->set_option( $this->_option_name, $this->_data, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param bool $is_required
|
||||
*/
|
||||
public function store_is_required( $is_required ) {
|
||||
$this->update_option( 'required', $is_required );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the GDPR opt-in sticky notice is currently shown.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_opt_in_notice_shown() {
|
||||
return $this->_notices->has_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the GDPR opt-in sticky notice.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*/
|
||||
public function remove_opt_in_notice() {
|
||||
$this->_notices->remove_sticky( "gdpr_optin_actions_{$this->_wp_user_id}", true );
|
||||
|
||||
$this->disable_opt_in_notice();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents the opt-in message from being added/shown.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.1.0
|
||||
*/
|
||||
public function disable_opt_in_notice() {
|
||||
$this->update_option( 'show_opt_in_notice', false );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a GDPR opt-in message needs to be shown to the current admin.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function should_show_opt_in_notice() {
|
||||
return (
|
||||
! isset( $this->_data['show_opt_in_notice'] ) ||
|
||||
true === $this->_data['show_opt_in_notice']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last time the GDPR opt-in notice was shown.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @return false|int
|
||||
*/
|
||||
public function last_time_notice_was_shown() {
|
||||
return isset( $this->_data['notice_shown_at'] ) ?
|
||||
$this->_data['notice_shown_at'] :
|
||||
false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the timestamp of the last time the GDPR opt-in message was shown to now.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*/
|
||||
public function notice_was_just_shown() {
|
||||
$this->update_option( 'notice_shown_at', WP_FS__SCRIPT_START_TIME );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param string|null $plugin_title
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.1.0
|
||||
*/
|
||||
public function add_opt_in_sticky_notice( $message, $plugin_title = null ) {
|
||||
$this->_notices->add_sticky(
|
||||
$message,
|
||||
"gdpr_optin_actions_{$this->_wp_user_id}",
|
||||
'',
|
||||
'promotion',
|
||||
true,
|
||||
$this->_wp_user_id,
|
||||
$plugin_title,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,402 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.7
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class FS_Key_Value_Storage
|
||||
*
|
||||
* @property int $install_timestamp
|
||||
* @property int $activation_timestamp
|
||||
* @property int $sync_timestamp
|
||||
* @property object $sync_cron
|
||||
* @property int $install_sync_timestamp
|
||||
* @property array $connectivity_test
|
||||
* @property array $is_on
|
||||
* @property object $trial_plan
|
||||
* @property bool $has_trial_plan
|
||||
* @property bool $trial_promotion_shown
|
||||
* @property string $sdk_version
|
||||
* @property string $sdk_last_version
|
||||
* @property bool $sdk_upgrade_mode
|
||||
* @property bool $sdk_downgrade_mode
|
||||
* @property bool $plugin_upgrade_mode
|
||||
* @property bool $plugin_downgrade_mode
|
||||
* @property string $plugin_version
|
||||
* @property string $plugin_last_version
|
||||
* @property bool $is_plugin_new_install
|
||||
* @property bool $was_plugin_loaded
|
||||
* @property object $plugin_main_file
|
||||
* @property bool $prev_is_premium
|
||||
* @property array $is_anonymous
|
||||
* @property bool $is_pending_activation
|
||||
* @property bool $sticky_optin_added
|
||||
* @property object $uninstall_reason
|
||||
* @property object $subscription
|
||||
*/
|
||||
class FS_Key_Value_Storage implements ArrayAccess, Iterator, Countable {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_id;
|
||||
|
||||
/**
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_secondary_id;
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @var int The ID of the blog that is associated with the current site level options.
|
||||
*/
|
||||
private $_blog_id = 0;
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_multisite_storage;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_data;
|
||||
|
||||
/**
|
||||
* @var FS_Key_Value_Storage[]
|
||||
*/
|
||||
private static $_instances = array();
|
||||
|
||||
/**
|
||||
* @var FS_Logger
|
||||
*/
|
||||
protected $_logger;
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $secondary_id
|
||||
* @param bool $network_level_or_blog_id
|
||||
*
|
||||
* @return FS_Key_Value_Storage
|
||||
*/
|
||||
static function instance( $id, $secondary_id, $network_level_or_blog_id = false ) {
|
||||
$key = $id . ':' . $secondary_id;
|
||||
|
||||
if ( is_multisite() ) {
|
||||
if ( true === $network_level_or_blog_id ) {
|
||||
$key .= ':ms';
|
||||
} else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
|
||||
$key .= ":{$network_level_or_blog_id}";
|
||||
} else {
|
||||
$network_level_or_blog_id = get_current_blog_id();
|
||||
|
||||
$key .= ":{$network_level_or_blog_id}";
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( self::$_instances[ $key ] ) ) {
|
||||
self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id, $network_level_or_blog_id );
|
||||
}
|
||||
|
||||
return self::$_instances[ $key ];
|
||||
}
|
||||
|
||||
protected function __construct( $id, $secondary_id, $network_level_or_blog_id = false ) {
|
||||
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $secondary_id . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
||||
|
||||
$this->_id = $id;
|
||||
$this->_secondary_id = $secondary_id;
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$this->_is_multisite_storage = ( true === $network_level_or_blog_id );
|
||||
|
||||
if ( is_numeric( $network_level_or_blog_id ) ) {
|
||||
$this->_blog_id = $network_level_or_blog_id;
|
||||
}
|
||||
} else {
|
||||
$this->_is_multisite_storage = false;
|
||||
}
|
||||
|
||||
$this->load();
|
||||
}
|
||||
|
||||
protected function get_option_manager() {
|
||||
return FS_Option_Manager::get_manager(
|
||||
WP_FS__ACCOUNTS_OPTION_NAME,
|
||||
true,
|
||||
$this->_is_multisite_storage ?
|
||||
true :
|
||||
( $this->_blog_id > 0 ? $this->_blog_id : false )
|
||||
);
|
||||
}
|
||||
|
||||
protected function get_all_data() {
|
||||
return $this->get_option_manager()->get_option( $this->_id, array() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load plugin data from local DB.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*/
|
||||
function load() {
|
||||
$all_plugins_data = $this->get_all_data();
|
||||
$this->_data = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
|
||||
$all_plugins_data[ $this->_secondary_id ] :
|
||||
array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param bool $flush
|
||||
*/
|
||||
function store( $key, $value, $flush = true ) {
|
||||
if ( $this->_logger->is_on() ) {
|
||||
$this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
|
||||
}
|
||||
|
||||
if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
|
||||
// No need to store data if the value wasn't changed.
|
||||
return;
|
||||
}
|
||||
|
||||
$all_data = $this->get_all_data();
|
||||
|
||||
$this->_data[ $key ] = $value;
|
||||
|
||||
$all_data[ $this->_secondary_id ] = $this->_data;
|
||||
|
||||
$options_manager = $this->get_option_manager();
|
||||
$options_manager->set_option( $this->_id, $all_data, $flush );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function save() {
|
||||
$this->get_option_manager()->store();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param bool $store
|
||||
* @param string[] $exceptions Set of keys to keep and not clear.
|
||||
*/
|
||||
function clear_all( $store = true, $exceptions = array() ) {
|
||||
$new_data = array();
|
||||
foreach ( $exceptions as $key ) {
|
||||
if ( isset( $this->_data[ $key ] ) ) {
|
||||
$new_data[ $key ] = $this->_data[ $key ];
|
||||
}
|
||||
}
|
||||
|
||||
$this->_data = $new_data;
|
||||
|
||||
if ( $store ) {
|
||||
$all_data = $this->get_all_data();
|
||||
$all_data[ $this->_secondary_id ] = $this->_data;
|
||||
$options_manager = $this->get_option_manager();
|
||||
$options_manager->set_option( $this->_id, $all_data, true );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete key-value storage.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*/
|
||||
function delete() {
|
||||
$this->_data = array();
|
||||
|
||||
$all_data = $this->get_all_data();
|
||||
unset( $all_data[ $this->_secondary_id ] );
|
||||
$options_manager = $this->get_option_manager();
|
||||
$options_manager->set_option( $this->_id, $all_data, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param string $key
|
||||
* @param bool $store
|
||||
*/
|
||||
function remove( $key, $store = true ) {
|
||||
if ( ! array_key_exists( $key, $this->_data ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
unset( $this->_data[ $key ] );
|
||||
|
||||
if ( $store ) {
|
||||
$all_data = $this->get_all_data();
|
||||
$all_data[ $this->_secondary_id ] = $this->_data;
|
||||
$options_manager = $this->get_option_manager();
|
||||
$options_manager->set_option( $this->_id, $all_data, true );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
*
|
||||
* @return bool|\FS_Plugin
|
||||
*/
|
||||
function get( $key, $default = false ) {
|
||||
return array_key_exists( $key, $this->_data ) ?
|
||||
$this->_data[ $key ] :
|
||||
$default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_secondary_id() {
|
||||
return $this->_secondary_id;
|
||||
}
|
||||
|
||||
|
||||
/* ArrayAccess + Magic Access (better for refactoring)
|
||||
-----------------------------------------------------------------------------------*/
|
||||
function __set( $k, $v ) {
|
||||
$this->store( $k, $v );
|
||||
}
|
||||
|
||||
function __isset( $k ) {
|
||||
return array_key_exists( $k, $this->_data );
|
||||
}
|
||||
|
||||
function __unset( $k ) {
|
||||
$this->remove( $k );
|
||||
}
|
||||
|
||||
function __get( $k ) {
|
||||
return $this->get( $k, null );
|
||||
}
|
||||
|
||||
#[ReturnTypeWillChange]
|
||||
function offsetSet( $k, $v ) {
|
||||
if ( is_null( $k ) ) {
|
||||
throw new Exception( 'Can\'t append value to request params.' );
|
||||
} else {
|
||||
$this->{$k} = $v;
|
||||
}
|
||||
}
|
||||
|
||||
#[ReturnTypeWillChange]
|
||||
function offsetExists( $k ) {
|
||||
return array_key_exists( $k, $this->_data );
|
||||
}
|
||||
|
||||
#[ReturnTypeWillChange]
|
||||
function offsetUnset( $k ) {
|
||||
unset( $this->$k );
|
||||
}
|
||||
|
||||
#[ReturnTypeWillChange]
|
||||
function offsetGet( $k ) {
|
||||
return $this->get( $k, null );
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.0.0)<br/>
|
||||
* Return the current element
|
||||
*
|
||||
* @link http://php.net/manual/en/iterator.current.php
|
||||
* @return mixed Can return any type.
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function current() {
|
||||
return current( $this->_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.0.0)<br/>
|
||||
* Move forward to next element
|
||||
*
|
||||
* @link http://php.net/manual/en/iterator.next.php
|
||||
* @return void Any returned value is ignored.
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function next() {
|
||||
next( $this->_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.0.0)<br/>
|
||||
* Return the key of the current element
|
||||
*
|
||||
* @link http://php.net/manual/en/iterator.key.php
|
||||
* @return mixed scalar on success, or null on failure.
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function key() {
|
||||
return key( $this->_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.0.0)<br/>
|
||||
* Checks if current position is valid
|
||||
*
|
||||
* @link http://php.net/manual/en/iterator.valid.php
|
||||
* @return boolean The return value will be casted to boolean and then evaluated.
|
||||
* Returns true on success or false on failure.
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function valid() {
|
||||
$key = key( $this->_data );
|
||||
|
||||
return ( $key !== null && $key !== false );
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.0.0)<br/>
|
||||
* Rewind the Iterator to the first element
|
||||
*
|
||||
* @link http://php.net/manual/en/iterator.rewind.php
|
||||
* @return void Any returned value is ignored.
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function rewind() {
|
||||
reset( $this->_data );
|
||||
}
|
||||
|
||||
/**
|
||||
* (PHP 5 >= 5.1.0)<br/>
|
||||
* Count elements of an object
|
||||
*
|
||||
* @link http://php.net/manual/en/countable.count.php
|
||||
* @return int The custom count as an integer.
|
||||
* </p>
|
||||
* <p>
|
||||
* The return value is cast to an integer.
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function count() {
|
||||
return count( $this->_data );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.6
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_License_Manager /*extends FS_Abstract_Manager*/
|
||||
{
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * @var FS_License_Manager[]
|
||||
// */
|
||||
// private static $_instances = array();
|
||||
//
|
||||
// static function instance( Freemius $fs ) {
|
||||
// $slug = strtolower( $fs->get_slug() );
|
||||
//
|
||||
// if ( ! isset( self::$_instances[ $slug ] ) ) {
|
||||
// self::$_instances[ $slug ] = new FS_License_Manager( $slug, $fs );
|
||||
// }
|
||||
//
|
||||
// return self::$_instances[ $slug ];
|
||||
// }
|
||||
//
|
||||
//// private function __construct($slug) {
|
||||
//// parent::__construct($slug);
|
||||
//// }
|
||||
//
|
||||
// function entry_id() {
|
||||
// return 'licenses';
|
||||
// }
|
||||
//
|
||||
// function sync( $id ) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @author Vova Feldman (@svovaf)
|
||||
// * @since 1.0.5
|
||||
// * @uses FS_Api
|
||||
// *
|
||||
// * @param number|bool $plugin_id
|
||||
// *
|
||||
// * @return FS_Plugin_License[]|stdClass Licenses or API error.
|
||||
// */
|
||||
// function api_get_user_plugin_licenses( $plugin_id = false ) {
|
||||
// $api = $this->_fs->get_api_user_scope();
|
||||
//
|
||||
// if ( ! is_numeric( $plugin_id ) ) {
|
||||
// $plugin_id = $this->_fs->get_id();
|
||||
// }
|
||||
//
|
||||
// $result = $api->call( "/plugins/{$plugin_id}/licenses.json" );
|
||||
//
|
||||
// if ( ! isset( $result->error ) ) {
|
||||
// for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) {
|
||||
// $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] );
|
||||
// }
|
||||
//
|
||||
// $result = $result->licenses;
|
||||
// }
|
||||
//
|
||||
// return $result;
|
||||
// }
|
||||
//
|
||||
// function api_get_many() {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// function api_activate( $id ) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// function api_deactivate( $id ) {
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* @param FS_Plugin_License[] $licenses
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function has_premium_license( $licenses ) {
|
||||
if ( is_array( $licenses ) ) {
|
||||
foreach ( $licenses as $license ) {
|
||||
/**
|
||||
* @var FS_Plugin_License $license
|
||||
*/
|
||||
if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,476 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 2-layer lazy options manager.
|
||||
* layer 2: Memory
|
||||
* layer 1: Database (options table). All options stored as one option record in the DB to reduce number of DB queries.
|
||||
*
|
||||
* If load() is not explicitly called, starts as empty manager. Same thing about saving the data - you have to explicitly call store().
|
||||
*
|
||||
* Class Freemius_Option_Manager
|
||||
*/
|
||||
class FS_Option_Manager {
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $_id;
|
||||
/**
|
||||
* @var array|object
|
||||
*/
|
||||
private $_options;
|
||||
/**
|
||||
* @var FS_Logger
|
||||
*/
|
||||
private $_logger;
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @var int The ID of the blog that is associated with the current site level options.
|
||||
*/
|
||||
private $_blog_id = 0;
|
||||
|
||||
/**
|
||||
* @since 2.0.0
|
||||
* @var bool
|
||||
*/
|
||||
private $_is_network_storage;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private $_autoload;
|
||||
|
||||
/**
|
||||
* @var array[string]FS_Option_Manager {
|
||||
* @key string
|
||||
* @value FS_Option_Manager
|
||||
* }
|
||||
*/
|
||||
private static $_MANAGERS = array();
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @param string $id
|
||||
* @param bool $load
|
||||
* @param bool|int $network_level_or_blog_id Since 2.0.0
|
||||
* @param bool|null $autoload
|
||||
*/
|
||||
private function __construct(
|
||||
$id,
|
||||
$load = false,
|
||||
$network_level_or_blog_id = false,
|
||||
$autoload = null
|
||||
) {
|
||||
$id = strtolower( $id );
|
||||
|
||||
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_opt_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
||||
|
||||
$this->_logger->entrance();
|
||||
$this->_logger->log( 'id = ' . $id );
|
||||
|
||||
$this->_id = $id;
|
||||
|
||||
$this->_autoload = $autoload;
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$this->_is_network_storage = ( true === $network_level_or_blog_id );
|
||||
|
||||
if ( is_numeric( $network_level_or_blog_id ) ) {
|
||||
$this->_blog_id = $network_level_or_blog_id;
|
||||
}
|
||||
} else {
|
||||
$this->_is_network_storage = false;
|
||||
}
|
||||
|
||||
if ( $load ) {
|
||||
$this->load();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @param string $id
|
||||
* @param bool $load
|
||||
* @param bool|int $network_level_or_blog_id Since 2.0.0
|
||||
* @param bool|null $autoload
|
||||
*
|
||||
* @return \FS_Option_Manager
|
||||
*/
|
||||
static function get_manager(
|
||||
$id,
|
||||
$load = false,
|
||||
$network_level_or_blog_id = false,
|
||||
$autoload = null
|
||||
) {
|
||||
$key = strtolower( $id );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
if ( true === $network_level_or_blog_id ) {
|
||||
$key .= ':ms';
|
||||
} else if ( is_numeric( $network_level_or_blog_id ) && $network_level_or_blog_id > 0 ) {
|
||||
$key .= ":{$network_level_or_blog_id}";
|
||||
} else {
|
||||
$network_level_or_blog_id = get_current_blog_id();
|
||||
|
||||
$key .= ":{$network_level_or_blog_id}";
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( self::$_MANAGERS[ $key ] ) ) {
|
||||
self::$_MANAGERS[ $key ] = new FS_Option_Manager(
|
||||
$id,
|
||||
$load,
|
||||
$network_level_or_blog_id,
|
||||
$autoload
|
||||
);
|
||||
} // If load required but not yet loaded, load.
|
||||
else if ( $load && ! self::$_MANAGERS[ $key ]->is_loaded() ) {
|
||||
self::$_MANAGERS[ $key ]->load();
|
||||
}
|
||||
|
||||
return self::$_MANAGERS[ $key ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @param bool $flush
|
||||
*/
|
||||
function load( $flush = false ) {
|
||||
$this->_logger->entrance();
|
||||
|
||||
if ( ! $flush && isset( $this->_options ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isset( $this->_options ) ) {
|
||||
// Clear prev options.
|
||||
$this->clear();
|
||||
}
|
||||
|
||||
$option_name = $this->get_option_manager_name();
|
||||
|
||||
if ( $this->_is_network_storage ) {
|
||||
$this->_options = get_site_option( $option_name );
|
||||
} else if ( $this->_blog_id > 0 ) {
|
||||
$this->_options = get_blog_option( $this->_blog_id, $option_name );
|
||||
} else {
|
||||
$this->_options = get_option( $option_name );
|
||||
}
|
||||
|
||||
if ( is_string( $this->_options ) ) {
|
||||
$this->_options = json_decode( $this->_options );
|
||||
}
|
||||
|
||||
// $this->_logger->info('get_option = ' . var_export($this->_options, true));
|
||||
|
||||
if ( false === $this->_options ) {
|
||||
$this->clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_loaded() {
|
||||
return isset( $this->_options );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_empty() {
|
||||
return ( $this->is_loaded() && false === $this->_options );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @param bool $flush
|
||||
*/
|
||||
function clear( $flush = false ) {
|
||||
$this->_logger->entrance();
|
||||
|
||||
$this->_options = array();
|
||||
|
||||
if ( $flush ) {
|
||||
$this->store();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete options manager from DB.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*/
|
||||
function delete() {
|
||||
$option_name = $this->get_option_manager_name();
|
||||
|
||||
if ( $this->_is_network_storage ) {
|
||||
delete_site_option( $option_name );
|
||||
} else if ( $this->_blog_id > 0 ) {
|
||||
delete_blog_option( $this->_blog_id, $option_name );
|
||||
} else {
|
||||
delete_option( $option_name );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @param string $option
|
||||
* @param bool $flush
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_option( $option, $flush = false ) {
|
||||
if ( ! $this->is_loaded() || $flush ) {
|
||||
$this->load( $flush );
|
||||
}
|
||||
|
||||
return array_key_exists( $option, $this->_options );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @param string $option
|
||||
* @param mixed $default
|
||||
* @param bool $flush
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function get_option( $option, $default = null, $flush = false ) {
|
||||
$this->_logger->entrance( 'option = ' . $option );
|
||||
|
||||
if ( ! $this->is_loaded() || $flush ) {
|
||||
$this->load( $flush );
|
||||
}
|
||||
|
||||
if ( is_array( $this->_options ) ) {
|
||||
$value = isset( $this->_options[ $option ] ) ?
|
||||
$this->_options[ $option ] :
|
||||
$default;
|
||||
} else if ( is_object( $this->_options ) ) {
|
||||
$value = isset( $this->_options->{$option} ) ?
|
||||
$this->_options->{$option} :
|
||||
$default;
|
||||
} else {
|
||||
$value = $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* If it's an object, return a clone of the object, otherwise,
|
||||
* external changes of the object will actually change the value
|
||||
* of the object in the option manager which may lead to an unexpected
|
||||
* behaviour and data integrity when a store() call is triggered.
|
||||
*
|
||||
* Example:
|
||||
* $object1 = $options->get_option( 'object1' );
|
||||
* $object1->x = 123;
|
||||
*
|
||||
* $object2 = $options->get_option( 'object2' );
|
||||
* $object2->y = 'dummy';
|
||||
*
|
||||
* $options->set_option( 'object2', $object2, true );
|
||||
*
|
||||
* If we don't return a clone of option 'object1', setting 'object2'
|
||||
* will also store the updated value of 'object1' which is quite not
|
||||
* an expected behaviour.
|
||||
*
|
||||
* @author Vova Feldman
|
||||
*/
|
||||
return is_object( $value ) ? clone $value : $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @param string $option
|
||||
* @param mixed $value
|
||||
* @param bool $flush
|
||||
*/
|
||||
function set_option( $option, $value, $flush = false ) {
|
||||
$this->_logger->entrance( 'option = ' . $option );
|
||||
|
||||
if ( ! $this->is_loaded() ) {
|
||||
$this->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* If it's an object, store a clone of the object, otherwise,
|
||||
* external changes of the object will actually change the value
|
||||
* of the object in the options manager which may lead to an unexpected
|
||||
* behaviour and data integrity when a store() call is triggered.
|
||||
*
|
||||
* Example:
|
||||
* $object1 = new stdClass();
|
||||
* $object1->x = 123;
|
||||
*
|
||||
* $options->set_option( 'object1', $object1 );
|
||||
*
|
||||
* $object1->x = 456;
|
||||
*
|
||||
* $options->set_option( 'object2', $object2, true );
|
||||
*
|
||||
* If we don't set the option as a clone of option 'object1', setting 'object2'
|
||||
* will also store the updated value of 'object1' ($object1->x = 456 instead of
|
||||
* $object1->x = 123) which is quite not an expected behaviour.
|
||||
*
|
||||
* @author Vova Feldman
|
||||
*/
|
||||
$copy = is_object( $value ) ? clone $value : $value;
|
||||
|
||||
if ( is_array( $this->_options ) ) {
|
||||
$this->_options[ $option ] = $copy;
|
||||
} else if ( is_object( $this->_options ) ) {
|
||||
$this->_options->{$option} = $copy;
|
||||
}
|
||||
|
||||
if ( $flush ) {
|
||||
$this->store();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unset option.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @param string $option
|
||||
* @param bool $flush
|
||||
*/
|
||||
function unset_option( $option, $flush = false ) {
|
||||
$this->_logger->entrance( 'option = ' . $option );
|
||||
|
||||
if ( is_array( $this->_options ) ) {
|
||||
if ( ! isset( $this->_options[ $option ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
unset( $this->_options[ $option ] );
|
||||
|
||||
} else if ( is_object( $this->_options ) ) {
|
||||
if ( ! isset( $this->_options->{$option} ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
unset( $this->_options->{$option} );
|
||||
}
|
||||
|
||||
if ( $flush ) {
|
||||
$this->store();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dump options to database.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*/
|
||||
function store() {
|
||||
$this->_logger->entrance();
|
||||
|
||||
$option_name = $this->get_option_manager_name();
|
||||
|
||||
if ( $this->_logger->is_on() ) {
|
||||
$this->_logger->info( $option_name . ' = ' . var_export( $this->_options, true ) );
|
||||
}
|
||||
|
||||
// Update DB.
|
||||
if ( $this->_is_network_storage ) {
|
||||
update_site_option( $option_name, $this->_options );
|
||||
} else if ( $this->_blog_id > 0 ) {
|
||||
update_blog_option( $this->_blog_id, $option_name, $this->_options );
|
||||
} else {
|
||||
update_option( $option_name, $this->_options, $this->_autoload );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get options keys.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.3
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
function get_options_keys() {
|
||||
if ( is_array( $this->_options ) ) {
|
||||
return array_keys( $this->_options );
|
||||
} else if ( is_object( $this->_options ) ) {
|
||||
return array_keys( get_object_vars( $this->_options ) );
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Migration
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Migrate options from site level.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function migrate_to_network() {
|
||||
$site_options = FS_Option_Manager::get_manager($this->_id, true, false);
|
||||
|
||||
$options = is_object( $site_options->_options ) ?
|
||||
get_object_vars( $site_options->_options ) :
|
||||
$site_options->_options;
|
||||
|
||||
if ( ! empty( $options ) ) {
|
||||
foreach ( $options as $key => $val ) {
|
||||
$this->set_option( $key, $val, false );
|
||||
}
|
||||
|
||||
$this->store();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Helper Methods
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
private function get_option_manager_name() {
|
||||
return $this->_id;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,707 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2022, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 2.5.1
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is responsible for managing the user permissions.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 2.5.1
|
||||
*/
|
||||
class FS_Permission_Manager {
|
||||
/**
|
||||
* @var Freemius
|
||||
*/
|
||||
private $_fs;
|
||||
/**
|
||||
* @var FS_Storage
|
||||
*/
|
||||
private $_storage;
|
||||
|
||||
/**
|
||||
* @var array<number,self>
|
||||
*/
|
||||
private static $_instances = array();
|
||||
|
||||
const PERMISSION_USER = 'user';
|
||||
const PERMISSION_SITE = 'site';
|
||||
const PERMISSION_EVENTS = 'events';
|
||||
const PERMISSION_ESSENTIALS = 'essentials';
|
||||
const PERMISSION_DIAGNOSTIC = 'diagnostic';
|
||||
const PERMISSION_EXTENSIONS = 'extensions';
|
||||
const PERMISSION_NEWSLETTER = 'newsletter';
|
||||
|
||||
/**
|
||||
* @param Freemius $fs
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
static function instance( Freemius $fs ) {
|
||||
$id = $fs->get_id();
|
||||
|
||||
if ( ! isset( self::$_instances[ $id ] ) ) {
|
||||
self::$_instances[ $id ] = new self( $fs );
|
||||
}
|
||||
|
||||
return self::$_instances[ $id ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Freemius $fs
|
||||
*/
|
||||
protected function __construct( Freemius $fs ) {
|
||||
$this->_fs = $fs;
|
||||
$this->_storage = FS_Storage::instance( $fs->get_module_type(), $fs->get_slug() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
static function get_all_permission_ids() {
|
||||
return array(
|
||||
self::PERMISSION_USER,
|
||||
self::PERMISSION_SITE,
|
||||
self::PERMISSION_EVENTS,
|
||||
self::PERMISSION_ESSENTIALS,
|
||||
self::PERMISSION_DIAGNOSTIC,
|
||||
self::PERMISSION_EXTENSIONS,
|
||||
self::PERMISSION_NEWSLETTER,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
static function get_api_managed_permission_ids() {
|
||||
return array(
|
||||
self::PERMISSION_USER,
|
||||
self::PERMISSION_SITE,
|
||||
self::PERMISSION_EXTENSIONS,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $permission
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
static function is_supported_permission( $permission ) {
|
||||
return in_array( $permission, self::get_all_permission_ids() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.5.3
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_premium_context() {
|
||||
return ( $this->_fs->is_premium() || $this->_fs->can_use_premium_code() );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $is_license_activation
|
||||
* @param array[] $extra_permissions
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
function get_permissions( $is_license_activation, array $extra_permissions = array() ) {
|
||||
return $is_license_activation ?
|
||||
$this->get_license_activation_permissions( $extra_permissions ) :
|
||||
$this->get_opt_in_permissions( $extra_permissions );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Opt-In Permissions
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param array[] $extra_permissions
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
function get_opt_in_permissions(
|
||||
array $extra_permissions = array(),
|
||||
$load_default_from_storage = false,
|
||||
$is_optional = false
|
||||
) {
|
||||
$permissions = array_merge(
|
||||
$this->get_opt_in_required_permissions( $load_default_from_storage ),
|
||||
$this->get_opt_in_optional_permissions( $load_default_from_storage, $is_optional ),
|
||||
$extra_permissions
|
||||
);
|
||||
|
||||
return $this->get_sorted_permissions_by_priority( $permissions );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $load_default_from_storage
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
function get_opt_in_required_permissions( $load_default_from_storage = false ) {
|
||||
return array( $this->get_user_permission( $load_default_from_storage ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $load_default_from_storage
|
||||
* @param bool $is_optional
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
function get_opt_in_optional_permissions(
|
||||
$load_default_from_storage = false,
|
||||
$is_optional = false
|
||||
) {
|
||||
return array_merge(
|
||||
$this->get_opt_in_diagnostic_permissions( $load_default_from_storage, $is_optional ),
|
||||
array( $this->get_extensions_permission(
|
||||
false,
|
||||
false,
|
||||
$load_default_from_storage
|
||||
) )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $load_default_from_storage
|
||||
* @param bool $is_optional
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
function get_opt_in_diagnostic_permissions(
|
||||
$load_default_from_storage = false,
|
||||
$is_optional = false
|
||||
) {
|
||||
// Alias.
|
||||
$fs = $this->_fs;
|
||||
|
||||
$permissions = array();
|
||||
|
||||
$permissions[] = $this->get_permission(
|
||||
self::PERMISSION_SITE,
|
||||
'admin-links',
|
||||
$fs->get_text_inline( 'View Basic Website Info', 'permissions-site' ),
|
||||
$fs->get_text_inline( 'Homepage URL & title, WP & PHP versions, and site language', 'permissions-site_desc' ),
|
||||
sprintf(
|
||||
/* translators: %s: 'Plugin' or 'Theme' */
|
||||
$fs->get_text_inline( 'To provide additional functionality that\'s relevant to your website, avoid WordPress or PHP version incompatibilities that can break your website, and recognize which languages & regions the %s should be translated and tailored to.', 'permissions-site_tooltip' ),
|
||||
$fs->get_module_label( true )
|
||||
),
|
||||
10,
|
||||
$is_optional,
|
||||
true,
|
||||
$load_default_from_storage
|
||||
);
|
||||
|
||||
$permissions[] = $this->get_permission(
|
||||
self::PERMISSION_EVENTS,
|
||||
'admin-' . ( $fs->is_plugin() ? 'plugins' : 'appearance' ),
|
||||
sprintf( $fs->get_text_inline( 'View Basic %s Info', 'permissions-events' ), $fs->get_module_label() ),
|
||||
sprintf(
|
||||
/* translators: %s: 'Plugin' or 'Theme' */
|
||||
$fs->get_text_inline( 'Current %s & SDK versions, and if active or uninstalled', 'permissions-events_desc' ),
|
||||
$fs->get_module_label( true )
|
||||
),
|
||||
'',
|
||||
20,
|
||||
$is_optional,
|
||||
true,
|
||||
$load_default_from_storage
|
||||
);
|
||||
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region License Activation Permissions
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param array[] $extra_permissions
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
function get_license_activation_permissions(
|
||||
array $extra_permissions = array(),
|
||||
$include_optional_label = true
|
||||
) {
|
||||
$permissions = array_merge(
|
||||
$this->get_license_required_permissions(),
|
||||
$this->get_license_optional_permissions( $include_optional_label ),
|
||||
$extra_permissions
|
||||
);
|
||||
|
||||
return $this->get_sorted_permissions_by_priority( $permissions );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $load_default_from_storage
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
function get_license_required_permissions( $load_default_from_storage = false ) {
|
||||
// Alias.
|
||||
$fs = $this->_fs;
|
||||
|
||||
$permissions = array();
|
||||
|
||||
$permissions[] = $this->get_permission(
|
||||
self::PERMISSION_ESSENTIALS,
|
||||
'admin-links',
|
||||
$fs->get_text_inline( 'View License Essentials', 'permissions-essentials' ),
|
||||
$fs->get_text_inline(
|
||||
sprintf(
|
||||
/* translators: %s: 'Plugin' or 'Theme' */
|
||||
'Homepage URL, %s version, SDK version',
|
||||
$fs->get_module_label()
|
||||
),
|
||||
'permissions-essentials_desc'
|
||||
),
|
||||
sprintf(
|
||||
/* translators: %s: 'Plugin' or 'Theme' */
|
||||
$fs->get_text_inline( 'To let you manage & control where the license is activated and ensure %s security & feature updates are only delivered to websites you authorize.', 'permissions-essentials_tooltip' ),
|
||||
$fs->get_module_label( true )
|
||||
),
|
||||
10,
|
||||
false,
|
||||
true,
|
||||
$load_default_from_storage
|
||||
);
|
||||
|
||||
$permissions[] = $this->get_permission(
|
||||
self::PERMISSION_EVENTS,
|
||||
'admin-' . ( $fs->is_plugin() ? 'plugins' : 'appearance' ),
|
||||
sprintf( $fs->get_text_inline( 'View %s State', 'permissions-events' ), $fs->get_module_label() ),
|
||||
sprintf(
|
||||
/* translators: %s: 'Plugin' or 'Theme' */
|
||||
$fs->get_text_inline( 'Is active, deactivated, or uninstalled', 'permissions-events_desc-paid' ),
|
||||
$fs->get_module_label( true )
|
||||
),
|
||||
sprintf( $fs->get_text_inline( 'So you can reuse the license when the %s is no longer active.', 'permissions-events_tooltip' ), $fs->get_module_label( true ) ),
|
||||
20,
|
||||
false,
|
||||
true,
|
||||
$load_default_from_storage
|
||||
);
|
||||
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
*/
|
||||
function get_license_optional_permissions(
|
||||
$include_optional_label = false,
|
||||
$load_default_from_storage = false
|
||||
) {
|
||||
return array(
|
||||
$this->get_diagnostic_permission( $include_optional_label, $load_default_from_storage ),
|
||||
$this->get_extensions_permission( true, $include_optional_label, $load_default_from_storage ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $include_optional_label
|
||||
* @param bool $load_default_from_storage
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_diagnostic_permission(
|
||||
$include_optional_label = false,
|
||||
$load_default_from_storage = false
|
||||
) {
|
||||
return $this->get_permission(
|
||||
self::PERMISSION_DIAGNOSTIC,
|
||||
'wordpress-alt',
|
||||
$this->_fs->get_text_inline( 'View Diagnostic Info', 'permissions-diagnostic' ) . ( $include_optional_label ? ' (' . $this->_fs->get_text_inline( 'optional' ) . ')' : '' ),
|
||||
$this->_fs->get_text_inline( 'WordPress & PHP versions, site language & title', 'permissions-diagnostic_desc' ),
|
||||
sprintf(
|
||||
/* translators: %s: 'Plugin' or 'Theme' */
|
||||
$this->_fs->get_text_inline( 'To avoid breaking your website due to WordPress or PHP version incompatibilities, and recognize which languages & regions the %s should be translated and tailored to.', 'permissions-diagnostic_tooltip' ),
|
||||
$this->_fs->get_module_label( true )
|
||||
),
|
||||
25,
|
||||
true,
|
||||
true,
|
||||
$load_default_from_storage
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Common Permissions
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param bool $is_license_activation
|
||||
* @param bool $include_optional_label
|
||||
* @param bool $load_default_from_storage
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_extensions_permission(
|
||||
$is_license_activation,
|
||||
$include_optional_label = false,
|
||||
$load_default_from_storage = false
|
||||
) {
|
||||
$is_on_by_default = ! $is_license_activation;
|
||||
|
||||
return $this->get_permission(
|
||||
self::PERMISSION_EXTENSIONS,
|
||||
'block-default',
|
||||
$this->_fs->get_text_inline( 'View Plugins & Themes List', 'permissions-extensions' ) . ( $is_license_activation ? ( $include_optional_label ? ' (' . $this->_fs->get_text_inline( 'optional' ) . ')' : '' ) : '' ),
|
||||
$this->_fs->get_text_inline( 'Names, slugs, versions, and if active or not', 'permissions-extensions_desc' ),
|
||||
$this->_fs->get_text_inline( 'To ensure compatibility and avoid conflicts with your installed plugins and themes.', 'permissions-events_tooltip' ),
|
||||
25,
|
||||
true,
|
||||
$is_on_by_default,
|
||||
$load_default_from_storage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $load_default_from_storage
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_user_permission( $load_default_from_storage = false ) {
|
||||
return $this->get_permission(
|
||||
self::PERMISSION_USER,
|
||||
'admin-users',
|
||||
$this->_fs->get_text_inline( 'View Basic Profile Info', 'permissions-profile' ),
|
||||
$this->_fs->get_text_inline( 'Your WordPress user\'s: first & last name, and email address', 'permissions-profile_desc' ),
|
||||
$this->_fs->get_text_inline( 'Never miss important updates, get security warnings before they become public knowledge, and receive notifications about special offers and awesome new features.', 'permissions-profile_tooltip' ),
|
||||
5,
|
||||
false,
|
||||
true,
|
||||
$load_default_from_storage
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Optional Permissions
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
*/
|
||||
function get_newsletter_permission() {
|
||||
return $this->get_permission(
|
||||
self::PERMISSION_NEWSLETTER,
|
||||
'email-alt',
|
||||
$this->_fs->get_text_inline( 'Newsletter', 'permissions-newsletter' ),
|
||||
$this->_fs->get_text_inline( 'Updates, announcements, marketing, no spam', 'permissions-newsletter_desc' ),
|
||||
'',
|
||||
15
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Permissions Storage
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_extensions_tracking_allowed( $blog_id = null ) {
|
||||
return $this->is_permission_allowed( self::PERMISSION_EXTENSIONS, ! $this->_fs->is_premium(), $blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_essentials_tracking_allowed( $blog_id = null ) {
|
||||
return $this->is_permission_allowed( self::PERMISSION_ESSENTIALS, true, $blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $default
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_diagnostic_tracking_allowed( $default = true ) {
|
||||
return $this->is_premium_context() ?
|
||||
$this->is_permission_allowed( self::PERMISSION_DIAGNOSTIC, $default ) :
|
||||
$this->is_permission_allowed( self::PERMISSION_SITE, $default );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_homepage_url_tracking_allowed( $blog_id = null ) {
|
||||
return $this->is_permission_allowed( $this->get_site_permission_name(), true, $blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function update_site_tracking( $is_enabled, $blog_id = null, $only_if_not_set = false ) {
|
||||
$permissions = $this->get_site_tracking_permission_names();
|
||||
|
||||
$result = true;
|
||||
foreach ( $permissions as $permission ) {
|
||||
if ( ! $only_if_not_set || ! $this->is_permission_set( $permission, $blog_id ) ) {
|
||||
$result = ( $result && $this->update_permission_tracking_flag( $permission, $is_enabled, $blog_id ) );
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $permission
|
||||
* @param bool $default
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_permission_allowed( $permission, $default = false, $blog_id = null ) {
|
||||
if ( ! self::is_supported_permission( $permission ) ) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
return $this->is_permission( $permission, true, $blog_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $permission
|
||||
* @param bool $is_allowed
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_permission( $permission, $is_allowed, $blog_id = null ) {
|
||||
if ( ! self::is_supported_permission( $permission ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$tag = "is_{$permission}_tracking_allowed";
|
||||
|
||||
return ( $is_allowed === $this->_fs->apply_filters(
|
||||
$tag,
|
||||
$this->_storage->get(
|
||||
$tag,
|
||||
$this->get_permission_default( $permission ),
|
||||
$blog_id,
|
||||
FS_Storage::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED
|
||||
)
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $permission
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_permission_set( $permission, $blog_id = null ) {
|
||||
$tag = "is_{$permission}_tracking_allowed";
|
||||
|
||||
$permission = $this->_storage->get(
|
||||
$tag,
|
||||
null,
|
||||
$blog_id,
|
||||
FS_Storage::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED
|
||||
);
|
||||
|
||||
return is_bool( $permission );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $permissions
|
||||
* @param bool $is_allowed
|
||||
*
|
||||
* @return bool `true` if all given permissions are in sync with `$is_allowed`.
|
||||
*/
|
||||
function are_permissions( $permissions, $is_allowed, $blog_id = null ) {
|
||||
foreach ( $permissions as $permission ) {
|
||||
if ( ! $this->is_permission( $permission, $is_allowed, $blog_id ) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $permission
|
||||
* @param bool $is_enabled
|
||||
* @param int|null $blog_id
|
||||
*
|
||||
* @return bool `false` if permission not supported or `$is_enabled` is not a boolean.
|
||||
*/
|
||||
function update_permission_tracking_flag( $permission, $is_enabled, $blog_id = null ) {
|
||||
if ( is_bool( $is_enabled ) && self::is_supported_permission( $permission ) ) {
|
||||
$this->_storage->store(
|
||||
"is_{$permission}_tracking_allowed",
|
||||
$is_enabled,
|
||||
$blog_id,
|
||||
FS_Storage::OPTION_LEVEL_NETWORK_ACTIVATED_NOT_DELEGATED
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string,bool> $permissions
|
||||
*/
|
||||
function update_permissions_tracking_flag( $permissions ) {
|
||||
foreach ( $permissions as $permission => $is_enabled ) {
|
||||
$this->update_permission_tracking_flag( $permission, $is_enabled );
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/**
|
||||
* @param string $permission
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function get_permission_default( $permission ) {
|
||||
if (
|
||||
$this->_fs->is_premium() &&
|
||||
self::PERMISSION_EXTENSIONS === $permission
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// All permissions except for the extensions in paid version are on by default when the user opts in to usage tracking.
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function get_site_permission_name() {
|
||||
return $this->is_premium_context() ?
|
||||
self::PERMISSION_ESSENTIALS :
|
||||
self::PERMISSION_SITE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
function get_site_tracking_permission_names() {
|
||||
return $this->is_premium_context() ?
|
||||
array(
|
||||
FS_Permission_Manager::PERMISSION_ESSENTIALS,
|
||||
FS_Permission_Manager::PERMISSION_EVENTS,
|
||||
) :
|
||||
array( FS_Permission_Manager::PERMISSION_SITE );
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Rendering
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param array $permission
|
||||
*/
|
||||
function render_permission( array $permission ) {
|
||||
fs_require_template( 'connect/permission.php', $permission );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $permissions_group
|
||||
*/
|
||||
function render_permissions_group( array $permissions_group ) {
|
||||
$permissions_group[ 'fs' ] = $this->_fs;
|
||||
|
||||
fs_require_template( 'connect/permissions-group.php', $permissions_group );
|
||||
}
|
||||
|
||||
function require_permissions_js() {
|
||||
fs_require_once_template( 'js/permissions.php', $params );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
#region Helper Methods
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @param string $dashicon
|
||||
* @param string $label
|
||||
* @param string $desc
|
||||
* @param string $tooltip
|
||||
* @param int $priority
|
||||
* @param bool $is_optional
|
||||
* @param bool $is_on_by_default
|
||||
* @param bool $load_from_storage
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function get_permission(
|
||||
$id,
|
||||
$dashicon,
|
||||
$label,
|
||||
$desc,
|
||||
$tooltip = '',
|
||||
$priority = 10,
|
||||
$is_optional = false,
|
||||
$is_on_by_default = true,
|
||||
$load_from_storage = false
|
||||
) {
|
||||
$is_on = $load_from_storage ?
|
||||
$this->is_permission_allowed( $id, $is_on_by_default ) :
|
||||
$is_on_by_default;
|
||||
|
||||
return array(
|
||||
'id' => $id,
|
||||
'icon-class' => $this->_fs->apply_filters( "permission_{$id}_icon", "dashicons dashicons-{$dashicon}" ),
|
||||
'label' => $this->_fs->apply_filters( "permission_{$id}_label", $label ),
|
||||
'tooltip' => $this->_fs->apply_filters( "permission_{$id}_tooltip", $tooltip ),
|
||||
'desc' => $this->_fs->apply_filters( "permission_{$id}_desc", $desc ),
|
||||
'priority' => $this->_fs->apply_filters( "permission_{$id}_priority", $priority ),
|
||||
'optional' => $is_optional,
|
||||
'default' => $this->_fs->apply_filters( "permission_{$id}_default", $is_on ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $permissions
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
private function get_sorted_permissions_by_priority( array $permissions ) {
|
||||
// Allow filtering of the permissions list.
|
||||
$permissions = $this->_fs->apply_filters( 'permission_list', $permissions );
|
||||
|
||||
// Sort by priority.
|
||||
uasort( $permissions, 'fs_sort_by_priority' );
|
||||
|
||||
return $permissions;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.6
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Plan_Manager {
|
||||
/**
|
||||
* @var FS_Plan_Manager
|
||||
*/
|
||||
private static $_instance;
|
||||
|
||||
/**
|
||||
* @return FS_Plan_Manager
|
||||
*/
|
||||
static function instance() {
|
||||
if ( ! isset( self::$_instance ) ) {
|
||||
self::$_instance = new FS_Plan_Manager();
|
||||
}
|
||||
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
private function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FS_Plugin_License[] $licenses
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_premium_license( $licenses ) {
|
||||
if ( is_array( $licenses ) ) {
|
||||
/**
|
||||
* @var FS_Plugin_License[] $licenses
|
||||
*/
|
||||
foreach ( $licenses as $license ) {
|
||||
if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if plugin has any paid plans.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param FS_Plugin_Plan[] $plans
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_paid_plan( $plans ) {
|
||||
if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var FS_Plugin_Plan[] $plans
|
||||
*/
|
||||
for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
|
||||
if ( ! $plans[ $i ]->is_free() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if plugin has any free plan, or is it premium only.
|
||||
*
|
||||
* Note: If no plans configured, assume plugin is free.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.7
|
||||
*
|
||||
* @param FS_Plugin_Plan[] $plans
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_free_plan( $plans ) {
|
||||
if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var FS_Plugin_Plan[] $plans
|
||||
*/
|
||||
for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
|
||||
if ( $plans[ $i ]->is_free() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all plans that have trial.
|
||||
* Since 2.6.2 call get_filtered_plan
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param FS_Plugin_Plan[] $plans
|
||||
*
|
||||
* @return FS_Plugin_Plan[]
|
||||
*/
|
||||
function get_trial_plans( $plans ) {
|
||||
return $this->get_filtered_plans( $plans, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all plans that are not hidden and have trial.
|
||||
*
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
*
|
||||
* @param FS_Plugin_Plan[] $plans
|
||||
*
|
||||
* @return FS_Plugin_Plan[]
|
||||
* @since 2.6.3
|
||||
*
|
||||
*/
|
||||
function get_visible_trial_plans( $plans ) {
|
||||
return $this->get_filtered_plans( $plans, true, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all plans filtered by trial or visibility.
|
||||
*
|
||||
* @author Daniele Alessandra (@danielealessandra)
|
||||
*
|
||||
* @param FS_Plugin_Plan[] $plans
|
||||
* @param boolean $should_have_trials
|
||||
* @param boolean $should_be_visible
|
||||
*
|
||||
* @return FS_Plugin_Plan[]
|
||||
* @since 2.6.3
|
||||
*
|
||||
*/
|
||||
function get_filtered_plans( $plans, $should_have_trials = false, $should_be_visible = false ) {
|
||||
$filtered_plans = array();
|
||||
|
||||
if ( is_array( $plans ) && count( $plans ) > 0 ) {
|
||||
foreach ( $plans as $plan ) {
|
||||
if ( ( $should_have_trials && ! $plan->has_trial() ) || ( $should_be_visible && $plan->is_hidden ) ) {
|
||||
continue;
|
||||
}
|
||||
$filtered_plans[] = $plan;
|
||||
}
|
||||
}
|
||||
|
||||
return $filtered_plans;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if plugin has any trial plan.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.9
|
||||
*
|
||||
* @param FS_Plugin_Plan[] $plans
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function has_trial_plan( $plans ) {
|
||||
if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var FS_Plugin_Plan[] $plans
|
||||
*/
|
||||
for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
|
||||
if ( $plans[ $i ]->has_trial() ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Freemius
|
||||
* @copyright Copyright (c) 2015, Freemius, Inc.
|
||||
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
||||
* @since 1.0.6
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class FS_Plugin_Manager {
|
||||
/**
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var string|number
|
||||
*/
|
||||
protected $_module_id;
|
||||
/**
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var FS_Plugin
|
||||
*/
|
||||
protected $_module;
|
||||
|
||||
/**
|
||||
* @var FS_Plugin_Manager[]
|
||||
*/
|
||||
private static $_instances = array();
|
||||
/**
|
||||
* @var FS_Logger
|
||||
*/
|
||||
protected $_logger;
|
||||
|
||||
/**
|
||||
* Option names
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.2
|
||||
*/
|
||||
const OPTION_NAME_PLUGINS = 'plugins';
|
||||
const OPTION_NAME_THEMES = 'themes';
|
||||
|
||||
/**
|
||||
* @param string|number $module_id
|
||||
*
|
||||
* @return FS_Plugin_Manager
|
||||
*/
|
||||
static function instance( $module_id ) {
|
||||
$key = 'm_' . $module_id;
|
||||
|
||||
if ( ! isset( self::$_instances[ $key ] ) ) {
|
||||
self::$_instances[ $key ] = new FS_Plugin_Manager( $module_id );
|
||||
}
|
||||
|
||||
return self::$_instances[ $key ];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|number $module_id
|
||||
*/
|
||||
protected function __construct( $module_id ) {
|
||||
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_' . 'plugins', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
||||
$this->_module_id = $module_id;
|
||||
|
||||
$this->load();
|
||||
}
|
||||
|
||||
protected function get_option_manager() {
|
||||
return FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @param string|bool $module_type "plugin", "theme", or "false" for all modules.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_all_modules( $module_type = false ) {
|
||||
$option_manager = $this->get_option_manager();
|
||||
|
||||
if ( false !== $module_type ) {
|
||||
return fs_get_entities( $option_manager->get_option( $module_type . 's', array() ), FS_Plugin::get_class_name() );
|
||||
}
|
||||
|
||||
return array(
|
||||
self::OPTION_NAME_PLUGINS => fs_get_entities( $option_manager->get_option( self::OPTION_NAME_PLUGINS, array() ), FS_Plugin::get_class_name() ),
|
||||
self::OPTION_NAME_THEMES => fs_get_entities( $option_manager->get_option( self::OPTION_NAME_THEMES, array() ), FS_Plugin::get_class_name() ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load plugin data from local DB.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*/
|
||||
function load() {
|
||||
$all_modules = $this->get_all_modules();
|
||||
|
||||
if ( ! is_numeric( $this->_module_id ) ) {
|
||||
unset( $all_modules[ self::OPTION_NAME_THEMES ] );
|
||||
}
|
||||
|
||||
foreach ( $all_modules as $modules ) {
|
||||
/**
|
||||
* @since 1.2.2
|
||||
*
|
||||
* @var $modules FS_Plugin[]
|
||||
*/
|
||||
foreach ( $modules as $module ) {
|
||||
$found_module = false;
|
||||
|
||||
/**
|
||||
* If module ID is not numeric, it must be a plugin's slug.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 1.2.2
|
||||
*/
|
||||
if ( ! is_numeric( $this->_module_id ) ) {
|
||||
if ( $this->_module_id === $module->slug ) {
|
||||
$this->_module_id = $module->id;
|
||||
$found_module = true;
|
||||
}
|
||||
} else if ( $this->_module_id == $module->id ) {
|
||||
$found_module = true;
|
||||
}
|
||||
|
||||
if ( $found_module ) {
|
||||
$this->_module = $module;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store plugin on local DB.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @param bool|FS_Plugin $module
|
||||
* @param bool $flush
|
||||
*
|
||||
* @return bool|\FS_Plugin
|
||||
*/
|
||||
function store( $module = false, $flush = true ) {
|
||||
if ( false !== $module ) {
|
||||
$this->_module = $module;
|
||||
}
|
||||
|
||||
$all_modules = $this->get_all_modules( $this->_module->type );
|
||||
$all_modules[ $this->_module->slug ] = $this->_module;
|
||||
|
||||
$options_manager = $this->get_option_manager();
|
||||
$options_manager->set_option( $this->_module->type . 's', $all_modules, $flush );
|
||||
|
||||
return $this->_module;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update local plugin data if different.
|
||||
*
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @param \FS_Plugin $plugin
|
||||
* @param bool $store
|
||||
*
|
||||
* @return bool True if plugin was updated.
|
||||
*/
|
||||
function update( FS_Plugin $plugin, $store = true ) {
|
||||
if ( ! ($this->_module instanceof FS_Plugin ) ||
|
||||
$this->_module->slug != $plugin->slug ||
|
||||
$this->_module->public_key != $plugin->public_key ||
|
||||
$this->_module->secret_key != $plugin->secret_key ||
|
||||
$this->_module->parent_plugin_id != $plugin->parent_plugin_id ||
|
||||
$this->_module->title != $plugin->title
|
||||
) {
|
||||
$this->store( $plugin, $store );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @param FS_Plugin $plugin
|
||||
* @param bool $store
|
||||
*/
|
||||
function set( FS_Plugin $plugin, $store = false ) {
|
||||
$this->_module = $plugin;
|
||||
|
||||
if ( $store ) {
|
||||
$this->store();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Vova Feldman (@svovaf)
|
||||
* @since 1.0.6
|
||||
*
|
||||
* @return bool|\FS_Plugin
|
||||
*/
|
||||
function get() {
|
||||
if ( isset( $this->_module ) ) {
|
||||
return $this->_module;
|
||||
}
|
||||
|
||||
if ( empty( $this->_module_id ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an FS_Plugin entity that has its `id` and `is_live` properties set (`is_live` is initialized in the FS_Plugin constructor) to avoid triggering an error that is relevant to these properties when the FS_Plugin entity is used before the `parse_settings()` method is called. This can happen when creating a regular WordPress site by cloning a subsite of a multisite network and the data that is stored in the network-level storage is not cloned.
|
||||
*
|
||||
* @author Leo Fajardo (@leorw)
|
||||
* @since 2.5.0
|
||||
*/
|
||||
$plugin = new FS_Plugin();
|
||||
$plugin->id = $this->_module_id;
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
// Silence is golden.
|
||||
// Hide file structure from users on unprotected servers.
|
||||